|
From: <fli...@li...> - 2017-10-17 23:48:41
|
Revision: 3054
http://sourceforge.net/p/flightgear/fgaddon/3054
Author: lbrenta
Date: 2017-10-17 23:48:39 +0000 (Tue, 17 Oct 2017)
Log Message:
-----------
Citation: Enable spoken ATIS. Bug reported by pilot WST at Klagenfurt. Thanks!
* Systems/instrumentation.xml: add comm1, comm2 to enable spoken ATIS.
* Nasal/Electrical.nas: set the "power-btn" property for comm/nav to
true iff the device is "serviceable" (i.e. its power button is on)
and it receives electricity.
* Models/Instruments/VHF-22/ctl22-com[12].xml,
Models/Instruments/VIR-32/ctl32-nav[12].xml: use the "power-btn"
property to determine whether the device is actually operating.
Modified Paths:
--------------
trunk/Aircraft/Citation/Models/Instruments/VHF-22/ctl22-com1.xml
trunk/Aircraft/Citation/Models/Instruments/VHF-22/ctl22-com2.xml
trunk/Aircraft/Citation/Models/Instruments/VIR-32/ctl32-nav1.xml
trunk/Aircraft/Citation/Models/Instruments/VIR-32/ctl32-nav2.xml
trunk/Aircraft/Citation/Nasal/Electrical.nas
trunk/Aircraft/Citation/Systems/instrumentation.xml
Modified: trunk/Aircraft/Citation/Models/Instruments/VHF-22/ctl22-com1.xml
===================================================================
--- trunk/Aircraft/Citation/Models/Instruments/VHF-22/ctl22-com1.xml 2017-10-17 21:35:09 UTC (rev 3053)
+++ trunk/Aircraft/Citation/Models/Instruments/VHF-22/ctl22-com1.xml 2017-10-17 23:48:39 UTC (rev 3054)
@@ -63,10 +63,7 @@
<object-name>stby.006</object-name>
<object-name>mem.annun</object-name>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
</animation>
@@ -73,6 +70,11 @@
<animation>
<type>rotate</type>
<object-name>CTL-22.pwr</object-name>
+ <!-- Intuitively the power knob should toggle the power-btn
+ property but this would make ATIS etc. work even without
+ electricity. So we toggle serviceable instead, and Nasal
+ updates power-btn in a loop depending on serviceable and
+ the voltage on the bus. -->
<property>instrumentation/comm/serviceable</property>
<interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
@@ -289,10 +291,7 @@
<repeatable>false</repeatable>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-swap</command>
<property>instrumentation/comm/frequencies/selected-mhz</property>
@@ -412,10 +411,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm/frequencies/standby-mhz</property>
@@ -444,10 +440,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm/frequencies/standby-mhz</property>
@@ -468,10 +461,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm/frequencies/standby-mhz</property>
@@ -492,10 +482,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm/frequencies/standby-mhz</property>
@@ -516,10 +503,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm/frequencies/standby-mhz</property>
@@ -548,10 +532,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm/frequencies/standby-mhz</property>
@@ -572,10 +553,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm/frequencies/standby-mhz</property>
@@ -596,10 +574,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[0]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm/frequencies/standby-mhz</property>
Modified: trunk/Aircraft/Citation/Models/Instruments/VHF-22/ctl22-com2.xml
===================================================================
--- trunk/Aircraft/Citation/Models/Instruments/VHF-22/ctl22-com2.xml 2017-10-17 21:35:09 UTC (rev 3053)
+++ trunk/Aircraft/Citation/Models/Instruments/VHF-22/ctl22-com2.xml 2017-10-17 23:48:39 UTC (rev 3054)
@@ -63,10 +63,7 @@
<object-name>stby.006</object-name>
<object-name>mem.annun</object-name>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
</animation>
@@ -73,6 +70,11 @@
<animation>
<type>rotate</type>
<object-name>CTL-22.pwr</object-name>
+ <!-- Intuitively the power knob should toggle the power-btn
+ property but this would make ATIS etc. work even without
+ electricity. So we toggle serviceable instead, and Nasal
+ updates power-btn in a loop depending on serviceable and
+ the voltage on the bus. -->
<property>instrumentation/comm[1]/serviceable</property>
<interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
@@ -289,10 +291,7 @@
<repeatable>false</repeatable>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-swap</command>
<property>instrumentation/comm[1]/frequencies/selected-mhz</property>
@@ -412,10 +411,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[1]/frequencies/standby-mhz</property>
@@ -444,10 +440,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[1]/frequencies/standby-mhz</property>
@@ -468,10 +461,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[1]/frequencies/standby-mhz</property>
@@ -492,10 +482,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[1]/frequencies/standby-mhz</property>
@@ -516,10 +503,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[1]/frequencies/standby-mhz</property>
@@ -548,10 +532,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[1]/frequencies/standby-mhz</property>
@@ -572,10 +553,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[1]/frequencies/standby-mhz</property>
@@ -596,10 +574,7 @@
<interval-sec>0.2</interval-sec>
<binding>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/comm[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/comm[1]/power-btn</property>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[1]/frequencies/standby-mhz</property>
Modified: trunk/Aircraft/Citation/Models/Instruments/VIR-32/ctl32-nav1.xml
===================================================================
--- trunk/Aircraft/Citation/Models/Instruments/VIR-32/ctl32-nav1.xml 2017-10-17 21:35:09 UTC (rev 3053)
+++ trunk/Aircraft/Citation/Models/Instruments/VIR-32/ctl32-nav1.xml 2017-10-17 23:48:39 UTC (rev 3054)
@@ -65,10 +65,7 @@
<object-name>stby.005</object-name>
<object-name>mem.annun</object-name>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/nav</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/nav[0]/power-btn</property>
</condition>
</animation>
Modified: trunk/Aircraft/Citation/Models/Instruments/VIR-32/ctl32-nav2.xml
===================================================================
--- trunk/Aircraft/Citation/Models/Instruments/VIR-32/ctl32-nav2.xml 2017-10-17 21:35:09 UTC (rev 3053)
+++ trunk/Aircraft/Citation/Models/Instruments/VIR-32/ctl32-nav2.xml 2017-10-17 23:48:39 UTC (rev 3054)
@@ -65,10 +65,7 @@
<object-name>stby.005</object-name>
<object-name>mem.annun</object-name>
<condition>
- <greater-than>
- <property>systems/electrical/outputs/nav[1]</property>
- <value>1</value>
- </greater-than>
+ <property>instrumentation/nav[1]/power-btn</property>
</condition>
</animation>
Modified: trunk/Aircraft/Citation/Nasal/Electrical.nas
===================================================================
--- trunk/Aircraft/Citation/Nasal/Electrical.nas 2017-10-17 21:35:09 UTC (rev 3053)
+++ trunk/Aircraft/Citation/Nasal/Electrical.nas 2017-10-17 23:48:39 UTC (rev 3054)
@@ -334,6 +334,11 @@
return load;
}
+var com1 = props.globals.initNode ("instrumentation/comm[0]/power-btn", 0, "BOOL");
+var com2 = props.globals.initNode ("instrumentation/comm[1]/power-btn", 0, "BOOL");
+var nav1 = props.globals.initNode ("instrumentation/nav[0]/power-btn", 0, "BOOL");
+var nav2 = props.globals.initNode ("instrumentation/nav[1]/power-btn", 0, "BOOL");
+
av_bus = func(bv) {
var load = 0.0;
var srvc = 0.0;
@@ -343,6 +348,15 @@
load += avbus_load[i] * srvc;
avbus_output[i].setValue(bv * srvc);
}
+ # If the comm/nav devices are serviceable (power button on) and have electricity, enable them. Their "power-btn" property controls whether they actually do anything.
+ com1.setBoolValue (getprop ("instrumentation/comm[0]/serviceable")
+ and (getprop ("systems/electrical/outputs/comm[0]") > 22));
+ com2.setBoolValue (getprop ("instrumentation/comm[1]/serviceable")
+ and (getprop ("systems/electrical/outputs/comm[1]") > 22));
+ nav1.setBoolValue (getprop ("instrumentation/nav[0]/serviceable")
+ and (getprop ("systems/electrical/outputs/nav[0]") > 22));
+ nav2.setBoolValue (getprop ("instrumentation/nav[1]/serviceable")
+ and (getprop ("systems/electrical/outputs/nav[1]") > 22));
return load;
}
Modified: trunk/Aircraft/Citation/Systems/instrumentation.xml
===================================================================
--- trunk/Aircraft/Citation/Systems/instrumentation.xml 2017-10-17 21:35:09 UTC (rev 3053)
+++ trunk/Aircraft/Citation/Systems/instrumentation.xml 2017-10-17 23:48:39 UTC (rev 3054)
@@ -63,6 +63,16 @@
<number>0</number>
</marker-beacon>
+ <comm-radio>
+ <name>comm</name>
+ <number>0</number>
+ </comm-radio>
+
+ <comm-radio>
+ <name>comm</name>
+ <number>1</number>
+ </comm-radio>
+
<nav-radio>
<name>nav</name>
<number>0</number>
|