Skip to content

Commit

Permalink
fix(cpn): inverted sources fix for custom functions reset list
Browse files Browse the repository at this point in the history
  • Loading branch information
elecpower committed Jul 12, 2024
1 parent c7bc9f0 commit f888dc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions companion/src/firmwares/customfunctiondata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ QString CustomFunctionData::resetToString(const int value, const ModelData * mod

if (value < step) {
if (value < firmware->getCapability(Timers))
return RawSource(SOURCE_TYPE_TIMER, value).toString(model);
return RawSource(SOURCE_TYPE_TIMER, value + 1).toString(model);
else
return QString(CPN_STR_UNKNOWN_ITEM);
}
Expand All @@ -296,7 +296,7 @@ QString CustomFunctionData::resetToString(const int value, const ModelData * mod
return tr("Telemetry");

if (value < step + firmware->getCapability(Sensors))
return RawSource(SOURCE_TYPE_TELEMETRY, 3 * (value - step + 1)).toString(model);
return RawSource(SOURCE_TYPE_TELEMETRY, 3 * (value - step) + 1).toString(model);

return QString(CPN_STR_UNKNOWN_ITEM);
}
Expand Down

0 comments on commit f888dc0

Please sign in to comment.