Showing 4 changed files with 238 additions and 7 deletions
+68 -3
Nasal/display.nas
... ...
@@ -106,8 +106,8 @@ var displayClass = {
106 106
                     'NAV1-pointer',
107 107
                     'NAV2-pointer',
108 108
                     'GPS-pointer',
109
-                    'Bearing1',
110
-                    'Bearing2',
109
+                    'BRG1-pointer',
110
+                    'BRG2-pointer',
111 111
                     'SelectedHDG-bg',
112 112
                     'SelectedHDG-bgtext',
113 113
                     'SelectedHDG-text',
... ...
@@ -146,6 +146,8 @@ var displayClass = {
146 146
                     'Speed110',
147 147
                     'Alt11100',
148 148
                     'HDG-text',
149
+                    'BRG1-pointer', 'BRG1-SRC-text', 'BRG1-DST-text', 'BRG1-WPID-text',
150
+                    'BRG2-pointer', 'BRG2-SRC-text', 'BRG2-DST-text', 'BRG2-WPID-text',
149 151
                     'WindData-OPTN1-HDG-text', 'WindData-OPTN1-SPD-text',
150 152
                     'WindData-OPTN2-crosswind-text', 'WindData-OPTN2-headwind-text',
151 153
                     'AltBigC', 'AltSmallC'
... ...
@@ -174,6 +176,7 @@ var displayClass = {
174 176
                 me.updateTIME();
175 177
                 me.updateOAT();
176 178
                 me.updateTAS();
179
+                me.updateBRG();
177 180
                 me.timerTrigger();
178 181
             }
179 182
             me._updateRadio({auto:'nav'});
... ...
@@ -829,6 +832,68 @@ var displayClass = {
829 832
     },
830 833
     _winddata_optn : 0,
831 834
 #}}}
835
+
836
+    updateBRG : func {
837
+# displays and update
838
+        foreach (var brg; [1, 2]) {
839
+            var source = 'brg' ~ brg ~ '-source';
840
+
841
+            var dev = radios.getNode(source).getValue();
842
+            var el  = 'BRG' ~ brg;
843
+            if (dev != 'OFF') {
844
+                var info = {
845
+                    pointer : nil,
846
+                    id : 'NO DATA',
847
+                    hdg : nil,
848
+                    dst : '--.-NM'
849
+                };
850
+                if (left(dev, 3) == 'NAV') {
851
+                    info.pointer = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/in-range');
852
+                    if (info.pointer) {
853
+                        info.id  = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/nav-id');
854
+                        info.hdg = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/heading-deg');
855
+                        info.dst = sprintf('%.1d', getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/nav-distance') / 1852); # m -> /1852
856
+                    }
857
+                }
858
+                elsif (dev == 'GPS') {
859
+                    info.pointer = props.getNode('/instrumentation/gps/wp').getChild('wp[1])');
860
+                    if (info.pointer) {
861
+                        info.id  = getprop('/instrumentation/gps/wp/wp[1]/ID');
862
+                        info.hdg = getprop('/instrumentation/gps/wp/wp[1]/bearing-mag-deg');
863
+                        info.dst = sprintf('%.1d', getprop('/instrumentation/gps/wp/wp[1]/distance-nm'));
864
+                    }
865
+                }
866
+                else { # there are 2 available ADF in FG, but instrument manage only 1
867
+                    info.pointer = getprop('/instrumentation/adf/in-range');
868
+                    if (info.pointer) {
869
+                        info.id  = getprop('/instrumentation/adf/ident');
870
+                        info.hdg = getprop('/instrumentation/adf/indicated-bearing-deg');
871
+                    }
872
+                }
873
+
874
+                if (info.pointer)
875
+                    me.screenElements[el ~ '-pointer']
876
+                        .setRotation(-info.hdg-me._updated_hdg * D2R)
877
+                        .show();
878
+                else
879
+                    me.screenElements[el ~ '-pointer']
880
+                        .hide();
881
+                me.screenElements[el ~ '-SRC-text']
882
+                    .setText(dev);
883
+                me.screenElements[el ~ '-DST-text']
884
+                    .setText(info.dst);
885
+                me.screenElements[el ~ '-WPID-text']
886
+                    .setText(info.id);
887
+                me.screenElements['BRG' ~ brg]
888
+                    .show();
889
+            }
890
+            else {
891
+                me.screenElements['BRG' ~ brg]
892
+                    .hide();
893
+            }
894
+        }
895
+        settimer(func me.updateBRG(), 1);
896
+    },
832 897
 };
833 898
 
834 899
 var keyMap = {
... ...
@@ -844,7 +909,7 @@ var keyMap = {
844 909
             texts : [ 'ADC1', 'ADC2', '', 'AHRS1', 'AHRS2'],
845 910
         },
846 911
         PFD : {
847
-            texts : [ 'SYN VIS', 'DFLTS', 'AOA/WIND', 'DME', 'BRG', 'HSI FMT', '', '', 'ALT UNIT', 'STD BARO' ],
912
+            texts : [ 'SYN VIS', 'DFLTS', 'AOA/WIND', 'DME', 'BRG1', 'HSI FMT', 'BRG2', '', 'ALT UNIT', 'STD BARO' ],
848 913
             'SYN VIS' : {
849 914
                 texts : [ 'PATHWAY', 'SYN TERR', 'HR2NHDG', 'APTSIGNS', 'FPM'],
850 915
             },
+12
Nasal/softkeys.nas
... ...
@@ -96,6 +96,18 @@ var softkeysClass = {
96 96
                         },
97 97
                     },
98 98
                 },
99
+                BRG1 : func (brg = 1){
100
+                    var source = 'brg' ~ brg ~ '-source';
101
+                    var list = ['NAV' ~ brg, 'GPS', 'ADF', 'OFF'];
102
+                    var index = std.Vector
103
+                                   .new(list)
104
+                                   .index(radios.getNode(source).getValue());
105
+                    var next = (index == size(list) -1) ?  0 : index + 1;
106
+                    radios.getNode(source).setValue(list[next]);
107
+                },
108
+                BRG2 : func {
109
+                    call(me.bindings.PFD.PFD.BRG1, [ 2 ], me);
110
+                },
99 111
             },
100 112
             XPDR: {
101 113
                 CODE: {
+156 -4
Systems/screen.svg
... ...
@@ -6222,8 +6222,8 @@
6222 6222
            style="display:inline;fill:#3e3e3e;fill-opacity:0.56226412;stroke:#ffffff;stroke-width:0.92486846;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
6223 6223
       </g>
6224 6224
       <g
6225
-         id="Bearing1"
6226
-         inkscape:label="Bearing1"
6225
+         id="BRG1-pointer"
6226
+         inkscape:label="BRG1-pointer"
6227 6227
          style="display:inline">
6228 6228
         <path
6229 6229
            style="display:inline;fill:none;stroke:#00ffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
... ...
@@ -6246,8 +6246,8 @@
6246 6246
       </g>
6247 6247
       <g
6248 6248
          style="display:inline"
6249
-         inkscape:label="Bearing2"
6250
-         id="Bearing2">
6249
+         inkscape:label="BRG2-pointer"
6250
+         id="BRG2-pointer">
6251 6251
         <path
6252 6252
            sodipodi:nodetypes="cc"
6253 6253
            inkscape:connector-curvature="0"
... ...
@@ -6935,6 +6935,54 @@
6935 6935
          id="DME1-bg"
6936 6936
          d="m 237,670 v -78 h 56 c 0,46.09733 24,78 24,78 h -80"
6937 6937
          style="display:inline;opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
6938
+      <text
6939
+         xml:space="preserve"
6940
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
6941
+         x="239.58443"
6942
+         y="611.12927"
6943
+         id="DME1-title"
6944
+         inkscape:label="DME1-title"><tspan
6945
+           sodipodi:role="line"
6946
+           id="tspan6098"
6947
+           x="239.58443"
6948
+           y="611.12927"
6949
+           style="fill:#ffffff">DME</tspan></text>
6950
+      <text
6951
+         xml:space="preserve"
6952
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
6953
+         x="239.77455"
6954
+         y="628.24243"
6955
+         id="DME1-SRC-text"
6956
+         inkscape:label="DME1-SRC-text"><tspan
6957
+           sodipodi:role="line"
6958
+           id="tspan6111"
6959
+           x="239.77455"
6960
+           y="628.24243"
6961
+           style="fill:#00ffff">NAV1</tspan></text>
6962
+      <text
6963
+         xml:space="preserve"
6964
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
6965
+         x="237.4928"
6966
+         y="647.4472"
6967
+         id="DME1-FREQ-text"
6968
+         inkscape:label="DME1-FREQ-text"><tspan
6969
+           sodipodi:role="line"
6970
+           id="tspan6115"
6971
+           x="237.4928"
6972
+           y="647.4472"
6973
+           style="fill:#00ffff">123.45</tspan></text>
6974
+      <text
6975
+         xml:space="preserve"
6976
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
6977
+         x="237.68295"
6978
+         y="666.27173"
6979
+         id="DME1-DST-text"
6980
+         inkscape:label="DME1-DST-text"><tspan
6981
+           sodipodi:role="line"
6982
+           id="tspan6119"
6983
+           x="237.68295"
6984
+           y="666.27173"
6985
+           style="fill:#ffffff">99.9NM</tspan></text>
6938 6986
     </g>
6939 6987
     <g
6940 6988
        id="BRG1"
... ...
@@ -6946,6 +6994,54 @@
6946 6994
          id="BRG1-bg"
6947 6995
          d="m 237,676 h 84 c 23.41331,39.76873 75,60 75,60 H 237 Z"
6948 6996
          style="display:inline;opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
6997
+      <path
6998
+         sodipodi:nodetypes="cc"
6999
+         inkscape:connector-curvature="0"
7000
+         id="path5378-2"
7001
+         d="m 296.49782,722.74639 h 63.3915"
7002
+         style="display:inline;fill:none;stroke:#00ffff;stroke-width:2.02932835;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7003
+      <path
7004
+         sodipodi:nodetypes="ccc"
7005
+         inkscape:connector-curvature="0"
7006
+         id="path5376-6"
7007
+         d="m 320.14562,734.07451 -17.5,-11.32812 17.5,-11.32812"
7008
+         style="display:inline;fill:none;stroke:#00ffff;stroke-width:1.70979106;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7009
+      <text
7010
+         xml:space="preserve"
7011
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
7012
+         x="239.5529"
7013
+         y="695.16937"
7014
+         id="BRG1-DST-text"
7015
+         inkscape:label="BRG1-DST-text"><tspan
7016
+           sodipodi:role="line"
7017
+           id="tspan5857-2-0"
7018
+           x="239.5529"
7019
+           y="695.16937"
7020
+           style="fill:#ffffff">99.9NM</tspan></text>
7021
+      <text
7022
+         xml:space="preserve"
7023
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
7024
+         x="241.2616"
7025
+         y="713.16797"
7026
+         id="BRG1-WPID-text"
7027
+         inkscape:label="BRG1-WPID-text"><tspan
7028
+           sodipodi:role="line"
7029
+           id="tspan5857-9-3"
7030
+           x="241.2616"
7031
+           y="713.16797"
7032
+           style="fill:#00ffff">WPID</tspan></text>
7033
+      <text
7034
+         xml:space="preserve"
7035
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
7036
+         x="240.84253"
7037
+         y="731.08093"
7038
+         id="BRG1-SRC-text"
7039
+         inkscape:label="BRG1-SRC-text"><tspan
7040
+           sodipodi:role="line"
7041
+           id="tspan5857-0"
7042
+           x="240.84253"
7043
+           y="731.08093"
7044
+           style="fill:#ffffff">NAV1</tspan></text>
6949 7045
     </g>
6950 7046
     <g
6951 7047
        id="PFD-Multilines"
... ...
@@ -6981,6 +7077,62 @@
6981 7077
          id="BRG2-bg"
6982 7078
          d="m 600,676 h 84 v 60 H 527 c 0,0 48.17738,-22.01773 73,-60 z"
6983 7079
          style="display:inline;opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7080
+      <path
7081
+         inkscape:connector-curvature="0"
7082
+         id="path5382-6"
7083
+         d="m 626.69102,722.59238 c -3.32886,0 -6.65772,0 -9.98658,0"
7084
+         style="display:inline;fill:none;stroke:#00ffff;stroke-width:1.08442605;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7085
+      <path
7086
+         inkscape:connector-curvature="0"
7087
+         id="path5387-7"
7088
+         d="m 599.26678,711.18476 c 5.81255,3.80255 11.62511,7.60508 17.43766,11.40762 -5.81255,3.80254 -11.62511,7.60508 -17.43766,11.40762"
7089
+         style="display:inline;fill:none;stroke:#00ffff;stroke-width:1.71272147;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7090
+      <path
7091
+         inkscape:connector-curvature="0"
7092
+         id="path5390-5"
7093
+         d="m 559.69754,722.59238 c 3.91595,0 7.83189,0 11.74785,0"
7094
+         style="display:inline;fill:none;stroke:#00ffff;stroke-width:1.20042503;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7095
+      <path
7096
+         inkscape:connector-curvature="0"
7097
+         id="path5396-6"
7098
+         d="m 611.07939,718.91251 c -13.21133,0 -26.42267,0 -39.634,0 0,2.45324 0,4.9065 0,7.35975 13.21133,0 26.42267,0 39.634,0"
7099
+         style="fill:none;stroke:#00ffff;stroke-width:2.35714316;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7100
+      <text
7101
+         xml:space="preserve"
7102
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
7103
+         x="630.98438"
7104
+         y="729.5387"
7105
+         id="BRG2-SRC-text"
7106
+         inkscape:label="BRG2-SRC-text"><tspan
7107
+           sodipodi:role="line"
7108
+           id="tspan5857"
7109
+           x="630.98438"
7110
+           y="729.5387"
7111
+           style="fill:#ffffff">NAV2</tspan></text>
7112
+      <text
7113
+         xml:space="preserve"
7114
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
7115
+         x="630.83301"
7116
+         y="712.19623"
7117
+         id="BRG2-WPID-text"
7118
+         inkscape:label="BRG2-WPID-text"><tspan
7119
+           sodipodi:role="line"
7120
+           id="tspan5857-9"
7121
+           x="630.83301"
7122
+           y="712.19623"
7123
+           style="fill:#00ffff">WPID</tspan></text>
7124
+      <text
7125
+         xml:space="preserve"
7126
+         style="font-style:normal;font-weight:normal;font-size:18.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
7127
+         x="608.20819"
7128
+         y="694.95819"
7129
+         id="BRG2-DST-text"
7130
+         inkscape:label="BRG2-DST-text"><tspan
7131
+           sodipodi:role="line"
7132
+           id="tspan5857-2"
7133
+           x="608.20819"
7134
+           y="694.95819"
7135
+           style="fill:#ffffff">99.9NM</tspan></text>
6984 7136
     </g>
6985 7137
     <path
6986 7138
        style="display:none;opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+2
zkv1000.nas
... ...
@@ -39,6 +39,8 @@ var init_props = func {
39 39
     radios.getNode('comm-tune',1).setIntValue(0);
40 40
     radios.getNode('comm-freq-mhz',1).alias('/instrumentation/comm/frequencies/standby-mhz');
41 41
     radios.getNode('xpdr-mode',1).setValue('GND');
42
+    radios.getNode('brg1-source',1).setValue('OFF');
43
+    radios.getNode('brg2-source',1).setValue('OFF');
42 44
 
43 45
     alerts = zkv.getNode('alerts',1);
44 46
     alerts.getNode('traffic-proximity',1).setIntValue(0);