Skip to content

Commit

Permalink
Fix screen wakeup issue by removing right widgets from UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device authored and kegman committed Jan 30, 2020
1 parent 24de16e commit f659493
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
5 changes: 5 additions & 0 deletions selfdrive/ui/paint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ static void bb_ui_draw_measures_left(UIState *s, int bb_x, int bb_y, int bb_w )
*/

//add battery temperature
/*
if (true) {
char val_str[16];
char uom_str[6];
Expand All @@ -870,6 +871,7 @@ static void bb_ui_draw_measures_left(UIState *s, int bb_x, int bb_y, int bb_w )
value_fontSize, label_fontSize, uom_fontSize );
bb_ry = bb_y + bb_h;
}
*/

//add grey panda GPS accuracy
/*if (true) {
Expand All @@ -894,6 +896,7 @@ static void bb_ui_draw_measures_left(UIState *s, int bb_x, int bb_y, int bb_w )
}*/

//add free space - from bthaler1
/*
if (true) {
char val_str[16];
char uom_str[3];
Expand All @@ -916,6 +919,7 @@ static void bb_ui_draw_measures_left(UIState *s, int bb_x, int bb_y, int bb_w )
value_fontSize, label_fontSize, uom_fontSize );
bb_ry = bb_y + bb_h;
}
//finally draw the frame
bb_h += 20;
Expand All @@ -924,6 +928,7 @@ static void bb_ui_draw_measures_left(UIState *s, int bb_x, int bb_y, int bb_w )
nvgStrokeColor(s->vg, nvgRGBA(255,255,255,80));
nvgStrokeWidth(s->vg, 6);
nvgStroke(s->vg);
*/
}


Expand Down
28 changes: 20 additions & 8 deletions selfdrive/ui/ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,26 +113,38 @@ static void ui_init(UIState *s) {
s->uilayout_sock = SubSocket::create(s->ctx, "uiLayoutState");
s->livecalibration_sock = SubSocket::create(s->ctx, "liveCalibration");
s->radarstate_sock = SubSocket::create(s->ctx, "radarState");
s->thermal_sock = SubSocket::create(s->ctx, "thermal");
//s->thermal_sock = SubSocket::create(s->ctx, "thermal");
s->carstate_sock = SubSocket::create(s->ctx, "carState");

assert(s->model_sock != NULL);
assert(s->controlsstate_sock != NULL);
assert(s->uilayout_sock != NULL);
assert(s->livecalibration_sock != NULL);
assert(s->radarstate_sock != NULL);
assert(s->thermal_sock != NULL);
//assert(s->thermal_sock != NULL);
assert(s->carstate_sock != NULL);

s->poller = Poller::create({
s->model_sock,
s->controlsstate_sock,
s->uilayout_sock,
s->livecalibration_sock,
s->radarstate_sock,
s->carstate_sock
});

/*
s->poller = Poller::create({
s->model_sock,
s->controlsstate_sock,
s->uilayout_sock,
s->livecalibration_sock,
s->radarstate_sock,
s->thermal_sock,
s->carstate_sock
s->carstate_sock
});
*/


#ifdef SHOW_SPEEDLIMIT
s->map_data_sock = SubSocket::create(s->ctx, "liveMapData");
Expand Down Expand Up @@ -434,12 +446,12 @@ void handle_message(UIState *s, Message * msg) {
s->scene.speedlimitaheaddistance = datad.speedLimitAheadDistance;
s->scene.speedlimit_valid = datad.speedLimitValid;
// getting thermal related data for dev ui
} else if (eventd.which == cereal_Event_thermal) {
struct cereal_ThermalData datad;
cereal_read_ThermalData(&datad, eventd.thermal);
//} else if (eventd.which == cereal_Event_thermal) {
// struct cereal_ThermalData datad;
// cereal_read_ThermalData(&datad, eventd.thermal);

s->scene.pa0 = datad.pa0;
s->scene.freeSpace = datad.freeSpace;
// s->scene.pa0 = datad.pa0;
// s->scene.freeSpace = datad.freeSpace;
} else if (eventd.which == cereal_Event_carState) {
struct cereal_CarState datad;
cereal_read_CarState(&datad, eventd.carState);
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/ui/ui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ typedef struct UIState {
track_vertices_data track_vertices[2];

// dev ui
SubSocket *thermal_sock;
//SubSocket *thermal_sock;
} UIState;

// API
Expand Down

0 comments on commit f659493

Please sign in to comment.