1
0
Fork 0

Bugfixes, enable ATT HDG switch

This commit is contained in:
legoboyvdlp R 2020-11-07 14:35:31 +00:00
parent 21f8f7ea9c
commit 7d77279fe6
5 changed files with 78 additions and 12 deletions

View file

@ -6975,6 +6975,65 @@
</binding> </binding>
</action> </action>
</animation> </animation>
<animation>
<type>rotate</type>
<object-name>ecam_att_hdg</object-name>
<object-name>ecam_att_hdg.mark</object-name>
<factor>-30</factor>
<property>controls/navigation/switching/att-hdg</property>
<axis>
<x1-m>-0.432428</x1-m>
<y1-m>-0.067552</y1-m>
<z1-m>-0.063695</z1-m>
<x2-m>-0.432195</x2-m>
<y2-m>-0.067552</y2-m>
<z2-m>-0.062285</z2-m>
</axis>
</animation>
<animation>
<type>pick</type>
<object-name>ecam_att_hdg</object-name>
<action>
<button>0</button>
<button>3</button>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (systems.SwitchingPanel.Switches.attHdg.getValue() != 1) {
systems.SwitchingPanel.doAttHdg(systems.SwitchingPanel.Switches.attHdg.getValue() + 1);
} else {
systems.SwitchingPanel.doAttHdg(-1);
}
</script>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/knb1", 1);</script>
</binding>
</action>
<action>
<button>2</button>
<button>4</button>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (systems.SwitchingPanel.Switches.attHdg.getValue() != -1) {
systems.SwitchingPanel.doAttHdg(systems.SwitchingPanel.Switches.attHdg.getValue() - 1);
} else {
systems.SwitchingPanel.doAttHdg(1);
}
</script>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/knb1", 1);</script>
</binding>
</action>
</animation>
<!-- Z Colors/Effects --> <!-- Z Colors/Effects -->
<animation> <animation>

View file

@ -7,7 +7,7 @@
var ALWAYS = func 1; var ALWAYS = func 1;
var NOTHING = func nil; 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); var adirs_3 = props.globals.getNode("/instrumentation/efis[0]/nd/ir-3", 1);
canvas.NDStyles["Airbus"] = { canvas.NDStyles["Airbus"] = {
@ -455,7 +455,7 @@ canvas.NDStyles["Airbus"] = {
update_on:["toggle_range","toggle_display_mode", "toggle_cstr", update_on:["toggle_range","toggle_display_mode", "toggle_cstr",
"toggle_wpt_idx"], "toggle_wpt_idx"],
predicate: func(nd, layer) { 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 ); layer.group.setVisible( visible );
if (visible) { if (visible) {
layer.update(); layer.update();
@ -763,7 +763,7 @@ canvas.NDStyles["Airbus"] = {
init: func(nd,symbol), init: func(nd,symbol),
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and
getprop("/FMGC/flightplan[2]/active") 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) { is_true: func(nd) {
nd.symbols.wpActiveId.setText(getprop("/FMGC/flightplan[2]/current-leg")); nd.symbols.wpActiveId.setText(getprop("/FMGC/flightplan[2]/current-leg"));
nd.symbols.wpActiveId.show(); nd.symbols.wpActiveId.show();
@ -777,7 +777,7 @@ canvas.NDStyles["Airbus"] = {
init: func(nd,symbol), init: func(nd,symbol),
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and
getprop("/FMGC/flightplan[2]/active") 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) { is_true: func(nd) {
#var cur_wp = getprop("/autopilot/route-manager/current-wp"); #var cur_wp = getprop("/autopilot/route-manager/current-wp");
var deg = nil; var deg = nil;
@ -800,9 +800,10 @@ canvas.NDStyles["Airbus"] = {
id: "wpActiveDist", id: "wpActiveDist",
impl: { impl: {
init: func(nd,symbol), 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 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) { is_true: func(nd) {
var dst = getprop("/FMGC/flightplan[2]/current-leg-dist"); var dst = getprop("/FMGC/flightplan[2]/current-leg-dist");
nd.symbols.wpActiveDist.setText(sprintf("%3.01f",dst)); nd.symbols.wpActiveDist.setText(sprintf("%3.01f",dst));
@ -815,7 +816,8 @@ canvas.NDStyles["Airbus"] = {
id: "wpActiveDistLbl", id: "wpActiveDistLbl",
impl: { impl: {
init: func(nd,symbol), 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) { is_true: func(nd) {
nd.symbols.wpActiveDistLbl.show(); nd.symbols.wpActiveDistLbl.show();
if(getprop("/FMGC/flightplan[2]/current-leg-dist") > 1000) if(getprop("/FMGC/flightplan[2]/current-leg-dist") > 1000)
@ -828,7 +830,8 @@ canvas.NDStyles["Airbus"] = {
id: "eta", id: "eta",
impl: { impl: {
init: func(nd,symbol), 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) { is_true: func(nd) {
var etaSec = getprop("/sim/time/utc/day-seconds")+ var etaSec = getprop("/sim/time/utc/day-seconds")+
getprop("/autopilot/route-manager/wp/eta-seconds"); getprop("/autopilot/route-manager/wp/eta-seconds");

View file

@ -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 gear_agl = props.globals.getNode("/position/gear-agl-ft", 1);
var aileron_input = props.globals.getNode("/controls/flight/aileron-input-fast", 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 elevator_input = props.globals.getNode("/controls/flight/elevator-input-fast", 1);
var att_switch = props.globals.getNode("/controls/switching/ATTHDG", 1); var att_switch = props.globals.getNode("/controls/navigation/switching/att-hdg", 1);
var air_switch = props.globals.getNode("/controls/switching/AIRDATA", 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 appr_enabled = props.globals.getNode("/it-autoflight/output/appr-armed/", 1);
var loc_enabled = props.globals.getNode("/it-autoflight/output/loc-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); var vert_gs = props.globals.getNode("/it-autoflight/output/vert/", 1);

View file

@ -62,8 +62,8 @@ var variousReset = func {
setprop("/controls/lighting/DU/mcdu1", 1); setprop("/controls/lighting/DU/mcdu1", 1);
setprop("/controls/lighting/DU/mcdu2", 1); setprop("/controls/lighting/DU/mcdu2", 1);
setprop("modes/fcu/hdg-time", -45); setprop("modes/fcu/hdg-time", -45);
setprop("/controls/switching/ATTHDG", 0); setprop("/controls/navigation/switching/att-hdg", 0);
setprop("/controls/switching/AIRDATA", 0); setprop("/controls/navigation/switching/air-data", 0);
setprop("/controls/switches/no-smoking-sign", 1); setprop("/controls/switches/no-smoking-sign", 1);
setprop("/controls/switches/seatbelt-sign", 1); setprop("/controls/switches/seatbelt-sign", 1);
} }

View file

@ -25,6 +25,10 @@ var SwitchingPanel = {
dmc.DMController.DMCs[1].changeActiveADIRS(1); dmc.DMController.DMCs[1].changeActiveADIRS(1);
} }
}, },
doAttHdg: func(newAttHdg) {
if (newAttHdg < -1 or newAttHdg > 1) { return; }
me.Switches.attHdg.setValue(newAttHdg);
},
doEisDMC: func(newDMC) { doEisDMC: func(newDMC) {
if (newDMC < -1 or newDMC > 1) { return; } if (newDMC < -1 or newDMC > 1) { return; }
me.Switches.eisDMC.setValue(newDMC); me.Switches.eisDMC.setValue(newDMC);