Merge branch 'dev' into 3D
This commit is contained in:
commit
1991d5b60d
14 changed files with 2382 additions and 2193 deletions
|
@ -6960,6 +6960,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>
|
||||||
|
|
|
@ -2,147 +2,167 @@
|
||||||
|
|
||||||
# Copyright (c) 2020 Josh Davidson (Octal450)
|
# Copyright (c) 2020 Josh Davidson (Octal450)
|
||||||
|
|
||||||
var IESI = nil;
|
|
||||||
var IESI_display = nil;
|
|
||||||
var elapsedtime = 0;
|
|
||||||
var ASI = 0;
|
|
||||||
var alt = 0;
|
|
||||||
var altTens = 0;
|
|
||||||
var airspeed_act = 0;
|
|
||||||
var mach_act = 0;
|
|
||||||
|
|
||||||
# props.nas nodes
|
# props.nas nodes
|
||||||
var iesi_init = props.globals.initNode("/instrumentation/iesi/iesi-init", 0, "BOOL");
|
var iesi_init = props.globals.initNode("/instrumentation/iesi/iesi-init", 0, "BOOL");
|
||||||
var iesi_reset = props.globals.initNode("/instrumentation/iesi/att-reset", 0, "DOUBLE");
|
var iesi_reset = props.globals.initNode("/instrumentation/iesi/att-reset", 0, "DOUBLE");
|
||||||
var iesi_brt = props.globals.getNode("/controls/lighting/DU/iesi", 1);
|
|
||||||
var iesi_rate = props.globals.getNode("/systems/acconfig/options/iesi-rate", 1);
|
|
||||||
var et = props.globals.getNode("/sim/time/elapsed-sec", 1);
|
|
||||||
var aconfig = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
|
|
||||||
|
|
||||||
var airspeed = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1);
|
|
||||||
var mach = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1);
|
|
||||||
var pitch = props.globals.getNode("/instrumentation/iesi/pitch-deg", 1);
|
|
||||||
var skid = props.globals.getNode("/instrumentation/iesi/slip-skid", 1);
|
|
||||||
var altitude = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft", 1);
|
|
||||||
var altitude_ind = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft-pfd", 1);
|
|
||||||
|
|
||||||
var altimeter_mode = props.globals.getNode("/instrumentation/altimeter[0]/std", 1);
|
|
||||||
var qnh_hpa = props.globals.getNode("/instrumentation/altimeter/setting-hpa", 1);
|
|
||||||
var qnh_inhg = props.globals.getNode("/instrumentation/altimeter/setting-inhg", 1);
|
|
||||||
|
|
||||||
|
var ASI = 0;
|
||||||
var _showIESI = 0;
|
var _showIESI = 0;
|
||||||
var _fast = 0;
|
var _fast = 0;
|
||||||
var _IESITime = 0;
|
var _IESITime = 0;
|
||||||
|
|
||||||
var canvas_IESI_base = {
|
var canvas_IESI = {
|
||||||
init: func(canvas_group, file) {
|
new: func(svg, name) {
|
||||||
var font_mapper = func(family, weight) {
|
var obj = {parents: [canvas_IESI] };
|
||||||
|
obj.canvas = canvas.new({
|
||||||
|
"name": "IESI",
|
||||||
|
"size": [1024, 1024],
|
||||||
|
"view": [1024, 1024],
|
||||||
|
"mipmapping": 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
obj.canvas.addPlacement({"node": "iesi.screen"});
|
||||||
|
obj.group = obj.canvas.createGroup();
|
||||||
|
|
||||||
|
obj.font_mapper = func(family, weight) {
|
||||||
return "LiberationFonts/LiberationSans-Regular.ttf";
|
return "LiberationFonts/LiberationSans-Regular.ttf";
|
||||||
};
|
};
|
||||||
|
|
||||||
canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper});
|
canvas.parsesvg(obj.group, svg, {"font-mapper": obj.font_mapper} );
|
||||||
|
foreach(var key; obj.getKeys()) {
|
||||||
var svg_keys = me.getKeys();
|
obj[key] = obj.group.getElementById(key);
|
||||||
foreach(var key; svg_keys) {
|
|
||||||
me[key] = canvas_group.getElementById(key);
|
var clip_el = obj.group.getElementById(key ~ "_clip");
|
||||||
var svg_keys = me.getKeys();
|
if (clip_el != nil) {
|
||||||
|
clip_el.setVisible(0);
|
||||||
|
var tran_rect = clip_el.getTransformedBounds();
|
||||||
|
|
||||||
foreach (var key; svg_keys) {
|
var clip_rect = sprintf("rect(%d,%d, %d,%d)",
|
||||||
me[key] = canvas_group.getElementById(key);
|
tran_rect[1],
|
||||||
|
tran_rect[2],
|
||||||
var clip_el = canvas_group.getElementById(key ~ "_clip");
|
tran_rect[3],
|
||||||
if (clip_el != nil) {
|
tran_rect[0]);
|
||||||
clip_el.setVisible(0);
|
obj[key].set("clip", clip_rect);
|
||||||
var tran_rect = clip_el.getTransformedBounds();
|
obj[key].set("clip-frame", canvas.Element.PARENT);
|
||||||
|
|
||||||
var clip_rect = sprintf("rect(%d,%d, %d,%d)",
|
|
||||||
tran_rect[1], # 0 ys
|
|
||||||
tran_rect[2], # 1 xe
|
|
||||||
tran_rect[3], # 2 ye
|
|
||||||
tran_rect[0]); #3 xs
|
|
||||||
# coordinates are top,right,bottom,left (ys, xe, ye, xs) ref: l621 of simgear/canvas/CanvasElement.cxx
|
|
||||||
me[key].set("clip", clip_rect);
|
|
||||||
me[key].set("clip-frame", canvas.Element.PARENT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
obj.AI_horizon_trans = obj["AI_horizon"].createTransform();
|
||||||
|
obj.AI_horizon_rot = obj["AI_horizon"].createTransform();
|
||||||
|
|
||||||
me.AI_horizon_trans = me["AI_horizon"].createTransform();
|
obj.middleAltOffset = nil;
|
||||||
me.AI_horizon_rot = me["AI_horizon"].createTransform();
|
|
||||||
|
obj.update_items = [
|
||||||
|
props.UpdateManager.FromHashValue("airspeed", nil, func(val) {
|
||||||
|
# Subtract 30, since the scale starts at 30, but don't allow less than 0, or more than 520 knots
|
||||||
|
if (val <= 30) {
|
||||||
|
ASI = 0;
|
||||||
|
} else if (val >= 520) {
|
||||||
|
ASI = 490;
|
||||||
|
} else {
|
||||||
|
ASI = val - 30;
|
||||||
|
}
|
||||||
|
obj["ASI_scale"].setTranslation(0, ASI * 8.295);
|
||||||
|
}),
|
||||||
|
props.UpdateManager.FromHashList(["altitude","altitude_ind"], nil, func(val) {
|
||||||
|
if (val.altitude > 50000) {
|
||||||
|
val.altitude = 50000;
|
||||||
|
} elsif (val.altitude < -2000) {
|
||||||
|
val.altitude = -2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val.altitude < 0) {
|
||||||
|
obj["negText"].show();
|
||||||
|
obj["negText2"].show();
|
||||||
|
} else {
|
||||||
|
obj["negText"].hide();
|
||||||
|
obj["negText2"].hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
obj.altOffset = (val.altitude / 500) - int(val.altitude / 500);
|
||||||
|
obj.middleAltText = roundaboutAlt(val.altitude / 100);
|
||||||
|
if (obj.altOffset > 0.5) {
|
||||||
|
obj.middleAltOffset = -(obj.altOffset - 1) * 258.5528;
|
||||||
|
} else {
|
||||||
|
obj.middleAltOffset = -obj.altOffset * 258.5528;
|
||||||
|
}
|
||||||
|
|
||||||
|
obj["ALT_scale"].setTranslation(0, -obj.middleAltOffset);
|
||||||
|
obj["ALT_scale"].update();
|
||||||
|
obj["ALT_five"].setText(sprintf("%03d", abs(obj.middleAltText+10)));
|
||||||
|
obj["ALT_four"].setText(sprintf("%03d", abs(obj.middleAltText+5)));
|
||||||
|
obj["ALT_three"].setText(sprintf("%03d", abs(obj.middleAltText)));
|
||||||
|
obj["ALT_two"].setText(sprintf("%03d", abs(obj.middleAltText-5)));
|
||||||
|
obj["ALT_one"].setText(sprintf("%03d", abs(obj.middleAltText-10)));
|
||||||
|
|
||||||
|
|
||||||
|
if (val.altitude < 0 and val.altitude_ind > 20) {
|
||||||
|
val.altitude_ind = 20;
|
||||||
|
} elsif (val.altitude > 0 and val.altitude_ind > 500) {
|
||||||
|
val.altitude_ind = 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
obj["ALT_digits"].setText(sprintf("%s", val.altitude_ind));
|
||||||
|
obj["ALT_meters"].setText(sprintf("%5.0f", math.round(val.altitude * 0.3048, 10)));
|
||||||
|
obj.altTens = num(right(sprintf("%02d", val.altitude), 2));
|
||||||
|
obj["ALT_tens"].setTranslation(0, obj.altTens * 3.16);
|
||||||
|
}),
|
||||||
|
props.UpdateManager.FromHashValue("mach", nil, func(val) {
|
||||||
|
if (val >= 0.5) {
|
||||||
|
obj._machWasAbove50 = 1;
|
||||||
|
obj["ASI_mach_decimal"].show();
|
||||||
|
obj["ASI_mach"].show();
|
||||||
|
} elsif (val >= 0.45 and obj._machWasAbove50) {
|
||||||
|
obj["ASI_mach_decimal"].show();
|
||||||
|
obj["ASI_mach"].show();
|
||||||
|
} else {
|
||||||
|
obj._machWasAbove50 = 0;
|
||||||
|
obj["ASI_mach_decimal"].hide();
|
||||||
|
obj["ASI_mach"].hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val >= 0.999) {
|
||||||
|
obj["ASI_mach"].setText("99");
|
||||||
|
} else {
|
||||||
|
obj["ASI_mach"].setText(sprintf("%2.0f", val * 100));
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
props.UpdateManager.FromHashValue("pitch", nil, func(val) {
|
||||||
|
obj.AI_horizon_trans.setTranslation(0, val * 16.74);
|
||||||
|
}),
|
||||||
|
props.UpdateManager.FromHashValue("roll", nil, func(val) {
|
||||||
|
obj.AI_horizon_rot.setRotation(-val * D2R, obj["AI_center"].getCenter());
|
||||||
|
obj["AI_bank"].setRotation(-val * D2R);
|
||||||
|
}),
|
||||||
|
props.UpdateManager.FromHashValue("skid", nil, func(val) {
|
||||||
|
obj["AI_slipskid"].setTranslation(val, 0);
|
||||||
|
}),
|
||||||
|
props.UpdateManager.FromHashList(["altimeter_mode","qnh_hpa","qnh_inhg"], nil, func(val) {
|
||||||
|
obj.updateQNH(val);
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
_showIESI = 0;
|
_showIESI = 0;
|
||||||
_fast = 0;
|
_fast = 0;
|
||||||
_IESITime = 0.0;
|
_IESITime = 0.0;
|
||||||
|
obj._cachedInhg = nil;
|
||||||
|
|
||||||
me.page = canvas_group;
|
return obj;
|
||||||
|
},
|
||||||
return me;
|
|
||||||
},
|
|
||||||
getKeys: func() {
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
update: func() {
|
|
||||||
cur_time = et.getValue();
|
|
||||||
# todo consider relay 7XB for power of DC HOT 1
|
|
||||||
# todo transient max 0.2s
|
|
||||||
# todo 20W power consumption
|
|
||||||
if (iesi_reset.getValue() == 1) {
|
|
||||||
if (iesi_init.getBoolValue() and _IESITime + 90 >= et.getValue()) {
|
|
||||||
_fast = 1;
|
|
||||||
} else {
|
|
||||||
_fast = 0;
|
|
||||||
}
|
|
||||||
iesi_init.setBoolValue(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (systems.ELEC.Bus.dcEss.getValue() >= 25 or (systems.ELEC.Bus.dcHot1.getValue() >= 25 and airspeed.getValue() >= 50 and cur_time >= 5)) {
|
|
||||||
_showIESI = 1;
|
|
||||||
IESI.update();
|
|
||||||
|
|
||||||
if (aconfig.getValue() != 1 and iesi_init.getValue() != 1) {
|
|
||||||
iesi_init.setBoolValue(1);
|
|
||||||
if (_fast) {
|
|
||||||
_IESITime = cur_time - 80;
|
|
||||||
_fast = 0;
|
|
||||||
} else {
|
|
||||||
_IESITime = cur_time;
|
|
||||||
}
|
|
||||||
} else if (aconfig.getValue() == 1 and iesi_init.getValue() != 1) {
|
|
||||||
iesi_init.setBoolValue(1);
|
|
||||||
_IESITime = cur_time - 87;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
_showIESI = 0;
|
|
||||||
iesi_init.setBoolValue(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_showIESI and iesi_brt.getValue() > 0.01) {
|
|
||||||
IESI.page.show();
|
|
||||||
} else {
|
|
||||||
IESI.page.hide();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
var canvas_IESI = {
|
|
||||||
new: func(canvas_group, file) {
|
|
||||||
var m = {parents: [canvas_IESI, canvas_IESI_base]};
|
|
||||||
m.init(canvas_group, file);
|
|
||||||
m._cachedInhg = -99;
|
|
||||||
m._machWasAbove50 = 0;
|
|
||||||
m._roll = 0;
|
|
||||||
return m;
|
|
||||||
},
|
|
||||||
getKeys: func() {
|
getKeys: func() {
|
||||||
return ["IESI","IESI_Init","ASI_scale","ASI_mach","ASI_mach_decimal","AI_center","AI_horizon","AI_bank","AI_slipskid","ALT_scale","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_meters","QNH_setting","QNH_std","negText","negText2","AI_bank_scale"];
|
return ["IESI","IESI_Init","ASI_scale","ASI_mach","ASI_mach_decimal","AI_center","AI_horizon","AI_bank","AI_slipskid","ALT_scale","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_meters","QNH_setting","QNH_std","negText","negText2","AI_bank_scale"];
|
||||||
},
|
},
|
||||||
update: func() {
|
update: func(notification) {
|
||||||
if (qnh_inhg.getValue() != me._cachedInhg) {
|
if (notification.qnh_inhg != me._cachedInhg) {
|
||||||
me._cachedInhg = qnh_inhg.getValue();
|
me._cachedInhg = notification.qnh_inhg;
|
||||||
me.updateQNH();
|
me.updateQNH(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_IESITime + 90 >= et.getValue()) {
|
me.updatePower(notification);
|
||||||
|
if (me.group.getVisible() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_IESITime + 90 >= notification.elapsed_seconds) {
|
||||||
me["IESI"].hide();
|
me["IESI"].hide();
|
||||||
me["IESI_Init"].show();
|
me["IESI_Init"].show();
|
||||||
return;
|
return;
|
||||||
|
@ -151,137 +171,119 @@ var canvas_IESI = {
|
||||||
me["IESI"].show();
|
me["IESI"].show();
|
||||||
}
|
}
|
||||||
|
|
||||||
# Airspeed
|
foreach(var update_item; me.update_items)
|
||||||
# Subtract 30, since the scale starts at 30, but don't allow less than 0, or more than 520 knots
|
{
|
||||||
airspeed_act = airspeed.getValue();
|
update_item.update(notification);
|
||||||
mach_act = mach.getValue();
|
}
|
||||||
if (airspeed_act <= 30) {
|
|
||||||
ASI = 0;
|
|
||||||
} else if (airspeed_act >= 520) {
|
|
||||||
ASI = 490;
|
|
||||||
} else {
|
|
||||||
ASI = airspeed_act - 30;
|
|
||||||
}
|
|
||||||
me["ASI_scale"].setTranslation(0, ASI * 8.295);
|
|
||||||
|
|
||||||
if (mach_act >= 0.5) {
|
|
||||||
me._machWasAbove50 = 1;
|
|
||||||
me["ASI_mach_decimal"].show();
|
|
||||||
me["ASI_mach"].show();
|
|
||||||
} elsif (mach_act >= 0.45 and me._machWasAbove50) {
|
|
||||||
me["ASI_mach_decimal"].show();
|
|
||||||
me["ASI_mach"].show();
|
|
||||||
} else {
|
|
||||||
me._machWasAbove50 = 0;
|
|
||||||
me["ASI_mach_decimal"].hide();
|
|
||||||
me["ASI_mach"].hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mach_act >= 0.999) {
|
|
||||||
me["ASI_mach"].setText("99");
|
|
||||||
} else {
|
|
||||||
me["ASI_mach"].setText(sprintf("%2.0f", mach_act * 100));
|
|
||||||
}
|
|
||||||
|
|
||||||
# Attitude
|
|
||||||
me._roll = pts.Orientation.roll.getValue();
|
|
||||||
me.AI_horizon_trans.setTranslation(0, pitch.getValue() * 16.74);
|
|
||||||
me.AI_horizon_rot.setRotation(-me._roll * D2R, me["AI_center"].getCenter());
|
|
||||||
|
|
||||||
me["AI_slipskid"].setTranslation(skid.getValue(), 0);
|
|
||||||
me["AI_bank"].setRotation(-me._roll * D2R);
|
|
||||||
|
|
||||||
# Altitude
|
|
||||||
me.altitude = altitude.getValue();
|
|
||||||
if (me.altitude > 50000) {
|
|
||||||
me.altitude = 50000;
|
|
||||||
} elsif (me.altitude < -2000) {
|
|
||||||
me.altitude = -2000;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (me.altitude < 0) {
|
|
||||||
me["negText"].show();
|
|
||||||
me["negText2"].show();
|
|
||||||
} else {
|
|
||||||
me["negText"].hide();
|
|
||||||
me["negText2"].hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
me.altOffset = me.altitude / 500 - int(me.altitude / 500);
|
|
||||||
me.middleAltText = roundaboutAlt(me.altitude / 100);
|
|
||||||
me.middleAltOffset = nil;
|
|
||||||
if (me.altOffset > 0.5) {
|
|
||||||
me.middleAltOffset = -(me.altOffset - 1) * 258.5528;
|
|
||||||
} else {
|
|
||||||
me.middleAltOffset = -me.altOffset * 258.5528;
|
|
||||||
}
|
|
||||||
me["ALT_scale"].setTranslation(0, -me.middleAltOffset);
|
|
||||||
me["ALT_scale"].update();
|
|
||||||
me["ALT_five"].setText(sprintf("%03d", abs(me.middleAltText+10)));
|
|
||||||
me["ALT_four"].setText(sprintf("%03d", abs(me.middleAltText+5)));
|
|
||||||
me["ALT_three"].setText(sprintf("%03d", abs(me.middleAltText)));
|
|
||||||
me["ALT_two"].setText(sprintf("%03d", abs(me.middleAltText-5)));
|
|
||||||
me["ALT_one"].setText(sprintf("%03d", abs(me.middleAltText-10)));
|
|
||||||
|
|
||||||
me.altitudeText = altitude_ind.getValue();
|
|
||||||
if (me.altitude < 0 and me.altitudeText > 20) {
|
|
||||||
me.altitudeText = 20;
|
|
||||||
} elsif (me.altitude > 0 and me.altitudeText > 500) {
|
|
||||||
me.altitudeText = 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
me["ALT_digits"].setText(sprintf("%s", me.altitudeText));
|
|
||||||
me["ALT_meters"].setText(sprintf("%5.0f", math.round(me.altitude * 0.3048, 10)));
|
|
||||||
altTens = num(right(sprintf("%02d", me.altitude), 2));
|
|
||||||
me["ALT_tens"].setTranslation(0, altTens * 3.16);
|
|
||||||
},
|
},
|
||||||
updateQNH: func() {
|
updateQNH: func(notification) {
|
||||||
if (altimeter_mode.getBoolValue()) {
|
if (notification.altimeter_mode) {
|
||||||
me["QNH_setting"].hide();
|
me["QNH_setting"].hide();
|
||||||
me["QNH_std"].show();
|
me["QNH_std"].show();
|
||||||
} else {
|
} else {
|
||||||
me["QNH_setting"].setText(sprintf("%4.0f", qnh_hpa.getValue()) ~ "/" ~ sprintf("%2.2f", qnh_inhg.getValue()));
|
me["QNH_setting"].setText(sprintf("%4.0f", notification.qnh_hpa) ~ "/" ~ sprintf("%2.2f", notification.qnh_inhg));
|
||||||
me["QNH_setting"].show();
|
me["QNH_setting"].show();
|
||||||
me["QNH_std"].hide();
|
me["QNH_std"].hide();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
updatePower: func(notification) {
|
||||||
|
# todo consider relay 7XB for power of DC HOT 1
|
||||||
|
# todo transient max 0.2s
|
||||||
|
# todo 20W power consumption
|
||||||
|
if (notification.attReset == 1) {
|
||||||
|
if (notification.iesiInit and _IESITime + 90 >= notification.elapsed_seconds) {
|
||||||
|
_fast = 1;
|
||||||
|
} else {
|
||||||
|
_fast = 0;
|
||||||
|
}
|
||||||
|
iesi_init.setBoolValue(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (notification.dcEss >= 25 or (notification.dcHot1 >= 25 and notification.airspeed >= 50 and notification.elapsed_seconds >= 5)) {
|
||||||
|
_showIESI = 1;
|
||||||
|
if (notification.acconfig != 1 and notification.iesiInit != 1) {
|
||||||
|
iesi_init.setBoolValue(1);
|
||||||
|
if (_fast) {
|
||||||
|
_IESITime = notification.elapsed_seconds - 80;
|
||||||
|
_fast = 0;
|
||||||
|
} else {
|
||||||
|
_IESITime = notification.elapsed_seconds;
|
||||||
|
}
|
||||||
|
} else if (notification.acconfig == 1 and notification.iesiInit != 1) {
|
||||||
|
iesi_init.setBoolValue(1);
|
||||||
|
_IESITime = notification.elapsed_seconds - 87;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_showIESI = 0;
|
||||||
|
iesi_init.setBoolValue(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_showIESI and notification.iesiBrt > 0.01) {
|
||||||
|
me.group.setVisible(1);
|
||||||
|
} else {
|
||||||
|
me.group.setVisible(0);
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
setlistener("sim/signals/fdm-initialized", func {
|
var IESIRecipient =
|
||||||
IESI_display = canvas.new({
|
{
|
||||||
"name": "IESI",
|
new: func(_ident)
|
||||||
"size": [1024, 1024],
|
{
|
||||||
"view": [1024, 1024],
|
var IESIRecipient = emesary.Recipient.new(_ident);
|
||||||
"mipmapping": 1
|
IESIRecipient.MainScreen = nil;
|
||||||
});
|
IESIRecipient.Receive = func(notification)
|
||||||
IESI_display.addPlacement({"node": "iesi.screen"});
|
{
|
||||||
var group_IESI = IESI_display.createGroup();
|
if (notification.NotificationType == "FrameNotification")
|
||||||
|
{
|
||||||
IESI = canvas_IESI.new(group_IESI, "Aircraft/A320-family/Models/Instruments/IESI/res/iesi.svg");
|
if (IESIRecipient.MainScreen == nil) {
|
||||||
|
IESIRecipient.MainScreen = canvas_IESI.new("Aircraft/A320-family/Models/Instruments/IESI/res/iesi.svg", "A320 IESI");
|
||||||
IESI.updateQNH();
|
}
|
||||||
|
|
||||||
IESI_update.start();
|
#if (!math.mod(notifications.frameNotification.FrameCount,2)){
|
||||||
if (iesi_rate.getValue() > 1) {
|
IESIRecipient.MainScreen.update(notification);
|
||||||
rateApply();
|
#}
|
||||||
}
|
return emesary.Transmitter.ReceiptStatus_OK;
|
||||||
});
|
}
|
||||||
|
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||||
|
};
|
||||||
|
return IESIRecipient;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
setlistener("/instrumentation/altimeter[0]/std", func() { if (IESI != nil) { IESI.updateQNH(); } }, 0, 0);
|
var A320IESI = IESIRecipient.new("A320 IESI");
|
||||||
|
emesary.GlobalTransmitter.Register(A320IESI);
|
||||||
|
|
||||||
var rateApply = func {
|
var input = {
|
||||||
IESI_update.restart(0.05 * iesi_rate.getValue());
|
"acconfig": "/systems/acconfig/autoconfig-running",
|
||||||
|
"airspeed": "/instrumentation/airspeed-indicator[0]/indicated-speed-kt",
|
||||||
|
"altitude": "/instrumentation/altimeter/indicated-altitude-ft",
|
||||||
|
"altitude_ind": "/instrumentation/altimeter/indicated-altitude-ft-pfd",
|
||||||
|
"altimeter_mode": "/instrumentation/altimeter[0]/std",
|
||||||
|
"attReset": "/instrumentation/iesi/att-reset",
|
||||||
|
"dcEss": "/systems/electrical/bus/dc-ess",
|
||||||
|
"dcHot1": "/systems/electrical/bus/dc-hot-1",
|
||||||
|
"iesiBrt": "/controls/lighting/DU/iesi",
|
||||||
|
"iesiInit": "/instrumentation/iesi/iesi-init",
|
||||||
|
"mach": "/instrumentation/airspeed-indicator/indicated-mach",
|
||||||
|
"pitch": "/instrumentation/iesi/pitch-deg",
|
||||||
|
"qnh_hpa": "/instrumentation/altimeter[0]/setting-hpa",
|
||||||
|
"qnh_inhg": "/instrumentation/altimeter[0]/setting-inhg",
|
||||||
|
"roll": "/orientation/roll-deg",
|
||||||
|
"skid": "/instrumentation/iesi/slip-skid",
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var name; keys(input)) {
|
||||||
|
emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 IESI", name, input[name]));
|
||||||
}
|
}
|
||||||
|
|
||||||
var IESI_update = maketimer(0.05, func {
|
|
||||||
canvas_IESI_base.update();
|
|
||||||
});
|
|
||||||
|
|
||||||
var showIESI = func {
|
var showIESI = func {
|
||||||
var dlg = canvas.Window.new([256, 256], "dialog").set("resize", 1);
|
var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1);
|
||||||
dlg.setCanvas(IESI_display);
|
dlg.setCanvas(A320IESI.MainScreen.canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setlistener("", func() { if (A320IESI.MainScreen != nil) { A320IESI.MainScreen.updateQNH(notification); } }, 0, 0);
|
||||||
|
|
||||||
var roundabout = func(x) {
|
var roundabout = func(x) {
|
||||||
var y = x - int(x);
|
var y = x - int(x);
|
||||||
return y < 0.5 ? int(x) : 1 + int(x);
|
return y < 0.5 ? int(x) : 1 + int(x);
|
||||||
|
|
|
@ -63,6 +63,7 @@ var myCockpit_switches = {
|
||||||
"toggle_chrono": {path: "/inputs/CHRONO", value: 0, type: "INT"},
|
"toggle_chrono": {path: "/inputs/CHRONO", value: 0, type: "INT"},
|
||||||
"toggle_xtrk_error": {path: "/nd/xtrk-error", value: 0, type: "BOOL"},
|
"toggle_xtrk_error": {path: "/nd/xtrk-error", value: 0, type: "BOOL"},
|
||||||
"toggle_trk_line": {path: "/nd/trk-line", value: 0, type: "BOOL"},
|
"toggle_trk_line": {path: "/nd/trk-line", value: 0, type: "BOOL"},
|
||||||
|
"ADIRS3": {path: "/nd/ir-3", value: 0, type: "BOOL"},
|
||||||
};
|
};
|
||||||
|
|
||||||
var canvas_nd_base = {
|
var canvas_nd_base = {
|
||||||
|
@ -186,6 +187,8 @@ var canvas_ND_1 = {
|
||||||
|
|
||||||
# here we make the ND:
|
# here we make the ND:
|
||||||
me.NDCpt = ND.new("instrumentation/efis", myCockpit_switches, "Airbus");
|
me.NDCpt = ND.new("instrumentation/efis", myCockpit_switches, "Airbus");
|
||||||
|
me.NDCpt.attitude_heading_setting = -1;
|
||||||
|
me.NDCpt.adirs_property = props.globals.getNode("/instrumentation/efis[0]/nd/ir-1",1);
|
||||||
me.NDCpt.newMFD(canvas_group);
|
me.NDCpt.newMFD(canvas_group);
|
||||||
me.NDCpt.update();
|
me.NDCpt.update();
|
||||||
|
|
||||||
|
@ -205,7 +208,10 @@ var canvas_ND_2 = {
|
||||||
m.init(canvas_group);
|
m.init(canvas_group);
|
||||||
|
|
||||||
# here we make the ND:
|
# here we make the ND:
|
||||||
|
myCockpit_switches["ADIRS"]= {path: "/nd/ir-2", value: 0, type: "BOOL"};
|
||||||
me.NDFo = ND.new("instrumentation/efis[1]", myCockpit_switches, "Airbus");
|
me.NDFo = ND.new("instrumentation/efis[1]", myCockpit_switches, "Airbus");
|
||||||
|
me.NDFo.attitude_heading_setting = 1;
|
||||||
|
me.NDFo.adirs_property = props.globals.getNode("/instrumentation/efis[1]/nd/ir-2",1);
|
||||||
me.NDFo.newMFD(canvas_group);
|
me.NDFo.newMFD(canvas_group);
|
||||||
me.NDFo.update();
|
me.NDFo.update();
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ var _MP_dbg_lvl = canvas._MP_dbg_lvl;
|
||||||
var assert_m = canvas.assert_m;
|
var assert_m = canvas.assert_m;
|
||||||
|
|
||||||
var wxr_live_tree = "/instrumentation/wxr";
|
var wxr_live_tree = "/instrumentation/wxr";
|
||||||
|
var adirs_3 = props.globals.getNode("/instrumentation/efis[0]/nd/ir-3", 1);
|
||||||
|
|
||||||
canvas.NavDisplay.set_switch = func(s, v) {
|
canvas.NavDisplay.set_switch = func(s, v) {
|
||||||
var switch = me.efis_switches[s];
|
var switch = me.efis_switches[s];
|
||||||
|
@ -160,6 +161,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
|
||||||
var make_event_handler = func(predicate, layer) func predicate(me, layer);
|
var make_event_handler = func(predicate, layer) func predicate(me, layer);
|
||||||
|
|
||||||
me.layers={}; # storage container for all ND specific layers
|
me.layers={}; # storage container for all ND specific layers
|
||||||
|
me.predicates={};
|
||||||
# look up all required layers as specified per the NDStyle hash and do the initial setup for event handling
|
# look up all required layers as specified per the NDStyle hash and do the initial setup for event handling
|
||||||
var default_opts = me.options != nil and contains(me.options, "defaults") ? me.options.defaults : nil;
|
var default_opts = me.options != nil and contains(me.options, "defaults") ? me.options.defaults : nil;
|
||||||
foreach(var layer; me.nd_style.layers) {
|
foreach(var layer; me.nd_style.layers) {
|
||||||
|
@ -214,6 +216,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
|
||||||
# pass the ND instance and the layer handle to the predicate when it is called
|
# pass the ND instance and the layer handle to the predicate when it is called
|
||||||
# so that it can directly access the ND instance and its own layer (without having to know the layer"s name)
|
# so that it can directly access the ND instance and its own layer (without having to know the layer"s name)
|
||||||
var event_handler = make_event_handler(layer.predicate, the_layer);
|
var event_handler = make_event_handler(layer.predicate, the_layer);
|
||||||
|
me.predicates[layer.name] = event_handler;
|
||||||
foreach(var event; layer.update_on) {
|
foreach(var event; layer.update_on) {
|
||||||
# this handles timers
|
# this handles timers
|
||||||
if (typeof(event)=="hash" and contains(event, "rate_hz")) {
|
if (typeof(event)=="hash" and contains(event, "rate_hz")) {
|
||||||
|
@ -433,7 +436,7 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
|
||||||
me.symbols.selHdgLine2.setRotation(hdgBugRot);
|
me.symbols.selHdgLine2.setRotation(hdgBugRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
var staPtrVis = !me.in_mode("toggle_display_mode", ["PLAN"]);
|
var staPtrVis = (!me.in_mode("toggle_display_mode", ["PLAN"]) and (me.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == me.attitude_heading_setting)));
|
||||||
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"))
|
||||||
{
|
{
|
||||||
|
@ -459,7 +462,7 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
|
||||||
var adf1hdg = getprop("/instrumentation/adf[1]/indicated-bearing-deg");
|
var adf1hdg = getprop("/instrumentation/adf[1]/indicated-bearing-deg");
|
||||||
if(!me.get_switch("toggle_centered"))
|
if(!me.get_switch("toggle_centered"))
|
||||||
{
|
{
|
||||||
if(me.in_mode("toggle_display_mode", ["PLAN"]))
|
if(me.in_mode("toggle_display_mode", ["PLAN"]) or (me.adirs_property.getValue() != 1 and (adirs_3.getValue() != 1 or att_switch.getValue() != me.attitude_heading_setting)))
|
||||||
me.symbols.trkInd.hide();
|
me.symbols.trkInd.hide();
|
||||||
else
|
else
|
||||||
me.symbols.trkInd.show();
|
me.symbols.trkInd.show();
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 134 KiB |
|
@ -7,6 +7,9 @@
|
||||||
var ALWAYS = func 1;
|
var ALWAYS = func 1;
|
||||||
var NOTHING = func nil;
|
var NOTHING = func nil;
|
||||||
|
|
||||||
|
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"] = {
|
canvas.NDStyles["Airbus"] = {
|
||||||
font_mapper: func(family, weight) {
|
font_mapper: func(family, weight) {
|
||||||
if( family == "Liberation Sans" and weight == "normal" )
|
if( family == "Liberation Sans" and weight == "normal" )
|
||||||
|
@ -86,7 +89,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible=nd.get_switch("toggle_weather") and
|
var visible=nd.get_switch("toggle_weather") and
|
||||||
nd.get_switch("toggle_weather_live") and
|
nd.get_switch("toggle_weather_live") and
|
||||||
nd.get_switch("toggle_display_mode") != "PLAN";
|
nd.get_switch("toggle_display_mode") != "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();
|
||||||
|
@ -105,7 +108,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
#print("Running storms predicate");
|
#print("Running storms predicate");
|
||||||
var visible=nd.get_switch("toggle_weather") and
|
var visible=nd.get_switch("toggle_weather") and
|
||||||
!nd.get_switch("toggle_weather_live") and
|
!nd.get_switch("toggle_weather_live") and
|
||||||
nd.get_switch("toggle_display_mode") != "PLAN";
|
nd.get_switch("toggle_display_mode") != "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) {
|
||||||
#print("storms update requested! (timer issue when closing the dialog?)");
|
#print("storms update requested! (timer issue when closing the dialog?)");
|
||||||
|
@ -122,7 +125,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible = nd.get_switch("toggle_waypoints") and
|
var visible = nd.get_switch("toggle_waypoints") and
|
||||||
nd.in_mode("toggle_display_mode", ["MAP"]) and
|
nd.in_mode("toggle_display_mode", ["MAP"]) and
|
||||||
(nd.rangeNm() <= 40);
|
(nd.rangeNm() <= 40) 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();
|
||||||
|
@ -151,7 +154,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
isMapStructure: 1,
|
isMapStructure: 1,
|
||||||
update_on: ["toggle_display_mode","toggle_range",{rate_hz: 2}],
|
update_on: ["toggle_display_mode","toggle_range",{rate_hz: 2}],
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible = nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]);# and nd.get_switch("toggle_fplan");
|
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();
|
||||||
|
@ -237,7 +240,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
"toggle_display_mode"],
|
"toggle_display_mode"],
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible = nd.get_switch("toggle_airports") and
|
var visible = nd.get_switch("toggle_airports") and
|
||||||
nd.in_mode("toggle_display_mode", ["MAP"]);
|
nd.in_mode("toggle_display_mode", ["MAP"]) 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();
|
||||||
|
@ -260,7 +263,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
# toggle visibility here
|
# toggle visibility here
|
||||||
var visible = nd.get_switch("toggle_vor") and
|
var visible = nd.get_switch("toggle_vor") and
|
||||||
nd.in_mode("toggle_display_mode", ["MAP"]) and
|
nd.in_mode("toggle_display_mode", ["MAP"]) and
|
||||||
(nd.rangeNm() <= 40);
|
(nd.rangeNm() <= 40) 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();
|
||||||
|
@ -289,7 +292,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible = nd.get_switch("toggle_dme") and
|
var visible = nd.get_switch("toggle_dme") and
|
||||||
nd.in_mode("toggle_display_mode", ["MAP"]) and
|
nd.in_mode("toggle_display_mode", ["MAP"]) and
|
||||||
(nd.rangeNm() <= 40);
|
(nd.rangeNm() <= 40) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting));
|
||||||
# toggle visibility here
|
# toggle visibility here
|
||||||
layer.group.setVisible( visible );
|
layer.group.setVisible( visible );
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
@ -322,7 +325,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible = nd.get_switch("toggle_ndb") and
|
var visible = nd.get_switch("toggle_ndb") and
|
||||||
nd.in_mode("toggle_display_mode", ["MAP"]) and
|
nd.in_mode("toggle_display_mode", ["MAP"]) and
|
||||||
(nd.rangeNm() <= 40);
|
(nd.rangeNm() <= 40) and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting));
|
||||||
# print("Running vor layer predicate");
|
# print("Running vor layer predicate");
|
||||||
# toggle visibility here
|
# toggle visibility here
|
||||||
layer.group.setVisible( visible );
|
layer.group.setVisible( visible );
|
||||||
|
@ -389,7 +392,6 @@ canvas.NDStyles["Airbus"] = {
|
||||||
var visible = nd.get_switch("toggle_traffic");
|
var visible = nd.get_switch("toggle_traffic");
|
||||||
layer.group.setVisible( visible );
|
layer.group.setVisible( visible );
|
||||||
if (visible) {
|
if (visible) {
|
||||||
#print("Updating MapStructure ND layer: TFC");
|
|
||||||
layer.update();
|
layer.update();
|
||||||
}
|
}
|
||||||
}, # end of layer update predicate
|
}, # end of layer update predicate
|
||||||
|
@ -400,7 +402,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
update_on:["toggle_range","toggle_display_mode"],
|
update_on:["toggle_range","toggle_display_mode"],
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible = (nd.rangeNm() <= 40) and
|
var visible = (nd.rangeNm() <= 40) 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)) ;
|
||||||
layer.group.setVisible( visible );
|
layer.group.setVisible( visible );
|
||||||
if (visible) {
|
if (visible) {
|
||||||
layer.update();
|
layer.update();
|
||||||
|
@ -420,7 +422,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
always_update: 1,
|
always_update: 1,
|
||||||
update_on:["toggle_range","toggle_display_mode","toggle_wpt_idx"],
|
update_on:["toggle_range","toggle_display_mode","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();
|
||||||
|
@ -452,7 +454,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();
|
||||||
|
@ -517,7 +519,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
missed_constraint_color: [1,0.57,0.14]
|
missed_constraint_color: [1,0.57,0.14]
|
||||||
},
|
},
|
||||||
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.toggle_cstr = nd.get_switch("toggle_cstr");
|
layer.toggle_cstr = nd.get_switch("toggle_cstr");
|
||||||
|
@ -542,7 +544,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
isMapStructure: 1,
|
isMapStructure: 1,
|
||||||
update_on: ["toggle_display_mode","toggle_range",{rate_hz: 2}],
|
update_on: ["toggle_display_mode","toggle_range",{rate_hz: 2}],
|
||||||
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();
|
||||||
|
@ -563,7 +565,7 @@ 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"]);
|
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();
|
||||||
|
@ -593,7 +595,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
always_update: 1,
|
always_update: 1,
|
||||||
update_on:["toggle_display_mode"],
|
update_on:["toggle_display_mode"],
|
||||||
predicate: func(nd, layer) {
|
predicate: func(nd, layer) {
|
||||||
var visible = nd.get_switch("toggle_display_mode") == "PLAN";
|
var visible = (nd.get_switch("toggle_display_mode") == "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();
|
||||||
|
@ -671,6 +673,24 @@ canvas.NDStyles["Airbus"] = {
|
||||||
is_false: func(nd) nd.symbols.compass_mask_ctr.hide(),
|
is_false: func(nd) nd.symbols.compass_mask_ctr.hide(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "nd_warn_memo",
|
||||||
|
impl: {
|
||||||
|
init: func(nd, symbol),
|
||||||
|
predicate: ALWAYS,
|
||||||
|
is_true: func(nd) nd.symbols.nd_warn_memo.hide(),
|
||||||
|
is_false: func(nd),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "nd_warn_msgbox",
|
||||||
|
impl: {
|
||||||
|
init: func(nd, symbol),
|
||||||
|
predicate: ALWAYS,
|
||||||
|
is_true: func(nd) nd.symbols.nd_warn_msgbox.hide(),
|
||||||
|
is_false: func(nd),
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
# TODO: taOnly doesn"t need to use getprop polling in update(), use a listener instead!
|
# TODO: taOnly doesn"t need to use getprop polling in update(), use a listener instead!
|
||||||
id: "taOnly", # the SVG ID
|
id: "taOnly", # the SVG ID
|
||||||
|
@ -742,7 +762,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();
|
||||||
|
@ -756,7 +776,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;
|
||||||
|
@ -779,9 +799,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));
|
||||||
|
@ -794,7 +815,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)
|
||||||
|
@ -807,7 +829,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");
|
||||||
|
@ -900,11 +923,70 @@ canvas.NDStyles["Airbus"] = {
|
||||||
is_false: func(nd) {},#nd.symbols.gs.hide(),
|
is_false: func(nd) {},#nd.symbols.gs.hide(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id:"nd_warn_hdg",
|
||||||
|
impl: {
|
||||||
|
init: func(nd,symbol),
|
||||||
|
common: func(nd),
|
||||||
|
predicate: func(nd) (nd.adirs_property.getValue() != 1 and (adirs_3.getValue() != 1 or att_switch.getValue() != nd.attitude_heading_setting)),
|
||||||
|
is_true: func(nd) {
|
||||||
|
nd.symbols.nd_warn_hdg.show();
|
||||||
|
},
|
||||||
|
is_false: func(nd) {
|
||||||
|
nd.symbols.nd_warn_hdg.hide();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"nd_warn_map",
|
||||||
|
impl: {
|
||||||
|
init: func(nd,symbol),
|
||||||
|
common: func(nd),
|
||||||
|
predicate: func(nd) (nd.adirs_property.getValue() != 1 and (adirs_3.getValue() != 1 or att_switch.getValue() != nd.attitude_heading_setting)),
|
||||||
|
is_true: func(nd) {
|
||||||
|
nd.symbols.nd_warn_map.show();
|
||||||
|
},
|
||||||
|
is_false: func(nd) {
|
||||||
|
nd.symbols.nd_warn_map.hide();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"unavailARC",
|
||||||
|
impl: {
|
||||||
|
init: func(nd,symbol),
|
||||||
|
common: func(nd),
|
||||||
|
predicate: func(nd) (!nd.get_switch("toggle_centered") and nd.get_switch("toggle_display_mode") != "PLAN"
|
||||||
|
and (nd.adirs_property.getValue() != 1 and (adirs_3.getValue() != 1 or att_switch.getValue() != nd.attitude_heading_setting))),
|
||||||
|
is_true: func(nd) {
|
||||||
|
nd.symbols.unavailARC.show();
|
||||||
|
},
|
||||||
|
is_false: func(nd) {
|
||||||
|
nd.symbols.unavailARC.hide();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:"unavailNAV",
|
||||||
|
impl: {
|
||||||
|
init: func(nd,symbol),
|
||||||
|
common: func(nd),
|
||||||
|
predicate: func(nd) (nd.get_switch("toggle_centered")
|
||||||
|
and (nd.adirs_property.getValue() != 1 and (adirs_3.getValue() != 1 or att_switch.getValue() != nd.attitude_heading_setting))),
|
||||||
|
is_true: func(nd) {
|
||||||
|
nd.symbols.unavailNAV.show();
|
||||||
|
},
|
||||||
|
is_false: func(nd) {
|
||||||
|
nd.symbols.unavailNAV.hide();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id:"compass",
|
id:"compass",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (!nd.get_switch("toggle_centered") and nd.get_switch("toggle_display_mode") != "PLAN"),
|
predicate: func(nd) (!nd.get_switch("toggle_centered") and nd.get_switch("toggle_display_mode") != "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.compass.setRotation(-nd.userHdgTrk*D2R);
|
nd.symbols.compass.setRotation(-nd.userHdgTrk*D2R);
|
||||||
nd.symbols.compass.show()
|
nd.symbols.compass.show()
|
||||||
|
@ -916,7 +998,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"compassApp",
|
id:"compassApp",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.get_switch("toggle_centered") and nd.get_switch("toggle_display_mode") != "PLAN"),
|
predicate: func(nd) (nd.get_switch("toggle_centered") and nd.get_switch("toggle_display_mode") != "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.compassApp.setRotation(-nd.userHdgTrk*D2R);
|
nd.symbols.compassApp.setRotation(-nd.userHdgTrk*D2R);
|
||||||
nd.symbols.compassApp.show()
|
nd.symbols.compassApp.show()
|
||||||
|
@ -928,7 +1011,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"northUp",
|
id:"northUp",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) nd.get_switch("toggle_display_mode") == "PLAN",
|
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "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.northUp.show(),
|
is_true: func(nd) nd.symbols.northUp.show(),
|
||||||
is_false: func(nd) nd.symbols.northUp.hide(),
|
is_false: func(nd) nd.symbols.northUp.hide(),
|
||||||
}, # of northUp.impl
|
}, # of northUp.impl
|
||||||
|
@ -937,7 +1020,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"planArcs",
|
id:"planArcs",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) ((nd.in_mode("toggle_display_mode", ["APP","VOR","PLAN"])) or ((nd.get_switch("toggle_display_mode") == "MAP") and (nd.get_switch("toggle_centered")))),
|
predicate: func(nd) (((nd.in_mode("toggle_display_mode", ["APP","VOR","PLAN"])) or ((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))),
|
||||||
is_true: func(nd) nd.symbols.planArcs.show(),
|
is_true: func(nd) nd.symbols.planArcs.show(),
|
||||||
is_false: func(nd) nd.symbols.planArcs.hide(),
|
is_false: func(nd) nd.symbols.planArcs.hide(),
|
||||||
}, # of planArcs.impl
|
}, # of planArcs.impl
|
||||||
|
@ -946,7 +1030,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"rangeArcs",
|
id:"rangeArcs",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) ((nd.get_switch("toggle_display_mode") == "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))),
|
||||||
is_true: func(nd) nd.symbols.rangeArcs.show(),
|
is_true: func(nd) nd.symbols.rangeArcs.show(),
|
||||||
is_false: func(nd) nd.symbols.rangeArcs.hide(),
|
is_false: func(nd) nd.symbols.rangeArcs.hide(),
|
||||||
}, # of rangeArcs.impl
|
}, # of rangeArcs.impl
|
||||||
|
@ -1047,7 +1132,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"aplSymMap",
|
id:"aplSymMap",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "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))),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.aplSymMap.set("z-index", 10);
|
nd.symbols.aplSymMap.set("z-index", 10);
|
||||||
nd.symbols.aplSymMap.show();
|
nd.symbols.aplSymMap.show();
|
||||||
|
@ -1060,7 +1146,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"aplSymMapCtr",
|
id:"aplSymMapCtr",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) ((nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")) or nd.in_mode("toggle_display_mode", ["APP","VOR"])),
|
predicate: func(nd) (((nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")) or nd.in_mode("toggle_display_mode", ["APP","VOR"]))
|
||||||
|
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.aplSymMapCtr.set("z-index", 10);
|
nd.symbols.aplSymMapCtr.set("z-index", 10);
|
||||||
nd.symbols.aplSymMapCtr.show();
|
nd.symbols.aplSymMapCtr.show();
|
||||||
|
@ -1157,8 +1244,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"trkInd2",
|
id:"trkInd2",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR","MAP"]) and
|
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR","MAP"]) and nd.get_switch("toggle_centered")
|
||||||
nd.get_switch("toggle_centered")),
|
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.trkInd2.show();
|
nd.symbols.trkInd2.show();
|
||||||
nd.symbols.trkInd2.setRotation((nd.aircraft_source.get_trk_mag()-nd.aircraft_source.get_hdg_mag())*D2R);
|
nd.symbols.trkInd2.setRotation((nd.aircraft_source.get_trk_mag()-nd.aircraft_source.get_hdg_mag())*D2R);
|
||||||
|
@ -1172,7 +1259,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
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.get_switch("toggle_centered") and
|
||||||
getprop(nd.options.defaults.lat_ctrl) != nd.options.defaults.managed_val),
|
getprop(nd.options.defaults.lat_ctrl) != nd.options.defaults.managed_val 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.trkline2.show();
|
nd.symbols.trkline2.show();
|
||||||
},
|
},
|
||||||
|
|
|
@ -5773,7 +5773,7 @@
|
||||||
</condition>
|
</condition>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
if (getprop("controls/apu/master") == 1) {
|
if (systems.APUNodes.Controls.master.getBoolValue()) {
|
||||||
systems.APUController.APU.startCommand();
|
systems.APUController.APU.startCommand();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -68,6 +68,7 @@ var canvas_upperECAM = {
|
||||||
obj[key].set("clip-frame", canvas.Element.PARENT);
|
obj[key].set("clip-frame", canvas.Element.PARENT);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
canvas.parsesvg(obj.test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg", {"font-mapper": obj.font_mapper} );
|
canvas.parsesvg(obj.test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg", {"font-mapper": obj.font_mapper} );
|
||||||
foreach(var key; obj.getKeysTest()) {
|
foreach(var key; obj.getKeysTest()) {
|
||||||
obj[key] = obj.test.getElementById(key);
|
obj[key] = obj.test.getElementById(key);
|
||||||
|
@ -451,8 +452,6 @@ var canvas_upperECAM = {
|
||||||
obj["ECAMR7"].setFont("LiberationMonoCustom.ttf");
|
obj["ECAMR7"].setFont("LiberationMonoCustom.ttf");
|
||||||
obj["ECAMR8"].setFont("LiberationMonoCustom.ttf");
|
obj["ECAMR8"].setFont("LiberationMonoCustom.ttf");
|
||||||
|
|
||||||
obj.page = obj.group;
|
|
||||||
|
|
||||||
# cache
|
# cache
|
||||||
obj._cachedN1 = [nil, nil];
|
obj._cachedN1 = [nil, nil];
|
||||||
obj._cachedN2 = [nil, nil];
|
obj._cachedN2 = [nil, nil];
|
||||||
|
@ -1090,7 +1089,7 @@ var showUpperECAM = func {
|
||||||
}
|
}
|
||||||
|
|
||||||
setlistener("/systems/electrical/bus/ac-ess", func() {
|
setlistener("/systems/electrical/bus/ac-ess", func() {
|
||||||
A320EWD.MainScreen.powerTransient();
|
if (A320EWD.MainScreen != nil) { A320EWD.MainScreen.powerTransient() }
|
||||||
}, 0, 0);
|
}, 0, 0);
|
||||||
|
|
||||||
var slatLockTimer = maketimer(0.50, func {
|
var slatLockTimer = maketimer(0.50, func {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,16 @@ 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);
|
||||||
|
foreach (var predicate; keys(canvas_nd.ND_1.NDCpt.predicates)) {
|
||||||
|
call(canvas_nd.ND_1.NDCpt.predicates[predicate]);
|
||||||
|
}
|
||||||
|
foreach (var predicate; keys(canvas_nd.ND_2.NDFo.predicates)) {
|
||||||
|
call(canvas_nd.ND_2.NDFo.predicates[predicate]);
|
||||||
|
}
|
||||||
|
},
|
||||||
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);
|
||||||
|
|
|
@ -7,6 +7,8 @@ var _NUMADIRU = 3;
|
||||||
|
|
||||||
var _selfTestTime = nil;
|
var _selfTestTime = nil;
|
||||||
|
|
||||||
|
var ADIRSnodesND = [props.globals.getNode("/instrumentation/efis[0]/nd/ir-1", 1),props.globals.getNode("/instrumentation/efis[1]/nd/ir-2", 1),props.globals.getNode("/instrumentation/efis[0]/nd/ir-3", 1)];
|
||||||
|
|
||||||
var ADIRU = {
|
var ADIRU = {
|
||||||
# local vars
|
# local vars
|
||||||
_alignTime: 0,
|
_alignTime: 0,
|
||||||
|
@ -110,18 +112,32 @@ var ADIRU = {
|
||||||
print("Stopping alignment or setting unaligned state");
|
print("Stopping alignment or setting unaligned state");
|
||||||
me.inAlign = 0;
|
me.inAlign = 0;
|
||||||
me.aligned = 0;
|
me.aligned = 0;
|
||||||
|
ADIRSnodesND[me.num].setValue(0);
|
||||||
ADIRS.Operating.aligned[me.num].setValue(0);
|
ADIRS.Operating.aligned[me.num].setValue(0);
|
||||||
if (me.alignTimer != nil) {
|
if (me.alignTimer != nil) {
|
||||||
me.alignTimer.stop();
|
me.alignTimer.stop();
|
||||||
}
|
}
|
||||||
|
foreach (var predicate; keys(canvas_nd.ND_1.NDCpt.predicates)) {
|
||||||
|
call(canvas_nd.ND_1.NDCpt.predicates[predicate]);
|
||||||
|
}
|
||||||
|
foreach (var predicate; keys(canvas_nd.ND_2.NDFo.predicates)) {
|
||||||
|
call(canvas_nd.ND_2.NDFo.predicates[predicate]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
stopAlignAligned: func() {
|
stopAlignAligned: func() {
|
||||||
me.inAlign = 0;
|
me.inAlign = 0;
|
||||||
me.aligned = 1;
|
me.aligned = 1;
|
||||||
|
ADIRSnodesND[me.num].setValue(1);
|
||||||
ADIRS.Operating.aligned[me.num].setValue(1);
|
ADIRS.Operating.aligned[me.num].setValue(1);
|
||||||
if (me.alignTimer != nil) {
|
if (me.alignTimer != nil) {
|
||||||
me.alignTimer.stop();
|
me.alignTimer.stop();
|
||||||
}
|
}
|
||||||
|
foreach (var predicate; keys(canvas_nd.ND_1.NDCpt.predicates)) {
|
||||||
|
call(canvas_nd.ND_1.NDCpt.predicates[predicate]);
|
||||||
|
}
|
||||||
|
foreach (var predicate; keys(canvas_nd.ND_2.NDFo.predicates)) {
|
||||||
|
call(canvas_nd.ND_2.NDFo.predicates[predicate]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
alignLoop: func() {
|
alignLoop: func() {
|
||||||
me._roll = pts.Orientation.roll.getValue();
|
me._roll = pts.Orientation.roll.getValue();
|
||||||
|
|
|
@ -87,19 +87,25 @@ var APU = {
|
||||||
powerOn: func() {
|
powerOn: func() {
|
||||||
# just in case
|
# just in case
|
||||||
me.resetStuff();
|
me.resetStuff();
|
||||||
if (systems.ELEC.Bus.dcBat.getValue() < 25) { return; }
|
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
||||||
|
settimer(func() {
|
||||||
|
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
||||||
|
me.resetStuff();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}, 0.2);
|
||||||
|
}
|
||||||
# apu able to receive emergency stop or start signals
|
# apu able to receive emergency stop or start signals
|
||||||
me.setState(1);
|
me.setState(1);
|
||||||
me.fuelValveCmd.setValue(1);
|
me.fuelValveCmd.setValue(1);
|
||||||
me.inletFlap.open();
|
me.inletFlap.open();
|
||||||
me.checkOil();
|
|
||||||
me.listenSignals = 1;
|
me.listenSignals = 1;
|
||||||
settimer(func() {
|
settimer(func() {
|
||||||
if (APUNodes.Controls.master.getValue() and !getprop("/systems/acconfig/autoconfig-running")) {
|
if (APUNodes.Controls.master.getValue() and !getprop("/systems/acconfig/autoconfig-running")) {
|
||||||
me.setState(2);
|
me.setState(2);
|
||||||
}
|
}
|
||||||
}, 3);
|
}, 3);
|
||||||
settimer(func() { me.checkOil }, 8);
|
settimer(func() { me.checkOil() }, 8);
|
||||||
},
|
},
|
||||||
startCommand: func(fast = 0) {
|
startCommand: func(fast = 0) {
|
||||||
if (me.listenSignals and (me.state == 1 or me.state == 2)) {
|
if (me.listenSignals and (me.state == 1 or me.state == 2)) {
|
||||||
|
@ -256,6 +262,7 @@ var APU = {
|
||||||
APUNodes.Controls.bleed.setValue(0);
|
APUNodes.Controls.bleed.setValue(0);
|
||||||
me.bleedTime = pts.Sim.Time.elapsedSec.getValue();
|
me.bleedTime = pts.Sim.Time.elapsedSec.getValue();
|
||||||
},
|
},
|
||||||
|
_powerLost: 0,
|
||||||
update: func() {
|
update: func() {
|
||||||
me._count += 1;
|
me._count += 1;
|
||||||
if (me._count == 5) {
|
if (me._count == 5) {
|
||||||
|
@ -263,14 +270,22 @@ var APU = {
|
||||||
if (me.state == 5 and APUNodes.Oil.pressure.getValue() < 35 or APUNodes.Oil.temperature.getValue() > 135) {
|
if (me.state == 5 and APUNodes.Oil.pressure.getValue() < 35 or APUNodes.Oil.temperature.getValue() > 135) {
|
||||||
me.autoStop();
|
me.autoStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
||||||
if (me.GenericControls.starter.getValue()) {
|
if (!me._powerLost) {
|
||||||
me.GenericControls.starter.setValue(0);
|
me._powerLost = 1;
|
||||||
}
|
settimer(func() {
|
||||||
if (me.state != 0) {
|
if (me._powerLost) {
|
||||||
me.autoStop();
|
if (me.GenericControls.starter.getValue()) {
|
||||||
|
me.GenericControls.starter.setValue(0);
|
||||||
|
}
|
||||||
|
if (me.state != 0) {
|
||||||
|
me.autoStop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 0.2);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
me._powerLost = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -483,6 +483,7 @@ var refuelClass = {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
systems.fuelSvc.Nodes.requestFuelLbs.setValue(pts.Consumables.Fuel.totalFuelLbs.getValue());
|
||||||
amount.setValue(math.round((systems.fuelSvc.Nodes.requestFuelLbs.getValue() + systems.fuelSvc.Nodes.requestLbs.getValue()) / 1000, 0.1));
|
amount.setValue(math.round((systems.fuelSvc.Nodes.requestFuelLbs.getValue() + systems.fuelSvc.Nodes.requestLbs.getValue()) / 1000, 0.1));
|
||||||
|
|
||||||
me._timerf();
|
me._timerf();
|
||||||
|
@ -593,11 +594,11 @@ var refuelClass = {
|
||||||
if (acconfig_weight_kgs.getValue() == 1) {
|
if (acconfig_weight_kgs.getValue() == 1) {
|
||||||
amount.setValue(target - 0.1 * LBS2KGS);
|
amount.setValue(target - 0.1 * LBS2KGS);
|
||||||
if ((target - 0.1) * LBS2KGS >= 10.0) {
|
if ((target - 0.1) * LBS2KGS >= 10.0) {
|
||||||
me._FQI_pre.setText(sprintf("%2.1f", (target - 0.1) * LBS2KGS));
|
me._FQI_pre.setText(sprintf("%2.1f", (target - (0.1 * LBS2KGS)) * LBS2KGS));
|
||||||
} else {
|
} else {
|
||||||
me._FQI_pre.setText(sprintf("%2.2f", (target - 0.1) * LBS2KGS));
|
me._FQI_pre.setText(sprintf("%2.2f", (target - (0.1 * LBS2KGS)) * LBS2KGS));
|
||||||
}
|
}
|
||||||
systems.fuelSvc.Nodes.requestLbs.setValue((((target - 0.1) * LBS2KGS) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
|
systems.fuelSvc.Nodes.requestLbs.setValue(((target - 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
|
||||||
} else {
|
} else {
|
||||||
amount.setValue(target - 0.1);
|
amount.setValue(target - 0.1);
|
||||||
if (target - 0.1 >= 10.0) {
|
if (target - 0.1 >= 10.0) {
|
||||||
|
@ -615,11 +616,11 @@ var refuelClass = {
|
||||||
if (acconfig_weight_kgs.getValue() == 1) {
|
if (acconfig_weight_kgs.getValue() == 1) {
|
||||||
amount.setValue(target + 0.1);
|
amount.setValue(target + 0.1);
|
||||||
if ((target + 0.1) * LBS2KGS >= 10.0) {
|
if ((target + 0.1) * LBS2KGS >= 10.0) {
|
||||||
me._FQI_pre.setText(sprintf("%2.1f", (target + 0.1) * LBS2KGS));
|
me._FQI_pre.setText(sprintf("%2.1f", (target + (0.1 * LBS2KGS)) * LBS2KGS));
|
||||||
} else {
|
} else {
|
||||||
me._FQI_pre.setText(sprintf("%2.2f", (target + 0.1) * LBS2KGS));
|
me._FQI_pre.setText(sprintf("%2.2f", (target + (0.1 * LBS2KGS)) * LBS2KGS));
|
||||||
}
|
}
|
||||||
systems.fuelSvc.Nodes.requestLbs.setValue((((target + 0.1) * LBS2KGS) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
|
systems.fuelSvc.Nodes.requestLbs.setValue(((target + 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
|
||||||
} else {
|
} else {
|
||||||
amount.setValue(target + 0.1);
|
amount.setValue(target + 0.1);
|
||||||
if (target + 0.1 >= 10.0) {
|
if (target + 0.1 >= 10.0) {
|
||||||
|
|
Loading…
Reference in a new issue