1
0
Fork 0

Merge branch 'dev' into 3D

This commit is contained in:
Jonathan Redpath 2022-01-07 18:42:10 +00:00
commit 0bdded7b8a
10 changed files with 341 additions and 3 deletions

View file

@ -870,6 +870,10 @@
<brake-left type="double">0</brake-left> <brake-left type="double">0</brake-left>
<brake-right type="double">0</brake-right> <brake-right type="double">0</brake-right>
</autobrake> </autobrake>
<cabin>
<footwarmer-cpt type="bool">0</footwarmer-cpt>
<footwarmer-fo type="bool">0</footwarmer-fo>
</cabin>
<CVR> <CVR>
<erase type="bool">0</erase> <erase type="bool">0</erase>
<gndctl type="bool">0</gndctl> <gndctl type="bool">0</gndctl>
@ -877,6 +881,9 @@
<test type="bool">0</test> <test type="bool">0</test>
<tone type="bool">0</tone> <tone type="bool">0</tone>
</CVR> </CVR>
<doors>
<doorc-switch type="int">0</doorc-switch>
</doors>
<electric> <electric>
<avionics-switch type="bool">true</avionics-switch> <avionics-switch type="bool">true</avionics-switch>
</electric> </electric>
@ -1672,6 +1679,7 @@
<options n="0"> <options n="0">
<system n="0"> <system n="0">
<keyboard-mode type="bool">0</keyboard-mode> <keyboard-mode type="bool">0</keyboard-mode>
<fgcamera-keys-enabled type="bool">0</fgcamera-keys-enabled>
</system> </system>
<steep-ils type="bool">0</steep-ils> <steep-ils type="bool">0</steep-ils>
<steep-ils-avail type="bool">0</steep-ils-avail> <steep-ils-avail type="bool">0</steep-ils-avail>
@ -2315,11 +2323,20 @@
<command>nasal</command> <command>nasal</command>
<script>mcdu.button("1", 1);</script> <script>mcdu.button("1", 1);</script>
</binding> </binding>
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>1</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<binding> <binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
<not><property>/FMGC/keyboard-right</property></not> <not><property>/FMGC/keyboard-right</property></not>
<not><property>/options/system/keyboard-mode</property></not> <not><property>/options/system/keyboard-mode</property></not>
<not><property>/options/system/fgcamera-keys-enabled</property></not>
</condition> </condition>
<command>nasal</command> <command>nasal</command>
<script>libraries.setView(1);</script> <script>libraries.setView(1);</script>
@ -2352,11 +2369,20 @@
<command>nasal</command> <command>nasal</command>
<script>mcdu.button("2", 1);</script> <script>mcdu.button("2", 1);</script>
</binding> </binding>
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>2</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<binding> <binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
<not><property>/FMGC/keyboard-right</property></not> <not><property>/FMGC/keyboard-right</property></not>
<not><property>/options/system/keyboard-mode</property></not> <not><property>/options/system/keyboard-mode</property></not>
<not><property>/options/system/fgcamera-keys-enabled</property></not>
</condition> </condition>
<command>nasal</command> <command>nasal</command>
<script>libraries.setView(2);</script> <script>libraries.setView(2);</script>
@ -2390,11 +2416,20 @@
<command>nasal</command> <command>nasal</command>
<script>mcdu.button("3", 1);</script> <script>mcdu.button("3", 1);</script>
</binding> </binding>
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>3</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<binding> <binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
<not><property>/FMGC/keyboard-right</property></not> <not><property>/FMGC/keyboard-right</property></not>
<not><property>/options/system/keyboard-mode</property></not> <not><property>/options/system/keyboard-mode</property></not>
<not><property>/options/system/fgcamera-keys-enabled</property></not>
</condition> </condition>
<command>nasal</command> <command>nasal</command>
<script>libraries.setView(3);</script> <script>libraries.setView(3);</script>
@ -2428,11 +2463,20 @@
<command>nasal</command> <command>nasal</command>
<script>mcdu.button("4", 1);</script> <script>mcdu.button("4", 1);</script>
</binding> </binding>
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>4</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<binding> <binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
<not><property>/FMGC/keyboard-right</property></not> <not><property>/FMGC/keyboard-right</property></not>
<not><property>/options/system/keyboard-mode</property></not> <not><property>/options/system/keyboard-mode</property></not>
<not><property>/options/system/fgcamera-keys-enabled</property></not>
</condition> </condition>
<command>nasal</command> <command>nasal</command>
<script>libraries.setView(4);</script> <script>libraries.setView(4);</script>
@ -2466,11 +2510,20 @@
<command>nasal</command> <command>nasal</command>
<script>mcdu.button("5", 1);</script> <script>mcdu.button("5", 1);</script>
</binding> </binding>
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>5</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<binding> <binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
<not><property>/FMGC/keyboard-right</property></not> <not><property>/FMGC/keyboard-right</property></not>
<not><property>/options/system/keyboard-mode</property></not> <not><property>/options/system/keyboard-mode</property></not>
<not><property>/options/system/fgcamera-keys-enabled</property></not>
</condition> </condition>
<command>nasal</command> <command>nasal</command>
<script>libraries.setView(5);</script> <script>libraries.setView(5);</script>
@ -2506,11 +2559,20 @@
<command>nasal</command> <command>nasal</command>
<script>mcdu.button("6", 1);</script> <script>mcdu.button("6", 1);</script>
</binding> </binding>
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>6</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<binding> <binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
<not><property>/FMGC/keyboard-right</property></not> <not><property>/FMGC/keyboard-right</property></not>
<not><property>/options/system/keyboard-mode</property></not> <not><property>/options/system/keyboard-mode</property></not>
<not><property>/options/system/fgcamera-keys-enabled</property></not>
</condition> </condition>
<command>nasal</command> <command>nasal</command>
<script>libraries.setView(6);</script> <script>libraries.setView(6);</script>
@ -2554,6 +2616,14 @@
<property>/sim/current-view/view-number</property> <property>/sim/current-view/view-number</property>
<value></value> <value></value>
</binding--> </binding-->
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>7</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<binding> <binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
@ -2582,6 +2652,14 @@
<command>nasal</command> <command>nasal</command>
<script>mcdu.button("8", 1);</script> <script>mcdu.button("8", 1);</script>
</binding> </binding>
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>8</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<!--binding> <!--binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
@ -2596,7 +2674,7 @@
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>
<not><property>/FMGC/keyboard-right</property></not> <not><property>/FMGC/keyboard-right</property></not>
<property>/options/system/keyboard-mode</property> <property>/options/system/keyboard-mode</property>
</condition> </condition>
<command>nasal</command> <command>nasal</command>
<script> <script>
@ -2621,6 +2699,14 @@
<command>nasal</command> <command>nasal</command>
<script>mcdu.button("9", 1);</script> <script>mcdu.button("9", 1);</script>
</binding> </binding>
<binding>
<condition>
<property>/options/system/fgcamera-keys-enabled</property>
</condition>
<command>fgcamera-select</command>
<camera-id>9</camera-id>
<camera-type>aircraft</camera-type>
</binding>
<!--binding> <!--binding>
<condition> <condition>
<not><property>/FMGC/keyboard-left</property></not> <not><property>/FMGC/keyboard-left</property></not>

