cleanup settings and periodic telemetry a bit

- don't always include "generated/periodic_telemetry.h" in generated/settings.h
- instead add module="generated/periodic_telemetry" in the generated settings_telemetry.xml
- remove unused periodic telemetry stuff from some test progs
- generators: print out from which tool the file has been generated
This commit is contained in:
Felix Ruess
2014-12-06 13:08:49 +01:00
parent caf762d1ff
commit 20ce44adc6
18 changed files with 23 additions and 32 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ let () =
let messages = Syntax.read filename class_name in
(** Print file header *)
Printf.fprintf h "/* Automatically generated from %s */\n" filename;
Printf.fprintf h "/* Automatically generated by gen_abi from %s */\n" filename;
Printf.fprintf h "/* Please DO NOT EDIT */\n\n";
Printf.fprintf h "/* Onboard middleware library ABI\n";
Printf.fprintf h " * send and receive messages of class %s\n" class_name;
+1 -1
View File
@@ -274,7 +274,7 @@ let extract_makefile = fun ac_id airframe_file makefile_ac ->
let xml = Xml.parse_file airframe_file in
let f = open_out makefile_ac in
fprintf f "# This file has been generated from %s by %s\n" airframe_file Sys.argv.(0);
fprintf f "# This file has been generated by gen_aircraft from %s by %s\n" airframe_file Sys.argv.(0);
fprintf f "# Please DO NOT EDIT\n";
fprintf f "AC_ID=%s\n" ac_id;
+1 -1
View File
@@ -369,7 +369,7 @@ let parse_and_gen_modes xml_file ap_name main_freq h_dir sm =
(* Output settings xml file *)
let write_settings = fun xml_file out_set ap ->
fprintf out_set "<!-- This file has been generated from %s -->\n" xml_file;
fprintf out_set "<!-- This file has been generated by gen_autopilot from %s -->\n" xml_file;
fprintf out_set "<!-- Please DO NOT EDIT -->\n\n";
fprintf out_set "<settings>\n";
fprintf out_set " <dl_settings>\n";
+1 -1
View File
@@ -779,7 +779,7 @@ let () =
printf "%s\n" (ExtXml.to_string_fmt dump_xml)
else begin
let h_name = "FLIGHT_PLAN_H" in
printf "/* This file has been generated from %s */\n" !xml_file;
printf "/* This file has been generated by gen_flight_plan from %s */\n" !xml_file;
printf "/* Please DO NOT EDIT */\n\n";
printf "#ifndef %s\n" h_name;
+1 -1
View File
@@ -359,7 +359,7 @@ let () =
let h = stdout in
Printf.fprintf h "/* Automatically generated from %s */\n" filename;
Printf.fprintf h "/* Automatically generated by gen_messages from %s */\n" filename;
Printf.fprintf h "/* Please DO NOT EDIT */\n";
Printf.fprintf h "/* Macros to send and receive messages of class %s */\n" class_name;
+1 -1
View File
@@ -311,7 +311,7 @@ let () =
let h = stdout in
Printf.fprintf h "/* Automatically generated from %s */\n" filename;
Printf.fprintf h "/* Automatically generated by gen_messages2 from %s */\n" filename;
Printf.fprintf h "/* Please DO NOT EDIT */\n";
Printf.fprintf h "/* Macros to send and receive messages of class %s */\n" class_name;
+1 -1
View File
@@ -316,7 +316,7 @@ let check_dependencies = fun modules names ->
) modules
let write_settings = fun xml_file out_set modules ->
fprintf out_set "<!-- This file has been generated from %s -->\n" xml_file;
fprintf out_set "<!-- This file has been generated by gen_modules from %s -->\n" xml_file;
fprintf out_set "<!-- Please DO NOT EDIT -->\n\n";
fprintf out_set "<settings>\n";
fprintf out_set " <dl_settings>\n";
+1 -1
View File
@@ -151,7 +151,7 @@ let _ =
let xml_file = Sys.argv.(1) in
try
let xml = Xml.parse_file xml_file in
fprintf out "/* Generated from %s */\n" xml_file;
fprintf out "/* Generated by gen_mtk from %s */\n" xml_file;
fprintf out "/* Please DO NOT EDIT */\n\n";
define "MTK_DIY14_SYNC1" "0xB5";
+3 -3
View File
@@ -100,7 +100,7 @@ let output_modes = fun out_h process_name modes freq modules ->
let write_settings = fun xml_file out_set telemetry_xml ->
(* filter xml file to remove unneeded process and modes (more than 1 mode per process) *)
let filtered_xml = List.filter (fun p -> List.length (Xml.children p) > 1) (Xml.children telemetry_xml) in
fprintf out_set "<!-- This file has been generated from %s -->\n" xml_file;
fprintf out_set "<!-- This file has been generated by gen_periodic from %s -->\n" xml_file;
fprintf out_set "<!-- Please DO NOT EDIT -->\n\n";
fprintf out_set "<settings>\n";
if List.length filtered_xml > 0 then begin
@@ -115,7 +115,7 @@ let write_settings = fun xml_file out_set telemetry_xml ->
match nb_modes with
| 0 | 1 -> () (* Nothing to do if 1 or zero mode *)
| _ -> (* add settings with all modes *)
fprintf out_set " <dl_setting min=\"0\" step=\"1\" max=\"%d\" var=\"telemetry_mode_%s\" shortname=\"%s\" values=\"%s\">\n" (nb_modes-1) process_name process_name (String.concat "|" modes);
fprintf out_set " <dl_setting min=\"0\" step=\"1\" max=\"%d\" var=\"telemetry_mode_%s\" shortname=\"%s\" values=\"%s\" module=\"generated/periodic_telemetry\">\n" (nb_modes-1) process_name process_name (String.concat "|" modes);
let i = ref 0 in
List.iter (fun m -> try
let key = Xml.attrib m "key_press" in
@@ -146,7 +146,7 @@ let _ =
let out_h = stdout in
fprintf out_h "/* This file has been generated from %s and %s */\n" Sys.argv.(2) Sys.argv.(3);
fprintf out_h "/* This file has been generated by gen_periodic from %s and %s */\n" Sys.argv.(2) Sys.argv.(3);
fprintf out_h "/* Please DO NOT EDIT */\n\n";
fprintf out_h "#ifndef _VAR_PERIODIC_H_\n";
fprintf out_h "#define _VAR_PERIODIC_H_\n\n";
+1 -1
View File
@@ -138,7 +138,7 @@ let _ =
let xml_file = Sys.argv.(1) in
let xml = Xml.parse_file xml_file in
printf "/* This file has been generated from %s */\n" xml_file;
printf "/* This file has been generated by gen_radio from %s */\n" xml_file;
printf "/* Please DO NOT EDIT */\n\n";
printf "#ifndef %s\n" h_name;
define h_name "";
+1 -2
View File
@@ -65,7 +65,6 @@ let print_dl_settings = fun settings ->
lprintf "\n";
StringSet.iter (fun m -> lprintf "#include \"%s.h\"\n" m) !modules;
lprintf "#include \"generated/modules.h\"\n";
lprintf "#include \"generated/periodic_telemetry.h\"\n";
lprintf "\n";
(** Datalink knowing what settings mean **)
@@ -326,7 +325,7 @@ let _ =
done;
try
printf "/* This file has been generated from %s */\n" (String.concat " " !xml_files);
printf "/* This file has been generated by gen_settings from %s */\n" (String.concat " " !xml_files);
printf "/* Please DO NOT EDIT */\n\n";
printf "#ifndef %s\n" h_name;
+1 -1
View File
@@ -153,7 +153,7 @@ let _ =
let xml_file = Sys.argv.(1) in
try
let xml = Xml.parse_file xml_file in
fprintf out "/* Generated from %s */\n" xml_file;
fprintf out "/* Generated by gen_ubx from %s */\n" xml_file;
fprintf out "/* Please DO NOT EDIT */\n\n";
define "UBX_SYNC1" "0xB5";
+1 -1
View File
@@ -225,7 +225,7 @@ let _ =
let xml_file = Sys.argv.(1) in
try
let xml = Xml.parse_file xml_file in
fprintf out "/* Generated from %s */\n" xml_file;
fprintf out "/* Generated by gen_xsens from %s */\n" xml_file;
fprintf out "/* Please DO NOT EDIT */\n\n";
define "XSENS_START" "0xFA";