Misc port
This commit is contained in:
parent
b8336d52b2
commit
7b4a4df40d
4 changed files with 43 additions and 28 deletions
|
@ -637,11 +637,9 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
|
||||||
me.symbols.dmeRDist.setText("");
|
me.symbols.dmeRDist.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
# Hide heading bug 10 secs after change
|
# Hide heading bug 45 secs after change
|
||||||
var vhdg_bug = getprop("/it-autoflight/input/hdg") or 0;
|
var vhdg_bug = getprop("/it-autoflight/input/hdg") or 0;
|
||||||
var hdg_bug_active = getprop("/it-autoflight/custom/show-hdg");
|
var hdg_bug_active = getprop("/it-autoflight/custom/show-hdg") or 1;
|
||||||
if (hdg_bug_active == nil)
|
|
||||||
hdg_bug_active = 1;
|
|
||||||
|
|
||||||
if((me.in_mode("toggle_display_mode", ["MAP"]) and me.get_switch("toggle_display_type") == "CRT")
|
if((me.in_mode("toggle_display_mode", ["MAP"]) and me.get_switch("toggle_display_type") == "CRT")
|
||||||
or (me.get_switch("toggle_track_heading") and me.get_switch("toggle_display_type") == "LCD"))
|
or (me.get_switch("toggle_track_heading") and me.get_switch("toggle_display_type") == "LCD"))
|
||||||
|
|
|
@ -595,18 +595,18 @@ canvas.NDStyles["Airbus"] = {
|
||||||
isMapStructure: 1,
|
isMapStructure: 1,
|
||||||
update_on: ["toggle_display_mode","toggle_range"],
|
update_on: ["toggle_display_mode","toggle_range"],
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible = nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting));
|
var visible = nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)) and getprop("/instrumentation/nd/symbols/decel/show");
|
||||||
layer.group.setVisible( visible );
|
layer.group.setVisible( visible );
|
||||||
if (visible) {
|
if (visible) {
|
||||||
layer.update();
|
layer.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
# Overridable options:
|
decel_node: "/instrumentation/nd/symbols/decel",
|
||||||
# decel_node: node containing latitude-deg and longitude-deg used to mark the deceleration point
|
|
||||||
# managed_speed_node: boolean property indicating that the aircraft is flying in managed speed mode
|
|
||||||
listen: [
|
listen: [
|
||||||
"fplan_active",
|
"fplan_active",
|
||||||
|
"current_wp",
|
||||||
|
"wp_count",
|
||||||
"spd_ctrl",
|
"spd_ctrl",
|
||||||
"ver_ctrl",
|
"ver_ctrl",
|
||||||
"athr"
|
"athr"
|
||||||
|
@ -746,14 +746,15 @@ canvas.NDStyles["Airbus"] = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "taOnly", # the SVG ID
|
# TODO: taOnly doesn"t need to use getprop polling in update(), use a listener instead!
|
||||||
impl: { # implementation hash
|
id: "taOnly",
|
||||||
init: func(nd, symbol), # for updateCenter stuff, called during initialization in the ctor
|
impl: {
|
||||||
predicate: func(nd) getprop("/instrumentation/tcas/inputs/mode") == 2, # the condition
|
init: func(nd, symbol),
|
||||||
is_true: func(nd) nd.symbols.taOnly.show(), # if true, run this
|
predicate: func(nd) getprop("/instrumentation/tcas/inputs/mode") == 2,
|
||||||
is_false: func(nd) nd.symbols.taOnly.hide(), # if false, run this
|
is_true: func(nd) nd.symbols.taOnly.show(),
|
||||||
}, # end of taOnly behavior/callbacks
|
is_false: func(nd) nd.symbols.taOnly.hide(),
|
||||||
}, # end of taOnly
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "tas",
|
id: "tas",
|
||||||
impl: {
|
impl: {
|
||||||
|
@ -761,7 +762,6 @@ canvas.NDStyles["Airbus"] = {
|
||||||
predicate: func(nd) getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 60,
|
predicate: func(nd) getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 60,
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.tas.setText(sprintf("%3.0f",getprop("/instrumentation/airspeed-indicator/true-speed-kt")));
|
nd.symbols.tas.setText(sprintf("%3.0f",getprop("/instrumentation/airspeed-indicator/true-speed-kt")));
|
||||||
nd.symbols.tas.show();
|
|
||||||
},
|
},
|
||||||
is_false: func(nd){
|
is_false: func(nd){
|
||||||
nd.symbols.tas.setText("---");
|
nd.symbols.tas.setText("---");
|
||||||
|
@ -1324,7 +1324,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"curTrkPtr",
|
id:"curTrkPtr",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR","MAP"]) and !nd.get_switch("toggle_centered")
|
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")
|
||||||
and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))
|
and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))
|
||||||
and abs(nd.aircraft_source.get_trk_mag() - nd.aircraft_source.get_hdg_mag()) <= 42),
|
and abs(nd.aircraft_source.get_trk_mag() - nd.aircraft_source.get_hdg_mag()) <= 42),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
|
@ -1368,7 +1368,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and
|
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and
|
||||||
nd.get_switch("toggle_centered") and (nd.change_phase != 1) and
|
nd.get_switch("toggle_centered") and (nd.change_phase != 1) and
|
||||||
getprop(nd.options.defaults.lat_ctrl) == 0 and abs(nd.aircraft_source.get_trk_mag() - nd.aircraft_source.get_hdg_mag()) <= 42 and
|
getprop(nd.options.defaults.lat_ctrl) == 0 and abs(nd.aircraft_source.get_trk_mag() - nd.aircraft_source.get_hdg_mag()) <= 42 and
|
||||||
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))),
|
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
|
@ -1531,6 +1531,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
predicate: func(nd) (getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100),
|
predicate: func(nd) (getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
var windDir = pts.Instrumentation.PFD.windDirection.getValue() or 0;
|
var windDir = pts.Instrumentation.PFD.windDirection.getValue() or 0;
|
||||||
|
if(nd.get_switch("toggle_true_north"))
|
||||||
|
windDir = windDir + getprop("/environment/magnetic-variation-deg");
|
||||||
nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",windDir,pts.Instrumentation.PFD.windSpeed.getValue() or 0));
|
nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",windDir,pts.Instrumentation.PFD.windSpeed.getValue() or 0));
|
||||||
},
|
},
|
||||||
is_false: func(nd) {
|
is_false: func(nd) {
|
||||||
|
@ -1545,7 +1547,18 @@ canvas.NDStyles["Airbus"] = {
|
||||||
predicate: func(nd) (!(nd.in_mode("toggle_display_mode", ["PLAN"]) and (nd.get_switch("toggle_display_type") == "LCD")) and (pts.Instrumentation.PFD.windSpeed.getValue() or 0) >= 2 and getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100),
|
predicate: func(nd) (!(nd.in_mode("toggle_display_mode", ["PLAN"]) and (nd.get_switch("toggle_display_type") == "LCD")) and (pts.Instrumentation.PFD.windSpeed.getValue() or 0) >= 2 and getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.windArrow.show();
|
nd.symbols.windArrow.show();
|
||||||
var windArrowRot = (pts.Instrumentation.PFD.windDirection.getValue() or 0) - nd.aircraft_source.get_hdg_tru();
|
var windArrowRot = pts.Instrumentation.PFD.windDirection.getValue() or 0;
|
||||||
|
if(nd.in_mode("toggle_display_mode", ["MAP","PLAN"])) {
|
||||||
|
if(nd.get_switch("toggle_true_north"))
|
||||||
|
windArrowRot = windArrowRot - nd.aircraft_source.get_trk_tru();
|
||||||
|
else
|
||||||
|
windArrowRot = windArrowRot - nd.aircraft_source.get_trk_mag();
|
||||||
|
} else {
|
||||||
|
if(nd.get_switch("toggle_true_north"))
|
||||||
|
windArrowRot = windArrowRot - nd.aircraft_source.get_hdg_tru();
|
||||||
|
else
|
||||||
|
windArrowRot = windArrowRot - nd.aircraft_source.get_hdg_mag();
|
||||||
|
}
|
||||||
nd.symbols.windArrow.setRotation(windArrowRot*D2R);
|
nd.symbols.windArrow.setRotation(windArrowRot*D2R);
|
||||||
},
|
},
|
||||||
is_false: func(nd) nd.symbols.windArrow.hide(),
|
is_false: func(nd) nd.symbols.windArrow.hide(),
|
||||||
|
|
|
@ -365,9 +365,9 @@ var ITAF = {
|
||||||
# Preselect Heading
|
# Preselect Heading
|
||||||
if (Output.latTemp != 0 and Output.latTemp != 9) { # Modes that always show HDG
|
if (Output.latTemp != 0 and Output.latTemp != 9) { # Modes that always show HDG
|
||||||
if (Custom.hdgTime.getValue() + 45 >= Misc.elapsedSec.getValue()) {
|
if (Custom.hdgTime.getValue() + 45 >= Misc.elapsedSec.getValue()) {
|
||||||
setprop("it-autoflight/custom/show-hdg", 1);
|
Custom.showHdg.setBoolValue(1);
|
||||||
} else {
|
} else {
|
||||||
setprop("it-autoflight/custom/show-hdg", 0);
|
Custom.showHdg.setBoolValue(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@ var altitude = 0;
|
||||||
var flap = 0;
|
var flap = 0;
|
||||||
var flaps = 0;
|
var flaps = 0;
|
||||||
var ktsmach = 0;
|
var ktsmach = 0;
|
||||||
var kts_sel = 0;
|
|
||||||
var mach_sel = 0;
|
|
||||||
var srsSPD = 0;
|
var srsSPD = 0;
|
||||||
var mng_alt_spd = 0;
|
var mng_alt_spd = 0;
|
||||||
var mng_alt_mach = 0;
|
var mng_alt_mach = 0;
|
||||||
|
@ -74,9 +72,9 @@ var FMGCinit = func {
|
||||||
var FMGCInternal = {
|
var FMGCInternal = {
|
||||||
# phase logic
|
# phase logic
|
||||||
phase: 0,
|
phase: 0,
|
||||||
|
decel: 0,
|
||||||
minspeed: 0,
|
minspeed: 0,
|
||||||
maxspeed: 0,
|
maxspeed: 0,
|
||||||
decel: 0,
|
|
||||||
clbSpdLim: 250,
|
clbSpdLim: 250,
|
||||||
desSpdLim: 250,
|
desSpdLim: 250,
|
||||||
clbSpdLimAlt: 10000,
|
clbSpdLimAlt: 10000,
|
||||||
|
@ -301,9 +299,15 @@ var updateARPT = func {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var updateArptLatLon = func {
|
var apt = nil;
|
||||||
|
var dms = nil;
|
||||||
|
var degrees = nil;
|
||||||
|
var minutes = nil;
|
||||||
|
var sign = nil;
|
||||||
|
var updateArptLatLon = func() {
|
||||||
#ref lat
|
#ref lat
|
||||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lat");
|
apt = airportinfo(FMGCInternal.depApt);
|
||||||
|
dms = apt.lat;
|
||||||
degrees = int(dms);
|
degrees = int(dms);
|
||||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||||
sign = degrees >= 0 ? "N" : "S";
|
sign = degrees >= 0 ? "N" : "S";
|
||||||
|
@ -311,7 +315,7 @@ var updateArptLatLon = func {
|
||||||
setprop("/FMGC/internal/align-ref-lat-minutes", minutes);
|
setprop("/FMGC/internal/align-ref-lat-minutes", minutes);
|
||||||
setprop("/FMGC/internal/align-ref-lat-sign", sign);
|
setprop("/FMGC/internal/align-ref-lat-sign", sign);
|
||||||
#ref long
|
#ref long
|
||||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lon");
|
dms = apt.lon;
|
||||||
degrees = int(dms);
|
degrees = int(dms);
|
||||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||||
sign = degrees >= 0 ? "E" : "W";
|
sign = degrees >= 0 ? "E" : "W";
|
||||||
|
|
Loading…
Reference in a new issue