diff --git a/sw/ground_segment/cockpit/page_settings.ml b/sw/ground_segment/cockpit/page_settings.ml index 4080915016..d84278c5af 100644 --- a/sw/ground_segment/cockpit/page_settings.ml +++ b/sw/ground_segment/cockpit/page_settings.ml @@ -36,10 +36,14 @@ object let (alt_a, alt_b) = Ocaml_tools.affine_transform auc in (float_of_string current_value#text -. alt_b) /. alt_a method update = fun s -> - if current_value#text <> s then begin - current_value#set_text s; - try set_default (float_of_string s) with Failure "float_of_string" -> () - end + (* value of infinity (string "inf") means it is not yet confirmed, so display "?" *) + if s = "inf" then + current_value#set_text "?" + else + if current_value#text <> s then begin + current_value#set_text s; + try set_default (float_of_string s) with Failure "float_of_string" -> () + end end let pipe_regexp = Str.regexp "|" @@ -199,7 +203,8 @@ let one_setting = fun (i:int) (do_change:int -> float -> unit) packing dl_settin let _icon = GMisc.image ~stock:`APPLY ~packing:commit_but#add () in let callback = fun x -> prev_value := (try Some ((float_of_string current_value#text-.alt_b)/.alt_a) with _ -> None); - commit x + commit x; + current_value#set_text "?" in ignore (commit_but#connect#clicked ~callback); tooltips#set_tip commit_but#coerce ~text:"Commit"; diff --git a/sw/ground_segment/tmtc/aircraft.ml b/sw/ground_segment/tmtc/aircraft.ml index 2d854e2992..e433593e02 100644 --- a/sw/ground_segment/tmtc/aircraft.ml +++ b/sw/ground_segment/tmtc/aircraft.ml @@ -217,7 +217,7 @@ let new_aircraft = fun id name fp airframe -> cam = { phi = 0.; theta = 0. ; target=(0.,0.)}; fbw = { rc_status = "???"; rc_mode = "???"; rc_rate=0; pprz_mode_msgs_since_last_fbw_status_msg=0 }; svinfo = svsinfo_init; - dl_setting_values = Array.create max_nb_dl_setting_values 42.; + dl_setting_values = Array.create max_nb_dl_setting_values infinity; nb_dl_setting_values = 0; horiz_mode = UnknownHorizMode; horizontal_mode = 0; diff --git a/sw/ground_segment/tmtc/server.ml b/sw/ground_segment/tmtc/server.ml index a184cc612e..c4c661df73 100644 --- a/sw/ground_segment/tmtc/server.ml +++ b/sw/ground_segment/tmtc/server.ml @@ -677,7 +677,11 @@ let setting = fun logging _sender vs -> "ac_id", Pprz.String ac_id; "value", List.assoc "value" vs] in Dl_Pprz.message_send dl_id "SETTING" vs; - log logging ac_id "SETTING" vs + log logging ac_id "SETTING" vs; + (* mark the setting as not yet confirmed *) + let ac = Hashtbl.find aircrafts ac_id in + let idx = Pprz.int_of_value (List.assoc "index" vs) in + ac.dl_setting_values.(idx) <- infinity (** Got a GET_DL_SETTING, and send an GET_SETTING *)