diff --git a/Models/Instruments/MCDU1/MCDU1.xml b/Models/Instruments/MCDU1/MCDU1.xml
index 4e9b6397..14967b73 100644
--- a/Models/Instruments/MCDU1/MCDU1.xml
+++ b/Models/Instruments/MCDU1/MCDU1.xml
@@ -18,7 +18,7 @@
false
nasal
-
+
@@ -30,7 +30,7 @@
false
nasal
-
+
@@ -42,7 +42,7 @@
false
nasal
-
+
@@ -54,7 +54,7 @@
false
nasal
-
+
@@ -66,7 +66,7 @@
false
nasal
-
+
@@ -78,7 +78,7 @@
false
nasal
-
+
@@ -90,7 +90,7 @@
false
nasal
-
+
@@ -102,7 +102,7 @@
false
nasal
-
+
@@ -114,7 +114,7 @@
false
nasal
-
+
@@ -126,7 +126,7 @@
false
nasal
-
+
@@ -138,7 +138,7 @@
false
nasal
-
+
@@ -150,7 +150,7 @@
false
nasal
-
+
@@ -162,7 +162,7 @@
false
nasal
-
+
@@ -174,7 +174,7 @@
false
nasal
-
+
@@ -186,7 +186,7 @@
false
nasal
-
+
@@ -198,7 +198,7 @@
false
nasal
-
+
@@ -210,7 +210,7 @@
false
nasal
-
+
@@ -222,7 +222,7 @@
false
nasal
-
+
@@ -234,7 +234,7 @@
false
nasal
-
+
@@ -246,7 +246,7 @@
false
nasal
-
+
@@ -258,7 +258,7 @@
false
nasal
-
+
@@ -270,7 +270,7 @@
false
nasal
-
+
@@ -282,7 +282,7 @@
false
nasal
-
+
@@ -294,7 +294,7 @@
false
nasal
-
+
@@ -306,7 +306,7 @@
false
nasal
-
+
@@ -318,7 +318,7 @@
false
nasal
-
+
@@ -330,7 +330,7 @@
false
nasal
-
+
@@ -342,11 +342,11 @@
false
nasal
-
+
-
+
pick
clr
@@ -366,7 +366,7 @@
false
nasal
-
+
@@ -378,7 +378,7 @@
false
nasal
-
+
@@ -390,7 +390,7 @@
false
nasal
-
+
@@ -402,7 +402,7 @@
false
nasal
-
+
@@ -414,7 +414,7 @@
false
nasal
-
+
@@ -426,7 +426,7 @@
false
nasal
-
+
@@ -438,7 +438,7 @@
false
nasal
-
+
@@ -450,7 +450,7 @@
false
nasal
-
+
@@ -462,7 +462,7 @@
false
nasal
-
+
@@ -474,7 +474,7 @@
false
nasal
-
+
@@ -486,7 +486,7 @@
false
nasal
-
+
@@ -498,11 +498,11 @@
false
nasal
-
+
-
+
diff --git a/Models/Instruments/MCDU2/MCDU2.xml b/Models/Instruments/MCDU2/MCDU2.xml
index 9ba2b592..050e5ed4 100644
--- a/Models/Instruments/MCDU2/MCDU2.xml
+++ b/Models/Instruments/MCDU2/MCDU2.xml
@@ -18,7 +18,7 @@
false
nasal
-
+
@@ -30,7 +30,7 @@
false
nasal
-
+
@@ -42,7 +42,7 @@
false
nasal
-
+
@@ -54,7 +54,7 @@
false
nasal
-
+
@@ -66,7 +66,7 @@
false
nasal
-
+
@@ -78,7 +78,7 @@
false
nasal
-
+
@@ -90,7 +90,7 @@
false
nasal
-
+
@@ -102,7 +102,7 @@
false
nasal
-
+
@@ -114,7 +114,7 @@
false
nasal
-
+
@@ -126,7 +126,7 @@
false
nasal
-
+
@@ -138,7 +138,7 @@
false
nasal
-
+
@@ -150,7 +150,7 @@
false
nasal
-
+
@@ -162,7 +162,7 @@
false
nasal
-
+
@@ -174,7 +174,7 @@
false
nasal
-
+
@@ -186,7 +186,7 @@
false
nasal
-
+
@@ -198,7 +198,7 @@
false
nasal
-
+
@@ -210,7 +210,7 @@
false
nasal
-
+
@@ -222,7 +222,7 @@
false
nasal
-
+
@@ -234,7 +234,7 @@
false
nasal
-
+
@@ -246,7 +246,7 @@
false
nasal
-
+
@@ -258,7 +258,7 @@
false
nasal
-
+
@@ -270,7 +270,7 @@
false
nasal
-
+
@@ -282,7 +282,7 @@
false
nasal
-
+
@@ -294,7 +294,7 @@
false
nasal
-
+
@@ -306,7 +306,7 @@
false
nasal
-
+
@@ -318,7 +318,7 @@
false
nasal
-
+
@@ -330,7 +330,7 @@
false
nasal
-
+
@@ -342,11 +342,11 @@
false
nasal
-
+
-
+
pick
clr
@@ -366,7 +366,7 @@
false
nasal
-
+
@@ -378,7 +378,7 @@
false
nasal
-
+
@@ -390,7 +390,7 @@
false
nasal
-
+
@@ -402,7 +402,7 @@
false
nasal
-
+
@@ -414,7 +414,7 @@
false
nasal
-
+
@@ -426,7 +426,7 @@
false
nasal
-
+
@@ -438,7 +438,7 @@
false
nasal
-
+
@@ -450,7 +450,7 @@
false
nasal
-
+
@@ -462,7 +462,7 @@
false
nasal
-
+
@@ -474,7 +474,7 @@
false
nasal
-
+
@@ -486,7 +486,7 @@
false
nasal
-
+
@@ -498,11 +498,11 @@
false
nasal
-
+
-
+
diff --git a/Nasal/MCDU1.nas b/Nasal/MCDU1.nas
index 4311a306..0be6f30d 100644
--- a/Nasal/MCDU1.nas
+++ b/Nasal/MCDU1.nas
@@ -9,4 +9,90 @@ var MCDU_init = func {
var MCDU_reset = func {
setprop("/MCDU[0]/page", "INIT");
+ setprop("/MCDU[0]/scratchpad", " ");
+}
+
+var button = func(btn) {
+ var scratchpad = getprop("/MCDU[0]/scratchpad");
+ if (btn == "A") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "A");
+ } else if (btn == "B") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "B");
+ } else if (btn == "C") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "C");
+ } else if (btn == "D") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "D");
+ } else if (btn == "E") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "E");
+ } else if (btn == "F") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "F");
+ } else if (btn == "G") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "G");
+ } else if (btn == "H") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "H");
+ } else if (btn == "I") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "I");
+ } else if (btn == "J") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "J");
+ } else if (btn == "K") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "K");
+ } else if (btn == "L") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "L");
+ } else if (btn == "M") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "M");
+ } else if (btn == "N") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "N");
+ } else if (btn == "O") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "O");
+ } else if (btn == "P") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "P");
+ } else if (btn == "Q") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "Q");
+ } else if (btn == "R") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "R");
+ } else if (btn == "S") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "S");
+ } else if (btn == "T") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "T");
+ } else if (btn == "U") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "U");
+ } else if (btn == "V") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "V");
+ } else if (btn == "W") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "W");
+ } else if (btn == "X") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "X");
+ } else if (btn == "Y") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "Y");
+ } else if (btn == "Z") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "Z");
+ } else if (btn == "SLASH") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "/");
+ } else if (btn == "SP") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ " ");
+ } else if (btn == "CLR") {
+ setprop("/MCDU[0]/scratchpad", " ");
+ } else if (btn == "0") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "0");
+ } else if (btn == "1") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "1");
+ } else if (btn == "2") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "2");
+ } else if (btn == "3") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "3");
+ } else if (btn == "4") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "4");
+ } else if (btn == "5") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "5");
+ } else if (btn == "6") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "6");
+ } else if (btn == "7") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "7");
+ } else if (btn == "8") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "8");
+ } else if (btn == "9") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ "9");
+ } else if (btn == "DOT") {
+ setprop("/MCDU[0]/scratchpad", scratchpad ~ ".");
+ }
}
\ No newline at end of file
diff --git a/Nasal/MCDU2.nas b/Nasal/MCDU2.nas
index f4924c77..765c6b82 100644
--- a/Nasal/MCDU2.nas
+++ b/Nasal/MCDU2.nas
@@ -9,4 +9,90 @@ var MCDU_init = func {
var MCDU_reset = func {
setprop("/MCDU[1]/page", "INIT");
+ setprop("/MCDU[1]/scratchpad", " ");
+}
+
+var button = func(btn) {
+ var scratchpad = getprop("/MCDU[1]/scratchpad");
+ if (btn == "A") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "A");
+ } else if (btn == "B") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "B");
+ } else if (btn == "C") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "C");
+ } else if (btn == "D") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "D");
+ } else if (btn == "E") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "E");
+ } else if (btn == "F") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "F");
+ } else if (btn == "G") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "G");
+ } else if (btn == "H") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "H");
+ } else if (btn == "I") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "I");
+ } else if (btn == "J") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "J");
+ } else if (btn == "K") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "K");
+ } else if (btn == "L") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "L");
+ } else if (btn == "M") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "M");
+ } else if (btn == "N") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "N");
+ } else if (btn == "O") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "O");
+ } else if (btn == "P") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "P");
+ } else if (btn == "Q") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "Q");
+ } else if (btn == "R") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "R");
+ } else if (btn == "S") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "S");
+ } else if (btn == "T") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "T");
+ } else if (btn == "U") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "U");
+ } else if (btn == "V") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "V");
+ } else if (btn == "W") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "W");
+ } else if (btn == "X") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "X");
+ } else if (btn == "Y") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "Y");
+ } else if (btn == "Z") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "Z");
+ } else if (btn == "SLASH") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "/");
+ } else if (btn == "SP") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ " ");
+ } else if (btn == "CLR") {
+ setprop("/MCDU[1]/scratchpad", " ");
+ } else if (btn == "0") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "0");
+ } else if (btn == "1") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "1");
+ } else if (btn == "2") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "2");
+ } else if (btn == "3") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "3");
+ } else if (btn == "4") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "4");
+ } else if (btn == "5") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "5");
+ } else if (btn == "6") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "6");
+ } else if (btn == "7") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "7");
+ } else if (btn == "8") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "8");
+ } else if (btn == "9") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ "9");
+ } else if (btn == "DOT") {
+ setprop("/MCDU[1]/scratchpad", scratchpad ~ ".");
+ }
}
\ No newline at end of file