diff --git a/gui/dialogs/gps.xml b/gui/dialogs/gps.xml
index a12d7a7c3..a5c23f96a 100644
--- a/gui/dialogs/gps.xml
+++ b/gui/dialogs/gps.xml
@@ -2,321 +2,594 @@
- gps
620
430
false
-
- 280
- 400
-
-
+
+
+ var gps = props.globals.getNode("/instrumentation/gps/", 1);
+ var dlg = props.globals.getNode("/sim/gui/dialogs/gps", 1);
+ var cmd = gps.getNode("command", 1);
+ var scratch = gps.getNode("scratch");
+
+ scratch.getNode("exact", 1).setBoolValue(0);
+ var searchType = scratch.getNode("type", 1);
+ var searchQuery = scratch.getNode("query", 1);
+
+ var copySearchArgs = func {
+ searchType.setValue(dlg.getNode("search-type").getValue());
+ searchQuery.setValue(dlg.getNode("search-query").getValue());
+ }
+
+
+
+ gps
+ vbox
+
+
+
+
+
+
+
+ table
+
+
+ 0
+ 0
+
+ Mode: %s
+ /instrumentation/gps/mode
+ true
+
+
+
+
+
+ /instrumentation/gps/mode
+ leg
+
+
+
+ 0
+ 1
+
+ Current Route Wp: %03d
+ /autopilot/route-manager/current-wp
+ true
+
+
+
+
+
+ /instrumentation/gps/mode
+ obs
+
+
+
+ 0
+ 1
+
+ Selected Course: %5.1f*
+ /instrumentation/gps/selected-course-deg
+ true
+
+
+
+ 0
+ 2
+
+ Xtrack: %5.2fnm
+ /instrumentation/gps/wp/wp[1]/course-error-nm
+ true
+
+
+
+ 1
+ 0
+
+ Longitude: %6.3f
+ /instrumentation/gps/indicated-longitude-deg
+ true
+
+
+ 1
+ 1
+
+ Latitude: %6.3f
+ /instrumentation/gps/indicated-latitude-deg
+ true
+
+
+ 1
+ 2
+
+ Altitude: %6.0fft
+ /instrumentation/gps/indicated-altitude-ft
+ true
+
+
+
+ 2
+ 0
+
+ Groundspeed: %4.0fkts
+ /instrumentation/gps/indicated-ground-speed-kt
+ true
+
+
+ 2
+ 1
+
+ Track: %3.0f*
+ /instrumentation/gps/indicated-track-magnetic-deg
+ true
+
+
+ 2
+ 2
+
+ VS: %4.0ffpm
+ /instrumentation/gps/indicated-vertical-speed
+ true
+
+
+
+ 3
+ 0
+
+ Odometer: %4.1fnm
+ /instrumentation/gps/odometer
+ true
+
+
+
+ 3
+ 1
+
+ RAIM: %3.2f
+ /instrumentation/gps/raim
+ true
+
+
+
+
+ 4
+ 0
+
+ Ident: %s
+ /instrumentation/gps/wp/wp[1]/ID
+ true
+
+
+
+ 4
+ 1
+ 2
+
+ Name: %s
+ /instrumentation/gps/wp/wp[1]/name
+ true
+
+
+
+ 5
+ 0
+
+ Longitude: %6.3f
+ /instrumentation/gps/wp/wp[1]/longitude-deg
+ true
+
+
+ 5
+ 1
+
+ Latitude: %6.3f
+ /instrumentation/gps/wp/wp[1]/latitude-deg
+ true
+
+
+ 5
+ 2
+
+ Altitude: %6.0fft
+ /instrumentation/gps/wp/wp[1]/altitude-ft
+ true
+
+
+
+
+ 6
+ 0
+
+ Bearing: %3.0f
+ /instrumentation/gps/wp/wp[1]/bearing-mag-deg
+ true
+
+
+ 6
+ 1
+
+ Distance: %5.2fnm
+ /instrumentation/gps/wp/wp[1]/distance-nm
+ true
+
+
+ 6
+ 2
+
+ TTW: %s
+ /instrumentation/gps/wp/wp[1]/TTW
+ true
+
+
+
+
+
+ /instrumentation/gps/mode
+ leg
+
+
+
+ 7
+ 0
+
+ Leg Course: %3.0f
+ /instrumentation/gps/wp/leg-mag-course-deg
+ true
+
+
+
+
+
+ /instrumentation/gps/mode
+ leg
+
+
+
+ 7
+ 1
+
+ Leg Distance: %5.1fnm
+ /instrumentation/gps/wp/leg-distance-nm
+ true
+
+
+
+
+
+ /instrumentation/gps/mode
+ obs
+
+ /instrumentation/gps/to-flag
+
+
+ 7
+ 0
+
+
+
+
+
+
+ /instrumentation/gps/mode
+ obs
+
+ /instrumentation/gps/from-flag
+
+
+ 7
+ 0
+
+
+
+
+
+
+
+
+
+ hbox
+ fill
+
+
+ vbox
+
+
+ hbox
+ fill
+
+
+ 80
+
+
+ searchType
+ /sim/gui/dialogs/gps/search-type
+ any
+ airport
+ vor
+ ndb
+ fix
+ wpt
+ true
+
+ dialog-apply
+
+
+
+
+
+
+ hbox
+ fill
+
+
+ 80
+
+
+ search-query
+ fill
+ true
+ 150
+ true
+ /sim/gui/dialogs/gps/search-query
+
+ dialog-apply
+
+
+
+
+
+ hbox
+ fill
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ /instrumentation/gps/scratch/valid
+
+
+ table
+
+
+ 0
+ 0
+
+ Ident: %s
+ /instrumentation/gps/scratch/ident
+ true
+
+
+
+ 0
+ 1
+ 2
+
+ Name: %s
+ /instrumentation/gps/scratch/name
+ true
+
+
+
+ 1
+ 0
+
+ Lon: %6.3f
+ /instrumentation/gps/scratch/longitude-deg
+ true
+
+
+ 1
+ 1
+
+ Lat: %6.3f
+ /instrumentation/gps/scratch/latitude-deg
+ true
+
+
+ 1
+ 2
+
+ Alt: %6.0fft
+ /instrumentation/gps/scratch/altitude-ft
+ true
+
+
+
+
+ 2
+ 0
+
+ Bearing: %3.0f
+ /instrumentation/gps/scratch/mag-bearing-deg
+ true
+
+
+ 2
+ 1
+
+ Distance: %5.1fnm
+ /instrumentation/gps/scratch/distance-nm
+ true
+
+
+
+
+
+
+ /instrumentation/gps/scratch/type
+ vor
+
+
+
+ 3
+ 0
+
+ Frequency: %5.1fMhz
+ /instrumentation/gps/scratch/frequency-mhz
+ true
+
+
+
+
+
+ /instrumentation/gps/scratch/type
+ ndb
+
+
+
+ 3
+ 0
+
+ Frequency: %5.1fKhz
+ /instrumentation/gps/scratch/frequency-khz
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
- 10
- 40
-
-
- 40
- 340
-
-
-
-
- wp0Type
- 0
- 320
- 100
- 25
-
- /instrumentation/gps/wp/wp[0]/waypoint-type
- airport
- nav
- fix
-
- dialog-apply
- wp0Type
-
-
-
-
- wp0ID
- 0
- 290
- 100
- 25
-
- /instrumentation/gps/wp/wp[0]/ID
-
- dialog-apply
- wp0ID
-
-
- dialog-update
-
-
-
-
- wp0Name
- 0
- 260
- 200
- 25
-
- /instrumentation/gps/wp/wp[0]/name
-
- dialog-apply
- wp0Name
-
-
- dialog-update
-
-
-
-
- wp0-lat
- 0
- 230
- 150
- 25
-
- /instrumentation/gps/wp/wp[0]/latitude-deg
-
- dialog-apply
- wp0-lat
-
-
- dialog-update
-
-
-
-
- wp0-lon
- 0
- 200
- 150
- 25
-
- /instrumentation/gps/wp/wp[0]/longitude-deg
-
- dialog-apply
- wp0-lon
-
-
- dialog-update
-
-
-
-
- wp0-alt
- 0
- 170
- 150
- 25
-
- /instrumentation/gps/wp/wp[0]/altitude-ft
-
- dialog-apply
- wp0-alt
-
-
- dialog-update
-
-
-
-
- wp0-course
- 0
- 140
- 150
- 25
-
- /instrumentation/gps/wp/wp[0]/desired-course-deg
- 0
- 360
-
- dialog-apply
- wp0-course
-
-
+ hbox
+ fill
+ 6
+
+
+
+
+
+
+ true
+
+
-
- 320
- 40
-
-
- 40
- 340
-
-
-
-
- wp1Type
- 0
- 320
- 100
- 25
-
- /instrumentation/gps/wp/wp[1]/waypoint-type
- airport
- nav
- fix
-
- dialog-apply
- wp1Type
-
-
-
-
- wp1ID
- 0
- 290
- 100
- 25
-
- /instrumentation/gps/wp/wp[1]/ID
-
- dialog-apply
- wp1ID
-
-
- dialog-update
-
-
-
-
- wp1Name
- 0
- 260
- 200
- 25
-
- /instrumentation/gps/wp/wp[1]/name
-
- dialog-apply
- wp1Name
-
-
- dialog-update
-
-
-
-
- wp1-lat
- 0
- 230
- 150
- 25
-
- /instrumentation/gps/wp/wp[1]/latitude-deg
-
- dialog-apply
- wp1-lat
-
-
- dialog-update
-
-
-
-
- wp1-lon
- 0
- 200
- 150
- 25
-
- /instrumentation/gps/wp/wp[1]/longitude-deg
-
- dialog-apply
- wp1-lon
-
-
- dialog-update
-
-
-
-
- wp1-alt
- 0
- 170
- 150
- 25
-
- /instrumentation/gps/wp/wp[1]/altitude-ft
-
- dialog-apply
- wp1-alt
-
-
- dialog-update
-
-
-
-
- wp1-course
- 0
- 140
- 150
- 25
-
- /instrumentation/gps/wp/wp[1]/desired-course-deg
-
- dialog-apply
- wp1-course
-
-
-
-
-
-
-
-
- leg-course
- 10
- 50
- 150
- 25
-
- /instrumentation/gps/wp/leg-true-course-deg
-
-
-
- leg-distance
- 10
- 80
- 150
- 25
-
- /instrumentation/gps/wp/leg-distance-nm
-
-
-
diff --git a/gui/dialogs/route-manager.xml b/gui/dialogs/route-manager.xml
index a63f91682..e32e3971f 100644
--- a/gui/dialogs/route-manager.xml
+++ b/gui/dialogs/route-manager.xml
@@ -23,13 +23,15 @@ command interface /autopilot/route-manager/input:
var selection = dlg.getNode("selection", 1);
var input = dlg.getNode("input", 1);
+ var routem = props.globals.getNode("/autopilot/route-manager", 1);
+
selection.setValue("");
input.setValue("");
var list = cmdarg().getNode("list");
- var cmd = props.globals.getNode("/autopilot/route-manager/input", 1);
- var route = props.globals.getNode("/autopilot/route-manager/route", 1);
-
+ var cmd = routem.getNode("input", 1);
+ var route = routem.getNode("route", 1);
+
var sel_index = func {
var s = selection.getValue();
selection.setValue("");
@@ -80,25 +82,17 @@ command interface /autopilot/route-manager/input:
var lst = setlistener("/autopilot/route-manager/route/num", route_changed, 1);
- var load_wp_file = func(path) {
- call(func {
- var file = io.open(path.getValue(), "r");
- var index = sel_index();
- while ((var wp = io.readln(file)) != nil) {
- wp = string.trim(wp);
- if (wp != "") {
- cmd.setValue("@insert" ~ index ~ ":" ~ wp);
- if (index >= 0)
- index += 1;
- }
- }
- io.close(file);
- }, [], var err = []);
- if (size(err))
- gui.popupTip("can't open file " ~ path.getValue(), 5);
+ var load_route = func(path) {
+ routem.getNode("file-path", 1).setValue(path.getValue());
+ cmd.setValue("@load");
+ gui.dialog_update("route-manager");
}
- var file_selector = gui.FileSelector.new(load_wp_file, "Load waypoint list", "Load");
+ var file_selector = gui.FileSelector.new(load_route, "Load flight-plan", "Load");
+
+ var activate_fp = func {
+ cmd.setValue("@activate");
+ }
@@ -130,7 +124,102 @@ command interface /autopilot/route-manager/input:
-
+
+
+
+
+ hbox
+
+
+ 80
+
+
+ departure-airport
+ fill
+ true
+ 150
+ /autopilot/route-manager/departure/airport
+
+
+
+
+
+ departure-runway
+ fill
+ true
+ 60
+ /autopilot/route-manager/departure/runway
+
+
+
+
+ hbox
+
+
+ 80
+
+
+ destination-airport
+ fill
+ true
+ 150
+ /autopilot/route-manager/destination/airport
+
+
+
+
+
+ destination-runway
+ fill
+ true
+ 60
+ /autopilot/route-manager/destination/runway
+
+
+
+
+ hbox
+
+
+ 80
+
+
+ alt-airport
+ fill
+ true
+ 150
+ /autopilot/route-manager/alternate/airport
+
+
+
+
+
+ hbox
+
+
+ 80
+
+
+ cruise-speed
+ fill
+ true
+ 150
+ /autopilot/route-manager/cruise/speed
+
+
+
+
+ 80
+
+
+ cruise-alt
+ fill
+ true
+ 150
+ /sim/gui/dialogs/route-manager/cruise-alt
+
+
+
@@ -239,6 +328,15 @@ command interface /autopilot/route-manager/input:
+
+
true