diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 2c3a17ce..ee17ff7a 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -81,6 +81,8 @@ setprop("/systems/acconfig/spinning", 0); setprop("/systems/acconfig/spin", "-"); setprop("/systems/acconfig/new-revision", ""); setprop("/systems/acconfig/out-of-date", 0); +setprop("/systems/acconfig/mismatch-code", "0x000"); +setprop("/systems/acconfig/mismatch-reason", "XX"); var main_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/main/dialog", "Aircraft/IDG-A32X/AircraftConfig/main.xml"); var welcome_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/welcome/dialog", "Aircraft/IDG-A32X/AircraftConfig/welcome.xml"); var ps_load_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/psload/dialog", "Aircraft/IDG-A32X/AircraftConfig/psload.xml"); @@ -91,6 +93,7 @@ var fbw_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/fbw/dialog", "Aircraft/ID var fail_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/fail/dialog", "Aircraft/IDG-A32X/AircraftConfig/fail.xml"); var about_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/about/dialog", "Aircraft/IDG-A32X/AircraftConfig/about.xml"); var update_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/update/dialog", "Aircraft/IDG-A32X/AircraftConfig/update.xml"); +var error_mismatch = gui.Dialog.new("sim/gui/dialogs/acconfig/error/mismatch/dialog", "Aircraft/IDG-A32X/AircraftConfig/error-mismatch.xml"); spinning.start(); init_dlg.open(); @@ -106,12 +109,25 @@ setlistener("/systems/acconfig/new-revision", func { } }); +var mismatch_chk = func { + if (num(string.replace(getprop("/sim/version/flightgear"),".","")) < 201731) { + setprop("/systems/acconfig/mismatch-code", "0x121"); + setprop("/systems/acconfig/mismatch-reason", "FGFS version older than 2017.3.1, please update FlightGear"); + if (getprop("/systems/acconfig/out-of-date") != 1) { + error_mismatch.open(); + } + print("Mismatch: 0x121"); + } +} + setlistener("/sim/signals/fdm-initialized", func { init_dlg.close(); if (getprop("/systems/acconfig/out-of-date") == 1) { update_dlg.open(); - print("The A320Family is out of date!"); - } else { + print("System: The IDG-A32X is out of date!"); + } + mismatch_chk(); + if (getprop("/systems/acconfig/out-of-date") != 1 and getprop("/systems/acconfig/mismatch-code") == "0x000") { welcome_dlg.open(); } spinning.stop(); diff --git a/AircraftConfig/error-mismatch.xml b/AircraftConfig/error-mismatch.xml new file mode 100644 index 00000000..f29a8a2b --- /dev/null +++ b/AircraftConfig/error-mismatch.xml @@ -0,0 +1,138 @@ + + + + + + + + + + aircraft-config-mismatch + vbox + + 0.5 + 0 + 0 + 1 + + + + hbox + + left + + + + + + + + vbox + + + left + + + + left + + + + + + + hbox + left + + + + + + + 1 + + /systems/acconfig/mismatch-code + 1 + + + + + hbox + left + + + + + + + 1 + + /systems/acconfig/mismatch-reason + 1 + + + + + + + left + + + + left + + + + left + + + + + + + + hbox + + + + + + diff --git a/AircraftConfig/update.xml b/AircraftConfig/update.xml index 1175f1e8..e3dae625 100644 --- a/AircraftConfig/update.xml +++ b/AircraftConfig/update.xml @@ -20,100 +20,87 @@ 1 - - hbox - - left - - - + - - - - - - vbox - - - center - - - - center - - - - center - - - - center - - - - - - - - - hbox - - - - + } else { + acconfig.error_mismatch.open(); + } + + + + dialog-close + + + diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 52ccbe22..990efaf0 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -146,13 +146,35 @@ modes/cpt-du-xfr 2 + + /systems/acconfig/mismatch-code + 0x000 + + + Mismatch1 + Aircraft/IDG-A32X/Models/Instruments/PFD/Mismatch.xml + + -0.5807 + -0.51115 + -0.0442 + -15 + + + + /systems/acconfig/mismatch-code + 0x000 + + + + translate PFD1 + Mismatch1 modes/cpt-du-xfr 0.18845 @@ -193,9 +215,27 @@ + + Mismatch2 + Aircraft/IDG-A32X/Models/Instruments/PFD/Mismatch.xml + + -0.5807 + 0.51115 + -0.0442 + -15 + + + + /systems/acconfig/mismatch-code + 0x000 + + + + translate PFD2 + Mismatch2 modes/fo-du-xfr -0.19505 diff --git a/Models/Instruments/PFD/Mismatch.xml b/Models/Instruments/PFD/Mismatch.xml new file mode 100644 index 00000000..f09b87a9 --- /dev/null +++ b/Models/Instruments/PFD/Mismatch.xml @@ -0,0 +1,13 @@ + + + + + + + res/mismatch.ac + + diff --git a/Models/Instruments/PFD/res/mismatch.ac b/Models/Instruments/PFD/res/mismatch.ac new file mode 100644 index 00000000..2d7c5f21 --- /dev/null +++ b/Models/Instruments/PFD/res/mismatch.ac @@ -0,0 +1,23 @@ +AC3Db +MATERIAL "ac3dmat1" rgb 1 1 1 amb 0 0 0 emis 0.658824 0.670588 0.67451 spec 0 0 0 shi 128 trans 0 +OBJECT world +kids 1 +OBJECT poly +name "rect" +loc 0.0643506 0 0 +texture "mismatch.png" +crease 45.000000 +numvert 4 +-0.0639733 0.0784821 -0.0784821 +-0.0639733 0.0784821 0.0784821 +-0.0639733 -0.0784821 0.0784821 +-0.0639733 -0.0784821 -0.0784821 +numsurf 1 +SURF 0x30 +mat 0 +refs 4 +0 1 1 +1 0 1 +2 0 0 +3 1 0 +kids 0 diff --git a/Models/Instruments/PFD/res/mismatch.png b/Models/Instruments/PFD/res/mismatch.png new file mode 100644 index 00000000..7db0bdb9 Binary files /dev/null and b/Models/Instruments/PFD/res/mismatch.png differ diff --git a/Systems/it-fbw.xml b/Systems/it-fbw.xml index 62787682..c5705a63 100644 --- a/Systems/it-fbw.xml +++ b/Systems/it-fbw.xml @@ -19,6 +19,14 @@ false noise-spike + + + + /systems/acconfig/mismatch-code + 0x000 + + + /controls/flight/aileron /controls/flight/aileron-input-fast 5 @@ -27,6 +35,14 @@ false noise-spike + + + + /systems/acconfig/mismatch-code + 0x000 + + + /controls/flight/elevator /controls/flight/elevator-input-fast 5 @@ -35,6 +51,14 @@ false noise-spike + + + + /systems/acconfig/mismatch-code + 0x000 + + + @@ -69,6 +93,14 @@ false noise-spike + + + + /systems/acconfig/mismatch-code + 0x000 + + + diff --git a/revision.txt b/revision.txt index f4a8e832..c2a7108a 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -1513 \ No newline at end of file +1514 \ No newline at end of file