feat: Allow the timer count direction to be selected (#2038)

* timer direction: ellapsed or left

* Add AUDIO announcement support

* Storage for showElapsed

* Translations

* Fix storage

* BW implementation

* Different BW implementation

* Companion support

* Color LCD implementation and rebase to lvgl

* Fix problems found by raphaelcoeffic

* chore: Regenerate the YAML files properly

* fix: Remove unused `TR_SHOW` remnant

* chore: Formatting and cleanup

* fix: Timer dir choice was shown in wrong place
Wrong newline used in ce23b50

* Fix cpn ui triggers, remove unnecessary code and some formatting

* fix(colorlcd): Hide timer dir opt if zero value

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
eshifri
2022-08-03 09:22:42 +10:00
committed by GitHub
co-authored by Peter Feerick elecpower
parent 415b566a79
commit be7a6a51ab
50 changed files with 286 additions and 85 deletions
+12 -1
View File
@@ -32,6 +32,7 @@ constexpr char AIM_TIMER_COUNTDOWNBEEP[] {"timerdata.countdownBeep"};
constexpr char AIM_TIMER_COUNTDOWNSTART[] {"timerdata.countdownStart"};
constexpr char AIM_TIMER_PERSISTENT[] {"timerdata.persistent"};
constexpr char AIM_TIMER_MODE[] {"timerdata.mode"};
constexpr char AIM_TIMER_SHOWELAPSED[] {"timerdata.showElapsed"};
constexpr int TIMER_NAME_LEN {8};
@@ -74,6 +75,12 @@ class TimerData {
TIMERMODE_MAX = TIMERMODE_COUNT - 1
};
enum TimerShowDirection {
TIMER_SHOW_REMAINING,
TIMER_SHOW_ELAPSED,
TIMER_SHOW_COUNT
};
TimerData() { clear(); }
RawSwitch swtch;
@@ -85,6 +92,7 @@ class TimerData {
unsigned int persistent;
int countdownStart;
int pvalue;
unsigned int showElapsed;
void convert(RadioDataConversionState & cstate);
void clear();
@@ -97,6 +105,8 @@ class TimerData {
QString pvalueToString() const;
QString valToString() const;
QString modeToString() const;
QString showElapsedToString() const;
void countdownBeepChanged();
void modeChanged();
@@ -106,9 +116,10 @@ class TimerData {
static QString pvalueToString(const int value);
static QString valToString(const int value);
static QString modeToString(const int value);
static QString showElapsedToString(const unsigned int value);
static AbstractStaticItemModel * countdownBeepItemModel();
static AbstractStaticItemModel * countdownStartItemModel();
static AbstractStaticItemModel * persistentItemModel();
static AbstractStaticItemModel * modeItemModel();
static AbstractStaticItemModel * showElapsedItemModel();
};