Replay settings (#2754)

* [replay] remove legacy code.

* [replay] Generate settings file.
This commit is contained in:
Fabien-B
2021-08-16 18:18:05 +02:00
committed by GitHub
parent c3a43bfd6d
commit 8ffd3dfcaf
2 changed files with 3 additions and 6 deletions
+1 -2
View File
@@ -772,8 +772,7 @@ let send_config = fun http _asker args ->
let fp = prefix ("var" // "aircrafts" // ac_name // "flight_plan.xml")
and af = prefix ("conf" // ExtXml.attrib conf "airframe")
and rc = prefix ("conf" // ExtXml.attrib conf "radio")
and settings = if not _is_replayed then prefix ("var" // "aircrafts" // ac_name //
"settings.xml") else "file://replay" in
and settings = prefix ("var" // "aircrafts" // ac_name // "settings.xml") in
let col = try Xml.attrib conf "gui_color" with _ -> new_color () in
let ac_name = try Xml.attrib conf "name" with _ -> "" in
[ "ac_id", PprzLink.String real_id;
+2 -4
View File
@@ -49,15 +49,13 @@ let store_conf = fun conf acs ->
let ac_dir = replay_dir // "var" // "aircrafts" // ac_name in
let w = fun s ->
(* Histotical: still useful ? *)
let f = replay_dir // "conf" // ExtXml.attrib x s in
write_xml f (ExtXml.child x s);
(* Write in the conf/ directory of the A/C *)
let f = ac_dir // "conf" // ExtXml.attrib x s in
write_xml f (ExtXml.child x s);
f in
ignore (w "airframe");
ignore (w "radio");
let f_settings = ac_dir // "settings.xml" in
write_xml f_settings (ExtXml.child x "generated_settings");
(* test if flight plan is an original one or the dumped version *)
let orig_fp = List.exists (fun e -> compare (Xml.tag e) "flight_plan" = 0) (Xml.children x) in
if orig_fp then begin