Icons in strips

This commit is contained in:
Pascal Brisset
2007-10-09 07:18:51 +00:00
parent e767d536b4
commit a090d024b3
9 changed files with 51 additions and 25 deletions
+3 -3
View File
@@ -161,7 +161,7 @@
<define name="ROLL_RATE_DGAIN" value="0."/>
<define name="ROLL_RATE_SUM_NB_SAMPLES" value="64"/>
<define name="ROLL_SLEW" value="0.05"/>
<define name="ROLL_SLEW" value="0.1"/>
</section>
<section name="NAV">
@@ -261,7 +261,7 @@ ap.srcs += gyro.c
ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A
ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/baro_MS5534A.c
ap.srcs += bomb.c
ap.srcs += nav_line.c
# Harware In The Loop
@@ -272,7 +272,7 @@ ap.srcs += bomb.c
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN -DIR_360 -DUSE_BARO_MS5534A
sim.srcs += nav_survey_rectangle.c $(SRC_ARCH)/sim_baro.c bomb.c
sim.srcs += nav_survey_rectangle.c $(SRC_ARCH)/sim_baro.c bomb.c nav_line.c
</makefile>
</airframe>
+5 -5
View File
@@ -1,6 +1,6 @@
<!DOCTYPE flight_plan SYSTEM "flight_plan.dtd">
<flight_plan alt="75" ground_alt="0" lat0="43.4622" lon0="1.2729" max_dist_from_home="1500" name="Versatile" qfu="270" security_height="25">
<flight_plan alt="75" ground_alt="0" lat0="43.4622" lon0="1.2729" max_dist_from_home="1500" name="Basic" qfu="270" security_height="25">
<header>
#include "nav_line.h"
</header>
@@ -31,13 +31,13 @@
<set value="1" var="kill_throttle"/>
<attitude roll="0" throttle="0" vmode="throttle"/>
</block>
<block name="Takeoff" strip_button="Takeoff">
<block name="Takeoff" strip_icon="gtk-media-play" strip_button="Takeoff">
<exception cond="estimator_z > ground_alt+25" deroute="Standby"/>
<set value="0" var="kill_throttle"/>
<set value="0" var="estimator_flight_time"/>
<go wp="CLIMB"/>
</block>
<block name="Standby" strip_button="Standby">
<block name="Standby" strip_button="Standby" strip_icon="gtk-home">
<circle radius="nav_radius" wp="STDBY"/>
</block>
<block name="Figure 8 around wp 1" strip_button="8">
@@ -46,12 +46,12 @@
<block name="Oval 1-2" strip_button="0">
<oval p1="1" p2="2" radius="nav_radius"/>
</block>
<block name="MOB" strip_button="MOB">
<block name="MOB" strip_button="Turn around here" strip_icon="gtk-refresh">
<call fun="NavSetWaypointHere(WP_MOB)"/>
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
<circle radius="nav_radius" wp="MOB"/>
</block>
<block name="Line 1-2">
<block name="Line 1-2" strip_button="Line 1-2" strip_icon="gtk-remove">
<call fun="nav_line_init()"/>
<call fun="nav_line(WP_1, WP_2, nav_radius)"/>
</block>
+1
View File
@@ -82,6 +82,7 @@ file CDATA #REQUIRED>
<!ATTLIST block
name CDATA #REQUIRED
strip_button CDATA #IMPLIED
strip_icon CDATA #IMPLIED
description CDATA #IMPLIED>
<!ATTLIST exception
+3 -4
View File
@@ -13,7 +13,6 @@
<waypoint name="S1" x="-151.6" y="80.4"/>
<waypoint name="S2" x="180.1" y="214.9"/>
<waypoint alt="30" name="AF" x="200" y="-10"/>
<waypoint name="TOD" x="8.0" y="-22.7"/>
<waypoint alt="0" name="TD" x="80.0" y="20.0"/>
<waypoint name="BASELEG" x="26.9" y="-23.0"/>
<waypoint name="_1" x="-100" y="0"/>
@@ -50,7 +49,7 @@
<go wp="CLIMB"/>
</block>
<block name="Standby" strip_button="Standby">
<circle radius="nav_radius" wp="1"/>
<circle radius="nav_radius" wp="STDBY"/>
</block>
<block name="Figure 8 around wp 1">
<eight center="1" radius="nav_radius" turn_around="2"/>
@@ -116,10 +115,10 @@
</block>
<block name="final">
<exception cond="ground_alt + 10 > estimator_z" deroute="flare"/>
<go from="TOD" hmode="route" vmode="glide" wp="TD"/>
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
</block>
<block name="flare">
<go approaching_time="0" from="TOD" hmode="route" throttle="0.0" vmode="throttle" wp="TD"/>
<go approaching_time="0" from="AF" hmode="route" throttle="0.0" vmode="throttle" wp="TD"/>
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/>
</block>
<block name="Steps roll -10, +10">
+1 -2
View File
@@ -6,10 +6,9 @@
<columns>
<rows size="390">
<widget size="200" name="strips"/>
<widget name="alarms"/>
</rows>
<widget size="400" name="aircraft"/>
<widget size="00" name="plugin"/>
<widget name="alarms"/>
</columns>
</rows>
</layout>
+5 -2
View File
@@ -12,9 +12,12 @@
<strip_button name="AUTO2" value="2"/>
</dl_setting>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="launch">
<strip_button name="Launch" value="1"/>
<strip_button icon="gtk-execute" name="Launch" value="1"/>
</dl_setting>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle">
<strip_button icon="gtk-stop" name="KILL" value="1"/>
<strip_button icon="gtk-redo" name="Resurrect" value="1"/>
</dl_setting>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/>
</dl_settings>
</dl_settings>
</settings>
+1
View File
@@ -34,6 +34,7 @@ auto CDATA #IMPLIED
<!ATTLIST strip_button
name CDATA #REQUIRED
icon CDATA #IMPLIED
value CDATA #IMPLIED
>
+20 -8
View File
@@ -272,10 +272,10 @@ let mark = fun (geomap:G.widget) ac_id track plugin_frame ->
(** Light display of attributes in the flight plan. *)
let attributes_pretty_printer = fun attribs ->
(* Remove the "no" an "strip_button" attributes *)
(* Remove the "no", "strip_icon" and "strip_button" attributes *)
let valid = fun a ->
let a = String.lowercase a in
a <> "no" && a <> "strip_button" in
a <> "no" && a <> "strip_icon" && a <> "strip_button" in
let attribs = List.filter (fun (a, _) -> valid a) attribs in
@@ -386,11 +386,23 @@ let create_ac = fun alert (geomap:G.widget) (acs_notebook:GPack.notebook) (ac_id
fp#waypoints;
(** Add the short cut buttons in the strip *)
List.iter (fun b ->
try
let label = ExtXml.attrib b "strip_button"
and id = ExtXml.int_attrib b "no" in
let b = GButton.button ~label () in
let tooltips = GData.tooltips () in
List.iter (fun block ->
try (* Is it a strip button ? *)
let label = ExtXml.attrib block "strip_button"
and id = ExtXml.int_attrib block "no" in
let b =
try (* Is it an icon ? *)
let icon = Xml.attrib block "strip_icon" in
let b = GButton.button () in
ignore (GMisc.image ~stock:(`STOCK icon) ~packing:b#add ());
(* Associates the label as a tooltip *)
tooltips#set_tip b#coerce ~text:label;
b
with
Xml.No_attribute _ -> (* It's not an icon *)
GButton.button ~label () in
strip#add_widget b#coerce;
ignore (b#connect#clicked (fun _ -> jump_to_block ac_id id))
with
@@ -402,7 +414,7 @@ let create_ac = fun alert (geomap:G.widget) (acs_notebook:GPack.notebook) (ac_id
(ac_notebook:GPack.notebook)#append_page ~tab_label:fp_label#coerce fp#window#coerce;
let infrared_label = GMisc.label ~text: "Infrared" () in
let infrared_frame = GBin.frame ~shadow_type: `NONE
let infrared_frame = GBin.frame ~show:false ~shadow_type: `NONE
~packing: (ac_notebook#append_page ~tab_label: infrared_label#coerce) () in
let ir_page = new Pages.infrared infrared_frame in
+12 -1
View File
@@ -297,7 +297,18 @@ let one_setting = fun i do_change packing s (tooltips:GData.tooltips) strip ->
assert(ExtXml.tag_is x "strip_button");
let label = ExtXml.attrib x "name"
and sp_value = ExtXml.float_attrib x "value" in
let b = GButton.button ~label () in
let b =
try (* Is it an icon ? *)
let icon = Xml.attrib x "icon" in
let b = GButton.button () in
ignore (GMisc.image ~stock:(`STOCK icon) ~packing:b#add ());
(* Associates the label as a tooltip *)
tooltips#set_tip b#coerce ~text:label;
b
with
Xml.No_attribute _ ->
GButton.button ~label () in
(strip b#coerce : unit);
ignore (b#connect#clicked (fun _ -> do_change i sp_value)))
(Xml.children s);