i am actually working on the overhead panel from the A330
I have update (and transmit my work to the dev team) the behavior of the apu master / starter switch
i am actually working on the external power switch.
Kory switches on the A330 overpanel are actually made with 2 distincts 3D objects, the upper part and lower part
For the external power switch here is the behavior we should have
When an external power souce is connected to the plane, the upper part of this switch should be light in green with the "AVAIL" word illuminated.
When pressing the switch , the upper part should light off and the lower part should light up displaying "ON" in blue
One more pression on the switch should switch back to AVAIL light on and ON light off
In the properties tree we have 2 properties in touch with that:
* /services/external-pwr/enable (this property tell is an external propertie is connected to the aircraft and is toogle by a check box in one of the aircraft menu)
* /controls/electric/external-power (this property is toogle by the external power switch on the overhead panel)
In the overhead XML file only the lower part is actually managed.
here is the actual code :
- Code: Select all
<animation>
<name>External power pick</name>
<type>pick</type>
<object-name>ExtPwrBtn1</object-name>
<object-name>ExtPwrBtn2</object-name>
<action>
<button>0</button>
<repeatable type="bool">false</repeatable>
<binding>
<command>property-toggle</command>
<property>controls/electric/external-power</property>
</binding>
<binding>
<command>nasal</command>
<script>utils.clickSound(6)</script>
</binding>
</action>
</animation>
<animation>
<name>External power on</name>
<type>textranslate</type>
<object-name>ExtPwrBtn2</object-name>
<property>controls/electric/external-power</property>
<factor>0.5</factor>
<axis>
<x>1</x>
<y>0</y>
</axis>
</animation>
As i understand, when pressing the switch with code, a texture translation is apply on the lower part (ExtPwrBtn2) to display the "On" indication.
=> so i added a section to manage the upper part, but i encouter a problem to have the texture animation on the upper part of this object as it depends from the 2 properties with conditionnal instructions
- Code: Select all
<animation>
<name>External power avail</name>
<type>textranslate</type>
<object-name>ExtPwrBtn1</object-name>
<condition>
<and>
<property>services/external-pwr/enable</property>
<not>
<property>controls/electric/external-power</property>
</not>
</and>
</condition>
<factor>0.5</factor>
<axis>
<x>1</x>
<y>0</y>
</axis>
</animation>
As i understood i tell here :
If power sources is connected and not activate => texture translation should happen
And so if the switch is pressed, ,the controls/electric/external-power goes to true, and then , the condition is no more true, so the translation should go back (and so display a black texture (light off)
=> this doesnt work ... but i don't understand why
So if some xml texture translate knowledge have the solution .... thanks by advance.
=> i solved this issue by adding a new property in the tree that manage the upper part and update the property with nasal code in the electric system of the aircraft, but i think this is a heavy solution and texture translate should be manage by the condition.
So i really like to manage with the XML file code (there is more other korry switch to manage with more than one property and update nasal is heavy and could bring some unstable behavior.