Cells sensor can now be displayed in PREC1 or even PREC0
This commit is contained in:
@@ -208,7 +208,7 @@ bool isSensorAvailable(int sensor)
|
|||||||
#define SENSOR_3RD_COLUMN (18*FW)
|
#define SENSOR_3RD_COLUMN (18*FW)
|
||||||
|
|
||||||
#define SENSOR_UNIT_ROWS ((sensor->type == TELEM_TYPE_CALCULATED && (sensor->formula == TELEM_FORMULA_DIST)) || sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
|
#define SENSOR_UNIT_ROWS ((sensor->type == TELEM_TYPE_CALCULATED && (sensor->formula == TELEM_FORMULA_DIST)) || sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
|
||||||
#define SENSOR_PREC_ROWS (sensor->isConfigurable() && sensor->unit != UNIT_FAHRENHEIT ? (uint8_t)0 : HIDDEN_ROW)
|
#define SENSOR_PREC_ROWS (sensor->isPrecConfigurable() && sensor->unit != UNIT_FAHRENHEIT ? (uint8_t)0 : HIDDEN_ROW)
|
||||||
#define SENSOR_PARAM1_ROWS (sensor->unit >= UNIT_FIRST_VIRTUAL ? HIDDEN_ROW : (uint8_t)0)
|
#define SENSOR_PARAM1_ROWS (sensor->unit >= UNIT_FIRST_VIRTUAL ? HIDDEN_ROW : (uint8_t)0)
|
||||||
#define SENSOR_PARAM2_ROWS (sensor->unit == UNIT_GPS || sensor->unit == UNIT_DATETIME || sensor->unit == UNIT_CELLS || (sensor->type==TELEM_TYPE_CALCULATED && (sensor->formula==TELEM_FORMULA_CONSUMPTION || sensor->formula==TELEM_FORMULA_TOTALIZE)) ? HIDDEN_ROW : (uint8_t)0)
|
#define SENSOR_PARAM2_ROWS (sensor->unit == UNIT_GPS || sensor->unit == UNIT_DATETIME || sensor->unit == UNIT_CELLS || (sensor->type==TELEM_TYPE_CALCULATED && (sensor->formula==TELEM_FORMULA_CONSUMPTION || sensor->formula==TELEM_FORMULA_TOTALIZE)) ? HIDDEN_ROW : (uint8_t)0)
|
||||||
#define SENSOR_PARAM3_ROWS (sensor->type == TELEM_TYPE_CALCULATED && sensor->formula < TELEM_FORMULA_MULTIPLY) ? (uint8_t)0 : HIDDEN_ROW
|
#define SENSOR_PARAM3_ROWS (sensor->type == TELEM_TYPE_CALCULATED && sensor->formula < TELEM_FORMULA_MULTIPLY) ? (uint8_t)0 : HIDDEN_ROW
|
||||||
|
|||||||
@@ -1305,6 +1305,7 @@ PACK(typedef struct {
|
|||||||
bool isAvailable();
|
bool isAvailable();
|
||||||
int32_t getValue(int32_t value, uint8_t unit, uint8_t prec) const;
|
int32_t getValue(int32_t value, uint8_t unit, uint8_t prec) const;
|
||||||
bool isConfigurable();
|
bool isConfigurable();
|
||||||
|
bool isPrecConfigurable();
|
||||||
}) TelemetrySensor;
|
}) TelemetrySensor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -614,3 +614,16 @@ bool TelemetrySensor::isConfigurable()
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TelemetrySensor::isPrecConfigurable()
|
||||||
|
{
|
||||||
|
if (isConfigurable()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (unit == UNIT_CELLS) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user