1
0
Fork 0

green arrows for ADF on ND

This commit is contained in:
Inuyaksa 2021-03-01 21:41:29 +01:00
parent f7adf7d2f5
commit d53003e43d
3 changed files with 45 additions and 27 deletions

View file

@ -167,6 +167,9 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
foreach(var feature; me.nd_style.features ) {
me.symbols[feature.id] = me.nd.getElementById(feature.id).updateCenter();
if(contains(feature.impl,"init")) feature.impl.init(me.nd, feature); # call The element"s init code (i.e. updateCenter)
if(contains(feature.impl,"changed_only")) {
if (feature.impl.changed_only == 1) feature.last_predicate = nil;
}
}
### this is the "old" method that"s less flexible, we want to use the style hash instead (see above)
@ -190,7 +193,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
foreach(var element; ["staArrowL2","staArrowR2","staArrowL","staArrowR"] )
me.symbols[element] = easeArrow.new( me.nd.getElementById(element).updateCenter() );
me.map = me.nd.createChild("map","map")
.set("clip", "rect(124, 1024, 1024, 0)")
.set("screen-range", 700)
@ -736,7 +739,12 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
if (contains(feature.impl, "common")) feature.impl.common(me);
# conditional stuff
if(!contains(feature.impl, "predicate")) continue; # no conditional stuff
if ( var result = feature.impl.predicate(me) )
var result = feature.impl.predicate(me);
if (contains(feature, "last_predicate")) {
if (feature.last_predicate != nil and feature.last_predicate == result) continue;
feature.last_predicate = result;
}
if ( result )
feature.impl.is_true(me, result); # pass the result to the predicate
else
feature.impl.is_false( me, result ); # pass the result to the predicate

View file

@ -27,12 +27,12 @@
id="namedview102"
showgrid="false"
inkscape:zoom="3.1081105"
inkscape:cx="163.03816"
inkscape:cy="979.87161"
inkscape:cx="454.60496"
inkscape:cy="542.30673"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer3"
inkscape:current-layer="unavailARC"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-object-midpoints="true"
@ -101,7 +101,10 @@
id="guide1327" /><sodipodi:guide
position="1017.0166,55.726826"
orientation="1,0"
id="guide1344" /></sodipodi:namedview><metadata
id="guide1344" /><sodipodi:guide
position="978.72968,72.618123"
orientation="1,0"
id="guide1259" /></sodipodi:namedview><metadata
id="metadata5186"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /><dc:creator><cc:Agent><dc:title>Gijs de Rooy</dc:title></cc:Agent></dc:creator><cc:license
@ -302,7 +305,7 @@
id="tspan2006"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;fill:#0dc04b">000</tspan></text><rect
style="fill:none;stroke:#f2f235;stroke-width:3.15591;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.9941"
style="fill:none;stroke:#f2f235;stroke-width:3.15591;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect2018"
width="63.76524"
height="58.673904"
@ -1014,11 +1017,11 @@
inkscape:label="#text7243"
id="dmeL"
y="993.85461"
x="85.73262"
x="87.73262"
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"
xml:space="preserve"><tspan
y="993.85461"
x="85.73262"
x="87.73262"
id="tspan3060"
sodipodi:role="line"
style="font-size:24px;line-height:1.25">NM</tspan></text>
@ -1039,36 +1042,36 @@
inkscape:label="#text7243"
id="vorR"
y="919.5495"
x="884.85938"
x="883.85938"
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:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="919.5495"
x="884.85938"
x="883.85938"
id="tspan3076"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;fill:#0dc04b">VOR 2</tspan></text>
<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:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
x="967.7326"
x="967.03125"
y="993.85461"
id="dmeR"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25"
sodipodi:role="line"
id="tspan3080"
x="967.7326"
x="967.03125"
y="993.85461">NM</tspan></text>
<text
inkscape:label="#text7243"
id="vorRId"
y="955.91815"
x="884.9375"
x="883.9375"
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:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="955.91815"
x="884.9375"
x="883.9375"
id="tspan3088"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;fill:#0dc04b">ABC</tspan></text>
@ -1415,7 +1418,8 @@
style="display:inline;fill:none;stroke:#cecdce;stroke-width:3.28819;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 23.634,896.5254 v 7.83228 m 1.26e-4,24.4977 v 24.41763 M 23.634,903.63377 8.682512,928.85538 H 23.634 l 14.467869,0.21255 z"
sodipodi:nodetypes="ccccccccc" /><g
id="dmeLDist"><text
id="dmeLDist"
transform="translate(2)"><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:#0dc04b;fill-opacity:1;stroke:none"
x="56.791557"
@ -1439,7 +1443,7 @@
sodipodi:role="line"
style="font-size:24px;line-height:1.25;fill:#0dc04b">.9</tspan></text></g><g
id="dmeRDist"
transform="translate(0.09918213)"><text
transform="translate(-0.90081787)"><text
inkscape:label="#text7243"
id="dmeRDist1"
y="993.85461"

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View file

