Shorter lines

This commit is contained in:
2020-05-24 15:37:04 +02:00
parent 05a4a25a2f
commit 26861b7701
9 changed files with 287 additions and 42 deletions

View File

@@ -28,11 +28,41 @@ public:
String text() const override { return String{"brems: "} + raw_brems + ": " + brems; }
};
using SampleCountChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETSAMPLECOUNT>, SampleCountAccessor, BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>, SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>;
using GasMinChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETGASMIN>, GasMinAccessor, BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>, SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>;
using GasMaxChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETGASMAX>, GasMaxAccessor, BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>, SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>;
using BremsMinChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETBREMSMIN>, BremsMinAccessor, BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>, SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>;
using BremsMaxChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETBREMSMAX>, BremsMaxAccessor, BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>, SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>;
using SampleCountChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETSAMPLECOUNT>,
SampleCountAccessor,
BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
>;
using GasMinChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETGASMIN>,
GasMinAccessor,
BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
>;
using GasMaxChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETGASMAX>,
GasMaxAccessor,
BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
>;
using BremsMinChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETBREMSMIN>,
BremsMinAccessor,
BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
>;
using BremsMaxChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETBREMSMAX>,
BremsMaxAccessor,
BackActionInterface<SwitchScreenAction<BoardcomputerHardwareSettingsMenu>>,
SwitchScreenAction<BoardcomputerHardwareSettingsMenu>
>;
class BoardcomputerHardwareSettingsMenu :
public MenuDisplay,

View File

