    }
  }
  
  static void check_messages(UIState *s) {
    while (true) {
      if (s->sm->update(0) == 0)
        break;
      handle_message(s, *(s->sm));
    }
  }
  
  static void ui_update(UIState *s) {
 
</s> remove   if(s->model_changed) {
 </s> add   if(s->sm->updated("model")) { </s> remove   const int img_idx = s->scene.networkType == cereal::ThermalData::NetworkType::NONE ? 0 : network_strength_map[s->scene.networkStrength];
 </s> add   const int img_idx = s->scene.thermal.getNetworkType() == cereal::ThermalData::NetworkType::NONE ? 0 : network_strength_map[s->scene.thermal.getNetworkStrength()]; </s> remove                ((battery_img_w - 19) * (s->scene.batteryPercent * 0.01)), battery_img_h - 11, COLOR_WHITE);
 </s> add                ((battery_img_w - 19) * (s->scene.thermal.getBatteryPercent() * 0.01)), battery_img_h - 11, COLOR_WHITE); </s> remove   draw_chevron(s, d_rel, y_rel, 25, nvgRGBA(201, 34, 49, fillAlpha), COLOR_YELLOW);
 </s> add   draw_chevron(s, d_rel, lead.getYRel(), 25, nvgRGBA(201, 34, 49, fillAlpha), COLOR_YELLOW); </s> remove static void draw_lead(UIState *s, float d_rel, float v_rel, float y_rel){
 </s> add static void draw_lead(UIState *s, const cereal::RadarState::LeadData::Reader &lead){
  if (s->sm->update(0) > 0){
    }
  }
  
  static void check_messages(UIState *s) {
  if (s->sm->update(0) > 0){
  if (s->sm->update(0) > 0){
  if (s->sm->update(0) > 0){
      handle_message(s, *(s->sm));
    }
  }
  
  static void ui_update(UIState *s) {
keep keep keep keep replace replace replace keep keep keep keep keep
 ui.cc: remove variables from UIScene, use event::Reader to get data  (#1585)

* use struct to store lead status

* remove white space

* use RadarState::LeadData::Reader

* use reader to get thermal data

* use reader

* continue

* remove variables

reset submodules,fix some errors

reset submodules

revert

* remove s->scene.gps_planner_active

* modify

* cleanup

* done

* resolve conflict

* remove irrelevant comment

* remove white space 
selfdrive/ui/ui.cc