From 3f16a74537e05741ae523974c4c129a328b67987 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sun, 14 Feb 2021 21:02:32 +0100 Subject: [PATCH] fix update hz - display HI/LO on ND --- .../ND/canvas/framework/navdisplay.nas | 2 +- .../ND/canvas/map/TERRAIN.lcontroller | 12 +- .../Instruments/ND/canvas/map/TERRAIN.symbol | 174 +++---- Models/Instruments/ND/canvas/res/airbusND.svg | 73 ++- .../ND/canvas/res/terrain/tile_01.png | Bin 3197 -> 1716 bytes .../ND/canvas/res/terrain/tile_02.png | Bin 175 -> 182 bytes .../ND/canvas/res/terrain/tile_03.png | Bin 3321 -> 2097 bytes .../ND/canvas/res/terrain/tile_04.png | Bin 175 -> 181 bytes .../ND/canvas/res/terrain/tile_06.png | Bin 175 -> 182 bytes .../Instruments/ND/canvas/res/terrainND.svg | 439 ------------------ Models/Instruments/ND/canvas/style.nas | 38 +- 11 files changed, 187 insertions(+), 551 deletions(-) delete mode 100644 Models/Instruments/ND/canvas/res/terrainND.svg diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index 04a59949..0f5e116c 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -69,7 +69,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update # because things are much better configurable that way # now look up all required SVG elements and initialize member fields using the same name to have a convenient handle foreach(var element; ["dmeLDist","dmeRDist","dmeL","dmeR","vorL","vorR","vorLId","vorRId", - "status.wxr","status.wpt","status.sta","status.arpt"]) + "status.wxr","status.wpt","status.sta","status.arpt","terrHI","terrLO"]) me.symbols[element] = me.nd.getElementById(element); # load elements from vector image, and create instance variables using identical names, and call updateCenter() on each diff --git a/Models/Instruments/ND/canvas/map/TERRAIN.lcontroller b/Models/Instruments/ND/canvas/map/TERRAIN.lcontroller index dfe9f333..4fba3af4 100644 --- a/Models/Instruments/ND/canvas/map/TERRAIN.lcontroller +++ b/Models/Instruments/ND/canvas/map/TERRAIN.lcontroller @@ -14,8 +14,6 @@ canvas.SymbolLayer.add(name, { } }); -var terrain_tree = "/instrumentation/terrain"; - var new = func(layer) { var m = { parents: [__self__], @@ -36,14 +34,10 @@ var del = func() { var searchCmd = func { if(me.map.getRange() == nil) return []; - #var lat = getprop(terrain_tree~"/center/latitude-deg"); - #var lon = getprop(terrain_tree~"/center/longitude-deg"); - #if(lat == nil or lon == nil) { - var pos = geo.aircraft_position(); - lat = pos.lat(); - lon = pos.lon(); - #} + var pos = geo.aircraft_position(); + lat = pos.lat(); + lon = pos.lon(); var result = geo.Coord.new(); result.set_latlon(lat, lon); diff --git a/Models/Instruments/ND/canvas/map/TERRAIN.symbol b/Models/Instruments/ND/canvas/map/TERRAIN.symbol index 48c384d9..65467122 100644 --- a/Models/Instruments/ND/canvas/map/TERRAIN.symbol +++ b/Models/Instruments/ND/canvas/map/TERRAIN.symbol @@ -7,20 +7,19 @@ DotSym.makeinstance( name, __self__ ); var element_type = "group"; +var terrain_visible = props.globals.initNode("/custom/terrain/visible", 0,"INT"); +var terrain_minalt = props.globals.initNode("/custom/terrain/min-altitude", 0,"INT"); +var terrain_maxalt = props.globals.initNode("/custom/terrain/max-altitude", -9999,"INT"); + var tile_list = ["*black*","tile_01.png","tile_02.png","tile_03.png","tile_04.png","tile_06.png","tile_09.png"]; -var radar_beacon = 0; -var radar_cycle = 0; -var rader_cleared = 0; var get_elevation = func (lat, lon) { - var info = geodinfo(lat, lon); var elevation = 0; if (info != nil) { elevation = int(info[0] * 3.2808399); } else { elevation = nil; } return elevation; - } var updateTerrain = func(r_scaled){ @@ -28,7 +27,11 @@ var updateTerrain = func(r_scaled){ if(me.fetching) return; me.fetching = 1; - me.rader_cleared = 0; + + if (me.request_clear == 1) { + me.request_clear = 0; + me.clear(); + } var RAD2DEG = 57.2957795; var DEG2RAD = 0.016774532925; @@ -54,80 +57,85 @@ var updateTerrain = func(r_scaled){ col = -1 + (-1 * a); } - #var col = me.radar_beacon - me.tileradius; + var trn = me.terrlayer[side ~ a]; - #for (var a=0; a < me.tileradius; a+=1) { + var len = size(trn); + var range = me.range; - #var trnL = me.terrlayer["L" ~ a]; - #var trnR = me.terrlayer["R" ~ a]; - var trn = me.terrlayer[side ~ a]; + var tiles = me.tile_list; - var len = size(trn); - var range = me.range; + var proj_lon = pos_lon + ((col * (range/30) * math.sin(DEG2RAD * (heading - 90))) / 40); + var proj_lat = pos_lat + ((col * (range/30) * math.cos(DEG2RAD * (heading - 90))) / 40); - var tiles = me.tile_list; + var elevft = []; - var proj_lon = pos_lon + ((col * (range/30) * math.sin(DEG2RAD * (heading - 90))) / 40); - var proj_lat = pos_lat + ((col * (range/30) * math.cos(DEG2RAD * (heading - 90))) / 40); + for (var row = 0; row < len; row += 1) { - var elevft = []; + if (trn[row] == nil) { + append(elevft,-1); + continue; + } - for (var row = 0; row < len; row += 1) { + var point_lon = proj_lon + ((row * (range/30) / 40) * math.sin(DEG2RAD * heading)); + var point_lat = proj_lat + ((row * (range/30) / 40) * math.cos(DEG2RAD * heading)); - if (trn[row] == nil) { - append(elevft,-1); - continue; - } - - var point_lon = proj_lon + ((row * (range/30) / 40) * math.sin(DEG2RAD * heading)); - var point_lat = proj_lat + ((row * (range/30) / 40) * math.cos(DEG2RAD * heading)); - - var elev = me.get_elevation(point_lat, point_lon); - var grad = 0; #black - if (elev != nil) { - if (elev < me.basealtitudeft) grad = 0; # < 400 (at airport) use blank - trivial - else { - var diff = elev - altitudeft; - if (diff>=0) { - grad = int(diff/1000) + 3; - if (grad>5) grad = 5; - } else { - if (diff>-500) grad = 3; # lite yellow - else { - grad = 2 + int(diff/1000); - if (grad<0) grad = 0; - } + var elev = me.get_elevation(point_lat, point_lon); + var grad = 0; #black + if (elev != nil) { + if (elevme.max_altitude) me.max_altitude = elev; + if (elev < me.basealtitudeft) grad = 0; # < 400 (at airport) use blank - trivial + else { + var diff = elev - altitudeft; + if (diff>=0) { + grad = int(diff/1000) + 3; + if (grad>5) grad = 5; + } else { + if (diff>-500) grad = 3; # lite yellow + else { + grad = 2 + int(diff/1000); + if (grad<0) grad = 0; } } - append(elevft,grad); # 0-5 - } else { - append(elevft,6); # magenta } - + append(elevft,grad); # 0-5 + } else { + append(elevft,6); # magenta } + + } - for (var r=0; r < len; r+=1) { + me.radar_cleared = 0; - var imgx = elevft[r]; - if (imgx == -1) continue; - if (imgx < 1) trn[r].hide(); - else trn[r].setFile(me.imgpath ~ me.tile_list[imgx]).show(); - #trnR[r].setFile(me.imgpath ~ me.tile_list[2-imgx]).show(); - - } - - #} + for (var r=0; r < len; r+=1) { + var imgx = elevft[r]; + if (imgx == -1) continue; + if (imgx < 1) trn[r].hide(); + else trn[r].setFile(me.imgpath ~ me.tile_list[imgx]).show(); + } me.radar_beacon += 1; - if (me.radar_beacon >= (me.tileradius*2)) { - me.radar_beacon = 0; - me.radar_cycle += 1; + if (me.radar_beacon >= (me.tileradiusw*2)) { + me.update_altitudes(); + me.restart_beacon(); } #me.last_request = getprop("sim/time/elapsed-sec"); me.fetching = 0; }; +var update_altitudes = func { + me.terrain_minalt.setValue(me.min_altitude); + me.terrain_maxalt.setValue(me.max_altitude); +} + +var restart_beacon = func { + me.radar_beacon = 0; + me.radar_cycle += 1; + me.min_altitude = 9999; + me.max_altitude = -9999; +}; + var init = func { #print('TERRAIN init'); me.tile = 33; # preferred 34 @@ -137,24 +145,31 @@ var init = func { me.range = me.model.rangeNm; # Range of Navigation Display me.viewport_radius = me.getOption('viewport_radius', 670); me.imgpath = get_local_path('res/terrain/'); - me.rader_cleared = 1; + me.radar_beacon = 0; + me.radar_cycle = 0; + me.radar_cleared = 1; + me.request_clear = 0; me.basealtitudeft = nil; me.visible = 0; + me.min_altitude = 9999; + me.max_altitude = -9999; var tile = me.tile; var gx = int(me.viewport_radius / tile); - me.tileradius = gx; - me.terrlayer = {}; #me.element.createChild("image").set("z-index", -100).hide(); + var limx = int((512/tile)+0.5); # horiz space is smaller + me.tileradiusw = limx; - var centx = 0; #me.viewport_radius * -0.5; + me.terrlayer = {}; + + var centx = 0; var centy = -me.viewport_radius; var group = me.group.createChild("group").set("z-index", -100); #me.element - for (var c=0; cTERR000000v`WF)9%}T_kVY- z^*rlYYwhoEwt9c{o?6c{W}RJqUiG!r4^}@_{c!b-bK=#R)n|>t!RkY^IcFUA&E`n; z1=SbNI)D4s*8JPGYuDCtj_Ka&)5jFXi`Cy(|5N>E^{MI`b|MOWc=qrB=P>7&4Kv2? zSHD~RK=siA;2+DaZEBotJaJ+Dd4Kia1M_?JJJnat+vIw5BBFBD7&}K4-Zj;)4lRz~ zR6jp&@s@zJ`jYXvtNKLs%|raz>QBe?tLpcvAFIB6=wrk3(dyT$KdSzC2w?yl196_L z{<`|d>d&elAJQ0DN5BaBLG{noe^tLxecOQDGD}sUUbv&urQ`h5WNG~{m49=HvRLO1 z5?>LnuRb;|997{282bD%nR1gU3vn&tsJumbfh>oTrar!w8ZZ`pWLXB{($I;GKXsOk zbWed%E6F}n{Ydq7!|tMyH8AXiIIa4?h=%VSV^2xMbr-%wlT8X73@!&&{nsIK$I}Ao zMN1j)tA2BesZ>{tj}Y9bZ-1Xy;I*uX4sFo#q!M?1arL}{Eg_EF4}w7lQ_DNqs8f23 zm`{u|JH5Vl*hwpp$O*(31~&IrzdZFoz41_>Ziw<(3w6$MKS5)Xfb|!R27%~E7O7a zy)dn${qQCaT7$uHYgJy3YObNBEDtIh8s}=x)XK&ar(6@FM86NkwNf1|Xs&tPPCktbsAx>h|jt z|HBz$v6zBMXb$$$cc@gV=yqUs({!*C0A4YUi>mlj>XtwEfzikEy?ww;D7p0LCVkaY zd=e+8q=j$5Pz;8{0BjZ;C!Ukm%#Daq)}Bw6!(0Tw62((O8GjuMKQJL4tr)u|EJW!c zNW2!z?%~Tc^aEfZ4D+4Sa`Z`^W=Jy!+qygC0x|$D_oajNi;l`XcAH=7lZ&g` z&E&1U(s~lvg+>F?=_WlA(T;&J{O$?(CeH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SusF(7Q|PKt9zsxjI`P4qpe8G z(Ny(Uq@MlMr_}Ir<5f51h!HWp7Ay<}O~(i*_`tWnVe-Z(d)&rRlE%K`1y$g^<#_<) z0^h~{8L(PyjGRs3B|yjXrvg_|_W~m;sRtcLEY4o&uIL#9v^o}ewg5~oPLYBx?Cz!4sQcixI)%CcmQMj30I(STTt5h?x`Cf&LHN`qnr{ S**qWs0000qSFi(`m~_uI3EybKBg42DY#9>m|#c3?I)FnxKiG_8IC qr%9vQ1(sP3!Wm4yAkMR!Z@AfgD^!}rZ7qTN89ZJ6T-G@yGywonQ!MTP delta 134 zcmdnSxSnx>q$nE$1A~=2_aPv~SRCZ;#IWw1%*%<2(rG{uzC(hbxbNTwCWUur-fa79_3mfm-`njxgN@xNA(3~*j diff --git a/Models/Instruments/ND/canvas/res/terrain/tile_03.png b/Models/Instruments/ND/canvas/res/terrain/tile_03.png index ca873469f2f54a55d2e33c11e941f049e6826a0e..ff188f9ffcd3443652cd879f26542676e9f8badd 100644 GIT binary patch delta 2072 zcmV+z2|xQZXNXn%S8 zJKpFaJ$>GDp8LM8`?|+-OnUb0`OW96d-v|vg9i_uG->?o*(F=Hl<(SA`NIztt*s>! zCgcwqG^kgvUOjsB=-02GbzC<0>C?w^>#<|UmXwUIuAWd?Sy)z9FnaW8uR3+=)VXtK z&XfNA`}5wdTeq%VyY}wgd*Z}=et!=iu6gmIIhSkw=bx67C#OOkHEI-hef#$P_VYDz zUv)S(0gME8VlF>gLV*`}Z5}-kkws`}T^d zQ;Rr42njNtIaBM^ty}fmww3cfV#EmU2*ty-YjqDEG~T#T|I<$ug@yST2%4CQ-(rOS z@@32M<2B2dXBIEcEL)ZVxqo0m>D;-c<>iG!v6~q-0CKsxx!n9$uUgn*=@l4ZWwQnL zFI}3MH?MTsw3L}wvcM|2dbRHP^E6WQfBUVH8j~ldIV>$5FY^Tj`Gg|Zz<~q70H*%m ze>XjQ)_mc@w3e1hC*J~?`P$5 zbEHx7VUt2jMQ_m|`hSK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%Nt5q=6t^=+pQ%CcJ432*g z@e8;CCP=>vIork@QT{qCn4u-c%a#zA(}O^p8%KJvxewrb84)~lF=AE1Sni(oW!<`> zw1~Wy@D^?%$>jKxIae3Y)nJmZgAZN3C5y-O{{6nAz4ruwqB>C50z)<;W@gn{B;X=A zxOH=iE9i(xJW_0=ds1g`+In}=*VBJDfyTz&bGNabDJnQY>POfBX3r0bat`m%qlFMn3m z-`t=@sBFK-&2HaSuU7!5d91B5*~TO>V~kh@%olJ{s@ZC^bE-5L_h|t2dBEO~>4YYAK>H*Sc0}%Tse=AQyf|(UIX2H z4gwT4WKu$5hNMkaLnyenJJNr~W>3#wPW1eF3?-%47@~bDIT#sxX*@tqE;p?-<>JOv z_OJ{E6gP<@SvPN5>GVvhpZ=(%mSFjAB=^arTM zAQ`c;&A?;yG-nd3Ah(16z%Xlr>ETZ1$g$j01H!INr;l`+dE zV{=);4Q6JSb5($H`Fu$YFFVnPgMMa;i4qZ`*USbV;6+wQ-#Ha)VeY<#JSKY~)--d) n;LZ%Y_mJU`ik;B9D6sT@ONQqk{&h!!00000NkvXXu0mjfpSo(Y diff --git a/Models/Instruments/ND/canvas/res/terrain/tile_04.png b/Models/Instruments/ND/canvas/res/terrain/tile_04.png index aa0778293a5c8f12f23b023e556ab9c2e0840e66..f1604ba30d8379eb31888742e00ba0948861a65e 100644 GIT binary patch delta 140 zcmZ3_xRr5&BnJ}%1H)F;Ia4Rr#ti(`m~_uI3Ef(!~g42C{e_b=CSV751Ss#ksPUCjbc plSZ`*EVCShGnjlqoM$)BvGU!m%yIpF(*vlT!PC{xWt~$(697}&F9!es delta 134 zcmdnWxSnx>q$nE$1A~=2_aPv~SRCZ;#IWw1%*%<2(rG{uzC(^B6o`{an^LB{Ts5+h#DL diff --git a/Models/Instruments/ND/canvas/res/terrain/tile_06.png b/Models/Instruments/ND/canvas/res/terrain/tile_06.png index 151be7c439d2ae33340dcbbecb1485cee2b5a8df..1c97e713981806f741680e42daa500fd978f41fd 100644 GIT binary patch delta 141 zcmZ3_xQ%gwBnJ}%1H)F;Ia4RqSFi(`m~_uI3EybKBg42E<5^we8-I5L|Xn7+JMnpVGn q)1*=D0?RB1;S45U5a-#=H{6`7)b6ZrWoQKIXYh3Ob6Mw<&;$T^s4k@d delta 134 zcmdnSxSnx>q$nE$1A~=2_aPv~SRCZ;#IWw1%*%<2(rG{uzC(__E%Oao@oWObYMLyxI2J;{DIYzb~KnOqpmDbP0l+XkK85S|} diff --git a/Models/Instruments/ND/canvas/res/terrainND.svg b/Models/Instruments/ND/canvas/res/terrainND.svg deleted file mode 100644 index 65bc1e02..00000000 --- a/Models/Instruments/ND/canvas/res/terrainND.svg +++ /dev/null @@ -1,439 +0,0 @@ - -image/svg+xmlGijs de Rooy▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index f3174d52..4b51decc 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -12,6 +12,9 @@ var adirs_3 = props.globals.getNode("/instrumentation/efis[0]/nd/ir-3", 1); var vhdg_bug = props.globals.getNode("/it-autoflight/input/hdg",0); # ND compass position deg +var terrain_visible = props.globals.getNode("/custom/terrain/visible", 0); +var terrain_minalt = props.globals.getNode("/custom/terrain/min-altitude", 0); +var terrain_maxalt = props.globals.getNode("/custom/terrain/max-altitude", -9999); canvas.NDStyles["Airbus"] = { font_mapper: func(family, weight) { @@ -86,23 +89,22 @@ canvas.NDStyles["Airbus"] = { layers: [ { name:"TERRAIN", - isMapStructure:1, - always_update: 1, - update_on:[ {rate_hz: 0.4}, "toggle_range","toggle_display_mode","toggle_terrain"], + isMapStructure: 1, + update_on:[ {rate_hz: 18}, "toggle_range","toggle_display_mode","toggle_terrain"], predicate: func(nd, layer) { #print("TERRAIN TOGGLE: " ~ nd.get_switch("toggle_terrain")); var visible = nd.get_switch("toggle_terrain") and - nd.get_switch("toggle_display_mode") != "PLAN" and (nd.rangeNm() <= 40) and !nd.get_switch("toggle_centered") and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)); - layer.group.setVisible(visible); + nd.get_switch("toggle_display_mode") != "PLAN" and (nd.rangeNm() <= 40) and !nd.get_switch("toggle_centered") and + (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)); + layer.group.setVisible(visible); if (visible) { layer.update(); + } else { + #terrain_visible.setValue(0); } }, # end of layer update predicate options: { viewport_radius: 670, #512, #706, - #position_callback: func(nd, pos){ - # pos = me.startpos; - #} }, "z-index": -100, }, @@ -1980,6 +1982,26 @@ canvas.NDStyles["Airbus"] = { nd.symbols.offsetLbl.hide(); } } + }, + { + id: "terrGroup", + impl: { + init: func(nd,symbol), + predicate: func(nd) ( nd.get_switch("toggle_terrain") and + nd.get_switch("toggle_display_mode") != "PLAN" and (nd.rangeNm() <= 40) and !nd.get_switch("toggle_centered") and + (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)) ), + is_true: func(nd){ + if (terrain_maxalt.getValue() != -9999) { + nd.symbols.terrLO.setText(sprintf("%03d",int(terrain_minalt.getValue()/100))); + nd.symbols.terrHI.setText(sprintf("%03d",int(terrain_maxalt.getValue()/100))); + nd.symbols.terrGroup.show(); + terrain_maxalt.setValue(-9999); #update visual once at radar cycle + } + }, + is_false: func(nd){ + nd.symbols.terrGroup.hide(); + } + } } ], # end of vector with features