@@ -20,21 +20,69 @@ class SettingsMenu;
namespace {
struct FrontFreqAccessor : public RefAccessor<uint8_t> { uint8_t &getRef() const override { return front.command.buzzer.freq; } };
using FrontFreqChangeScreen = makeComponent<ChangeValueDisplay<uint8_t>, StaticText<TEXT_FRONTFREQ>, FrontFreqAccessor, BackActionInterface<SwitchScreenAction<BuzzerMenu>>, SwitchScreenAction<BuzzerMenu>>;
using FrontFreqChangeScreen = makeComponent<
ChangeValueDisplay<uint8_t>,
StaticText<TEXT_FRONTFREQ>,
FrontFreqAccessor,
BackActionInterface<SwitchScreenAction<BuzzerMenu>>,
SwitchScreenAction<BuzzerMenu>
>;
struct FrontPatternAccessor : public RefAccessor<uint8_t> { uint8_t &getRef() const override { return front.command.buzzer.pattern; } };
using FrontPatternChangeScreen = makeComponent<ChangeValueDisplay<uint8_t>, StaticText<TEXT_FRONTPATTERN>, FrontPatternAccessor, BackActionInterface<SwitchScreenAction<BuzzerMenu>>, SwitchScreenAction<BuzzerMenu>>;
using FrontPatternChangeScreen = makeComponent<
ChangeValueDisplay<uint8_t>,
StaticText<TEXT_FRONTPATTERN>,
FrontPatternAccessor,
BackActionInterface<SwitchScreenAction<BuzzerMenu>>,
SwitchScreenAction<BuzzerMenu>
>;
struct BackFreqAccessor : public RefAccessor<uint8_t> { uint8_t &getRef() const override { return back.command.buzzer.freq; } };
using BackFreqChangeScreen = makeComponent<ChangeValueDisplay<uint8_t>, StaticText<TEXT_BACKFREQ>, BackFreqAccessor, BackActionInterface<SwitchScreenAction<BuzzerMenu>>, SwitchScreenAction<BuzzerMenu>>;
using BackFreqChangeScreen = makeComponent<
ChangeValueDisplay<uint8_t>,
StaticText<TEXT_BACKFREQ>,
BackFreqAccessor,
BackActionInterface<SwitchScreenAction<BuzzerMenu>>,
SwitchScreenAction<BuzzerMenu>
>;
struct BackPatternAccessor : public RefAccessor<uint8_t> { uint8_t &getRef() const override { return back.command.buzzer.pattern; } };
using BackPatternChangeScreen = makeComponent<ChangeValueDisplay<uint8_t>, StaticText<TEXT_BACKPATTERN>, BackPatternAccessor, BackActionInterface<SwitchScreenAction<BuzzerMenu>>, SwitchScreenAction<BuzzerMenu>>;
using BackPatternChangeScreen = makeComponent<
ChangeValueDisplay<uint8_t>,
StaticText<TEXT_BACKPATTERN>,
BackPatternAccessor,
BackActionInterface<SwitchScreenAction<BuzzerMenu>>,
SwitchScreenAction<BuzzerMenu>
>;
using ReverseBeepFreq0ChangeScreen = makeComponent<ChangeValueDisplay<uint8_t>, StaticText<TEXT_REVERSEBEEPFREQ0>, ReverseBeepFreq0Accessor, BackActionInterface<SwitchScreenAction<BuzzerMenu>>, SwitchScreenAction<BuzzerMenu>>;
using ReverseBeepFreq1ChangeScreen = makeComponent<ChangeValueDisplay<uint8_t>, StaticText<TEXT_REVERSEBEEPFREQ1>, ReverseBeepFreq1Accessor, BackActionInterface<SwitchScreenAction<BuzzerMenu>>, SwitchScreenAction<BuzzerMenu>>;
using ReverseBeepDuration0ChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_REVERSEBEEPDURATION0>, ReverseBeepDuration0Accessor, BackActionInterface<SwitchScreenAction<BuzzerMenu>>, SwitchScreenAction<BuzzerMenu>>;
using ReverseBeepDuration1ChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_REVERSEBEEPDURATION1>, ReverseBeepDuration1Accessor, BackActionInterface<SwitchScreenAction<BuzzerMenu>>, SwitchScreenAction<BuzzerMenu>>;
using ReverseBeepFreq0ChangeScreen = makeComponent<
ChangeValueDisplay<uint8_t>,
StaticText<TEXT_REVERSEBEEPFREQ0>,
ReverseBeepFreq0Accessor,
BackActionInterface<SwitchScreenAction<BuzzerMenu>>,
SwitchScreenAction<BuzzerMenu>
>;
using ReverseBeepFreq1ChangeScreen = makeComponent<
ChangeValueDisplay<uint8_t>,
StaticText<TEXT_REVERSEBEEPFREQ1>,
ReverseBeepFreq1Accessor,
BackActionInterface<SwitchScreenAction<BuzzerMenu>>,
SwitchScreenAction<BuzzerMenu>
>;
using ReverseBeepDuration0ChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_REVERSEBEEPDURATION0>,
ReverseBeepDuration0Accessor,
BackActionInterface<SwitchScreenAction<BuzzerMenu>>,
SwitchScreenAction<BuzzerMenu>
>;
using ReverseBeepDuration1ChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_REVERSEBEEPDURATION1>,
ReverseBeepDuration1Accessor,
BackActionInterface<SwitchScreenAction<BuzzerMenu>>,
SwitchScreenAction<BuzzerMenu>
>;
class BuzzerMenu :
public MenuDisplay,

View File

@@ -23,9 +23,28 @@ class SettingsMenu;
}
namespace {
using WheelDiameterMmChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_WHEELDIAMETERMM>, WheelDiameterMmAccessor, BackActionInterface<SwitchScreenAction<ControllerHardwareSettingsMenu>>, SwitchScreenAction<ControllerHardwareSettingsMenu>>;
using WheelDiameterInchChangeScreen = makeComponent<ChangeValueDisplay<float>, StaticText<TEXT_WHEELDIAMETERINCH>, WheelDiameterInchAccessor, RatioNumberStep<float, std::ratio<1,10>>, BackActionInterface<SwitchScreenAction<ControllerHardwareSettingsMenu>>, SwitchScreenAction<ControllerHardwareSettingsMenu>>;
using NumMagnetPolesChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_NUMMAGNETPOLES>, NumMagnetPolesAccessor, BackActionInterface<SwitchScreenAction<ControllerHardwareSettingsMenu>>, SwitchScreenAction<ControllerHardwareSettingsMenu>>;
using WheelDiameterMmChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_WHEELDIAMETERMM>,
WheelDiameterMmAccessor,
BackActionInterface<SwitchScreenAction<ControllerHardwareSettingsMenu>>,
SwitchScreenAction<ControllerHardwareSettingsMenu>
>;
using WheelDiameterInchChangeScreen = makeComponent<
ChangeValueDisplay<float>,
StaticText<TEXT_WHEELDIAMETERINCH>,
WheelDiameterInchAccessor,
RatioNumberStep<float, std::ratio<1,10>>,
BackActionInterface<SwitchScreenAction<ControllerHardwareSettingsMenu>>,
SwitchScreenAction<ControllerHardwareSettingsMenu>
>;
using NumMagnetPolesChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_NUMMAGNETPOLES>,
NumMagnetPolesAccessor,
BackActionInterface<SwitchScreenAction<ControllerHardwareSettingsMenu>>,
SwitchScreenAction<ControllerHardwareSettingsMenu>
>;
class ControllerHardwareSettingsMenu :
public MenuDisplay,

View File

@@ -18,16 +18,76 @@ class ModesSettingsMenu;
}
namespace {
using DefaultModeCtrlTypChangeDisplay = makeComponent<ChangeValueDisplay<ControlType>, StaticText<TEXT_SETCONTROLTYPE>, DefaultModeCtrlTypAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeCtrlModChangeDisplay = makeComponent<ChangeValueDisplay<ControlMode>, StaticText<TEXT_SETCONTROLMODE>, DefaultModeCtrlModAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeSmoothingChangeDisplay = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETSMOOTHING>, DefaultModeSmoothingAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeFrontPercentageChangeDisplay = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETFRONTPERCENTAGE>, DefaultModeFrontPercentageAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeBackPercentageChangeDisplay = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETBACKPERCENTAGE>, DefaultModeBackPercentageAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeAddSchwelleChangeDisplay = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETADDSCHWELLE>, DefaultModeAddSchwelleAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeGas1WertChangeDisplay = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETGAS1WERT>, DefaultModeGas1WertAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeGas2WertChangeDisplay = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETGAS2WERT>, DefaultModeGas2WertAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeBrems1WertChangeDisplay = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETBREMS1WERT>, DefaultModeBrems1WertAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeBrems2WertChangeDisplay = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETBREMS2WERT>, DefaultModeBrems2WertAccessor, BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>, SwitchScreenAction<DefaultModeSettingsMenu>>;
using DefaultModeCtrlTypChangeDisplay = makeComponent<
ChangeValueDisplay<ControlType>,
StaticText<TEXT_SETCONTROLTYPE>,
DefaultModeCtrlTypAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeCtrlModChangeDisplay = makeComponent<
ChangeValueDisplay<ControlMode>,
StaticText<TEXT_SETCONTROLMODE>,
DefaultModeCtrlModAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeSmoothingChangeDisplay = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETSMOOTHING>,
DefaultModeSmoothingAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeFrontPercentageChangeDisplay = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETFRONTPERCENTAGE>,
DefaultModeFrontPercentageAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeBackPercentageChangeDisplay = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETBACKPERCENTAGE>,
DefaultModeBackPercentageAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeAddSchwelleChangeDisplay = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETADDSCHWELLE>,
DefaultModeAddSchwelleAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeGas1WertChangeDisplay = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETGAS1WERT>,
DefaultModeGas1WertAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeGas2WertChangeDisplay = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETGAS2WERT>,
DefaultModeGas2WertAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeBrems1WertChangeDisplay = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETBREMS1WERT>,
DefaultModeBrems1WertAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
using DefaultModeBrems2WertChangeDisplay = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETBREMS2WERT>,
DefaultModeBrems2WertAccessor,
BackActionInterface<SwitchScreenAction<DefaultModeSettingsMenu>>,
SwitchScreenAction<DefaultModeSettingsMenu>
>;
class DefaultModeSettingsMenu :
public MenuDisplay,

View File

@@ -39,7 +39,13 @@ struct WifiModeAccessor : public virtual AccessorInterface<wifi_mode_t>
// TODO: better error handling
}
};
using WifiModeChangeScreen = makeComponent<ChangeValueDisplay<wifi_mode_t>, StaticText<TEXT_WIFICHANGEMODE>, WifiModeAccessor, BackActionInterface<SwitchScreenAction<GenericWifiSettingsMenu>>, SwitchScreenAction<GenericWifiSettingsMenu>>;
using WifiModeChangeScreen = makeComponent<
ChangeValueDisplay<wifi_mode_t>,
StaticText<TEXT_WIFICHANGEMODE>,
WifiModeAccessor,
BackActionInterface<SwitchScreenAction<GenericWifiSettingsMenu>>,
SwitchScreenAction<GenericWifiSettingsMenu>
>;
struct WifiSleepAccessor : public virtual AccessorInterface<bool>
{
@@ -62,7 +68,13 @@ struct WifiTxPowerAccessor : public virtual AccessorInterface<wifi_power_t>
// TODO: better error handling
}
};
using WifiTxPowerChangeScreen = makeComponent<ChangeValueDisplay<wifi_power_t>, StaticText<TEXT_WIFICHANGETXPOWER>, WifiTxPowerAccessor, BackActionInterface<SwitchScreenAction<GenericWifiSettingsMenu>>, SwitchScreenAction<GenericWifiSettingsMenu>>;
using WifiTxPowerChangeScreen = makeComponent<
ChangeValueDisplay<wifi_power_t>,
StaticText<TEXT_WIFICHANGETXPOWER>,
WifiTxPowerAccessor,
BackActionInterface<SwitchScreenAction<GenericWifiSettingsMenu>>,
SwitchScreenAction<GenericWifiSettingsMenu>
>;
class GenericWifiSettingsMenu :
public MenuDisplay,

