1
0
Fork 0

Fix PTU sound

This commit is contained in:
legoboyvdlp R 2020-04-25 16:03:56 +01:00
parent 9c49cb92a2
commit 1ed30c1f0c
5 changed files with 60 additions and 9 deletions

View file

@ -37,7 +37,7 @@ var HYD = {
yellow: props.globals.getNode("systems/hydraulic/yellow-psi"), yellow: props.globals.getNode("systems/hydraulic/yellow-psi"),
}, },
Ptu: { Ptu: {
active: props.globals.getNode("systems/hydraulic/sources/ptu/ptu-active"), active: props.globals.getNode("systems/hydraulic/sources/ptu/ptu-hydraulic-condition"),
diff: props.globals.getNode("systems/hydraulic/yellow-psi-diff"), diff: props.globals.getNode("systems/hydraulic/yellow-psi-diff"),
}, },
Qty: { Qty: {

View file

@ -57,11 +57,10 @@
</condition> </condition>
</hyd-yellow> </hyd-yellow>
<!-- Disabled until proper PTU system implemented, to not annoy people -->
<hyd> <hyd>
<name>PTU</name> <name>PTU</name>
<mode>once</mode> <mode>once</mode>
<path>airbus_ptu.wav</path> <path>airbus_ptu_on.wav</path>
<condition> <condition>
<or> <or>
<property>/systems/hydraulic/sources/ptu/yellow-green</property> <property>/systems/hydraulic/sources/ptu/yellow-green</property>
@ -75,6 +74,23 @@
<max-dist>100.0</max-dist> <max-dist>100.0</max-dist>
</hyd> </hyd>
<hyd>
<name>PTU-loop</name>
<mode>looped</mode>
<path>airbus_ptu.wav</path>
<condition>
<equals>
<property>/systems/hydraulic/sources/ptu/ptu-loop-sound</property>
<value>1</value>
</equals>
</condition>
<volume>
<factor>8</factor>
</volume>
<reference-dist>20.0</reference-dist>
<max-dist>100.0</max-dist>
</hyd>
<announcement> <announcement>
<name>PurserSnacks</name> <name>PurserSnacks</name>
<mode>once</mode> <mode>once</mode>

Binary file not shown.

BIN
Sounds/airbus_ptu_on.wav Normal file

Binary file not shown.

View file

@ -416,25 +416,44 @@
</function> </function>
</fcs_function> </fcs_function>
<switch name="/systems/hydraulic/sources/ptu/ptu-active"> <switch name="/systems/hydraulic/sources/ptu/ptu-inhibited">
<default value="1"/>
<test logic="OR" value="0">
<test logic="AND">
/sim/model/autopush/enabled eq 0
/controls/gear/brake-parking eq 0
</test>
<test logic="AND">
/controls/engines/engine[0]/cutoff-switch eq 0
/controls/engines/engine[1]/cutoff-switch eq 0
</test>
<test logic="AND">
/controls/engines/engine[0]/cutoff-switch eq 1
/controls/engines/engine[1]/cutoff-switch eq 1
</test>
/gear/gear[0]/compression-norm eq 0
</test>
</switch>
<switch name="/systems/hydraulic/sources/ptu/ptu-hydraulic-condition">
<test logic="AND" value="0"> <test logic="AND" value="0">
/systems/hydraulic/yellow-psi-diff gt -250 /systems/hydraulic/yellow-psi-diff gt -250
/systems/hydraulic/yellow-psi-diff lt 250 /systems/hydraulic/yellow-psi-diff lt 250
/systems/hydraulic/sources/ptu/ptu-active eq 1 /systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1
</test> </test>
<test logic="AND" value="1"> <test logic="AND" value="1">
<test logic="OR"> <test logic="OR">
/systems/hydraulic/yellow-psi-diff ge 250 /systems/hydraulic/yellow-psi-diff ge 250
/systems/hydraulic/yellow-psi-diff le -250 /systems/hydraulic/yellow-psi-diff le -250
</test> </test>
/systems/hydraulic/sources/ptu/ptu-active eq 1 /systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1
</test> </test>
<test logic="AND" value="1"> <test logic="AND" value="1">
<test logic="OR"> <test logic="OR">
/systems/hydraulic/yellow-psi-diff gt 500 /systems/hydraulic/yellow-psi-diff gt 500
/systems/hydraulic/yellow-psi-diff lt -500 /systems/hydraulic/yellow-psi-diff lt -500
</test> </test>
/systems/hydraulic/sources/ptu/ptu-active eq 0 /systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 0
</test> </test>
</switch> </switch>
@ -442,18 +461,34 @@
<default value="0"/> <default value="0"/>
<test logic="AND" value="/systems/hydraulic/green-psi-ptu"> <test logic="AND" value="/systems/hydraulic/green-psi-ptu">
/controls/hydraulic/switches/ptu eq 1 /controls/hydraulic/switches/ptu eq 1
/systems/hydraulic/sources/ptu/ptu-active eq 1 /systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1
/systems/hydraulic/sources/ptu/ptu-inhibited eq 0
/systems/electrical/bus/dc-2 ge 25 /systems/electrical/bus/dc-2 ge 25
/systems/failures/hydraulic/ptu ne 1 /systems/failures/hydraulic/ptu ne 1
/systems/hydraulic/sources/yellow-edp/fire-valve lt 0.10 /systems/hydraulic/sources/yellow-edp/fire-valve lt 0.10
</test> </test>
</switch> </switch>
<switch name="/systems/hydraulic/sources/ptu/ptu-loop-sound-cmd">
<default value="0"/>
<test logic="OR" value="1">
/systems/hydraulic/sources/ptu/yellow-green ne 0
/systems/hydraulic/sources/ptu/green-yellow ne 0
</test>
</switch>
<actuator name="/systems/hydraulic/sources/ptu/ptu-loop-sound">
<input>/systems/hydraulic/sources/ptu/ptu-loop-sound-cmd</input>
<rate_limit sense="incr">1</rate_limit>
<rate_limit sense="decr">100</rate_limit> <!-- instant -->
</actuator>
<switch name="/systems/hydraulic/sources/ptu/yellow-green"> <switch name="/systems/hydraulic/sources/ptu/yellow-green">
<default value="0"/> <default value="0"/>
<test logic="AND" value="/systems/hydraulic/yellow-psi-ptu"> <test logic="AND" value="/systems/hydraulic/yellow-psi-ptu">
/controls/hydraulic/switches/ptu eq 1 /controls/hydraulic/switches/ptu eq 1
/systems/hydraulic/sources/ptu/ptu-active eq 1 /systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1
/systems/hydraulic/sources/ptu/ptu-inhibited eq 0
/systems/electrical/bus/dc-2 ge 25 /systems/electrical/bus/dc-2 ge 25
/systems/failures/hydraulic/ptu ne 1 /systems/failures/hydraulic/ptu ne 1
/systems/hydraulic/sources/green-edp/fire-valve lt 0.10 /systems/hydraulic/sources/green-edp/fire-valve lt 0.10