Add panel lighting control so the panel/instruments lighting can be adjusted independantly of the Nav lights.
This commit is contained in:
parent
15418bead8
commit
02fab82534
4 changed files with 1285 additions and 13 deletions
1187
Aircraft/c172p/Instruments/light/light_control.ac
Normal file
1187
Aircraft/c172p/Instruments/light/light_control.ac
Normal file
File diff suppressed because it is too large
Load diff
84
Aircraft/c172p/Instruments/light/light_control.xml
Normal file
84
Aircraft/c172p/Instruments/light/light_control.xml
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<path>light_control.ac</path>
|
||||
|
||||
<!-- Panel/radio light control -->
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>LightHotspotLeft</object-name>
|
||||
<visible>true</visible>
|
||||
<action>
|
||||
<name>Decrease</name>
|
||||
<button>0</button>
|
||||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>controls/lighting/instruments-norm</property>
|
||||
<step>-0.1</step>
|
||||
<min>0</min>
|
||||
<max>1.0</max>
|
||||
<wrap>0</wrap>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>LightHotspotRight</object-name>
|
||||
<visible>true</visible>
|
||||
<action>
|
||||
<name>Increase</name>
|
||||
<button>0</button>
|
||||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>controls/lighting/instruments-norm</property>
|
||||
<step>0.1</step>
|
||||
<min>0</min>
|
||||
<max>1.0</max>
|
||||
<wrap>0</wrap>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>LightHotspotLeft</object-name>
|
||||
<object-name>LightHotspotRight</object-name>
|
||||
<object-name>LightKnob</object-name>
|
||||
<visible>true</visible>
|
||||
<action>
|
||||
<name>Decrease - scrollwheel</name>
|
||||
<button>3</button>
|
||||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>controls/lighting/instruments-norm</property>
|
||||
<step>-0.1</step>
|
||||
<min>0</min>
|
||||
<max>1.0</max>
|
||||
<wrap>0</wrap>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
<name>Increase - scrollwheel</name>
|
||||
<button>4</button>
|
||||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>controls/lighting/instruments-norm</property>
|
||||
<step>0.1</step>
|
||||
<min>0</min>
|
||||
<max>1.0</max>
|
||||
<wrap>0</wrap>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
|
||||
|
||||
</PropertyList>
|
||||
|
||||
|
|
@ -276,6 +276,16 @@
|
|||
</offsets>
|
||||
</model>
|
||||
|
||||
<model>
|
||||
<name>PanelLight</name>
|
||||
<path>Aircraft/c172p/Instruments/light/light_control.xml</path>
|
||||
<offsets>
|
||||
<x-m>-0.36</x-m>
|
||||
<y-m>-0.035</y-m>
|
||||
<z-m>-0.273</z-m>
|
||||
</offsets>
|
||||
</model>
|
||||
|
||||
<!-- Controls -->
|
||||
<animation>
|
||||
<name>CarbHeatGroup</name>
|
||||
|
@ -310,6 +320,7 @@
|
|||
<object-name>NavLightSwitch</object-name>
|
||||
<object-name>BeaconSwitch</object-name>
|
||||
<object-name>StrobeSwitch</object-name>
|
||||
<object-name>PanelLight</object-name>
|
||||
<!--
|
||||
<object-name>ElectronicsLabels</object-name>
|
||||
<object-name>ElectronicsLabels2</object-name>
|
||||
|
|
|
@ -66,20 +66,10 @@ var update_actions = func {
|
|||
# Left main
|
||||
var delta_h = dhL_ft.getValue()*ftTOm;
|
||||
var left_alpha_deg = ( math.acos( (h0 - delta_h)/R_m ) - theta0_rad )*radTOdeg;
|
||||
|
||||
|
||||
|
||||
# outputs
|
||||
if ( navLights.getValue() ) {
|
||||
instrumentLightFactor.setDoubleValue(1.0);
|
||||
# Used double in case one wants to later add the ability to dim the instrument lights
|
||||
instrumentsNorm.setDoubleValue(1.0);
|
||||
panelLights.setDoubleValue(1.0);
|
||||
} else {
|
||||
instrumentLightFactor.setDoubleValue(0.0);
|
||||
instrumentsNorm.setDoubleValue(0.0);
|
||||
panelLights.setDoubleValue(0.0);
|
||||
}
|
||||
# Outputs
|
||||
instrumentLightFactor.setDoubleValue(instrumentsNorm.getValue());
|
||||
panelLights.setDoubleValue(instrumentsNorm.getValue());
|
||||
|
||||
filteredCDI0.setDoubleValue( cdi0_lowpass.filter(cdiNAV0.getValue()));
|
||||
filteredCDI1.setDoubleValue(cdi1_lowpass.filter(cdiNAV1.getValue()));
|
||||
|
|
Loading…
Reference in a new issue