1
0
Fork 0

Chrono, Clock, ET Chrono, rudder trim indicator improvements

Clock (todo): GPS/INT/SET mode
This commit is contained in:
vezza 2020-04-17 23:53:20 +02:00 committed by Jonathan Redpath
parent 7348b8997e
commit d940e862ae
3 changed files with 439 additions and 254 deletions

View file

@ -370,6 +370,7 @@
<object-name>autoland_light_on</object-name>
<object-name>brk_fan_on</object-name>
<object-name>brk_hot_on</object-name>
<object-name>clock_glare</object-name>
<object-name>cstr_led</object-name>
<object-name>cstr_led.001</object-name>
<object-name>dec_low_on</object-name>
@ -429,18 +430,19 @@
<object-name>radio_vor_led</object-name>
<object-name>rgear_down</object-name>
<object-name>rgear_unlk</object-name>
<object-name>rudder-trim-letter</object-name>
<object-name>rudder-trim</object-name>
<object-name>spd-text</object-name>
<object-name>spd-text-test</object-name>
<object-name>terr_on_nd_on</object-name>
<object-name>terr_on_nd_label</object-name>
<object-name>terr_on_nd_on_l</object-name>
<object-name>terr_on_nd_on_r</object-name>
<object-name>vord_led</object-name>
<object-name>vord_led.001</object-name>
<object-name>vs-text</object-name>
<object-name>vs-text-test</object-name>
<object-name>wpt_led</object-name>
<object-name>wpt_led.001</object-name>
<object-name>terr_on_nd_label</object-name>
<object-name>clock_glare</object-name>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
@ -483,7 +485,6 @@
<object-name>exped_led</object-name>
<object-name>qnh-test</object-name>
<object-name>radio_opt_led</object-name>
<object-name>rudder-trim-test</object-name>
<object-name>ver.fmgc</object-name>
<condition>
<property>controls/switches/annun-test</property>
@ -594,27 +595,26 @@
</animation>
<text>
<name>rudder-trim</name>
<name>rudder-trim-letter</name>
<offsets>
<x-m>0.108</x-m>
<y-m>-0.016</y-m>
<y-m>-0.032</y-m>
<z-m>-0.133</z-m>
<!--<z-m>-0.134</z-m>-->
<heading-deg>90</heading-deg>
<roll-deg>0</roll-deg>
</offsets>
<alignment>center-center</alignment>
<alignment>left-center</alignment>
<axis-alignment>xy-plane</axis-alignment>
<type type="string">number-value</type>
<format type="string">%2.1f</format>
<property>fdm/jsbsim/hydraulics/rudder/trim-cmd-deg</property>
<type type="string">text-value</type>
<format type="string">%s</format>
<property>controls/flight/rudder-trim-letter-display</property>
<truncate>false</truncate>
<layout>left-to-right</layout>
<font type="string">led.txf</font>
<font type="string">DSEG/DSEG14/Classic/DSEG14Classic-Bold.ttf</font>
<draw-text>true</draw-text>
<draw-alignment>false</draw-alignment>
<draw-boundingbox>false</draw-boundingbox>
<character-size>0.008</character-size>
<character-size>0.007</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
@ -623,42 +623,33 @@
</text>
<text>
<name>rudder-trim-test</name>
<name>rudder-trim</name>
<offsets>
<x-m>0.12323</x-m>
<y-m>-0.01972</y-m>
<z-m>-0.137</z-m>
<x-m>0.108</x-m>
<y-m>-0.008</y-m>
<z-m>-0.133</z-m>
<heading-deg>90</heading-deg>
<roll-deg>0</roll-deg>
</offsets>
<alignment>center-center</alignment>
<alignment>right-center</alignment>
<axis-alignment>xy-plane</axis-alignment>
<type type="string">text-value</type>
<format type="string">-88.8</format>
<property>autopilot/serviceable</property>
<format type="string">%s</format>
<property>controls/flight/rudder-trim-display</property>
<truncate>false</truncate>
<font type="string">led.txf</font>
<layout>left-to-right</layout>
<font>led.txf</font>
<draw-text>true</draw-text>
<draw-alignment>false</draw-alignment>
<draw-boundingbox>false</draw-boundingbox>
<character-size>0.009</character-size>
<character-size>0.007</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
</font-resolution>
<kerning>default</kerning>
</text>
<animation>
<type>select</type>
<object-name>rudder-trim</object-name>
<condition>
<not-equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</not-equals>
</condition>
</animation>
<animation>
<type>rotate</type>
<object-name>ParkBrk</object-name>
@ -705,16 +696,22 @@
<type>select</type>
<object-name>terr_on_nd_on_l</object-name>
<condition>
<or>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<equals>
<property>controls/switches/terr_on_nd_l</property>
<value>1</value>
</equals>
</or>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<or>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<equals>
<property>controls/switches/terr_on_nd_l</property>
<value>1</value>
</equals>
</or>
</and>
</condition>
</animation>
@ -740,16 +737,22 @@
<type>select</type>
<object-name>terr_on_nd_on_r</object-name>
<condition>
<or>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<equals>
<property>controls/switches/terr_on_nd_r</property>
<value>1</value>
</equals>
</or>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<or>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<equals>
<property>controls/switches/terr_on_nd_r</property>
<value>1</value>
</equals>
</or>
</and>
</condition>
</animation>
@ -6926,22 +6929,42 @@
<type>select</type>
<object-name>chrono1</object-name>
<condition>
<or>
<equals>
<property>instrumentation/chrono/chrono-reset</property>
<value>0</value>
</equals>
<and>
<and>
<or>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-1</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-2</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</or>
<or>
<equals>
<property>instrumentation/chrono/chrono-reset</property>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<greater-than>
<property>instrumentation/chrono/elapsetime-sec</property>
<equals>
<property>instrumentation/chrono/chrono-reset</property>
<value>0</value>
</greater-than>
</and>
</or>
</equals>
<and>
<equals>
<property>instrumentation/chrono/chrono-reset</property>
<value>1</value>
</equals>
<greater-than>
<property>instrumentation/chrono/elapsetime-sec</property>
<value>0</value>
</greater-than>
</and>
</or>
</and>
</condition>
</animation>
@ -6950,6 +6973,20 @@
<object-name>chrono2_1</object-name>
<condition>
<and>
<or>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-1</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-2</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</or>
<property>instrumentation/clock/serviceable</property>
<or>
<equals>
@ -6976,7 +7013,25 @@
<object-name>chrono2_2</object-name>
<condition>
<and>
<or>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-1</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-2</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</or>
<property>instrumentation/clock/serviceable</property>
<not-equals>
<property>instrumentation/chrono[0]/chrono-reset</property>
<value>2</value>
</not-equals>
<or>
<equals>
<property>instrumentation/clock/set-knob</property>
@ -7003,27 +7058,43 @@
<object-name>UTC_2</object-name>
<object-name>UTC_3</object-name>
<condition>
<not>
<and>
<property>instrumentation/clock/serviceable</property>
<or>
<equals>
<property>instrumentation/clock/set-knob</property>
<value>0</value>
</equals>
<and>
<and>
<or>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-1</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-2</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</or>
<not>
<and>
<property>instrumentation/clock/serviceable</property>
<or>
<equals>
<property>instrumentation/clock/set-knob</property>
<value>1</value>
<value>0</value>
</equals>
<equals>
<property>instrumentation/clock/utc-selector</property>
<value>2</value>
</equals>
</and>
</or>
</and>
</not>
<and>
<equals>
<property>instrumentation/clock/set-knob</property>
<value>1</value>
</equals>
<equals>
<property>instrumentation/clock/utc-selector</property>
<value>2</value>
</equals>
</and>
</or>
</and>
</not>
</and>
</condition>
</animation>
@ -7031,7 +7102,23 @@
<type>select</type>
<object-name>chrono3</object-name>
<condition>
<property>instrumentation/clock/serviceable</property>
<and>
<or>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-1</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-hot-2</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</or>
<property>instrumentation/clock/serviceable</property>
</and>
</condition>
</animation>
@ -7079,7 +7166,7 @@
<axis-alignment>xy-plane</axis-alignment>
<type type="string">text-value</type>
<format type="string">%s</format>
<property>instrumentation/clock/indicated-short-string</property>
<property>instrumentation/clock/clock_hh_mm</property>
<truncate>false</truncate>
<layout>left-to-right</layout>
<draw-text type="bool">true</draw-text> <!-- draw the text itself -->
@ -7225,7 +7312,7 @@
<name>chrono3</name>
<offsets>
<x-m>-0.54</x-m>
<y-m>0.158</y-m>
<y-m>0.1595</y-m>
<z-m>0.1785</z-m>
<heading-deg>90</heading-deg>
<roll-deg>72.81</roll-deg>

