Merge branch 'master' into dev

This commit is contained in:
Joshua Davidson 2018-10-30 19:30:06 -04:00
commit 2420df185f
3 changed files with 147 additions and 159 deletions

View file

@ -2755,7 +2755,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.mode_inc();</script> <script>libraries.setCptND(1);</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -2764,7 +2764,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.mode_dec();</script> <script>libraries.setCptND(-1);</script>
</binding> </binding>
</action> </action>
</animation> </animation>
@ -2793,7 +2793,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.mode2_inc();</script> <script>libraries.setFoND(1);</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -2802,7 +2802,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.mode2_dec();</script> <script>libraries.setFoND(-1);</script>
</binding> </binding>
</action> </action>
</animation> </animation>
@ -2831,7 +2831,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.ctl_func("range",1);</script> <script>libraries.setNDRange(0, 1);</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -2840,7 +2840,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.ctl_func("range",-1);</script> <script>libraries.setNDRange(0, -1);</script>
</binding> </binding>
</action> </action>
</animation> </animation>
@ -2849,10 +2849,10 @@
<object-name>nd_range</object-name> <object-name>nd_range</object-name>
<property>instrumentation/efis/inputs/range-nm</property> <property>instrumentation/efis/inputs/range-nm</property>
<interpolation> <interpolation>
<entry><ind>10</ind><dep>0</dep></entry> <entry><ind> 10</ind><dep> 0</dep></entry>
<entry><ind>20</ind><dep>45</dep></entry> <entry><ind> 20</ind><dep> 45</dep></entry>
<entry><ind>40</ind><dep>90</dep></entry> <entry><ind> 40</ind><dep> 90</dep></entry>
<entry><ind>80</ind><dep>135</dep></entry> <entry><ind> 80</ind><dep>135</dep></entry>
<entry><ind>160</ind><dep>180</dep></entry> <entry><ind>160</ind><dep>180</dep></entry>
<entry><ind>320</ind><dep>225</dep></entry> <entry><ind>320</ind><dep>225</dep></entry>
</interpolation> </interpolation>
@ -2870,7 +2870,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.ctl2_func("range",1);</script> <script>libraries.setNDRange(1, 1);</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -2879,7 +2879,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.ctl2_func("range",-1);</script> <script>libraries.setNDRange(1, -1);</script>
</binding> </binding>
</action> </action>
</animation> </animation>
@ -2888,10 +2888,10 @@
<object-name>nd_range_fo</object-name> <object-name>nd_range_fo</object-name>
<property>instrumentation/efis[1]/inputs/range-nm</property> <property>instrumentation/efis[1]/inputs/range-nm</property>
<interpolation> <interpolation>
<entry><ind>10</ind><dep>0</dep></entry> <entry><ind> 10</ind><dep> 0</dep></entry>
<entry><ind>20</ind><dep>45</dep></entry> <entry><ind> 20</ind><dep> 45</dep></entry>
<entry><ind>40</ind><dep>90</dep></entry> <entry><ind> 40</ind><dep> 90</dep></entry>
<entry><ind>80</ind><dep>135</dep></entry> <entry><ind> 80</ind><dep>135</dep></entry>
<entry><ind>160</ind><dep>180</dep></entry> <entry><ind>160</ind><dep>180</dep></entry>
<entry><ind>320</ind><dep>225</dep></entry> <entry><ind>320</ind><dep>225</dep></entry>
</interpolation> </interpolation>

View file

