Copilot: handle cabin light.

parent 77b09faa
......@@ -222,6 +222,7 @@ var _loop = func {
settimer(func {
do(func{
Tu144.Frontlight(1);
Tu144.IntlightsTOL();
});
}, 7.0);
settimer(func {
......@@ -277,6 +278,7 @@ var _loop = func {
do(func {
Tu144.GearCmd(-1);
Tu144.Frontlight(0);
Tu144.IntlightsDefault();
});
}
}, 5.0);
......@@ -508,10 +510,11 @@ var _loop = func {
if(WOW){
if(
(!frontlight and (readyfortaxi > _readyfortaxi)) or
(frontlight and (ready < _ready) and (Vind < 60.0))
(frontlight and (ready < _ready) and (Vind < 200.0))
){
do(func{
Tu144.Frontlight(-1);
Tu144.IntlightsDefault();
});
}else if(
(frontlight == -1) and
......
......@@ -144,7 +144,7 @@ setlistener("/sim/signals/fdm-initialized", func(p) {
Tu144.IntlightsDefault();
}else if((state == "take-off") or (state == "approach")){
Tu144.LightsTOL(1);
Tu144.IntlightsDefault();
Tu144.IntlightsTOL();
}else{
Tu144.LightsDefault(1);
Tu144.IntlightsDefault();
......
......@@ -758,8 +758,9 @@ LightsDefault = func (night = 0) {
}
# @brief Cabin light.
Cabinlight = func (on) {
setprop("/fdm/jsbsim/systems/lighting/panel/switch/cabin", on);
Cabinlight = func (main, backup = 0) {
setprop("/fdm/jsbsim/systems/lighting/panel/switch/cabin", main);
setprop("/fdm/jsbsim/systems/lighting/panel/switch/cabin_backup", backup);
}
# @brief Cargo hold light.
......@@ -769,19 +770,25 @@ Cargolight = func (on) {
# @brief Internal light profile: default
IntlightsDefault = func () {
Cabinlight(1);
Cabinlight(1, 0);
Cargolight(0);
}
# @brief Internal light profile: takeoff/landing
IntlightsTOL = func () {
Cabinlight(0, 1);
Cargolight(0);
}
# @brief Internal light profile: gate
IntlightsGate = func () {
Cabinlight(1);
Cabinlight(1, 0);
Cargolight(1);
}
# @brief Internal light profile: default
IntlightsOff = func () {
Cabinlight(0);
Cabinlight(0, 0);
Cargolight(0);
}
......
......@@ -103,12 +103,18 @@
</group>
<group><layout>vbox</layout>
<text><label>Cabin</label></text>
<text><label>Main</label></text>
<checkbox>
<property>/fdm/jsbsim/systems/lighting/panel/switch/cabin</property>
<live>true</live>
<binding><command>dialog-apply</command></binding>
</checkbox>
<text><label>Off</label></text>
<checkbox>
<property>/fdm/jsbsim/systems/lighting/panel/switch/cabin_backup</property>
<live>true</live>
<binding><command>dialog-apply</command></binding>
</checkbox>
<text><label>Backup</label></text>
</group>
<group><layout>vbox</layout>
<text><label>Cargo</label></text>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment