1
0
Fork 0

FG1000 - Fix 3D model GDUs, find nearest ID on DTO

This commit is contained in:
Stuart Buchanan 2018-04-29 21:15:18 +01:00
parent 1b52eaccbd
commit 8fdffa16e6
17 changed files with 56 additions and 45 deletions

View file

@ -191,7 +191,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -300,6 +299,7 @@
<command>FG1000HardKeyPushed</command>
<device>1</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -307,6 +307,7 @@
<command>FG1000HardKeyPushed</command>
<device>1</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -719,7 +720,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -191,7 +191,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -300,6 +299,7 @@
<command>FG1000HardKeyPushed</command>
<device>2</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -307,6 +307,7 @@
<command>FG1000HardKeyPushed</command>
<device>2</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -719,7 +720,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -191,7 +191,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -300,6 +299,7 @@
<command>FG1000HardKeyPushed</command>
<device>3</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -307,6 +307,7 @@
<command>FG1000HardKeyPushed</command>
<device>3</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -719,7 +720,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -191,7 +191,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -300,6 +299,7 @@
<command>FG1000HardKeyPushed</command>
<device>1</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -307,6 +307,7 @@
<command>FG1000HardKeyPushed</command>
<device>1</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -719,7 +720,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -203,7 +203,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -552,6 +551,7 @@
<command>FG1000HardKeyPushed</command>
<device>1</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -559,6 +559,7 @@
<command>FG1000HardKeyPushed</command>
<device>1</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -971,7 +972,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -203,7 +203,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -552,6 +551,7 @@
<command>FG1000HardKeyPushed</command>
<device>2</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -559,6 +559,7 @@
<command>FG1000HardKeyPushed</command>
<device>2</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -971,7 +972,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -203,7 +203,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -552,6 +551,7 @@
<command>FG1000HardKeyPushed</command>
<device>3</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -559,6 +559,7 @@
<command>FG1000HardKeyPushed</command>
<device>3</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -971,7 +972,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -203,7 +203,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -552,6 +551,7 @@
<command>FG1000HardKeyPushed</command>
<device>4</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -559,6 +559,7 @@
<command>FG1000HardKeyPushed</command>
<device>4</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -971,7 +972,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -208,7 +208,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -557,6 +556,7 @@
<command>FG1000HardKeyPushed</command>
<device>1</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -564,6 +564,7 @@
<command>FG1000HardKeyPushed</command>
<device>1</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -976,7 +977,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -203,7 +203,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -552,6 +551,7 @@
<command>FG1000HardKeyPushed</command>
<device>2</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -559,6 +559,7 @@
<command>FG1000HardKeyPushed</command>
<device>2</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -971,7 +972,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -203,7 +203,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -552,6 +551,7 @@
<command>FG1000HardKeyPushed</command>
<device>3</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -559,6 +559,7 @@
<command>FG1000HardKeyPushed</command>
<device>3</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -971,7 +972,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -203,7 +203,6 @@
</action>
</animation>
<animation>
<type>knob</type>
<object-name>NavOuter</object-name>
@ -552,6 +551,7 @@
<command>FG1000HardKeyPushed</command>
<device>4</device>
<notification>ALT_INNER</notification>
<offset>1</offset>
</binding>
</action>
<shift-action>
@ -559,6 +559,7 @@
<command>FG1000HardKeyPushed</command>
<device>4</device>
<notification>ALT_OUTER</notification>
<offset>1</offset>
</binding>
</shift-action>
<hovered>
@ -971,7 +972,7 @@
<animation>
<type>pick</type>
<object-name>FMSInner</object-name>
<object-name>FmsInner</object-name>
<action>
<button>0</button>
<binding>

View file

@ -336,9 +336,9 @@ setDirectTo : func(param)
# No flightplan, or waypoint not found, so use the GPS DTO function.
# Hokey property-based interface.
setprop("/instrumentation/gps/scratch/ident", id);
setprop("/instrumentation/gps/scratch/altitude-ft", 0);
setprop("/instrumentation/gps/scratch/latitude-deg", 0);
setprop("/instrumentation/gps/scratch/longitude-deg", 0);
setprop("/instrumentation/gps/scratch/altitude-ft", alt_ft);
setprop("/instrumentation/gps/scratch/latitude-deg", getprop("/position/latitude-deg"));
setprop("/instrumentation/gps/scratch/longitude-deg", getprop("/position/longitude-deg"));
}
# Switch the GPS to DTO mode.

