From 352c64b930c71e09941ee74cc40dbf0a165e1264 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 3 Aug 2021 18:44:22 +0100 Subject: [PATCH] Fix the track line / indicator --- .../ND/canvas/framework/navdisplay.nas | 9 +-- Models/Instruments/ND/canvas/res/airbusND.svg | 72 +++++++++---------- Models/Instruments/ND/canvas/style.nas | 56 +++++++-------- 3 files changed, 64 insertions(+), 73 deletions(-) diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index bca19f6c..2693461b 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -225,7 +225,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update # anything that needs updatecenter called, should be added to the vector here # foreach(var element; ["staFromL2","staToL2","staFromR2","staToR2", - "hdgTrk","trkInd","hdgBug","HdgBugCRT","TrkBugLCD","HdgBugLCD","curHdgPtr", + "hdgTrk","hdgBug","HdgBugCRT","TrkBugLCD","HdgBugLCD","curHdgPtr", "HdgBugCRT2","TrkBugLCD2","HdgBugLCD2","hdgBug2","selHdgLine","selHdgLine2","curHdgPtr2", "staToL","staFromL","staToR","staFromR"] ) me.symbols[element] = me.nd.getElementById(element).updateCenter(); @@ -613,13 +613,11 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec 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")) { - me.symbols.trkInd.setRotation(0); me.symbols.curHdgPtr.setRotation((userHdg-userTrk)*D2R); me.symbols.curHdgPtr2.setRotation((userHdg-userTrk)*D2R); } else { - me.symbols.trkInd.setRotation((userTrk-userHdg)*D2R); me.symbols.curHdgPtr.setRotation(0); me.symbols.curHdgPtr2.setRotation(0); } @@ -656,10 +654,6 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec var adf0hdg = getprop("/instrumentation/adf/indicated-bearing-deg"); var adf1hdg = getprop("/instrumentation/adf[1]/indicated-bearing-deg"); if(!me.get_switch("toggle_centered")) { - if(me.in_mode("toggle_display_mode", ["PLAN"]) or (me.adirs_property.getValue() != 1 or (me.change_phase == 1) and (adirs_3.getValue() != 1 or att_switch.getValue() != me.attitude_heading_setting))) - me.symbols.trkInd.hide(); - else - me.symbols.trkInd.show(); if((getprop("/instrumentation/nav[2]/in-range") and me.get_switch("toggle_lh_vor_adf") == 1)) { me.symbols.staToL.setColor(0.195,0.96,0.097); me.symbols.staFromL.setColor(0.195,0.96,0.097); @@ -713,7 +707,6 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec } me.symbols.selHdgLine.setVisible(staPtrVis and hdg_bug_active); } else { - me.symbols.trkInd.hide(); if((getprop("/instrumentation/nav[2]/in-range") and me.get_switch("toggle_lh_vor_adf") == 1)) { me.symbols.staFromL2.setColor(0.195,0.96,0.097); me.symbols.staToL2.setColor(0.195,0.96,0.097); diff --git a/Models/Instruments/ND/canvas/res/airbusND.svg b/Models/Instruments/ND/canvas/res/airbusND.svg index d83f7743..63aa5f1a 100644 --- a/Models/Instruments/ND/canvas/res/airbusND.svg +++ b/Models/Instruments/ND/canvas/res/airbusND.svg @@ -1183,25 +1183,23 @@ x="198.86594" y="648.10144">99 - + inkscape:label="#path3888-1" /> + = 100), is_true: func(nd) { var windDir = pts.Instrumentation.PFD.windDirection.getValue() or 0; - if(nd.get_switch("toggle_true_north")) - windDir = windDir + getprop("environment/magnetic-variation-deg"); nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",windDir,pts.Instrumentation.PFD.windSpeed.getValue() or 0)); }, is_false: func(nd) { @@ -1538,18 +1547,7 @@ canvas.NDStyles["Airbus"] = { predicate: func(nd) (!(nd.in_mode("toggle_display_mode", ["PLAN"]) and (nd.get_switch("toggle_display_type") == "LCD")) and (pts.Instrumentation.PFD.windSpeed.getValue() or 0) >= 2 and getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100), is_true: func(nd) { nd.symbols.windArrow.show(); - var windArrowRot = pts.Instrumentation.PFD.windDirection.getValue() or 0; - if(nd.in_mode("toggle_display_mode", ["MAP","PLAN"])) { - if(nd.get_switch("toggle_true_north")) - windArrowRot = windArrowRot - nd.aircraft_source.get_trk_tru(); - else - windArrowRot = windArrowRot - nd.aircraft_source.get_trk_mag(); - } else { - if(nd.get_switch("toggle_true_north")) - windArrowRot = windArrowRot - nd.aircraft_source.get_hdg_tru(); - else - windArrowRot = windArrowRot - nd.aircraft_source.get_hdg_mag(); - } + var windArrowRot = (pts.Instrumentation.PFD.windDirection.getValue() or 0) - nd.aircraft_source.get_hdg_tru(); nd.symbols.windArrow.setRotation(windArrowRot*D2R); }, is_false: func(nd) nd.symbols.windArrow.hide(),