View File

@@ -16,8 +16,20 @@ class ModesSettingsMenu;
}
namespace {
using LarsmModeModeChangeDisplay = makeComponent<ChangeValueDisplay<LarsmModeMode>, StaticText<TEXT_LARSMMODECHANGEMODE>, LarsmModeModeAccessor, BackActionInterface<SwitchScreenAction<LarsmModeSettingsMenu>>, SwitchScreenAction<LarsmModeSettingsMenu>>;
using LarsmModeIterationsChangeDisplay = makeComponent<ChangeValueDisplay<uint8_t>, StaticText<TEXT_LARSMMODECHANGEITERATIONS>, LarsmModeIterationsAccessor, BackActionInterface<SwitchScreenAction<LarsmModeSettingsMenu>>, SwitchScreenAction<LarsmModeSettingsMenu>>;
using LarsmModeModeChangeDisplay = makeComponent<
ChangeValueDisplay<LarsmModeMode>,
StaticText<TEXT_LARSMMODECHANGEMODE>,
LarsmModeModeAccessor,
BackActionInterface<SwitchScreenAction<LarsmModeSettingsMenu>>,
SwitchScreenAction<LarsmModeSettingsMenu>
>;
using LarsmModeIterationsChangeDisplay = makeComponent<
ChangeValueDisplay<uint8_t>,
StaticText<TEXT_LARSMMODECHANGEITERATIONS>,
LarsmModeIterationsAccessor,
BackActionInterface<SwitchScreenAction<LarsmModeSettingsMenu>>,
SwitchScreenAction<LarsmModeSettingsMenu>
>;
class LarsmModeSettingsMenu :
public MenuDisplay,

View File

@@ -16,12 +16,48 @@ class SettingsMenu;
}
namespace {
using IMotMaxChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETIMOTMAX>, IMotMaxAccessor, BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>, SwitchScreenAction<LimitsSettingsMenu>>;
using IDcMaxChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETIDCMAX>, IDcMaxAccessor, BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>, SwitchScreenAction<LimitsSettingsMenu>>;
using NMotMaxKmhChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETNMOTMAXKMH>, NMotMaxKmhAccessor, BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>, SwitchScreenAction<LimitsSettingsMenu>>;
using NMotMaxRpmChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETNMOTMAX>, NMotMaxRpmAccessor, BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>, SwitchScreenAction<LimitsSettingsMenu>>;
using FieldWeakMaxChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETFIELDWEAKMAX>, FieldWeakMaxAccessor, BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>, SwitchScreenAction<LimitsSettingsMenu>>;
using PhaseAdvMaxChangeScreen = makeComponent<ChangeValueDisplay<int16_t>, StaticText<TEXT_SETPHASEADVMAX>, PhaseAdvMaxAccessor, BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>, SwitchScreenAction<LimitsSettingsMenu>>;
using IMotMaxChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETIMOTMAX>,
IMotMaxAccessor,
BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>,
SwitchScreenAction<LimitsSettingsMenu>
>;
using IDcMaxChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETIDCMAX>,
IDcMaxAccessor,
BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>,
SwitchScreenAction<LimitsSettingsMenu>
>;
using NMotMaxKmhChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETNMOTMAXKMH>,
NMotMaxKmhAccessor,
BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>,
SwitchScreenAction<LimitsSettingsMenu>
>;
using NMotMaxRpmChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETNMOTMAX>,
NMotMaxRpmAccessor,
BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>,
SwitchScreenAction<LimitsSettingsMenu>
>;
using FieldWeakMaxChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETFIELDWEAKMAX>,
FieldWeakMaxAccessor,
BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>,
SwitchScreenAction<LimitsSettingsMenu>
>;
using PhaseAdvMaxChangeScreen = makeComponent<
ChangeValueDisplay<int16_t>,
StaticText<TEXT_SETPHASEADVMAX>,
PhaseAdvMaxAccessor,
BackActionInterface<SwitchScreenAction<LimitsSettingsMenu>>,
SwitchScreenAction<LimitsSettingsMenu>
>;
class LimitsSettingsMenu :
public MenuDisplay,

View File

@@ -18,16 +18,32 @@ class MainMenu;
namespace {
template<const Settings *preset>
class ApplyPresetAction : public virtual ActionInterface {public: void triggered() override { settings = *preset; saveSettings(); } };
class ApplyPresetAction : public virtual ActionInterface
{
public:
void triggered() override { settings = *preset; saveSettings(); }
};
template<const Settings::Limits *preset>
class ApplyLimitsPresetAction : public virtual ActionInterface {public: void triggered() override { settings.limits = *preset; saveSettings(); } };
class ApplyLimitsPresetAction : public virtual ActionInterface
{
public:
void triggered() override { settings.limits = *preset; saveSettings(); }
};
template<const Settings::ControllerHardware *preset>
class ApplyControllerHardwarePresetAction : public virtual ActionInterface {public: void triggered() override { settings.controllerHardware = *preset; saveSettings(); } };
class ApplyControllerHardwarePresetAction : public virtual ActionInterface
{
public:
void triggered() override { settings.controllerHardware = *preset; saveSettings(); }
};
template<const Settings::BoardcomputerHardware *preset>
class ApplyBoardcomputerHardwarePresetAction : public virtual ActionInterface {public: void triggered() override { settings.boardcomputerHardware = *preset; saveSettings(); } };
class ApplyBoardcomputerHardwarePresetAction : public virtual ActionInterface
{
public:
void triggered() override { settings.boardcomputerHardware = *preset; saveSettings(); }
};
class PresetsMenu :
public MenuDisplay,

View File

@@ -16,8 +16,20 @@ class ModesSettingsMenu;
}
namespace {
using TempomatModeCtrlTypChangeScreen = makeComponent<ChangeValueDisplay<ControlType>, StaticText<TEXT_SETCONTROLMODE>, TempomatModeCtrlTypAccessor, BackActionInterface<SwitchScreenAction<TempomatModeSettingsMenu>>, SwitchScreenAction<TempomatModeSettingsMenu>>;
using TempomatModeCtrlModChangeScreen = makeComponent<ChangeValueDisplay<ControlMode>, StaticText<TEXT_SETCONTROLMODE>, TempomatModeCtrlModAccessor, BackActionInterface<SwitchScreenAction<TempomatModeSettingsMenu>>, SwitchScreenAction<TempomatModeSettingsMenu>>;
using TempomatModeCtrlTypChangeScreen = makeComponent<
ChangeValueDisplay<ControlType>,
StaticText<TEXT_SETCONTROLMODE>,
TempomatModeCtrlTypAccessor,
BackActionInterface<SwitchScreenAction<TempomatModeSettingsMenu>>,
SwitchScreenAction<TempomatModeSettingsMenu>
>;
using TempomatModeCtrlModChangeScreen = makeComponent<
ChangeValueDisplay<ControlMode>,
StaticText<TEXT_SETCONTROLMODE>,
TempomatModeCtrlModAccessor,
BackActionInterface<SwitchScreenAction<TempomatModeSettingsMenu>>,
SwitchScreenAction<TempomatModeSettingsMenu>
>;
class TempomatModeSettingsMenu :
public MenuDisplay,