Running speed read from Footpod ANT+ device (#4701)

Only when the Footpod stride length is configured to zero, for backward compatibility.
This commit is contained in:
Peret
2025-09-09 15:22:47 +02:00
committed by GitHub
parent ed929366aa
commit 2653aa08e7
3 changed files with 8 additions and 6 deletions

View File

@@ -1207,7 +1207,7 @@ void ANTChannel::broadcastEvent(unsigned char *ant_message)
if (fpCount==4) {
// default or get config
double STRIDELENGTH=115; // 1.15m seems to be a common L2 pace stride length (?)
double STRIDELENGTH= 0.0;
if (parent->devConf) STRIDELENGTH=parent->devConf->stridelength;
// convert to meters
@@ -1221,8 +1221,11 @@ void ANTChannel::broadcastEvent(unsigned char *ant_message)
parent->setCadence(fpStrides * (60/(fpMS/1000.00f)));
// running speed is strides x 2 (for left and right) multiplied
// by the user defined stride length, which is typicall ~78cm
parent->setSpeed((fpStrides*2*STRIDELENGTH) / (fpMS/1000.00f) * 3.6f);
// by the user defined stride length
if (STRIDELENGTH > 0.0)
parent->setSpeed((fpStrides*2*STRIDELENGTH) / (fpMS/1000.00f) * 3.6f);
else
parent->setSpeed(antMessage.fpodSpeed * 3.6f);
// reset counters
fpCount=0;

View File

@@ -815,7 +815,7 @@ ANTMessage::ANTMessage(ANT *parent, const unsigned char *message) {
// SDM main format - strides loop at 255 should be x2
fpodInstant=false;
fpodStrides = message[10];
fpodSpeed = 0;
fpodSpeed = double(message[8]&0x0f) + (double(message[9]/256.00f));
fpodCadence = 0;
}
break;

View File

@@ -36,7 +36,7 @@ DeviceConfiguration::DeviceConfiguration()
type=0;
wheelSize=2100;
postProcess=0;
stridelength=80;
stridelength=0;
controller = NULL;
virtualPowerDefinitionString = "";
}
@@ -109,7 +109,6 @@ DeviceConfigurations::readConfig()
configStr = QString("%1%2").arg(GC_DEV_STRIDE).arg(i+1);
configVal = appsettings->value(NULL, configStr);
Entry.stridelength = configVal.toInt();
if (Entry.stridelength == 0) Entry.stridelength = 78; // default to 78cm
configStr = QString("%1%2").arg(GC_DEV_PROF).arg(i+1);
configVal = appsettings->value(NULL, configStr);