Copilot: use stopwatch.

parent 064bb0b3
......@@ -219,6 +219,9 @@ var _loop = func {
}
if(ready > _ready){
do(func{
Tu144.Window(1, 0.0);
});
settimer(func {
do(func{
Tu144.Frontlight(1);
......@@ -233,6 +236,9 @@ var _loop = func {
if(rolling > _rolling){
say("rolling", 1.5);
do(func{
Tu144.Stopwatch(1, 1);
});
}
if(rolling and !braking){
......@@ -300,6 +306,7 @@ var _loop = func {
if(gear_callout == "gear_in"){
settimer(func{
do(func{
Tu144.Stopwatch(1, 2);
# Tu144.GearCmd(0);
Tu144.Frontlight(0);
Tu144.IntlightsDefault();
......
......@@ -670,6 +670,32 @@ AckMaster = func () {
}, 1.0);
}
# @brief Start/stop/reset stopwatch.
# Acknowledge master warning and caution. Takes 2 seconds.
# @param memb Crew member: 0: pilot, 1: copilot, 2: engineer, 3: navigator.
# @param cmd Command: 0: reset, 1: start, 2: stop.
Stopwatch = func (memb, cmd) {
setprop("/fdm/jsbsim/systems/instr/AChS[" ~ memb ~ "]/button/stopwatch", 0);
var err = 0;
settimer(func{
err = math.mod((cmd - getprop("/fdm/jsbsim/systems/instr/AChS[" ~ memb ~ "]/status/stopwatch") + 3), 3);
if(err){
setprop("/fdm/jsbsim/systems/instr/AChS[" ~ memb ~ "]/button/stopwatch", 1);
settimer(func{
setprop("/fdm/jsbsim/systems/instr/AChS[" ~ memb ~ "]/button/stopwatch", 0);
if(err > 1){
settimer(func{
setprop("/fdm/jsbsim/systems/instr/AChS[" ~ memb ~ "]/button/stopwatch", 1);
settimer(func{
setprop("/fdm/jsbsim/systems/instr/AChS[" ~ memb ~ "]/button/stopwatch", 0);
}, 0.4);
}, 0.4);
}
}, 0.4);
}
}, 0.4);
}
# @brief Prepare NPK settings.
PrepareNPK = func () {
SetMagvar(magvar());
......@@ -794,9 +820,9 @@ IntlightsOff = func () {
# @brief Set window command
# @param door Window number. 0: Left; 1: Right.
# @param window Window number. 0: Left; 1: Right.
# @param cmd Command norm (0.0 .. 1.0).
Window = func(door, cmd) {
Window = func(window, cmd) {
setprop("fdm/jsbsim/systems/doors/window[" ~ door ~ "]/cmd-norm", cmd);
}
......
......@@ -255,6 +255,9 @@
<system file="Tu-144-jsbsim/instruments/AChS_0"/>
<system file="Tu-144-jsbsim/instruments/AChS_1"/>
<system file="Tu-144-jsbsim/instruments/AChS_2"/>
<!--
<system file="Tu-144-jsbsim/instruments/AChS_3"/>
-->
<system file="Tu-144-jsbsim/instruments/SSTM"/>
<system file="Tu-144-jsbsim/comm/SPU"/>
......
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