From 22a2cbb730ce15c9a99dc11aad4226cca0eae9eb Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Sun, 29 Mar 2020 00:06:08 +1000 Subject: [PATCH] fix ui glitch, disallow charging ctrl on uno --- selfdrive/thermald/thermald.py | 23 +++++++++++++---------- selfdrive/ui/sidebar.cc | 12 ++++++++++-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 8429f773d..4a792a69c 100644 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -216,17 +216,20 @@ def thermald_thread(): if ts - ts_last_update_vars >= 10.: modified = dp_get_last_modified() if dp_last_modified != modified: - dragon_charging_ctrl = True if params.get('DragonChargingCtrl', encoding='utf8') == "1" else False dp_temp_monitor = True if params.get('DragonEnableTempMonitor', encoding='utf8') == "1" else False - if dragon_charging_ctrl: - try: - dragon_to_discharge = int(params.get('DragonCharging', encoding='utf8')) - except (TypeError, ValueError): - dragon_to_discharge = 70 - try: - dragon_to_charge = int(params.get('DragonDisCharging', encoding='utf8')) - except (TypeError, ValueError): - dragon_to_charge = 60 + if not is_uno: + dragon_charging_ctrl = True if params.get('DragonChargingCtrl', encoding='utf8') == "1" else False + if dragon_charging_ctrl: + try: + dragon_to_discharge = int(params.get('DragonCharging', encoding='utf8')) + except (TypeError, ValueError): + dragon_to_discharge = 70 + try: + dragon_to_charge = int(params.get('DragonDisCharging', encoding='utf8')) + except (TypeError, ValueError): + dragon_to_charge = 60 + else: + dragon_charging_ctrl = False dp_last_modified = modified ts_last_update_vars = ts diff --git a/selfdrive/ui/sidebar.cc b/selfdrive/ui/sidebar.cc index 4ea239ea2..d91a336e6 100644 --- a/selfdrive/ui/sidebar.cc +++ b/selfdrive/ui/sidebar.cc @@ -1,6 +1,14 @@ #include #include #include + +#include "common/util.h" +#include "common/timing.h" +#include "common/swaglog.h" +#include "common/touch.h" +#include "common/visionimg.h" +#include "common/params.h" + #include "ui.hpp" static void ui_draw_sidebar_background(UIState *s, bool hasSidebar) { @@ -57,7 +65,7 @@ static void ui_draw_sidebar_ip_addr(UIState *s, bool hasSidebar) { const int network_ip_x = hasSidebar ? 58 : -(sbr_w); const int network_ip_y = 255; - char network_ip_str[20]; + char network_ip_str[15]; snprintf(network_ip_str, sizeof(network_ip_str), "%s", s->scene.ipAddr); nvgFillColor(s->vg, COLOR_WHITE); nvgFontSize(s->vg, 32); @@ -91,7 +99,7 @@ static void ui_draw_sidebar_battery_icon(UIState *s, bool hasSidebar) { static void ui_draw_sidebar_battery_text(UIState *s, bool hasSidebar) { const int battery_img_h = 36; - const int battery_img_w = 76; + const int battery_img_w = 96; const int battery_img_x = hasSidebar ? 150 : -(sbr_w); const int battery_img_y = 305;