View file

@ -113,13 +113,13 @@ var DirectTo =
},
offdisplay : func() {
me.DirectToChart.setVisible(0);
if (me.DirectToChart != nil) me.DirectToChart.setVisible(0);
me._group.setVisible(0);
me.getElement("Group").setVisible(0);
me.getController().offdisplay();
},
ondisplay : func() {
me.DirectToChart.setVisible(1);
if (me.DirectToChart != nil) me.DirectToChart.setVisible(1);
me._group.setVisible(1);
me.getElement("Group").setVisible(1);
me.getController().ondisplay();

View file

@ -51,7 +51,6 @@ var NearestVORController =
me._crsrToggle = 1;
},
# Input Handling
handleCRSR : func() {
me._crsrToggle = (! me._crsrToggle);
@ -81,13 +80,13 @@ var NearestVORController =
},
handleFMSOuter : func(value) {
if (me._crsrToggle == 1) {
if (me._currentGroup == NearestVORController.UIGROUP.VOR) {
# Scroll through whatever is the current list
me.page.select.incrSmall(value);
var id = me.page.select.getValue();
var data = me.getNavDataItem(id);
if ((data != nil) and (size(data) >0)) me.page.updateNavDataItem(data[0]);
}
if (me._currentGroup == NearestVORController.UIGROUP.VOR) {
# Scroll through whatever is the current list
me.page.select.incrSmall(value);
var id = me.page.select.getValue();
var data = me.getNavDataItem(id);
if ((data != nil) and (size(data) >0)) me.page.updateNavDataItem(data[0]);
}
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
return me.page.mfd.SurroundController.handleFMSOuter(value);

View file

@ -54,6 +54,8 @@ var PFDInstrumentsController =
_leg_xtrk_nm : 0,
_leg_valid : 0,
_navSelected : 1,
_nav1_id : "",
_nav1_freq : 0.0,
_nav1_radial_deg : 0,

View file

@ -1,7 +1,7 @@
# See: http://wiki.flightgear.org/MapStructure
# TODO: this layer doesn't make sense to support for AI/MP traffic, because we don't currently have access to flightplan/routing info
# that also applies to other layers like WPT or even navaid layers that handle station tuning based on local radio settings
#
#
# Class things:
var name = 'RTE';
var parents = [SymbolLayer.Controller];
@ -26,9 +26,9 @@ var new = func(layer) {
listeners: [],
};
layer.searcher._equals = func(l,r) 0; # TODO: create model objects instead?
append(m.listeners, setlistener(layer.options.active_node, func m.layer.update() ),
append(m.listeners, setlistener(layer.options.active_node, func m.layer.update() ),
setlistener(layer.options.wp_num, func m.layer.update() ));
m.addVisibilityListener();
var driver = opt_member(m.layer.options, 'route_driver');
if(driver == nil){
@ -52,20 +52,19 @@ var searchCmd = func {
# FIXME: do we return the current route even if it isn't active?
printlog(_MP_dbg_lvl, "Running query: ", name);
var plans = []; # TODO: multiple flightplans?
var plans = [];
var driver = me.route_driver;
driver.update();
if(!driver.shouldUpdate()) return me.last_result;
# http://wiki.flightgear.org/Nasal_Flightplan
var planCount = driver.getNumberOfFlightPlans();
for (var idx = 0; idx < planCount; idx += 1) {
#var fp = driver.getFlightPlan(idx);
if (driver.getFlightPlan(idx) == nil) return [];
var fpSize = driver.getPlanSize(idx);
if(fpSize < 2) continue;
var type = driver.getFlightPlanType(idx);
if(type == nil) type = 'current';
if (!getprop(me.layer.options.active_node) and
type == 'current' and
if (!getprop(me.layer.options.active_node) and
type == 'current' and
!me.layer.options.display_inactive_rte) fpSize = 0;
var coords = [];
var discontinuity = 0;
@ -91,4 +90,3 @@ var searchCmd = func {
me.last_result = plans;
return plans;
};