Improve MCDU Framework Logic, Working THR RED/ACC
This commit is contained in:
parent
70b1cef7cf
commit
a6c676b47c
4 changed files with 384 additions and 32 deletions
|
@ -574,10 +574,58 @@
|
|||
<alignment>left-center</alignment>
|
||||
<axis-alignment>yz-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">1500/1500</format>
|
||||
<format type="string">%s</format>
|
||||
<truncate type="bool">false</truncate>
|
||||
<font type="string">BoeingCDU-Large.ttf</font>
|
||||
<property>autopilot/serviceable</property>
|
||||
<property>/systems/thrust/clbreduc-ft</property>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
<draw-boundingbox type="bool">false</draw-boundingbox>
|
||||
<character-size>0.0040</character-size>
|
||||
<font-resolution>
|
||||
<width type="int">64</width>
|
||||
<height type="int">64</height>
|
||||
</font-resolution>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<name>thred</name>
|
||||
<offsets>
|
||||
<x-m>-0.001</x-m>
|
||||
<y-m>-0.0355</y-m>
|
||||
<z-m>0.030</z-m>
|
||||
</offsets>
|
||||
<alignment>left-center</alignment>
|
||||
<axis-alignment>yz-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">/%s</format>
|
||||
<truncate type="bool">false</truncate>
|
||||
<font type="string">BoeingCDU-Large.ttf</font>
|
||||
<property>/it-autoflight/settings/reduc-agl-ft</property>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
<draw-boundingbox type="bool">false</draw-boundingbox>
|
||||
<character-size>0.0040</character-size>
|
||||
<font-resolution>
|
||||
<width type="int">64</width>
|
||||
<height type="int">64</height>
|
||||
</font-resolution>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<name>thred2</name>
|
||||
<offsets>
|
||||
<x-m>-0.001</x-m>
|
||||
<y-m>-0.045</y-m>
|
||||
<z-m>0.030</z-m>
|
||||
</offsets>
|
||||
<alignment>left-center</alignment>
|
||||
<axis-alignment>yz-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">%s</format>
|
||||
<truncate type="bool">false</truncate>
|
||||
<font type="string">BoeingCDU-Large.ttf</font>
|
||||
<property>/systems/thrust/clbreduc-ft</property>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
<draw-boundingbox type="bool">false</draw-boundingbox>
|
||||
|
@ -588,6 +636,46 @@
|
|||
</font-resolution>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<name>thred2</name>
|
||||
<offsets>
|
||||
<x-m>-0.001</x-m>
|
||||
<y-m>-0.0335</y-m>
|
||||
<z-m>0.030</z-m>
|
||||
</offsets>
|
||||
<alignment>left-center</alignment>
|
||||
<axis-alignment>yz-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">/%s</format>
|
||||
<truncate type="bool">false</truncate>
|
||||
<font type="string">BoeingCDU-Large.ttf</font>
|
||||
<property>/it-autoflight/settings/reduc-agl-ft</property>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
<draw-boundingbox type="bool">false</draw-boundingbox>
|
||||
<character-size>0.0050</character-size>
|
||||
<font-resolution>
|
||||
<width type="int">64</width>
|
||||
<height type="int">64</height>
|
||||
</font-resolution>
|
||||
</text>
|
||||
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>thred</object-name>
|
||||
<condition>
|
||||
<not><property>/MCDUC/thracc-set</property></not>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>thred2</object-name>
|
||||
<condition>
|
||||
<property>/MCDUC/thracc-set</property>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<text>
|
||||
<name>flex2</name>
|
||||
<offsets>
|
||||
|
@ -842,6 +930,7 @@
|
|||
<object-name>trans2</object-name>
|
||||
<object-name>eoaccel</object-name>
|
||||
<object-name>thred</object-name>
|
||||
<object-name>thred2</object-name>
|
||||
<object-name>flex</object-name>
|
||||
<diffuse>
|
||||
<red>0</red>
|
||||
|
|
|
@ -574,10 +574,58 @@
|
|||
<alignment>left-center</alignment>
|
||||
<axis-alignment>yz-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">1500/1500</format>
|
||||
<format type="string">%s</format>
|
||||
<truncate type="bool">false</truncate>
|
||||
<font type="string">BoeingCDU-Large.ttf</font>
|
||||
<property>autopilot/serviceable</property>
|
||||
<property>/systems/thrust/clbreduc-ft</property>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
<draw-boundingbox type="bool">false</draw-boundingbox>
|
||||
<character-size>0.0040</character-size>
|
||||
<font-resolution>
|
||||
<width type="int">64</width>
|
||||
<height type="int">64</height>
|
||||
</font-resolution>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<name>thred</name>
|
||||
<offsets>
|
||||
<x-m>-0.001</x-m>
|
||||
<y-m>-0.0355</y-m>
|
||||
<z-m>0.030</z-m>
|
||||
</offsets>
|
||||
<alignment>left-center</alignment>
|
||||
<axis-alignment>yz-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">/%s</format>
|
||||
<truncate type="bool">false</truncate>
|
||||
<font type="string">BoeingCDU-Large.ttf</font>
|
||||
<property>/it-autoflight/settings/reduc-agl-ft</property>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
<draw-boundingbox type="bool">false</draw-boundingbox>
|
||||
<character-size>0.0040</character-size>
|
||||
<font-resolution>
|
||||
<width type="int">64</width>
|
||||
<height type="int">64</height>
|
||||
</font-resolution>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<name>thred2</name>
|
||||
<offsets>
|
||||
<x-m>-0.001</x-m>
|
||||
<y-m>-0.045</y-m>
|
||||
<z-m>0.030</z-m>
|
||||
</offsets>
|
||||
<alignment>left-center</alignment>
|
||||
<axis-alignment>yz-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">%s</format>
|
||||
<truncate type="bool">false</truncate>
|
||||
<font type="string">BoeingCDU-Large.ttf</font>
|
||||
<property>/systems/thrust/clbreduc-ft</property>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
<draw-boundingbox type="bool">false</draw-boundingbox>
|
||||
|
@ -588,6 +636,46 @@
|
|||
</font-resolution>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<name>thred2</name>
|
||||
<offsets>
|
||||
<x-m>-0.001</x-m>
|
||||
<y-m>-0.0335</y-m>
|
||||
<z-m>0.030</z-m>
|
||||
</offsets>
|
||||
<alignment>left-center</alignment>
|
||||
<axis-alignment>yz-plane</axis-alignment>
|
||||
<type type="string">text-value</type>
|
||||
<format type="string">/%s</format>
|
||||
<truncate type="bool">false</truncate>
|
||||
<font type="string">BoeingCDU-Large.ttf</font>
|
||||
<property>/it-autoflight/settings/reduc-agl-ft</property>
|
||||
<draw-text type="bool">true</draw-text>
|
||||
<draw-alignment type="bool">false</draw-alignment>
|
||||
<draw-boundingbox type="bool">false</draw-boundingbox>
|
||||
<character-size>0.0050</character-size>
|
||||
<font-resolution>
|
||||
<width type="int">64</width>
|
||||
<height type="int">64</height>
|
||||
</font-resolution>
|
||||
</text>
|
||||
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>thred</object-name>
|
||||
<condition>
|
||||
<not><property>/MCDUC/thracc-set</property></not>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>thred2</object-name>
|
||||
<condition>
|
||||
<property>/MCDUC/thracc-set</property>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<text>
|
||||
<name>flex2</name>
|
||||
<offsets>
|
||||
|
@ -842,6 +930,7 @@
|
|||
<object-name>trans2</object-name>
|
||||
<object-name>eoaccel</object-name>
|
||||
<object-name>thred</object-name>
|
||||
<object-name>thred2</object-name>
|
||||
<object-name>flex</object-name>
|
||||
<diffuse>
|
||||
<red>0</red>
|
||||
|
|
107
Nasal/MCDU1.nas
107
Nasal/MCDU1.nas
|
@ -12,6 +12,7 @@ var MCDU_reset = func {
|
|||
setprop("/MCDU[0]/scratchpad", "");
|
||||
setprop("/MCDUC/flight-num", "");
|
||||
setprop("/MCDUC/flight-num-set", 0);
|
||||
setprop("/MCDUC/thracc-set", 0);
|
||||
setprop("/FMGC/internal/dep-arpt", "");
|
||||
setprop("/FMGC/internal/arr-arpt", "");
|
||||
setprop("/FMGC/internal/tofrom-set", 0);
|
||||
|
@ -38,6 +39,8 @@ var lskbutton = func(btn) {
|
|||
} else if (btn == "5") {
|
||||
if (getprop("/MCDU[0]/page") == "INITA") {
|
||||
initInputA("L5");
|
||||
} else if (getprop("/MCDU[0]/page") == "TO") {
|
||||
PerfTOInput("L5");
|
||||
} else if (getprop("/MCDU[0]/page") == "CLB") {
|
||||
perfCLBInput("L5");
|
||||
}
|
||||
|
@ -86,6 +89,7 @@ var initInputA = func(key) {
|
|||
setprop("/MCDUC/flight-num-set", 1);
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -105,9 +109,11 @@ var initInputA = func(key) {
|
|||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -129,9 +135,11 @@ var initInputA = func(key) {
|
|||
setprop("/FMGC/internal/cruise-lvl-set", 1);
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -146,12 +154,21 @@ var initInputA = func(key) {
|
|||
var tfs = size(scratchpad);
|
||||
if (tfs == 9) {
|
||||
var fromto = split("/", scratchpad);
|
||||
var froms = size(fromto[0]);
|
||||
var tos = size(fromto[1]);
|
||||
if (froms == 4 and tos == 4) {
|
||||
setprop("/FMGC/internal/dep-arpt", fromto[0]);
|
||||
setprop("/FMGC/internal/arr-arpt", fromto[1]);
|
||||
setprop("/FMGC/internal/tofrom-set", 1);
|
||||
fmgc.updateARPT();
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "GPS PRIMARY");
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -162,6 +179,39 @@ var initInputA = func(key) {
|
|||
}
|
||||
}
|
||||
|
||||
var PerfTOInput = func(key) {
|
||||
var scratchpad = getprop("/MCDU[0]/scratchpad");
|
||||
if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", "3000");
|
||||
setprop("/MCDUC/thracc-set", 0);
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 9) {
|
||||
var thracc = split("/", scratchpad);
|
||||
var thrred = size(thracc[0]);
|
||||
var acc = size(thracc[1]);
|
||||
if ((thrred >= 1 and thrred <= 4) and (acc >= 1 and acc <= 4)) {
|
||||
setprop("/systems/thrust/clbreduc-ft", thracc[0]);
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", thracc[1]);
|
||||
setprop("/MCDUC/thracc-set", 1);
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("/MCDU[0]/page", "CLB");
|
||||
}
|
||||
}
|
||||
|
||||
var perfCLBInput = func(key) {
|
||||
var scratchpad = getprop("/MCDU[0]/scratchpad");
|
||||
if (key == "L5") {
|
||||
|
@ -180,9 +230,11 @@ var perfCLBInput = func(key) {
|
|||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -193,12 +245,6 @@ var perfCLBInput = func(key) {
|
|||
}
|
||||
}
|
||||
|
||||
var PerfTOInput = func(key) {
|
||||
if (key == "R6") {
|
||||
setprop("/MCDU[0]/page", "CLB");
|
||||
}
|
||||
}
|
||||
|
||||
var perfCRZInput = func(key) {
|
||||
if (key == "L6") {
|
||||
setprop("/MCDU[0]/page", "CLB");
|
||||
|
@ -254,95 +300,136 @@ var button = func(btn) {
|
|||
var scratchpad = getprop("/MCDU[0]/scratchpad");
|
||||
if (btn == "A") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "A");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "B") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "B");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "C") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "C");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "D") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "D");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "E") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "E");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "F") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "F");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "G") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "G");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "H") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "H");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "I") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "I");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "J") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "J");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "K") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "K");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "L") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "L");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "M") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "M");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "N") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "N");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "O") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "O");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "P") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "P");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "Q") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "Q");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "R") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "R");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "S") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "S");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "T") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "T");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "U") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "U");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "V") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "V");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "W") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "W");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "X") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "X");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "Y") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "Y");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "Z") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "Z");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "SLASH") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "/");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "SP") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ " ");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "CLR") {
|
||||
var scratchpad = getprop("/MCDU[0]/scratchpad");
|
||||
if (size(scratchpad) == 0) {
|
||||
setprop("/MCDU[0]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[0]/scratchpad", "CLR");
|
||||
} else if (scratchpad == "CLR") {
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
} else if (scratchpad == "NOT ALLOWED") {
|
||||
} else if (getprop("/MCDU[0]/scratchpad-msg") == 1) {
|
||||
setprop("/MCDU[0]/scratchpad", "");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (size(scratchpad) > 0) {
|
||||
setprop("/MCDU[0]/scratchpad", left(scratchpad, size(scratchpad)-1));
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
}
|
||||
} else if (btn == "0") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "0");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "1") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "1");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "2") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "2");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "3") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "3");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "4") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "4");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "5") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "5");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "6") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "6");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "7") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "7");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "8") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "8");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "9") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "9");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "DOT") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ ".");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
} else if (btn == "PLUSMINUS") {
|
||||
setprop("/MCDU[0]/scratchpad", scratchpad ~ "-");
|
||||
setprop("/MCDU[0]/scratchpad-msg", "0");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
107
Nasal/MCDU2.nas
107
Nasal/MCDU2.nas
|
@ -12,6 +12,7 @@ var MCDU_reset = func {
|
|||
setprop("/MCDU[1]/scratchpad", "");
|
||||
setprop("/MCDUC/flight-num", "");
|
||||
setprop("/MCDUC/flight-num-set", 0);
|
||||
setprop("/MCDUC/thracc-set", 0);
|
||||
setprop("/FMGC/internal/dep-arpt", "");
|
||||
setprop("/FMGC/internal/arr-arpt", "");
|
||||
setprop("/FMGC/internal/tofrom-set", 0);
|
||||
|
@ -38,6 +39,8 @@ var lskbutton = func(btn) {
|
|||
} else if (btn == "5") {
|
||||
if (getprop("/MCDU[1]/page") == "INITA") {
|
||||
initInputA("L5");
|
||||
} else if (getprop("/MCDU[1]/page") == "TO") {
|
||||
PerfTOInput("L5");
|
||||
} else if (getprop("/MCDU[1]/page") == "CLB") {
|
||||
perfCLBInput("L5");
|
||||
}
|
||||
|
@ -86,6 +89,7 @@ var initInputA = func(key) {
|
|||
setprop("/MCDUC/flight-num-set", 1);
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -105,9 +109,11 @@ var initInputA = func(key) {
|
|||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -129,9 +135,11 @@ var initInputA = func(key) {
|
|||
setprop("/FMGC/internal/cruise-lvl-set", 1);
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -146,12 +154,21 @@ var initInputA = func(key) {
|
|||
var tfs = size(scratchpad);
|
||||
if (tfs == 9) {
|
||||
var fromto = split("/", scratchpad);
|
||||
var froms = size(fromto[0]);
|
||||
var tos = size(fromto[1]);
|
||||
if (froms == 4 and tos == 4) {
|
||||
setprop("/FMGC/internal/dep-arpt", fromto[0]);
|
||||
setprop("/FMGC/internal/arr-arpt", fromto[1]);
|
||||
setprop("/FMGC/internal/tofrom-set", 1);
|
||||
fmgc.updateARPT();
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "GPS PRIMARY");
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -162,6 +179,39 @@ var initInputA = func(key) {
|
|||
}
|
||||
}
|
||||
|
||||
var PerfTOInput = func(key) {
|
||||
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
||||
if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", "3000");
|
||||
setprop("/MCDUC/thracc-set", 0);
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 9) {
|
||||
var thracc = split("/", scratchpad);
|
||||
var thrred = size(thracc[0]);
|
||||
var acc = size(thracc[1]);
|
||||
if ((thrred >= 1 and thrred <= 4) and (acc >= 1 and acc <= 4)) {
|
||||
setprop("/systems/thrust/clbreduc-ft", thracc[0]);
|
||||
setprop("/it-autoflight/settings/reduc-agl-ft", thracc[1]);
|
||||
setprop("/MCDUC/thracc-set", 1);
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("/MCDU[1]/page", "CLB");
|
||||
}
|
||||
}
|
||||
|
||||
var perfCLBInput = func(key) {
|
||||
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
||||
if (key == "L5") {
|
||||
|
@ -180,9 +230,11 @@ var perfCLBInput = func(key) {
|
|||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
@ -193,12 +245,6 @@ var perfCLBInput = func(key) {
|
|||
}
|
||||
}
|
||||
|
||||
var PerfTOInput = func(key) {
|
||||
if (key == "R6") {
|
||||
setprop("/MCDU[1]/page", "CLB");
|
||||
}
|
||||
}
|
||||
|
||||
var perfCRZInput = func(key) {
|
||||
if (key == "L6") {
|
||||
setprop("/MCDU[1]/page", "CLB");
|
||||
|
@ -254,95 +300,136 @@ var button = func(btn) {
|
|||
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
||||
if (btn == "A") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "A");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "B") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "B");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "C") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "C");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "D") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "D");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "E") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "E");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "F") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "F");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "G") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "G");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "H") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "H");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "I") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "I");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "J") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "J");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "K") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "K");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "L") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "L");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "M") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "M");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "N") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "N");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "O") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "O");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "P") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "P");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "Q") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "Q");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "R") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "R");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "S") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "S");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "T") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "T");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "U") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "U");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "V") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "V");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "W") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "W");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "X") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "X");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "Y") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "Y");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "Z") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "Z");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "SLASH") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "/");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "SP") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ " ");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "CLR") {
|
||||
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
||||
if (size(scratchpad) == 0) {
|
||||
setprop("/MCDU[1]/scratchpad-msg", "1");
|
||||
setprop("/MCDU[1]/scratchpad", "CLR");
|
||||
} else if (scratchpad == "CLR") {
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
} else if (scratchpad == "NOT ALLOWED") {
|
||||
} else if (getprop("/MCDU[1]/scratchpad-msg") == 1) {
|
||||
setprop("/MCDU[1]/scratchpad", "");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (size(scratchpad) > 0) {
|
||||
setprop("/MCDU[1]/scratchpad", left(scratchpad, size(scratchpad)-1));
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
}
|
||||
} else if (btn == "0") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "0");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "1") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "1");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "2") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "2");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "3") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "3");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "4") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "4");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "5") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "5");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "6") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "6");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "7") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "7");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "8") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "8");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "9") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "9");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "DOT") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ ".");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
} else if (btn == "PLUSMINUS") {
|
||||
setprop("/MCDU[1]/scratchpad", scratchpad ~ "-");
|
||||
setprop("/MCDU[1]/scratchpad-msg", "0");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue