Numerical temperature gauge
Added toggle to replace the "GOOD", "OK", and "HIGH" temperature statuses with a numerical temperature gauge based on the highest temperature between the memory, CPU, and GPU and a function to swap between it by simply taping on the "Temp" gauge itself.
This commit is contained in:
@@ -266,6 +266,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"ExperimentalModeViaDistance", PERSISTENT},
|
||||
{"ExperimentalModeViaLKAS", PERSISTENT},
|
||||
{"ExperimentalModeViaScreen", PERSISTENT},
|
||||
{"Fahrenheit", PERSISTENT},
|
||||
{"FireTheBabysitter", PERSISTENT},
|
||||
{"ForceAutoTune", PERSISTENT},
|
||||
{"ForceFingerprint", PERSISTENT},
|
||||
@@ -314,6 +315,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"NoLogging", PERSISTENT},
|
||||
{"NoUploads", PERSISTENT},
|
||||
{"NudgelessLaneChange", PERSISTENT},
|
||||
{"NumericalTemp", PERSISTENT},
|
||||
{"OneLaneChange", PERSISTENT},
|
||||
{"PathEdgeWidth", PERSISTENT},
|
||||
{"PathWidth", PERSISTENT},
|
||||
|
||||
BIN
selfdrive/frogpilot/assets/toggle_icons/icon_temperature.png
Normal file
BIN
selfdrive/frogpilot/assets/toggle_icons/icon_temperature.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -42,6 +42,8 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
|
||||
{"RoadEdgesWidth", "Road Edges", "Adjust the visual thickness of road edges on your display.\n\nDefault is 1/2 of the MUTCD average lane line width of 4 inches.", ""},
|
||||
{"UnlimitedLength", "'Unlimited' Road UI Length", "Extend the display of the path, lane lines, and road edges as far as the system can detect, providing a more expansive view of the road ahead.", ""},
|
||||
|
||||
{"NumericalTemp", "Numerical Temperature Gauge", "Replace the 'GOOD', 'OK', and 'HIGH' temperature statuses with a numerical temperature gauge based on the highest temperature between the memory, CPU, and GPU.", "../frogpilot/assets/toggle_icons/icon_temperature.png"},
|
||||
|
||||
{"QOLVisuals", "Quality of Life", "Miscellaneous quality of life changes to improve your overall openpilot experience.", "../frogpilot/assets/toggle_icons/quality_of_life.png"},
|
||||
{"DriveStats", "Drive Stats In Home Screen", "Display your device's drive stats in the home screen.", ""},
|
||||
{"FullMap", "Full Sized Map", "Maximize the size of the map in the onroad UI.", ""},
|
||||
@@ -142,6 +144,11 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
|
||||
} else if (param == "PathWidth") {
|
||||
toggle = new FrogPilotParamValueControl(param, title, desc, icon, 0, 100, std::map<int, QString>(), this, false, " feet", 10);
|
||||
|
||||
} else if (param == "NumericalTemp") {
|
||||
std::vector<QString> temperatureToggles{"Fahrenheit"};
|
||||
std::vector<QString> temperatureToggleNames{tr("Fahrenheit")};
|
||||
toggle = new FrogPilotParamToggleControl(param, title, desc, icon, temperatureToggles, temperatureToggleNames);
|
||||
|
||||
} else if (param == "QOLVisuals") {
|
||||
FrogPilotParamManageControl *qolToggle = new FrogPilotParamManageControl(param, title, desc, icon, this);
|
||||
QObject::connect(qolToggle, &FrogPilotParamManageControl::manageButtonClicked, this, [this]() {
|
||||
|
||||
@@ -99,9 +99,11 @@ void Sidebar::mousePressEvent(QMouseEvent *event) {
|
||||
// Declare the click boxes
|
||||
QRect cpuRect = {30, 496, 240, 126};
|
||||
QRect memoryRect = {30, 654, 240, 126};
|
||||
QRect tempRect = {30, 338, 240, 126};
|
||||
|
||||
static int showChip = 0;
|
||||
static int showMemory = 0;
|
||||
static int showTemp = 0;
|
||||
|
||||
// Swap between the respective metrics upon tap
|
||||
if (cpuRect.contains(event->pos())) {
|
||||
@@ -120,6 +122,13 @@ void Sidebar::mousePressEvent(QMouseEvent *event) {
|
||||
params.putBoolNonBlocking("ShowStorageLeft", isStorageLeft);
|
||||
params.putBoolNonBlocking("ShowStorageUsed", isStorageUsed);
|
||||
update();
|
||||
} else if (tempRect.contains(event->pos())) {
|
||||
showTemp = (showTemp + 1) % 3;
|
||||
scene.fahrenheit = showTemp == 2;
|
||||
scene.numerical_temp = showTemp != 0;
|
||||
params.putBoolNonBlocking("Fahrenheit", showTemp == 2);
|
||||
params.putBoolNonBlocking("NumericalTemp", showTemp != 0);
|
||||
update();
|
||||
} else if (onroad && home_btn.contains(event->pos())) {
|
||||
flag_pressed = true;
|
||||
update();
|
||||
@@ -173,6 +182,10 @@ void Sidebar::updateState(const UIState &s) {
|
||||
|
||||
auto frogpilotDeviceState = sm["frogpilotDeviceState"].getFrogpilotDeviceState();
|
||||
|
||||
bool isNumericalTemp = scene.numerical_temp;
|
||||
|
||||
int maxTempC = deviceState.getMaxTempC();
|
||||
QString max_temp = scene.fahrenheit ? QString::number(maxTempC * 9 / 5 + 32) + "°F" : QString::number(maxTempC) + "°C";
|
||||
QColor theme_color = currentColors[0];
|
||||
|
||||
// FrogPilot metrics
|
||||
@@ -234,12 +247,12 @@ void Sidebar::updateState(const UIState &s) {
|
||||
}
|
||||
setProperty("connectStatus", QVariant::fromValue(connectStatus));
|
||||
|
||||
ItemStatus tempStatus = {{tr("TEMP"), tr("HIGH")}, danger_color};
|
||||
ItemStatus tempStatus = {{tr("TEMP"), isNumericalTemp ? max_temp : tr("HIGH")}, danger_color};
|
||||
auto ts = deviceState.getThermalStatus();
|
||||
if (ts == cereal::DeviceState::ThermalStatus::GREEN) {
|
||||
tempStatus = {{tr("TEMP"), tr("GOOD")}, theme_color};
|
||||
tempStatus = {{tr("TEMP"), isNumericalTemp ? max_temp : tr("GOOD")}, theme_color};
|
||||
} else if (ts == cereal::DeviceState::ThermalStatus::YELLOW) {
|
||||
tempStatus = {{tr("TEMP"), tr("OK")}, warning_color};
|
||||
tempStatus = {{tr("TEMP"), isNumericalTemp ? max_temp : tr("OK")}, warning_color};
|
||||
}
|
||||
setProperty("tempStatus", QVariant::fromValue(tempStatus));
|
||||
|
||||
|
||||
@@ -311,6 +311,7 @@ void ui_update_frogpilot_params(UIState *s) {
|
||||
scene.disable_smoothing_mtsc = params.getBool("DisableMTSCSmoothing");
|
||||
scene.driver_camera = params.getBool("DriverCamera");
|
||||
scene.experimental_mode_via_screen = params.getBool("ExperimentalModeViaScreen") && params.getBool("ExperimentalModeActivation");
|
||||
scene.fahrenheit = params.getBool("Fahrenheit");
|
||||
|
||||
scene.model_ui = params.getBool("ModelUI");
|
||||
scene.dynamic_path_width = scene.model_ui && params.getBool("DynamicPathWidth");
|
||||
@@ -320,6 +321,8 @@ void ui_update_frogpilot_params(UIState *s) {
|
||||
scene.road_edge_width = params.getInt("RoadEdgesWidth") * (scene.is_metric ? 1.0f : INCH_TO_CM) / 200.0f;
|
||||
scene.unlimited_road_ui_length = scene.model_ui && params.getBool("UnlimitedLength");
|
||||
|
||||
scene.numerical_temp = params.getBool("NumericalTemp");
|
||||
|
||||
bool quality_of_life_controls = params.getBool("QOLControls");
|
||||
scene.reverse_cruise = quality_of_life_controls && params.getBool("ReverseCruise");
|
||||
scene.reverse_cruise_ui = scene.reverse_cruise && params.getBool("ReverseCruiseUI");
|
||||
|
||||
@@ -184,6 +184,7 @@ typedef struct UIScene {
|
||||
bool enabled;
|
||||
bool experimental_mode;
|
||||
bool experimental_mode_via_screen;
|
||||
bool fahrenheit;
|
||||
bool fps_counter;
|
||||
bool full_map;
|
||||
bool hide_speed;
|
||||
@@ -192,6 +193,7 @@ typedef struct UIScene {
|
||||
bool lead_info;
|
||||
bool map_open;
|
||||
bool model_ui;
|
||||
bool numerical_temp;
|
||||
bool reverse_cruise;
|
||||
bool reverse_cruise_ui;
|
||||
bool show_driver_camera;
|
||||
|
||||
Reference in New Issue
Block a user