View file

@ -51,6 +51,7 @@ setprop("/systems/acconfig/out-of-date", 0);
setprop("/systems/acconfig/mismatch-code", "0x000"); setprop("/systems/acconfig/mismatch-code", "0x000");
setprop("/systems/acconfig/mismatch-reason", "XX"); setprop("/systems/acconfig/mismatch-reason", "XX");
setprop("/systems/acconfig/options/keyboard-mode", 0); setprop("/systems/acconfig/options/keyboard-mode", 0);
setprop("/systems/acconfig/options/fgcamera-keys-enabled", 0);
setprop("/systems/acconfig/options/weight-kgs", 1); setprop("/systems/acconfig/options/weight-kgs", 1);
setprop("/systems/acconfig/options/adirs-skip", 0); setprop("/systems/acconfig/options/adirs-skip", 0);
setprop("/systems/acconfig/options/allow-oil-consumption", 0); setprop("/systems/acconfig/options/allow-oil-consumption", 0);
@ -220,6 +221,7 @@ var renderingSettings = {
var readSettings = func { var readSettings = func {
io.read_properties(pts.Sim.fgHome.getValue() ~ "/Export/A320-family-config.xml", "/systems/acconfig/options"); io.read_properties(pts.Sim.fgHome.getValue() ~ "/Export/A320-family-config.xml", "/systems/acconfig/options");
setprop("/options/system/keyboard-mode", getprop("/systems/acconfig/options/keyboard-mode")); setprop("/options/system/keyboard-mode", getprop("/systems/acconfig/options/keyboard-mode"));
if (getprop("/sim/fgcamera/enable")) setprop("/options/system/fgcamera-keys-enabled", getprop("/systems/acconfig/options/fgcamera-keys-enabled")); # read only when FGCamera enabled
setprop("/options/system/weight-kgs", getprop("/systems/acconfig/options/weight-kgs")); setprop("/options/system/weight-kgs", getprop("/systems/acconfig/options/weight-kgs"));
setprop("/options/system/save-state", getprop("/systems/acconfig/options/save-state")); setprop("/options/system/save-state", getprop("/systems/acconfig/options/save-state"));
setprop("/controls/adirs/skip", getprop("/systems/acconfig/options/adirs-skip")); setprop("/controls/adirs/skip", getprop("/systems/acconfig/options/adirs-skip"));
@ -235,6 +237,7 @@ var readSettings = func {
var writeSettings = func { var writeSettings = func {
setprop("/systems/acconfig/options/keyboard-mode", getprop("/options/system/keyboard-mode")); setprop("/systems/acconfig/options/keyboard-mode", getprop("/options/system/keyboard-mode"));
setprop("/systems/acconfig/options/fgcamera-keys-enabled", getprop("/options/system/fgcamera-keys-enabled"));
setprop("/systems/acconfig/options/weight-kgs", getprop("/options/system/weight-kgs")); setprop("/systems/acconfig/options/weight-kgs", getprop("/options/system/weight-kgs"));
setprop("/systems/acconfig/options/save-state", getprop("/options/system/save-state")); setprop("/systems/acconfig/options/save-state", getprop("/options/system/save-state"));
setprop("/systems/acconfig/options/adirs-skip", getprop("/controls/adirs/skip")); setprop("/systems/acconfig/options/adirs-skip", getprop("/controls/adirs/skip"));

View file

@ -242,6 +242,27 @@
<live>true</live> <live>true</live>
</checkbox> </checkbox>
<checkbox>
<label>Enable FGCamera 0-9 keys</label>
<halign>left</halign>
<enable>/sim/fgcamera/enable</enable>
<property>/options/system/fgcamera-keys-enabled</property>
<binding>
<command>property-toggle</command>
<property>/options/system/fgcamera-keys-enabled</property>
</binding>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
acconfig.writeSettings();
</script>
</binding>
<live>true</live>
</checkbox>
<!-- TODO Comment back in, when fully implemented --> <!-- TODO Comment back in, when fully implemented -->
<checkbox> <checkbox>
<label>Weight in KG</label> <label>Weight in KG</label>

View file

@ -777,6 +777,19 @@
<script>atc.transponderPanel.modeSwitch(getprop("controls/atc/mode-knob") + 1);</script> <script>atc.transponderPanel.modeSwitch(getprop("controls/atc/mode-knob") + 1);</script>
</binding> </binding>
</action> </action>
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>atc_stby_mode</tooltip-id>
<label>Mode: %s</label>
<property>controls/atc/mode-knob</property>
<mapping>nasal</mapping>
<script>
var modes = ['STANDBY','ALT','XPNDR','TA ONLY','TA/RA'];
return modes[arg[0]];
</script>
</binding>
</hovered>
</animation> </animation>
<animation> <animation>
@ -1457,6 +1470,89 @@
</action> </action>
</animation> </animation>
<!-- Cocktpit Door Switch -->
<animation>
<type>knob</type>
<object-name>CockpitDoorSwitch</object-name>
<object-name>CockpitDoorSwitch.mark</object-name>
<property>controls/doors/doorc-switch</property>
<interpolation>
<entry><ind>-1</ind><dep>-25</dep></entry>
<entry><ind> 0</ind><dep> 0</dep></entry>
<entry><ind> 1</ind><dep> 25</dep></entry>
</interpolation>
<axis>
<object-name>CockpitDoorSwitch.axis</object-name>
</axis>
<action>
<binding>
<command>property-cycle</command>
<property>controls/doors/doorc-switch</property>
<value>-1</value>
<value>0</value>
<value>1</value>
<wrap>false</wrap>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/switch1", 1);</script>
</binding>
</action>
<release>
<binding>
<command>property-assign</command>
<property>controls/doors/doorc-switch</property>
<value>0</value>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/switch1", 1);</script>
</binding>
</release>
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>doorc-switch-lock</tooltip-id>
<label>Cockpit door switch</label>
</binding>
</hovered>
</animation>
<animation>
<type>select</type>
<object-name>CockpitDoorOpen</object-name>
<condition>
<or>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<not-equals>
<property>sim/model/door-positions/doorc/lock-status</property>
<value>1</value>
</not-equals>
</or>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>CockpitDoorFault</object-name>
<condition>
<or>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<equals>
<property>sim/model/door-positions/doorc/lock-status</property>
<value>-9</value>
</equals>
</or>
</condition>
</animation>
<!-- Terr on ND --> <!-- Terr on ND -->
<animation> <animation>
<type>pick</type> <type>pick</type>
@ -2084,6 +2180,76 @@
</axis> </axis>
</animation> </animation>
<!-- Foot warner switches -->
<animation>
<type>rotate</type>
<object-name>foot_warmer_cpt_sw</object-name>
<object-name>foot_warmer_cpt_sw.mark</object-name>
<property>controls/cabin/footwarmer-cpt</property>
<interpolation>
<entry><ind>1</ind><dep>-20</dep></entry>
<entry><ind>0</ind><dep>20</dep></entry>
</interpolation>
<axis>
<object-name>foot_warmer_cpt_sw.axis</object-name>
</axis>
</animation>
<animation>
<type>pick</type>
<object-name>foot_warmer_cpt_sw</object-name>
<object-name>foot_warmer_cpt_sw.mark</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>controls/cabin/footwarmer-cpt</property>
<value>1</value>
<value>0</value>
</binding>
<binding>
<command>property-toggle</command>
<property>/sim/sounde/switch1</property>
</binding>
</action>
</animation>
<animation>
<type>rotate</type>
<object-name>foot_warmer_fo_sw</object-name>
<object-name>foot_warmer_fo_sw.mark</object-name>
<property>controls/cabin/footwarmer-fo</property>
<interpolation>
<!-- Axis inverted!! -->
<entry><ind>1</ind><dep>20</dep></entry>
<entry><ind>0</ind><dep>-20</dep></entry>
</interpolation>
<axis>
<object-name>foot_warmer_fo_sw.axis</object-name>
</axis>
</animation>
<animation>
<type>pick</type>
<object-name>foot_warmer_fo_sw</object-name>
<object-name>foot_warmer_fo_sw.mark</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>controls/cabin/footwarmer-fo</property>
<value>1</value>
<value>0</value>
</binding>
<binding>
<command>property-toggle</command>
<property>/sim/sounde/switch1</property>
</binding>
</action>
</animation>
<!-- ECAM Controls --> <!-- ECAM Controls -->
<animation> <animation>
<type>pick</type> <type>pick</type>

View file

@ -5191,6 +5191,7 @@
<object-name>LandingLtLSwtch</object-name> <object-name>LandingLtLSwtch</object-name>
<action> <action>
<button>0</button> <button>0</button>
<button>3</button>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-cycle</command> <command>property-cycle</command>
@ -5206,6 +5207,7 @@
</action> </action>
<action> <action>
<button>1</button> <button>1</button>
<button>4</button>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-cycle</command> <command>property-cycle</command>
@ -5227,6 +5229,7 @@
<object-name>LandingLtRSwtch</object-name> <object-name>LandingLtRSwtch</object-name>
<action> <action>
<button>0</button> <button>0</button>
<button>3</button>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-cycle</command> <command>property-cycle</command>
@ -5242,6 +5245,7 @@
</action> </action>
<action> <action>
<button>1</button> <button>1</button>
<button>4</button>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-cycle</command> <command>property-cycle</command>

View file

@ -80,6 +80,10 @@ var armrests = aircraft.door.new("/sim/model/door-positions/armrests", 2);
var windowLeft = aircraft.door.new("/sim/model/door-positions/windowLeft", 1); var windowLeft = aircraft.door.new("/sim/model/door-positions/windowLeft", 1);
var windowRight = aircraft.door.new("/sim/model/door-positions/windowRight", 1); var windowRight = aircraft.door.new("/sim/model/door-positions/windowRight", 1);
# Cockpit door - TODO animation
var cockpitdoor = aircraft.door.new("/sim/model/door-positions/doorc", 1);
setprop("/sim/model/door-positions/doorc/lock-status",0);
# door opener/closer # door opener/closer
var triggerDoor = func(door, doorName, doorDesc) { var triggerDoor = func(door, doorName, doorDesc) {
if (getprop("/sim/model/door-positions/" ~ doorName ~ "/position-norm") > 0) { if (getprop("/sim/model/door-positions/" ~ doorName ~ "/position-norm") > 0) {
@ -95,7 +99,27 @@ var triggerDoor = func(door, doorName, doorDesc) {
} }
}; };
# Systems setlistener("/controls/doors/doorc-switch",func(a){
if (getprop("systems/electrical/bus/dc-2")>25 or getprop("systems/electrical/bus/dc-1")>25) {
var pos = a.getValue();
var current = getprop("/sim/model/door-positions/doorc/lock-status");
if (pos == 1 and current == 0) { ## LOCK
settimer( func {
if (a.getValue() == pos) setprop("/sim/model/door-positions/doorc/lock-status",1);
},0.4);
}
else if (pos == -1 and current == 1) { ## UNLOCK
settimer( func {
if (a.getValue() == pos) setprop("/sim/model/door-positions/doorc/lock-status",0);
},0.2);
}
#setprop("/sim/model/door-positions/doorc/lock-status",-9); ## FAULT
}
});
###########
# Systems #
###########
var systemsInitialized = 0; var systemsInitialized = 0;
var A320Libraries = nil; var A320Libraries = nil;

View file

@ -7,6 +7,11 @@
# Sounds # # Sounds #
########## ##########
var playSoundOnce = func(path,delay) {
setprop(path,1);
settimer(func {setprop(path,0);},delay);
}
setlistener("/sim/sounde/btn1", func { setlistener("/sim/sounde/btn1", func {
if (!getprop("/sim/sounde/btn1")) { if (!getprop("/sim/sounde/btn1")) {
return; return;
@ -122,4 +127,11 @@ var pushbuttonSound = props.globals.getNode("/sim/sounde/pushbutton");
var pushbutton = func() { var pushbutton = func() {
pushbuttonSound.setValue(1); pushbuttonSound.setValue(1);
settimer(func {pushbuttonSound.setValue(0);},0.20); settimer(func {pushbuttonSound.setValue(0);},0.20);
} }
setlistener("/sim/model/door-positions/doorc/lock-status",func(lock) {
if (lock.getValue() == 1)
playSoundOnce("/sim/sounde/doorc_locking",0.5);
else
playSoundOnce("/sim/sounde/doorc_unlocking",0.5);
},0,0);

View file

@ -1888,6 +1888,28 @@
</volume> </volume>
</relay> </relay>
<relay>
<name>CockpitDoorLocking</name>
<mode>once</mode>
<path>Aircraft/A320-family/Sounds/Cockpit/cockpitdoor_lock.wav</path>
<property>/sim/sounde/doorc_locking</property>
<volume>
<property>/sim/current-view/internal</property>
<factor>1</factor>
</volume>
</relay>
<relay>
<name>CockpitDoorUnlocking</name>
<mode>once</mode>
<path>Aircraft/A320-family/Sounds/Cockpit/cockpitdoor_unlock.wav</path>
<property>/sim/sounde/doorc_unlocking</property>
<volume>
<property>/sim/current-view/internal</property>
<factor>0.8</factor>
</volume>
</relay>
<announcements> <announcements>
<name>fa_boarding</name> <name>fa_boarding</name>
<mode>once</mode> <mode>once</mode>

Binary file not shown.

Binary file not shown.