View file

@ -125791,12 +125791,12 @@ numsurf 1
SURF 0X0
mat 24
refs 6
5 0.542737 0.326399
2 0.487908 0.326399
0 0.487908 0.268329
4 0.542737 0.268329
1 0.597566 0.268329
3 0.597566 0.326399
5 0.543967 0.325169
2 0.489138 0.325169
0 0.489138 0.267099
4 0.543967 0.267099
1 0.598796 0.267099
3 0.598796 0.325169
kids 0
OBJECT poly
name "brk_hot_on"
@ -125815,12 +125815,12 @@ numsurf 1
SURF 0X0
mat 24
refs 6
5 0.489179 0.378231
3 0.489179 0.327542
0 0.540317 0.327542
2 0.591455 0.327542
4 0.591455 0.378231
1 0.540317 0.378231
5 0.49164 0.378231
3 0.49164 0.327542
0 0.542778 0.327542
2 0.593916 0.327542
4 0.593916 0.378231
1 0.542778 0.378231
kids 0
OBJECT poly
name "dec_low_on"
@ -320932,8 +320932,8 @@ refs 4
SURF 0X12
mat 1
refs 2
327 0 0
328 0 0
673 0 0
674 0 0
SURF 0X12
mat 1
refs 2
@ -320947,8 +320947,8 @@ refs 2
SURF 0X12
mat 1
refs 2
673 0 0
674 0 0
327 0 0
328 0 0
kids 0
OBJECT poly
name "pedals_indicator_1"
@ -544890,73 +544890,73 @@ numsurf 10
SURF 0X0
mat 23
refs 4
5 0.609434 0.126776
0 0.609434 0.126776
3 0.732308 0.126776
7 0.732308 0.126776
5 0.609434 0.11994
0 0.609434 0.11994
3 0.732308 0.11994
7 0.732308 0.11994
SURF 0X0
mat 23
refs 4
0 0.609434 0.126776
5 0.609434 0.126776
10 0.609434 0.249456
2 0.609434 0.249456
0 0.609434 0.11994
5 0.609434 0.11994
10 0.609434 0.24262
2 0.609434 0.24262
SURF 0X0
mat 23
refs 4
11 0.722494 0.238723
6 0.722494 0.137509
7 0.732308 0.126776
8 0.732308 0.249456
11 0.722494 0.231887
6 0.722494 0.130673
7 0.732308 0.11994
8 0.732308 0.24262
SURF 0X0
mat 23
refs 4
10 0.609434 0.249456
9 0.619248 0.238723
11 0.722494 0.238723
8 0.732308 0.249456
10 0.609434 0.24262
9 0.619248 0.231887
11 0.722494 0.231887
8 0.732308 0.24262
SURF 0X0
mat 23
refs 4
5 0.609434 0.126776
4 0.619248 0.137509
9 0.619248 0.238723
10 0.609434 0.249456
5 0.609434 0.11994
4 0.619248 0.130673
9 0.619248 0.231887
10 0.609434 0.24262
SURF 0X0
mat 23
refs 4
6 0.722494 0.137509
4 0.619248 0.137509
5 0.609434 0.126776
7 0.732308 0.126776
6 0.722494 0.130673
4 0.619248 0.130673
5 0.609434 0.11994
7 0.732308 0.11994
SURF 0X0
mat 23
refs 4
2 0.609434 0.249456
10 0.609434 0.249456
8 0.732308 0.249456
1 0.732308 0.249456
2 0.609434 0.24262
10 0.609434 0.24262
8 0.732308 0.24262
1 0.732308 0.24262
SURF 0X0
mat 23
refs 4
8 0.732308 0.249456
7 0.732308 0.126776
3 0.732308 0.126776
1 0.732308 0.249456
8 0.732308 0.24262
7 0.732308 0.11994
3 0.732308 0.11994
1 0.732308 0.24262
SURF 0X0
mat 23
refs 4
11 0.722494 0.232008
9 0.619248 0.232008
4 0.619248 0.130794
6 0.722494 0.130794
11 0.722494 0.23152
9 0.619248 0.23152
4 0.619248 0.130306
6 0.722494 0.130306
SURF 0X0
mat 23
refs 4
2 0.609434 0.249456
1 0.732308 0.249456
3 0.732308 0.126776
0 0.609434 0.126776
2 0.609434 0.24262
1 0.732308 0.24262
3 0.732308 0.11994
0 0.609434 0.11994
kids 0
OBJECT poly
name "terr_on_nd_label"
@ -544996,10 +544996,10 @@ terr_on_nd_on_l.mesh
crease 45.0
texture "main_labels.png"
numvert 4
-0.53508 0.1567 0.22978
-0.53501 0.15682 0.21331
-0.53923 0.17088 0.22987
-0.53917 0.171 0.2134
-0.53508 0.15674 0.22982
-0.53501 0.15678 0.21335
-0.53923 0.17092 0.22983
-0.53917 0.17096 0.21336
numsurf 1
SURF 0X0
mat 24
@ -545016,10 +545016,10 @@ terr_on_nd_on_r.mesh
crease 45.0
texture "main_labels.png"
numvert 4
-0.54895 0.20552 -0.21949
-0.54935 0.20538 -0.23595
-0.55285 0.21977 -0.21951
-0.55324 0.21963 -0.23598
-0.54903 0.20573 -0.21972
-0.54943 0.20559 -0.23618
-0.55293 0.21998 -0.21974
-0.55332 0.21984 -0.23621
numsurf 1
SURF 0X0
mat 24
@ -545050,75 +545050,75 @@ numvert 12
-0.55313 0.20293 -0.23765
numsurf 10
SURF 0X0
mat 24
mat 23
refs 4
5 0.619248 0.130234
3 0.722494 0.130234
0 0.722494 0.231448
1 0.619248 0.231448
5 0.619248 0.128281
3 0.722494 0.128281
0 0.722494 0.229495
1 0.619248 0.229495
SURF 0X0
mat 24
mat 23
refs 4
0 0.722494 0.238723
2 0.732308 0.249456
8 0.609434 0.249456
1 0.619248 0.238723
0 0.722494 0.229934
2 0.732308 0.240667
8 0.609434 0.240667
1 0.619248 0.229934
SURF 0X0
mat 24
mat 23
refs 4
4 0.732308 0.126776
2 0.732308 0.249456
0 0.722494 0.238723
3 0.722494 0.137509
4 0.732308 0.117987
2 0.732308 0.240667
0 0.722494 0.229934
3 0.722494 0.12872
SURF 0X0
mat 24
mat 23
refs 4
6 0.609434 0.126776
4 0.732308 0.126776
3 0.722494 0.137509
5 0.619248 0.137509
6 0.609434 0.117987
4 0.732308 0.117987
3 0.722494 0.12872
5 0.619248 0.12872
SURF 0X0
mat 24
mat 23
refs 4
1 0.619248 0.238723
8 0.609434 0.249456
6 0.609434 0.126776
5 0.619248 0.137509
1 0.619248 0.229934
8 0.609434 0.240667
6 0.609434 0.117987
5 0.619248 0.12872
SURF 0X0
mat 24
mat 23
refs 4
11 0.732308 0.126776
4 0.732308 0.126776
6 0.609434 0.126776
7 0.609434 0.126776
11 0.732308 0.117987
4 0.732308 0.117987
6 0.609434 0.117987
7 0.609434 0.117987
SURF 0X0
mat 24
mat 23
refs 4
8 0.609434 0.249456
9 0.609434 0.249456
7 0.609434 0.126776
6 0.609434 0.126776
8 0.609434 0.240667
9 0.609434 0.240667
7 0.609434 0.117987
6 0.609434 0.117987
SURF 0X0
mat 24
mat 23
refs 4
2 0.732308 0.249456
10 0.732308 0.249456
9 0.609434 0.249456
8 0.609434 0.249456
2 0.732308 0.240667
10 0.732308 0.240667
9 0.609434 0.240667
8 0.609434 0.240667
SURF 0X0
mat 24
mat 23
refs 4
11 0.732308 0.126776
7 0.609434 0.126776
9 0.609434 0.249456
10 0.732308 0.249456
11 0.732308 0.117987
7 0.609434 0.117987
9 0.609434 0.240667
10 0.732308 0.240667
SURF 0X0
mat 24
mat 23
refs 4
11 0.732308 0.126776
10 0.732308 0.249456
2 0.732308 0.249456
4 0.732308 0.126776
11 0.732308 0.117987
10 0.732308 0.240667
2 0.732308 0.240667
4 0.732308 0.117987
kids 0
OBJECT group
name "thr_l"

