diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index 81d82153..64527ec1 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -32,8 +32,7 @@ canvas.NavDisplay.get_nav_path = func (type, idx) { return sprintf(path, name, idx); }; -canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update_time=0.05) -{ +canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update_time=0.05) { if (me.inited) die("MFD already was added to scene"); me.range_dependant_layers = []; me.always_update_layers = {}; @@ -87,6 +86,8 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update .set("screen-range", 700) .set("z-index",-1); + me.lastCompassRot = 0; # last compass rotation deg + me.update_sub(); # init some map properties based on switches var vor1_path = "/instrumentation/nav[2]"; @@ -277,20 +278,36 @@ canvas.NavDisplay.update_sub = func(){ me.userTrk=userHdg; } + var reqHdg = 0; + if((me.in_mode("toggle_display_mode", ["MAP"]) and me.get_switch("toggle_display_type") == "CRT") - or (me.get_switch("toggle_track_heading") and me.get_switch("toggle_display_type") == "LCD")) - { + or (me.get_switch("toggle_track_heading") and me.get_switch("toggle_display_type") == "LCD")) { userHdgTrk = userTrk; me.userHdgTrk = userTrk; + me.lastCompassRot = userTrk; userHdgTrkTru = userTrkTru; me.symbols.hdgTrk.setText("TRK"); } else { - userHdgTrk = userHdg; - me.userHdgTrk = userHdg; + var dist = int(userHdg - me.lastCompassRot); + if (dist>180) dist = dist - 360; + elsif (dist<-180) dist = 360 + dist; + if (dist>0) { + dist = dist * 0.3; + if (dist>20) dist = 20; + me.lastCompassRot = (dist<1) ? userHdg : me.lastCompassRot+dist; + } + elsif (dist<0) { + dist = dist * 0.3; + if (dist<-20) dist = -20; + me.lastCompassRot = (dist>-1) ? userHdg : me.lastCompassRot+dist; + } + userHdgTrk = me.lastCompassRot; + me.userHdgTrk = me.lastCompassRot; userHdgTrkTru = userHdgTru; me.symbols.hdgTrk.setText("HDG"); } + # First, update the display position of the map var oldRange = me.map.getRange(); var pos = { diff --git a/Models/Instruments/ND/canvas/res/airbusND.svg b/Models/Instruments/ND/canvas/res/airbusND.svg index fc7e5289..343918c0 100644 --- a/Models/Instruments/ND/canvas/res/airbusND.svg +++ b/Models/Instruments/ND/canvas/res/airbusND.svg @@ -7,8 +7,8 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - sodipodi:docname="airbusND_orig.svg" - inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)" + sodipodi:docname="airbusND.svg" + inkscape:version="1.0.2 (e86c870879, 2021-01-15, custom)" xml:space="preserve" id="svg5180" height="1024" @@ -23,22 +23,22 @@ inkscape:pageopacity="1" inkscape:pageshadow="2" inkscape:window-width="1920" - inkscape:window-height="1056" + inkscape:window-height="1017" id="namedview102" showgrid="false" - inkscape:zoom="0.9002897" - inkscape:cx="467.92702" - inkscape:cy="538.03817" - inkscape:window-x="1920" - inkscape:window-y="0" + inkscape:zoom="0.90028968" + inkscape:cx="475.13347" + inkscape:cy="301.30025" + inkscape:window-x="-8" + inkscape:window-y="-8" inkscape:window-maximized="1" - inkscape:current-layer="layer8" + inkscape:current-layer="layer3" inkscape:object-nodes="true" inkscape:snap-smooth-nodes="true" inkscape:snap-object-midpoints="true" inkscape:snap-grids="false" inkscape:snap-to-guides="false" - showguides="true" + showguides="false" inkscape:guide-bbox="true" inkscape:document-rotation="0">image/svg+xmlGijs de RooyGijs de RooyABCD 999.9 999°/ 99 999 999 GS + x="14.276394" + y="33.306854">GS TAS @@ -983,12 +986,12 @@ 08 34.4z @@ -1173,36 +1176,36 @@ sodipodi:nodetypes="ccccccccc" />NM + x="967.04547" + y="67.431412">NM ILS + x="807.289" + y="33.929054">ILS 999.99 @@ -1224,14 +1227,14 @@ inkscape:transform-center-y="-715.12894" />360 OFST -999999CRS @@ -1656,23 +1685,23 @@ xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ededed;fill-opacity:1;stroke:none" x="854.72168" - y="124.87983" + y="104.87983" id="dmeLbl" inkscape:label="#text7243">  + y="104.87983">  999 @@ -1680,13 +1709,13 @@ xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ededed;fill-opacity:1;stroke:none" x="913.95801" - y="126.12444" + y="106.12444" id="dme" inkscape:label="#text7243">99.9 =nd.userHdgTrk) ? (bugRot-nd.userHdgTrk) : (360+bugRot-nd.userHdgTrk); + if (diffRot<180 and diffRot>48) { + nd.symbols.hdgBug2ValR.setText(sprintf("%03d", bugRot+0.5)); #CHECKME - not sure about adding +.5 as "hdg" process + nd.symbols.hdgBug2ValR.show(); + } else { + nd.symbols.hdgBug2ValR.hide(); + } + }, + is_false: func(nd) nd.symbols.hdgBug2ValR.hide(), + }, + }, + { + id:"hdgBug2ValL", + impl: { + init: func(nd,symbol), + predicate: func(nd) nd.in_mode("toggle_display_mode", ["MAP"]) and !nd.get_switch("toggle_centered"), + is_true: func(nd) { + var bugRot = vhdg_bug.getValue(); + var diffRot = (bugRot>nd.userHdgTrk) ? (360+nd.userHdgTrk-bugRot) : (nd.userHdgTrk-bugRot); + if (diffRot<180 and diffRot>48) { + nd.symbols.hdgBug2ValL.setText(sprintf("%03d", bugRot-0.5)); #CHECKME - not sure about adding +.5 as "hdg" process + nd.symbols.hdgBug2ValL.show(); + } else { + nd.symbols.hdgBug2ValL.hide(); + } + }, + is_false: func(nd) nd.symbols.hdgBug2ValL.hide(), + }, + }, { id:"hdgGroup", impl: {