1
0
Fork 0

Merge branch 'dev' into pneumatics

This commit is contained in:
legoboyvdlp R 2020-06-15 18:17:35 +01:00
commit 65989164f1
33 changed files with 4117 additions and 717 deletions

View file

@ -4195,6 +4195,7 @@
<file>Aircraft/A320-family/Nasal/FMGC/FMGC.nas</file>
<file>Aircraft/A320-family/Nasal/FMGC/FMGC-b.nas</file>
<file>Aircraft/A320-family/Nasal/FMGC/FMGC-c.nas</file>
<file>Aircraft/A320-family/Nasal/FMGC/winds.nas</file>
</fmgc>
<mcdu>
<file>Aircraft/A320-family/Nasal/MCDU/DUPLICATE.nas</file> <!-- dynamic page - init before others as used in various pages -->
@ -4208,6 +4209,10 @@
<file>Aircraft/A320-family/Nasal/MCDU/PILOTWAYPOINT.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/HOLD.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/F-PLN.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/WINDCLB.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/WINDCRZ.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/WINDDES.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/WINDHIST.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/MCDU.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/INITA.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/IRSINIT.nas</file>
@ -4226,6 +4231,7 @@
<file>Aircraft/A320-family/Nasal/MCDU/PERFTO.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/RADNAV.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/DATA.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/DATA2.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/STATUS.nas</file>
</mcdu>
<!-- Canvas -->

View file

@ -69,29 +69,29 @@
<model>
<path>Aircraft/A320-family/Models/Effects/Moisture-neo.xml</path>
<name>moisture</name>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/relative-humidity</property>
<value>45</value>
</greater-than>
<less-than-equals>
<property>position/altitude-agl-ft</property>
<value>75</value>
</less-than-equals>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[0]/n1</property>
<value>60</value>
</greater-than>
</and>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/relative-humidity</property>
<value>45</value>
</greater-than>
<less-than-equals>
<property>position/altitude-agl-ft</property>
<value>75</value>
</less-than-equals>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[0]/n1</property>
<value>60</value>
</greater-than>
</and>
</condition>
<offsets>
<x-m>0</x-m>
@ -105,33 +105,33 @@
<model>
<path>Aircraft/A320-family/Models/Effects/engine-spray.xml</path>
<name>engine-spray</name>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/surface/wetness</property>
<value>0.3</value>
</greater-than>
<less-than-equals>
<property>position/altitude-agl-ft</property>
<value>15</value>
</less-than-equals>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[0]/n1-actual</property>
<value>65</value>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/surface/wetness</property>
<value>0.3</value>
</greater-than>
<less-than-equals>
<property>position/altitude-agl-ft</property>
<value>15</value>
</less-than-equals>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[0]/n1-actual</property>
<value>65</value>
</greater-than>
<equals>
<property>engines/engine[0]/reverser-pos-norm</property>
<value>0</value>
</equals>
</and>
<value>0</value>
</equals>
</and>
</condition>
<offsets>
<x-m>4.875</x-m>
@ -144,29 +144,29 @@
<model>
<path>Aircraft/A320-family/Models/Effects/engine-spray-reverse.xml</path>
<name>engine-spray-reverse</name>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/surface/wetness</property>
<value>0.3</value>
</greater-than>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[0]/n1-actual</property>
<value>65</value>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/surface/wetness</property>
<value>0.3</value>
</greater-than>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[0]/n1-actual</property>
<value>65</value>
</greater-than>
<greater-than>
<property>engines/engine[0]/reverser-pos-norm</property>
<value>0.75</value>
</greater-than>
</and>
<value>0.75</value>
</greater-than>
</and>
</condition>
<offsets>
<x-m>-1.0</x-m>

View file

@ -58,29 +58,29 @@
<model>
<name>moisture</name>
<path>Aircraft/A320-family/Models/Effects/Moisture.xml</path>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/relative-humidity</property>
<value>45</value>
</greater-than>
<less-than-equals>
<property>position/altitude-agl-ft</property>
<value>75</value>
</less-than-equals>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[1]/n1</property>
<value>60</value>
</greater-than>
</and>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/relative-humidity</property>
<value>45</value>
</greater-than>
<less-than-equals>
<property>position/altitude-agl-ft</property>
<value>75</value>
</less-than-equals>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[1]/n1</property>
<value>60</value>
</greater-than>
</and>
</condition>
<offsets>
<x-m>0</x-m>
@ -94,33 +94,33 @@
<model>
<path>Aircraft/A320-family/Models/Effects/engine-spray.xml</path>
<name>engine-spray</name>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/surface/wetness</property>
<value>0.3</value>
</greater-than>
<less-than-equals>
<property>position/altitude-agl-ft</property>
<value>15</value>
</less-than-equals>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[1]/n1-actual</property>
<value>65</value>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/surface/wetness</property>
<value>0.3</value>
</greater-than>
<less-than-equals>
<property>position/altitude-agl-ft</property>
<value>15</value>
</less-than-equals>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[1]/n1-actual</property>
<value>65</value>
</greater-than>
<equals>
<property>engines/engine[1]/reverser-pos-norm</property>
<value>0</value>
</equals>
</and>
<value>0</value>
</equals>
</and>
</condition>
<offsets>
<x-m>4.875</x-m>
@ -133,29 +133,29 @@
<model>
<path>Aircraft/A320-family/Models/Effects/engine-spray-reverse.xml</path>
<name>engine-spray-reverse</name>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/surface/wetness</property>
<value>0.3</value>
</greater-than>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[1]/n1-actual</property>
<value>65</value>
<condition>
<and>
<greater-than>
<property>position/altitude-agl-ft</property>
<value>1</value>
</greater-than>
<greater-than>
<property>environment/surface/wetness</property>
<value>0.3</value>
</greater-than>
<less-than-equals>
<property>sim/time/sun-angle-rad</property>
<value>1.63</value>
</less-than-equals>
<greater-than>
<property>engines/engine[1]/n1-actual</property>
<value>65</value>
</greater-than>
<greater-than>
<property>engines/engine[1]/reverser-pos-norm</property>
<value>0.75</value>
</greater-than>
</and>
<value>0.75</value>
</greater-than>
</and>
</condition>
<offsets>
<x-m>0</x-m>

View file

