I have a simple data field that is trying to save data to fit file. I have it saving record, session and lap data. I can see the record and session data on garmin connect web and mobile but the lap data is not showing up. I can see the lap data being saved in the fit fille using java -jar fitcsvtool.jar activity.fit --defn none --data lap.
I have a fit.xml file in the resources folder as below:
<fitContributions> <!-- RECORD : Record Chart Definitions --> <fitField id="0" displayInChart="true" sortOrder="0" precision="2" chartTitle="@Strings.FITNESSTITLE" dataLabel="@Strings.FITNESSLABEL" unitLabel="@Strings.KPH" fillColor="#ff7b00" /> <!-- SESSION : Session Data Definitions --> <fitField id="1" displayInActivitySummary="true" sortOrder="1" precision="2" dataLabel="@Strings.FITNESSLABEL2" unitLabel="@Strings.KPH2" /> <!-- LAP : Lap Data Definitions --> <fitField id="2" displayInActivityLaps="true" sortOrder="2" precision="2" dataLabel="@Strings.FITNESSLABEL3" unitLabel="@Strings.KPH3" /> </fitContributions>
and strings.xml looks like this:
<strings> <string id="AppName">RTFC</string> <string id="FITNESSTITLE">Fitness</string> <string id="FITNESSLABEL">Fitness</string> <string id="FITNESSLABEL2">Avg Fitness</string> <string id="FITNESSLABEL3">Avg Fitness</string> <string id="KPH">kph</string> <string id="KPH2">kph</string> <string id="KPH3">kph</string> </strings>
I have this in function initialize() to create the fields:
FitFit = createField( "FITNESS", 0, FitContributor.DATA_TYPE_FLOAT, {:mesgType=>FitContributor.MESG_TYPE_RECORD, :units=>"kph"} ); FitFitSum = createField( "FITNESS", 1, FitContributor.DATA_TYPE_FLOAT, {:mesgType=>FitContributor.MESG_TYPE_SESSION, :units=>"kph"} ); FitFitLap = createField( "FITNESS", 2, FitContributor.DATA_TYPE_FLOAT, {:mesgType=>FitContributor.MESG_TYPE_LAP, :units=>"kph"} ); FitFit.setData(0.0); FitFitSum.setData(0.0); FitFitLap.setData(0.0);
and this in function compute()
if (info != null && thingtoreturn != null) { // Record FitFit.setData(thingtoreturn); // Session Scounter++; bigMean += thingtoreturn; FitFitSum.setData(bigMean / Scounter); // Lap Lcounter++; lapMean += thingtoreturn; FitFitLap.setData(lapMean / Lcounter); }
and this bit to reset the lap value:
public function onTimerLap() as Void { //! Handle lap event Lcounter = 0; lapMean = 0.0; }
I can see the fit data in activity_data.csv made from running java -jar fitcsvtool.jar activity.fit --defn none --data lap against a real or simulated fit file:
and activity.csv made in same way:
But I have no lap data in garmin connect mobile (even if I scroll right) or web (I do get session and record data).
There seem to be threads from a few years back which say that garmin connect web and/or mobile is not to be trusted for fit data viewing but I figured this would be fixed by now. I also spent some time in monkeygraph which again works well for session and record data but seems flaky with lap data. I was wondering if I had too many native lab fields and this was causing the issue... 48 seems like a lot.
Please help, thanks!