View file

@ -7,8 +7,9 @@ var clk = aircraft.timer.new("instrumentation/clock/elapsetime-sec",1);
setlistener("sim/signals/fdm-initialized", func {
chr.stop();
chr.reset();
clk.reset();
clk.stop();
clk.reset();
props.globals.initNode("instrumentation/clock/clock_hh_mm", 0,"STRING");
props.globals.initNode("instrumentation/clock/indicated-string",0,"STRING");
props.globals.initNode("instrumentation/clock/elapsed-string",0,"STRING");
props.globals.initNode("instrumentation/clock/elapsetime-sec",0,"INT");
@ -19,24 +20,68 @@ setlistener("sim/signals/fdm-initialized", func {
props.globals.initNode("instrumentation/clock/et-min",0,"INT");
props.globals.initNode("instrumentation/chrono[0]/chr-et-string",0,"STRING");
props.globals.initNode("instrumentation/chrono[0]/elapsetime-sec",0,"INT");
props.globals.initNode("instrumentation/chrono[0]/chr-et-sec",0,"INT");
props.globals.initNode("instrumentation/chrono[0]/chrono-reset",1,"INT");
props.globals.initNode("instrumentation/chrono[0]/chr-et-min",0,"INT");
props.globals.initNode("instrumentation/chrono[0]/chr-et-sec",0,"INT");
props.globals.initNode("controls/flight/rudder-trim-display",0,"STRING");
start_loop.start();
});
setlistener("instrumentation/chrono[0]/chrono-reset", func(et){
var tmp = et.getValue();
if(tmp == 2){
chr.stop();
chr.reset();
setprop("instrumentation/chrono[0]/chrono-reset", 1);
}elsif(tmp==1){
chr.stop();
}elsif(tmp==0){
chr.start();
}
if (tmp == 2) {
if (getprop("instrumentation/chrono[0]/started") == 1) {
if (getprop("instrumentation/chrono[0]/paused") == 0) {
setprop("instrumentation/chrono[0]/elapsetime-sec", 0);
setprop("instrumentation/chrono[0]/chrono-reset", 0);
} else {
chr.stop();
chr.reset();
setprop("instrumentation/chrono[0]/chrono-reset", 1);
setprop("instrumentation/chrono[0]/started", 0);
setprop("instrumentation/chrono[0]/paused", 0);
};
} else {
if (getprop("instrumentation/chrono[0]/paused") == 0) {
# No action required
} else {
setprop("instrumentation/chrono[0]/paused", 0);
};
};
} elsif (tmp == 1) {
if (getprop("instrumentation/chrono[0]/started") == 1) {
if (getprop("instrumentation/chrono[0]/paused") == 0) {
chr.stop();
setprop("instrumentation/chrono[0]/paused", 1);
} else {
chr.stop();
};
} else {
if (getprop("instrumentation/chrono[0]/paused") == 0) {
chr.stop();
} else {
chr.stop();
setprop("instrumentation/chrono[0]/paused", 0);
};
};
} elsif (tmp == 0) {
if (getprop("instrumentation/chrono[0]/started") == 0) {
if (getprop("instrumentation/chrono[0]/paused") == 0) {
chr.start();
setprop("instrumentation/chrono[0]/started", 1);
} else {
chr.start();
setprop("instrumentation/chrono[0]/paused", 0);
};
} else {
if (getprop("instrumentation/chrono[0]/paused") == 0) {
# No action required
} else {
chr.start();
setprop("instrumentation/chrono[0]/paused", 0);
};
};
};
},0,0);
setlistener("instrumentation/clock/et-selector", func(et){
@ -51,49 +96,102 @@ setlistener("instrumentation/clock/et-selector", func(et){
},0,0);
var start_loop = maketimer(0.1, func {
var UTC_date = sprintf("%02d %02d %02d", getprop("sim/time/utc/month"), getprop("sim/time/utc/day"), substr(sprintf("%2d", getprop("sim/time/utc/year")),1,2));
setprop("instrumentation/clock/utc-date", UTC_date);
var UTC_date1 = sprintf("%02d", getprop("sim/time/utc/month"));
var UTC_date2 = sprintf("%02d", getprop("sim/time/utc/day"));
var UTC_date3 = substr(sprintf("%2d", getprop("sim/time/utc/year")),1,2);
var clock2_2 = substr(getprop("instrumentation/clock/indicated-string"),6,2);
setprop("instrumentation/clock/indicated-seconds", sprintf("%02d", clock2_2));
setprop("instrumentation/clock/utc-date", UTC_date);
setprop("instrumentation/clock/utc-date1", UTC_date1);
setprop("instrumentation/clock/utc-date2", UTC_date2);
setprop("instrumentation/clock/utc-date3", UTC_date3);
if (getprop("instrumentation/clock/set-knob")=="")
{
setprop("instrumentation/clock/set-knob", 0);
};
if (getprop("instrumentation/clock/utc-selector")=="")
{
setprop("instrumentation/clock/utc-selector", 0);
};
# Chrono
var chr_tmp = getprop("instrumentation/chrono[0]/elapsetime-sec");
if (chr_tmp >= 6000) {
setprop("instrumentation/chrono[0]/elapsetime-sec", chr_tmp-6000);
};
var chr_min = int(chr_tmp * 0.0166666666667);
if (chr_tmp >= 60) {
var chr_sec = int(chr_tmp - (chr_min * 60));
# Annun-test
if (getprop("controls/switches/annun-test") == 1) {
var UTC_date = sprintf("%02d %02d %02d", "88", "88", "88");
var UTC_date1 = sprintf("%02d", "88");
var UTC_date2 = sprintf("%02d", "88");
var UTC_date3 = sprintf("%02d", "88");
var clock2_1 = "88:88";
var clock2_2 = sprintf("%02d", 88);
setprop("instrumentation/clock/clock_hh_mm", clock2_1);
setprop("instrumentation/clock/indicated-seconds", clock2_2);
setprop("instrumentation/clock/utc-date", UTC_date);
setprop("instrumentation/clock/utc-date1", UTC_date1);
setprop("instrumentation/clock/utc-date2", UTC_date2);
setprop("instrumentation/clock/utc-date3", UTC_date3);
setprop("instrumentation/chrono[0]/chr-et-string", "88 88");
setprop("instrumentation/clock/elapsed-string", "88:88");
} else {
var chr_sec = int(chr_tmp);
};
setprop("instrumentation/chrono[0]/chr-et-min",chr_min);
setprop("instrumentation/chrono[0]/chr-et-sec",chr_sec);
chr_tmp = sprintf("%02d %02d", chr_min, chr_sec);
setprop("instrumentation/chrono[0]/chr-et-string", chr_tmp);
# Clock
var UTC_date = sprintf("%02d %02d %02d", getprop("sim/time/utc/month"), getprop("sim/time/utc/day"), substr(sprintf("%2d", getprop("sim/time/utc/year")),1,2));
setprop("instrumentation/clock/utc-date", UTC_date);
var UTC_date1 = sprintf("%02d", getprop("sim/time/utc/month"));
var UTC_date2 = sprintf("%02d", getprop("sim/time/utc/day"));
var UTC_date3 = substr(sprintf("%2d", getprop("sim/time/utc/year")),2,2);
var clock2_1 = getprop("instrumentation/clock/indicated-short-string");
var clock2_2 = sprintf("%02d", substr(getprop("instrumentation/clock/indicated-string"),6,2));
setprop("instrumentation/clock/clock_hh_mm", clock2_1);
setprop("instrumentation/clock/indicated-seconds", clock2_2);
setprop("instrumentation/clock/utc-date", UTC_date);
setprop("instrumentation/clock/utc-date1", UTC_date1);
setprop("instrumentation/clock/utc-date2", UTC_date2);
setprop("instrumentation/clock/utc-date3", UTC_date3);
if (getprop("instrumentation/clock/set-knob") == "") {
setprop("instrumentation/clock/set-knob", 0);
};
if (getprop("instrumentation/clock/utc-selector") == "") {
setprop("instrumentation/clock/utc-selector", 0);
};
# if (getprop("instrumentation/clock/utc-selector") == 0) {
# # To do - GPS mode
# };
# if (getprop("instrumentation/clock/utc-selector") == 1) {
# # To do - INT mode
# };
# if (getprop("instrumentation/clock/utc-selector") == 2) {
# # To do - SET mode
# };
# Chrono
var chr_tmp = getprop("instrumentation/chrono[0]/elapsetime-sec");
if (chr_tmp >= 6000) {
setprop("instrumentation/chrono[0]/elapsetime-sec", chr_tmp-6000);
};
var chr_min = int(chr_tmp * 0.0166666666667);
if (chr_tmp >= 60) {
var chr_sec = int(chr_tmp - (chr_min * 60));
} else {
var chr_sec = int(chr_tmp);
};
setprop("instrumentation/chrono[0]/chr-et-min",chr_min);
setprop("instrumentation/chrono[0]/chr-et-sec",chr_sec);
chr_tmp = sprintf("%02d %02d", chr_min, chr_sec);
setprop("instrumentation/chrono[0]/chr-et-string", chr_tmp);
# ET clock
var et_tmp = getprop("instrumentation/clock/elapsetime-sec");
var et_min = int(et_tmp * 0.0166666666667);
var et_hr = int(et_min * 0.0166666666667);
et_min = et_min - (et_hr * 60);
setprop("instrumentation/clock/et-hr",et_hr);
setprop("instrumentation/clock/et-min",et_min);
et_tmp = sprintf("%02d:%02d", et_hr, et_min);
setprop("instrumentation/clock/elapsed-string", et_tmp);
# ET clock
var et_tmp = getprop("instrumentation/clock/elapsetime-sec");
if (et_tmp >= 360000) {
setprop("instrumentation/clock/elapsetime-sec", et_tmp-360000);
};
var et_min = int(et_tmp * 0.0166666666667);
var et_hr = int(et_min * 0.0166666666667);
et_min = et_min - (et_hr * 60);
setprop("instrumentation/clock/et-hr",et_hr);
setprop("instrumentation/clock/et-min",et_min);
et_tmp = sprintf("%02d:%02d", et_hr, et_min);
setprop("instrumentation/clock/elapsed-string", et_tmp);
};
# Rudder trim
var rudder_val = getprop("fdm/jsbsim/hydraulics/rudder/trim-cmd-deg");
if (getprop("controls/switches/annun-test") == 1) {
setprop("controls/flight/rudder-trim-display", "88.8");
setprop("controls/flight/rudder-trim-letter-display", "8");
} else {
if (rudder_val > -0.05 and rudder_val < 0.05) {
setprop("controls/flight/rudder-trim-display", sprintf("%2.1f", abs(rudder_val)));
setprop("controls/flight/rudder-trim-letter-display", "");
} else {
if (rudder_val >= 0.05) {
setprop("controls/flight/rudder-trim-display", sprintf("%2.1f", abs(rudder_val)));
setprop("controls/flight/rudder-trim-letter-display", "R");
} else {
if (rudder_val <= -0.05) {
setprop("controls/flight/rudder-trim-display", sprintf("%2.1f", abs(rudder_val)));
setprop("controls/flight/rudder-trim-letter-display", "L");
};
};
};
};
});