From 3aada81966adc3502e86fc7112323d793242fedc Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 24 Mar 2020 16:46:27 +0000 Subject: [PATCH] FROM legend, now show UTC / altitude of FROM waypoint --- Models/Instruments/MCDU/MCDU.nas | 2 +- Models/Instruments/MCDU/res/mcdu.svg | 870 ++++++++++++++------------- Nasal/FMGC/flightplan.nas | 22 + Nasal/MCDU/F-PLN-rework.nas | 18 +- 4 files changed, 479 insertions(+), 433 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 02eaca25..fe66ff7c 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -202,7 +202,7 @@ 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_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R", + "FPLN","FPLN_From","FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R", "arrow2R","arrow3R","arrow4R","arrow5R"]; }, update: func() { diff --git a/Models/Instruments/MCDU/res/mcdu.svg b/Models/Instruments/MCDU/res/mcdu.svg index 5ad19c52..cfdaef17 100644 --- a/Models/Instruments/MCDU/res/mcdu.svg +++ b/Models/Instruments/MCDU/res/mcdu.svg @@ -41,13 +41,13 @@ inkscape:window-height="705" id="namedview371" showgrid="true" - inkscape:zoom="4.1661918" - inkscape:cx="37.539162" - inkscape:cy="725.25661" + inkscape:zoom="1.5306292" + inkscape:cx="332.0077" + inkscape:cy="938.33632" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" - inkscape:current-layer="Simple" + inkscape:current-layer="svg2" showguides="false" inkscape:snap-global="false" units="px" @@ -871,446 +871,460 @@ x="18.917452" id="tspan4269-7" sodipodi:role="line">TEXT + + + style="display:inline" + id="Simple-9" + inkscape:label="Simple"> - - - - - - - - - - - + + + + + + + + + + CALLSIG + + CALLSIG + x="350.9628" + id="tspan3617" + sodipodi:role="line">TMPY + id="FPLN_TMPY_ERASE" + inkscape:label="#g3715"> + ERASE TMPY - - ERASE - TMPY - - - - - - + id="tspan3629" + sodipodi:role="line">TMPY - + + + + + + + TMPY - TMPY + INSERT - - - - - - + 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 + + + + + + FROM + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="arrow5L" + inkscape:label="arrow5L" + transform="matrix(1.0000008,0,0,0.99998914,-895.98809,589.53826)" + style="stroke:#bb6100;stroke-opacity:1"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2135,7 +2149,7 @@ 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:#ffffff;fill-opacity:1" y="187.10254" x="399.48752" - id="tspan1079" + id="tspan339" sodipodi:role="line">F S @@ -2161,7 +2175,7 @@ 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:#ffffff;fill-opacity:1" y="422.15305" x="398.21817" - id="tspan1085" + id="tspan345" sodipodi:role="line">O = @@ -2187,7 +2201,7 @@ style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1" y="278.32764" x="478.87796" - id="tspan1091" + id="tspan351" sodipodi:role="line">= = diff --git a/Nasal/FMGC/flightplan.nas b/Nasal/FMGC/flightplan.nas index 65a58f01..980321a0 100644 --- a/Nasal/FMGC/flightplan.nas +++ b/Nasal/FMGC/flightplan.nas @@ -46,6 +46,10 @@ var flightPlanController = { arrivalIndex: [0, 0, 0], arrivalDist: 0, _arrivalDist: 0, + fromWptTime: nil, + fromWptAlt: nil, + _timeTemp: nil, + _altTemp: nil, reset: func() { me.temporaryFlag[0] = 0; @@ -94,6 +98,24 @@ var flightPlanController = { }, autoSequencing: func() { + me._timeTemp = math.round(getprop("/sim/time/utc/minute") + (getprop("/sim/time/utc/second") / 60)); + if (me._timeTemp < 10) { + me._timeTemp = "0" ~ me._timeTemp; + } + me.fromWptTime = getprop("/sim/time/utc/hour") ~ me._timeTemp; + me._altTemp = getprop("/systems/navigation/adr/output/baro-alt-corrected-1-capt"); + + if (me._altTemp > getprop("FMGC/internal/trans-alt")) { + me.fromWptAlt = "FL" ~ math.round(me._altTemp / 100); + } else { + if (me._altTemp > 0) { + me.fromWptAlt = math.round(me._altTemp); + } else { + me.fromWptAlt = "M" ~ math.round(me._altTemp); + } + } + + # todo setlistener on sim/time/warp to recompute predictions if (me.num[2].getValue() > 2) { if (me.temporaryFlag[0] == 1 and wpID[0][0] == wpID[2][0]) { me.deleteWP(0, 0); diff --git a/Nasal/MCDU/F-PLN-rework.nas b/Nasal/MCDU/F-PLN-rework.nas index b720ed79..fc843f62 100644 --- a/Nasal/MCDU/F-PLN-rework.nas +++ b/Nasal/MCDU/F-PLN-rework.nas @@ -31,9 +31,15 @@ var fplnItem = { updateCenterText: func() { if (me.wp != nil) { if (me.wp.wp_name != "DISCONTINUITY") { - me.brg = me.getBrg(); - me.track = me.getTrack(); - return ["---- ", nil, me.colour]; + if (me.index != (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) or fmgc.flightPlanController.fromWptTime == nil) { + me.brg = me.getBrg(); + me.track = me.getTrack(); + return ["---- ", nil, me.colour]; + } else { + me.brg = me.getBrg(); + me.track = me.getTrack(); + return [fmgc.flightPlanController.fromWptTime ~ " ", nil, me.colour]; + } } else { return ["---F-PLN DISCONTINUITY--", nil, "wht"]; } @@ -65,7 +71,11 @@ var fplnItem = { return "---"; }, getAlt: func() { - return "-----"; + if (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) and fmgc.flightPlanController.fromWptAlt != nil) { + return " " ~ fmgc.flightPlanController.fromWptAlt; + } else { + return "-----"; + } }, getDist: func() { return "--";