mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-01 05:33:49 +08:00
Visuals - Developer UI - Use International System of Units
Display relevant metrics in the SI format.
This commit is contained in:
@@ -733,14 +733,14 @@ void AnnotatedCameraWidget::initializeFrogPilotWidgets() {
|
||||
}
|
||||
|
||||
void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UIScene &scene) {
|
||||
if (is_metric) {
|
||||
if (is_metric || useSI) {
|
||||
accelerationUnit = tr(" m/s²");
|
||||
leadDistanceUnit = tr(mapOpen ? "m" : "meters");
|
||||
leadSpeedUnit = tr("kph");
|
||||
leadSpeedUnit = useSI ? tr("m/s") : tr("kph");
|
||||
|
||||
accelerationConversion = 1.0f;
|
||||
distanceConversion = 1.0f;
|
||||
speedConversion = MS_TO_KPH;
|
||||
speedConversion = useSI ? 1.0f : MS_TO_KPH;
|
||||
} else {
|
||||
accelerationUnit = tr(" ft/s²");
|
||||
leadDistanceUnit = tr(mapOpen ? "ft" : "feet");
|
||||
@@ -850,6 +850,8 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
|
||||
animationTimer->stop();
|
||||
}
|
||||
|
||||
useSI = scene.use_si;
|
||||
|
||||
if (currentHolidayTheme != scene.current_holiday_theme || customSignals != scene.custom_signals) {
|
||||
currentHolidayTheme = scene.current_holiday_theme;
|
||||
customSignals = scene.custom_signals;
|
||||
|
||||
@@ -124,6 +124,7 @@ private:
|
||||
bool trafficModeActive;
|
||||
bool turnSignalLeft;
|
||||
bool turnSignalRight;
|
||||
bool useSI;
|
||||
bool useViennaSLCSign;
|
||||
bool vtscControllingCurve;
|
||||
|
||||
|
||||
@@ -370,6 +370,7 @@ void ui_update_frogpilot_params(UIState *s) {
|
||||
scene.is_memory = scene.sidebar_metrics && params.getBool("ShowMemoryUsage");
|
||||
scene.is_storage_left = scene.sidebar_metrics && params.getBool("ShowStorageLeft");
|
||||
scene.is_storage_used = scene.sidebar_metrics && params.getBool("ShowStorageUsed");
|
||||
scene.use_si = developer_ui && params.getBool("UseSI");
|
||||
|
||||
scene.disable_smoothing_mtsc = params.getBool("MTSCEnabled") && params.getBool("DisableMTSCSmoothing");
|
||||
scene.disable_smoothing_vtsc = params.getBool("VisionTurnControl") && params.getBool("DisableVTSCSmoothing");
|
||||
|
||||
@@ -185,6 +185,7 @@ typedef struct UIScene {
|
||||
bool turn_signal_left;
|
||||
bool turn_signal_right;
|
||||
bool use_kaofui_icons;
|
||||
bool use_si;
|
||||
bool use_vienna_slc_sign;
|
||||
bool vtsc_controlling_curve;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user