mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-01 04:46:51 +08:00
[Server] modify ac_id field of CONFIG message for replay sessions (#2616)
* [server] Send real ID with CONFIG message instead of the original ID. * Fix pprz_connect to accept non integer ac ids. Makes "conf_by_id" docstring true. * Makes suggested modifications.
This commit is contained in:
@@ -749,9 +749,9 @@ let listen_intruders = fun log ->
|
|||||||
ignore(Ground_Pprz.message_bind "INTRUDER" (update_intruder log))
|
ignore(Ground_Pprz.message_bind "INTRUDER" (update_intruder log))
|
||||||
|
|
||||||
let send_config = fun http _asker args ->
|
let send_config = fun http _asker args ->
|
||||||
let ac_id' = PprzLink.string_assoc "ac_id" args in
|
let real_id = PprzLink.string_assoc "ac_id" args in
|
||||||
try
|
try
|
||||||
let _is_replayed, ac_id, root_dir, conf_xml = replayed ac_id' in
|
let _is_replayed, ac_id, root_dir, conf_xml = replayed real_id in
|
||||||
|
|
||||||
let conf = ExtXml.child conf_xml "aircraft" ~select:(fun x -> ExtXml.attrib x "ac_id" = ac_id) in
|
let conf = ExtXml.child conf_xml "aircraft" ~select:(fun x -> ExtXml.attrib x "ac_id" = ac_id) in
|
||||||
let ac_name = ExtXml.attrib conf "name" in
|
let ac_name = ExtXml.attrib conf "name" in
|
||||||
@@ -770,7 +770,7 @@ let send_config = fun http _asker args ->
|
|||||||
"settings.xml") else "file://replay" in
|
"settings.xml") else "file://replay" in
|
||||||
let col = try Xml.attrib conf "gui_color" with _ -> new_color () in
|
let col = try Xml.attrib conf "gui_color" with _ -> new_color () in
|
||||||
let ac_name = try Xml.attrib conf "name" with _ -> "" in
|
let ac_name = try Xml.attrib conf "name" with _ -> "" in
|
||||||
[ "ac_id", PprzLink.String ac_id;
|
[ "ac_id", PprzLink.String real_id;
|
||||||
"flight_plan", PprzLink.String fp;
|
"flight_plan", PprzLink.String fp;
|
||||||
"airframe", PprzLink.String af;
|
"airframe", PprzLink.String af;
|
||||||
"radio", PprzLink.String rc;
|
"radio", PprzLink.String rc;
|
||||||
@@ -779,7 +779,7 @@ let send_config = fun http _asker args ->
|
|||||||
"ac_name", PprzLink.String ac_name ]
|
"ac_name", PprzLink.String ac_name ]
|
||||||
with
|
with
|
||||||
Not_found ->
|
Not_found ->
|
||||||
failwith (sprintf "ground UNKNOWN %s" ac_id')
|
failwith (sprintf "ground UNKNOWN %s" real_id)
|
||||||
|
|
||||||
let ivy_server = fun http ->
|
let ivy_server = fun http ->
|
||||||
ignore (Ground_Pprz.message_answerer my_id "AIRCRAFTS" send_aircrafts_msg);
|
ignore (Ground_Pprz.message_answerer my_id "AIRCRAFTS" send_aircrafts_msg);
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class PprzConnect(object):
|
|||||||
msg['flight_plan'], msg['settings'], msg['radio'],
|
msg['flight_plan'], msg['settings'], msg['radio'],
|
||||||
msg['default_gui_color'])
|
msg['default_gui_color'])
|
||||||
self._conf_list_by_name[conf.name] = conf
|
self._conf_list_by_name[conf.name] = conf
|
||||||
self._conf_list_by_id[int(conf.id)] = conf
|
self._conf_list_by_id[conf.id] = conf
|
||||||
if self._notify is not None:
|
if self._notify is not None:
|
||||||
self._notify(conf) # user defined general callback
|
self._notify(conf) # user defined general callback
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
|
|||||||
Reference in New Issue
Block a user