Showing 2 changed files with 69 additions and 28 deletions
+52 -28
Nasal/display.nas
... ...
@@ -128,7 +128,7 @@ var displayClass = {
128 128
                     'DME1',
129 129
                     'PFD-Map',
130 130
                     'PFD-Multilines',
131
-                    'WindData', 'WindData-OPTN1', 'WindData-OPTN2', 'WindData-OPTN1-HDG', 'WindData-OPTN2-symbol', 'WindData-OPTN2-headwind', 'WindData-OPTN2-crosswind'
131
+                    'WindData', 'WindData-OPTN1', 'WindData-OPTN2', 'WindData-OPTN1-HDG', 'WindData-OPTN2-symbol', 'WindData-OPTN2-headwind', 'WindData-OPTN2-crosswind', 'WindData-NODATA',
132 132
                 );
133 133
                 append(groups.clip,
134 134
                     'SpeedLint1',
... ...
@@ -798,36 +798,60 @@ var displayClass = {
798 798
 # update the window text and arrows for OPTN1/2 {{{
799 799
         if (me._winddata_optn == 0)
800 800
             return;
801
-        var wind_hdg = getprop('/environment/wind-from-heading-deg');
802
-        var wind_spd = getprop('/environment/wind-speed-kt');
803
-        var alpha = wind_hdg - me._updated_hdg;
804
-        if (me._winddata_optn == 1) {
805
-            me.screenElements['WindData-OPTN1-HDG']
806
-                .setRotation((alpha + 180) * D2R);
807
-            me.screenElements['WindData-OPTN1-HDG-text']
808
-                .setText(sprintf("%03i°", wind_hdg));
809
-            me.screenElements['WindData-OPTN1-SPD-text']
810
-                .setText(int(wind_spd) ~ 'KT');
811
-        }
812
-        else { # me._winddata_optn == 2
813
-            alpha *= D2R;
814
-            var Vt = wind_spd * math.sin(alpha);
815
-            var Ve = wind_spd * math.cos(alpha);
816
-            if (Vt != 0) {
817
-                me.screenElements['WindData-OPTN2-crosswind-text']
818
-                    .setText(sprintf('%i', abs(Vt)));
819
-                me.screenElements['WindData-OPTN2-crosswind']
820
-                    .setScale(-abs(Vt)/Vt, 1)
821
-                    .setTranslation(-35 * (abs(Vt)/Vt + 1), 0);
801
+        if (me._updated_ias < 30) {
802
+            me.screenElements['WindData-NODATA']
803
+                .hide();
804
+            var wind_hdg = getprop('/environment/wind-from-heading-deg');
805
+            var wind_spd = getprop('/environment/wind-speed-kt');
806
+            var alpha = wind_hdg - me._updated_hdg;
807
+            if (me._winddata_optn == 1) {
808
+                me.screenElements['WindData-OPTN1-HDG']
809
+                    .setRotation((alpha + 180) * D2R)
810
+                    .show();
811
+                me.screenElements['WindData-OPTN1-HDG-text']
812
+                    .setText(sprintf("%03i°", wind_hdg))
813
+                    .show();
814
+                me.screenElements['WindData-OPTN1-SPD-text']
815
+                    .setText(int(wind_spd) ~ 'KT')
816
+                    .show();
822 817
             }
823
-            if (Ve != 0) {
824
-                me.screenElements['WindData-OPTN2-headwind-text']
825
-                    .setText(sprintf('%i', abs(Ve)));
826
-                me.screenElements['WindData-OPTN2-headwind']
827
-                    .setScale(1, abs(Ve)/Ve)
828
-                    .setTranslation(0, 515 * (1 - abs(Ve)/Ve));
818
+            else { # me._winddata_optn == 2
819
+                alpha *= D2R;
820
+                var Vt = wind_spd * math.sin(alpha);
821
+                var Ve = wind_spd * math.cos(alpha);
822
+                if (Vt != 0) {
823
+                    me.screenElements['WindData-OPTN2-crosswind-text']
824
+                        .setText(sprintf('%i', abs(Vt)))
825
+                        .show();
826
+                    me.screenElements['WindData-OPTN2-crosswind']
827
+                        .setScale(-abs(Vt)/Vt, 1)
828
+                        .setTranslation(-35 * (abs(Vt)/Vt + 1), 0)
829
+                        .show();
830
+                }
831
+                if (Ve != 0) {
832
+                    me.screenElements['WindData-OPTN2-headwind-text']
833
+                        .setText(sprintf('%i', abs(Ve)))
834
+                        .show();
835
+                    me.screenElements['WindData-OPTN2-headwind']
836
+                        .setScale(1, abs(Ve)/Ve)
837
+                        .setTranslation(0, 515 * (1 - abs(Ve)/Ve))
838
+                        .show();
839
+                }
829 840
             }
830 841
         }
842
+        else {
843
+            foreach (var e; [
844
+                    'WindData-OPTN1-HDG',
845
+                    'WindData-OPTN1-HDG-text',
846
+                    'WindData-OPTN1-SPD-text',
847
+                    'WindData-OPTN2-crosswind-text',
848
+                    'WindData-OPTN2-crosswind',
849
+                    'WindData-OPTN2-headwind-text',
850
+                    'WindData-OPTN2-headwind'
851
+            ])
852
+                me.screenElements[e].hide();
853
+            me.screenElements['WindData-NODATA'].show();
854
+        }
831 855
         settimer(func me.updateWindData(), 0.5);
832 856
     },
833 857
     _winddata_optn : 0,
+17
Systems/screen.svg
... ...
@@ -7188,6 +7188,23 @@
7188 7188
          width="80"
7189 7189
          id="WindData-bg"
7190 7190
          style="display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7191
+      <text
7192
+         xml:space="preserve"
7193
+         style="font-style:normal;font-weight:normal;font-size:16px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
7194
+         x="285.13638"
7195
+         y="483.44598"
7196
+         id="WindData-NODATA"
7197
+         inkscape:label="WindData-NODATA"><tspan
7198
+           sodipodi:role="line"
7199
+           id="tspan6137"
7200
+           x="285.13638"
7201
+           y="483.44598"
7202
+           style="fill:#ffffff">NO WIND</tspan><tspan
7203
+           sodipodi:role="line"
7204
+           x="285.13638"
7205
+           y="503.44598"
7206
+           id="tspan6141"
7207
+           style="fill:#ffffff">DATA</tspan></text>
7191 7208
       <g
7192 7209
          id="WindData-OPTN2"
7193 7210
          inkscape:label="WindData-OPTN2"