Skip to content

Commit

Permalink
chore: Also show hats status in model printer
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick committed Sep 24, 2023
1 parent cb10543 commit 6493e3f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions companion/src/modelprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,10 @@ QString ModelPrinter::printSettingsTrim()
str << printLabelValue(tr("Step"), printTrimIncrementMode());
str << printLabelValue(tr("Display"), printTrimsDisplayMode());
str << printLabelValue(tr("Extended"), printBoolean(model.extendedTrims, BOOLEAN_YESNO));
Board::Type board = firmware->getBoard();
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board)) {
str << printLabelValue(tr("Hats Mode"), printHatsMode());
}
return str.join(" ");
}

Expand Down Expand Up @@ -869,6 +873,22 @@ QString ModelPrinter::printTrimsDisplayMode()
}
}

QString ModelPrinter::printHatsMode()
{
switch (model.hatsMode) {
case GeneralSettings::HATSMODE_TRIMS_ONLY:
return tr("Trims only");
case GeneralSettings::HATSMODE_KEYS_ONLY:
return tr("Keys only");
case GeneralSettings::HATSMODE_SWITCHABLE:
return tr("Switchable");
case GeneralSettings::HATSMODE_GLOBAL:
return tr("Global");
default:
return CPN_STR_UNKNOWN_ITEM;
}
}

QString ModelPrinter::printModuleType(int idx)
{
return ModuleData::indexToString(idx, firmware);
Expand Down
1 change: 1 addition & 0 deletions companion/src/modelprinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class ModelPrinter: public QObject
QString printModuleType(int idx);
QString printThrottleSource(int idx);
QString printTrimsDisplayMode();
QString printHatsMode();
QString printSettingsTrim();
QString printSwitchWarnings();
QString printPotWarnings();
Expand Down

0 comments on commit 6493e3f

Please sign in to comment.