diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml
index e8944999..915d3d1e 100644
--- a/Models/FlightDeck/a320.flightdeck.xml
+++ b/Models/FlightDeck/a320.flightdeck.xml
@@ -6975,6 +6975,65 @@
+
+
+ rotate
+ ecam_att_hdg
+ ecam_att_hdg.mark
+ -30
+ controls/navigation/switching/att-hdg
+
+ -0.432428
+ -0.067552
+ -0.063695
+ -0.432195
+ -0.067552
+ -0.062285
+
+
+
+
+ pick
+ ecam_att_hdg
+
+
+
+ true
+
+ nasal
+
+
+
+ nasal
+
+
+
+
+
+
+ true
+
+ nasal
+
+
+
+ nasal
+
+
+
+
diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas
index 1eb6b840..478ae2a0 100644
--- a/Models/Instruments/ND/canvas/style.nas
+++ b/Models/Instruments/ND/canvas/style.nas
@@ -7,7 +7,7 @@
var ALWAYS = func 1;
var NOTHING = func nil;
-var att_switch = props.globals.getNode("/controls/switching/ATTHDG", 1);
+var att_switch = props.globals.getNode("/controls/navigation/switching/att-hdg", 1);
var adirs_3 = props.globals.getNode("/instrumentation/efis[0]/nd/ir-3", 1);
canvas.NDStyles["Airbus"] = {
@@ -455,7 +455,7 @@ canvas.NDStyles["Airbus"] = {
update_on:["toggle_range","toggle_display_mode", "toggle_cstr",
"toggle_wpt_idx"],
predicate: func(nd, layer) {
- var visible= (nd.in_mode("toggle_display_mode", ["MAP","PLAN"]));
+ 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)));
layer.group.setVisible( visible );
if (visible) {
layer.update();
@@ -763,7 +763,7 @@ canvas.NDStyles["Airbus"] = {
init: func(nd,symbol),
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and
getprop("/FMGC/flightplan[2]/active") and
- nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
+ 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)),
is_true: func(nd) {
nd.symbols.wpActiveId.setText(getprop("/FMGC/flightplan[2]/current-leg"));
nd.symbols.wpActiveId.show();
@@ -777,7 +777,7 @@ canvas.NDStyles["Airbus"] = {
init: func(nd,symbol),
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and
getprop("/FMGC/flightplan[2]/active") and
- nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
+ 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)),
is_true: func(nd) {
#var cur_wp = getprop("/autopilot/route-manager/current-wp");
var deg = nil;
@@ -800,9 +800,10 @@ canvas.NDStyles["Airbus"] = {
id: "wpActiveDist",
impl: {
init: func(nd,symbol),
- predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg-dist") != nil and
+ predicate: func(nd) (getprop("/FMGC/flightplan[2]/current-leg-dist") != nil and
getprop("/FMGC/flightplan[2]/active") and
- nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
+ 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))),
is_true: func(nd) {
var dst = getprop("/FMGC/flightplan[2]/current-leg-dist");
nd.symbols.wpActiveDist.setText(sprintf("%3.01f",dst));
@@ -815,7 +816,8 @@ canvas.NDStyles["Airbus"] = {
id: "wpActiveDistLbl",
impl: {
init: func(nd,symbol),
- predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg-dist") != nil and getprop("/FMGC/flightplan[2]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
+ predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg-dist") != nil and getprop("/FMGC/flightplan[2]/active") and 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)),
is_true: func(nd) {
nd.symbols.wpActiveDistLbl.show();
if(getprop("/FMGC/flightplan[2]/current-leg-dist") > 1000)
@@ -828,7 +830,8 @@ canvas.NDStyles["Airbus"] = {
id: "eta",
impl: {
init: func(nd,symbol),
- predicate: func(nd) getprop("/autopilot/route-manager/wp/eta") != nil and getprop("/FMGC/flightplan[2]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
+ predicate: func(nd) getprop("/autopilot/route-manager/wp/eta") != nil and getprop("/FMGC/flightplan[2]/active") and 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)),
is_true: func(nd) {
var etaSec = getprop("/sim/time/utc/day-seconds")+
getprop("/autopilot/route-manager/wp/eta-seconds");
diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas
index a8a3f641..156f3976 100644
--- a/Models/Instruments/PFD/PFD.nas
+++ b/Models/Instruments/PFD/PFD.nas
@@ -109,8 +109,8 @@ var athr = props.globals.getNode("/it-autoflight/output/athr", 1);
var gear_agl = props.globals.getNode("/position/gear-agl-ft", 1);
var aileron_input = props.globals.getNode("/controls/flight/aileron-input-fast", 1);
var elevator_input = props.globals.getNode("/controls/flight/elevator-input-fast", 1);
-var att_switch = props.globals.getNode("/controls/switching/ATTHDG", 1);
-var air_switch = props.globals.getNode("/controls/switching/AIRDATA", 1);
+var att_switch = props.globals.getNode("/controls/navigation/switching/att-hdg", 1);
+var air_switch = props.globals.getNode("/controls/navigation/switching/air-data", 1);
var appr_enabled = props.globals.getNode("/it-autoflight/output/appr-armed/", 1);
var loc_enabled = props.globals.getNode("/it-autoflight/output/loc-armed/", 1);
var vert_gs = props.globals.getNode("/it-autoflight/output/vert/", 1);
diff --git a/Nasal/Libraries/buttons.nas b/Nasal/Libraries/buttons.nas
index edbc2a09..17682b2b 100644
--- a/Nasal/Libraries/buttons.nas
+++ b/Nasal/Libraries/buttons.nas
@@ -62,8 +62,8 @@ var variousReset = func {
setprop("/controls/lighting/DU/mcdu1", 1);
setprop("/controls/lighting/DU/mcdu2", 1);
setprop("modes/fcu/hdg-time", -45);
- setprop("/controls/switching/ATTHDG", 0);
- setprop("/controls/switching/AIRDATA", 0);
+ setprop("/controls/navigation/switching/att-hdg", 0);
+ setprop("/controls/navigation/switching/air-data", 0);
setprop("/controls/switches/no-smoking-sign", 1);
setprop("/controls/switches/seatbelt-sign", 1);
}
diff --git a/Nasal/Panels/SwitchingPanel.nas b/Nasal/Panels/SwitchingPanel.nas
index 96066a20..2e2fa280 100644
--- a/Nasal/Panels/SwitchingPanel.nas
+++ b/Nasal/Panels/SwitchingPanel.nas
@@ -25,6 +25,10 @@ var SwitchingPanel = {
dmc.DMController.DMCs[1].changeActiveADIRS(1);
}
},
+ doAttHdg: func(newAttHdg) {
+ if (newAttHdg < -1 or newAttHdg > 1) { return; }
+ me.Switches.attHdg.setValue(newAttHdg);
+ },
doEisDMC: func(newDMC) {
if (newDMC < -1 or newDMC > 1) { return; }
me.Switches.eisDMC.setValue(newDMC);