maximum number of samples for fitcontributor

I did some exercises about fitcontributor and i noticed that it is possible to store a vector of data simply passing to field the array and the number of items into it. I coded and i can say it works but the graph i get on garmin connect shows always time steps of 1 second. I setup a timer of 100ms, retrieve 10 samples, push a vector of 10 samples each sec. In my mind i thougth this would produce a graph of many 10-vectors with elements spaced of 100ms ... was it supposed to be or i was wrong?

thank you

Top Replies

All Replies

  • This has nothing to do with the array type. Every fit field works this way:
    you can call setData as many times as you wish, and it'll record the last set value once per second.

  • Yes ok! i call it once per second but the data is an array of 10 element. So the graph should has 10 items every second…

  • Ah, so you probably have the same problem I have: I wasn't able to understand how these "arrays" should work. Or it just doesn't work. Can you post the code where you call createField and setData?

  • Yes sure! Actually i'm at work. This evening i will post some snippets about the C code and the resource xml code i used. 

    maybe 4 eyes and 2 brains would find the workaround...

  • As far as I know, array types are part of the FIT specification, but they're not exposed in the CIQ SDK and they probably wouldn't be rendered in Garmin Connect.

    forums.garmin.com/.../fitcontributor-setdata-array

  • AccField_x = RECsession.createField("Accelerometer X", 1, FitContributor.DATA_TYPE_FLOAT, {:count=>10, :mesgType=>FitContributor.MESG_TYPE_RECORD, :units=>"mG" });
                            AccField_x.setData(0);
    xAccVector (and y and z) are collected using a timer of 100ms. Then, every 10 cycles i do a WatchUi.requestUpdate(); and into the onUpdate function i put the following:
                // push the fitcontributor accel data into the field
                AccField_x.setData(xAccVector);
                AccField_y.setData(yAccVector);
                AccField_z.setData(zAccVector);
    where the xAccVector is the 10element array. So every second i should have a 10element vecotr pushed into the cloud.
    unfortunately it save only one value each second
  • thank you for the link and answer

  • But how would you like this to work? You send a "10 dimensional" vector every second. How that was supposed to be displayed in a meaningful way? Even if this would work you would probably see 10 graphs when the 1st graph has the data for: 0.0s, 1.0, 2.0..., the 2nd graph has the data for 0.1s, 1.1, 2.2, etc, the 3rg graph for: 0.2, 1.2, 2.2,...
    At least that's what I understand. But maybe that's a misinterpretation because of what I tried to do with arrays:
    I wanted to measure how much time the user spent in each HR zone, so I had a array of size 7: 0 (below 1), 1, 2,... 5, 6 (above 5). But it didn't work out so I removed it from my code.

  • well my mind said: i cannot push data more than once a second. But the command for the single field allow an array. So i thought that i could push 10 values each second and the graph will be populated with blocks of 10 samples each second. I mean it is not a 10-dimensional vector but a monodimensional one ... like a line in a graph