Showing 6 changed files with 118 additions and 1 deletions
+9
Nasal/display.nas
... ...
@@ -1078,6 +1078,7 @@ var displayClass = {
1078 1078
                 else
1079 1079
                     me.screenElements['CDI-GPS-XTK-text']
1080 1080
                         .hide();
1081
+                me.screenElements['CDI-GPS-ANN-text'].hide();
1081 1082
             }
1082 1083
             else { # GPS
1083 1084
                 # TODO: deviation depending of the flight phase
... ...
@@ -1085,6 +1086,14 @@ var displayClass = {
1085 1086
                 var abs_deflection_max = 2.4;
1086 1087
                 if (me.screenElements['LATMOD-Armed-text'].getText() == 'GPS')
1087 1088
                     abs_deflection_max = 0.5;
1089
+                if (getprop('/instrumentation/gps/mode') == 'obs') {
1090
+                    abs_deflection_max = 0.1;
1091
+                    me.screenElements['CDI-GPS-ANN-text']
1092
+                        .setText('OBS')
1093
+                        .show();
1094
+                }
1095
+                else
1096
+                    me.screenElements['CDI-GPS-ANN-text'].hide();
1088 1097
                 var abs_deflection = abs(deflection);
1089 1098
                 me.screenElements['CDI-GPS-XTK-text']
1090 1099
                     .setText(sprintf((abs_deflection < 1 ? 'XTK %.1fNM' : 'XTK %iNM'), abs_deflection))
+21
Nasal/softkeys.nas
... ...
@@ -421,6 +421,27 @@ var softkeysClass = {
421 421
                 me.bindings.PFD.XPDR.ident.start();
422 422
                 call(me.bindings.PFD.XPDR.CODE.exit, [], me);
423 423
             },
424
+            OBS : func {
425
+                if (cdi.getValue('source') != 'GPS')
426
+                    return;
427
+                var cmd  = props.globals.getNode('/instrumentation/gps/command');
428
+                var mode = getprop('/instrumentation/gps/mode');
429
+                if (mode == 'dto') mode = 'direct';
430
+                if (mode != 'obs') {
431
+                    data._previous_gps_mode = mode;
432
+                    cmd.setValue('obs');
433
+                    aliases.GPS.course = 'selected-course-deg';
434
+                    setprop('/instrumentation/gps/selected-course-deg', int(getprop('/instrumentation/gps/desired-course-deg')));
435
+                    me.colored['OBS'] = 1;
436
+                }
437
+                else {
438
+                    cmd.setValue(data._previous_gps_mode);
439
+                    delete(data, '_previous_gps_mode');
440
+                    aliases.GPS.course = 'desired-course-deg';
441
+                    me.colored['OBS'] = 0;
442
+                }
443
+                me.device.display.setSoftKeyColor(4, me.colored['OBS'], 1);
444
+            },
424 445
             CDI : func {
425 446
                 var list = ['OFF'];
426 447
                 if (getprop('/instrumentation/gps/route-distance-nm') != nil)
+1 -1
README.md
... ...
@@ -86,13 +86,13 @@ Please report bug at <zkv1000@seb.lautre.net>.
86 86
   * integration of [GFC700 from the official Stuart Buchanan's FG1000](http://wiki.flightgear.org/FG1000#GFC700_Autopilot)
87 87
 * ![][90%]
88 88
   * TMR/REF Timer ![][done], Vspeeds ![][done], minimums ![][pending] (don't understand the role of this)
89
+  * route displayed on map: legs ![][done], current and next leg ![][done], OBS ![][done], TOC/TOD ![][ongoing]
89 90
   * angle of attack display (not sure about calculation): specific for each airplane (see Installation instructions below)
90 91
   * Bearing needs some checks to be sure it shows the correct information
91 92
   * XPDR: emergency code depending of the country (eg.: 1200 for US, 7700 for Europe), should be set in settings
92 93
   * use of [maketimer()](http://wiki.flightgear.org/Nasal_library#maketimer.28.29) instead of [settimer()](http://wiki.flightgear.org/Nasal_library#settimer.28.29) when possible
93 94
 * ![][80%]
94 95
   * Setting pages (MFD): pages/sub-pages selection via FMS knob ![][done], pages content implementation ![][ongoing]
95
-  * route displayed on map: legs ![][done], current and next leg ![][done], TOC/TOD ![][ongoing], OBS ![][ongoing]
96 96
 * ![][70%]
97 97
 * ![][60%]
98 98
   * NOT TESTED: add the posssibility to only use Nasal part of the instrument. This in case of a cockpit which already includes needed objects and animations for screens, knobs and buttons in its config files
+29
pfd-copilot.xml
... ...
@@ -545,6 +545,16 @@
545 545
       <binding>
546 546
         <condition>
547 547
           <property>/instrumentation/zkv1000/PFD-copilot/status</property>
548
+          <not>
549
+            <equals>
550
+              <property>/instrumentation/zkv1000/cdi/source</property>
551
+              <value>GPS</value>
552
+            </equals>
553
+            <equals>
554
+              <property>/instrumentation/gps/mode</property>
555
+              <value>obs</value>
556
+            </equals>
557
+          </not>
548 558
         </condition>
549 559
         <command>property-adjust</command>
550 560
         <property>/instrumentation/zkv1000/cdi/course</property>
... ...
@@ -553,6 +563,25 @@
553 563
         <max>359</max>
554 564
         <wrap>true</wrap>
555 565
       </binding>
566
+      <binding>
567
+        <condition>
568
+          <property>/instrumentation/zkv1000/PFD-copilot/status</property>
569
+          <equals>
570
+            <property>/instrumentation/zkv1000/cdi/source</property>
571
+            <value>GPS</value>
572
+          </equals>
573
+          <equals>
574
+            <property>/instrumentation/gps/mode</property>
575
+            <value>obs</value>
576
+          </equals>
577
+        </condition>
578
+        <command>property-adjust</command>
579
+        <property>/instrumentation/gps/selected-course-deg</property>
580
+        <factor>1</factor>
581
+        <min>0</min>
582
+        <max>359</max>
583
+        <wrap>true</wrap>
584
+      </binding>
556 585
       <binding>
557 586
         <condition>
558 587
           <property>/instrumentation/zkv1000/PFD-copilot/status</property>
+29
pfd-pilot.xml
... ...
@@ -545,6 +545,16 @@
545 545
       <binding>
546 546
         <condition>
547 547
           <property>/instrumentation/zkv1000/PFD-pilot/status</property>
548
+          <not>
549
+            <equals>
550
+              <property>/instrumentation/zkv1000/cdi/source</property>
551
+              <value>GPS</value>
552
+            </equals>
553
+            <equals>
554
+              <property>/instrumentation/gps/mode</property>
555
+              <value>obs</value>
556
+            </equals>
557
+          </not>
548 558
         </condition>
549 559
         <command>property-adjust</command>
550 560
         <property>/instrumentation/zkv1000/cdi/course</property>
... ...
@@ -553,6 +563,25 @@
553 563
         <max>359</max>
554 564
         <wrap>true</wrap>
555 565
       </binding>
566
+      <binding>
567
+        <condition>
568
+          <property>/instrumentation/zkv1000/PFD-pilot/status</property>
569
+          <equals>
570
+            <property>/instrumentation/zkv1000/cdi/source</property>
571
+            <value>GPS</value>
572
+          </equals>
573
+          <equals>
574
+            <property>/instrumentation/gps/mode</property>
575
+            <value>obs</value>
576
+          </equals>
577
+        </condition>
578
+        <command>property-adjust</command>
579
+        <property>/instrumentation/gps/selected-course-deg</property>
580
+        <factor>1</factor>
581
+        <min>0</min>
582
+        <max>359</max>
583
+        <wrap>true</wrap>
584
+      </binding>
556 585
       <binding>
557 586
         <condition>
558 587
           <property>/instrumentation/zkv1000/PFD-pilot/status</property>
+29
pfd.xml
... ...
@@ -545,6 +545,16 @@
545 545
       <binding>
546 546
         <condition>
547 547
           <property>/instrumentation/zkv1000/PFD/status</property>
548
+          <not>
549
+            <equals>
550
+              <property>/instrumentation/zkv1000/cdi/source</property>
551
+              <value>GPS</value>
552
+            </equals>
553
+            <equals>
554
+              <property>/instrumentation/gps/mode</property>
555
+              <value>obs</value>
556
+            </equals>
557
+          </not>
548 558
         </condition>
549 559
         <command>property-adjust</command>
550 560
         <property>/instrumentation/zkv1000/cdi/course</property>
... ...
@@ -553,6 +563,25 @@
553 563
         <max>359</max>
554 564
         <wrap>true</wrap>
555 565
       </binding>
566
+      <binding>
567
+        <condition>
568
+          <property>/instrumentation/zkv1000/PFD/status</property>
569
+          <equals>
570
+            <property>/instrumentation/zkv1000/cdi/source</property>
571
+            <value>GPS</value>
572
+          </equals>
573
+          <equals>
574
+            <property>/instrumentation/gps/mode</property>
575
+            <value>obs</value>
576
+          </equals>
577
+        </condition>
578
+        <command>property-adjust</command>
579
+        <property>/instrumentation/gps/selected-course-deg</property>
580
+        <factor>1</factor>
581
+        <min>0</min>
582
+        <max>359</max>
583
+        <wrap>true</wrap>
584
+      </binding>
556 585
       <binding>
557 586
         <condition>
558 587
           <property>/instrumentation/zkv1000/PFD/status</property>