@ -18,8 +18,14 @@ var myAirways = [nil, nil];
var myDuplicate = [nil, nil];
var myClosestAirport = [nil, nil];
var myPilotWP = [nil, nil];
var myWind = [nil, nil];
var myCLBWIND = [nil, nil];
var myCRZWIND = [nil, nil];
var myDESWIND = [nil, nil];
var myHISTWIND = [nil, nil];
var default = "BoeingCDU-Large.ttf";
var symbol = "helvetica_medium.txf";
#var symbol = "helvetica_medium.txf";
var symbol = "LiberationMonoCustom.ttf";
var normal = 70;
var small = 56;
var page = "";
@ -204,6 +210,8 @@ var dest_qnh = props.globals.getNode("/FMGC/internal/dest-qnh", 1);
var dest_temp = props.globals.getNode("/FMGC/internal/dest-temp", 1);
var dest_mag = props.globals.getNode("/FMGC/internal/dest-mag", 1);
var dest_wind = props.globals.getNode("/FMGC/internal/dest-wind", 1);
# var grnd_mag = props.globals.getNode("/FMGC/internal/dest-mag-grnd", 1);
# var grnd_wind = props.globals.getNode("/FMGC/internal/dest-wind-grnd", 1);
var vapp_speed_set = props.globals.getNode("/FMGC/internal/vapp-speed-set", 1);
var final = props.globals.getNode("/FMGC/internal/final", 1);
var radio = props.globals.getNode("/FMGC/internal/radio", 1);
@ -978,7 +986,7 @@ var canvas_MCDU_base = {
} else {
me["Simple_L5"].setFont(symbol);
me["Simple_L5"].setFontSize(small);
me["Simple_L5"].setText("[ ]/[ . ]");
me["Simple_L5"].setText("[ ]/[ ]");
}
if (vor2FreqSet.getValue() == 1) {
@ -998,7 +1006,7 @@ var canvas_MCDU_base = {
} else {
me["Simple_R5"].setFont(symbol);
me["Simple_R5"].setFontSize(small);
me["Simple_R5"].setText("[ . ]/[ ]");
me["Simple_R5"].setText("[ ]/[ ]");
}
me["Simple_L1"].setText(" " ~ vor1.getValue());
@ -1012,13 +1020,37 @@ var canvas_MCDU_base = {
me["Simple_L5S"].setText("ADF1/FREQ");
me["Simple_R1"].setText(" " ~ vor2.getValue());
me["Simple_R2"].setText(sprintf("%3.0f", vor2CRS.getValue()));
me["Simple_R3"].setText("[ ]/[ ]");
me["Simple_R3"].setText("[ ]/[ ]");
me["Simple_R4"].setText("-.- [ ]");
me["Simple_R1S"].setText("FREQ/VOR2");
me["Simple_R2S"].setText("CRS");
me["Simple_R3S"].setText("CHAN/ MLS");
me["Simple_R4S"].setText("SLOPE CRS");
me["Simple_R5S"].setText("FREQ/ADF2");
if (getprop("systems/radio/rmp[0]/nav") or getprop("systems/radio/rmp[1]/nav")) {
me["Simple_L1"].hide();
me["Simple_L2"].hide();
me["Simple_L3"].hide();
me["Simple_L4"].hide();
me["Simple_L5"].hide();
me["Simple_R1"].hide();
me["Simple_R2"].hide();
me["Simple_R3"].hide();
me["Simple_R4"].hide();
me["Simple_R5"].hide();
} else {
me["Simple_L1"].show();
me["Simple_L2"].show();
me["Simple_L3"].show();
me["Simple_L4"].show();
me["Simple_L5"].show();
me["Simple_R1"].show();
me["Simple_R2"].show();
me["Simple_R3"].show();
me["Simple_R4"].show();
me["Simple_R5"].show();
}
} else if (page == "INITA") {
if (!pageSwitch[i].getBoolValue()) {
me["Simple"].show();
@ -2264,7 +2296,7 @@ var canvas_MCDU_base = {
me["Simple_L4S"].setText("TRANS ALT");
me["Simple_L5S"].setText("THR RED/ACC");
me["Simple_L6S"].setText(" UPLINK");
me["Simple_R2"].setText("[ ] ");
me["Simple_R2"].setText("[ ] ");
me["Simple_R5"].setText(sprintf("%3.0f", engOutAcc.getValue()));
me["Simple_R6"].setText("PHASE ");
me["Simple_R1S"].setText("RWY ");
@ -2340,7 +2372,7 @@ var canvas_MCDU_base = {
} else {
me["Simple_R3"].setFont(symbol);
me["Simple_R3"].setFontSize(small);
me["Simple_R3"].setText("[ ]/[ ]");
me["Simple_R3"].setText("[ ]/[ ]");
}
if (flexSet.getValue() == 1) {
me["Simple_R4"].setFont(default);
@ -2944,6 +2976,8 @@ var canvas_MCDU_base = {
me["Simple_L3S"].setText("MAG WIND");
if (dest_mag.getValue() != -1 and dest_wind.getValue() != -1) {
me["Simple_L3"].setText(sprintf("%03.0fg", dest_mag.getValue()) ~ sprintf("/%.0f", dest_wind.getValue()));
# } else if (grnd_mag.getValue() != -1 and grnd_wind.getValue() != -1) {
# me["Simple_L3"].setText(sprintf("%03.0fg", grnd_mag.getValue()) ~ sprintf("/%.0f", grnd_wind.getValue()));
} else {
me["Simple_L3"].setText("---g/---");;
}
@ -3137,6 +3171,135 @@ var canvas_MCDU_base = {
me["Simple_C1S"].setText("FLP RETR");
me["Simple_C2S"].setText("SLT RETR");
me["Simple_C3S"].setText("CLEAN ");
} else if (page == "WINDCLB" or page == "WINDCRZ" or page == "WINDDES" or page == "WINDHIST") {
if (!pageSwitch[i].getBoolValue()) {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["IRSINIT"].hide();
me["INITB"].hide();
me["FUELPRED"].hide();
me["PROG"].hide();
me["PERFTO"].hide();
# if (page == "WINDCRZ") {
# up/down arrows show
# } else {
# up/down arrows hide
# }
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["Simple_Title"].show();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
me["Simple_L0S"].hide();
me["Simple_C3B"].hide();
me["Simple_C4B"].hide();
me.fontLeft(default, default, default, default, default, default);
me.fontLeftS(default, default, default, default, default, default);
me.fontRight(default, default, default, default, default, default);
me.fontRightS(default, default, default, default, default, default);
me.fontSizeLeft(normal, normal, normal, normal, normal, normal);
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
if (page == "WINDCLB") {
myWind = myCLBWIND;
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "amb");
me.colorRightS("wht", "wht", "amb", "wht", "wht", "amb");
me.fontSizeCenter(normal, normal, normal, normal, normal, normal);
} else if (page == "WINDCRZ") {
myWind = myCRZWIND;
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "amb");
me.colorRightS("wht", "amb", "wht", "wht", "wht", "amb");
me.fontSizeCenter(normal, normal, normal, normal, normal, normal);
} else if (page == "WINDDES") {
myWind = myDESWIND;
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "amb");
me.colorRightS("wht", "wht", "amb", "wht", "wht", "amb");
me.fontSizeCenter(normal, normal, normal, normal, normal, normal);
} else if (page == "WINDHIST") {
myWind = myHISTWIND;
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.fontSizeCenter(small, small, small, small, small, normal);
}
if (myWind[i] != nil) {
if (page == "WINDCRZ") {
me["Simple_Title"].setText(sprintf("%s", myWind[i].title[0] ~ myWind[i].title[1] ~ myWind[i].title[2]));
} else {
me["Simple_Title"].setText(sprintf("%s", myWind[i].title));
}
me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myWind[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myWind[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myWind[i].titleColour ~ "/b"));
forindex (var matrixArrow; myWind[i].arrowsMatrix) {
if (matrixArrow == 0) {
var sign = "L";
} else {
var sign = "R";
}
forindex (var item; myWind[i].arrowsMatrix[matrixArrow]) {
if (myWind[i].arrowsMatrix[matrixArrow][item] == 1) {
me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show();
} else {
me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide();
}
}
}
me.colorLeftArrow(myWind[i].arrowsColour[0][0],myWind[i].arrowsColour[0][1],myWind[i].arrowsColour[0][2],myWind[i].arrowsColour[0][3],myWind[i].arrowsColour[0][4],myWind[i].arrowsColour[0][5]);
forindex (var matrixFont; myWind[i].fontMatrix) {
if (matrixFont == 0) {
var sign = "L";
} else {
var sign = "R";
}
forindex (var item; myWind[i].fontMatrix[matrixFont]) {
if (myWind[i].fontMatrix[matrixFont][item] == 1) {
me["Simple_" ~ sign ~ (item + 1)].setFont(symbol);
me["Simple_" ~ sign ~ (item + 1)].setFontSize(small);
} else {
me["Simple_" ~ sign ~ (item + 1)].setFont(default);
me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal);
}
}
}
me.dynamicPageFunc(myWind[i].L1, "Simple_L1");
me.dynamicPageFunc(myWind[i].L2, "Simple_L2");
me.dynamicPageFunc(myWind[i].L3, "Simple_L3");
me.dynamicPageFunc(myWind[i].L4, "Simple_L4");
me.dynamicPageFunc(myWind[i].L5, "Simple_L5");
me.dynamicPageFunc(myWind[i].L6, "Simple_L6");
me.colorLeft(myWind[i].L1[2],myWind[i].L2[2],myWind[i].L3[2],myWind[i].L4[2],myWind[i].L5[2],myWind[i].L6[2]);
me.dynamicPageFunc(myWind[i].C1, "Simple_C1");
me.dynamicPageFunc(myWind[i].C2, "Simple_C2");
me.dynamicPageFunc(myWind[i].C3, "Simple_C3");
me.dynamicPageFunc(myWind[i].C4, "Simple_C4");
me.dynamicPageFunc(myWind[i].C5, "Simple_C5");
me.dynamicPageFunc(myWind[i].C6, "Simple_C6");
me.colorCenter(myWind[i].C1[2],myWind[i].C2[2],myWind[i].C3[2],myWind[i].C4[2],myWind[i].C5[2],myWind[i].C6[2]);
me.dynamicPageFunc(myWind[i].R1, "Simple_R1");
me.dynamicPageFunc(myWind[i].R2, "Simple_R2");
me.dynamicPageFunc(myWind[i].R3, "Simple_R3");
me.dynamicPageFunc(myWind[i].R4, "Simple_R4");
me.dynamicPageFunc(myWind[i].R5, "Simple_R5");
me.dynamicPageFunc(myWind[i].R6, "Simple_R6");
me.colorRight(myWind[i].R1[2],myWind[i].R2[2],myWind[i].R3[2],myWind[i].R4[2],myWind[i].R5[2],myWind[i].R6[2]);
}
pageSwitch[i].setBoolValue(1);
}
} else if (page == "LATREV") {
if (!pageSwitch[i].getBoolValue()) {
me["Simple"].show();
@ -3176,6 +3339,8 @@ var canvas_MCDU_base = {
if (myLatRev[i] != nil) {
me["Simple_Title"].setText(sprintf("%s", myLatRev[i].title[0] ~ myLatRev[i].title[1] ~ myLatRev[i].title[2]));
me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myLatRev[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myLatRev[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myLatRev[i].titleColour ~ "/b"));
if (myLatRev[i].subtitle[0] != nil) {
me["Simple_Center"].show();
@ -3603,7 +3768,6 @@ var canvas_MCDU_base = {
me["ArrowRight"].show();
me["arrowsDepArr"].show();
me["Simple_L1_Arrow"].hide();
me["Simple_L2_Arrow"].hide();
me["Simple_L3_Arrow"].hide();
me["Simple_L4_Arrow"].hide();
me["Simple_L5_Arrow"].hide();
@ -3630,6 +3794,12 @@ var canvas_MCDU_base = {
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
if (myArrival[i].arrowsMatrix[0][1]) {
me["Simple_L2_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][1] ~ "/r"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][1] ~ "/g"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][1] ~ "/b"));
me["Simple_L2_Arrow"].show();
} else {
me["Simple_L2_Arrow"].hide();
}
if (myArrival[i] != nil) {
me["Simple_Title"].setText(sprintf("%s", myArrival[i].title[0] ~ myArrival[i].title[1] ~ myArrival[i].title[2]));
@ -3641,6 +3811,7 @@ var canvas_MCDU_base = {
var sign = "R";
}
forindex (var item; myArrival[i].arrowsMatrix[matrixArrow]) {
if (item == 1) { continue; }
if (item == 5) {
me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/b"));
continue;

View file

@ -240,7 +240,6 @@
</animation>
<!-- Knob -->
<!-- TODO add bindings for VOR, LS and ADF -->
<!-- We use a little hack to get 8.33MHz spacing working:
First we assign our current STBY freq we want to adjust to the default instrument.
Then we change the channel there.
@ -513,7 +512,145 @@
<max>29999</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/frequencies/standby-mhz</property>
<step>0.05</step>
<min>108.00</min>
<max>112.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/radials/selected-deg</property>
<step>1</step>
<min>1</min>
<max>361</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[2]/frequencies/standby-mhz</property>
<step>0.05</step>
<min>108.00</min>
<max>118.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[2]/radials/selected-deg</property>
<step>1</step>
<min>1</min>
<max>361</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">adf</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/adf[0]/frequencies/standby-khz</property>
<step>1</step>
<min>190</min>
<max>1751</max>
<wrap>true</wrap>
</binding>
</action>
<action>
<button>1</button>
@ -779,9 +916,148 @@
<max>29999</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/frequencies/standby-mhz</property>
<step>-0.05</step>
<min>108.00</min>
<max>112.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/radials/selected-deg</property>
<step>-1</step>
<min>1</min>
<max>361</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[2]/frequencies/standby-mhz</property>
<step>-0.05</step>
<min>108.00</min>
<max>118.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[2]/radials/selected-deg</property>
<step>-1</step>
<min>1</min>
<max>361</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">adf</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/adf[0]/frequencies/standby-khz</property>
<step>-1</step>
<min>190</min>
<max>1751</max>
<wrap>true</wrap>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>radio_rot0</object-name>
@ -925,7 +1201,64 @@
<wrap>true</wrap>
<mask>integer</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/frequencies/standby-mhz</property>
<step>1.00</step>
<min>108.00</min>
<max>112.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[2]/frequencies/standby-mhz</property>
<step>1.00</step>
<min>108.00</min>
<max>118.00</max>
<wrap>true</wrap>
</binding>
</action>
<action>
<button>1</button>
@ -1067,7 +1400,64 @@
<wrap>true</wrap>
<mask>integer</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/frequencies/standby-mhz</property>
<step>-1.00</step>
<min>108.00</min>
<max>112.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[2]/frequencies/standby-mhz</property>
<step>-1</step>
<min>108.00</min>
<max>118.00</max>
<wrap>true</wrap>
</binding>
</action>
</animation>
@ -1076,23 +1466,15 @@
<type>pick</type>
<object-name>radio_nav_lit</object-name>
<action>
<button>1</button>
<button>0</button>
<binding>
<command>property-assign</command>
<command>property-toggle</command>
<property>controls/radio/rmp[0]/nav-protect</property>
<value>1</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>controls/radio/rmp[0]/nav-protect</property>
<value>0</value>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/oh-cover", 1);</script>
</binding>
</mod-up>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/oh-cover", 1);</script>
</binding>
</action>
</animation>
<animation>
@ -1111,7 +1493,7 @@
<object-name>radio_nav</object-name>
<action>
<button>0</button>
<repeatable>true</repeatable>
<repeatable>false</repeatable>
<binding>
<command>property-toggle</command>
<property>systems/radio/rmp[0]/nav</property>
@ -1132,6 +1514,15 @@
</and>
</condition>
</binding>
<binding>
<command>property-assign</command>
<property>controls/radio/rmp[0]/nav-protect</property>
<value>0</value>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/oh-cover", 1);</script>
</binding>
</action>
</animation>

View file

@ -240,7 +240,6 @@
</animation>
<!-- Knob -->
<!-- TODO add bindings for VOR, LS and ADF -->
<!-- We use a little hack to get 8.33MHz spacing working:
First we assign our current STBY freq we want to adjust to the default instrument.
Then we change the channel there.
@ -513,6 +512,145 @@
<max>29999</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/frequencies/standby-mhz</property>
<step>0.05</step>
<min>108.00</min>
<max>112.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/radials/selected-deg</property>
<step>1</step>
<min>1</min>
<max>361</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[3]/frequencies/standby-mhz</property>
<step>0.05</step>
<min>108.00</min>
<max>118.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[3]/radials/selected-deg</property>
<step>1</step>
<min>1</min>
<max>361</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">adf</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/adf[1]/frequencies/standby-khz</property>
<step>1</step>
<min>190</min>
<max>1751</max>
<wrap>true</wrap>
</binding>
</action>
<action>
@ -779,7 +917,145 @@
<max>29999</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/frequencies/standby-mhz</property>
<step>-0.05</step>
<min>108.00</min>
<max>112.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/radials/selected-deg</property>
<step>-1</step>
<min>1</min>
<max>361</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[3]/frequencies/standby-mhz</property>
<step>-0.05</step>
<min>108.00</min>
<max>118.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[3]/radials/selected-deg</property>
<step>-1</step>
<min>1</min>
<max>361</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">adf</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/adf[1]/frequencies/standby-khz</property>
<step>-1</step>
<min>190</min>
<max>1751</max>
<wrap>true</wrap>
</binding>
</action>
</animation>
<animation>
@ -925,7 +1201,64 @@
<wrap>true</wrap>
<mask>integer</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/frequencies/standby-mhz</property>
<step>1.00</step>
<min>108.00</min>
<max>112.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[3]/frequencies/standby-mhz</property>
<step>1.00</step>
<min>108.00</min>
<max>118.00</max>
<wrap>true</wrap>
</binding>
</action>
<action>
<button>1</button>
@ -1067,7 +1400,64 @@
<wrap>true</wrap>
<mask>integer</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">ls</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[0]/frequencies/standby-mhz</property>
<step>-1.00</step>
<min>108.00</min>
<max>112.00</max>
<wrap>true</wrap>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vor</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/select-crs</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/nav[3]/frequencies/standby-mhz</property>
<step>-1</step>
<min>108.00</min>
<max>118.00</max>
<wrap>true</wrap>
</binding>
</action>
</animation>
@ -1076,23 +1466,15 @@
<type>pick</type>
<object-name>radio_nav_lit</object-name>
<action>
<button>1</button>
<button>0</button>
<binding>
<command>property-assign</command>
<command>property-toggle</command>
<property>controls/radio/rmp[1]/nav-protect</property>
<value>1</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>controls/radio/rmp[1]/nav-protect</property>
<value>0</value>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/oh-cover", 1);</script>
</binding>
</mod-up>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/oh-cover", 1);</script>
</binding>
</action>
</animation>
<animation>
@ -1111,7 +1493,7 @@
<object-name>radio_nav</object-name>
<action>
<button>0</button>
<repeatable>true</repeatable>
<repeatable>false</repeatable>
<binding>
<command>property-toggle</command>
<property>systems/radio/rmp[1]/nav</property>
@ -1132,6 +1514,15 @@
</and>
</condition>
</binding>
<binding>
<command>property-assign</command>
<property>controls/radio/rmp[1]/nav-protect</property>
<value>0</value>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/oh-cover", 1);</script>
</binding>
</action>
</animation>

View file

@ -3,7 +3,7 @@ MATERIAL "radio" rgb 0.800 0.800 0.800 amb 1.000 1.000 1.000 emis 0.100 0.100
MATERIAL "radio_emit" rgb 0.640 0.640 0.640 amb 1.000 1.000 1.000 emis 0.850 0.850 0.850 spec 0.400 0.400 0.400 shi 12 trans 0.000
MATERIAL "DefaultWhite" rgb 1.000 1.000 1.000 amb 0.200 0.200 0.200 emis 0.000 0.000 0.000 spec 0.500 0.500 0.500 shi 10 trans 0.000
OBJECT world
name "Blender_exporter_v2.26__Radio.ac"
name "Blender_exporter_v3.3__Radio.ac"
kids 37
OBJECT poly
name "radio_active.screen"
@ -14746,9 +14746,9 @@ SURF 0X0
mat 0
refs 4
5 0.993212 0.944859
4 0.931324 0.944859
10 0.931324 0.943492
11 0.993212 0.943492
10 0.931324 0.943492
4 0.931324 0.944859
SURF 0X0
mat 0
refs 4
@ -14760,9 +14760,9 @@ SURF 0X0
mat 0
refs 4
1 0.965523 0.925681
0 0.997855 0.925681
4 0.997855 0.935702
5 0.965523 0.935702
4 0.997855 0.935702
0 0.997855 0.925681
SURF 0X0
mat 0
refs 4
@ -14792,9 +14792,9 @@ SURF 0X0
mat 0
refs 4
0 0.931324 0.94175
1 0.993212 0.94175
3 0.993212 0.942381
2 0.931324 0.942381
3 0.993212 0.942381
1 0.993212 0.94175
kids 0
OBJECT poly
name "radio_nav_lit.axis"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 KiB

After

Width:  |  Height:  |  Size: 320 KiB

View file

@ -3,7 +3,7 @@ MATERIAL "radio" rgb 0.800 0.800 0.800 amb 1.000 1.000 1.000 emis 0.100 0.100
MATERIAL "radio_emit" rgb 0.640 0.640 0.640 amb 1.000 1.000 1.000 emis 0.850 0.850 0.850 spec 0.400 0.400 0.400 shi 12 trans 0.000
MATERIAL "DefaultWhite" rgb 1.000 1.000 1.000 amb 0.200 0.200 0.200 emis 0.000 0.000 0.000 spec 0.500 0.500 0.500 shi 10 trans 0.000
OBJECT world
name "Blender_exporter_v2.26__Radio1.ac"
name "Blender_exporter_v3.3__Radio1.ac"
kids 37
OBJECT poly
name "radio_active.screen"
@ -14746,9 +14746,9 @@ SURF 0X0
mat 0
refs 4
5 0.993212 0.944859
4 0.931324 0.944859
10 0.931324 0.943492
11 0.993212 0.943492
10 0.931324 0.943492
4 0.931324 0.944859
SURF 0X0
mat 0
refs 4
@ -14760,9 +14760,9 @@ SURF 0X0
mat 0
refs 4
1 0.965523 0.925681
0 0.997855 0.925681
4 0.997855 0.935702
5 0.965523 0.935702
4 0.997855 0.935702
0 0.997855 0.925681
SURF 0X0
mat 0
refs 4
@ -14792,9 +14792,9 @@ SURF 0X0
mat 0
refs 4
0 0.931324 0.94175
1 0.993212 0.94175
3 0.993212 0.942381
2 0.931324 0.942381
3 0.993212 0.942381
1 0.993212 0.94175
kids 0
OBJECT poly
name "radio_nav_lit.axis"

View file

@ -430,6 +430,12 @@ var ITAF = {
if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue()) {
flightPlanController.autoSequencing();
}
#if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue() and fmgc.flightPlanController.flightplans[2].getWP(FPLN.currentWPTemp).fly_type == "flyBy") {
# flightPlanController.autoSequencing();
#} elsif (FPLN.wp0Dist.getValue() <= 0.1) {
# flightPlanController.autoSequencing();
#}
}
}
},

View file

@ -269,9 +269,9 @@ var updateFuel = func {
temp = getprop("/FMGC/internal/cruise-temp");
dist = flightPlanController.arrivalDist;
wind = getprop("/FMGC/internal/trip-wind");
trpWind = getprop("/FMGC/internal/trip-wind");
wind_value = getprop("/FMGC/internal/trip-wind-value");
if (find("HD", wind) != -1 or find("-", wind) != -1 or find("H", wind) != -1) {
if (find("HD", trpWind) != -1 or find("-", trpWind) != -1 or find("H", trpWind) != -1) {
wind_value = wind_value * -1;
}
dist = dist - (dist * wind_value * 0.002);
@ -722,6 +722,8 @@ var reset_FMGC = func {
ITAF.init();
FMGCinit();
flightPlanController.reset();
windController.reset();
mcdu.MCDU_reset(0);
mcdu.MCDU_reset(1);
setprop("it-autoflight/input/fd1", fd1);

View file

@ -7,7 +7,6 @@ var pos = nil;
var geoPosPrev = geo.Coord.new();
var currentLegCourseDist = nil;
var courseDistanceFrom = nil;
var courseDistanceFromPrev = nil;
var sizeWP = nil;
var magTrueError = 0;
var storeCourse = nil;
@ -77,6 +76,11 @@ var flightPlanController = {
me.flightplans[n].cleanPlan();
me.flightplans[n].departure = nil;
me.flightplans[n].destination = nil;
mcdu.isNoTransArr[n] = 0;
mcdu.isNoTransDep[n] = 0;
mcdu.isNoSid[n] = 0;
mcdu.isNoStar[n] = 0;
mcdu.isNoVia[n] = 0;
},
createTemporaryFlightPlan: func(n) {
@ -92,6 +96,7 @@ var flightPlanController = {
if (canvas_mcdu.myAirways[n] != nil) {
canvas_mcdu.myAirways[n].updateTmpy();
}
fmgc.windController.createTemporaryWinds(n);
me.flightPlanChanged(n);
},
@ -111,6 +116,37 @@ var flightPlanController = {
flightPlanTimer.stop();
me.resetFlightplan(2);
me.flightplans[2] = me.flightplans[n].clone();
if (mcdu.isNoSid[n] == 1) {
mcdu.isNoSid[2] = 1;
} else {
mcdu.isNoSid[2] = 0;
}
if (mcdu.isNoStar[n] == 1) {
mcdu.isNoStar[2] = 1;
} else {
mcdu.isNoStar[2] = 0;
}
if (mcdu.isNoVia[n] == 1) {
mcdu.isNoVia[2] = 1;
} else {
mcdu.isNoVia[2] = 0;
}
if (mcdu.isNoTransDep[n] == 1) {
mcdu.isNoTransDep[2] = 1;
} else {
mcdu.isNoTransDep[2] = 0;
}
if (mcdu.isNoTransArr[n] == 1) {
mcdu.isNoTransArr[2] = 1;
} else {
mcdu.isNoTransArr[2] = 0;
}
me.flightPlanChanged(2);
flightPlanTimer.start();
}
@ -120,6 +156,8 @@ var flightPlanController = {
if (canvas_mcdu.myDirTo[n] != nil) {
canvas_mcdu.myDirTo[n].updateTmpy();
}
fmgc.windController.destroyTemporaryWinds(n, a);
me.flightPlanChanged(n);
},
updateAirports: func(dep, arr, plan) {
@ -133,6 +171,7 @@ var flightPlanController = {
}
me.addDiscontinuity(1, plan);
#debug.dump(me.flightplans[2]);
# reset mcdu if it exists
if (canvas_mcdu.myFpln[0] != nil) { canvas_mcdu.myFpln[0].scroll = 0; }
if (canvas_mcdu.myFpln[1] != nil) { canvas_mcdu.myFpln[1].scroll = 0; }
@ -222,14 +261,24 @@ var flightPlanController = {
if (force) {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
if (index > 0) {
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY" and me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
} else {
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY") {
if (me.flightplans[plan].getWP(index) != nil) { # index is not nil
if (me.flightplans[plan].getWP(index - 1) != nil) { # index -1 is also not nil
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY" and me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
} else { # -1 is nil
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY") {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
}
} elsif (me.flightplans[plan].getWP(index - 1) != nil) { # index is nil, -1 is not
if (me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
} else { # both are nil??
print("Possible error in discontinuities!");
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
},
@ -241,10 +290,12 @@ var flightPlanController = {
insertTP: func(n, index = 1) {
me.flightplans[n].insertWP(createWP(geo.aircraft_position(), "T-P"), index);
fmgc.windController.insertWind(n, index, 0, "T-P");
},
insertPPOS: func(n, index = 0) {
me.flightplans[n].insertWP(createWP(geo.aircraft_position(), "PPOS"), index);
fmgc.windController.insertWind(n, index, 0, "PPOS");
},
# childWPBearingDistance - return waypoint at bearing and distance from specified waypoint ghost
@ -274,6 +325,7 @@ var flightPlanController = {
# fudge the altitude since we cannot create a hdgtoAlt from nasal. Assume 600 feet per mile - 2.5 miles
me.flightplans[n].insertWP(createWP(me.childWPBearingDistance(wptStore, me.flightplans[n].departure_runway.heading, 2.5), "1500", "sid"), 1);
fmgc.windController.insertWind(n, 1, 0, "1500");
}
me.flightPlanChanged(n);
},
@ -294,6 +346,7 @@ var flightPlanController = {
hdg = hdg - 360;
}
me.flightplans[n].insertWP(createWP(me.childWPBearingDistance(wptStore, hdg, 5), "CF", "star"), me.arrivalIndex[n]);
fmgc.windController.insertWind(n, me.arrivalIndex[n], 0, "CF");
}
me.flightPlanChanged(n);
},
@ -316,6 +369,7 @@ var flightPlanController = {
# use createWP here as createWPFrom doesn't accept waypoints
# createWPFrom worked before... but be sure!
me.flightplans[plan].insertWP(createWP(waypointGhost, waypointGhost.wp_name), 2);
fmgc.windController.insertWind(plan, 2, 0, waypointGhost.wp_name);
me.addDiscontinuity(3, plan);
} else {
# we want to delete the intermediate waypoints up to but not including the waypoint. Leave index 0, we delete it later.
@ -341,6 +395,7 @@ var flightPlanController = {
if (((s == 0 and left(wp, 4) != FMGCdep.getValue() and left(wp, 4) != FMGCarr.getValue()) or (s == 1)) and me.flightplans[n].getPlanSize() > 2) {
if (me.flightplans[n].getWP(index).id != "DISCONTINUITY" and a == 0) { # if it is a discont, don't make a new one
me.flightplans[n].deleteWP(index);
fmgc.windController.deleteWind(n, index);
if (me.flightplans[n].getWP(index) != nil and s == 0) {
if (me.flightplans[n].getWP(index).id != "DISCONTINUITY") { # else, if the next one isn't a discont, add one
me.addDiscontinuity(index, n);
@ -348,6 +403,7 @@ var flightPlanController = {
}
} else {
me.flightplans[n].deleteWP(index);
fmgc.windController.deleteWind(n, index);
}
me.flightPlanChanged(n);
canvas_nd.A3XXRouteDriver.triggerSignal("fp-removed");
@ -407,6 +463,7 @@ var flightPlanController = {
var indexPresent = me.flightplans[plan].indexOfWP(airport[indexToInsert]);
if (me.flightplans[plan].indexOfWP(airport[indexToInsert]) == -1) {
me.flightplans[plan].insertWP(createWPFrom(airport[indexToInsert]), index);
fmgc.windController.insertWind(plan, index, 0, text);
me.addDiscontinuity(index + 1, plan);
me.flightPlanChanged(plan);
return 2;
@ -440,6 +497,7 @@ var flightPlanController = {
var indexPresent = me.flightplans[plan].indexOfWP(fix[indexToInsert]);
if (me.flightplans[plan].indexOfWP(fix[indexToInsert]) == -1) {
me.flightplans[plan].insertWP(createWPFrom(fix[indexToInsert]), index);
fmgc.windController.insertWind(plan, index, 1, text);
me.addDiscontinuity(index + 1, plan);
me.flightPlanChanged(plan);
return 2;
@ -473,6 +531,7 @@ var flightPlanController = {
var indexPresent = me.flightplans[plan].indexOfWP(navaid[indexToInsert]);
if (me.flightplans[plan].indexOfWP(navaid[indexToInsert]) == -1) {
me.flightplans[plan].insertWP(createWPFrom(navaid[indexToInsert]), index);
fmgc.windController.insertWind(plan, index, 1, text);
me.addDiscontinuity(index + 1, plan);
me.flightPlanChanged(plan);
return 2;
@ -493,6 +552,7 @@ var flightPlanController = {
if (me.flightplans[plan].indexOfWP(wpGhost) == -1) {
# use createWP here as createWPFrom doesn't accept waypoints
me.flightplans[plan].insertWP(createWP(wpGhost, wpGhost.wp_name), index);
fmgc.windController.insertWind(plan, index, 1, wpGhost.wp_name);
me.addDiscontinuity(index + 1, plan);
me.flightPlanChanged(plan);
return 2;
@ -522,6 +582,7 @@ var flightPlanController = {
}
me.flightplans[plan].insertWP(waypoint.wpGhost, index);
fmgc.windController.insertWind(plan, index, 1, "LL");
me.addDiscontinuity(index + 1, plan);
me.flightPlanChanged(plan);
return 2;
@ -593,6 +654,37 @@ var flightPlanController = {
return me.insertPlaceBearingDistance(wpGhost, textSplit[1] + localMagvar, textSplit[2], index, plan); # magnetic to true? I don't know. But this works!
},
getNavCount: func(plan) {
var count = 0;
for (var wpt = 0; wpt < me.flightplans[plan].getPlanSize(); wpt += 1) {
#print(me.flightplans[plan].getWP(wpt).wp_type);
if (me.flightplans[plan].getWP(wpt).wp_type == "navaid") {
count += 1;
}
}
return count;
},
getDepartureCount: func(plan) {
var count = 0;
for (var wpt = 0; wpt < me.flightplans[plan].getPlanSize(); wpt += 1) {
#print(me.flightplans[plan].getWP(wpt).wp_role);
if (me.flightplans[plan].getWP(wpt).wp_role == "sid") {
count += 1;
}
}
return count;
},
getArrivalCount: func(plan) {
var count = 0;
for (var wpt = 0; wpt < me.flightplans[plan].getPlanSize(); wpt += 1) {
if (me.flightplans[plan].getWP(wpt).wp_role == "star" or me.flightplans[plan].getWP(wpt).wp_role == "approach" or me.flightplans[plan].getWP(wpt).wp_role == "missed") {
count += 1;
}
}
return count;
},
# insertPlaceBearingDistance - insert PBD waypoint at specified index,
# at some specified bearing, distance from a specified location
@ -609,6 +701,7 @@ var flightPlanController = {
}
me.flightplans[plan].insertWP(waypoint.wpGhost, index);
fmgc.windController.insertWind(plan, index, 0, "PBD");
me.addDiscontinuity(index + 1, plan);
me.flightPlanChanged(plan);
return 2;
@ -664,7 +757,10 @@ var flightPlanController = {
append(wpCoursePrev[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/course-from-prev", 0, "DOUBLE"));
append(wpDistancePrev[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/distance-from-prev", 0, "DOUBLE"));
}
me.updatePlans();
fmgc.windController.updatePlans();
# push update to fuel
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
@ -703,17 +799,13 @@ var flightPlanController = {
}
if (wpt > 0) {
geoPosPrev.set_latlon(me.flightplans[n].getWP(wpt - 1).lat, me.flightplans[n].getWP(wpt - 1).lon);
courseDistanceFromPrev = waypointHashStore.courseAndDistanceFrom(geoPosPrev);
wpCoursePrev[n][wpt].setValue(courseDistanceFromPrev[0]);
wpDistancePrev[n][wpt].setValue(courseDistanceFromPrev[1]);
if (wpt > 1) {
if (me.flightplans[n].getWP(wpt - 1).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt - 1).wp_type != "vectors" and me.flightplans[n].getWP(wpt - 1).wp_type != "hdgToAlt" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt" and wpt <= me.arrivalIndex[n]) {
# print("Adding " ~ courseDistanceFromPrev[1] ~ " miles for waypoint " ~ me.flightplans[n].getWP(wpt).wp_name);
me._arrivalDist += courseDistanceFromPrev[1];
}
}
wpCoursePrev[n][wpt].setValue(me.flightplans[n].getWP(wpt).leg_bearing);
wpDistancePrev[n][wpt].setValue(me.flightplans[n].getWP(wpt).leg_distance);
#if (wpt > 1) {
# if (me.flightplans[n].getWP(wpt - 1).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt - 1).wp_type != "vectors" and me.flightplans[n].getWP(wpt - 1).wp_type != "hdgToAlt" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt" and wpt <= me.arrivalIndex[n]) {
# me._arrivalDist += courseDistanceFromPrev[1];
# }
#}
} else {
# use PPOS for the first waypoint
wpCoursePrev[n][wpt].setValue(courseDistanceFrom[0]);
@ -732,8 +824,7 @@ var flightPlanController = {
}
}
}
# print("Total: " ~ me._arrivalDist);
me.arrivalDist = me._arrivalDist;
me.arrivalDist = me.flightplans[2].getWP(me.arrivalIndex[2]).distance_along_route - me.flightplans[2].getWP(1).leg_distance + me._arrivalDist;
me.updateMCDUDriver(n);
},

View file

@ -174,8 +174,11 @@ var MessageController = {
]),
typeIIMessages: std.Vector.new([
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),
TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),
TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),TypeIIMessage.new("V1/VR/V2 DISAGREE", "amb", 0),
TypeIIMessage.new("TO SPEED TOO LOW", "amb", 0),
]),
# to speed to low - new on a320, margin against vmcg / vs1g
getTypeIMsgByText: func(text) {
return me.getMsgByText(text, me.typeIMessages.vector);

378
Nasal/FMGC/winds.nas Normal file
View file

@ -0,0 +1,378 @@
# A3XX FMGC Wind Driver
# Copyright (c) 2020 Matthew Maring (mattmaring)
var wind = {
new: func() {
var w = {parents: [wind]};
w.heading = 0;
w.magnitude = 0;
w.altitude = "";
return w;
},
newcopy: func(heading, magnitude, altitude) {
var w = {parents: [wind]};
w.heading = heading;
w.magnitude = magnitude;
w.altitude = altitude;
return w;
}
};
var alt_wind = {
new: func() {
var aw = {parents: [alt_wind]};
aw.heading = 0;
aw.magnitude = 0;
return aw;
},
newcopy: func(heading, magnitude) {
var aw = {parents: [alt_wind]};
aw.heading = heading ;
aw.magnitude = magnitude;
return aw;
}
};
var sat_temp = {
new: func() {
var st = {parents: [sat_temp]};
st.temp = 0;
st.altitude = "";
return st;
},
newcopy: func(temp, altitude) {
var st = {parents: [sat_temp]};
st.temp = temp;
st.altitude = altitude;
return st;
}
};
var waypoint_winds = {
new: func(id, type, includeWind) {
var ww = {parents: [waypoint_winds]};
ww.id = id;
ww.type = type; #departure, waypoint, arrival
ww.includeWind = includeWind;
ww.wind1 = wind.new();
ww.wind2 = wind.new();
ww.wind3 = wind.new();
ww.wind4 = wind.new();
ww.wind5 = wind.new();
ww.sat1 = sat_temp.new();
ww.alt1 = alt_wind.new();
return ww;
},
newcopy: func(id, type, includeWind, wind1, wind2, wind3, wind4, wind5, sat1, alt1) {
var ww = {parents: [waypoint_winds]};
ww.id = id;
ww.type = type; #departure, waypoint, arrival
ww.includeWind = includeWind;
ww.wind1 = wind1;
ww.wind2 = wind2;
ww.wind3 = wind3;
ww.wind4 = wind4;
ww.wind5 = wind5;
ww.sat1 = sat1;
ww.alt1 = alt1;
return ww;
}
};
var windController = {
clb_winds: [0, 0, 0],
crz_winds: [0, 0, 0],
des_winds: [0, 0, 0],
winds: [[], [], []], #waypoint winds used if route includes navaids
nav_indicies: [[], [], []],
windSizes: [0, 0, 0],
accessPage: ["", ""],
#temporaryFlag: [0, 0],
init: func() {
me.resetWind(2);
me.clb_winds[2] = waypoint_winds.new("climb", "waypoint", 1);
me.crz_winds[2] = waypoint_winds.new("cruize", "waypoint", 1);
me.des_winds[2] = waypoint_winds.new("descent", "waypoint", 1);
},
reset: func() {
#me.temporaryFlag[0] = 0;
#me.temporaryFlag[1] = 0;
me.resetWind(0);
me.resetWind(1);
me.resetWind(2);
},
resetWind: func(n) {
me.clb_winds[n] = 0;
me.crz_winds[n] = 0;
me.des_winds[n] = 0;
me.winds[n] = [];
me.nav_indicies[n] = [];
me.windSizes[n] = 0;
},
copyClbWind: func(n) {
var id = me.clb_winds[n].id;
var type = me.clb_winds[n].type;
var includeWind = me.clb_winds[n].includeWind;
var wind1 = wind.newcopy(me.clb_winds[n].wind1.heading, me.clb_winds[n].wind1.magnitude, me.clb_winds[n].wind1.altitude);
var wind2 = wind.newcopy(me.clb_winds[n].wind2.heading, me.clb_winds[n].wind2.magnitude, me.clb_winds[n].wind2.altitude);
var wind3 = wind.newcopy(me.clb_winds[n].wind3.heading, me.clb_winds[n].wind3.magnitude, me.clb_winds[n].wind3.altitude);
var wind4 = wind.newcopy(me.clb_winds[n].wind4.heading, me.clb_winds[n].wind4.magnitude, me.clb_winds[n].wind4.altitude);
var wind5 = wind.newcopy(me.clb_winds[n].wind5.heading, me.clb_winds[n].wind5.magnitude, me.clb_winds[n].wind5.altitude);
var sat1 = sat_temp.newcopy(me.clb_winds[n].sat1.temp, me.clb_winds[n].sat1.altitude);
var alt1 = alt_wind.newcopy(me.clb_winds[n].alt1.heading, me.clb_winds[n].alt1.magnitude);
return waypoint_winds.newcopy(id, type, includeWind, wind1, wind2, wind3, wind4, wind5, sat1, alt1);
},
copyCrzWind: func(n) {
var id = me.crz_winds[n].id;
var type = me.crz_winds[n].type;
var includeWind = me.crz_winds[n].includeWind;
var wind1 = wind.newcopy(me.crz_winds[n].wind1.heading, me.crz_winds[n].wind1.magnitude, me.crz_winds[n].wind1.altitude);
var wind2 = wind.newcopy(me.crz_winds[n].wind2.heading, me.crz_winds[n].wind2.magnitude, me.crz_winds[n].wind2.altitude);
var wind3 = wind.newcopy(me.crz_winds[n].wind3.heading, me.crz_winds[n].wind3.magnitude, me.crz_winds[n].wind3.altitude);
var wind4 = wind.newcopy(me.crz_winds[n].wind4.heading, me.crz_winds[n].wind4.magnitude, me.crz_winds[n].wind4.altitude);
var wind5 = wind.newcopy(me.crz_winds[n].wind5.heading, me.crz_winds[n].wind5.magnitude, me.crz_winds[n].wind5.altitude);
var sat1 = sat_temp.newcopy(me.crz_winds[n].sat1.temp, me.crz_winds[n].sat1.altitude);
var alt1 = alt_wind.newcopy(me.crz_winds[n].alt1.heading, me.crz_winds[n].alt1.magnitude);
return waypoint_winds.newcopy(id, type, includeWind, wind1, wind2, wind3, wind4, wind5, sat1, alt1);
},
copyDesWind: func(n) {
var id = me.des_winds[n].id;
var type = me.des_winds[n].type;
var includeWind = me.des_winds[n].includeWind;
var wind1 = wind.newcopy(me.des_winds[n].wind1.heading, me.des_winds[n].wind1.magnitude, me.des_winds[n].wind1.altitude);
var wind2 = wind.newcopy(me.des_winds[n].wind2.heading, me.des_winds[n].wind2.magnitude, me.des_winds[n].wind2.altitude);
var wind3 = wind.newcopy(me.des_winds[n].wind3.heading, me.des_winds[n].wind3.magnitude, me.des_winds[n].wind3.altitude);
var wind4 = wind.newcopy(me.des_winds[n].wind4.heading, me.des_winds[n].wind4.magnitude, me.des_winds[n].wind4.altitude);
var wind5 = wind.newcopy(me.des_winds[n].wind5.heading, me.des_winds[n].wind5.magnitude, me.des_winds[n].wind5.altitude);
var sat1 = sat_temp.newcopy(me.des_winds[n].sat1.temp, me.des_winds[n].sat1.altitude);
var alt1 = alt_wind.newcopy(me.des_winds[n].alt1.heading, me.des_winds[n].alt1.magnitude);
return waypoint_winds.newcopy(id, type, includeWind, wind1, wind2, wind3, wind4, wind5, sat1, alt1);
},
copyWinds: func(n) {
var tempWind = [];
for (i = 0; i < size(me.winds[n]); i += 1) {
var id = me.winds[n][i].id;
var type = me.winds[n][i].type;
var includeWind = me.winds[n][i].includeWind;
var wind1 = wind.newcopy(me.winds[n][i].wind1.heading, me.winds[n][i].wind1.magnitude, me.winds[n][i].wind1.altitude);
var wind2 = wind.newcopy(me.winds[n][i].wind2.heading, me.winds[n][i].wind2.magnitude, me.winds[n][i].wind2.altitude);
var wind3 = wind.newcopy(me.winds[n][i].wind3.heading, me.winds[n][i].wind3.magnitude, me.winds[n][i].wind3.altitude);
var wind4 = wind.newcopy(me.winds[n][i].wind4.heading, me.winds[n][i].wind4.magnitude, me.winds[n][i].wind4.altitude);
var wind5 = wind.newcopy(me.winds[n][i].wind5.heading, me.winds[n][i].wind5.magnitude, me.winds[n][i].wind5.altitude);
var sat1 = sat_temp.newcopy(me.winds[n][i].sat1.temp, me.winds[n][i].sat1.altitude);
var alt1 = alt_wind.newcopy(me.winds[n][i].alt1.heading, me.winds[n][i].alt1.magnitude);
append(tempWind, waypoint_winds.newcopy(id, type, includeWind, wind1, wind2, wind3, wind4, wind5, sat1, alt1));
}
return tempWind;
},
createTemporaryWinds: func(n) {
me.resetWind(n);
me.clb_winds[n] = me.copyClbWind(2);
me.crz_winds[n] = me.copyCrzWind(2);
me.des_winds[n] = me.copyDesWind(2);
me.winds[n] = me.copyWinds(2);
me.nav_indicies[n] = me.nav_indicies[2];
me.windSizes[n] = me.windSizes[2];
#me.temporaryFlag[n] = 1;
},
destroyTemporaryWinds: func(n, a) { # a = 1 activate, a = 0 erase
#print("destroying temporary ", n);
if (a == 1) {
me.resetWind(2);
me.clb_winds[2] = me.copyClbWind(n);
me.crz_winds[2] = me.copyCrzWind(n);
me.des_winds[2] = me.copyDesWind(n);
me.winds[2] = me.copyWinds(n);
me.nav_indicies[2] = me.nav_indicies[n];
me.windSizes[2] = me.windSizes[n];
}
if (n == 3) { return; }
me.resetWind(n);
#me.updatePlans();
#me.temporaryFlag[n] = 0;
},
insertWind: func(plan, index, value, id) {
if (me.windSizes[plan] == index) {
if (value == 3) {
append(me.winds[plan], waypoint_winds.new(id, "arrival", 0));
} else if (value == 2) {
append(me.winds[plan], waypoint_winds.new(id, "departure", 0));
} else if (value == 1) {
append(me.winds[plan], waypoint_winds.new(id, "waypoint", 1));
} else {
append(me.winds[plan], waypoint_winds.new(id, "waypoint", 0));
}
me.windSizes[plan] += 1;
} else if (me.windSizes[plan] > index and index >= 0) {
append(me.winds[plan], waypoint_winds.new(id, "waypoint", 0));
me.windSizes[plan] += 1;
for (i = me.windSizes[plan] - 1; i > index; i -= 1) {
me.winds[plan][i] = me.winds[plan][i - 1];
}
if (value == 3) {
me.winds[plan][index] = waypoint_winds.new(id, "arrival", 0);
} else if (value == 2) {
me.winds[plan][index] = waypoint_winds.new(id, "departure", 0);
} else if (value == 1) {
me.winds[plan][index] = waypoint_winds.new(id, "waypoint", 1);
} else {
me.winds[plan][index] = waypoint_winds.new(id, "waypoint", 0);
}
} else {
#print("insert invalid id: ", id, ", plan: ", plan, ", index: ", index, ", size: ", me.windSizes[plan]);
#debug.dump(me.winds);
#debug.dump(me.windSizes);
return;
}
#print("insert plan: ", plan, ", index: ", index);
#debug.dump(me.winds);
#debug.dump(me.windSizes);
},
deleteWind: func(plan, index) {
if (me.windSizes[plan] == index) {
pop(me.winds[plan]);
me.windSizes[plan] -= 1;
} else if (me.windSizes[plan] > index and index >= 0) {
for (i = index; i < me.windSizes[plan] - 1; i += 1) {
me.winds[plan][i] = me.winds[plan][i + 1];
}
pop(me.winds[plan]);
me.windSizes[plan] -= 1;
} else {
#print("delete invalid plan: ", plan, ", index: ", index, ", size: ", me.windSizes[plan]);
#debug.dump(me.winds);
#debug.dump(me.windSizes);
return;
}
#print("delete plan: ", plan, ", index: ", index);
#debug.dump(me.winds);
#debug.dump(me.windSizes);
},
updatePlans: func() {
var winds_copy = me.winds;
var windSizes_copy = me.windSizes;
me.winds = [[], [], []];
me.nav_indicies = [[], [], []];
me.windSizes = [0, 0, 0];
# loop through waypoints
for (plan = 0; plan <= 2; plan += 1) {
for (i = 0; i < fmgc.flightPlanController.flightplans[plan].getPlanSize(); i += 1) {
var waypoint = fmgc.flightPlanController.flightplans[plan].getWP(i);
#print(waypoint.wp_role, "| : |", waypoint.wp_type);
if (waypoint.wp_role == "sid") {
append(me.winds[plan], waypoint_winds.new(waypoint.id, "departure", 0));
me.windSizes[plan] += 1;
} else if (waypoint.wp_role == "star" or waypoint.wp_role == "approach" or waypoint.wp_role == "missed") {
append(me.winds[plan], waypoint_winds.new(waypoint.id, "arrival", 0));
me.windSizes[plan] += 1;
} else if (waypoint.wp_role == nil and waypoint.wp_type == "navaid") {
var found = 0;
for (index = 0; index < windSizes_copy[plan]; index += 1) {
#print(waypoint.id, " : ", winds_copy[plan][index].id);
if (waypoint.id == winds_copy[plan][index].id) {
append(me.winds[plan], winds_copy[plan][index]);
append(me.nav_indicies[plan], i);
me.windSizes[plan] += 1;
found = 1;
}
}
if (found != 1) {
append(me.winds[plan], waypoint_winds.new(waypoint.id, "waypoint", 0));
me.windSizes[plan] += 1;
}
} else {
append(me.winds[plan], waypoint_winds.new(waypoint.id, "waypoint", 0));
me.windSizes[plan] += 1;
}
#print("insert plan: ", plan, ", index: ", i);
#debug.dump(me.winds);
#debug.dump(me.nav_indicies);
#debug.dump(me.windSizes);
}
}
if (canvas_mcdu.myCLBWIND[1] != nil) {
canvas_mcdu.myCLBWIND[1].reload();
}
if (canvas_mcdu.myCLBWIND[0] != nil) {
canvas_mcdu.myCLBWIND[0].reload();
}
if (canvas_mcdu.myCRZWIND[1] != nil) {
if (!fmgc.flightPlanController.temporaryFlag[1]) {
if (getprop("/FMGC/internal/tofrom-set") and size(fmgc.windController.nav_indicies[2]) > 0) {
canvas_mcdu.myCRZWIND[1].waypoint = fmgc.flightPlanController.flightplans[2].getWP(me.nav_indicies[2][0]);
canvas_mcdu.myCRZWIND[1].singleCRZ = 0;
canvas_mcdu.myCRZWIND[1].cur_location = 0;
} else {
canvas_mcdu.myCRZWIND[1].waypoint = nil;
canvas_mcdu.myCRZWIND[1].singleCRZ = 1;
canvas_mcdu.myCRZWIND[1].cur_location = 0;
}
} else {
if (getprop("/FMGC/internal/tofrom-set") and size(fmgc.windController.nav_indicies[1]) > 0) {
canvas_mcdu.myCRZWIND[1].waypoint = fmgc.flightPlanController.flightplans[1].getWP(me.nav_indicies[1][0]);
canvas_mcdu.myCRZWIND[1].singleCRZ = 0;
canvas_mcdu.myCRZWIND[1].cur_location = 0;
} else {
canvas_mcdu.myCRZWIND[1].waypoint = nil;
canvas_mcdu.myCRZWIND[1].singleCRZ = 1;
canvas_mcdu.myCRZWIND[1].cur_location = 0;
}
}
canvas_mcdu.myCRZWIND[1].reload();
}
if (canvas_mcdu.myCRZWIND[0] != nil) {
if (!fmgc.flightPlanController.temporaryFlag[0]) {
if (getprop("/FMGC/internal/tofrom-set") and size(fmgc.windController.nav_indicies[2]) > 0) {
canvas_mcdu.myCRZWIND[0].waypoint = fmgc.flightPlanController.flightplans[2].getWP(me.nav_indicies[2][0]);
canvas_mcdu.myCRZWIND[0].singleCRZ = 0;
canvas_mcdu.myCRZWIND[0].cur_location = 0;
} else {
canvas_mcdu.myCRZWIND[0].waypoint = nil;
canvas_mcdu.myCRZWIND[0].singleCRZ = 1;
canvas_mcdu.myCRZWIND[0].cur_location = 0;
}
} else {
if (getprop("/FMGC/internal/tofrom-set") and size(fmgc.windController.nav_indicies[0]) > 0) {
canvas_mcdu.myCRZWIND[0].waypoint = fmgc.flightPlanController.flightplans[0].getWP(me.nav_indicies[0][0]);
canvas_mcdu.myCRZWIND[0].singleCRZ = 0;
canvas_mcdu.myCRZWIND[0].cur_location = 0;
} else {
canvas_mcdu.myCRZWIND[0].waypoint = nil;
canvas_mcdu.myCRZWIND[0].singleCRZ = 1;
canvas_mcdu.myCRZWIND[0].cur_location = 0;
}
}
canvas_mcdu.myCRZWIND[0].reload();
}
if (canvas_mcdu.myDESWIND[1] != nil) {
canvas_mcdu.myDESWIND[1].reload();
}
if (canvas_mcdu.myDESWIND[0] != nil) {
canvas_mcdu.myDESWIND[0].reload();
}
if (canvas_mcdu.myHISTWIND[1] != nil) {
canvas_mcdu.myHISTWIND[1].reload();
}
if (canvas_mcdu.myHISTWIND[0] != nil) {
canvas_mcdu.myHISTWIND[0].reload();
}
}
};

View file

@ -224,6 +224,7 @@ var systemsInit = func {
systems.autobrake_init();
systems.fire_init();
fmgc.flightPlanController.reset();
fmgc.windController.reset();
fadec.FADEC.init();
fmgc.ITAF.init();
fmgc.FMGCinit();
@ -243,6 +244,7 @@ var systemsInit = func {
fcu.FCUController.init();
dmc.DMController.init();
fmgc.flightPlanController.init();
fmgc.windController.init();
}
setlistener("/sim/signals/fdm-initialized", func {

View file

@ -1,4 +1,6 @@
var isNoStar = [0, 0];
var isNoStar = [0, 0, 0];
var isNoTransArr = [0, 0, 0];
var isNoVia = [0, 0, 0];
var arrivalPage = {
title: [nil, nil, nil],
@ -31,17 +33,20 @@ var arrivalPage = {
selectedVIA: nil,
selectedSTAR: nil,
selectedTransition: nil,
stars: nil,
transitions: nil,
vias: nil,
stars: [],
transitions: [],
vias: [],
computer: nil,
enableScrollApproach: 0,
enableScrollStars: 0,
enableScrollVias: 0,
scrollApproach: 0,
scrollStars: 0,
activePage: 0, # runways, stars, trans
hasPressNoTrans: 0, # temporary
scrollVias: 0,
activePage: 0, # runways, stars, vias
oldPage: 0,
_approaches: nil,
_vias: nil,
_stars: nil,
_transitions: nil,
new: func(icao, computer) {
@ -56,39 +61,75 @@ var arrivalPage = {
return nil;
},
reset: func() {
isNoStar[me.computer] = 0;
me.selectedApproach = nil;
me.selectedSTAR = nil;
me.hasPressNoTrans = 0;
me.selectedTransition = nil;
me.selectedVIA = nil;
isNoStar[me.computer] = 0;
isNoTransArr[me.computer] = 0;
isNoVia[me.computer] = 0;
},
_setupFirstTime: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[2].approach != nil) {
me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach;
if (getprop("/sim/version/flightgear") == "2020.2.0") {
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans;
} elsif (isNoVia[2] == 1) {
me.selectedVIA = "NO VIA";
}
}
}
if (fmgc.flightPlanController.flightplans[2].star != nil) {
me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star;
isNoStar[me.computer] = 0;
} elsif (isNoStar[me.computer] == 1) {
isNoStar[2] = 0;
} elsif (isNoStar[2] == 1) {
me.selectedSTAR = "NO STAR";
me.hasPressNoTrans = 1;
}
if (isNoTransArr[2]) {
me.selectedTransition = "NO TRANS";
} elsif (fmgc.flightPlanController.flightplans[2].star != nil) {
me.selectedTransition = fmgc.flightPlanController.flightplans[2].star_trans;
}
} else {
if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
me.selectedApproach = fmgc.flightPlanController.flightplans[me.computer].approach;
if (getprop("/sim/version/flightgear") == "2020.2.0") {
if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
me.selectedVIA = fmgc.flightPlanController.flightplans[me.computer].approach_trans;
} elsif (isNoVia[me.computer] == 1) {
me.selectedVIA = "NO VIA";
}
}
} elsif (fmgc.flightPlanController.flightplans[2].approach != nil) {
me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach;
if (getprop("/sim/version/flightgear") == "2020.2.0") {
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans;
}
}
}
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
me.selectedSTAR = fmgc.flightPlanController.flightplans[me.computer].star;
me.selectedTransition = fmgc.flightPlanController.flightplans[me.computer].star_trans;
isNoStar[me.computer] = 0;
} elsif (fmgc.flightPlanController.flightplans[2].star != nil) {
me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star;
me.selectedTransition = fmgc.flightPlanController.flightplans[2].star_trans;
isNoStar[me.computer] = 0;
isNoStar[2] = 0;
} elsif (isNoStar[me.computer] == 1) {
me.selectedSTAR = "NO STAR";
me.hasPressNoTrans = 1;
}
if (isNoTransArr[me.computer] or isNoTransArr[2]) {
me.selectedTransition = "NO TRANS";
} elsif (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
me.selectedTransition = fmgc.flightPlanController.flightplans[me.computer].star_trans;
} elsif (fmgc.flightPlanController.flightplans[2].star != nil) {
me.selectedTransition = fmgc.flightPlanController.flightplans[2].star_trans;
}
}
},
@ -99,8 +140,8 @@ var arrivalPage = {
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.L6 = [" RETURN END", nil, "wht"];
if (!fmgc.flightPlanController.temporaryFlag[me.computer] or me.activePage == 2) {
me.L6 = [" RETURN", nil, "wht"];
} else {
me.L6 = [" F-PLN", " TMPY", "yel"];
me.arrowsColour[0][5] = "yel";
@ -108,11 +149,17 @@ var arrivalPage = {
if (me.activePage == 0) {
me.updateApproaches();
} else {
} elsif (me.activePage == 1) {
me.updateSTARs();
me.updateTransitions();
} else {
me.updateVIAs();
}
me.checkPageType();
me.updateActiveApproach();
me.updateActiveVIAs();
me.updateActiveSTARs();
me.updateActiveTransitions();
},
@ -143,101 +190,147 @@ var arrivalPage = {
me._clearPage();
me._setupPageWithData();
},
# Functions to populate top row
updateActiveApproach: func() {
if (me.apprIsRwyFlag) {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[me.computer].destination_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].destination_runway.id, " APPR", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].destination_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[2].destination_runway.id, " APPR", "grn"];
} elsif (fmgc.flightPlanController.flightplans[2].destination_runway != nil and fmgc.flightPlanController.flightplans[2].destination_runway.id == me.selectedApproach.id) {
me.L1 = [fmgc.flightPlanController.flightplans[2].destination_runway.id, " APPR", "yel"];
} else {
me.L1 = ["---", " APPR", "wht"];
me.L1 = ["-----", " APPR", "wht"];
}
} else {
if (fmgc.flightPlanController.flightplans[me.computer].destination_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].destination_runway.id, " APPR", "yel"];
if (fmgc.flightPlanController.flightplans[2].destination_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[2].destination_runway.id, " APPR", "grn"];
} else {
me.L1 = ["---", " APPR", "wht"];
me.L1 = ["-----", " APPR", "wht"];
}
}
} elsif (me.selectedApproach != nil) {
if (fmgc.flightPlanController.flightplans[2].approach != nil) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].approach.id, " APPR", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].approach.id == me.selectedApproach.id) {
} elsif (fmgc.flightPlanController.flightplans[2].approach != nil and fmgc.flightPlanController.flightplans[2].approach.id == me.selectedApproach.id) {
me.L1 = [fmgc.flightPlanController.flightplans[2].approach.id, " APPR", "yel"];
} else {
me.L1 = ["-----", " APPR", "wht"];
}
} else {
if (fmgc.flightPlanController.flightplans[2].approach != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[2].approach.id, " APPR", "grn"];
} else {
me.L1 = ["---", " APPR", "wht"];
}
} elsif (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].approach.id, " APPR", "yel"];
} else {
me.L1 = ["---", " APPR", "wht"];
me.L1 = ["-----", " APPR", "wht"];
}
}
} else {
me.L1 = ["---", " APPR", "wht"];
me.L1 = ["-----", " APPR", "wht"];
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
updateActiveVIAs: func() {
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
if (me.selectedVIA == "NO VIA") {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.C1 = ["NONE", "VIA", "grn"];
} else {
me.C1 = ["NONE", "VIA", "yel"];
}
} elsif (me.selectedVIA != nil) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].approach_trans.id, "VIA", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].approach_trans != nil and fmgc.flightPlanController.flightplans[2].approach_trans.id == me.selectedVIA.id) {
me.C1 = [fmgc.flightPlanController.flightplans[2].approach_trans.id, "VIA", "yel"];
} else {
me.C1 = ["-------", "VIA", "wht"];
}
} else {
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[2].approach_trans.id, "VIA", "grn"];
} else {
me.C1 = ["-------", "VIA", "wht"];
}
}
} else {
me.C1 = ["-------", "VIA", "wht"];
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
updateActiveSTARs: func() {
if (me.selectedSTAR == "NO STAR") {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.C1 = ["NONE", "STAR", "grn"];
me.R1 = ["NONE", "STAR ", "grn"];
} else {
me.C1 = ["NONE", "STAR", "yel"];
me.R1 = ["NONE", "STAR ", "yel"];
}
} elsif (me.selectedSTAR != nil) {
if (fmgc.flightPlanController.flightplans[2].star != nil) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "STAR", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].star.id == me.selectedSTAR.id) {
me.C1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR", "grn"];
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "STAR ", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].star != nil and fmgc.flightPlanController.flightplans[2].star.id == me.selectedSTAR.id) {
me.R1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR ", "yel"];
} else {
me.C1 = ["------- ", "STAR", "wht"];
me.R1 = ["-------", "STAR ", "wht"];
}
} elsif (fmgc.flightPlanController.flightplans[me.computer].star.id != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "STAR", "yel"];
} else {
me.C1 = ["------- ", "STAR", "wht"];
if (fmgc.flightPlanController.flightplans[2].star != nil) {
me.R1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR ", "grn"];
} else {
me.R1 = ["-------", "STAR ", "wht"];
}
}
} else {
me.C1 = ["------- ", "STAR", "wht"];
me.R1 = ["-------", "STAR ", "wht"];
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
updateActiveTransitions: func() {
if (!me.hasPressNoTrans) {
if (me.selectedTransition == "NO TRANS") {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.R2 = ["NONE", "TRANS ", "grn"];
} else {
me.R2 = ["NONE", "TRANS ", "yel"];
}
} else {
if (me.selectedTransition != nil) {
if (fmgc.flightPlanController.flightplans[2].star_trans != nil) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) {
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "TRANS", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].star_trans.id == me.selectedTransition.id) {
me.R1 = [fmgc.flightPlanController.flightplans[2].star_trans.id, "TRANS", "grn"];
me.R2 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "TRANS ", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].star_trans != nil and fmgc.flightPlanController.flightplans[2].star_trans.id == me.selectedTransition.id) {
me.R2 = [fmgc.flightPlanController.flightplans[2].star_trans.id, "TRANS ", "yel"];
} else {
me.R1 = ["-------", "TRANS ", "wht"];
me.R2 = ["-------", "TRANS ", "wht"];
}
} elsif (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "STAR", "yel"];
} else {
me.R1 = ["-------", "TRANS ", "wht"];
} else {
if (fmgc.flightPlanController.flightplans[2].star_trans != nil) {
me.R2 = [fmgc.flightPlanController.flightplans[2].star_trans.id, "TRANS ", "grn"];
} else {
me.R2 = ["-------", "TRANS ", "wht"];
}
}
} else {
me.R1 = ["-------", "TRANS ", "wht"];
}
} else {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.R1 = ["NONE", "TRANS ", "grn"];
} else {
me.R1 = ["NONE", "TRANS ", "yel"];
me.R2 = ["-------", "TRANS ", "wht"];
}
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
updateApproaches: func() {
me.apprIsRwyFlag = 0;
if (me.arrAirport == nil) {
me.arrAirport = findAirportsByICAO(left(me.id, 4));
}
me.approaches = [];
me._approaches = nil;
me._approaches = me.arrAirport[0].getApproachList();
me.approaches = sort(me._approaches,func(a,b) cmp(a,b));
if (me.approaches == nil or size(me.approaches) == 0) {
@ -353,6 +446,10 @@ var arrivalPage = {
if (me.arrAirport == nil) {
me.arrAirport = findAirportsByICAO(left(me.id, 4));
}
me.stars = [];
me._stars = nil;
if (me.selectedApproach != nil) {
me._stars = me.arrAirport[0].stars(me.selectedApproach.runways[0]);
} else {
@ -367,18 +464,8 @@ var arrivalPage = {
}
if (size(me.stars) >= 1) {
me.L2 = [" " ~ me.stars[0 + me.scrollStars], "STARS", "blu"];
me.L3 = [" " ~ me.stars[0 + me.scrollStars], "STARS", "blu"];
if (me.stars[0 + me.scrollStars] != me.selectedSTAR) {
me.arrowsMatrix[0][1] = 1;
me.arrowsColour[0][1] = "blu";
} else {
me.arrowsMatrix[0][1] = 0;
me.arrowsColour[0][1] = "ack";
}
}
if (size(me.stars) >= 2) {
me.L3 = [" " ~ me.stars[1 + me.scrollStars], nil, "blu"];
if (me.stars[1 + me.scrollStars] != me.selectedSTAR) {
me.arrowsMatrix[0][2] = 1;
me.arrowsColour[0][2] = "blu";
} else {
@ -386,9 +473,9 @@ var arrivalPage = {
me.arrowsColour[0][2] = "ack";
}
}
if (size(me.stars) >= 3) {
me.L4 = [" " ~ me.stars[2 + me.scrollStars], nil, "blu"];
if (me.stars[2 + me.scrollStars] != me.selectedSTAR) {
if (size(me.stars) >= 2) {
me.L4 = [" " ~ me.stars[1 + me.scrollStars], nil, "blu"];
if (me.stars[1 + me.scrollStars] != me.selectedSTAR) {
me.arrowsMatrix[0][3] = 1;
me.arrowsColour[0][3] = "blu";
} else {
@ -396,9 +483,9 @@ var arrivalPage = {
me.arrowsColour[0][3] = "ack";
}
}
if (size(me.stars) >= 4) {
me.L5 = [" " ~ me.stars[3 + me.scrollStars], nil, "blu"];
if (me.stars[3 + me.scrollStars] != me.selectedSTAR) {
if (size(me.stars) >= 3) {
me.L5 = [" " ~ me.stars[2 + me.scrollStars], nil, "blu"];
if (me.stars[2 + me.scrollStars] != me.selectedSTAR) {
me.arrowsMatrix[0][4] = 1;
me.arrowsColour[0][4] = "blu";
} else {
@ -407,21 +494,75 @@ var arrivalPage = {
}
}
me.C2 = [nil, "AVAILABLE", "wht"];
me.R2 = [nil, "TRANS ", "wht"];
me.C3[1] = "AVAILABLE";
me.R3[1] = "TRANS ";
if (size(me.stars) > 4) {
if (size(me.stars) > 3) {
me.enableScrollStars = 1;
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
updateVIAs: func() {
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
if (me.selectedApproach == nil or me.activePage != 2) {
me.clearVias();
return;
}
me.vias = [];
me._vias = nil;
me._vias = me.selectedApproach.transitions;
me.vias = sort(me._vias, func(a,b) cmp(a,b));
append(me.vias, "NO VIA");
if (size(me.vias) >= 1) {
me.L2 = [" " ~ me.vias[0 + me.scrollVias], " APP VIAS", "blu"];
if (me.vias[0 + me.scrollVias] != me.selectedVIA) {
me.arrowsMatrix[0][1] = 1;
me.arrowsColour[0][1] = "blu";
} else {
me.arrowsMatrix[0][1] = 0;
me.arrowsColour[0][1] = "ack";
}
}
if (size(me.vias) >= 2) {
me.L3 = [" " ~ me.vias[1 + me.scrollVias], nil, "blu"];
if (me.vias[1 + me.scrollVias] != me.selectedVIA) {
me.arrowsMatrix[0][2] = 1;
me.arrowsColour[0][2] = "blu";
} else {
me.arrowsMatrix[0][2] = 0;
me.arrowsColour[0][2] = "ack";
}
}
if (size(me.vias) >= 3) {
me.L4 = [" " ~ me.vias[2 + me.scrollVias], nil, "blu"];
if (me.vias[2 + me.scrollVias] != me.selectedVIA) {
me.arrowsMatrix[0][3] = 1;
me.arrowsColour[0][3] = "blu";
} else {
me.arrowsMatrix[0][3] = 0;
me.arrowsColour[0][3] = "ack";
}
}
if (size(me.vias) >= 4) {
me.L5 = [" " ~ me.vias[3 + me.scrollVias], nil, "blu"];
if (me.vias[3 + me.scrollVias] != me.selectedVIA) {
me.arrowsMatrix[0][4] = 1;
me.arrowsColour[0][4] = "blu";
} else {
me.arrowsMatrix[0][4] = 0;
me.arrowsColour[0][4] = "ack";
}
}
if (size(me.vias) > 3) {
me.enableScrollVias = 1;
}
},
clearTransitions: func() {
me.R2 = [nil, "TRANS", "wht"];
me.R3 = [nil, "TRANS", "wht"];
me.R4 = [nil, "TRANS", "wht"];
me.R5 = [nil, "TRANS", "wht"];
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
me.R3 = [nil, nil, "wht"];
me.R4 = [nil, nil, "wht"];
me.R5 = [nil, nil, "wht"];
me.arrowsMatrix[1][2] = 0;
me.arrowsColour[1][2] = "ack";
me.arrowsMatrix[1][3] = 0;
@ -429,67 +570,68 @@ var arrivalPage = {
me.arrowsMatrix[1][4] = 0;
me.arrowsColour[1][4] = "ack";
},
clearVias: func() {
me.L2 = [nil, nil, "wht"];
me.L3 = [nil, nil, "wht"];
me.L4 = [nil, nil, "wht"];
me.L5 = [nil, nil, "wht"];
me.arrowsMatrix[0][1] = 0;
me.arrowsColour[0][1] = "ack";
me.arrowsMatrix[0][2] = 0;
me.arrowsColour[0][2] = "ack";
me.arrowsMatrix[0][3] = 0;
me.arrowsColour[0][3] = "ack";
me.arrowsMatrix[0][4] = 0;
me.arrowsColour[0][4] = "ack";
if (me.activePage == 2) {
me.activePage = me.oldPage;
}
},
updateTransitions: func() {
if (me.arrAirport == nil) {
me.arrAirport = findAirportsByICAO(left(me.id, 4));
}
if (me.selectedSTAR == nil) {
me.R2 = ["NO TRANS ", "TRANS", "blu"];
if (!me.hasPressNoTrans) {
me.arrowsMatrix[1][1] = 1;
me.arrowsColour[1][1] = "blu";
} else {
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
}
return;
}
if (me.selectedSTAR == "NO STAR") {
me.transitions = [];
me._transitions = nil;
me.clearTransitions();
if (me.selectedSTAR == nil or me.selectedSTAR == "NO STAR") {
append(me.transitions, "NO TRANS");
return;
}
me._transitions = me.arrAirport[0].getStar(me.selectedSTAR).transitions;
if (isghost(me.selectedSTAR)) {
me._transitions = me.arrAirport[0].getStar(me.selectedSTAR.id).transitions;
} else {
me._transitions = me.arrAirport[0].getStar(me.selectedSTAR).transitions;
}
me.transitions = sort(me._transitions,func(a,b) cmp(a,b));
append(me.transitions, "NO TRANS");
if (size(me.transitions) == 0) {
me.R2 = ["NO TRANS ", "TRANS", "blu"];
if (!me.hasPressNoTrans) {
me.arrowsMatrix[1][1] = 1;
me.arrowsColour[1][1] = "blu";
} else {
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
}
} elsif (size(me.transitions) >= 1) {
me.R2 = [me.transitions[0] ~ " ", "TRANS", "blu"];
if (size(me.transitions) >= 1) {
me.R3 = [me.transitions[0] ~ " ", "TRANS", "blu"];
if (me.transitions[0] != me.selectedTransition) {
me.arrowsMatrix[1][1] = 1;
me.arrowsColour[1][1] = "blu";
} else {
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
}
} elsif (size(me.transitions) >= 2) {
me.R3 = [me.transitions[1] ~ " ", nil, "blu"];
if (me.transitions[1] != me.selectedTransition) {
me.arrowsMatrix[1][2] = 1;
me.arrowsColour[1][2] = "blu";
} else {
me.arrowsMatrix[1][2] = 0;
me.arrowsColour[1][2] = "ack";
}
} elsif (size(me.transitions) >= 3) {
me.R4 = [me.transitions[2] ~ " ", nil, "blu"];
if (me.transitions[2] != me.selectedTransition) {
}
if (size(me.transitions) >= 2) {
me.R4 = [me.transitions[1] ~ " ", nil, "blu"];
if (me.transitions[1] != me.selectedTransition) {
me.arrowsMatrix[1][3] = 1;
me.arrowsColour[1][3] = "blu";
} else {
me.arrowsMatrix[1][3] = 0;
me.arrowsColour[1][3] = "ack";
}
} elsif (size(me.transitions) >= 4) {
me.R5 = [me.transitions[3] ~ " ", nil, "blu"];
if (me.transitions[3] != me.selectedTransition) {
}
if (size(me.transitions) >= 3) {
me.R5 = [me.transitions[2] ~ " ", nil, "blu"];
if (me.transitions[2] != me.selectedTransition) {
me.arrowsMatrix[1][4] = 1;
me.arrowsColour[1][4] = "blu";
} else {
@ -497,6 +639,9 @@ var arrivalPage = {
me.arrowsColour[1][4] = "ack";
}
}
# no indication it is scrollable...
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
makeTmpy: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
@ -510,6 +655,17 @@ var arrivalPage = {
}
}
},
checkPageType: func() {
if (me.activePage == 0) {
me.L2 = [nil, nil, "wht"];
me.arrowsMatrix[0][1] = 0;
me.arrowsColour[0][1] = "wht";
} elsif (me.activePage == 1) {
me.L2 = [" VIAS", " APPR", "wht"];
me.arrowsMatrix[0][1] = 1;
me.arrowsColour[0][1] = "wht";
}
},
scrollUp: func() {
if (me.activePage == 0) {
if (me.enableScrollApproach) {
@ -519,10 +675,10 @@ var arrivalPage = {
}
me.updateApproaches();
}
} else {
} elsif (me.activePage == 1) {
if (me.enableScrollStars) {
me.scrollStars += 1;
if (me.scrollStars > size(me.stars) - 4) {
if (me.scrollStars > size(me.stars) - 3) {
me.scrollStars = 0;
}
me.updateSTARs();
@ -531,7 +687,15 @@ var arrivalPage = {
} else {
me.updateTransitions();
}
me.hasPressNoTrans = 0;
}
} elsif (me.activePage == 2) {
if (me.enableScrollVias) {
me.scrollVias += 1;
if (me.scrollVias > size(me.vias) - 4) {
me.scrollVias = 0;
}
me.updateActiveVIAs();
me.updateVIAs();
}
}
},
@ -544,11 +708,11 @@ var arrivalPage = {
}
me.updateApproaches();
}
} else {
} elsif (me.activePage == 1) {
if (me.enableScrollStars) {
me.scrollStars -= 1;
if (me.scrollStars < 0) {
me.scrollStars = size(me.stars) - 4;
me.scrollStars = size(me.stars) - 3;
}
me.updateSTARs();
if (me.selectedSTAR == nil or me.selectedSTAR == "NO STAR") {
@ -556,24 +720,52 @@ var arrivalPage = {
} else {
me.updateTransitions();
}
me.hasPressNoTrans = 0;
}
} elsif (me.activePage == 2) {
if (me.enableScrollVias) {
me.scrollVias -= 1;
if (me.scrollVias < 0) {
me.scrollVias = size(me.vias) - 4;
}
me.updateActiveVIAs();
me.updateVIAs();
}
}
},
scrollLeft: func() {
if (me.activePage == 2) { return; }
me.activePage = !me.activePage;
me.checkPageType();
me.updatePage();
},
scrollRight: func() {
if (me.activePage == 2) { return; }
me.activePage = !me.activePage;
me.checkPageType();
me.updatePage();
},
arrPushbuttonLeft: func(index) {
if (me.activePage == 0) {
if (size(me.approaches) >= (index - 2) and index != 2) {
if (index == 2 and me.activePage == 1 and me.selectedApproach != nil) {
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
me.oldPage = me.activePage;
me.activePage = 2;
me.updatePage();
me.updateVIAs();
} elsif (index == 6 and me.activePage == 2) {
me.activePage = me.oldPage;
me.oldPage = 0;
me.updatePage();
} elsif (index == 6 and me.activePage != 2) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
setprop("/MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
} else {
setprop("/MCDU[" ~ me.computer ~ "]/page", "LATREV");
}
} elsif (me.activePage == 0 and index != 6) {
if (size(me.approaches) >= (index - 2) and index != 2) { # index = 3, size = 1
if (!dirToFlag) {
me.selectedSTAR = nil;
me.hasPressNoTrans = 0;
me.selectedVIA = nil;
isNoTransArr[me.computer] = 0;
isNoStar[me.computer] = 0;
me.makeTmpy();
if (!me.apprIsRwyFlag) {
@ -587,20 +779,22 @@ var arrivalPage = {
setprop("FMGC/internal/baro", 99999);
setprop("FMGC/internal/radio", 99999);
setprop("FMGC/internal/radio-no", 0);
me.updateActiveApproach();
me.updateApproaches();
me.updatePage();
fmgc.flightPlanController.flightPlanChanged(me.computer);
me.scrollRight();
me.checkPageType();
} else {
mcdu_message(me.computer, "DIR TO IN PROGRESS");
}
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else {
if (size(me.stars) >= (index - 2)) {
} elsif (me.activePage == 1 and index != 6) {
if (size(me.stars) >= (index - 2) and index != 2) {
if (!dirToFlag) {
me.selectedSTAR = me.stars[index - 2 + me.scrollStars];
me.selectedTransition = nil;
me.selectedSTAR = me.stars[index - 3 + me.scrollStars];
me.makeTmpy();
if (me.selectedSTAR != "NO STAR") {
isNoStar[me.computer] = 0;
@ -612,15 +806,14 @@ var arrivalPage = {
fmgc.flightPlanController.insertNOSTAR(me.computer);
}
}
me.updateActiveSTARs();
me.updateSTARs();
if (me.selectedSTAR != "NO STAR") {
me.hasPressNoTrans = 0;
me.updateTransitions();
isNoTransArr[me.computer] = 0;
} else {
me.hasPressNoTrans = 1;
isNoTransArr[me.computer] = 1;
me.selectedTransition = "NO TRANS";
}
me.updateActiveTransitions();
me.updatePage();
fmgc.flightPlanController.flightPlanChanged(me.computer);
} else {
mcdu_message(me.computer, "DIR TO IN PROGRESS");
@ -628,24 +821,44 @@ var arrivalPage = {
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} elsif (me.activePage == 2 and index != 6) {
if (size(me.vias) >= (index - 1)) { # different!!
if (!dirToFlag) {
me.selectedVIA = me.vias[index - 2 + me.scrollVias];
me.makeTmpy();
if (me.selectedVIA != "NO VIA") {
isNoVia[me.computer] = 0;
fmgc.flightPlanController.flightplans[me.computer].approach_trans = me.selectedVIA;
} else {
isNoVia[me.computer] = 1;
fmgc.flightPlanController.flightplans[me.computer].approach_trans = nil;
}
me.updateVIAs();
me.updatePage();
fmgc.flightPlanController.flightPlanChanged(me.computer);
} else {
mcdu_message(me.computer, "DIR TO IN PROGRESS");
}
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
},
arrPushbuttonRight: func(index) {
if (index == 2 and size(me.transitions) == 0) {
if (size(me.transitions) >= (index - 2)) {
if (!dirToFlag) {
me.hasPressNoTrans = 1;
me.updateActiveTransitions();
me.updateTransitions();
} else {
mcdu_message(me.computer, "DIR TO IN PROGRESS");
}
} elsif (size(me.transitions) >= (index - 1)) {
if (!dirToFlag) {
me.selectedTransition = me.transitions[index - 2];
me.selectedTransition = me.transitions[index - 3];
me.makeTmpy();
fmgc.flightPlanController.flightplans[me.computer].star_trans = me.selectedTransition;
me.updateActiveTransitions();
me.updateTransitions();
if (me.selectedTransition != "NO TRANS") {
isNoTransArr[me.computer] = 0;
fmgc.flightPlanController.flightplans[me.computer].star_trans = me.selectedTransition;
} else {
isNoTransArr[me.computer] = 1;
fmgc.flightPlanController.flightplans[me.computer].star_trans = nil;
}
me.updatePage();
fmgc.flightPlanController.flightPlanChanged(me.computer);
} else {
mcdu_message(me.computer, "DIR TO IN PROGRESS");

15
Nasal/MCDU/DATA2.nas Normal file
View file

@ -0,0 +1,15 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var data2Input = func(key, i) {
if (key == "L5") {
if (canvas_mcdu.myCLBWIND[i] == nil) {
canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i);
} else {
canvas_mcdu.myCLBWIND[i].reload();
}
fmgc.windController.accessPage[i] = "DATA2";
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
}
}

View file

@ -1,4 +1,5 @@
var isNoSid = [0, 0];
var isNoSid = [0, 0, 0];
var isNoTransDep = [0, 0, 0];
var departurePage = {
title: [nil, nil, nil],
@ -29,18 +30,18 @@ var departurePage = {
selectedRunway: nil,
selectedSID: nil,
selectedTransition: nil,
sids: nil,
transitions: nil,
computer: nil,
enableScrollRwy: 0,
enableScrollSids: 0,
scrollRwy: 0,
scrollSids: 0,
activePage: 0, # runways, sids, trans
hasPressNoTrans: 0, # temporary
_runways: nil,
_sids: nil,
_transitions: nil,
runways: [],
sids: [],
transitions: [],
new: func(icao, computer) {
var page = {parents:[departurePage]};
page.id = icao;
@ -54,8 +55,9 @@ var departurePage = {
},
reset: func() {
isNoSid[me.computer] = 0;
isNoTransDep[me.computer] = 0;
me.selectedSID = nil;
me.hasPressNoTrans = 0;
me.selectedTransition = nil;
},
_setupFirstTime: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
@ -65,9 +67,14 @@ var departurePage = {
if (fmgc.flightPlanController.flightplans[2].sid != nil) {
me.selectedSID = fmgc.flightPlanController.flightplans[2].sid;
isNoSid[me.computer] = 0;
} elsif (isNoSid[me.computer] == 1) {
} elsif (isNoSid[2] == 1) {
me.selectedSID = "NO SID";
me.hasPressNoTrans = 1;
}
if (isNoTransDep[2]) {
me.selectedTransition = "NO TRANS";
} elsif (fmgc.flightPlanController.flightplans[2].sid != nil) {
me.selectedTransition = fmgc.flightPlanController.flightplans[2].sid_trans;
}
} else {
if (fmgc.flightPlanController.flightplans[me.computer].departure_runway != nil) {
@ -77,15 +84,20 @@ var departurePage = {
}
if (fmgc.flightPlanController.flightplans[me.computer].sid != nil) {
me.selectedSID = fmgc.flightPlanController.flightplans[me.computer].sid;
me.selectedTransition = fmgc.flightPlanController.flightplans[me.computer].sid_trans;
isNoSid[me.computer] = 0;
} elsif (fmgc.flightPlanController.flightplans[2].sid != nil) {
me.selectedSID = fmgc.flightPlanController.flightplans[2].sid;
me.selectedTransition = fmgc.flightPlanController.flightplans[2].sid_trans;
isNoSid[me.computer] = 0;
} elsif (isNoSid[me.computer] == 1) {
me.selectedSID = "NO SID";
me.hasPressNoTrans = 1;
}
if (isNoTransDep[me.computer] or isNoTransDep[2]) {
me.selectedTransition = "NO TRANS";
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid != nil) {
me.selectedTransition = fmgc.flightPlanController.flightplans[me.computer].sid_trans;
} elsif (fmgc.flightPlanController.flightplans[2].sid != nil) {
me.selectedTransition = fmgc.flightPlanController.flightplans[2].sid_trans;
}
}
},
@ -107,6 +119,7 @@ var departurePage = {
me.updateRunways();
} else {
me.updateSIDs();
me.updateTransitions();
}
me.updateActiveRunway();
@ -142,18 +155,20 @@ var departurePage = {
},
updateActiveRunway: func() {
if (me.selectedRunway != nil) {
if (fmgc.flightPlanController.flightplans[2].departure_runway != nil) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[me.computer].departure_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].departure_runway.id, " RWY", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].departure_runway.id == me.selectedRunway.id) {
me.L1 = [fmgc.flightPlanController.flightplans[2].departure_runway.id, " RWY", "grn"];
} elsif (fmgc.flightPlanController.flightplans[2].departure_runway != nil and fmgc.flightPlanController.flightplans[2].departure_runway.id == me.selectedRunway.id) {
me.L1 = [fmgc.flightPlanController.flightplans[2].departure_runway.id, " RWY", "yel"];
} else {
me.L1 = ["---", " RWY", "wht"];
}
} elsif (fmgc.flightPlanController.flightplans[me.computer].departure_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].departure_runway.id, " RWY", "yel"];
} else {
me.L1 = ["---", " RWY", "wht"];
if (fmgc.flightPlanController.flightplans[2].departure_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[2].departure_runway.id, " RWY", "grn"];
} else {
me.L1 = ["---", " RWY", "wht"];
}
}
} else {
me.L1 = ["---", " RWY", "wht"];
@ -168,18 +183,20 @@ var departurePage = {
me.C1 = ["NONE", "SID", "yel"];
}
} elsif (me.selectedSID != nil) {
if (fmgc.flightPlanController.flightplans[2].sid != nil) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[me.computer].sid != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].sid.id, "SID", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].sid.id == me.selectedSID.id) {
me.C1 = [fmgc.flightPlanController.flightplans[2].sid.id, "SID", "grn"];
} elsif (fmgc.flightPlanController.flightplans[2].sid != nil and fmgc.flightPlanController.flightplans[2].sid.id == me.selectedSID.id) {
me.C1 = [fmgc.flightPlanController.flightplans[2].sid.id, "SID", "yel"];
} else {
me.C1 = ["------- ", "SID", "wht"];
}
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].sid.id, "SID", "yel"];
} else {
me.C1 = ["------- ", "SID", "wht"];
if (fmgc.flightPlanController.flightplans[2].sid != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[2].sid.id, "SID", "grn"];
} else {
me.C1 = ["------- ", "SID", "wht"];
}
}
} else {
me.C1 = ["------- ", "SID", "wht"];
@ -187,30 +204,32 @@ var departurePage = {
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
updateActiveTransitions: func() {
if (!me.hasPressNoTrans) {
if (me.selectedTransition != nil) {
if (fmgc.flightPlanController.flightplans[2].sid_trans != nil) {
if (fmgc.flightPlanController.flightplans[me.computer].sid_trans != nil) {
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].sid_trans.id, "TRANS", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].sid_trans.id == me.selectedTransition.id) {
me.R1 = [fmgc.flightPlanController.flightplans[2].sid_trans.id, "TRANS", "grn"];
} else {
me.R1 = ["-------", "TRANS ", "wht"];
}
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid_trans != nil) {
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].sid_trans.id, "SID", "yel"];
} else {
me.R1 = ["-------", "TRANS ", "wht"];
}
} else {
me.R1 = ["-------", "TRANS ", "wht"];
}
} else {
if (me.selectedTransition == "NO TRANS") {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.R1 = ["NONE", "TRANS ", "grn"];
} else {
me.R1 = ["NONE", "TRANS ", "yel"];
}
} else {
if (me.selectedTransition != nil) {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[me.computer].sid_trans != nil) {
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].sid_trans.id, "TRANS", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].sid_trans != nil and fmgc.flightPlanController.flightplans[2].sid_trans.id == me.selectedTransition.id) {
me.R1 = [fmgc.flightPlanController.flightplans[2].sid_trans.id, "TRANS", "yel"];
} else {
me.R1 = ["-------", "TRANS ", "wht"];
}
} else {
if (fmgc.flightPlanController.flightplans[2].sid_trans != nil) {
me.R1 = [fmgc.flightPlanController.flightplans[2].sid_trans.id, "SID", "grn"];
} else {
me.R1 = ["-------", "TRANS ", "wht"];
}
}
} else {
me.R1 = ["-------", "TRANS ", "wht"];
}
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
@ -218,6 +237,10 @@ var departurePage = {
if (me.depAirport == nil) {
me.depAirport = findAirportsByICAO(left(me.id, 4));
}
me.runways = [];
me._runways = nil;
me._runways = keys(me.depAirport[0].runways);
me.runways = sort(me._runways,func(a,b) cmp(a,b));
@ -279,6 +302,10 @@ var departurePage = {
if (me.depAirport == nil) {
me.depAirport = findAirportsByICAO(left(me.id, 4));
}
me.sids = [];
me._sids = nil;
if (me.selectedRunway != nil) {
me._sids = me.depAirport[0].sids(me.selectedRunway.id);
} else {
@ -334,8 +361,8 @@ var departurePage = {
}
}
me.C2 = [nil, "AVAILABLE", "wht"];
me.R2 = [nil, "TRANS ", "wht"];
me.C2[1] = "AVAILABLE";
me.R2[1] = "TRANS ";
if (size(me.sids) > 4) {
me.enableScrollSids = 1;
@ -361,30 +388,22 @@ var departurePage = {
me.depAirport = findAirportsByICAO(left(me.id, 4));
}
if (me.selectedSID == nil) {
me.R2 = ["NO TRANS ", "TRANS", "blu"];
if (!me.hasPressNoTrans) {
me.arrowsMatrix[1][1] = 1;
me.arrowsColour[1][1] = "blu";
} else {
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
}
me.clearTransitions();
if (me.selectedSID == nil or me.selectedSID == "NO SID") {
append(me.transitions, "NO TRANS");
return;
}
if (isghost(me.selectedSID)) {
me._transitions = me.depAirport[0].getSid(me.selectedSID.id).transitions;
} else {
me._transitions = me.depAirport[0].getSid(me.selectedSID).transitions;
}
me._transitions = me.depAirport[0].getSid(me.selectedSID).transitions;
me.transitions = sort(me._transitions,func(a,b) cmp(a,b));
append(me.transitions, "NO TRANS");
if (size(me.transitions) == 0) {
me.R2 = ["NO TRANS ", "TRANS", "blu"];
if (!me.hasPressNoTrans) {
me.arrowsMatrix[1][1] = 1;
me.arrowsColour[1][1] = "blu";
} else {
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
}
} elsif (size(me.transitions) >= 1) {
if (size(me.transitions) >= 1) {
me.R2 = [me.transitions[0] ~ " ", "TRANS", "blu"];
if (me.transitions[0] != me.selectedTransition) {
me.arrowsMatrix[1][1] = 1;
@ -421,6 +440,7 @@ var departurePage = {
me.arrowsColour[1][4] = "ack";
}
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
makeTmpy: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
@ -455,7 +475,6 @@ var departurePage = {
} else {
me.updateTransitions();
}
me.hasPressNoTrans = 0;
}
}
},
@ -480,7 +499,6 @@ var departurePage = {
} else {
me.updateTransitions();
}
me.hasPressNoTrans = 0;
}
}
},
@ -498,12 +516,12 @@ var departurePage = {
if (!dirToFlag) {
me.selectedSID = nil;
isNoSid[me.computer] = 0;
me.hasPressNoTrans = 0;
isNoTransDep[me.computer] = 0;
me.selectedRunway = me.depAirport[0].runway(me.runways[index - 2 + me.scrollRwy]);
me.makeTmpy();
fmgc.flightPlanController.flightplans[me.computer].departure_runway = me.selectedRunway;
me.updateActiveRunway();
me.updateRunways();
me.updatePage();
fmgc.flightPlanController.flightPlanChanged(me.computer);
me.scrollRight();
} else {
@ -519,21 +537,20 @@ var departurePage = {
me.makeTmpy();
if (me.selectedSID != "NO SID") {
isNoSid[me.computer] = 0;
fmgc.flightPlanController.flightplans[me.computer].sid = me.selectedSID;
fmgc.flightPlanController.flightplans[me.computer].sid = me.depAirport[0].getSid(me.selectedSID);
} else {
isNoSid[me.computer] = 1;
fmgc.flightPlanController.flightplans[me.computer].sid = nil;
fmgc.flightPlanController.insertNOSID(me.computer);
}
me.updateActiveSIDs();
me.updateSIDs();
if (me.selectedSID != "NO SID") {
me.hasPressNoTrans = 0;
me.updateTransitions();
isNoTransDep[me.computer] = 0;
} else {
me.hasPressNoTrans = 1;
isNoTransDep[me.computer] = 1;
me.selectedTransition = "NO TRANS";
}
me.updateActiveTransitions();
me.updatePage();
fmgc.flightPlanController.flightPlanChanged(me.computer);
} else {
mcdu_message(me.computer, "DIR TO IN PROGRESS");
@ -544,21 +561,18 @@ var departurePage = {
}
},
depPushbuttonRight: func(index) {
if (index == 2 and size(me.transitions) == 0) {
if (!dirToFlag) {
me.hasPressNoTrans = 1;
me.updateActiveTransitions();
me.updateTransitions();
} else {
mcdu_message(me.computer, "DIR TO IN PROGRESS");
}
} elsif (size(me.transitions) >= (index - 1)) {
if (size(me.transitions) >= (index - 1)) {
if (!dirToFlag) {
me.selectedTransition = me.transitions[index - 2];
me.makeTmpy();
fmgc.flightPlanController.flightplans[me.computer].sid_trans = me.depAirport[0].getSid(me.selectedSID).transition(me.selectedTransition);
me.updateActiveTransitions();
me.updateTransitions();
if (me.selectedTransition != "NO TRANS") {
isNoTransDep[me.computer] = 0;
fmgc.flightPlanController.flightplans[me.computer].sid_trans = me.selectedTransition;
} else {
isNoTransDep[me.computer] = 1;
fmgc.flightPlanController.flightplans[me.computer].sid_trans = nil;
}
me.updatePage();
fmgc.flightPlanController.flightPlanChanged(me.computer);
} else {
mcdu_message(me.computer, "DIR TO IN PROGRESS");

View file

@ -7,6 +7,7 @@ var fplnItem = {
fI.computer = computer;
fI.colour = colour;
fI.assembledStr = [nil, nil, colour];
fI._colour = "wht";
return fI;
},
updateLeftText: func() {
@ -39,8 +40,10 @@ var fplnItem = {
if (me.wp.wp_name != "DISCONTINUITY") {
if (me.index == fmgc.flightPlanController.currentToWptIndex.getValue() - 1 and fmgc.flightPlanController.fromWptTime != nil) {
me.assembledStr[0] = fmgc.flightPlanController.fromWptTime ~ " ";
me.assembledStr[2] = "grn";
} else {
me.assembledStr[0] = "---- ";
me.assembledStr[2] = "wht";
}
if (me.index == fmgc.flightPlanController.currentToWptIndex.getValue()) {
@ -65,7 +68,11 @@ var fplnItem = {
me.spd = me.getSpd();
me.alt = me.getAlt();
me.dist = me.getDist();
return [me.spd ~ "/" ~ me.alt, " " ~ me.dist ~ "NM ", me.colour];
me._colour = "wht";
if (me.spd[1] != "wht" or me.alt[1] != "wht") {
me._colour = "mag";
}
return [me.spd[0] ~ "/" ~ me.alt[0], " " ~ me.dist ~ "NM ", me._colour];
} else {
return [nil, nil, "ack"];
}
@ -88,18 +95,26 @@ var fplnItem = {
},
getSpd: func() {
if (me.index == 0 and getprop("FMGC/internal/v1-set")) {
return sprintf("%3.0f", math.round(getprop("FMGC/internal/v1")));
return [sprintf("%3.0f", math.round(getprop("FMGC/internal/v1"))), "mag"];
} elsif (me.wp.speed_cstr != nil and me.wp.speed_cstr != 0) {
return [sprintf("%3.0f", me.wp.speed_cstr), "mag"];
} else {
return "---";
return ["---", "wht"];
}
},
getAlt: func() {
if (me.index == 0 and left(me.wp.wp_name, 4) == getprop("/FMGC/internal/dep-arpt") and fmgc.flightPlanController.flightplans[me.plan].departure != nil) {
return sprintf("%6.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT));
return [" " ~ sprintf("%-5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "mag"];
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) and fmgc.flightPlanController.fromWptAlt != nil) {
return " " ~ fmgc.flightPlanController.fromWptAlt;
return [" " ~ fmgc.flightPlanController.fromWptAlt, "mag"];
} elsif (me.wp.alt_cstr != nil and me.wp.alt_cstr != 0) {
if (me.wp.alt_cstr > fmgc.FMGCInternal.transAlt) {
return [" " ~ sprintf("%-5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), "mag"];
} else {
return [" " ~ sprintf("%-5.0f", me.wp.alt_cstr), "mag"];
}
} else {
return "------";
return ["------", "wht"];
}
},
getDist: func() {
@ -148,23 +163,23 @@ var fplnItem = {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (me.index == fmgc.flightPlanController.arrivalIndex[me.computer]) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer);
} if (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[me.computer].departure.id) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer);
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[me.computer].departure.id) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer);
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
} else {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer);
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
}
} else {
if (me.index == fmgc.flightPlanController.arrivalIndex[2]) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer);
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[2].departure.id) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer);
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer, me.wp, me.plan);
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer);
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
} else {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer);
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer, me.wp, me.plan);
}
}
setprop("MCDU[" ~ me.computer ~ "]/page", "VERTREV");
@ -216,17 +231,6 @@ var fplnPage = { # this one is only created once, and then updated - remember th
R5: [nil, nil, "ack"],
R6: [nil, nil, "ack"],
# init conditions
# line 1 = FROM
# line 2 = TO
# line 6 = DEST
# neither pseudo nor markers may be FROM waypoint
# bearing between FROM and TO waypoints
# track between line 2 and line 3 waypoints
# name of LEG above TO waypoint - is airway identifier, or waypoint name
# DEST in LINE 6 time prediction, distance along flightplan, and EFOB
# dashes if no predictions
planList: [],
outputList: [],
scroll: 0,

View file

@ -33,7 +33,9 @@ var fuelPredInput = func(key, i) {
if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/rte-rsv", 0.05 * num(getprop("/FMGC/internal/trip-fuel")));
setprop("/FMGC/internal/rte-rsv-set", 0);
setprop("/FMGC/internal/rte-percent", 5.0);
setprop("/FMGC/internal/rte-percent-set", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else if (getprop("/FMGC/internal/trip-fuel") != 0) {
@ -43,17 +45,21 @@ var fuelPredInput = func(key, i) {
var perc = num(split("/", scratchpad)[1]);
if (perc != nil and perc >= 0.0 and perc <= 15.0) {
setprop("/FMGC/internal/rte-rsv", num(perc) / 100 * num(getprop("/FMGC/internal/trip-fuel")));
setprop("/FMGC/internal/rte-rsv-set", 0);
setprop("/FMGC/internal/rte-percent", perc);
setprop("/FMGC/internal/rte-percent-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
mcdu_scratchpad.scratchpads[i].empty();
}
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) {
setprop("/FMGC/internal/rte-rsv", scratchpad);
setprop("/FMGC/internal/rte-rsv-set", 1);
if (scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100 <= 15.0) {
setprop("/FMGC/internal/rte-percent", scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100);
} else {
setprop("/FMGC/internal/rte-percent", 15.0); # need reasearch on this value
}
setprop("/FMGC/internal/rte-percent-set", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {

View file

@ -40,21 +40,42 @@ var holdPage = {
_setupPageWithData: func() {
me.title = ["HOLD", " AT ", me.waypoint.wp_name];
me.titleColour = "wht";
me.L1 = [" [ ]", "INB CRS", "blu"];
me.L2 = [" R", " TURN", "blu"];
if (pts.Instrumentation.Altimeter.indicatedFt.getValue() >= 14000) {
me.L2 = [" 1.5/----", "TIME/DIST", "blu"];
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["wht", "wht", "ack", "ack", "ack", "ack"]];
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
if (me.waypoint.fly_type == "Hold") {
me.makeTmpy();
me.L1 = [" " ~ sprintf("%03.0f", me.waypoint.hold_inbound_radial), "INB CRS", "blu"];
me.fontMatrix[0][0] = 0;
if (me.waypoint.hold_is_left_handed) {
me.L2 = [" L", " TURN", "blu"];
} else {
me.L2 = [" R", " TURN", "blu"];
}
if (me.waypoint.hold_is_distance) {
me.L2 = [" -.-/" ~ me.waypoint.hold_time_or_distance, "TIME/DIST", "blu"];
} else {
me.L2 = [" " ~ sprintf("%3.1f", (me.waypoint.hold_time_or_distance / 60)) ~ "/----", "TIME/DIST", "blu"];
}
me.R1 = ["COMPUTED ", nil, "wht"];
me.R2 = ["DATABASE ", nil, "yel"];
me.arrowsMatrix[1][1] = 0;
} else {
me.L2 = [" 1.0/----", "TIME/DIST", "blu"];
me.L1 = [" 100", "INB CRS", "blu"];
me.L2 = [" R", " TURN", "blu"];
if (pts.Instrumentation.Altimeter.indicatedFt.getValue() >= 14000) {
me.L2 = [" 1.5/----", "TIME/DIST", "blu"];
} else {
me.L2 = [" 1.0/----", "TIME/DIST", "blu"];
}
me.R1 = ["COMPUTED ", nil, "wht"];
me.R2 = ["DATABASE ", nil, "wht"];
}
me.L6 = [" RETURN", nil, "wht"];
me.C4 = ["LAST EXIT", nil, "wht"];
me.C5 = ["---- ---.-", "UTC FUEL", "wht"];
me.R1 = ["COMPUTED ", nil, "wht"];
me.R2 = ["DATABASE ", nil, "wht"];
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["wht", "wht", "ack", "ack", "ack", "ack"]];
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
makeTmpy: func() {
@ -67,7 +88,7 @@ var holdPage = {
me.L1[2] = "yel";
me.L2[2] = "yel";
me.L6 = [" F-PLN", " TMPY", "yel"];
me.R6 = ["INSERT* ", " TMPY", "yel"];
me.R6 = ["INSERT ", " TMPY", "yel"];
me.arrowsColour[0][5] = "yel";
me.titleColour = "yel";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);

View file

@ -9,6 +9,7 @@ var initInputA = func(key, i) {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/alt-airport", "");
setprop("/FMGC/internal/alt-set", 0);
fmgc.windController.updatePlans();
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
@ -24,6 +25,7 @@ var initInputA = func(key, i) {
if (tfs == 4) {
setprop("/FMGC/internal/alt-airport", scratchpad);
setprop("/FMGC/internal/alt-set", 1);
fmgc.windController.updatePlans();
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
@ -169,7 +171,9 @@ var initInputA = func(key, i) {
setprop("/FMGC/internal/fuel-calculating", 1);
}
fmgc.flightPlanController.reset(2);
fmgc.windController.reset(2);
fmgc.flightPlanController.init();
fmgc.windController.init();
mcdu_scratchpad.scratchpads[i].empty();
#} else if (scratchpad == "") {
#setprop("/FMGC/internal/alt-selected", 0);
@ -222,6 +226,14 @@ var initInputA = func(key, i) {
}
} else if (key == "R3") {
setprop("MCDU[" ~ i ~ "]/page", "IRSINIT");
} else if (key == "R4") {
if (canvas_mcdu.myCLBWIND[i] == nil) {
canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i);
} else {
canvas_mcdu.myCLBWIND[i].reload();
}
fmgc.windController.accessPage[i] = "INITA";
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
} else if (key == "R5") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/tropo", 36090);

View file

@ -1,5 +1,6 @@
var latRev = {
title: [nil, nil, nil],
titleColour: "wht",
subtitle: [nil, nil],
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
@ -36,6 +37,7 @@ var latRev = {
_checkTmpy: func() {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.L6 = [" F-PLN", " TMPY", "yel"];
me.titleColour = "yel";
me.arrowsColour[0][5] = "yel";
me.R2[2] = "yel";
me.R3[2] = "yel";
@ -50,7 +52,7 @@ var latRev = {
me.L3 = [" HOLD", nil, "wht"];
me.L6 = [" RETURN", nil, "wht"];
me.R1 = ["FIX INFO ", nil, "wht"];
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
me.arrowsMatrix = [[0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "wht", "wht", "ack", "ack", "wht"], ["wht", "ack", "ack", "ack", "ack", "ack"]];
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0]];
@ -75,7 +77,7 @@ var latRev = {
me.L2 = [" OFFSET", nil, "wht"];
me.L6 = [" RETURN", nil, "wht"];
me.R1 = ["FIX INFO ", nil, "wht"];
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
me.R3 = ["[ ]", "NEXT WPT ", "blu"];
me.R4 = ["[ ]", "NEW DEST", "blu"];
me.arrowsMatrix = [[1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0]];

View file

@ -167,6 +167,8 @@ var MCDU_reset = func(i) {
setprop("/FMGC/internal/dest-temp", -999);
setprop("/FMGC/internal/dest-mag", -1);
setprop("/FMGC/internal/dest-wind", -1);
# setprop("/FMGC/internal/dest-mag-grnd", -1);
# setprop("/FMGC/internal/dest-wind-grnd", -1);
setprop("/FMGC/internal/vapp-speed-set", 0);
setprop("/FMGC/internal/final", "");
setprop("/FMGC/internal/baro", 99999);
@ -207,6 +209,12 @@ var lskbutton = func(btn, i) {
initInputIRS("L1",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L1",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(1);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(1);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(1);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGTO") {
progTOInput("L1",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGCLB") {
@ -250,6 +258,12 @@ var lskbutton = func(btn, i) {
} else if (btn == "2") {
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("L2",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(2);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(2);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(2);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
perfTOInput("L2",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
@ -288,6 +302,12 @@ var lskbutton = func(btn, i) {
initInputB("L3",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("L3",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(3);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(3);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(3);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
perfTOInput("L3",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
@ -331,6 +351,12 @@ var lskbutton = func(btn, i) {
initInputB("L4",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("L4",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(4);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(4);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(4);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
perfTOInput("L4",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
@ -359,6 +385,12 @@ var lskbutton = func(btn, i) {
initInputB("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
perfTOInput("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") {
@ -379,12 +411,16 @@ var lskbutton = func(btn, i) {
printInput2("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
dataInput("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA2") {
data2Input("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonLeft(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
canvas_mcdu.myDeparture[i].depPushbuttonLeft(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonLeft(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "VERTREV") {
canvas_mcdu.myVertRev[i].pushButtonLeft(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
canvas_mcdu.myDirTo[i].leftFieldBtn(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
@ -404,6 +440,21 @@ var lskbutton = func(btn, i) {
fuelPredInput("L6",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("L6",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(6);
#} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDHIST") {
# canvas_mcdu.myHISTWIND[i].pushButtonRight(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDHIST") {
if (canvas_mcdu.myCLBWIND[i] == nil) {
canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i);
} else {
canvas_mcdu.myCLBWIND[i].reload();
}
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ROUTESELECTION") {
initInputROUTESEL("L6",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") {
@ -422,7 +473,9 @@ var lskbutton = func(btn, i) {
canvas_mcdu.myFpln[i].pushButtonLeft(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV" or getprop("/MCDU[" ~ i ~ "]/page") == "VERTREV" or getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE" or getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL" or getprop("/MCDU[" ~ i ~ "]/page") == "HOLD") {
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonLeft(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE" or getprop("/MCDU[" ~ i ~ "]/page") == "HOLD") {
if (fmgc.flightPlanController.temporaryFlag[i]) {
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
} else {
@ -446,6 +499,15 @@ var rskbutton = func(btn, i) {
initInputIRS("R1",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("R1",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
if (canvas_mcdu.myHISTWIND[i] == nil) {
canvas_mcdu.myHISTWIND[i] = windHISTPage.new(i);
} else {
canvas_mcdu.myHISTWIND[i].reload();
}
setprop("MCDU[" ~ i ~ "]/page", "WINDHIST");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonRight(1);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
radnavInput("R1",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
@ -473,7 +535,7 @@ var rskbutton = func(btn, i) {
}
canvas_mcdu.myPilotWP[i] = nil;
canvas_mcdu.myPilotWP[i] = pilotWaypointPage.new(i);
setprop("/MCDU[" ~ i ~ "]/page", "PILOTWP");
setprop("/MCDU[" ~ i ~ "]/page", "PILOTWP");
} else {
mcdu_message(i, "NOT ALLOWED"); # todo spawn new waypoints page
}
@ -531,8 +593,48 @@ var rskbutton = func(btn, i) {
mcdu_message(i, "NOT ALLOWED");
}
} else if (btn == "4") {
if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("R4",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("R4",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
if (canvas_mcdu.myCLBWIND[i] == nil) {
canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i);
} else {
canvas_mcdu.myCLBWIND[i].reload();
}
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
if (fmgc.flightPlanController.temporaryFlag[i]) {
if (getprop("/FMGC/internal/tofrom-set") and size(fmgc.windController.nav_indicies[i]) > 0) {
if (canvas_mcdu.myCRZWIND[i] != nil) {
canvas_mcdu.myCRZWIND[i].del();
}
canvas_mcdu.myCRZWIND[i] = nil;
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, fmgc.flightPlanController.flightplans[i].getWP(fmgc.windController.nav_indicies[i][0]), 0);
} else {
if (canvas_mcdu.myCRZWIND[i] == nil) {
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, nil, nil);
} else {
canvas_mcdu.myCRZWIND[i].reload();
}
}
} else {
if (getprop("/FMGC/internal/tofrom-set") and size(fmgc.windController.nav_indicies[2]) > 0) {
if (canvas_mcdu.myCRZWIND[i] != nil) {
canvas_mcdu.myCRZWIND[i].del();
}
canvas_mcdu.myCRZWIND[i] = nil;
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, fmgc.flightPlanController.flightplans[2].getWP(fmgc.windController.nav_indicies[2][0]), 0);
} else {
if (canvas_mcdu.myCRZWIND[i] == nil) {
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, nil, nil);
} else {
canvas_mcdu.myCRZWIND[i].reload();
}
}
}
setprop("MCDU[" ~ i ~ "]/page", "WINDCRZ");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
perfTOInput("R4",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
@ -555,6 +657,44 @@ var rskbutton = func(btn, i) {
initInputA("R5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("R5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
if (fmgc.flightPlanController.temporaryFlag[i]) {
if (getprop("/FMGC/internal/tofrom-set") and size(fmgc.windController.nav_indicies[i]) > 0) {
if (canvas_mcdu.myCRZWIND[i] != nil) {
canvas_mcdu.myCRZWIND[i].del();
}
canvas_mcdu.myCRZWIND[i] = nil;
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, fmgc.flightPlanController.flightplans[i].getWP(fmgc.windController.nav_indicies[i][0]), 0);
} else {
if (canvas_mcdu.myCRZWIND[i] == nil) {
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, nil, nil);
} else {
canvas_mcdu.myCRZWIND[i].reload();
}
}
} else {
if (getprop("/FMGC/internal/tofrom-set") and size(fmgc.windController.nav_indicies[2]) > 0) {
if (canvas_mcdu.myCRZWIND[i] != nil) {
canvas_mcdu.myCRZWIND[i].del();
}
canvas_mcdu.myCRZWIND[i] = nil;
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, fmgc.flightPlanController.flightplans[2].getWP(fmgc.windController.nav_indicies[2][0]), 0);
} else {
if (canvas_mcdu.myCRZWIND[i] == nil) {
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, nil, nil);
} else {
canvas_mcdu.myCRZWIND[i].reload();
}
}
}
setprop("MCDU[" ~ i ~ "]/page", "WINDCRZ");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
if (canvas_mcdu.myDESWIND[i] == nil) {
canvas_mcdu.myDESWIND[i] = windDESPage.new(i, "");
} else {
canvas_mcdu.myDESWIND[i].reload();
}
setprop("MCDU[" ~ i ~ "]/page", "WINDDES");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "STATUS") {
statusInput("R5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
@ -599,6 +739,14 @@ var rskbutton = func(btn, i) {
initInputA("R6",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("R6",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonRight(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonRight(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonRight(6);
#} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDHIST") {
# canvas_mcdu.myHISTWIND[i].pushButtonRight(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
perfTOInput("R6",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") {
@ -695,6 +843,8 @@ var arrowbutton = func(btn, i) {
canvas_mcdu.myDirTo[i].scrollUp();
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("up",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonUp();
}
} else if (btn == "down") {
if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
@ -707,7 +857,9 @@ var arrowbutton = func(btn, i) {
canvas_mcdu.myDirTo[i].scrollDn();
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("down",i);
}
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonDown();
}
}
}

View file

@ -35,12 +35,10 @@ var perfAPPRInput = func(key, i) {
mcdu_scratchpad.scratchpads[i].empty();
} else if (tfs >= 3 and tfs <= 7 and find("/", scratchpad) != -1) {
var weather = split("/", scratchpad);
var mag = int(weather[0]);
var mags = size(weather[0]);
var wind = int(weather[1]);
var winds = size(weather[1]);
if (mags >= 1 and mags <= 3 and winds >= 1 and winds <= 3) {
if (mag != nil and wind != nil and mag >= 0 and mag <= 360 and wind >= 0 and wind <= 200) {
if (num(weather[0]) != nil and num(weather[1]) != nil and int(weather[0]) >= 0 and int(weather[0]) <= 360 and int(weather[1]) >= 0 and int(weather[1]) <= 200) {
setprop("/FMGC/internal/dest-mag", weather[0]);
setprop("/FMGC/internal/dest-wind", weather[1]);
mcdu_scratchpad.scratchpads[i].empty();

View file

@ -4,70 +4,74 @@
var radnavInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor1freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 5 or tfs == 6) {
if (scratchpad >= 108.00 and scratchpad <= 111.95) {
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
mcdu_message(i, "NOT ALLOWED");
} else {
if (!getprop("systems/radio/rmp[0]/nav") and !getprop("systems/radio/rmp[1]/nav")) {
if (key == "L1") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor1freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 5 or tfs == 6) {
if (scratchpad >= 108.00 and scratchpad <= 111.95) {
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
mcdu_message(i, "NOT ALLOWED");
} else {
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
setprop("/FMGC/internal/vor1freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
}
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
setprop("/FMGC/internal/vor1freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
setprop("/FMGC/internal/vor1freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "L2") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor1crs-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 3) {
if (scratchpad >= 0 and scratchpad <= 360) {
setprop("instrumentation/nav[2]/radials/selected-deg", scratchpad);
setprop("/FMGC/internal/vor1crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (key == "L2") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor1crs-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "L3") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/ils1freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 5 or tfs == 6) {
if (scratchpad >= 108.00 and scratchpad <= 111.95) {
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
setprop("instrumentation/nav[0]/frequencies/selected-mhz", scratchpad);
setprop("/FMGC/internal/ils1freq-set", 1);
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 3) {
if (scratchpad >= 0 and scratchpad <= 360) {
setprop("instrumentation/nav[2]/radials/selected-deg", scratchpad);
setprop("/FMGC/internal/vor1crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
if (num(getprop("/FMGC/internal/ils1freq-calculated")) != 0 and num(getprop("/FMGC/internal/ils1freq-calculated")) != num(getprop("instrumentation/nav[0]/frequencies/selected-mhz"))) {
genericMessage(i, "RWY/LS MISMATCH", "amb");
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "L3") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/ils1freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 5 or tfs == 6) {
if (scratchpad >= 108.00 and scratchpad <= 111.95) {
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
setprop("instrumentation/nav[0]/frequencies/selected-mhz", scratchpad);
setprop("/FMGC/internal/ils1freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
if (num(getprop("/FMGC/internal/ils1freq-calculated")) != 0 and num(getprop("/FMGC/internal/ils1freq-calculated")) != num(getprop("instrumentation/nav[0]/frequencies/selected-mhz"))) {
genericMessage(i, "RWY/LS MISMATCH", "amb");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
@ -75,110 +79,110 @@ var radnavInput = func(key, i) {
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "L4") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/ils1crs-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 3) {
if (scratchpad >= 0 and scratchpad <= 360) {
setprop("instrumentation/nav[0]/radials/selected-deg", scratchpad);
setprop("/FMGC/internal/ils1crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (key == "L4") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/ils1crs-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "L5") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/adf1freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 4) {
if (scratchpad >= 190 and scratchpad <= 1750) {
setprop("instrumentation/adf[0]/frequencies/selected-khz", scratchpad);
setprop("/FMGC/internal/adf1freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "R1") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor2freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 5 or tfs == 6) {
if (scratchpad >= 108.10 and scratchpad <= 111.95) {
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
mcdu_message(i, "NOT ALLOWED");
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 3) {
if (scratchpad >= 0 and scratchpad <= 360) {
setprop("instrumentation/nav[0]/radials/selected-deg", scratchpad);
setprop("/FMGC/internal/ils1crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "L5") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/adf1freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 4) {
if (scratchpad >= 190 and scratchpad <= 1750) {
setprop("instrumentation/adf[0]/frequencies/selected-khz", scratchpad);
setprop("/FMGC/internal/adf1freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "R1") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor2freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 5 or tfs == 6) {
if (scratchpad >= 108.10 and scratchpad <= 111.95) {
if (scratchpad == 108.10 or scratchpad == 108.15 or scratchpad == 108.30 or scratchpad == 108.35 or scratchpad == 108.50 or scratchpad == 108.55 or scratchpad == 108.70 or scratchpad == 108.75 or scratchpad == 108.90 or scratchpad == 108.95
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
mcdu_message(i, "NOT ALLOWED");
} else {
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
setprop("/FMGC/internal/vor2freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
}
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
setprop("/FMGC/internal/vor2freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
setprop("/FMGC/internal/vor2freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "R2") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor2crs-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 3) {
if (scratchpad >= 0 and scratchpad <= 360) {
setprop("instrumentation/nav[3]/radials/selected-deg", scratchpad);
setprop("/FMGC/internal/vor2crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else if (key == "R2") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/vor2crs-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs >= 1 and tfs <= 3) {
if (scratchpad >= 0 and scratchpad <= 360) {
setprop("instrumentation/nav[3]/radials/selected-deg", scratchpad);
setprop("/FMGC/internal/vor2crs-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "R5") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/adf2freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 4) {
if (scratchpad >= 190 and scratchpad <= 1750) {
setprop("instrumentation/adf[1]/frequencies/selected-khz", scratchpad);
setprop("/FMGC/internal/adf2freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else if (key == "R5") {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/adf2freq-set", 0);
mcdu_scratchpad.scratchpads[i].empty();
} else {
var tfs = size(scratchpad);
if (tfs == 3 or tfs == 4) {
if (scratchpad >= 190 and scratchpad <= 1750) {
setprop("instrumentation/adf[1]/frequencies/selected-khz", scratchpad);
setprop("/FMGC/internal/adf2freq-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}

View file

@ -20,12 +20,14 @@ var vertRev = {
arrAirport: nil,
index: nil,
computer: nil,
new: func(type, id, index, computer) {
new: func(type, id, index, computer, wp, plan) {
var vr = {parents:[vertRev]};
vr.type = type; # 0 = origin 1 = destination 2 = wpt not ppos 3 = ppos 4 = cruise wpt 5 = climb wpt (3 + 4 not needed yet)
vr.id = id;
vr.index = index;
vr.computer = computer;
vr.wp = wp;
vr.plan = plan;
vr._setupPageWithData();
vr._checkTmpy();
return vr;
@ -53,7 +55,7 @@ var vertRev = {
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
} if (me.type == 2) {
} elsif (me.type == 2) {
me.title = ["VERT REV", " AT ", me.id];
me.L1 = ["", " EFOB ---.-", "wht"];
me.R1 = ["", "EXTRA ---.- ", "wht"];
@ -132,6 +134,52 @@ var vertRev = {
me.arrowsMatrix[1][4] = 0;
}
},
pushButtonLeft: func(index) {
if (index == 5) {
#print("role: ", me.wp.wp_role, ", type: ", me.wp.wp_type);
if (me.wp.wp_role == "sid") {
if (canvas_mcdu.myCLBWIND[me.computer] == nil) {
canvas_mcdu.myCLBWIND[me.computer] = windCLBPage.new(me.computer);
} else {
canvas_mcdu.myCLBWIND[me.computer].reload();
}
fmgc.windController.accessPage[me.computer] = "VERTREV";
setprop("MCDU[" ~ me.computer ~ "]/page", "WINDCLB");
} else if (me.wp.wp_role == "star" or me.wp.wp_role == "approach" or me.wp.wp_role == "missed") {
if (canvas_mcdu.myDESWIND[me.computer] == nil) {
canvas_mcdu.myDESWIND[me.computer] = windDESPage.new(me.computer);
} else {
canvas_mcdu.myDESWIND[me.computer].reload();
}
fmgc.windController.accessPage[me.computer] = "VERTREV";
setprop("MCDU[" ~ me.computer ~ "]/page", "WINDDES");
} else if (me.wp.wp_role == nil and me.wp.wp_type == "navaid") {
if (canvas_mcdu.myCRZWIND[me.computer] == nil) {
cur_location = 0;
for (i = 0; i < size(fmgc.windController.nav_indicies[me.plan]); i += 1) {
if (fmgc.windController.nav_indicies[me.plan][i] == me.index) {
cur_location = i;
}
}
canvas_mcdu.myCRZWIND[me.computer] = windCRZPage.new(me.computer, me.wp, cur_location);
} else {
canvas_mcdu.myCRZWIND[me.computer].reload();
}
fmgc.windController.accessPage[me.computer] = "VERTREV";
setprop("MCDU[" ~ me.computer ~ "]/page", "WINDCRZ");
} else {
if (canvas_mcdu.myCRZWIND[me.computer] == nil) {
canvas_mcdu.myCRZWIND[me.computer] = windCRZPage.new(me.computer, nil, 0);
} else {
canvas_mcdu.myCRZWIND[me.computer].reload();
}
fmgc.windController.accessPage[me.computer] = "VERTREV";
setprop("MCDU[" ~ me.computer ~ "]/page", "WINDCRZ");
}
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
},
};
setlistener("FMGC/internal/cruise-lvl-set", func() {

313
Nasal/MCDU/WINDCLB.nas Normal file
View file

@ -0,0 +1,313 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var windCLBPage = {
title: nil,
titleColour: "wht",
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
L1: [nil, nil, "ack"], # content, title, colour
L2: [nil, nil, "ack"],
L3: [nil, nil, "ack"],
L4: [nil, nil, "ack"],
L5: [nil, nil, "ack"],
L6: [nil, nil, "ack"],
C1: [nil, nil, "ack"],
C2: [nil, nil, "ack"],
C3: [nil, nil, "ack"],
C4: [nil, nil, "ack"],
C5: [nil, nil, "ack"],
C6: [nil, nil, "ack"],
R1: [nil, nil, "ack"],
R2: [nil, nil, "ack"],
R3: [nil, nil, "ack"],
R4: [nil, nil, "ack"],
R5: [nil, nil, "ack"],
R6: [nil, nil, "ack"],
scroll: 0,
vector: [],
index: nil,
computer: nil,
items: 0,
new: func(computer) {
var wcp = {parents:[windCLBPage]};
wcp.computer = computer;
wcp._setupPageWithData();
wcp.updateTmpy();
return wcp;
},
del: func() {
return nil;
},
_setupPageWithData: func() {
me.title = "CLIMB WIND";
me.titleColour = "wht";
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 1, 0]];
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "ack"], ["wht", "ack", "ack", "ack", "wht", "ack"]];
me.fontMatrix = [[1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]];
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
#debug.dump(fmgc.windController.clb_winds[0]);
#debug.dump(fmgc.windController.clb_winds[1]);
#debug.dump(fmgc.windController.clb_winds[2]);
if (fmgc.windController.clb_winds[computer_temp] == 0 or fmgc.windController.clb_winds[computer_temp].wind1.altitude == "") {
me.items = 1;
} else if (fmgc.windController.clb_winds[computer_temp].wind2.altitude == "") {
me.items = 2;
} else if (fmgc.windController.clb_winds[computer_temp].wind3.altitude == "") {
me.items = 3;
} else if (fmgc.windController.clb_winds[computer_temp].wind4.altitude == "") {
me.items = 4;
} else {
me.items = 5;
}
if (me.items >= 5) {
var windStore = fmgc.windController.clb_winds[computer_temp].wind5;
if (windStore.altitude != "") {
me.L5 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][4] = 1;
} else {
me.L5 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][4] = 1;
}
} else {
me.L5 = [nil, nil, "ack"];
}
if (me.items >= 4) {
var windStore = fmgc.windController.clb_winds[computer_temp].wind4;
if (windStore.altitude != "") {
me.L4 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][3] = 1;
} else {
me.L4 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][3] = 1;
}
} else {
me.L4 = [nil, nil, "ack"];
}
if (me.items >= 3) {
var windStore = fmgc.windController.clb_winds[computer_temp].wind3;
if (windStore.altitude != "") {
me.L3 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][2] = 1;
}
} else {
me.L3 = [nil, nil, "ack"];
}
if (me.items >= 2) {
var windStore = fmgc.windController.clb_winds[computer_temp].wind2;
if (windStore.altitude != "") {
me.L2 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][1] = 1;
} else {
me.L2 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][1] = 1;
}
} else {
me.L2 = [nil, nil, "ack"];
}
if (me.items >= 1) {
var windStore = fmgc.windController.clb_winds[computer_temp].wind1;
if (windStore.altitude != "") {
me.L1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
} else {
me.L1 = ["[ ]/[ ]/[ ]", "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
}
}
me.L6 = [" RETURN", nil, "wht"];
me.R1 = [" HISTORY ", "WIND ", "wht"];
me.R3 = [" REQUEST ", "WIND ", "amb"];
me.R5 = [" PHASE ", "NEXT ", "wht"];
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
makeTmpy: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
}
},
updateTmpy: func() {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.L1[2] = "yel";
me.L2[2] = "yel";
me.L3[2] = "yel";
me.L4[2] = "yel";
me.L5[2] = "yel";
me.L6 = [" CANCEL", " WIND", "amb"];
me.R6 = ["UPDATE ", "WIND ", "amb"];
me.arrowsMatrix[0][5] = 0;
me.title = "DRAFT CLIMB WIND";
me.titleColour = "yel";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} else {
me.L1[2] = "blu";
me.L2[2] = "blu";
me.L3[2] = "blu";
me.L4[2] = "blu";
me.L5[2] = "blu";
me.L6 = [" RETURN", nil, "wht"];
me.R6 = [nil, nil, "ack"];
me.arrowsMatrix[0][5] = 1;
me.title = "CLIMB WIND";
me.titleColour = "wht";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}
},
reload: func() {
me._setupPageWithData();
me.updateTmpy();
},
pushButtonLeft: func(index) {
if (index == 6 and fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (canvas_mcdu.myFpln[me.computer] != nil) {
canvas_mcdu.myFpln[me.computer].pushButtonLeft(index);
} else {
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
# push update to fuel
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
}
}
me.reload();
} else if (index == 6) {
setprop("/MCDU[" ~ me.computer ~ "]/page", fmgc.windController.accessPage[me.computer]);
} else if (me.items >= index) {
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) >= 5 and size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) <= 13) {
var winds = split("/", mcdu_scratchpad.scratchpads[me.computer].scratchpad);
if (size(winds[0]) >= 1 and size(winds[0]) <= 3 and num(winds[0]) != nil and winds[0] >= 0 and winds[0] <= 360 and
size(winds[1]) >= 1 and size(winds[1]) <= 3 and num(winds[1]) != nil and winds[1] >= 0 and winds[1] <= 200 and
size(winds[2]) >= 4 and size(winds[2]) <= 5 and ((num(winds[2]) != nil and winds[2] >= 1000 and winds[2] <= 39000) or
(num(split("FL", winds[2])[1]) != nil and split("FL", winds[2])[1] >= 10 and split("FL", winds[2])[1] <= 390))) {
me.makeTmpy();
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
#print(computer_temp);
if (index == 5) {
fmgc.windController.clb_winds[computer_temp].wind5.heading = winds[0];
fmgc.windController.clb_winds[computer_temp].wind5.magnitude = winds[1];
fmgc.windController.clb_winds[computer_temp].wind5.altitude = winds[2];
} else if (index == 4) {
fmgc.windController.clb_winds[computer_temp].wind4.heading = winds[0];
fmgc.windController.clb_winds[computer_temp].wind4.magnitude = winds[1];
fmgc.windController.clb_winds[computer_temp].wind4.altitude = winds[2];
} else if (index == 3) {
fmgc.windController.clb_winds[computer_temp].wind3.heading = winds[0];
fmgc.windController.clb_winds[computer_temp].wind3.magnitude = winds[1];
fmgc.windController.clb_winds[computer_temp].wind3.altitude = winds[2];
} else if (index == 2) {
fmgc.windController.clb_winds[computer_temp].wind2.heading = winds[0];
fmgc.windController.clb_winds[computer_temp].wind2.magnitude = winds[1];
fmgc.windController.clb_winds[computer_temp].wind2.altitude = winds[2];
} else if (index == 1) {
fmgc.windController.clb_winds[computer_temp].wind1.heading = winds[0];
fmgc.windController.clb_winds[computer_temp].wind1.magnitude = winds[1];
fmgc.windController.clb_winds[computer_temp].wind1.altitude = winds[2];
}
mcdu_scratchpad.scratchpads[me.computer].empty();
if (me.items == index and index != 5) {
me.items += 1;
}
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else if (mcdu_scratchpad.scratchpads[me.computer].scratchpad == "CLR") {
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
if (me.items == index) {
if (index == 5) {
fmgc.windController.clb_winds[computer_temp].wind5.heading = 0;
fmgc.windController.clb_winds[computer_temp].wind5.magnitude = 0;
fmgc.windController.clb_winds[computer_temp].wind5.altitude = "";
} else if (index == 4) {
fmgc.windController.clb_winds[computer_temp].wind4.heading = 0;
fmgc.windController.clb_winds[computer_temp].wind4.magnitude = 0;
fmgc.windController.clb_winds[computer_temp].wind4.altitude = "";
} else if (index == 3) {
fmgc.windController.clb_winds[computer_temp].wind3.heading = 0;
fmgc.windController.clb_winds[computer_temp].wind3.magnitude = 0;
fmgc.windController.clb_winds[computer_temp].wind3.altitude = "";
} else if (index == 2) {
fmgc.windController.clb_winds[computer_temp].wind2.heading = 0;
fmgc.windController.clb_winds[computer_temp].wind2.magnitude = 0;
fmgc.windController.clb_winds[computer_temp].wind2.altitude = "";
} else if (index == 1) {
fmgc.windController.clb_winds[computer_temp].wind1.heading = 0;
fmgc.windController.clb_winds[computer_temp].wind1.magnitude = 0;
fmgc.windController.clb_winds[computer_temp].wind1.altitude = "";
}
} else {
if (index <= 1) {
fmgc.windController.clb_winds[computer_temp].wind1.heading = fmgc.windController.clb_winds[computer_temp].wind2.heading;
fmgc.windController.clb_winds[computer_temp].wind1.magnitude = fmgc.windController.clb_winds[computer_temp].wind2.magnitude;
fmgc.windController.clb_winds[computer_temp].wind1.altitude = fmgc.windController.clb_winds[computer_temp].wind2.altitude;
}
if (index <= 2) {
fmgc.windController.clb_winds[computer_temp].wind2.heading = fmgc.windController.clb_winds[computer_temp].wind3.heading;
fmgc.windController.clb_winds[computer_temp].wind2.magnitude = fmgc.windController.clb_winds[computer_temp].wind3.magnitude;
fmgc.windController.clb_winds[computer_temp].wind2.altitude = fmgc.windController.clb_winds[computer_temp].wind3.altitude;
}
if (index <= 3) {
fmgc.windController.clb_winds[computer_temp].wind3.heading = fmgc.windController.clb_winds[computer_temp].wind4.heading;
fmgc.windController.clb_winds[computer_temp].wind3.magnitude = fmgc.windController.clb_winds[computer_temp].wind4.magnitude;
fmgc.windController.clb_winds[computer_temp].wind3.altitude = fmgc.windController.clb_winds[computer_temp].wind4.altitude;
}
if (index <= 4) {
fmgc.windController.clb_winds[computer_temp].wind4.heading = fmgc.windController.clb_winds[computer_temp].wind5.heading;
fmgc.windController.clb_winds[computer_temp].wind4.magnitude = fmgc.windController.clb_winds[computer_temp].wind5.magnitude;
fmgc.windController.clb_winds[computer_temp].wind4.altitude = fmgc.windController.clb_winds[computer_temp].wind5.altitude;
}
}
mcdu_scratchpad.scratchpads[me.computer].empty();
me.items -= 1;
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
},
pushButtonRight: func(index) {
if (index == 6 and fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (canvas_mcdu.myFpln[me.computer] != nil) {
canvas_mcdu.myFpln[me.computer].pushButtonRight(index);
} else {
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
# push update to fuel
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
}
}
me.reload();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
}
};

521
Nasal/MCDU/WINDCRZ.nas Normal file
View file

@ -0,0 +1,521 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var windCRZPage = {
title: [nil, nil, nil],
titleColour: "wht",
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
L1: [nil, nil, "ack"], # content, title, colour
L2: [nil, nil, "ack"],
L3: [nil, nil, "ack"],
L4: [nil, nil, "ack"],
L5: [nil, nil, "ack"],
L6: [nil, nil, "ack"],
C1: [nil, nil, "ack"],
C2: [nil, nil, "ack"],
C3: [nil, nil, "ack"],
C4: [nil, nil, "ack"],
C5: [nil, nil, "ack"],
C6: [nil, nil, "ack"],
R1: [nil, nil, "ack"],
R2: [nil, nil, "ack"],
R3: [nil, nil, "ack"],
R4: [nil, nil, "ack"],
R5: [nil, nil, "ack"],
R6: [nil, nil, "ack"],
scroll: 0,
vector: [],
index: nil,
computer: nil,
cur_location: 0,
match_location: 0,
items: 0,
singleCRZ: 0,
new: func(computer, waypoint, cur_location) {
var wcp = {parents:[windCRZPage]};
wcp.computer = computer;
wcp.waypoint = waypoint;
wcp.cur_location = cur_location;
if (waypoint == nil) {
wcp.singleCRZ = 1;
}
wcp._setupPageWithData();
wcp.updateTmpy();
return wcp;
},
del: func() {
return nil;
},
_setupPageWithData: func() {
if (me.singleCRZ == 1) {
me.title = ["","CRZ WIND",""];
} else {
me.title = ["CRZ WIND", " AT ", me.waypoint.wp_name];
}
me.titleColour = "wht";
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 1, 0]];
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["ack", "ack", "ack", "wht", "wht", "ack"]];
me.fontMatrix = [[1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]];
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
#debug.dump(fmgc.windController.crz_winds[0]);
#debug.dump(fmgc.windController.crz_winds[1]);
#debug.dump(fmgc.windController.crz_winds[2]);
if (me.singleCRZ == 1) {
if (fmgc.windController.crz_winds[computer_temp] == 0 or fmgc.windController.crz_winds[computer_temp].wind1.altitude == "") {
me.items = 1;
} else if (fmgc.windController.crz_winds[computer_temp].wind2.altitude == "") {
me.items = 2;
} else if (fmgc.windController.crz_winds[computer_temp].wind3.altitude == "") {
me.items = 3;
} else {
me.items = 4;
}
} else {
me.match_location = fmgc.windController.nav_indicies[computer_temp][me.cur_location];
if (size(fmgc.windController.winds[computer_temp]) == 0 or fmgc.windController.winds[computer_temp][me.match_location].wind1.altitude == "") {
me.items = 1;
} else if (fmgc.windController.winds[computer_temp][me.match_location].wind2.altitude == "") {
me.items = 2;
} else if (fmgc.windController.winds[computer_temp][me.match_location].wind3.altitude == "") {
me.items = 3;
} else {
me.items = 4;
}
}
# load data
if (me.singleCRZ == 1) {
if (me.items >= 4) {
var windStore = fmgc.windController.crz_winds[computer_temp].wind4;
if (windStore.altitude != "") {
me.L4 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][3] = 1;
} else {
me.L4 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][3] = 1;
}
} else {
me.L4 = [nil, nil, "ack"];
}
if (me.items >= 3) {
var windStore = fmgc.windController.crz_winds[computer_temp].wind3;
if (windStore.altitude != "") {
me.L3 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][2] = 1;
}
} else {
me.L3 = [nil, nil, "ack"];
}
if (me.items >= 2) {
var windStore = fmgc.windController.crz_winds[computer_temp].wind2;
if (windStore.altitude != "") {
me.L2 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][1] = 1;
} else {
me.L2 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][1] = 1;
}
} else {
me.L2 = [nil, nil, "ack"];
}
if (me.items >= 1) {
var windStore = fmgc.windController.crz_winds[computer_temp].wind1;
if (windStore.altitude != "") {
me.L1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
} else {
me.L1 = ["[ ]/[ ]/[ ]", "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
}
}
var windStore = fmgc.windController.crz_winds[computer_temp].sat1;
if (windStore.altitude != "") {
me.L5 = [windStore.temp ~ "/" ~ windStore.altitude, "SAT / ALT", "blu"];
me.fontMatrix[0][4] = 1;
} else {
me.L5 = ["[ ]/[ ]", "SAT / ALT", "blu"];
me.fontMatrix[0][4] = 1;
}
} else {
if (me.items >= 4) {
var windStore = fmgc.windController.winds[computer_temp][me.match_location].wind4;
if (windStore.altitude != "") {
me.L4 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][3] = 1;
} else {
me.L4 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][3] = 1;
}
} else {
me.L4 = [nil, nil, "ack"];
}
if (me.items >= 3) {
var windStore = fmgc.windController.winds[computer_temp][me.match_location].wind3;
if (windStore.altitude != "") {
me.L3 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][2] = 1;
}
} else {
me.L3 = [nil, nil, "ack"];
}
if (me.items >= 2) {
var windStore = fmgc.windController.winds[computer_temp][me.match_location].wind2;
if (windStore.altitude != "") {
me.L2 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][1] = 1;
} else {
me.L2 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][1] = 1;
}
} else {
me.L2 = [nil, nil, "ack"];
}
if (me.items >= 1) {
var windStore = fmgc.windController.winds[computer_temp][me.match_location].wind1;
if (windStore.altitude != "") {
me.L1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
} else {
me.L1 = ["[ ]/[ ]/[ ]", "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
}
}
var windStore = fmgc.windController.winds[computer_temp][me.match_location].sat1;
if (windStore.altitude != "") {
me.L5 = [windStore.temp ~ "/" ~ windStore.altitude, "SAT / ALT", "blu"];
me.fontMatrix[0][4] = 1;
} else {
me.L5 = ["[ ]/[ ]", "SAT / ALT", "blu"];
me.fontMatrix[0][4] = 1;
}
}
me.L6 = [" RETURN", nil, "wht"];
me.R2 = [" REQUEST ", "WIND ", "amb"];
me.R4 = [" PHASE ", "PREV ", "wht"];
me.R5 = [" PHASE ", "NEXT ", "wht"];
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
makeTmpy: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
}
},
updateTmpy: func() {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.L1[2] = "yel";
me.L2[2] = "yel";
me.L3[2] = "yel";
me.L4[2] = "yel";
me.L5[2] = "yel";
me.L6 = [" CANCEL", "UPDATE", "amb"];
me.R6 = ["INSERT ", "UPDATE ", "amb"];
me.arrowsMatrix[0][5] = 0;
if (me.singleCRZ == 1) {
me.title = ["","DRAFT CRZ WIND",""];
} else {
me.title = ["DRAFT CRZ WIND", " AT ", me.waypoint.wp_name];
}
me.titleColour = "yel";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} else {
me.L1[2] = "blu";
me.L2[2] = "blu";
me.L3[2] = "blu";
me.L4[2] = "blu";
me.L5[2] = "blu";
me.L6 = [" RETURN", nil, "wht"];
me.R6 = [nil, nil, "ack"];
me.arrowsMatrix[0][5] = 1;
if (me.singleCRZ == 1) {
me.title = ["","CRZ WIND",""];
} else {
me.title = ["CRZ WIND", " AT ", me.waypoint.wp_name];
}
me.titleColour = "wht";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}
},
reload: func() {
me._setupPageWithData();
me.updateTmpy();
},
pushButtonLeft: func(index) {
if (index == 6 and fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (canvas_mcdu.myFpln[me.computer] != nil) {
canvas_mcdu.myFpln[me.computer].pushButtonLeft(index);
} else {
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
# push update to fuel
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
}
}
me.reload();
} else if (index == 6) {
setprop("/MCDU[" ~ me.computer ~ "]/page", fmgc.windController.accessPage[me.computer]);
} else if (index == 5) {
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) >= 6 and size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) <= 9) {
var winds = split("/", mcdu_scratchpad.scratchpads[me.computer].scratchpad);
if (size(winds[0]) >= 1 and size(winds[0]) <= 3 and num(winds[0]) != nil and winds[0] >= -99 and winds[0] <= 99 and
size(winds[1]) >= 4 and size(winds[1]) <= 5 and ((num(winds[1]) != nil and winds[1] >= 1000 and winds[1] <= 39000) or
(num(split("FL", winds[1])[1]) != nil and split("FL", winds[1])[1] >= 10 and split("FL", winds[1])[1] <= 390))) {
me.makeTmpy();
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
#print(computer_temp);
if (me.singleCRZ == 1) {
fmgc.windController.crz_winds[computer_temp].sat1.temp = winds[0];
fmgc.windController.crz_winds[computer_temp].sat1.altitude = winds[1];
} else {
fmgc.windController.winds[computer_temp][me.match_location].sat1.temp = winds[0];
fmgc.windController.winds[computer_temp][me.match_location].sat1.altitude = winds[1];
}
mcdu_scratchpad.scratchpads[me.computer].empty();
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else if (mcdu_scratchpad.scratchpads[me.computer].scratchpad == "CLR") {
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
#print(computer_temp);
if (me.singleCRZ == 1) {
fmgc.windController.crz_winds[computer_temp].sat1.temp = 0;
fmgc.windController.crz_winds[computer_temp].sat1.altitude = "";
} else {
fmgc.windController.winds[computer_temp][me.match_location].sat1.temp = 0;
fmgc.windController.winds[computer_temp][me.match_location].sat1.altitude = "";
}
mcdu_scratchpad.scratchpads[me.computer].empty();
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else if (me.items >= index) {
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) >= 5 and size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) <= 13) {
var winds = split("/", mcdu_scratchpad.scratchpads[me.computer].scratchpad);
if (size(winds[0]) >= 1 and size(winds[0]) <= 3 and num(winds[0]) != nil and winds[0] >= 0 and winds[0] <= 360 and
size(winds[1]) >= 1 and size(winds[1]) <= 3 and num(winds[1]) != nil and winds[1] >= 0 and winds[1] <= 200 and
size(winds[2]) >= 4 and size(winds[2]) <= 5 and ((num(winds[2]) != nil and winds[2] >= 1000 and winds[2] <= 39000) or
(num(split("FL", winds[2])[1]) != nil and split("FL", winds[2])[1] >= 10 and split("FL", winds[2])[1] <= 390))) {
me.makeTmpy();
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
#print(computer_temp);
if (me.singleCRZ == 1) {
if (index == 4) {
fmgc.windController.crz_winds[computer_temp].wind4.heading = winds[0];
fmgc.windController.crz_winds[computer_temp].wind4.magnitude = winds[1];
fmgc.windController.crz_winds[computer_temp].wind4.altitude = winds[2];
} else if (index == 3) {
fmgc.windController.crz_winds[computer_temp].wind3.heading = winds[0];
fmgc.windController.crz_winds[computer_temp].wind3.magnitude = winds[1];
fmgc.windController.crz_winds[computer_temp].wind3.altitude = winds[2];
} else if (index == 2) {
fmgc.windController.crz_winds[computer_temp].wind2.heading = winds[0];
fmgc.windController.crz_winds[computer_temp].wind2.magnitude = winds[1];
fmgc.windController.crz_winds[computer_temp].wind2.altitude = winds[2];
} else if (index == 1) {
fmgc.windController.crz_winds[computer_temp].wind1.heading = winds[0];
fmgc.windController.crz_winds[computer_temp].wind1.magnitude = winds[1];
fmgc.windController.crz_winds[computer_temp].wind1.altitude = winds[2];
}
} else {
if (index == 4) {
fmgc.windController.winds[computer_temp][me.match_location].wind4.heading = winds[0];
fmgc.windController.winds[computer_temp][me.match_location].wind4.magnitude = winds[1];
fmgc.windController.winds[computer_temp][me.match_location].wind4.altitude = winds[2];
} else if (index == 3) {
fmgc.windController.winds[computer_temp][me.match_location].wind3.heading = winds[0];
fmgc.windController.winds[computer_temp][me.match_location].wind3.magnitude = winds[1];
fmgc.windController.winds[computer_temp][me.match_location].wind3.altitude = winds[2];
} else if (index == 2) {
fmgc.windController.winds[computer_temp][me.match_location].wind2.heading = winds[0];
fmgc.windController.winds[computer_temp][me.match_location].wind2.magnitude = winds[1];
fmgc.windController.winds[computer_temp][me.match_location].wind2.altitude = winds[2];
} else if (index == 1) {
fmgc.windController.winds[computer_temp][me.match_location].wind1.heading = winds[0];
fmgc.windController.winds[computer_temp][me.match_location].wind1.magnitude = winds[1];
fmgc.windController.winds[computer_temp][me.match_location].wind1.altitude = winds[2];
}
}
mcdu_scratchpad.scratchpads[me.computer].empty();
if (me.items == index and index != 4) {
me.items += 1;
}
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else if (mcdu_scratchpad.scratchpads[me.computer].scratchpad == "CLR") {
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
#print(computer_temp);
if (me.singleCRZ == 1) {
if (me.items == index) {
if (index == 4) {
fmgc.windController.crz_winds[computer_temp].wind4.heading = 0;
fmgc.windController.crz_winds[computer_temp].wind4.magnitude = 0;
fmgc.windController.crz_winds[computer_temp].wind4.altitude = "";
} else if (index == 3) {
fmgc.windController.crz_winds[computer_temp].wind3.heading = 0;
fmgc.windController.crz_winds[computer_temp].wind3.magnitude = 0;
fmgc.windController.crz_winds[computer_temp].wind3.altitude = "";
} else if (index == 2) {
fmgc.windController.crz_winds[computer_temp].wind2.heading = 0;
fmgc.windController.crz_winds[computer_temp].wind2.magnitude = 0;
fmgc.windController.crz_winds[computer_temp].wind2.altitude = "";
} else if (index == 1) {
fmgc.windController.crz_winds[computer_temp].wind1.heading = 0;
fmgc.windController.crz_winds[computer_temp].wind1.magnitude = 0;
fmgc.windController.crz_winds[computer_temp].wind1.altitude = "";
}
} else {
if (index <= 1) {
fmgc.windController.crz_winds[computer_temp].wind1.heading = fmgc.windController.crz_winds[computer_temp].wind2.heading;
fmgc.windController.crz_winds[computer_temp].wind1.magnitude = fmgc.windController.crz_winds[computer_temp].wind2.magnitude;
fmgc.windController.crz_winds[computer_temp].wind1.altitude = fmgc.windController.crz_winds[computer_temp].wind2.altitude;
}
if (index <= 2) {
fmgc.windController.crz_winds[computer_temp].wind2.heading = fmgc.windController.crz_winds[computer_temp].wind3.heading;
fmgc.windController.crz_winds[computer_temp].wind2.magnitude = fmgc.windController.crz_winds[computer_temp].wind3.magnitude;
fmgc.windController.crz_winds[computer_temp].wind2.altitude = fmgc.windController.crz_winds[computer_temp].wind3.altitude;
}
if (index <= 3) {
fmgc.windController.crz_winds[computer_temp].wind3.heading = fmgc.windController.crz_winds[computer_temp].wind4.heading;
fmgc.windController.crz_winds[computer_temp].wind3.magnitude = fmgc.windController.crz_winds[computer_temp].wind4.magnitude;
fmgc.windController.crz_winds[computer_temp].wind3.altitude = fmgc.windController.crz_winds[computer_temp].wind4.altitude;
}
}
} else {
if (me.items == index) {
if (index == 4) {
fmgc.windController.winds[computer_temp][me.match_location].wind4.heading = 0;
fmgc.windController.winds[computer_temp][me.match_location].wind4.magnitude = 0;
fmgc.windController.winds[computer_temp][me.match_location].wind4.altitude = "";
} else if (index == 3) {
fmgc.windController.winds[computer_temp][me.match_location].wind3.heading = 0;
fmgc.windController.winds[computer_temp][me.match_location].wind3.magnitude = 0;
fmgc.windController.winds[computer_temp][me.match_location].wind3.altitude = "";
} else if (index == 2) {
fmgc.windController.winds[computer_temp][me.match_location].wind2.heading = 0;
fmgc.windController.winds[computer_temp][me.match_location].wind2.magnitude = 0;
fmgc.windController.winds[computer_temp][me.match_location].wind2.altitude = "";
} else if (index == 1) {
fmgc.windController.winds[computer_temp][me.match_location].wind1.heading = 0;
fmgc.windController.winds[computer_temp][me.match_location].wind1.magnitude = 0;
fmgc.windController.winds[computer_temp][me.match_location].wind1.altitude = "";
}
} else {
if (index <= 1) {
fmgc.windController.winds[computer_temp][me.match_location].wind1.heading = fmgc.windController.winds[computer_temp][me.match_location].wind2.heading;
fmgc.windController.winds[computer_temp][me.match_location].wind1.magnitude = fmgc.windController.winds[computer_temp][me.match_location].wind2.magnitude;
fmgc.windController.winds[computer_temp][me.match_location].wind1.altitude = fmgc.windController.winds[computer_temp][me.match_location].wind2.altitude;
}
if (index <= 2) {
fmgc.windController.winds[computer_temp][me.match_location].wind2.heading = fmgc.windController.winds[computer_temp][me.match_location].wind3.heading;
fmgc.windController.winds[computer_temp][me.match_location].wind2.magnitude = fmgc.windController.winds[computer_temp][me.match_location].wind3.magnitude;
fmgc.windController.winds[computer_temp][me.match_location].wind2.altitude = fmgc.windController.winds[computer_temp][me.match_location].wind3.altitude;
}
if (index <= 3) {
fmgc.windController.winds[computer_temp][me.match_location].wind3.heading = fmgc.windController.winds[computer_temp][me.match_location].wind4.heading;
fmgc.windController.winds[computer_temp][me.match_location].wind3.magnitude = fmgc.windController.winds[computer_temp][me.match_location].wind4.magnitude;
fmgc.windController.winds[computer_temp][me.match_location].wind3.altitude = fmgc.windController.winds[computer_temp][me.match_location].wind4.altitude;
}
}
}
mcdu_scratchpad.scratchpads[me.computer].empty();
me.items -= 1;
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
},
pushButtonRight: func(index) {
if (index == 6 and fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (canvas_mcdu.myFpln[me.computer] != nil) {
canvas_mcdu.myFpln[me.computer].pushButtonRight(index);
} else {
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
# push update to fuel
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
}
}
me.reload();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
},
pushButtonUp: func() {
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
if (me.cur_location < size(fmgc.windController.nav_indicies[computer_temp]) - 1) {
me.cur_location = me.cur_location + 1;
} else {
me.cur_location = 0;
}
me.match_location = fmgc.windController.nav_indicies[computer_temp][me.cur_location];
me.waypoint = fmgc.flightPlanController.flightplans[computer_temp].getWP(me.match_location);
me.reload();
},
pushButtonDown: func() {
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
if (me.cur_location > 0) {
me.cur_location = me.cur_location - 1;
} else {
me.cur_location = size(fmgc.windController.nav_indicies[computer_temp]) - 1;
}
me.match_location = fmgc.windController.nav_indicies[computer_temp][me.cur_location];
me.waypoint = fmgc.flightPlanController.flightplans[computer_temp].getWP(me.match_location);
me.reload();
}
};

365
Nasal/MCDU/WINDDES.nas Normal file
View file

@ -0,0 +1,365 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var windDESPage = {
title: nil,
titleColour: "wht",
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
L1: [nil, nil, "ack"], # content, title, colour
L2: [nil, nil, "ack"],
L3: [nil, nil, "ack"],
L4: [nil, nil, "ack"],
L5: [nil, nil, "ack"],
L6: [nil, nil, "ack"],
C1: [nil, nil, "ack"],
C2: [nil, nil, "ack"],
C3: [nil, nil, "ack"],
C4: [nil, nil, "ack"],
C5: [nil, nil, "ack"],
C6: [nil, nil, "ack"],
R1: [nil, nil, "ack"],
R2: [nil, nil, "ack"],
R3: [nil, nil, "ack"],
R4: [nil, nil, "ack"],
R5: [nil, nil, "ack"],
R6: [nil, nil, "ack"],
scroll: 0,
vector: [],
index: nil,
computer: nil,
items: 0,
new: func(computer) {
var wdp = {parents:[windDESPage]};
wdp.computer = computer;
wdp._setupPageWithData();
wdp.updateTmpy();
return wdp;
},
del: func() {
return nil;
},
_setupPageWithData: func() {
me.title = "DES WIND";
#me.title = ["DES WIND", " AT ", me.waypoint.wp_name];
me.titleColour = "wht";
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0]];
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["ack", "ack", "ack", "wht", "ack", "ack"]];
me.fontMatrix = [[1, 1, 1, 1, 1, 0], [1, 0, 0, 0, 0, 0]];
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
# debug.dump(fmgc.windController.des_winds[0]);
# debug.dump(fmgc.windController.des_winds[1]);
# debug.dump(fmgc.windController.des_winds[2]);
if (fmgc.windController.des_winds[computer_temp] == 0 or fmgc.windController.des_winds[computer_temp].wind1.altitude == "") {
me.items = 1;
} else if (fmgc.windController.des_winds[computer_temp].wind2.altitude == "") {
me.items = 2;
} else if (fmgc.windController.des_winds[computer_temp].wind3.altitude == "") {
me.items = 3;
} else if (fmgc.windController.des_winds[computer_temp].wind4.altitude == "") {
me.items = 4;
} else {
me.items = 5;
}
if (me.items >= 5) {
var windStore = fmgc.windController.des_winds[computer_temp].wind5;
if (windStore.altitude != "") {
me.L5 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][4] = 1;
} else {
me.L5 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][4] = 1;
}
} else {
me.L5 = [nil, nil, "ack"];
}
if (me.items >= 4) {
var windStore = fmgc.windController.des_winds[computer_temp].wind4;
if (windStore.altitude != "") {
me.L4 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][3] = 1;
} else {
me.L4 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][3] = 1;
}
} else {
me.L4 = [nil, nil, "ack"];
}
if (me.items >= 3) {
var windStore = fmgc.windController.des_winds[computer_temp].wind3;
if (windStore.altitude != "") {
me.L3 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][2] = 1;
}
} else {
me.L3 = [nil, nil, "ack"];
}
if (me.items >= 2) {
var windStore = fmgc.windController.des_winds[computer_temp].wind2;
if (windStore.altitude != "") {
me.L2 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][1] = 1;
} else {
me.L2 = ["[ ]/[ ]/[ ]", nil, "blu"];
me.fontMatrix[0][1] = 1;
}
} else {
me.L2 = [nil, nil, "ack"];
}
if (me.items >= 1) {
var windStore = fmgc.windController.des_winds[computer_temp].wind1;
if (windStore.altitude != "") {
me.L1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
} else {
me.L1 = ["[ ]/[ ]/[ ]", "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
}
}
me.L6 = [" RETURN", nil, "wht"];
if (getprop("/FMGC/internal/alt-set")) {
var windStore = fmgc.windController.des_winds[computer_temp].alt1;
if (windStore.heading != 0 and windStore.magnitude != 0) {
me.R1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude), "ALTN WIND ", "blu"];
me.fontMatrix[1][0] = 1;
} else {
me.R1 = ["[ ]/[ ]", "ALTN WIND ", "blu"];
me.fontMatrix[1][0] = 1;
}
} else {
me.R1 = ["", "", "blu"];
}
me.R3 = [" REQUEST ", "WIND ", "amb"];
me.R4 = [" PHASE ", "PREV ", "wht"];
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
makeTmpy: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
}
},
updateTmpy: func() {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.L1[2] = "yel";
me.L2[2] = "yel";
me.L3[2] = "yel";
me.L4[2] = "yel";
me.L5[2] = "yel";
me.R1[2] = "yel";
me.L6 = [" CANCEL", " WIND", "amb"];
me.R6 = ["UPDATE ", "WIND ", "amb"];
me.arrowsMatrix[0][5] = 0;
me.title = "DRAFT DES WIND";
me.titleColour = "yel";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} else {
me.L1[2] = "blu";
me.L2[2] = "blu";
me.L3[2] = "blu";
me.L4[2] = "blu";
me.L5[2] = "blu";
me.R1[2] = "blu";
me.L6 = [" RETURN", nil, "wht"];
me.R6 = [nil, nil, "ack"];
me.arrowsMatrix[0][5] = 1;
me.title = "DES WIND";
me.titleColour = "wht";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}
},
reload: func() {
me._setupPageWithData();
me.updateTmpy();
},
pushButtonLeft: func(index) {
if (index == 6 and fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (canvas_mcdu.myFpln[me.computer] != nil) {
canvas_mcdu.myFpln[me.computer].pushButtonLeft(index);
} else {
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
# push update to fuel
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
}
}
me.reload();
} else if (index == 6) {
setprop("/MCDU[" ~ me.computer ~ "]/page", fmgc.windController.accessPage[me.computer]);
} else if (me.items >= index) {
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) >= 5 and size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) <= 13) {
var winds = split("/", mcdu_scratchpad.scratchpads[me.computer].scratchpad);
if (size(winds[0]) >= 0 and size(winds[0]) <= 3 and num(winds[0]) != nil and winds[0] >= 0 and winds[0] <= 360 and
size(winds[1]) >= 0 and size(winds[1]) <= 3 and num(winds[1]) != nil and winds[1] >= 0 and winds[1] <= 200 and
size(winds[2]) >= 4 and size(winds[2]) <= 5 and (winds[2] == "GRND" or (num(winds[2]) != nil and winds[2] >= 1000 and winds[2] <= 39000) or
(num(split("FL", winds[2])[1]) != nil and split("FL", winds[2])[1] >= 10 and split("FL", winds[2])[1] <= 390))) {
me.makeTmpy();
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
# if (winds[2] == "GRND") {
# setprop("/FMGC/internal/dest-mag-grnd", winds[0]);
# setprop("/FMGC/internal/dest-wind-grnd", winds[1]);
# }
#print(computer_temp);
if (index == 5) {
fmgc.windController.des_winds[computer_temp].wind5.heading = winds[0];
fmgc.windController.des_winds[computer_temp].wind5.magnitude = winds[1];
fmgc.windController.des_winds[computer_temp].wind5.altitude = winds[2];
} else if (index == 4) {
fmgc.windController.des_winds[computer_temp].wind4.heading = winds[0];
fmgc.windController.des_winds[computer_temp].wind4.magnitude = winds[1];
fmgc.windController.des_winds[computer_temp].wind4.altitude = winds[2];
} else if (index == 3) {
fmgc.windController.des_winds[computer_temp].wind3.heading = winds[0];
fmgc.windController.des_winds[computer_temp].wind3.magnitude = winds[1];
fmgc.windController.des_winds[computer_temp].wind3.altitude = winds[2];
} else if (index == 2) {
fmgc.windController.des_winds[computer_temp].wind2.heading = winds[0];
fmgc.windController.des_winds[computer_temp].wind2.magnitude = winds[1];
fmgc.windController.des_winds[computer_temp].wind2.altitude = winds[2];
} else if (index == 1) {
fmgc.windController.des_winds[computer_temp].wind1.heading = winds[0];
fmgc.windController.des_winds[computer_temp].wind1.magnitude = winds[1];
fmgc.windController.des_winds[computer_temp].wind1.altitude = winds[2];
}
mcdu_scratchpad.scratchpads[me.computer].empty();
if (me.items == index and index != 5) {
me.items += 1;
}
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else if (mcdu_scratchpad.scratchpads[me.computer].scratchpad == "CLR") {
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
if (me.items == index) {
if (index == 5) {
fmgc.windController.des_winds[computer_temp].wind5.heading = 0;
fmgc.windController.des_winds[computer_temp].wind5.magnitude = 0;
fmgc.windController.des_winds[computer_temp].wind5.altitude = "";
} else if (index == 4) {
fmgc.windController.des_winds[computer_temp].wind4.heading = 0;
fmgc.windController.des_winds[computer_temp].wind4.magnitude = 0;
fmgc.windController.des_winds[computer_temp].wind4.altitude = "";
} else if (index == 3) {
fmgc.windController.des_winds[computer_temp].wind3.heading = 0;
fmgc.windController.des_winds[computer_temp].wind3.magnitude = 0;
fmgc.windController.des_winds[computer_temp].wind3.altitude = "";
} else if (index == 2) {
fmgc.windController.des_winds[computer_temp].wind2.heading = 0;
fmgc.windController.des_winds[computer_temp].wind2.magnitude = 0;
fmgc.windController.des_winds[computer_temp].wind2.altitude = "";
} else if (index == 1) {
fmgc.windController.des_winds[computer_temp].wind1.heading = 0;
fmgc.windController.des_winds[computer_temp].wind1.magnitude = 0;
fmgc.windController.des_winds[computer_temp].wind1.altitude = "";
}
} else {
if (index <= 1) {
fmgc.windController.des_winds[computer_temp].wind1.heading = fmgc.windController.des_winds[computer_temp].wind2.heading;
fmgc.windController.des_winds[computer_temp].wind1.magnitude = fmgc.windController.des_winds[computer_temp].wind2.magnitude;
fmgc.windController.des_winds[computer_temp].wind1.altitude = fmgc.windController.des_winds[computer_temp].wind2.altitude;
}
if (index <= 2) {
fmgc.windController.des_winds[computer_temp].wind2.heading = fmgc.windController.des_winds[computer_temp].wind3.heading;
fmgc.windController.des_winds[computer_temp].wind2.magnitude = fmgc.windController.des_winds[computer_temp].wind3.magnitude;
fmgc.windController.des_winds[computer_temp].wind2.altitude = fmgc.windController.des_winds[computer_temp].wind3.altitude;
}
if (index <= 3) {
fmgc.windController.des_winds[computer_temp].wind3.heading = fmgc.windController.des_winds[computer_temp].wind4.heading;
fmgc.windController.des_winds[computer_temp].wind3.magnitude = fmgc.windController.des_winds[computer_temp].wind4.magnitude;
fmgc.windController.des_winds[computer_temp].wind3.altitude = fmgc.windController.des_winds[computer_temp].wind4.altitude;
}
if (index <= 4) {
fmgc.windController.des_winds[computer_temp].wind4.heading = fmgc.windController.des_winds[computer_temp].wind5.heading;
fmgc.windController.des_winds[computer_temp].wind4.magnitude = fmgc.windController.des_winds[computer_temp].wind5.magnitude;
fmgc.windController.des_winds[computer_temp].wind4.altitude = fmgc.windController.des_winds[computer_temp].wind5.altitude;
}
}
mcdu_scratchpad.scratchpads[me.computer].empty();
me.items -= 1;
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
},
pushButtonRight: func(index) {
if (index == 1 and getprop("/FMGC/internal/alt-set")) {
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) >= 3 and size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) <= 7) {
var winds = split("/", mcdu_scratchpad.scratchpads[me.computer].scratchpad);
if (size(winds[0]) >= 1 and size(winds[0]) <= 3 and num(winds[0]) != nil and winds[0] >= 0 and winds[0] <= 360 and
size(winds[1]) >= 1 and size(winds[1]) <= 3 and num(winds[1]) != nil and winds[1] >= 0 and winds[1] <= 200) {
me.makeTmpy();
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
#print(computer_temp);
fmgc.windController.des_winds[computer_temp].alt1.heading = winds[0];
fmgc.windController.des_winds[computer_temp].alt1.magnitude = winds[1];
mcdu_scratchpad.scratchpads[me.computer].empty();
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else if (mcdu_scratchpad.scratchpads[me.computer].scratchpad == "CLR") {
var computer_temp = 2;
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
computer_temp = me.computer;
}
fmgc.windController.des_winds[computer_temp].alt1.heading = 0;
fmgc.windController.des_winds[computer_temp].alt1.magnitude = 0;
mcdu_scratchpad.scratchpads[me.computer].empty();
me._setupPageWithData();
me.updateTmpy();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
} else if (index == 6 and fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (canvas_mcdu.myFpln[me.computer] != nil) {
canvas_mcdu.myFpln[me.computer].pushButtonRight(index);
} else {
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
# push update to fuel
if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1);
}
}
me.reload();
} else {
mcdu_message(me.computer, "NOT ALLOWED");
}
}
};

99
Nasal/MCDU/WINDHIST.nas Normal file
View file

@ -0,0 +1,99 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var windHISTPage = {
title: nil,
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
L1: [nil, nil, "ack"], # content, title, colour
L2: [nil, nil, "ack"],
L3: [nil, nil, "ack"],
L4: [nil, nil, "ack"],
L5: [nil, nil, "ack"],
L6: [nil, nil, "ack"],
C1: [nil, nil, "ack"],
C2: [nil, nil, "ack"],
C3: [nil, nil, "ack"],
C4: [nil, nil, "ack"],
C5: [nil, nil, "ack"],
C6: [nil, nil, "ack"],
R1: [nil, nil, "ack"],
R2: [nil, nil, "ack"],
R3: [nil, nil, "ack"],
R4: [nil, nil, "ack"],
R5: [nil, nil, "ack"],
R6: [nil, nil, "ack"],
scroll: 0,
vector: [],
index: nil,
computer: nil,
new: func(computer) {
var whp = {parents:[windHISTPage]};
whp.computer = computer;
whp._setupPageWithData();
whp.updateTmpy();
return whp;
},
del: func() {
return nil;
},
_setupPageWithData: func() {
me.title = "HISTORY WIND";
me.titleColour = "wht";
me.L1 = ["----/---", "", "blu"];
me.L2 = ["----/---", "", "blu"];
me.L3 = ["----/---", "", "blu"];
me.L4 = ["----/---", "", "blu"];
me.L5 = ["----/---", "", "blu"];
me.L6 = [" CLIMB WIND", "", "wht"];
me.C1 = ["FL050", "", "blu"];
me.C2 = ["FL150", "", "blu"];
me.C3 = ["FL250", "", "blu"];
me.C4 = [" FL--- CRZ FL", "", "blu"];
me.C5 = ["FL370", "", "blu"];
me.R6 = ["SELECT ", "", "amb"];
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
me.fontMatrix = [[1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]];
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
makeTmpy: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
}
},
updateTmpy: func() {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.L1[2] = "yel";
me.L2[2] = "yel";
me.L3[2] = "yel";
me.L4[2] = "yel";
me.L5[2] = "yel";
me.C1[2] = "yel";
me.C2[2] = "yel";
me.C3[2] = "yel";
me.C4[2] = "yel";
me.C5[2] = "yel";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} else {
me.L1[2] = "blu";
me.L2[2] = "blu";
me.L3[2] = "blu";
me.L4[2] = "blu";
me.L5[2] = "blu";
me.C1[2] = "blu";
me.C2[2] = "blu";
me.C3[2] = "blu";
me.C4[2] = "blu";
me.C5[2] = "blu";
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}
},
reload: func() {
me._setupPageWithData();
me.updateTmpy();
}
};

View file

@ -31,6 +31,20 @@ var act_vhf1 = props.globals.getNode("instrumentation/comm[0]/frequencies/select
var act_vhf2 = props.globals.getNode("instrumentation/comm[1]/frequencies/selected-mhz");
var act_vhf3 = props.globals.getNode("instrumentation/comm[2]/frequencies/selected-mhz");
var act_ls1 = props.globals.getNode("instrumentation/nav[0]/frequencies/selected-mhz");
var act_vor1 = props.globals.getNode("instrumentation/nav[2]/frequencies/selected-mhz");
var act_vor2 = props.globals.getNode("instrumentation/nav[3]/frequencies/selected-mhz");
var act_adf1 = props.globals.getNode("instrumentation/adf[0]/frequencies/selected-khz");
var act_adf2 = props.globals.getNode("instrumentation/adf[1]/frequencies/selected-khz");
var stby_ls1 = props.globals.getNode("instrumentation/nav[0]/frequencies/standby-mhz");
var stby_vor1 = props.globals.getNode("instrumentation/nav[2]/frequencies/standby-mhz");
var stby_vor2 = props.globals.getNode("instrumentation/nav[3]/frequencies/standby-mhz");
var stby_adf1 = props.globals.getNode("instrumentation/adf[0]/frequencies/standby-khz");
var stby_adf2 = props.globals.getNode("instrumentation/adf[1]/frequencies/standby-khz");
var act_ls1_crs = props.globals.getNode("instrumentation/nav[0]/radials/selected-deg");
var act_vor1_crs = props.globals.getNode("instrumentation/nav[2]/radials/selected-deg");
var act_vor2_crs = props.globals.getNode("instrumentation/nav[3]/radials/selected-deg");
if (rand() > 0.5) {
var hf1 = genFourRand();
var hf2 = genFiveRand();
@ -79,6 +93,9 @@ var am_mode_rmp1 = props.globals.initNode("/systems/radio/rmp[0]/am-active", 0,
var am_mode_rmp2 = props.globals.initNode("/systems/radio/rmp[1]/am-active", 0, "BOOL");
var am_mode_rmp3 = props.globals.initNode("/systems/radio/rmp[2]/am-active", 0, "BOOL");
var sel_crs_rmp1 = props.globals.initNode("/systems/radio/rmp[0]/select-crs", 1, "BOOL");
var sel_crs_rmp2 = props.globals.initNode("/systems/radio/rmp[1]/select-crs", 1, "BOOL");
var init = func() {
chan_rmp1.setValue("vhf1");
chan_rmp2.setValue("vhf2");
@ -218,7 +235,52 @@ var update_active_vhf = func(vhf) {
}
}
}
};
}
var update_displays_nav = func(nav) {
var chan1 = chan_rmp1.getValue();
var chan2 = chan_rmp2.getValue();
if (nav == 1) {
if (chan1 == "ls") {
act_display_rmp1.setValue(sprintf("%3.2f", act_ls1.getValue()));
if (sel_crs_rmp1.getBoolValue()) {
stby_display_rmp1.setValue("C-" ~ sprintf("%3.0f", act_ls1_crs.getValue()));
} else {
stby_display_rmp1.setValue(sprintf("%3.2f", stby_ls1.getValue()));
}
}
if (chan2 == "ls") {
act_display_rmp2.setValue(sprintf("%3.2f", act_ls1.getValue()));
if (sel_crs_rmp2.getBoolValue()) {
stby_display_rmp2.setValue("C-" ~ sprintf("%3.0f", act_ls1_crs.getValue()));
} else {
stby_display_rmp2.setValue(sprintf("%3.2f", stby_ls1.getValue()));
}
}
} else if (nav == 3 and chan1 == "vor") {
act_display_rmp1.setValue(sprintf("%3.2f", act_vor1.getValue()));
if (sel_crs_rmp1.getBoolValue()) {
stby_display_rmp1.setValue("C-" ~ sprintf("%3.0f", act_vor1_crs.getValue()));
} else {
stby_display_rmp1.setValue(sprintf("%3.2f", stby_vor1.getValue()));
}
} else if (nav == 4 and chan2 == "vor") {
act_display_rmp2.setValue(sprintf("%3.2f", act_vor2.getValue()));
if (sel_crs_rmp2.getBoolValue()) {
stby_display_rmp2.setValue("C-" ~ sprintf("%3.0f", act_vor2_crs.getValue()));
} else {
stby_display_rmp2.setValue(sprintf("%3.2f", stby_vor2.getValue()));
}
} else if (nav == 5 and chan1 == "adf") {
act_display_rmp1.setValue(sprintf("%4.0f", act_adf1.getValue()));
stby_display_rmp1.setValue(sprintf("%4.0f", stby_adf1.getValue()));
} else if (nav == 6 and chan2 == "adf") {
act_display_rmp2.setValue(sprintf("%4.0f", act_adf2.getValue()));
stby_display_rmp2.setValue(sprintf("%4.0f", stby_adf2.getValue()));
}
}
var update_stby_freq = func(rmp_no, freq) {
if (rmp_no == 0) {
@ -284,6 +346,10 @@ var update_chan_sel = func(rmp_no) {
update_active_vhf(3);
update_active_vhf(4);
update_active_vhf(5);
update_displays_nav(1);
update_displays_nav(rmp_no + 3);
update_displays_nav(rmp_no + 5);
if (rmp_no == 0) {
var chan = chan_rmp1.getValue();
@ -330,6 +396,7 @@ var update_chan_sel = func(rmp_no) {
var transfer = func(rmp_no) {
rmp_no = rmp_no - 1;
var sel_chan = getprop("systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan");
var sel_crs = getprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs");
if (string.match(sel_chan, "vhf[1-3]")) {
var mod1 = int(string.replace(sel_chan, "vhf", ""));
@ -345,6 +412,50 @@ var transfer = func(rmp_no) {
var mem = systems.HFS[mod].selectedChannelKhz;
systems.HFS[mod].selectChannel(getprop("systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/hf" ~ mod1 ~ "-standby", mem);
} elsif (sel_chan == "adf") {
var mem = getprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/selected-khz");
setprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/selected-khz", getprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/standby-khz"));
setprop("instrumentation/adf[" ~ rmp_no ~ "]/frequencies/standby-khz", mem);
update_displays_nav(rmp_no + 5);
} elsif (sel_chan == "vor") {
if (sel_crs) {
setprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/standby-mhz", getprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/selected-mhz"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0);
update_displays_nav(rmp_no + 3);
} else {
setprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/selected-mhz", getprop("instrumentation/nav[" ~ (rmp_no + 2) ~ "]/frequencies/standby-mhz"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1);
update_displays_nav(rmp_no + 3);
}
} elsif (sel_chan == "ls") {
if (sel_crs) {
setprop("instrumentation/nav[0]/frequencies/standby-mhz", getprop("instrumentation/nav[0]/frequencies/selected-mhz"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 0);
update_displays_nav(1);
} else {
setprop("instrumentation/nav[0]/frequencies/selected-mhz", getprop("instrumentation/nav[0]/frequencies/standby-mhz"));
setprop("systems/radio/rmp[" ~ rmp_no ~ "]/select-crs", 1);
update_displays_nav(1);
}
}
}
var change_nav_mode = func(rmp_nr, nav_mode) {
if (!nav_mode.getBoolValue()) {
if (rmp_nr == 1 and (chan_rmp1.getValue() == "vor" or chan_rmp1.getValue() == "ls" or chan_rmp1.getValue() == "adf")) {
chan_rmp1.setValue("vhf1");
}
if (rmp_nr == 2 and (chan_rmp2.getValue() == "vor" or chan_rmp2.getValue() == "ls" or chan_rmp2.getValue() == "adf")) {
chan_rmp2.setValue("vhf2");
}
setprop("/FMGC/internal/ils1freq-set", 1);
setprop("/FMGC/internal/ils1crs-set", 1);
setprop("/FMGC/internal/vor1freq-set", 1);
setprop("/FMGC/internal/vor1crs-set", 1);
setprop("/FMGC/internal/vor2freq-set", 1);
setprop("/FMGC/internal/vor2crs-set", 1);
setprop("/FMGC/internal/adf1freq-set", 1);
setprop("/FMGC/internal/adf2freq-set", 1);
}
}
@ -431,3 +542,64 @@ setlistener("/systems/radio/rmp[1]/sel_chan", func {
setlistener("/systems/radio/rmp[2]/sel_chan", func {
update_chan_sel(2);
});
setlistener("/instrumentation/nav[0]/frequencies/selected-mhz", func {
update_displays_nav(1);
});
setlistener("/instrumentation/nav[0]/frequencies/standby-mhz", func {
update_displays_nav(1);
});
setlistener("/instrumentation/nav[2]/frequencies/selected-mhz", func {
update_displays_nav(3);
});
setlistener("/instrumentation/nav[2]/frequencies/standby-mhz", func {
update_displays_nav(3);
});
setlistener("/instrumentation/nav[3]/frequencies/selected-mhz", func {
update_displays_nav(4);
});
setlistener("/instrumentation/nav[3]/frequencies/standby-mhz", func {
update_displays_nav(4);
});
setlistener("/instrumentation/adf[0]/frequencies/selected-khz", func {
update_displays_nav(5);
});
setlistener("/instrumentation/adf[0]/frequencies/standby-khz", func {
update_displays_nav(5);
});
setlistener("/instrumentation/adf[1]/frequencies/selected-khz", func {
update_displays_nav(6);
});
setlistener("/instrumentation/adf[1]/frequencies/standby-khz", func {
update_displays_nav(6);
});
setlistener("/instrumentation/nav[0]/radials/selected-deg", func {
update_displays_nav(1);
});
setlistener("/instrumentation/nav[2]/radials/selected-deg", func {
update_displays_nav(3);
});
setlistener("/instrumentation/nav[3]/radials/selected-deg", func {
update_displays_nav(4);
});
setlistener("/systems/radio/rmp[0]/nav", func(nav_mode) {
change_nav_mode(1, nav_mode);
});
setlistener("/systems/radio/rmp[1]/nav", func(nav_mode) {
change_nav_mode(2, nav_mode);
});

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- IT-GUI -->
<!-- IT-GUI (Airbus) -->
<!-- Copyright (c) 2020 Josh Davidson (Octal450) -->
@ -10,27 +10,27 @@
<colors n="0">
<background n="0">
<alpha>0.95</alpha>
<blue>0.05</blue>
<green>0.05</green>
<red>0.05</red>
<blue>0.17</blue>
<green>0.17</green>
<red>0.17</red>
</background>
<button n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.13</blue>
<green>0.13</green>
<red>0.13</red>
</button>
<checkbox-foreground n="0">
<alpha>0.95</alpha>
<blue>0.05</blue>
<green>0.05</green>
<red>0.05</red>
<blue>0.19</blue>
<green>0.19</green>
<red>0.19</red>
</checkbox-foreground>
<checkbox-highlight n="0">
<alpha>0.95</alpha>
<blue>0.9</blue>
<green>0.9</green>
<red>0.9</red>
<blue>0.8</blue>
<green>0.58</green>
<red>0.44</red>
</checkbox-highlight>
<checkbox-misc n="0">
<alpha>0.95</alpha>
@ -40,9 +40,9 @@
</checkbox-misc>
<combo-editfield n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</combo-editfield>
<dial-misc n="0">
<alpha>0.95</alpha>
@ -52,15 +52,15 @@
</dial-misc>
<hrule n="0">
<alpha>0.95</alpha>
<blue>1.0</blue>
<green>0.0</green>
<red>1.0</red>
<blue>0.8</blue>
<green>0.58</green>
<red>0.44</red>
</hrule>
<input n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</input>
<input-legend n="0">
<alpha>0.95</alpha>
@ -82,27 +82,27 @@
</radio-foreground>
<select-editfield n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</select-editfield>
<slider n="0">
<alpha>1.0</alpha>
<blue>0.4</blue>
<green>0.4</green>
<red>0.4</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</slider>
<textbox-editable n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</textbox-editable>
<vrule n="0">
<alpha>0.95</alpha>
<blue>1.0</blue>
<green>0.0</green>
<red>1.0</red>
<blue>0.8</blue>
<green>0.58</green>
<red>0.44</red>
</vrule>
</colors>
</style>
@ -111,39 +111,39 @@
<colors n="0">
<background n="0">
<alpha>0.95</alpha>
<blue>0.05</blue>
<green>0.05</green>
<red>0.05</red>
<blue>0.17</blue>
<green>0.17</green>
<red>0.17</red>
</background>
<button n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.13</blue>
<green>0.13</green>
<red>0.13</red>
</button>
<checkbox-foreground n="0">
<alpha>0.95</alpha>
<blue>0.05</blue>
<green>0.05</green>
<red>0.05</red>
<blue>0.19</blue>
<green>0.19</green>
<red>0.19</red>
</checkbox-foreground>
<checkbox-highlight n="0">
<alpha>0.95</alpha>
<blue>0.9</blue>
<green>0.9</green>
<red>0.9</red>
<blue>0.8</blue>
<green>0.58</green>
<red>0.44</red>
</checkbox-highlight>
<checkbox-misc n="0">
<alpha>0.95</alpha>
<blue>0.9</blue>
<green>0.9</green>
<red>0.9</red>
<blue>0.8</blue>
<green>0.58</green>
<red>0.44</red>
</checkbox-misc>
<combo-editfield n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</combo-editfield>
<dial-misc n="0">
<alpha>0.95</alpha>
@ -153,15 +153,15 @@
</dial-misc>
<hrule n="0">
<alpha>0.95</alpha>
<blue>1.0</blue>
<green>0.0</green>
<red>1.0</red>
<blue>0.8</blue>
<green>0.58</green>
<red>0.44</red>
</hrule>
<input n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</input>
<input-legend n="0">
<alpha>0.95</alpha>
@ -183,27 +183,27 @@
</radio-foreground>
<select-editfield n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</select-editfield>
<slider n="0">
<alpha>1.0</alpha>
<blue>0.4</blue>
<green>0.4</green>
<red>0.4</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</slider>
<textbox-editable n="0">
<alpha>0.95</alpha>
<blue>0.2</blue>
<green>0.2</green>
<red>0.2</red>
<blue>0.33</blue>
<green>0.33</green>
<red>0.33</red>
</textbox-editable>
<vrule n="0">
<alpha>0.95</alpha>
<blue>1.0</blue>
<green>0.0</green>
<red>1.0</red>
<blue>0.8</blue>
<green>0.58</green>
<red>0.44</red>
</vrule>
</colors>
</style>