1
0
Fork 0

added TERR AHEAD with color

This commit is contained in:
Inuyaksa 2021-02-25 00:12:04 +01:00
parent ec429b8c83
commit 7bc27a893e
3 changed files with 36 additions and 7 deletions

View file

@ -138,7 +138,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
# because things are much better configurable that way
# now look up all required SVG elements and initialize member fields using the same name to have a convenient handle
foreach(var element; ["dmeLDist","dmeRDist","dmeL","dmeR","vorL","vorR","vorLId","vorRId",
"status.wxr","status.wpt","status.sta","status.arpt","terrHI","terrLO"])
"status.wxr","status.wpt","status.sta","status.arpt","terrHI","terrLO","TerrLabel","terrAhead"])
me.symbols[element] = me.nd.getElementById(element);
# load elements from vector image, and create instance variables using identical names, and call updateCenter() on each

View file

@ -26,13 +26,13 @@
inkscape:window-height="1017"
id="namedview102"
showgrid="false"
inkscape:zoom="0.77702762"
inkscape:cx="212.87887"
inkscape:cy="628.74339"
inkscape:zoom="2.197766"
inkscape:cx="933.14634"
inkscape:cy="816.83256"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg5180"
inkscape:current-layer="terrGroup"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-object-midpoints="true"
@ -252,7 +252,7 @@
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
x="954.74292"
y="828.34009"
id="text1996"
id="TerrLabel"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25"
sodipodi:role="line"
@ -291,7 +291,23 @@
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f2f235;stroke-width:3.15591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.9941;stop-color:#000000;stop-opacity:1"
d="m 962.24879,861.87476 63.60531,0.61588"
id="path2033"
sodipodi:nodetypes="cc" /></g><path
sodipodi:nodetypes="cc" /><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
x="1020.2351"
y="798.34009"
id="terrAhead"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25;text-align:end;text-anchor:end"
sodipodi:role="line"
id="tspan1244"
x="1020.2351"
y="798.34009">TERR</tspan><tspan
style="font-size:24px;line-height:1.25;text-align:end;text-anchor:end"
sodipodi:role="line"
x="1020.2351"
y="828.34009"
id="tspan1248">AHEAD</tspan></text></g><path
sodipodi:nodetypes="cc"
inkscape:label="#path3843"
inkscape:transform-center-y="-340.574"

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View file

@ -14,7 +14,10 @@ var vhdg_bug = props.globals.getNode("/it-autoflight/input/hdg",0); # ND compass
var terrain_minalt = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-on-nd/min-altitude", 0);
var terrain_maxalt = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-altitude", -9999);
var terrain_alert = props.globals.getNode("/instrumentation/mk-viii/outputs/alert-mode",0);
var AMBER = [0.7333,0.3803,0.0000];
var RED = [1.0000,0.0000,0.0000];
canvas.NDStyles["Airbus"] = {
font_mapper: func(family, weight) {
@ -1992,6 +1995,16 @@ canvas.NDStyles["Airbus"] = {
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)) ),
is_true: func(nd){
if (terrain_maxalt.getValue() != -9999) {
var alert = terrain_alert.getValue();
if (alert == 0) {
nd.symbols.TerrLabel.setVisible(1);
nd.symbols.terrAhead.setVisible(0);
} else {
nd.symbols.TerrLabel.setVisible(0);
nd.symbols.terrAhead.setVisible(1);
if (alert == 1) nd.symbols.terrAhead.setColor(AMBER[0],AMBER[1],AMBER[2]);
else nd.symbols.terrAhead.setColor(RED[0],RED[1],RED[2]);
}
nd.symbols.terrLO.setText(sprintf("%03d",math.round(terrain_minalt.getValue()/100)));
nd.symbols.terrHI.setText(sprintf("%03d",math.round(terrain_maxalt.getValue()/100)));
nd.symbols.terrGroup.show();