Add brake balance display
This commit is contained in:
parent
58b0b72c6d
commit
661e1a2274
|
@ -113,6 +113,15 @@ String get_value(Value val) {
|
||||||
return String(Vehicle_data.speed_fr);
|
return String(Vehicle_data.speed_fr);
|
||||||
case VAL_SPEED:
|
case VAL_SPEED:
|
||||||
return String(Vehicle_data.speed);
|
return String(Vehicle_data.speed);
|
||||||
|
case VAL_BBAL: {
|
||||||
|
double p_total =
|
||||||
|
Vehicle_data.p_brake_front + Vehicle_data.p_brake_rear / 2.398;
|
||||||
|
double bbal = p_total == 0 ? 0 : 100 * Vehicle_data.p_brake_front / p_total;
|
||||||
|
if (bbal >= 100) {
|
||||||
|
return "100";
|
||||||
|
}
|
||||||
|
return String(bbal, 2);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return "???";
|
return "???";
|
||||||
}
|
}
|
||||||
|
@ -160,6 +169,8 @@ String get_label(Value val) {
|
||||||
return "SPEED FR";
|
return "SPEED FR";
|
||||||
case VAL_SPEED:
|
case VAL_SPEED:
|
||||||
return "SPEED";
|
return "SPEED";
|
||||||
|
case VAL_BBAL:
|
||||||
|
return "BBAL";
|
||||||
default:
|
default:
|
||||||
return "???";
|
return "???";
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,9 @@ enum Value {
|
||||||
VAL_SPEED_FL,
|
VAL_SPEED_FL,
|
||||||
VAL_SPEED_FR,
|
VAL_SPEED_FR,
|
||||||
VAL_SPEED,
|
VAL_SPEED,
|
||||||
|
VAL_BBAL,
|
||||||
VAL_FIRST_LEFT_BOX = VAL_LAPTIME,
|
VAL_FIRST_LEFT_BOX = VAL_LAPTIME,
|
||||||
VAL_LAST = VAL_SPEED
|
VAL_LAST = VAL_BBAL
|
||||||
};
|
};
|
||||||
String get_value(Value val);
|
String get_value(Value val);
|
||||||
String get_label(Value val);
|
String get_label(Value val);
|
||||||
|
|
Loading…
Reference in New Issue