diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 1ae2342e..3bef098c 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -439,6 +439,7 @@ vs-text-test wpt_led wpt_led.001 + terr_on_nd_label systems/electrical/bus/dc-ess @@ -482,7 +483,6 @@ qnh-test radio_opt_led rudder-trim-test - terr_on_nd_on ver.fmgc controls/switches/annun-test @@ -595,9 +595,10 @@ rudder-trim - 0.118 + 0.108 -0.016 - -0.134 + -0.133 + 90 0 @@ -607,15 +608,17 @@ %2.1f fdm/jsbsim/hydraulics/rudder/trim-cmd-deg false + left-to-right led.txf true false false - 0.009 + 0.008 32 32 + default @@ -631,7 +634,7 @@ xy-plane text-value -88.8 - autopilot/servicable + autopilot/serviceable false led.txf true @@ -2225,7 +2228,7 @@ xy-plane text-value STD - autopilot/servicable + autopilot/serviceable false led.txf true @@ -2251,7 +2254,7 @@ xy-plane text-value STD - autopilot/servicable + autopilot/serviceable false led.txf true @@ -2277,7 +2280,7 @@ xy-plane text-value 88.88 - autopilot/servicable + autopilot/serviceable false led.txf true @@ -2303,7 +2306,7 @@ xy-plane text-value 88.88 - autopilot/servicable + autopilot/serviceable false led.txf true @@ -3641,7 +3644,7 @@ xy-plane text-value .888 - autopilot/servicable + autopilot/serviceable false led.txf true @@ -3693,7 +3696,7 @@ xy-plane text-value 888 - autopilot/servicable + autopilot/serviceable false led.txf true @@ -3745,7 +3748,7 @@ xy-plane text-value 88888 - autopilot/servicable + autopilot/serviceable false led.txf true @@ -3823,7 +3826,7 @@ xy-plane text-value -8888 - autopilot/servicable + autopilot/serviceable false led.txf true @@ -5116,6 +5119,12 @@ brakes_accum_psi.mark brakes_lb_psi.mark brakes_rb_psi.mark + clock_et_selector + clock_utc_selector + clock_reset_pushbutton + clock_chr_pushbutton + clock_date_set_pushbutton + clock_display clock_glare flood_lt_main.mark flood_lt_ped.mark @@ -6318,12 +6327,12 @@ compass_box iesi clock_body - clock_glare clock_et_selector clock_utc_selector clock_reset_pushbutton clock_chr_pushbutton clock_date_set_pushbutton + gear_lever_body ParkBrk RudderTrim @@ -6452,7 +6461,12 @@ Aircraft/A320-family/Models/Effects/clock clock clock_body - clock_glare + clock_et_selector + clock_utc_selector + clock_reset_pushbutton + clock_chr_pushbutton + clock_date_set_pushbutton + clock_display @@ -6474,12 +6488,12 @@ ceiling compass_box clock_body - clock_glare clock_et_selector clock_utc_selector clock_reset_pushbutton clock_chr_pushbutton clock_date_set_pushbutton + clock_glare DoorC efis_box_1 efis_box_2 @@ -6577,6 +6591,7 @@ dec_low_on dec_max_on dec_med_on + terr_on_nd_label foot_warmer_cpt_sw foot_warmer_cpt_sw.mark foot_warmer_fo_sw @@ -6676,6 +6691,7 @@ sts.007 thr_l rev_l + terr_on_nd_label thr_l_body thr_l_button thr_l_screw @@ -6742,15 +6758,124 @@ - select chrono1 - - instrumentation/chrono/running - instrumentation/chrono/paused - + + + instrumentation/chrono/chrono-reset + 2 + + instrumentation/clock/serviceable + + + + + + select + chrono2_1 + + + instrumentation/clock/serviceable + + + instrumentation/clock/set-knob + 0 + + + + instrumentation/clock/set-knob + 1 + + + instrumentation/clock/utc-selector + 2 + + + + + + + + + select + chrono2_2 + + + instrumentation/clock/serviceable + + + instrumentation/clock/set-knob + 0 + + + + instrumentation/clock/set-knob + 1 + + + instrumentation/clock/utc-selector + 2 + + + + + + + + + select + UTC_1 + + + + instrumentation/clock/serviceable + + + instrumentation/clock/set-knob + 0 + + + + instrumentation/clock/set-knob + 1 + + + instrumentation/clock/utc-selector + 2 + + + + + + + + + select + UTC_2 + + + + instrumentation/clock/serviceable + + + instrumentation/clock/set-knob + 0 + + + + instrumentation/clock/set-knob + 1 + + + instrumentation/clock/utc-selector + 2 + + + + + @@ -6765,8 +6890,8 @@ chrono1 -0.553 - 0.159 - 0.215 + 0.160 + 0.2155 90 72.81 @@ -6774,14 +6899,14 @@ xy-plane text-value %s - instrumentation/chrono/text + instrumentation/chrono/elapsed-string false left-to-right true false false led.txf - 0.009 + 0.008 1.0 0.012 0.050 @@ -6793,10 +6918,10 @@ - chrono2 + chrono2_1 -0.546 - 0.159 + 0.153 0.196 90 72.81 @@ -6805,37 +6930,6 @@ xy-plane text-value %s - instrumentation/clock/indicated-string - false - left-to-right - true - false - false - led.txf - 0.009 - 1.0 - 0.012 - 0.050 - - 32 - 32 - - default - - - - chrono3 - - -0.54 - 0.159 - 0.178 - 90 - 72.81 - - center-center - xy-plane - text-value - %s instrumentation/clock/indicated-short-string false left-to-right @@ -6843,7 +6937,131 @@ false false led.txf - 0.009 + 0.008 + 1.0 + 0.012 + 0.060 + + 32 + 32 + + default + + + + chrono2_2 + + -0.546 + 0.172 + 0.196 + 90 + 72.81 + + center-center + xy-plane + text-value + %s + instrumentation/clock/indicated-seconds + false + left-to-right + true + false + false + led.txf + 0.006 + 1.0 + 0.012 + 0.060 + + 32 + 32 + + default + + + + UTC_1 + + -0.546 + 0.153 + 0.196 + 90 + 72.81 + + center-center + xy-plane + text-value + %s + instrumentation/clock/utc-date1 + false + left-to-right + true + false + false + led.txf + 0.008 + 1.0 + 0.012 + 0.060 + + 32 + 32 + + default + + + + UTC_2 + + -0.546 + 0.172 + 0.196 + 90 + 72.81 + + center-center + xy-plane + text-value + %s + instrumentation/clock/utc-date2 + false + left-to-right + true + false + false + led.txf + 0.006 + 1.0 + 0.012 + 0.060 + + 32 + 32 + + default + + + + chrono3 + + -0.54 + 0.160 + 0.1785 + 90 + 72.81 + + center-center + xy-plane + text-value + %s + instrumentation/clock/elapsed-string + false + left-to-right + true + false + false + led.txf + 0.008 1.0 0.012 0.040 @@ -6943,14 +7161,14 @@ pick clock_reset_pushbutton - controls/switches/clock_reset_pushbutton + instrumentation/chrono/chrono-reset - + false property-cycle - instruments/clock/chrono-reset - 1 + instrumentation/chrono/chrono-reset + 2 @@ -6958,14 +7176,25 @@ pick clock_chr_pushbutton - instruments/clock/time-knob + instrumentation/chrono/chrono-reset + + + false + + property-cycle + instrumentation/chrono/chrono-reset + 1 + 0 + + false property-cycle - instruments/clock/time-knob - 1 + instrumentation/chrono/started + 0 + 1 @@ -6973,18 +7202,27 @@ pick clock_date_set_pushbutton - controls/switches/clock_date_set_pushbutton + instrumentation/clock/set-knob - - + false property-cycle - instruments/clock/set-knob + instrumentation/clock/set-knob 0 1 + + + false + + property-cycle + instrumentation/clock/set-knob + 1 + 0 + + @@ -7038,7 +7276,7 @@ false property-cycle - instrumentation/clock/et-knob + instrumentation/clock/et-selector 0 1 2 @@ -7049,7 +7287,7 @@ false property-cycle - instrumentation/clock/et-knob + instrumentation/clock/et-selector 2 1 0 @@ -7061,7 +7299,7 @@ ET selector rotate rotate clock_et_selector - instrumentation/clock/et-knob + instrumentation/clock/et-selector 00 145 diff --git a/Nasal/Instruments/clock.nas b/Nasal/Instruments/clock.nas index fcf6b017..7d584ad1 100644 --- a/Nasal/Instruments/clock.nas +++ b/Nasal/Instruments/clock.nas @@ -1,50 +1,101 @@ # +# Chrono - Clock - ET # -# -var chronometer = aircraft.timer.new("instrumentation/clock/ET-sec",1); -var elapsetime = aircraft.timer.new("instrumentation/clock/elapsetime-sec",1); +var chr_et = aircraft.timer.new("instrumentation/chrono/elapsetime-sec",1); +var et = aircraft.timer.new("instrumentation/clock/elapsetime-sec",1); setlistener("sim/signals/fdm-initialized", func { - chronometer.stop(); - props.globals.initNode("instrumentation/clock/ET-display",0,"INT"); - props.globals.initNode("instrumentation/clock/time-display",0,"INT"); - props.globals.initNode("instrumentation/clock/time-knob",0,"INT"); - props.globals.initNode("instrumentation/clock/et-knob",0,"INT"); + chr_et.stop(); + et.stop(); + props.globals.initNode("instrumentation/clock/indicated-string",0,"STRING"); + props.globals.initNode("instrumentation/clock/elapsed-string",0,"STRING"); + props.globals.initNode("instrumentation/chrono/elapsed-string",0,"STRING"); + props.globals.initNode("instrumentation/clock/display-string",0,"STRING"); + props.globals.initNode("instrumentation/clock/et-selector",1,"INT"); + props.globals.initNode("instrumentation/clock/utc-selector",0,"INT"); props.globals.initNode("instrumentation/clock/set-knob",0,"INT"); - props.globals.initNode("instrumentation/clock/utc_date",0,"STRING"); - #settimer(start_updates,1); - start_loop(); - #writeSettings(); + props.globals.initNode("instrumentation/chrono/chrono-reset",2,"INT"); + props.globals.initNode("instrumentation/clock/et-hr",0,"INT"); + props.globals.initNode("instrumentation/clock/et-min",0,"INT"); + props.globals.initNode("instrumentation/chrono/et-hr",0,"INT"); + props.globals.initNode("instrumentation/chrono/et-min",0,"INT"); + start_loop.start(); }); -setlistener("instrumentation/clock/et-knob", func(et){ - var tmp = et.getValue(); - if(tmp == -1){ - chronometer.reset(); - }elsif(tmp==0){ - chronometer.stop(); +setlistener("instrumentation/chrono/chrono-reset", func(chrono){ + var tmp = chrono.getValue(); + if(tmp == 2){ + chr_et.stop(); + chr_et.reset(); + #setprop("instrumentation/chrono/chrono-reset", 0); }elsif(tmp==1){ - chronometer.start(); + chr_et.stop(); + }elsif(tmp==0){ + chr_et.start(); } },0,0); -var start_loop = func { - var UTC_date = sprintf("%02d %02d %02d", getprop("sim/time/utc/month"), getprop("sim/time/utc/day"), getprop("sim/time/utc/year")); - var et_tmp = getprop("instrumentation/clock/ET-sec"); - if(et_tmp == 0) - { - et_tmp = getprop("instrumentation/clock/elapsetime-sec"); +setlistener("instrumentation/clock/et-selector", func(clock_et){ + var tmp1 = clock_et.getValue(); + if(tmp1 == 2){ + et.reset(); + setprop("instrumentation/clock/et-selector", 1); + }elsif(tmp1==1){ + et.stop(); + }elsif(tmp1==0){ + et.start(); } +},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 %02d", getprop("sim/time/utc/month"), getprop("sim/time/utc/day")); + var UTC_date2 = 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); + if (getprop("instrumentation/clock/set-knob")=="") + { + setprop("instrumentation/clock/set-knob", 0); + }; + if (getprop("instrumentation/clock/utc-selector")=="") + { + setprop("instrumentation/clock/utc-selector", 0); + }; + + # 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); et_tmp = et_hr * 100 + et_min; - setprop("instrumentation/clock/ET-display",et_tmp); + setprop("instrumentation/clock/elapsed-string",et_tmp); et_tmp = int(getprop("instrumentation/clock/elapsetime-sec") * 0.0166666666667); et_hr = int(et_tmp * 0.0166666666667); et_min = et_tmp - (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); - setprop("instrumentation/clock/utc_date", UTC_date); - settimer(update_systems,0); -} + + # Chrono + var et_tmp = getprop("instrumentation/chrono/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); + et_sec = int(et_tmp) - (et_min * 60) - (et_hr * 3600); + et_tmp = et_hr * 100 + et_min + et_sec; + setprop("instrumentation/chrono/elapsed-string",et_tmp); + et_tmp = int(getprop("instrumentation/chrono/elapsetime-sec") * 0.0166666666667); + et_hr = int(et_tmp * 0.0166666666667); + et_min = et_tmp - (et_hr * 60); + setprop("instrumentation/chrono/et-hr",et_hr); + setprop("instrumentation/chrono/et-min",et_min); + setprop("instrumentation/chrono/et-min",et_sec); + et_tmp = sprintf("%02d %02d", et_min, et_sec); + setprop("instrumentation/chrono/elapsed-string", et_tmp); +});