diff --git a/sw/ground_segment/tmtc/Makefile b/sw/ground_segment/tmtc/Makefile index fd1f52f26d..7e4c795f17 100644 --- a/sw/ground_segment/tmtc/Makefile +++ b/sw/ground_segment/tmtc/Makefile @@ -31,12 +31,15 @@ OCAMLC = ocamlc OCAMLOPT = ocamlopt INCLUDES= -I ../../lib/ocaml -I +lablgtk2 -messages: messages.ml - $(OCAMLC) $(INCLUDES) -o /dev/null unix.cma xml-light.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma gtkInit.cmo str.cma lib-pprz.cma $^ # To check - cat ../../../pprz_src_test.sh > $@ - echo 'lablgtk2 str.cma ivy-ocaml.cma -I $$PAPARAZZI_SRC/sw/lib/ocaml lib-pprz.cma $$PAPARAZZI_SRC/sw/ground_segment/tmtc/$< $$*' >> $@ - chmod a+x $@ +#messages: messages.ml +# $(OCAMLC) $(INCLUDES) -o /dev/null unix.cma xml-light.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma gtkInit.cmo str.cma lib-pprz.cma $^ # To check +# cat ../../../pprz_src_test.sh > $@ +# echo 'lablgtk2 str.cma ivy-ocaml.cma -I $$PAPARAZZI_SRC/sw/lib/ocaml lib-pprz.cma -I $$PAPARAZZI_SRC/sw/ground_segment/tmtc $$PAPARAZZI_SRC/sw/ground_segment/tmtc/$< $$*' >> $@ +# chmod a+x $@ +messages : messages.ml + $(OCAMLOPT) $(INCLUDES) -o $@ str.cmxa unix.cmxa xml-light.cmxa glibivy-ocaml.cmxa -I +lablgtk2 lablgtk.cmxa gtkInit.cmx lib-pprz.cmxa $^ + strip $@ receive : modem.cmo receive.ml $(OCAMLC) $(INCLUDES) -o $@ str.cma unix.cma xml-light.cma glibivy-ocaml.cma -I +lablgtk2 lablgtk.cma lib-pprz.cma $^ #To check diff --git a/sw/ground_segment/tmtc/messages.ml b/sw/ground_segment/tmtc/messages.ml index 9d8e453216..06e6bfe1d9 100644 --- a/sw/ground_segment/tmtc/messages.ml +++ b/sw/ground_segment/tmtc/messages.ml @@ -55,15 +55,19 @@ let format = fun field -> open GMain let _ = - let bus = ref "127.255.255.255:2010" in + let ivy_bus = ref "127.255.255.255:2010" in (* let classes = ref ["telemetry_ap";"ground"] in *) let classes = ref [] in Arg.parse - [ "-b", Arg.String (fun x -> bus := x), "Bus\tDefault is 127.255.255.25:2010"; + [ "-b", Arg.String (fun x -> ivy_bus := x), "Bus\tDefault is 127.255.255.255:2010"; "-c", Arg.String (fun x -> classes := x :: !classes), "class name"] (fun x -> prerr_endline ("WARNING: don't do anything with "^x)) "Usage: "; + + Ivy.init "Paparazzi messages" "READY" (fun _ _ -> ()); + Ivy.start !ivy_bus; + let xml = Xml.parse_file xml_file in let window = GWindow.window ~title:"Paparazzi messages" () in @@ -133,8 +137,7 @@ let _ = messages in window#show (); + let loop = Glib.Main.create true in + while Glib.Main.is_running loop do ignore (Glib.Main.iteration true) done - Ivy.init "Paparazzi messages" "READY" (fun _ _ -> ()); - Ivy.start !bus; - - GMain.Main.main () +(* GMain.Main.main () *)