@ -18,7 +18,7 @@ var terrain_maxcol = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-
var terrain_alert = props.globals.getNode("/instrumentation/mk-viii/outputs/alert-mode",0);
var GREEN = [0.0509,0.7529,0.2941];
var YELLOW = [0.9333,0.9333,0.0000];
var YELLOW = [0.949,0.949,0.207];
var RED = [1.0000,0.0000,0.0000];
canvas.NDStyles["Airbus"] = {
@ -1623,22 +1623,23 @@ canvas.NDStyles["Airbus"] = {
impl: {
init: func(nd,symbol),
predicate: func(nd) (nd.get_switch("toggle_lh_vor_adf") != 0),
changed_only: 1,
is_true: func(nd) {
nd.symbols.dmeL.show();
if(nd.get_switch("toggle_lh_vor_adf") < 0){
nd.symbols.vorL.setText("ADF 1");
nd.symbols.vorL.setColor(0.195,0.96,0.097);
nd.symbols.vorLId.setColor(0.195,0.96,0.097);
nd.symbols.dmeLDist.setColor(0.195,0.96,0.097);
#nd.symbols.dmeLDist.setColor(0.195,0.96,0.097);
nd.symbols.dmeL.setText("");
}
else{
nd.symbols.vorL.setText("VOR 1");
nd.symbols.vorL.setColor(1,1,1);
nd.symbols.vorLId.setColor(1,1,1);
nd.symbols.dmeLDist.setColor(1,1,1);
#nd.symbols.dmeLDist.setColor(1,1,1);
nd.symbols.dmeL.setText("NM");
nd.symbols.dmeL.setColor(0,0.59,0.8);
#nd.symbols.dmeL.setColor(0,0.59,0.8);
}
},
is_false: func(nd){
@ -1651,20 +1652,21 @@ canvas.NDStyles["Airbus"] = {
impl: {
init: func(nd,symbol),
predicate: func(nd) (nd.get_switch("toggle_rh_vor_adf") != 0),
changed_only: 1,
is_true: func(nd) {
if(nd.get_switch("toggle_rh_vor_adf") < 0){
nd.symbols.vorR.setText("ADF 2");
nd.symbols.vorR.setColor(0.195,0.96,0.097);
nd.symbols.vorRId.setColor(0.195,0.96,0.097);
nd.symbols.dmeRDist.setColor(0.195,0.96,0.097);
#nd.symbols.dmeRDist.setColor(0.195,0.96,0.097);
nd.symbols.dmeR.setText("");
} else {
nd.symbols.vorR.setText("VOR 2");
nd.symbols.vorR.setColor(1,1,1);
nd.symbols.vorRId.setColor(1,1,1);
nd.symbols.dmeRDist.setColor(1,1,1);
#nd.symbols.dmeRDist.setColor(1,1,1);
nd.symbols.dmeR.setText("NM");
nd.symbols.dmeR.setColor(0,0.59,0.8);
#nd.symbols.dmeR.setColor(0,0.59,0.8);
}
},
is_false: func(nd){
@ -1720,9 +1722,11 @@ canvas.NDStyles["Airbus"] = {
id:"vorLSym",
impl: {
init: func(nd,symbol),
predicate: func(nd) (nd.get_switch("toggle_lh_vor_adf") != 0),
predicate: func(nd) (nd.get_switch("toggle_lh_vor_adf") != 0),
is_true: func(nd) {
nd.symbols.vorLSym.show();
if (nd.get_switch("toggle_lh_vor_adf") < 0) nd.symbols.vorLSym.setColor(0.195,0.96,0.097);
else nd.symbols.vorLSym.setColor(1,1,1);
nd.symbols.vorLSym.show();
},
is_false: func(nd){
nd.symbols.vorLSym.hide();
@ -1777,8 +1781,10 @@ canvas.NDStyles["Airbus"] = {
id:"vorRSym",
impl: {
init: func(nd,symbol),
predicate: func(nd) (nd.get_switch("toggle_rh_vor_adf") != 0),
predicate: func(nd) (nd.get_switch("toggle_rh_vor_adf") != 0),
is_true: func(nd) {
if (nd.get_switch("toggle_rh_vor_adf") < 0) nd.symbols.vorRSym.setColor(0.195,0.96,0.097);
else nd.symbols.vorRSym.setColor(1,1,1);
nd.symbols.vorRSym.show();
},
is_false: func(nd){