Oh I misunderstood the question. We do have a way of stuffing higher frequency data into the .fit file from Connect IQ. We put the timestamp and the sensor data into an array. See the Fit Contributor code below.
Then we have a script in an Activity Chart in Intervals.icu that upacks the arrays. That script is pasted below the Fit Contributor code.
using Toybox.Application as App;
using Toybox.WatchUi as Ui;
using Toybox.System as Sys;
using Toybox.FitContributor as Fit;
import Toybox.Application.Storage;
const TIME_FIELD_ID = 0;
const SMO2_FIELD_ID = 1;
const THB_FIELD_ID = 2;
const DEVICE_INFO_ID = 3;
const TAGS_FIELD_ID = 4;
// format and units for displaying SmO2 data
const G_currentHemoPercentUnits = Ui.loadResource(Rez.Strings.smo2_units);
const G_currentHemoPercentLabel = Ui.loadResource(Rez.Strings.smo2_label);
// format and units for displaying THb data
const G_totalHemoConcentrationUnits = Ui.loadResource(Rez.Strings.thb_units);
const G_totalHemoConcentrationLabel = Ui.loadResource(Rez.Strings.thb_label);
const G_AppSensor = Ui.loadResource(Rez.Strings.AppSensor);
class MO2FitContributor {
// FIT Contributions variables
hidden var mTime = null;
hidden var mSmO2 = null;
hidden var mThb = null;
hidden var mDeviceInfo = null;
hidden var mTags = null;
hidden var mArraySize = 21;
hidden var tagFieldName = "MoxyTags"; // Field name recognized by Intervals.icu
hidden var tags = "MoxyTenHz"; // Multiple tags are space delimited
hidden var tagLength = tags.length() + 1;
// Constructor
function initialize(activity) {
var location = Storage.getValue("SensorLx").toNumber();
if (location > Glocations.size()-1 or location < 0 or location == null) {
location = Glocations.size()-1;
}
var label = " Sensor " + Storage.getValue("SensorId").toString() + " on " + Ui.loadResource(Glocations[location]);
mTime = activity.createField(G_AppSensor + " " + "Time" + label, TIME_FIELD_ID, Fit.DATA_TYPE_UINT32, { :count=>mArraySize, :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"msec" });
mSmO2 = activity.createField(G_AppSensor + " " + G_currentHemoPercentLabel + label, SMO2_FIELD_ID, Fit.DATA_TYPE_FLOAT, { :count=>mArraySize, :mesgType=>Fit.MESG_TYPE_RECORD, :units=>G_currentHemoPercentUnits });
mThb = activity.createField(G_AppSensor + " " + G_totalHemoConcentrationLabel + label, THB_FIELD_ID, Fit.DATA_TYPE_FLOAT, { :count=>mArraySize, :mesgType=>Fit.MESG_TYPE_RECORD, :units=>G_totalHemoConcentrationUnits });
mDeviceInfo = activity.createField("CIQ_device_info", DEVICE_INFO_ID, Fit.DATA_TYPE_UINT8, { :count=>8, :mesgType=>Fit.MESG_TYPE_SESSION });
mTags = activity.createField(tagFieldName, TAGS_FIELD_ID, FitContributor.DATA_TYPE_STRING, { :count=>tagLength, :mesgType=>FitContributor.MESG_TYPE_SESSION });
mSmO2.setData(0);
mThb.setData(0);
mTags.setData(tags);
}
function compute(sensor) {
if( sensor != null ) {
var time = new[sensor.data.iSize];
var smo2 = new[sensor.data.iSize];
var thb = new[sensor.data.iSize];
var j;
var buffer_end = false;
for (var i = 0; i < sensor.data.iSize; i++){
j = (i + sensor.data.iTail) % (sensor.data.iSize + 1);
if (j == sensor.data.iHead ) {
buffer_end = true;
}
if (!buffer_end) {
time[i] = sensor.data.timeBuffer[j];
smo2[i] = sensor.data.smo2Buffer[j];
thb[i] = sensor.data.thbBuffer[j];
}
else {
time[i] = 0;
smo2[i] = 0;
thb[i] = 0;
}
}
mTime.setData(time);
mSmO2.setData(smo2);
mThb.setData(thb);
}
}
function setDeviceInfo(sensor_position, serial_number, manufacturer) {
mDeviceInfo.setData([31,sensor_position,(serial_number),(serial_number >> 8),(serial_number >> 16),(serial_number >> 24),(manufacturer),(manufacturer >> 8)]);
}
}
{
// version 0.1.0 April 29, 2025
const activity = icu.activity
const itags = activity.tags || \[\];
if (itags.includes('MoxyTenHz')) {
let Time_array = icu.streams.TenHzTime;
let SmO2_array = icu.streams.TenHzSmO2;
let THb_array = icu.streams.TenHzTHb;
let time = \[\];
let smo2 = \[\];
let maxtime = 0;
for (let i = 0; i < Time_array.length; i++) {
const timerow = Time_array\[i\];
if (timerow != null) {
const smo2row = SmO2_array\[i\];
for (let j = 0; j < timerow.length; j++) {
if (timerow\[j\] / 1000 > maxtime) {
maxtime = timerow\[j\] / 1000;
time.push(timerow\[j\] / 1000);
smo2.push(smo2row\[j\]);
console.log(timerow\[j\] + "," + smo2row\[j\].toFixed(1));
}
}
}
}
let data = \[
{ // Plot the segmented fit as lines
x: time,
y: smo2,
mode: 'lines',
type: 'scatter',
name: 'Fitted Lines',
marker: {
color: '#202020',
opacity: 1
}
},
\]
let layout = {
title: {
text: "SmO2 Graph",
font: {
size: 36,
color: '#000000'
}
},
xaxis: {
title: 'Time (Seconds)',
font: {
size: 24,
color: '#828282'
}
},
yaxis: {
title: 'SmO2 (%)',
font: {
size: 24,
color: '#828282'
}
},
images: \[
{
x: 0.9,
y: 1.05,
sizex: 0.15,
sizey: 0.15,
source: "https://www.moxymonitor.com/wp-content/uploads/Moxy-tagline-logo.png",
xanchor: "right",
xref: "paper",
yanchor: "bottom",
yref: "paper"
}
\],
margin: {
l: 40,
r: 20,
t: 75,
b: 40
},
}
chart = { data, layout }
}
}