diff --git a/conf/airframes/ENAC/fixed-wing/jp.xml b/conf/airframes/ENAC/fixed-wing/jp.xml index 2436cfd0b6..b31dc52a10 100644 --- a/conf/airframes/ENAC/fixed-wing/jp.xml +++ b/conf/airframes/ENAC/fixed-wing/jp.xml @@ -175,6 +175,7 @@
+
diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml index 24b60a1461..083896f8ff 100644 --- a/sw/ground_segment/cockpit/live.ml +++ b/sw/ground_segment/cockpit/live.ml @@ -386,13 +386,16 @@ let get_rc_max_rate = fun af_xml -> let get_bat_levels = fun af_xml -> let default_catastrophic_level = 9. - and default_max_level = 12.5 in + and default_max_level = 12.5 + and default_nb_cell = None in try let bat_section = ExtXml.child af_xml ~select:(fun x -> Xml.attrib x "name" = "BAT") "section" in let fvalue = fun name default -> try ExtXml.float_attrib (ExtXml.child bat_section ~select:(fun x -> ExtXml.attrib x "name" = name) "define") "value" with _ -> default in - fvalue "CATASTROPHIC_BAT_LEVEL" default_catastrophic_level, fvalue "MAX_BAT_LEVEL" default_max_level - with _ -> (default_catastrophic_level, default_max_level) + let fvalue_opt = fun name default -> + try Some (ExtXml.float_attrib (ExtXml.child bat_section ~select:(fun x -> ExtXml.attrib x "name" = name) "define") "value") with _ -> default in + fvalue "CATASTROPHIC_BAT_LEVEL" default_catastrophic_level, fvalue "MAX_BAT_LEVEL" default_max_level, fvalue_opt "BAT_NB_CELLS" default_nb_cell + with _ -> (default_catastrophic_level, default_max_level, default_nb_cell) let get_alt_shift = fun af_xml -> let default_plus_plus = 30. @@ -528,10 +531,11 @@ let create_ac = fun ?(confirm_kill=true) alert (geomap:G.widget) (acs_notebook:G ac_notebook#page_num w#coerce = ac_notebook#current_page in (** Add a strip *) - let min_bat, max_bat = get_bat_levels af_xml in + let min_bat, max_bat, nb_cell_bat = get_bat_levels af_xml in let alt_shift_plus_plus, alt_shift_plus, alt_shift_minus = get_alt_shift af_xml in let icons_theme = get_icons_theme af_xml in - let param = { Strip.color = color; min_bat = min_bat; max_bat = max_bat; + let param = { Strip.color = color; + min_bat = min_bat; max_bat = max_bat; nb_cell_bat = nb_cell_bat; alt_shift_plus_plus = alt_shift_plus_plus; alt_shift_plus = alt_shift_plus; alt_shift_minus = alt_shift_minus; diff --git a/sw/ground_segment/cockpit/strip.ml b/sw/ground_segment/cockpit/strip.ml index 2b7cd094bc..b7f5e9a302 100644 --- a/sw/ground_segment/cockpit/strip.ml +++ b/sw/ground_segment/cockpit/strip.ml @@ -55,6 +55,7 @@ type strip_param = { color : string; min_bat : float; max_bat : float; + nb_cell_bat : float option; alt_shift_plus_plus : float; alt_shift_plus : float; alt_shift_minus : float; @@ -197,6 +198,7 @@ let add = fun config strip_param (strips:GPack.box) -> let color = strip_param.color and min_bat = strip_param.min_bat and max_bat = strip_param.max_bat + and nb_cell_bat = strip_param.nb_cell_bat and alt_shift_plus_plus = strip_param.alt_shift_plus_plus and alt_shift_plus = strip_param.alt_shift_plus and alt_shift_minus = strip_param.alt_shift_minus in @@ -307,7 +309,9 @@ object agl#set ~arrow value [0.2, (sprintf "%3.0f" value); 0.8, sprintf "%+.1f" climb] method set_bat value = let v = if value < 0.1 then "UNK" else (string_of_float value) in - bat#set value [0.5, v] + match nb_cell_bat with + | None -> bat#set value [0.5, v] + | Some nb -> bat#set value [0.3, v; 0.7, sprintf "%.1f /c" (value /. nb)] method set_throttle ?(kill=false) value = let background = if kill then "red" else "orange" in throttle#set ~background value (sprintf "%.0f%%" value) diff --git a/sw/ground_segment/cockpit/strip.mli b/sw/ground_segment/cockpit/strip.mli index f40a87c180..7b4dabc524 100644 --- a/sw/ground_segment/cockpit/strip.mli +++ b/sw/ground_segment/cockpit/strip.mli @@ -55,6 +55,7 @@ type strip_param = { color : string; min_bat : float; max_bat : float; + nb_cell_bat : float option; alt_shift_plus_plus : float; alt_shift_plus : float; alt_shift_minus : float;