@ -5,167 +5,155 @@
############################################## ##############################################
setlistener("sim/signals/fdm-initialized", func { setlistener("sim/signals/fdm-initialized", func {
setprop("/instrumentation/efis/nd/display-mode", "NAV"); setprop("/instrumentation/efis[0]/nd/display-mode", "NAV");
setprop("/instrumentation/efis/mfd/pnl_mode-num", 2); setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2);
setprop("/instrumentation/efis/inputs/range-nm", 20); setprop("/instrumentation/efis[0]/inputs/range-nm", 20);
setprop("/instrumentation/efis/inputs/tfc", 0); setprop("/instrumentation/efis[0]/inputs/tfc", 0);
setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
setprop("/instrumentation/efis[0]/inputs/wpt", 0);
setprop("/instrumentation/efis[0]/inputs/VORD", 0);
setprop("/instrumentation/efis[0]/inputs/DME", 0);
setprop("/instrumentation/efis[0]/inputs/NDB", 0);
setprop("/instrumentation/efis[0]/inputs/arpt", 0);
setprop("/instrumentation/efis[1]/nd/display-mode", "NAV"); setprop("/instrumentation/efis[1]/nd/display-mode", "NAV");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2); setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2);
setprop("/instrumentation/efis[1]/inputs/range-nm", 20); setprop("/instrumentation/efis[1]/inputs/range-nm", 20);
setprop("/instrumentation/efis[1]/inputs/tfc", 0); setprop("/instrumentation/efis[1]/inputs/tfc", 0);
setprop("/instrumentation/efis[1]/inputs/CSTR", 0);
setprop("/instrumentation/efis[1]/inputs/wpt", 0);
setprop("/instrumentation/efis[1]/inputs/VORD", 0);
setprop("/instrumentation/efis[1]/inputs/DME", 0);
setprop("/instrumentation/efis[1]/inputs/NDB", 0);
setprop("/instrumentation/efis[1]/inputs/arpt", 0);
}); });
# Captain var setCptND = func(d) {
var mode = getprop("/instrumentation/efis[0]/nd/display-mode");
var ctl_func = func(md,val) {
if(md == "range") { if (d == 1) {
var rng = getprop("/instrumentation/efis/inputs/range-nm"); if (mode == "ILS") {
if(val ==1){ setprop("/instrumentation/efis[0]/nd/display-mode", "VOR");
rng = rng * 2; setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 1);
if(rng > 320) rng = 320; } else if (mode == "VOR") {
} else if(val = -1){ setprop("/instrumentation/efis[0]/nd/display-mode", "NAV");
rng = rng / 2; setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2);
if(rng < 10) rng = 10; } else if (mode == "NAV") {
} setprop("/instrumentation/efis[0]/nd/display-mode", "ARC");
setprop("/instrumentation/efis/inputs/range-nm", rng); setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 3);
} } else if (mode == "ARC") {
} setprop("/instrumentation/efis[0]/nd/display-mode", "PLAN");
setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 4);
var mode_inc = func { }
var mode = getprop("/instrumentation/efis/nd/display-mode"); } else if (d == -1) {
if (mode == "ILS") { if (mode == "PLAN") {
setprop("/instrumentation/efis/nd/display-mode", "VOR"); setprop("/instrumentation/efis[0]/nd/display-mode", "ARC");
setprop("/instrumentation/efis/mfd/pnl_mode-num", 1); setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 3);
} else if (mode == "VOR") { } else if (mode == "ARC") {
setprop("/instrumentation/efis/nd/display-mode", "NAV"); setprop("/instrumentation/efis[0]/nd/display-mode", "NAV");
setprop("/instrumentation/efis/mfd/pnl_mode-num", 2); setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2);
} else if (mode == "NAV") { } else if (mode == "NAV") {
setprop("/instrumentation/efis/nd/display-mode", "ARC"); setprop("/instrumentation/efis[0]/nd/display-mode", "VOR");
setprop("/instrumentation/efis/mfd/pnl_mode-num", 3); setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 1);
} else if (mode == "ARC") { } else if (mode == "VOR") {
setprop("/instrumentation/efis/nd/display-mode", "PLAN"); setprop("/instrumentation/efis[0]/nd/display-mode", "ILS");
setprop("/instrumentation/efis/mfd/pnl_mode-num", 4); setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 0);
} else { }
return 0;
} }
} }
var mode_dec = func { var setFoND = func(d) {
var mode = getprop("/instrumentation/efis/nd/display-mode"); var mode = getprop("/instrumentation/efis[1]/nd/display-mode");
if (mode == "PLAN") {
setprop("/instrumentation/efis/nd/display-mode", "ARC"); if (d == 1) {
setprop("/instrumentation/efis/mfd/pnl_mode-num", 3); if (mode == "ILS") {
} else if (mode == "ARC") { setprop("/instrumentation/efis[1]/nd/display-mode", "VOR");
setprop("/instrumentation/efis/nd/display-mode", "NAV"); setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1);
setprop("/instrumentation/efis/mfd/pnl_mode-num", 2); } else if (mode == "VOR") {
} else if (mode == "NAV") { setprop("/instrumentation/efis[1]/nd/display-mode", "NAV");
setprop("/instrumentation/efis/nd/display-mode", "VOR"); setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2);
setprop("/instrumentation/efis/mfd/pnl_mode-num", 1); } else if (mode == "NAV") {
} else if (mode == "VOR") { setprop("/instrumentation/efis[1]/nd/display-mode", "ARC");
setprop("/instrumentation/efis/nd/display-mode", "ILS"); setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3);
setprop("/instrumentation/efis/mfd/pnl_mode-num", 0); } else if (mode == "ARC") {
} else { setprop("/instrumentation/efis[1]/nd/display-mode", "PLAN");
return 0; setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 4);
}
} else if (d == -1) {
if (mode == "PLAN") {
setprop("/instrumentation/efis[1]/nd/display-mode", "ARC");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3);
} else if (mode == "ARC") {
setprop("/instrumentation/efis[1]/nd/display-mode", "NAV");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2);
} else if (mode == "NAV") {
setprop("/instrumentation/efis[1]/nd/display-mode", "VOR");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1);
} else if (mode == "VOR") {
setprop("/instrumentation/efis[1]/nd/display-mode", "ILS");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 0);
}
} }
} }
var setNDRange = func(n, d) {
var rng = getprop("/instrumentation/efis[" ~ n ~ "]/inputs/range-nm");
if (d == 1) {
rng = rng * 2;
if (rng > 320) {
rng = 320;
}
} else if (d == -1){
rng = rng / 2;
if (rng < 10) {
rng = 10;
}
}
setprop("/instrumentation/efis[" ~ n ~ "]/inputs/range-nm", rng);
}
var cpt_efis_btns = func(i) { var cpt_efis_btns = func(i) {
if (i == "cstr") { if (i == "cstr") {
setprop("/instrumentation/efis/inputs/CSTR", 1); setprop("/instrumentation/efis[0]/inputs/CSTR", 1);
setprop("/instrumentation/efis/inputs/wpt", 0); setprop("/instrumentation/efis[0]/inputs/wpt", 0);
setprop("/instrumentation/efis/inputs/VORD", 0); setprop("/instrumentation/efis[0]/inputs/VORD", 0);
setprop("/instrumentation/efis/inputs/DME", 0); setprop("/instrumentation/efis[0]/inputs/DME", 0);
setprop("/instrumentation/efis/inputs/NDB", 0); setprop("/instrumentation/efis[0]/inputs/NDB", 0);
setprop("/instrumentation/efis/inputs/arpt", 0); setprop("/instrumentation/efis[0]/inputs/arpt", 0);
} else if (i == "wpt") { } else if (i == "wpt") {
setprop("/instrumentation/efis/inputs/CSTR", 0); setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
setprop("/instrumentation/efis/inputs/wpt", 1); setprop("/instrumentation/efis[0]/inputs/wpt", 1);
setprop("/instrumentation/efis/inputs/VORD", 0); setprop("/instrumentation/efis[0]/inputs/VORD", 0);
setprop("/instrumentation/efis/inputs/DME", 0); setprop("/instrumentation/efis[0]/inputs/DME", 0);
setprop("/instrumentation/efis/inputs/NDB", 0); setprop("/instrumentation/efis[0]/inputs/NDB", 0);
setprop("/instrumentation/efis/inputs/arpt", 0); setprop("/instrumentation/efis[0]/inputs/arpt", 0);
} else if (i == "vord") { } else if (i == "vord") {
setprop("/instrumentation/efis/inputs/CSTR", 0); setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
setprop("/instrumentation/efis/inputs/wpt", 0); setprop("/instrumentation/efis[0]/inputs/wpt", 0);
setprop("/instrumentation/efis/inputs/VORD", 1); setprop("/instrumentation/efis[0]/inputs/VORD", 1);
setprop("/instrumentation/efis/inputs/DME", 1); setprop("/instrumentation/efis[0]/inputs/DME", 1);
setprop("/instrumentation/efis/inputs/NDB", 0); setprop("/instrumentation/efis[0]/inputs/NDB", 0);
setprop("/instrumentation/efis/inputs/arpt", 0); setprop("/instrumentation/efis[0]/inputs/arpt", 0);
} else if (i == "ndb") { } else if (i == "ndb") {
setprop("/instrumentation/efis/inputs/CSTR", 0); setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
setprop("/instrumentation/efis/inputs/wpt", 0); setprop("/instrumentation/efis[0]/inputs/wpt", 0);
setprop("/instrumentation/efis/inputs/VORD", 0); setprop("/instrumentation/efis[0]/inputs/VORD", 0);
setprop("/instrumentation/efis/inputs/DME", 0); setprop("/instrumentation/efis[0]/inputs/DME", 0);
setprop("/instrumentation/efis/inputs/NDB", 1); setprop("/instrumentation/efis[0]/inputs/NDB", 1);
setprop("/instrumentation/efis/inputs/arpt", 0); setprop("/instrumentation/efis[0]/inputs/arpt", 0);
} else if (i == "arpt") { } else if (i == "arpt") {
setprop("/instrumentation/efis/inputs/CSTR", 0); setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
setprop("/instrumentation/efis/inputs/wpt", 0); setprop("/instrumentation/efis[0]/inputs/wpt", 0);
setprop("/instrumentation/efis/inputs/VORD", 0); setprop("/instrumentation/efis[0]/inputs/VORD", 0);
setprop("/instrumentation/efis/inputs/DME", 0); setprop("/instrumentation/efis[0]/inputs/DME", 0);
setprop("/instrumentation/efis/inputs/NDB", 0); setprop("/instrumentation/efis[0]/inputs/NDB", 0);
setprop("/instrumentation/efis/inputs/arpt", 1); setprop("/instrumentation/efis[0]/inputs/arpt", 1);
} else if (i == "off") { } else if (i == "off") {
setprop("/instrumentation/efis/inputs/CSTR", 0); setprop("/instrumentation/efis[0]/inputs/CSTR", 0);
setprop("/instrumentation/efis/inputs/wpt", 0); setprop("/instrumentation/efis[0]/inputs/wpt", 0);
setprop("/instrumentation/efis/inputs/VORD", 0); setprop("/instrumentation/efis[0]/inputs/VORD", 0);
setprop("/instrumentation/efis/inputs/DME", 0); setprop("/instrumentation/efis[0]/inputs/DME", 0);
setprop("/instrumentation/efis/inputs/NDB", 0); setprop("/instrumentation/efis[0]/inputs/NDB", 0);
setprop("/instrumentation/efis/inputs/arpt", 0); setprop("/instrumentation/efis[0]/inputs/arpt", 0);
}
}
# First Officer
var ctl2_func = func(md,val) {
if(md == "range") {
var rng = getprop("/instrumentation/efis[1]/inputs/range-nm");
if(val ==1){
rng = rng * 2;
if(rng > 320) rng = 320;
} else if(val = -1){
rng = rng / 2;
if(rng < 10) rng = 10;
}
setprop("/instrumentation/efis[1]/inputs/range-nm", rng);
}
}
var mode2_inc = func {
var mode = getprop("/instrumentation/efis[1]/nd/display-mode");
if (mode == "ILS") {
setprop("/instrumentation/efis[1]/nd/display-mode", "VOR");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1);
} else if (mode == "VOR") {
setprop("/instrumentation/efis[1]/nd/display-mode", "NAV");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2);
} else if (mode == "NAV") {
setprop("/instrumentation/efis[1]/nd/display-mode", "ARC");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3);
} else if (mode == "ARC") {
setprop("/instrumentation/efis[1]/nd/display-mode", "PLAN");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 4);
} else {
return 0;
}
}
var mode2_dec = func {
var mode = getprop("/instrumentation/efis[1]/nd/display-mode");
if (mode == "PLAN") {
setprop("/instrumentation/efis[1]/nd/display-mode", "ARC");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3);
} else if (mode == "ARC") {
setprop("/instrumentation/efis[1]/nd/display-mode", "NAV");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2);
} else if (mode == "NAV") {
setprop("/instrumentation/efis[1]/nd/display-mode", "VOR");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1);
} else if (mode == "VOR") {
setprop("/instrumentation/efis[1]/nd/display-mode", "ILS");
setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 0);
} else {
return 0;
} }
} }

View file

@ -1 +1 @@
4689 4690