Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cpn): inverted sources fix for custom functions reset list #5289

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading