2020-03-27 22:50:02 +00:00
|
|
|
|
#
|
2021-02-13 23:29:20 +00:00
|
|
|
|
# Chrono - Clock - ET
|
2020-03-27 22:50:02 +00:00
|
|
|
|
#
|
2020-04-12 20:20:46 +00:00
|
|
|
|
var chr = aircraft.timer.new("instrumentation/chrono[0]/elapsetime-sec",1);
|
|
|
|
|
var clk = aircraft.timer.new("instrumentation/clock/elapsetime-sec",1);
|
2021-02-13 23:29:20 +00:00
|
|
|
|
var chrono_cpt = aircraft.timer.new("instrumentation/ndchrono[0]/elapsetime-sec",1);
|
|
|
|
|
var chrono_fo = aircraft.timer.new("instrumentation/ndchrono[1]/elapsetime-sec",1);
|
2020-03-27 22:50:02 +00:00
|
|
|
|
|
2020-10-04 14:18:22 +00:00
|
|
|
|
var chr_min = nil;
|
|
|
|
|
var chr_sec = nil;
|
|
|
|
|
var chr_tmp = nil;
|
|
|
|
|
var clock2_1 = nil;
|
|
|
|
|
var clock2_2 = nil;
|
|
|
|
|
var day = nil;
|
|
|
|
|
var et_hr = nil;
|
|
|
|
|
var et_min = nil;
|
|
|
|
|
var et_tmp = nil;
|
|
|
|
|
var month = nil;
|
|
|
|
|
var rudder_val = nil;
|
|
|
|
|
var tmp = nil;
|
|
|
|
|
var tmp1 = nil;
|
|
|
|
|
var UTC_date = nil;
|
|
|
|
|
var UTC_date1 = nil;
|
|
|
|
|
var UTC_date2 = nil;
|
|
|
|
|
var UTC_date3 = nil;
|
|
|
|
|
var year = nil;
|
|
|
|
|
|
|
|
|
|
var et_selector = props.globals.initNode("/instrumentation/clock/et-selector", 1, "INT");
|
|
|
|
|
var utc_selector = props.globals.initNode("/instrumentation/clock/utc-selector",0,"INT");
|
|
|
|
|
var set_knob = props.globals.initNode("/instrumentation/clock/set-knob",0,"INT");
|
|
|
|
|
|
|
|
|
|
var clock = {
|
|
|
|
|
elapsedHour: props.globals.initNode("/instrumentation/clock/et-hr", 0, "INT"),
|
|
|
|
|
elapsedMin: props.globals.initNode("/instrumentation/clock/et-min", 0, "INT"),
|
|
|
|
|
elapsedString: props.globals.initNode("/instrumentation/clock/elapsed-string", 0, "STRING"),
|
|
|
|
|
elapsedSec: props.globals.initNode("/instrumentation/clock/elapsetime-sec", 0, "INT"),
|
|
|
|
|
indicatedSec: props.globals.getNode("/instrumentation/clock/indicated-seconds"),
|
|
|
|
|
hhMM: props.globals.initNode("/instrumentation/clock/clock_hh_mm", 0, "STRING"),
|
|
|
|
|
utcDate: [props.globals.initNode("/instrumentation/clock/utc-date", "", "STRING"), props.globals.initNode("/instrumentation/clock/utc-date1", "", "STRING"),
|
|
|
|
|
props.globals.initNode("/instrumentation/clock/utc-date2", "", "STRING"),props.globals.initNode("/instrumentation/clock/utc-date3", "", "STRING")],
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var chrono = {
|
|
|
|
|
chronoReset: props.globals.initNode("/instrumentation/chrono[0]/chrono-reset", 1, "INT"),
|
|
|
|
|
elapseTime: props.globals.initNode("/instrumentation/chrono[0]/elapsetime-sec", 0, "INT"),
|
|
|
|
|
etMin: props.globals.initNode("/instrumentation/chrono[0]/chr-et-min", 0, "INT"),
|
|
|
|
|
etSec: props.globals.initNode("/instrumentation/chrono[0]/chr-et-sec", 0, "INT"),
|
|
|
|
|
etString: props.globals.initNode("/instrumentation/chrono[0]/chr-et-string", 0, "STRING"),
|
|
|
|
|
paused: props.globals.getNode("/instrumentation/chrono[0]/paused"),
|
|
|
|
|
started: props.globals.getNode("/instrumentation/chrono[0]/started"),
|
|
|
|
|
};
|
|
|
|
|
|
2021-02-13 23:29:20 +00:00
|
|
|
|
#Cpt chrono
|
|
|
|
|
var cpt_chrono = {
|
|
|
|
|
etHh_cpt: props.globals.initNode("/instrumentation/ndchrono[0]/etHh_cpt", 0, "INT"),
|
|
|
|
|
etMin_cpt: props.globals.initNode("/instrumentation/ndchrono[0]/etMin_cpt", 0, "INT"),
|
|
|
|
|
etSec_cpt: props.globals.initNode("/instrumentation/ndchrono[0]/etSec_cpt", 0, "INT"),
|
|
|
|
|
text: props.globals.initNode("/instrumentation/ndchrono[0]/text", "0' 00''", "STRING"),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#Fo chrono
|
|
|
|
|
var fo_chrono = {
|
|
|
|
|
etHh_fo: props.globals.initNode("/instrumentation/ndchrono[1]/etHh_fo", 0, "INT"),
|
|
|
|
|
etMin_fo: props.globals.initNode("/instrumentation/ndchrono[1]/etMin_fo", 0, "INT"),
|
|
|
|
|
etSec_fo: props.globals.initNode("/instrumentation/ndchrono[1]/etSec_fo", 0, "INT"),
|
|
|
|
|
text: props.globals.initNode("/instrumentation/ndchrono[1]/text", "0' 00''", "STRING"),
|
|
|
|
|
};
|
|
|
|
|
|
2020-10-04 14:18:22 +00:00
|
|
|
|
var rudderTrim = {
|
|
|
|
|
rudderTrimDisplay: props.globals.initNode("/controls/flight/rudder-trim-display", 0, "STRING"),
|
|
|
|
|
rudderTrimDisplayLetter: props.globals.initNode("/controls/flight/rudder-trim-letter-display", "", "STRING"),
|
|
|
|
|
};
|
|
|
|
|
|
2021-05-18 12:02:11 +00:00
|
|
|
|
setlistener("/sim/signals/fdm-initialized", func {
|
2020-04-12 20:20:46 +00:00
|
|
|
|
chr.stop();
|
|
|
|
|
chr.reset();
|
2020-04-12 20:40:49 +00:00
|
|
|
|
clk.stop();
|
2020-04-17 21:53:20 +00:00
|
|
|
|
clk.reset();
|
2021-02-13 23:29:20 +00:00
|
|
|
|
chrono_cpt.reset();
|
|
|
|
|
chrono_fo.reset();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
rudderTrim.rudderTrimDisplay.setValue(sprintf("%2.1f", pts.Fdm.JSBsim.Hydraulics.Rudder.trimDeg.getValue()));
|
2020-04-12 20:40:49 +00:00
|
|
|
|
start_loop.start();
|
2020-03-27 22:50:02 +00:00
|
|
|
|
});
|
|
|
|
|
|
2020-10-04 14:18:22 +00:00
|
|
|
|
setlistener("/instrumentation/chrono[0]/chrono-reset", func(et){
|
|
|
|
|
tmp = et.getValue();
|
2020-04-17 21:53:20 +00:00
|
|
|
|
if (tmp == 2) {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
if (chrono.started.getBoolValue()) {
|
|
|
|
|
if (!chrono.paused.getBoolValue()) {
|
|
|
|
|
chrono.elapseTime.setValue(0);
|
|
|
|
|
chrono.chronoReset.setBoolValue(0);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
} else {
|
|
|
|
|
chr.stop();
|
|
|
|
|
chr.reset();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chrono.chronoReset.setBoolValue(1);
|
|
|
|
|
chrono.started.setBoolValue(0);
|
|
|
|
|
chrono.paused.setBoolValue(0);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
};
|
|
|
|
|
} else {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
if (!chrono.paused.getBoolValue()) {
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# No action required
|
|
|
|
|
} else {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chrono.paused.setBoolValue(0);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
} elsif (tmp == 1) {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
if (chrono.started.getBoolValue()) {
|
|
|
|
|
if (!chrono.paused.getBoolValue()) {
|
2020-04-17 21:53:20 +00:00
|
|
|
|
chr.stop();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chrono.paused.setBoolValue(1);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
} else {
|
|
|
|
|
chr.stop();
|
|
|
|
|
};
|
|
|
|
|
} else {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
if (!chrono.paused.getBoolValue()) {
|
2020-04-17 21:53:20 +00:00
|
|
|
|
chr.stop();
|
|
|
|
|
} else {
|
|
|
|
|
chr.stop();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chrono.paused.setBoolValue(0);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
} elsif (tmp == 0) {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
if (!chrono.started.getBoolValue()) {
|
|
|
|
|
if (!chrono.paused.getBoolValue()) {
|
2020-04-17 21:53:20 +00:00
|
|
|
|
chr.start();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chrono.started.setBoolValue(1);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
} else {
|
|
|
|
|
chr.start();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chrono.paused.setBoolValue(0);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
};
|
|
|
|
|
} else {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
if (!chrono.paused.getBoolValue()) {
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# No action required
|
|
|
|
|
} else {
|
|
|
|
|
chr.start();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chrono.paused.setBoolValue(0);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-10-04 14:18:22 +00:00
|
|
|
|
}, 0, 0);
|
2020-03-27 22:50:02 +00:00
|
|
|
|
|
2021-02-13 23:29:20 +00:00
|
|
|
|
#Chrono
|
|
|
|
|
setlistener("instrumentation/efis[0]/inputs/CHRONO", func(et){
|
|
|
|
|
chrono0 = et.getValue();
|
|
|
|
|
if (chrono0 == 1){
|
|
|
|
|
chrono_cpt.start();
|
|
|
|
|
} elsif (chrono0 == 2) {
|
|
|
|
|
chrono_cpt.stop();
|
|
|
|
|
} elsif (chrono0 == 0) {
|
|
|
|
|
chrono_cpt.reset();
|
|
|
|
|
setprop("instrumentation/ndchrono[0]/elapsetime-sec", 0);
|
|
|
|
|
}
|
|
|
|
|
}, 0, 0);
|
|
|
|
|
|
|
|
|
|
setlistener("instrumentation/efis[1]/inputs/CHRONO", func(et){
|
|
|
|
|
chrono1 = et.getValue();
|
|
|
|
|
if (chrono1 == 1){
|
|
|
|
|
chrono_fo.start();
|
|
|
|
|
} elsif (chrono1 == 2) {
|
|
|
|
|
chrono_fo.stop();
|
|
|
|
|
} elsif (chrono1 == 0) {
|
|
|
|
|
chrono_fo.reset();
|
|
|
|
|
setprop("instrumentation/ndchrono[1]/elapsetime-sec", 0);
|
|
|
|
|
}
|
|
|
|
|
}, 0, 0);
|
|
|
|
|
|
2020-04-12 20:20:46 +00:00
|
|
|
|
setlistener("instrumentation/clock/et-selector", func(et){
|
2020-10-04 14:18:22 +00:00
|
|
|
|
tmp1 = et.getValue();
|
|
|
|
|
if (tmp1 == 2){
|
2020-04-12 20:40:49 +00:00
|
|
|
|
clk.reset();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
} elsif (tmp1 == 1){
|
2020-04-12 20:40:49 +00:00
|
|
|
|
clk.stop();
|
2020-10-04 14:18:22 +00:00
|
|
|
|
} elsif (tmp1 == 0){
|
2020-04-12 20:40:49 +00:00
|
|
|
|
clk.start();
|
|
|
|
|
}
|
2020-10-04 14:18:22 +00:00
|
|
|
|
}, 0, 0);
|
2020-03-30 20:42:09 +00:00
|
|
|
|
|
|
|
|
|
var start_loop = maketimer(0.1, func {
|
2020-04-18 12:53:54 +00:00
|
|
|
|
if (systems.ELEC.Bus.dcEss.getValue() < 25) { return; }
|
2020-10-04 14:18:22 +00:00
|
|
|
|
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# Annun-test
|
2020-10-04 14:18:22 +00:00
|
|
|
|
if (pts.Controls.Switches.annunTest.getBoolValue()) {
|
|
|
|
|
UTC_date = sprintf("%02d %02d %02d", "88", "88", "88");
|
|
|
|
|
UTC_date1 = sprintf("%02d", "88");
|
|
|
|
|
UTC_date2 = sprintf("%02d", "88");
|
|
|
|
|
UTC_date3 = sprintf("%02d", "88");
|
|
|
|
|
clock2_1 = "88:88";
|
|
|
|
|
clock2_2 = sprintf("%02d", 88);
|
|
|
|
|
|
|
|
|
|
clock.hhMM.setValue(clock2_1);
|
|
|
|
|
clock.indicatedSec.setValue(clock2_2);
|
|
|
|
|
clock.utcDate[0].setValue(UTC_date);
|
|
|
|
|
clock.utcDate[1].setValue(UTC_date1);
|
|
|
|
|
clock.utcDate[2].setValue(UTC_date2);
|
|
|
|
|
clock.utcDate[3].setValue(UTC_date3);
|
|
|
|
|
|
|
|
|
|
chrono.etString.setValue("88 88");
|
|
|
|
|
clock.elapsedString.setValue("88:88");
|
2020-04-17 21:53:20 +00:00
|
|
|
|
} else {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
day = pts.Sim.Time.UTC.day.getValue();
|
|
|
|
|
month = pts.Sim.Time.UTC.month.getValue();
|
|
|
|
|
year = pts.Sim.Time.UTC.year.getValue();
|
|
|
|
|
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# Clock
|
2020-10-04 14:18:22 +00:00
|
|
|
|
UTC_date = sprintf("%02d %02d %02d", month, day, substr(sprintf("%2d", year),1,2));
|
|
|
|
|
UTC_date1 = sprintf("%02d", month);
|
|
|
|
|
UTC_date2 = sprintf("%02d", day);
|
|
|
|
|
UTC_date3 = substr(sprintf("%2d", year),2,2);
|
|
|
|
|
clock2_1 = pts.Instrumentation.Clock.indicatedStringShort.getValue();
|
|
|
|
|
clock2_2 = sprintf("%02d", substr(pts.Instrumentation.Clock.indicatedString.getValue(),6,2));
|
|
|
|
|
|
|
|
|
|
clock.hhMM.setValue(clock2_1);
|
|
|
|
|
clock.indicatedSec.setValue(clock2_2);
|
|
|
|
|
clock.utcDate[0].setValue(UTC_date);
|
|
|
|
|
clock.utcDate[1].setValue(UTC_date1);
|
|
|
|
|
clock.utcDate[2].setValue(UTC_date2);
|
|
|
|
|
clock.utcDate[3].setValue(UTC_date3);
|
|
|
|
|
|
|
|
|
|
if (set_knob.getValue() == "") {
|
|
|
|
|
set_knob.setValue(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (utc_selector.getValue() == "") {
|
|
|
|
|
utc_selector.setValue(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# if (getprop("/instrumentation/clock/utc-selector") == 0) {
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# # To do - GPS mode
|
|
|
|
|
# };
|
2020-10-04 14:18:22 +00:00
|
|
|
|
# if (getprop("/instrumentation/clock/utc-selector") == 1) {
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# # To do - INT mode
|
|
|
|
|
# };
|
2020-10-04 14:18:22 +00:00
|
|
|
|
# if (getprop("/instrumentation/clock/utc-selector") == 2) {
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# # To do - SET mode
|
|
|
|
|
# };
|
2020-04-18 06:28:42 +00:00
|
|
|
|
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# Chrono
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chr_tmp = chrono.elapseTime.getValue();
|
2020-04-17 21:53:20 +00:00
|
|
|
|
if (chr_tmp >= 6000) {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chrono.elapseTime.setValue(chr_tmp - 6000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chr_min = int(chr_tmp * 0.0166666666667);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
if (chr_tmp >= 60) {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chr_sec = int(chr_tmp - (chr_min * 60));
|
2020-04-17 21:53:20 +00:00
|
|
|
|
} else {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
chr_sec = int(chr_tmp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chrono.etMin.setValue(chr_min);
|
|
|
|
|
chrono.etSec.setValue(chr_sec);
|
|
|
|
|
chrono.etString.setValue(sprintf("%02d:%02d", chr_min, chr_sec));
|
2020-03-30 20:42:09 +00:00
|
|
|
|
|
2020-04-17 21:53:20 +00:00
|
|
|
|
# ET clock
|
2020-10-04 14:18:22 +00:00
|
|
|
|
et_tmp = clock.elapsedSec.getValue();
|
2020-04-17 21:53:20 +00:00
|
|
|
|
if (et_tmp >= 360000) {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
clock.elapsedSec.setValue(et_tmp - 360000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
et_min = int(et_tmp * 0.0166666666667);
|
|
|
|
|
et_hr = int(et_min * 0.0166666666667);
|
2020-04-17 21:53:20 +00:00
|
|
|
|
et_min = et_min - (et_hr * 60);
|
2020-10-04 14:18:22 +00:00
|
|
|
|
|
|
|
|
|
clock.elapsedHour.setValue(et_hr);
|
|
|
|
|
clock.elapsedMin.setValue(et_min);
|
|
|
|
|
clock.elapsedString.setValue(sprintf("%02d:%02d", et_hr, et_min));
|
2020-07-16 18:50:01 +00:00
|
|
|
|
|
|
|
|
|
foreach (item; update_items) {
|
|
|
|
|
item.update(nil);
|
|
|
|
|
}
|
2020-10-04 14:18:22 +00:00
|
|
|
|
}
|
2021-02-13 23:29:20 +00:00
|
|
|
|
|
|
|
|
|
#Cpt Chrono
|
|
|
|
|
chr0_tmp = getprop("instrumentation/ndchrono[0]/elapsetime-sec");
|
|
|
|
|
if (chr0_tmp >= 360000) {
|
|
|
|
|
setprop("instrumentation/ndchrono[0]/elapsetime-sec", getprop("instrumentation/ndchrono[0]/elapsetime-sec") - 360000);
|
|
|
|
|
};
|
|
|
|
|
chr0_hh = int(chr0_tmp * 0.000277777777778);
|
|
|
|
|
chr0_min = int((chr0_tmp * 0.0166666666667) - (chr0_hh * 60));
|
|
|
|
|
chr0_sec = int(chr0_tmp - (chr0_min * 60) - (chr0_hh * 3600));
|
|
|
|
|
setprop("instrumentation/ndchrono[0]/etHh_cpt", chr0_hh);
|
|
|
|
|
setprop("instrumentation/ndchrono[0]/etMin_cpt", chr0_min);
|
|
|
|
|
setprop("instrumentation/ndchrono[0]/etSec_cpt", chr0_sec);
|
|
|
|
|
if (chr0_tmp >= 3600) {
|
|
|
|
|
setprop("instrumentation/ndchrono[0]/text", sprintf("%02d H %02d'", chr0_hh, chr0_min));
|
|
|
|
|
} else {
|
|
|
|
|
setprop("instrumentation/ndchrono[0]/text", sprintf("%02d' %02d''", chr0_min, chr0_sec));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#Fo Chrono
|
|
|
|
|
chr1_tmp = getprop("instrumentation/ndchrono[1]/elapsetime-sec");
|
|
|
|
|
if (chr1_tmp >= 360000) {
|
|
|
|
|
setprop("instrumentation/ndchrono[1]/elapsetime-sec", getprop("instrumentation/ndchrono[1]/elapsetime-sec") - 360000);
|
|
|
|
|
};
|
|
|
|
|
chr1_hh = int(chr1_tmp * 0.000277777777778);
|
|
|
|
|
chr1_min = int(chr1_tmp * 0.0166666666667);
|
|
|
|
|
chr1_sec = int(chr1_tmp - (chr1_min * 60) - (chr1_hh * 3600));
|
|
|
|
|
setprop("instrumentation/ndchrono[1]/etHh_fo", chr1_hh);
|
|
|
|
|
setprop("instrumentation/ndchrono[1]/etMin_fo", chr1_min);
|
|
|
|
|
setprop("instrumentation/ndchrono[1]/etSec_fo", chr1_sec);
|
|
|
|
|
if (chr1_tmp >= 3600) {
|
|
|
|
|
setprop("instrumentation/ndchrono[1]/text", sprintf("%02d H %02d'", chr1_hh, chr1_min));
|
|
|
|
|
} else {
|
|
|
|
|
setprop("instrumentation/ndchrono[1]/text", sprintf("%02d' %02d''", chr1_min, chr1_sec));
|
|
|
|
|
}
|
2020-04-18 13:05:40 +00:00
|
|
|
|
});
|
2020-04-18 06:28:42 +00:00
|
|
|
|
|
2020-07-17 21:15:49 +00:00
|
|
|
|
var updateRudderTrim = func() {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
if (pts.Controls.Switches.annunTest.getBoolValue()) {
|
|
|
|
|
rudderTrim.rudderTrimDisplay.setValue(sprintf("%3.1f", "88.8"));
|
|
|
|
|
rudderTrim.rudderTrimDisplayLetter.setValue(sprintf("%1.0f", "8"));
|
2020-07-17 21:15:49 +00:00
|
|
|
|
} else {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
rudder_val = pts.Fdm.JSBsim.Hydraulics.Rudder.trimDeg.getValue();
|
2020-07-17 21:15:49 +00:00
|
|
|
|
if (rudder_val > -0.05 and rudder_val < 0.05) {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
rudderTrim.rudderTrimDisplay.setValue(sprintf("%2.1f", abs(rudder_val)));
|
|
|
|
|
rudderTrim.rudderTrimDisplayLetter.setValue("");
|
2020-07-17 21:15:49 +00:00
|
|
|
|
} else {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
rudderTrim.rudderTrimDisplay.setValue(sprintf("%2.1f", abs(rudder_val)));
|
2020-07-17 21:15:49 +00:00
|
|
|
|
if (rudder_val >= 0.05) {
|
2020-10-04 14:18:22 +00:00
|
|
|
|
rudderTrim.rudderTrimDisplayLetter.setValue("R");
|
|
|
|
|
} elsif (rudder_val <= -0.05) {
|
|
|
|
|
rudderTrim.rudderTrimDisplayLetter.setValue("L");
|
2020-07-16 18:50:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-17 21:15:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var update_items = [
|
|
|
|
|
props.UpdateManager.FromProperty("/fdm/jsbsim/hydraulics/rudder/trim-deg", 0.05, func(notification)
|
|
|
|
|
{
|
|
|
|
|
updateRudderTrim();
|
|
|
|
|
}
|
2020-07-16 18:50:01 +00:00
|
|
|
|
),
|
2020-07-17 21:15:49 +00:00
|
|
|
|
];
|
|
|
|
|
|
2021-02-13 23:29:20 +00:00
|
|
|
|
setlistener("/controls/switches/annun-test", updateRudderTrim, 0, 0);
|