fix(color): min/max highlight in output list swapped if inverted (#5367)
Use code from output edit page to highlight min/max values on output list page for consistency
This commit is contained in:
@@ -211,16 +211,15 @@ class OutputLineButton : public ListLineButton
|
|||||||
if (value != newValue) {
|
if (value != newValue) {
|
||||||
value = newValue;
|
value = newValue;
|
||||||
|
|
||||||
const LimitData* output = limitAddress(index);
|
int chanVal = calcRESXto100(ex_chans[index]);
|
||||||
int chanZero = output->ppmCenter;
|
|
||||||
|
|
||||||
if (value < chanZero - 5) {
|
if (chanVal < -DEADBAND) {
|
||||||
lv_obj_add_state(min, ETX_STATE_MINMAX_BOLD);
|
lv_obj_add_state(min, ETX_STATE_MINMAX_BOLD);
|
||||||
} else {
|
} else {
|
||||||
lv_obj_clear_state(min, ETX_STATE_MINMAX_BOLD);
|
lv_obj_clear_state(min, ETX_STATE_MINMAX_BOLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value > chanZero + 5) {
|
if (chanVal > DEADBAND) {
|
||||||
lv_obj_add_state(max, ETX_STATE_MINMAX_BOLD);
|
lv_obj_add_state(max, ETX_STATE_MINMAX_BOLD);
|
||||||
} else {
|
} else {
|
||||||
lv_obj_clear_state(max, ETX_STATE_MINMAX_BOLD);
|
lv_obj_clear_state(max, ETX_STATE_MINMAX_BOLD);
|
||||||
|
|||||||
@@ -30,16 +30,6 @@
|
|||||||
|
|
||||||
#define ETX_STATE_MINMAX_HIGHLIGHT LV_STATE_USER_1
|
#define ETX_STATE_MINMAX_HIGHLIGHT LV_STATE_USER_1
|
||||||
|
|
||||||
// deadband in % for switching direction of Min/Max text and value field highlighting
|
|
||||||
// 0 = no deadband
|
|
||||||
// 1..100 = [-DEADBAND; DEADBAND]
|
|
||||||
#define DEADBAND 0
|
|
||||||
|
|
||||||
// deadband in % for switching direction of Min/Max text and value field highlighting
|
|
||||||
// 0 = no deadband
|
|
||||||
// 1..100 = [-DEADBAND; DEADBAND]
|
|
||||||
#define DEADBAND 0
|
|
||||||
|
|
||||||
class OutputEditStatusBar : public Window
|
class OutputEditStatusBar : public Window
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -24,6 +24,11 @@
|
|||||||
#include "page.h"
|
#include "page.h"
|
||||||
#include "gvar_numberedit.h"
|
#include "gvar_numberedit.h"
|
||||||
|
|
||||||
|
// deadband in % for switching direction of Min/Max text and value field highlighting
|
||||||
|
// 0 = no deadband
|
||||||
|
// 1..100 = [-DEADBAND; DEADBAND]
|
||||||
|
#define DEADBAND 0
|
||||||
|
|
||||||
class OutputEditStatusBar;
|
class OutputEditStatusBar;
|
||||||
|
|
||||||
class OutputEditWindow : public Page
|
class OutputEditWindow : public Page
|
||||||
|
|||||||
Reference in New Issue
Block a user