1
0
Fork 0

DIRTO finalised, now to make it work

This commit is contained in:
legoboyvdlp R 2020-03-29 16:55:30 +01:00
parent a87aced049
commit 023344442a
5 changed files with 187 additions and 46 deletions

View file

@ -203,8 +203,8 @@ var canvas_MCDU_base = {
"Simple_R4_Arrow","Simple_R5_Arrow","Simple_R6_Arrow","Simple_C1","Simple_C2","Simple_C3","Simple_C4","Simple_C5","Simple_C6","Simple_C1S",
"Simple_C2S","Simple_C3S","Simple_C4S","Simple_C5S","Simple_C6S","INITA","INITA_CoRoute","INITA_FltNbr","INITA_CostIndex","INITA_CruiseFLTemp",
"INITA_FromTo","INITA_InitRequest","INITA_AlignIRS","INITB","INITB_ZFWCG","INITB_ZFW","INITB_ZFW_S","INITB_Block","PERFTO","PERFTO_V1","PERFTO_VR","PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR","PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE",
"FPLN","FPLN_From","FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R",
"arrow2R","arrow3R","arrow4R","arrow5R"];
"FPLN","FPLN_From","FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L",
"arrow1R","arrow2R","arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group"];
},
update: func() {
if (systems.ELEC.Bus.ac1.getValue() >= 110 and mcdu1_lgt.getValue() > 0.01) {
@ -227,6 +227,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].show();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -539,9 +540,16 @@ var canvas_MCDU_base = {
#}
if (fmgc.flightPlanController.temporaryFlag[i]) {
me["FPLN_TMPY_group"].show();
if (!mcdu.dirToFlag) {
me["FPLN_TMPY_group"].show();
me["DIRTO_TMPY_group"].hide();
} else {
me["DIRTO_TMPY_group"].show();
me["FPLN_TMPY_group"].hide();
}
} else {
me["FPLN_TMPY_group"].hide();
me["DIRTO_TMPY_group"].hide();
}
}
} elsif (page == "MCDU") {
@ -549,6 +557,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].hide();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -635,6 +644,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].hide();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -721,6 +731,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].hide();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -805,6 +816,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].hide();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -894,6 +906,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -995,6 +1008,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].hide();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -1138,6 +1152,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].hide();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].show();
me["INITB"].hide();
me["PERFTO"].hide();
@ -1297,6 +1312,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].show();
me["PERFTO"].hide();
@ -1431,6 +1447,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -1547,6 +1564,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].show();
@ -2000,6 +2018,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -2127,6 +2146,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -2383,6 +2403,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -2639,6 +2660,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -2964,6 +2986,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -3277,6 +3300,7 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].show();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].hide();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
@ -3602,21 +3626,22 @@ var canvas_MCDU_base = {
me["Simple"].show();
me["Simple_Center"].hide();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].show();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();
me["arrowsDepArr"].hide();
me["arrowsDepArr"].show();
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["Simple_Title"].show();
me["ArrowLeft"].show();
me["ArrowRight"].show();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
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();
me["Simple_L6_Arrow"].show();
me["Simple_L6_Arrow"].hide();
me["Simple_R1_Arrow"].hide();
me["Simple_R2_Arrow"].hide();
me["Simple_R3_Arrow"].hide();
@ -3648,10 +3673,7 @@ var canvas_MCDU_base = {
var sign = "R";
}
forindex (var item; myDirTo[i].arrowsMatrix[matrixArrow]) {
if (item == 5) {
me["Simple_L6_Arrow"].setColor(getprop("MCDUC/colors/" ~ myDirTo[i].arrowsColour[0][5] ~ "/r"), getprop("MCDUC/colors/" ~ myDirTo[i].arrowsColour[0][5] ~ "/g"), getprop("MCDUC/colors/" ~ myDirTo[i].arrowsColour[0][5] ~ "/b"));
continue;
}
if (item == 5) { continue; }
if (myDirTo[i].arrowsMatrix[matrixArrow][item] == 1) {
me["arrow" ~ (item + 1) ~ sign].show();
me["arrow" ~ (item + 1) ~ sign].setColor(getprop("MCDUC/colors/" ~ myDirTo[i].arrowsColour[matrixArrow][item] ~ "/r"), getprop("MCDUC/colors/" ~ myDirTo[i].arrowsColour[matrixArrow][item] ~ "/g"), getprop("MCDUC/colors/" ~ myDirTo[i].arrowsColour[matrixArrow][item] ~ "/b"));
@ -3661,8 +3683,6 @@ var canvas_MCDU_base = {
}
}
forindex (var matrixFont; myDirTo[i].fontMatrix) {
if (matrixFont == 0) {
var sign = "L";
@ -3680,6 +3700,12 @@ var canvas_MCDU_base = {
}
}
if (fmgc.flightPlanController.temporaryFlag[i] and mcdu.dirToFlag) {
me["DIRTO_TMPY_group"].show();
} else {
me["DIRTO_TMPY_group"].hide();
}
if (myDirTo[i].L1[0] == nil) {
me["Simple_L1"].hide();
me["Simple_L1S"].hide();
@ -3856,6 +3882,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me["Simple"].hide();
me["FPLN"].hide();
me["DIRTO_TMPY_group"].show();
me["INITA"].hide();
me["INITB"].hide();
me["PERFTO"].hide();

View file

@ -42,8 +42,8 @@
id="namedview371"
showgrid="true"
inkscape:zoom="1.5306292"
inkscape:cx="332.0077"
inkscape:cy="938.33632"
inkscape:cx="1100.8644"
inkscape:cy="75.945873"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
@ -1069,19 +1069,136 @@
</g>
</g>
</g>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="177.72771"
y="68.861366"
id="FPLN_FROM"
transform="scale(0.991516,1.0085566)"
inkscape:label="#text4244"><tspan
sodipodi:role="line"
id="tspan1240"
x="177.72771"
y="68.861366"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:51.20000076px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">FROM</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="177.72771"
y="68.861366"
id="FPLN_FROM"
transform="scale(0.991516,1.0085566)"
inkscape:label="#text4244"><tspan
sodipodi:role="line"
id="tspan1240"
x="177.72771"
y="68.861366"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:51.20000076px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">FROM</tspan></text>
</g>
<g
inkscape:label="#g3767"
id="DIRTO_TMPY_group">
<g
id="DIRTO_TMPY_ERASE"
inkscape:label="#g3715">
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="63.16515"
y="773.87396"
id="text174"
transform="scale(0.991516,1.0085566)"
inkscape:label="#text4244"><tspan
sodipodi:role="line"
id="tspan172"
x="63.16515"
y="773.87396"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#bb6100;fill-opacity:1">ERASE</tspan></text>
<text
inkscape:label="#text4244"
transform="scale(0.991516,1.0085566)"
id="text178"
y="717.159"
x="73.163895"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#bb6100;fill-opacity:1"
y="717.159"
x="73.163895"
id="tspan176"
sodipodi:role="line">DIR TO</tspan></text>
<g
id="g186"
inkscape:label="#g4241"
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,710.38932)"
style="stroke:#bb6100;stroke-opacity:1">
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path180"
d="M 952.4036,47.432743 H 923.87395"
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 936.70791,32.6968 921.8587,47.4328"
id="path182"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path184"
d="M 936.70791,62.1688 921.8587,47.4328"
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
id="g207"
inkscape:label="#g3746">
<text
inkscape:label="#text4244"
transform="scale(0.9915153,1.0085573)"
id="text191"
y="717.15857"
x="937.84546"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1"
y="717.15857"
x="947.84546"
id="tspan189"
sodipodi:role="line">DIR TO</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="972.33221"
y="773.87335"
id="text195"
transform="scale(0.99151523,1.0085574)"
inkscape:label="#text4244"><tspan
sodipodi:role="line"
id="tspan193"
x="972.33221"
y="773.87335"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1">INSERT</tspan></text>
<g
id="g205"
inkscape:label="#g4324"
transform="matrix(1.0807108,0,0,1.0807111,-76.371959,450.13459)">
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path197"
d="M 998.71909,284.70793 H 970.18944"
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 994.54102,294.79468 -20.17351,-20.1735"
id="path199"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path201"
d="m 984.45427,298.97275 -10e-6,-28.52964"
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 974.36752,294.79468 20.17349,-20.1735"
id="path203"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</g>
</g>
<g
inkscape:label="arrowsDepArr"

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View file

@ -341,11 +341,9 @@ var flightPlanController = {
}
},
scratchpad: func(text, index, plan) { # return 0 not in database, 1 not allowed, 2 success
scratchpad: func(text, index, plan) { # return 0 not in database, 1 not allowed, 2 success, 3 = not allowed due to dir to
if (mcdu.dirToFlag) {
setprop("MCDU[" ~ plan ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ plan ~ "]/scratchpad", "DIR TO IN PROGRESS");
return;
return 3;
}
if (!fmgc.flightPlanController.temporaryFlag[plan]) {

View file

@ -39,15 +39,13 @@ var dirTo = {
me.L3 = [nil, nil, "blu"];
me.L4 = [nil, nil, "blu"];
me.L5 = [nil, nil, "blu"];
me.L6 = [" ERASE", " DIR TO", "yel"];
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
me.R2 = ["DIRECT TO ", nil, "blu"];
me.R3 = ["ABEAM PTS ", "WITH ", "blu"];
me.R4 = ["[ ] ", "RADIAL IN ", "blu"];
me.R5 = ["[ ] ", "RADIAL OUT ", "blu"];
me.R6 = ["INSERT* ", "DIR TO ", "yel"];
me.arrowsMatrix = [[0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0]];
me.arrowsColour = [["ack", "blu", "blu", "blu", "blu", "ack"], ["ack", "blu", "ack", "blu", "ack", "ack"]];
me.arrowsMatrix = [[0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0]];
me.arrowsColour = [["ack", "blu", "blu", "blu", "blu", "ack"], ["ack", "blu", "blu", "ack", "ack", "ack"]];
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
me.updateFromFpln();
me.updateTmpy();
@ -64,27 +62,25 @@ var dirTo = {
},
updateTmpy: func() {
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.L6 = [" ERASE", " DIR TO", "yel"];
me.R6 = ["INSERT ", "DIR TO ", "yel"];
me.arrowsMatrix[0][5] = 1;
me.arrowsColour[0][5] = "yel";
me.L1[2] = "yel";
me.R2[2] = "yel";
me.R3[2] = "yel";
me.arrowsColour[1][1] = "yel";
me.arrowsColour[1][2] = "yel";
me.titleColour = "yel";
} else {
me.L6 = [nil, nil, "yel"];
me.R6 = [nil, nil, "yel"];
me.arrowsMatrix[0][5] = 0;
me.arrowsColour[0][5] = "ack";
me.L1[2] = "blu";
me.R2[2] = "blu";
me.R3[2] = "blu";
me.arrowsColour[1][1] = "blu";
me.arrowsColour[1][2] = "blu";
me.titleColour = "wht";
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
updateFromFpln: func() {
if (canvas_mcdu.myFpln[me.computer] == nil) {
canvas_mcdu.myFpln[i] = fplnPage.new(2, me.computer);
canvas_mcdu.myFpln[me.computer] = fplnPage.new(2, me.computer);
}
var x = 0;

View file

@ -360,7 +360,10 @@ var fplnPage = { # this one is only created once, and then updated - remember th
if (size(me.outputList) >= index) {
if (size(getprop("MCDU[" ~ me.computer ~ "]/scratchpad")) > 0) {
var returny = fmgc.flightPlanController.scratchpad(getprop("MCDU[" ~ me.computer ~ "]/scratchpad"), (index - 1 + me.scroll), me.computer);
if (returny == 0) {
if (returny == 3) {
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
} elsif (returny == 0) {
notInDataBase(me.computer);
} elsif (returny == 1) {
notAllowed(me.computer);