diff --git a/A320-100-CFM.xml b/A320-100-CFM.xml index dfde4253..e68416c8 100644 --- a/A320-100-CFM.xml +++ b/A320-100-CFM.xml @@ -137,7 +137,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/A320-200-CFM.xml b/A320-200-CFM.xml index d794782a..cc5c783c 100644 --- a/A320-200-CFM.xml +++ b/A320-200-CFM.xml @@ -137,7 +137,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/A320-200-IAE.xml b/A320-200-IAE.xml index 1b491710..ddbdc62d 100644 --- a/A320-200-IAE.xml +++ b/A320-200-IAE.xml @@ -137,7 +137,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/A320-main.xml b/A320-main.xml index 6de2247f..1c6f4db3 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -28,10 +28,31 @@ - 5000 - 200 - 500 0 + + 1 + + + + 1.0 + 0.0 + 1.0 + 0.1 + 0.01 + 2.0 + 0.0 + 0.0 + + 5.5 + 5.5 + 5.0 + 0.03 + true + + + + Model View + @@ -221,8 +242,10 @@ - dialog-show - pushback + nasal + @@ -374,6 +397,18 @@ + + + + + + + + + + + + Cockpit Crew @@ -1500,6 +1535,18 @@ Aircraft/IDG-A32X/Nasal/icing.nas + + Aircraft/IDG-A32X/Nasal/autopush.nas + + + Aircraft/IDG-A32X/Nasal/autopush_driver.nas + + + Aircraft/IDG-A32X/Nasal/dynarr.nas + + + Aircraft/IDG-A32X/Nasal/autopush_route.nas + diff --git a/A320neo-CFM.xml b/A320neo-CFM.xml index 653d89d0..828ec642 100644 --- a/A320neo-CFM.xml +++ b/A320neo-CFM.xml @@ -137,7 +137,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/A320neo-PW.xml b/A320neo-PW.xml index f14833a7..0f7cdc24 100644 --- a/A320neo-PW.xml +++ b/A320neo-PW.xml @@ -137,7 +137,6 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> - diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 538f58cf..d829028f 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -109,6 +109,7 @@ var updated_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/updated/dialog", "Air var error_mismatch = gui.Dialog.new("sim/gui/dialogs/acconfig/error/mismatch/dialog", "Aircraft/IDG-A32X/AircraftConfig/error-mismatch.xml"); var groundservices_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/groundsrvc/dialog", "Aircraft/IDG-A32X/AircraftConfig/groundservices.xml"); var du_quality = gui.Dialog.new("sim/gui/dialogs/acconfig/du-quality/dialog", "Aircraft/IDG-A32X/AircraftConfig/du-quality.xml"); +var autopush_dlg = gui.Dialog.new("sim/gui/dialogs/autopush/dialog", "Aircraft/IDG-A32X/AircraftConfig/autopush.xml"); spinning.start(); init_dlg.open(); @@ -162,7 +163,7 @@ setlistener("/sim/signals/fdm-initialized", func { } mismatch_chk(); readSettings(); - if (getprop("/systems/acconfig/options/revision") < current_revision and getprop("/systems/acconfig/mismatch-code") == "0x000") { + if (getprop("/systems/acconfig/out-of-date") != 1 and getprop("/systems/acconfig/options/revision") < current_revision and getprop("/systems/acconfig/mismatch-code") == "0x000") { updated_dlg.open(); } else if (getprop("/systems/acconfig/out-of-date") != 1 and getprop("/systems/acconfig/mismatch-code") == "0x000" and getprop("/systems/acconfig/options/welcome-skip") != 1) { welcome_dlg.open(); diff --git a/AircraftConfig/autopush.xml b/AircraftConfig/autopush.xml new file mode 100644 index 00000000..ef031d33 --- /dev/null +++ b/AircraftConfig/autopush.xml @@ -0,0 +1,326 @@ + + + + + + + autopush + vbox + + + + hbox + + + + + + + true + + + + + + + + + + + true + vbox + center + top + + + left + + /sim/model/pushback/enabled + true + + dialog-apply + + + + + table + + + 0 + 0 + + left + + + + + + 0 + 2 + -1.0 + 1.0 + /sim/model/pushback/steer-cmd-norm + true + + dialog-apply + + + + + + + + + 1 + 0 + + left + + + + + + 1 + 2 + -25 + 25 + /sim/model/pushback/target-speed-km_h + true + + dialog-apply + + + + + + + + + 1 + 5 + 16 + /sim/model/pushback/target-speed-km_h + %3.0f + true + right + + + + 1 + 6 + + left + + + + + + + + table + + + 0 + 0 + + left + + + + + + + + 1 + 0 + + left + + + + + + + + 1 + 3 + left + + true + /sim/model/pushback/route/show + + dialog-apply + + + + + 2 + 0 + + left + + + + + + + + + + + diff --git a/Models/Autopush/Goldhofert.xml b/Models/Autopush/Goldhofert.xml new file mode 100644 index 00000000..2af4c67f --- /dev/null +++ b/Models/Autopush/Goldhofert.xml @@ -0,0 +1,132 @@ + + + + Models/Airport/Pushback/Goldhofert.ac + + + + + Models/Airport/Pushback/Goldhofert-warning-light.xml + + -2.908 + 0.260 + 1.326 + 0 + + + + + Models/Airport/Pushback/Goldhofert-warning-light.xml + + -1.781 + 0.260 + 1.326 + 90 + + + + + spin + wheelfl + wheelfr + + gear/gear[0]/rollspeed-ms + -16.3 +
+ -2.8976 + 0 + 0.5809 +
+ + 0 + 1 + 0 + +
+ + + spin + wheelrl + wheelrr + + gear/gear[0]/rollspeed-ms + -16.3 +
+ 2.0501 + 0 + 0.5735 +
+ + 0 + 1 + 0 + +
+ + + select + + + sim/model/pushback/connected + + + + + rotate + sim/model/pushback/yaw + + 60.0 +
+ 0 + 0 + 0 +
+ + 0 + 0 + -1 + +
+ + + translate + + gear/gear[0]/compression-ft + 0.3048 + + 0 + 0 + 1 + + + + + rotate + + orientation/pitch-deg + + -7.0 +
+ 0 + 0 + 0 +
+ + 0 + 1 + 0 + +
+
diff --git a/Models/Autopush/cursor.ac b/Models/Autopush/cursor.ac new file mode 100644 index 00000000..0b320677 --- /dev/null +++ b/Models/Autopush/cursor.ac @@ -0,0 +1,589 @@ +AC3Db +MATERIAL "autopush cursor" rgb 0.0000 0.0000 0.0000 amb 0.0000 0.0000 0.0000 emis 1.000 0.173 0.545 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 +OBJECT world +name "Blender_exporter_v2.26__cursor.ac" +kids 1 +OBJECT poly +name "Circle" +data 11 +Circle.mesh +crease 40.0 +numvert 128 +0 0.2 -0.75 +0 0.2 -1 +-0.09802 0.2 -0.99518 +-0.19509 0.2 -0.98079 +-0.29028 0.2 -0.95694 +-0.38268 0.2 -0.92388 +-0.4714 0.2 -0.88192 +-0.55557 0.2 -0.83147 +-0.63439 0.2 -0.77301 +-0.70711 0.2 -0.70711 +-0.77301 0.2 -0.63439 +-0.83147 0.2 -0.55557 +-0.88192 0.2 -0.4714 +-0.92388 0.2 -0.38268 +-0.95694 0.2 -0.29028 +-0.98079 0.2 -0.19509 +-0.99518 0.2 -0.09802 +-1 0.2 0 +-0.99518 0.2 0.09802 +-0.98079 0.2 0.19509 +-0.95694 0.2 0.29028 +-0.92388 0.2 0.38268 +-0.88192 0.2 0.4714 +-0.83147 0.2 0.55557 +-0.77301 0.2 0.63439 +-0.70711 0.2 0.70711 +-0.63439 0.2 0.77301 +-0.55557 0.2 0.83147 +-0.4714 0.2 0.88192 +-0.38268 0.2 0.92388 +-0.29028 0.2 0.95694 +-0.19509 0.2 0.98079 +-0.09802 0.2 0.99518 +0 0.2 1 +0.09802 0.2 0.99518 +0.19509 0.2 0.98079 +0.29029 0.2 0.95694 +0.38268 0.2 0.92388 +0.4714 0.2 0.88192 +0.55557 0.2 0.83147 +0.63439 0.2 0.77301 +0.70711 0.2 0.70711 +0.77301 0.2 0.63439 +0.83147 0.2 0.55557 +0.88192 0.2 0.4714 +0.92388 0.2 0.38268 +0.95694 0.2 0.29028 +0.98079 0.2 0.19509 +0.99518 0.2 0.09802 +1 0.2 0 +0.99518 0.2 -0.09802 +0.98079 0.2 -0.19509 +0.95694 0.2 -0.29028 +0.92388 0.2 -0.38268 +0.88192 0.2 -0.4714 +0.83147 0.2 -0.55557 +0.77301 0.2 -0.63439 +0.70711 0.2 -0.70711 +0.6344 0.2 -0.77301 +0.55557 0.2 -0.83147 +0.4714 0.2 -0.88192 +0.38269 0.2 -0.92388 +0.29029 0.2 -0.95694 +0.19509 0.2 -0.98078 +0.09802 0.2 -0.99518 +-0.07351 0.2 -0.74639 +-0.14632 0.2 -0.73559 +-0.21771 0.2 -0.71771 +-0.28701 0.2 -0.69291 +-0.35355 0.2 -0.66144 +-0.41668 0.2 -0.6236 +-0.47579 0.2 -0.57976 +-0.53033 0.2 -0.53033 +-0.57976 0.2 -0.47579 +-0.6236 0.2 -0.41668 +-0.66144 0.2 -0.35355 +-0.69291 0.2 -0.28701 +-0.71771 0.2 -0.21771 +-0.73559 0.2 -0.14632 +-0.74639 0.2 -0.07351 +-0.75 0.2 0 +-0.74639 0.2 0.07351 +-0.73559 0.2 0.14632 +-0.71771 0.2 0.21771 +-0.69291 0.2 0.28701 +-0.66144 0.2 0.35355 +-0.6236 0.2 0.41668 +-0.57976 0.2 0.4758 +-0.53033 0.2 0.53033 +-0.47579 0.2 0.57976 +-0.41668 0.2 0.6236 +-0.35355 0.2 0.66144 +-0.28701 0.2 0.69291 +-0.21771 0.2 0.71771 +-0.14632 0.2 0.73559 +-0.07351 0.2 0.74639 +0 0.2 0.75 +0.07351 0.2 0.74639 +0.14632 0.2 0.73559 +0.21771 0.2 0.71771 +0.28701 0.2 0.69291 +0.35355 0.2 0.66144 +0.41668 0.2 0.6236 +0.4758 0.2 0.57976 +0.53033 0.2 0.53033 +0.57976 0.2 0.47579 +0.6236 0.2 0.41668 +0.66144 0.2 0.35355 +0.69291 0.2 0.28701 +0.71771 0.2 0.21771 +0.73559 0.2 0.14632 +0.74639 0.2 0.07351 +0.75 0.2 0 +0.74639 0.2 -0.07351 +0.73559 0.2 -0.14632 +0.71771 0.2 -0.21771 +0.69291 0.2 -0.28701 +0.66144 0.2 -0.35355 +0.6236 0.2 -0.41668 +0.57976 0.2 -0.47579 +0.53033 0.2 -0.53033 +0.4758 0.2 -0.57976 +0.41668 0.2 -0.6236 +0.35355 0.2 -0.66144 +0.28701 0.2 -0.69291 +0.21772 0.2 -0.7177 +0.14632 0.2 -0.73559 +0.07352 0.2 -0.74639 +numsurf 64 +SURF 0X10 +mat 0 +refs 4 +25 0.080806 0.323223 +88 0.091854 0.367417 +87 0.088765 0.381051 +24 0.076687 0.341402 +SURF 0X10 +mat 0 +refs 4 +12 0.06988 0.617849 +75 0.08366 0.588387 +74 0.086025 0.604169 +11 0.073033 0.638893 +SURF 0X10 +mat 0 +refs 4 +51 0.186299 0.548772 +114 0.170974 0.536579 +113 0.171649 0.518378 +50 0.187199 0.524504 +SURF 0X10 +mat 0 +refs 4 +64 0.131126 0.748796 +127 0.129595 0.686597 +126 0.134145 0.683897 +63 0.137193 0.745196 +SURF 0X10 +mat 0 +refs 4 +11 0.073033 0.638893 +74 0.086025 0.604169 +73 0.088765 0.618949 +10 0.076687 0.658598 +SURF 0X10 +mat 0 +refs 4 +24 0.076687 0.341402 +87 0.088765 0.381051 +86 0.086025 0.39583 +23 0.073033 0.361107 +SURF 0X10 +mat 0 +refs 4 +37 0.148918 0.26903 +100 0.142938 0.326773 +99 0.138607 0.320574 +36 0.143143 0.260765 +SURF 0X10 +mat 0 +refs 4 +50 0.187199 0.524504 +113 0.171649 0.518378 +112 0.171875 0.5 +49 0.1875 0.5 +SURF 0X10 +mat 0 +refs 4 +63 0.137193 0.745196 +126 0.134145 0.683897 +125 0.138607 0.679426 +62 0.143143 0.739235 +SURF 0X10 +mat 0 +refs 4 +10 0.076687 0.658598 +73 0.088765 0.618949 +72 0.091854 0.632583 +9 0.080806 0.676777 +SURF 0X10 +mat 0 +refs 4 +23 0.073033 0.361107 +86 0.086025 0.39583 +85 0.08366 0.411613 +22 0.06988 0.382151 +SURF 0X10 +mat 0 +refs 4 +36 0.143143 0.260765 +99 0.138607 0.320574 +98 0.134145 0.316103 +35 0.137193 0.254804 +SURF 0X10 +mat 0 +refs 4 +49 0.1875 0.5 +112 0.171875 0.5 +111 0.171649 0.481622 +48 0.187199 0.475496 +SURF 0X10 +mat 0 +refs 4 +62 0.143143 0.739235 +125 0.138607 0.679426 +124 0.142938 0.673227 +61 0.148918 0.73097 +SURF 0X10 +mat 0 +refs 4 +9 0.080806 0.676777 +72 0.091854 0.632583 +71 0.095263 0.644939 +8 0.08535 0.693253 +SURF 0X10 +mat 0 +refs 4 +22 0.06988 0.382151 +85 0.08366 0.411613 +84 0.081693 0.428247 +21 0.067258 0.404329 +SURF 0X10 +mat 0 +refs 4 +35 0.137193 0.254804 +98 0.134145 0.316103 +97 0.129595 0.313403 +34 0.131126 0.251204 +SURF 0X10 +mat 0 +refs 4 +48 0.187199 0.475496 +111 0.171649 0.481622 +110 0.170974 0.463421 +47 0.186299 0.451227 +SURF 0X10 +mat 0 +refs 4 +61 0.148918 0.73097 +124 0.142938 0.673227 +123 0.147097 0.66536 +60 0.154463 0.72048 +SURF 0X10 +mat 0 +refs 4 +8 0.08535 0.693253 +71 0.095263 0.644939 +70 0.098958 0.6559 +7 0.090277 0.707867 +SURF 0X10 +mat 0 +refs 4 +21 0.067258 0.404329 +84 0.081693 0.428247 +83 0.080143 0.445572 +20 0.065191 0.427429 +SURF 0X10 +mat 0 +refs 4 +34 0.131126 0.251204 +97 0.129595 0.313403 +96 0.125 0.3125 +33 0.125 0.25 +SURF 0X10 +mat 0 +refs 4 +47 0.186299 0.451227 +110 0.170974 0.463421 +109 0.169857 0.445572 +46 0.184809 0.427429 +SURF 0X10 +mat 0 +refs 4 +60 0.154463 0.72048 +123 0.147097 0.66536 +122 0.151043 0.6559 +59 0.159723 0.707867 +SURF 0X10 +mat 0 +refs 4 +7 0.090277 0.707867 +70 0.098958 0.6559 +69 0.102903 0.66536 +6 0.095538 0.72048 +SURF 0X10 +mat 0 +refs 4 +20 0.065191 0.427429 +83 0.080143 0.445572 +82 0.079026 0.46342 +19 0.063701 0.451227 +SURF 0X10 +mat 0 +refs 4 +33 0.125 0.25 +96 0.125 0.3125 +95 0.120406 0.313403 +32 0.118874 0.251204 +SURF 0X10 +mat 0 +refs 4 +46 0.184809 0.427429 +109 0.169857 0.445572 +108 0.168307 0.428247 +45 0.182743 0.404329 +SURF 0X10 +mat 0 +refs 4 +59 0.159723 0.707867 +122 0.151043 0.6559 +121 0.154737 0.644939 +58 0.16465 0.693252 +SURF 0X10 +mat 0 +refs 4 +6 0.095538 0.72048 +69 0.102903 0.66536 +68 0.107062 0.673227 +5 0.101082 0.73097 +SURF 0X10 +mat 0 +refs 4 +19 0.063701 0.451227 +82 0.079026 0.46342 +81 0.078351 0.481622 +18 0.062801 0.475496 +SURF 0X10 +mat 0 +refs 4 +32 0.118874 0.251204 +95 0.120406 0.313403 +94 0.115855 0.316103 +31 0.112807 0.254804 +SURF 0X10 +mat 0 +refs 4 +45 0.182743 0.404329 +108 0.168307 0.428247 +107 0.16634 0.411613 +44 0.18012 0.382151 +SURF 0X10 +mat 0 +refs 4 +58 0.16465 0.693252 +121 0.154737 0.644939 +120 0.158146 0.632582 +57 0.169194 0.676776 +SURF 0X10 +mat 0 +refs 4 +5 0.101082 0.73097 +68 0.107062 0.673227 +67 0.111393 0.679426 +4 0.106857 0.739235 +SURF 0X10 +mat 0 +refs 4 +18 0.062801 0.475496 +81 0.078351 0.481622 +80 0.078125 0.5 +17 0.0625 0.5 +SURF 0X10 +mat 0 +refs 4 +31 0.112807 0.254804 +94 0.115855 0.316103 +93 0.111393 0.320574 +30 0.106857 0.260765 +SURF 0X10 +mat 0 +refs 4 +44 0.18012 0.382151 +107 0.16634 0.411613 +106 0.163975 0.395831 +43 0.176967 0.361108 +SURF 0X10 +mat 0 +refs 4 +57 0.169194 0.676776 +120 0.158146 0.632582 +119 0.161235 0.618949 +56 0.173313 0.658598 +SURF 0X10 +mat 0 +refs 4 +4 0.106857 0.739235 +67 0.111393 0.679426 +66 0.115855 0.683897 +3 0.112807 0.745196 +SURF 0X10 +mat 0 +refs 4 +17 0.0625 0.5 +80 0.078125 0.5 +79 0.078351 0.518378 +16 0.062801 0.524504 +SURF 0X10 +mat 0 +refs 4 +30 0.106857 0.260765 +93 0.111393 0.320574 +92 0.107062 0.326772 +29 0.101082 0.26903 +SURF 0X10 +mat 0 +refs 4 +43 0.176967 0.361108 +106 0.163975 0.395831 +105 0.161235 0.381051 +42 0.173313 0.341402 +SURF 0X10 +mat 0 +refs 4 +56 0.173313 0.658598 +119 0.161235 0.618949 +118 0.163975 0.604169 +55 0.176967 0.638892 +SURF 0X10 +mat 0 +refs 4 +3 0.112807 0.745196 +66 0.115855 0.683897 +65 0.120406 0.686597 +2 0.118874 0.748796 +SURF 0X10 +mat 0 +refs 4 +16 0.062801 0.524504 +79 0.078351 0.518378 +78 0.079026 0.536579 +15 0.063701 0.548773 +SURF 0X10 +mat 0 +refs 4 +29 0.101082 0.26903 +92 0.107062 0.326772 +91 0.102903 0.33464 +28 0.095538 0.27952 +SURF 0X10 +mat 0 +refs 4 +42 0.173313 0.341402 +105 0.161235 0.381051 +104 0.158146 0.367418 +41 0.169194 0.323223 +SURF 0X10 +mat 0 +refs 4 +55 0.176967 0.638892 +118 0.163975 0.604169 +117 0.16634 0.588387 +54 0.18012 0.617849 +SURF 0X10 +mat 0 +refs 4 +15 0.063701 0.548773 +78 0.079026 0.536579 +77 0.080143 0.554428 +14 0.065191 0.572571 +SURF 0X10 +mat 0 +refs 4 +28 0.095538 0.27952 +91 0.102903 0.33464 +90 0.098958 0.344099 +27 0.090277 0.292132 +SURF 0X10 +mat 0 +refs 4 +41 0.169194 0.323223 +104 0.158146 0.367418 +103 0.154737 0.355061 +40 0.16465 0.306747 +SURF 0X10 +mat 0 +refs 4 +54 0.18012 0.617849 +117 0.16634 0.588387 +116 0.168307 0.571753 +53 0.182743 0.595671 +SURF 0X10 +mat 0 +refs 4 +0 0.125 0.6875 +1 0.125 0.75 +2 0.118874 0.748796 +65 0.120406 0.686597 +SURF 0X10 +mat 0 +refs 4 +14 0.065191 0.572571 +77 0.080143 0.554428 +76 0.081693 0.571753 +13 0.067258 0.595671 +SURF 0X10 +mat 0 +refs 4 +27 0.090277 0.292132 +90 0.098958 0.344099 +89 0.095263 0.35506 +26 0.08535 0.306747 +SURF 0X10 +mat 0 +refs 4 +40 0.16465 0.306747 +103 0.154737 0.355061 +102 0.151042 0.344099 +39 0.159723 0.292133 +SURF 0X10 +mat 0 +refs 4 +53 0.182743 0.595671 +116 0.168307 0.571753 +115 0.169857 0.554428 +52 0.184809 0.572571 +SURF 0X10 +mat 0 +refs 4 +13 0.067258 0.595671 +76 0.081693 0.571753 +75 0.08366 0.588387 +12 0.06988 0.617849 +SURF 0X10 +mat 0 +refs 4 +26 0.08535 0.306747 +89 0.095263 0.35506 +88 0.091854 0.367417 +25 0.080806 0.323223 +SURF 0X10 +mat 0 +refs 4 +39 0.159723 0.292133 +102 0.151042 0.344099 +101 0.147097 0.33464 +38 0.154462 0.27952 +SURF 0X10 +mat 0 +refs 4 +52 0.184809 0.572571 +115 0.169857 0.554428 +114 0.170974 0.536579 +51 0.186299 0.548772 +SURF 0X10 +mat 0 +refs 4 +1 0.125 0.75 +0 0.125 0.6875 +127 0.129595 0.686597 +64 0.131126 0.748796 +SURF 0X10 +mat 0 +refs 4 +38 0.154462 0.27952 +101 0.147097 0.33464 +100 0.142938 0.326773 +37 0.148918 0.26903 +kids 0 diff --git a/Models/Autopush/cursor.png b/Models/Autopush/cursor.png new file mode 100644 index 00000000..2d21ca3c Binary files /dev/null and b/Models/Autopush/cursor.png differ diff --git a/Models/Autopush/cursor.xml b/Models/Autopush/cursor.xml new file mode 100644 index 00000000..1d97f260 --- /dev/null +++ b/Models/Autopush/cursor.xml @@ -0,0 +1,29 @@ + + + + + cursor.ac + + + false + + + + scale + /sim/model/pushback/driver/D_min-m + 0.0 + 1.0 + + + diff --git a/Models/Autopush/cursor_sharp.ac b/Models/Autopush/cursor_sharp.ac new file mode 100644 index 00000000..e8992959 --- /dev/null +++ b/Models/Autopush/cursor_sharp.ac @@ -0,0 +1,67 @@ +AC3Db +MATERIAL "autopush cursor" rgb 0.0000 0.0000 0.0000 amb 0.0000 0.0000 0.0000 emis 1.000 0.173 0.545 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 +OBJECT world +name "Blender_exporter_v2.26__cursor_sharp.ac" +kids 1 +OBJECT poly +name "Circle" +data 11 +Circle.mesh +crease 40.0 +numvert 12 +0 0.2 -0.75 +0 0.2 -1 +0.64952 0.2 -0.375 +0.86603 0.2 -0.5 +0.64952 0.2 0.375 +0.86603 0.2 0.5 +0 0.2 0.75 +0 0.2 1 +-0.64952 0.2 0.375 +-0.86603 0.2 0.5 +-0.64952 0.2 -0.375 +-0.86603 0.2 -0.5 +numsurf 6 +SURF 0X10 +mat 0 +refs 4 +0 0.125 0.6875 +2 0.171875 0.59375 +3 0.1875 0.625 +1 0.125 0.75 +SURF 0X10 +mat 0 +refs 4 +2 0.171875 0.59375 +4 0.171875 0.40625 +5 0.1875 0.375 +3 0.1875 0.625 +SURF 0X10 +mat 0 +refs 4 +4 0.171875 0.40625 +6 0.125 0.3125 +7 0.125 0.25 +5 0.1875 0.375 +SURF 0X10 +mat 0 +refs 4 +6 0.125 0.3125 +8 0.078125 0.40625 +9 0.0625 0.375 +7 0.125 0.25 +SURF 0X10 +mat 0 +refs 4 +8 0.078125 0.40625 +10 0.078125 0.59375 +11 0.0625 0.625 +9 0.0625 0.375 +SURF 0X10 +mat 0 +refs 4 +10 0.078125 0.59375 +0 0.125 0.6875 +1 0.125 0.75 +11 0.0625 0.625 +kids 0 diff --git a/Models/Autopush/cursor_sharp.xml b/Models/Autopush/cursor_sharp.xml new file mode 100644 index 00000000..2a79bb48 --- /dev/null +++ b/Models/Autopush/cursor_sharp.xml @@ -0,0 +1,29 @@ + + + + + cursor_sharp.ac + + + false + + + + scale + /sim/model/pushback/driver/D_min-m + 0.0 + 1.0 + + + diff --git a/Models/Autopush/waypoint.ac b/Models/Autopush/waypoint.ac new file mode 100644 index 00000000..443b4274 --- /dev/null +++ b/Models/Autopush/waypoint.ac @@ -0,0 +1,238 @@ +AC3Db +MATERIAL "autopush cursor" rgb 0.0000 0.0000 0.0000 amb 0.0000 0.0000 0.0000 emis 1.000 0.173 0.545 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 +OBJECT world +name "Blender_exporter_v2.26__waypoint.ac" +kids 1 +OBJECT poly +name "Circle" +data 11 +Circle.mesh +crease 40.0 +numvert 33 +0.03902 0.2 -0.19616 +0.07654 0.2 -0.18478 +0.11111 0.2 -0.16629 +0.14142 0.2 -0.14142 +0.16629 0.2 -0.11111 +0.18478 0.2 -0.07654 +0.19616 0.2 -0.03902 +0.2 0.2 -0 +0.19616 0.2 0.03902 +0.18478 0.2 0.07654 +0.16629 0.2 0.11111 +0.14142 0.2 0.14142 +0.11111 0.2 0.16629 +0.07654 0.2 0.18478 +0.03902 0.2 0.19616 +0 0.2 0.2 +-0.03902 0.2 0.19616 +-0.07654 0.2 0.18478 +-0.11111 0.2 0.16629 +-0.14142 0.2 0.14142 +-0.16629 0.2 0.11111 +-0.18478 0.2 0.07654 +-0.19616 0.2 0.03902 +-0.2 0.2 0 +-0.19616 0.2 -0.03902 +-0.18478 0.2 -0.07654 +-0.16629 0.2 -0.11111 +-0.14142 0.2 -0.14142 +-0.11111 0.2 -0.16629 +-0.07654 0.2 -0.18478 +-0.03902 0.2 -0.19616 +0 0.2 -0.2 +0 0.2 0 +numsurf 32 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +18 0.090277 0.292133 +17 0.101082 0.26903 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +31 0.125 0.75 +30 0.112807 0.745197 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +4 0.176967 0.638893 +3 0.169194 0.676777 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +17 0.101082 0.26903 +16 0.112807 0.254804 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +30 0.112807 0.745197 +29 0.101082 0.73097 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +3 0.169194 0.676777 +2 0.159723 0.707868 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +16 0.112807 0.254804 +15 0.125 0.25 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +29 0.101082 0.73097 +28 0.090277 0.707868 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +2 0.159723 0.707868 +1 0.148918 0.73097 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +15 0.125 0.25 +14 0.137193 0.254804 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +28 0.090277 0.707868 +27 0.080806 0.676777 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +1 0.148918 0.73097 +0 0.137193 0.745197 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +14 0.137193 0.254804 +13 0.148918 0.26903 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +27 0.080806 0.676777 +26 0.073033 0.638893 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +0 0.137193 0.745197 +31 0.125 0.75 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +13 0.148918 0.26903 +12 0.159723 0.292133 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +26 0.073033 0.638893 +25 0.067258 0.595671 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +12 0.159723 0.292133 +11 0.169194 0.323224 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +25 0.067258 0.595671 +24 0.063701 0.548773 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +11 0.169194 0.323224 +10 0.176967 0.361108 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +24 0.063701 0.548773 +23 0.0625 0.5 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +10 0.176967 0.361108 +9 0.182743 0.404329 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +23 0.0625 0.5 +22 0.063701 0.451228 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +9 0.182743 0.404329 +8 0.186299 0.451228 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +22 0.063701 0.451228 +21 0.067258 0.404329 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +8 0.186299 0.451228 +7 0.1875 0.5 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +21 0.067258 0.404329 +20 0.073033 0.361108 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +7 0.1875 0.5 +6 0.186299 0.548773 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +20 0.073033 0.361108 +19 0.080806 0.323223 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +6 0.186299 0.548773 +5 0.182742 0.595671 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +19 0.080806 0.323223 +18 0.090277 0.292133 +SURF 0X0 +mat 0 +refs 3 +32 0.125 0.5 +5 0.182742 0.595671 +4 0.176967 0.638893 +kids 0 diff --git a/Models/Autopush/waypoint.xml b/Models/Autopush/waypoint.xml new file mode 100644 index 00000000..40e528ef --- /dev/null +++ b/Models/Autopush/waypoint.xml @@ -0,0 +1,29 @@ + + + + + waypoint.ac + + + false + + + + scale + /sim/model/pushback/driver/D_min-m + 0.0 + 1.0 + + + diff --git a/Models/Services/Pushback/Douglas.xml b/Models/Services/Pushback/Douglas.xml index 0a43106d..f872f582 100644 --- a/Models/Services/Pushback/Douglas.xml +++ b/Models/Services/Pushback/Douglas.xml @@ -79,24 +79,6 @@ - - - rotate - sim/model/pushback/position-norm - -90 - 90 -
- 0 - 0 - 0 -
- - 0 - 0 - 1 - -
- translate @@ -109,72 +91,22 @@ - - translate - sim/model/pushback/position-norm - - 1.0000000.000000 - 0.9500001.961477 - 0.9000003.910862 - 0.8500005.836134 - 0.8000007.725425 - 0.7500009.567086 - 0.70000011.349763 - 0.65000013.062464 - 0.60000014.694631 - 0.55000016.236201 - 0.50000017.677670 - 0.45000019.010149 - 0.40000020.225425 - 0.35000021.316004 - 0.30000022.275163 - 0.25000023.096988 - 0.20000023.776413 - 0.15000024.309248 - 0.10000024.692209 - 0.05000024.922933 - 0.00000025.000000 - - - -1 - 0 - 0 - - - - - translate - sim/model/pushback/position-norm - - 1.0000000.000000 - 0.9500000.077067 - 0.9000000.307791 - 0.8500000.690752 - 0.8000001.223587 - 0.7500001.903012 - 0.7000002.724837 - 0.6500003.683996 - 0.6000004.774575 - 0.5500005.989851 - 0.5000007.322330 - 0.4500008.763799 - 0.40000010.305369 - 0.35000011.937536 - 0.30000013.650238 - 0.25000015.432914 - 0.20000017.274575 - 0.15000019.163866 - 0.10000021.089138 - 0.05000023.038523 - 0.00000025.000000 - + rotate + gear/gear[0]/steering-norm + -70 +
+ 0 + 0 + 0 +
0 - -1 - 0 + 0 + 1
+ diff --git a/Nasal/autopush.nas b/Nasal/autopush.nas new file mode 100644 index 00000000..18dbb4f5 --- /dev/null +++ b/Nasal/autopush.nas @@ -0,0 +1,136 @@ +# AUTOPUSH +# Basic pushback logic class. +# +# Copyright (c) 2018 Autopush authors: +# Michael Danilov +# Joshua Davidson http://github.com/it0uchpods +# Merspieler http://gitlab.com/merspieler +# Distribute under the terms of GPLv2. + + +var _enabled = 0; +var _K_p = nil; +var _F_p = nil; +var _K_i = nil; +var _F_i = nil; +var _K_d = nil; +var _F_d = nil; +var _F = nil; +var _int = nil; +var _deltaV = nil; +var _T_f = nil; +var _K_yaw = nil; +var _yasim = 0; +var _time = nil; +# (ft / s^2) / ((km / h) / s) +var _unitconv = M2FT / 3.6; +var _debug = nil; + +var _loop = func() { + if (!getprop("/sim/model/pushback/available")) { + _stop(); + return; + } + var force = 0.0; + var x = 0.0; + var y = 0.0; + # Rollspeed is only adequate if the wheel is touching the ground. + if (getprop("/gear/gear[0]/wow")) { + var deltaV = getprop("/sim/model/pushback/target-speed-km_h"); + deltaV -= getprop("/gear/gear[0]/rollspeed-ms") * 3.6; + var dV = deltaV - _deltaV; + var time = getprop("/sim/time/elapsed-sec"); + var prop = math.min(math.max(_K_p * deltaV, -_F_p), _F_p); + var speedup = getprop("/sim/speed-up"); + dt = time - _time; + # XXX Sanitising dt. Smaller chance of freakout on lag spike. + if(dt > 0.0) { + if(dt < 0.05) { + _int = math.min(math.max(_int + _K_i * dV * dt, -_F_i), _F_i); + } + if(dt > 0.002) { + var deriv = math.min(math.max(_K_d * dV / dt, -_F_d), _F_d); + } + } + var accel = prop + _int + deriv; + if (_debug > 2) { + print("pushback prop " ~ prop ~ ", _int " ~ _int ~ ", deriv " ~ deriv); + } + _deltaV = deltaV; + _time = time; + if (!_yasim) { + force = accel * getprop("/fdm/jsbsim/inertia/weight-lbs") * _unitconv; + } else { + force = accel * getprop("/fdm/yasim/gross-weight-lbs") * _unitconv; + } + var yaw = getprop("/sim/model/pushback/yaw") * _K_yaw; + x = math.cos(yaw); + y = math.sin(yaw); + setprop("/sim/model/pushback/force-x", x); + setprop("/sim/model/pushback/force-y", y); + } + setprop("/sim/model/pushback/force-lbf", force); + if (_yasim) { + # The force is divided by YASim thrust="100000.0" setting. + setprop("/sim/model/pushback/force-x-yasim", x * force * 0.00001); + # YASim's y is to the left. + setprop("/sim/model/pushback/force-y-yasim", -y * force * 0.00001); + } +} + +var _timer = maketimer(0.0167, func{_loop()}); + +var _start = func() { + # Else overwritten by dialog. + settimer(func() { + setprop("/sim/model/pushback/target-speed-km_h", 0.0) + }, 0.1); + _K_p = getprop("/sim/model/pushback/K_p"); + _F_p = getprop("/sim/model/pushback/F_p"); + _K_i = getprop("/sim/model/pushback/K_i"); + _F_i = getprop("/sim/model/pushback/F_i"); + _K_d = getprop("/sim/model/pushback/K_d"); + _F_d = getprop("/sim/model/pushback/F_d"); + _F = getprop("/sim/model/pushback/F"); + _T_f = getprop("/sim/model/pushback/T_f"); + _K_yaw = getprop("/sim/model/pushback/yaw-mult") * D2R; + _yasim = (getprop("/sim/flight-model") == "yasim"); + _debug = getprop("/sim/model/pushback/debug") or 0; + _int = 0.0; + _deltaV = 0.0; + _time = getprop("/sim/time/elapsed-sec"); + setprop("/sim/model/pushback/connected", 1); + if (!_timer.isRunning) { + if (getprop("/sim/model/pushback/chocks")) { + setprop("/sim/model/pushback/chocks", 0); + screen.log.write("(pushback): Pushback connected, chocks removed. Please release brakes."); + } else { + screen.log.write("(pushback): Pushback connected, please release brakes."); + } + } + _timer.start(); +} + +var _stop = func() { + if (_timer.isRunning) { + screen.log.write("(pushback): Pushback and bypass pin removed."); + } + _timer.stop(); + setprop("/sim/model/pushback/force-lbf", 0.0); + if (_yasim) { + setprop("/sim/model/pushback/force-x-yasim", 0.0); + setprop("/sim/model/pushback/force-y-yasim", 0.0); + } + setprop("/sim/model/pushback/connected", 0); + setprop("/sim/model/pushback/enabled", 0); +} + +setlistener("/sim/model/pushback/enabled", func(p) { + var enabled = p.getValue(); + if ((enabled > _enabled) and getprop("/sim/model/pushback/available")) { + _start(); + } else if (enabled < _enabled) { + _stop(); + } + _enabled = enabled; +}); diff --git a/Nasal/autopush_driver.nas b/Nasal/autopush_driver.nas new file mode 100644 index 00000000..53170c27 --- /dev/null +++ b/Nasal/autopush_driver.nas @@ -0,0 +1,101 @@ +# AUTOPUSH +# Pushback driver class. +# +# Command the pushback to tow/push the aircraft. +# +# Copyright (c) 2018 Autopush authors: +# Michael Danilov +# Joshua Davidson http://github.com/it0uchpods +# Merspieler http://gitlab.com/merspieler +# Distribute under the terms of GPLv2. + + +var _K_V = nil; +var _F_V = nil; +var _D_min = nil; +var _K_psi = nil; +var _debug = nil; + +var _route = nil; +var _push = nil; +var _sign = nil; +var _psi_park = nil; + +var _to_wp = nil; + + +var _loop = func() { + if (!getprop("/sim/model/pushback/connected")) { + stop(); + return; + } + var psi = getprop("/orientation/heading-deg") + _push * 180.0; + var (A, D) = courseAndDistance(_route[_to_wp]); + D *= NM2M; + # FIXME Use _K_V and total remaining distance. + var V = _F_V; + if ((D < _D_min) or (abs(geo.normdeg180(A - psi) > 90.0))) { + _to_wp += 1; + if (_to_wp == size(_route)) { + _done(); + autopush_route.clear(); + return; + } + if (_debug) { + print("pushback_driver wp " ~ _to_wp); + } + } + if (_debug > 1) { + print("pushback_driver psi_target " ~ geo.normdeg(A) ~ ", deltapsi " ~ _sign * geo.normdeg180(A - psi)); + } + setprop("/sim/model/pushback/target-speed-km_h", _sign * V); + steering = math.min(math.max(_sign * _K_psi * geo.normdeg180(A - psi), -1.0), 1.0); + setprop("/sim/model/pushback/steer-cmd-norm", steering); +} + +var _timer = maketimer(0.051, func{_loop()}); + +var _done = func() { + stop(); + screen.log.write("(pushback): Pushback complete, please set parking brake."); +} + +var start = func() { + if (_timer.isRunning) { + stop(); + } + if (!getprop("/sim/model/pushback/connected")) { + gui.popupTip("Pushback must be connected"); + return; + } + _route = autopush_route.route(); + if ((_route == nil) or size(_route) < 2) { + autopush_route.enter(1); + return; + }else{ + autopush_route.done(); + } + _K_V = getprop("/sim/model/pushback/driver/K_V"); + _F_V = getprop("/sim/model/pushback/driver/F_V"); + _D_min = getprop("/sim/model/pushback/driver/D_min-m"); + _K_psi = getprop("/sim/model/pushback/driver/K_psi"); + _debug = getprop("/sim/model/pushback/debug") or 0; + var (psi_park, D_park) = courseAndDistance(_route[0], _route[1]); + var (psi_twy, D_twy) = courseAndDistance(_route[size(_route) - 2], _route[size(_route) - 1]); + _psi_park = psi_park; + _push = (abs(geo.normdeg180(getprop("/orientation/heading-deg") - psi_park)) > 90.0); + _sign = 1.0 - 2.0 * _push; + _to_wp = 0; + _timer.start(); + if (_sign < 0.0) { + screen.log.write("(pushback): Push back facing " ~ int(geo.normdeg(psi_twy + 180.0 - magvar())) ~ "."); + } else { + screen.log.write("(pushback): Tow facing " ~ int(geo.normdeg(psi_twy - magvar())) ~ "."); + } +} + +var stop = func() { + _timer.stop(); + setprop("/sim/model/pushback/target-speed-km_h", 0.0); + autopush_route.clear(); +} diff --git a/Nasal/autopush_route.nas b/Nasal/autopush_route.nas new file mode 100644 index 00000000..606c9ff5 --- /dev/null +++ b/Nasal/autopush_route.nas @@ -0,0 +1,292 @@ +# AUTOPUSH +# Visual entry of pushback route. +# +# Copyright (c) 2018 Autopush authors: +# Michael Danilov +# Joshua Davidson http://github.com/it0uchpods +# Merspieler http://gitlab.com/merspieler +# Distribute under the terms of GPLv2. + + +var _listener = nil; +var _view_listener = nil; +var _user_points = dynarr.dynarr.new(4); +var _user_point_modes = dynarr.dynarr.new(4); # Modes: 0 = Bezier node, 1 = Bezier end/start node +var _route = []; +var _view_index = nil; +var _user_point_models = []; +var _waypoint_models = []; +var _N = 0; +var _show = 0; +var _view_changed_or_external = 0; +var _start_immediately = nil; +var _D_min = nil; + + +var _add = func(pos) { + if (_N) { + var (A, S) = courseAndDistance(_user_points.arr[_N - 1], pos); + if (S * NM2M < 3 * _D_min) { + gui.popupTip("Too close to the previous point,\ntry again"); + return; + } + } + _user_points.add(geo.Coord.new(pos)); + + if (_user_point_modes.maxsize == 1 and _user_point_modes.size == 1) { + _user_point_modes.arr[0] = 0; + } else { + _user_point_modes.add(0); + } + setsize(_user_point_models, _N + 1); + _user_point_models[_N] = geo.put_model("Models/Autopush/cursor.xml", pos, 0.0); + _N += 1; + if (_N == 1) { + gui.popupTip("Click waypoints, press \"Done\" to finish"); + } else { + _calculate_route(); + _place_waypoint_models(); + } +} + +var delete_last = func() { + if (_listener == nil) { + return; + } + if (_N > 1) { + _N -= 1; + _user_points.del(_N); + _user_point_modes.del(_N); + _user_point_models[_N].remove(); + _user_point_models[_N] = nil; + setsize(_user_point_models, _N); + _calculate_route(); + _place_waypoint_models(); + } +} + +var _stop = func(fail = 0) { + if (_listener != nil) { + removelistener(_listener); + _listener = nil; + if (!fail) { + settimer(func() { + _reset_view(); + if (_start_immediately) { + autopush_driver.start(); + } else { + gui.popupTip("Done"); + } + }, 1.0); + } else { + _reset_view(); + } + } +} + +var _place_user_point_models = func() { + _clear_user_point_models(); + setsize(_user_point_models, _N); + var user_points = _user_points.get_sliced(); + for (var ii = 0; ii < _N; ii += 1) { + var model = "Models/Autopush/cursor.xml"; + if (_user_point_modes.arr[ii] == 1) { + model = "Models/Autopush/cursor_sharp.xml"; + } + _user_point_models[ii] = geo.put_model(model, user_points[ii], 0.0); + } +} + +var _clear_user_point_models = func() { + for (var ii = 0; ii < size(_user_point_models); ii += 1) { + if (_user_point_models[ii] != nil) { + _user_point_models[ii].remove(); + _user_point_models[ii] = nil; + } + } + setsize(_user_point_models, 0); +} + +var _place_waypoint_models = func() { + _clear_waypoint_models(); + setsize(_waypoint_models, size(_route)); + for (var ii = 0; ii < size(_route); ii += 1) { + _waypoint_models[ii] = geo.put_model("Models/Autopush/waypoint.xml", _route[ii], 0.0); + } +} + +var _clear_waypoint_models = func() { + for (var ii = 0; ii < size(_waypoint_models); ii += 1) { + if (_waypoint_models[ii] != nil) { + _waypoint_models[ii].remove(); + _waypoint_models[ii] = nil; + } + } + setsize(_waypoint_models, 0); +} + +var _set_view = func() { + if(!getprop("/sim/current-view/internal")){ + _view_changed_or_external = 1; + return; + } + _view_index = getprop("/sim/current-view/view-number"); + setprop("/sim/current-view/view-number", view.indexof("Model View")); + _view_changed_or_external = 0; + _view_listener = setlistener("/sim/current-view/name", func { + _view_changed_or_external = 1; + }); +} + +var _reset_view = func() { + if (!_view_changed_or_external) { + setprop("/sim/current-view/view-number", _view_index); + } + if (_view_listener != nil) { + removelistener(_view_listener); + _view_listener = nil; + } + if (!_show) { + _clear_user_point_models(); + _clear_waypoint_models(); + } +} + +var _calculate_route = func() { + _route = []; + user_points = _user_points.get_sliced(); + var route = dynarr.dynarr.new(); + # add the first point cause it will be fix at this pos + route.add(geo.Coord.new(user_points[0])); + + n = size(user_points); + var base = 0; + for (var i = 0; i < n; i += 1) { + if (_user_point_modes.arr[i] == 1 or i == n - 1) { + if (i - base > 0) { + var bezier = _calculate_bezier(user_points[base:i]); + + var m = size(bezier); + for (var j = 0; j < m; j += 1) { + route.add(geo.Coord.new(bezier[j])); + } + } + base = i; + route.add(geo.Coord.new(user_points[i])); + } + } + + PNumber = size(user_points); + _route = route.get_sliced(); +} + +var _calculate_bezier = func(user_points) { + var route = dynarr.dynarr.new(); + + PNumber = size(user_points); + + if (PNumber > 1) { + var pointList = []; + setsize(pointList, PNumber); + for (var i = 0; i < PNumber; i += 1) { + pointList[i] = []; + setsize(pointList[i], PNumber); + } + + pointList[0] = user_points; + + var len = 0; + for (var i = 0; i < PNumber - 1; i += 1) { + len += user_points[i].distance_to(user_points[i + 1]); + } + + var step = _D_min / len; + + for (var i = step; i < 1 - step; i+= step) { + # start iterating from 1 cause we don't need to iterate over Pn + for (var j = 1; j < PNumber; j += 1) { + for (var k = 0; k < PNumber - j; k += 1) { + pointList[j][k] = geo.Coord.new(pointList[j - 1][k]); + var dist = pointList[j - 1][k].distance_to(pointList[j - 1][k + 1]); + var course = pointList[j - 1][k].course_to(pointList[j - 1][k + 1]); + pointList[j][k].apply_course_distance(course, dist * i); + } + } + pointList[PNumber - 1][0].set_alt(geo.elevation(pointList[PNumber - 1][0].lat(),pointList[PNumber - 1][0].lon())); + route.add(geo.Coord.new(pointList[PNumber - 1][0])); + } + } + + return route.get_sliced(); +} + +setlistener("/sim/model/pushback/route/show", func(p) { + var show = p.getValue(); + if (_listener == nil) { + if (show > _show) { + _place_user_point_models(); + _place_waypoint_models(); + } else if (show < _show) { + _clear_user_point_models(); + _clear_waypoint_models(); + } + } + _show = show; +}); + + +var enter = func(start_immediately = 0) { + clear(); + _set_view(); + _D_min = getprop("/sim/model/pushback/driver/D_min-m"); + var wp = geo.aircraft_position(); + var H = geo.elevation(wp.lat(), wp.lon()); + if (H != nil) { + wp.set_alt(H); + } + _add(wp); + _listener = setlistener("/sim/signals/click", func { + _add(geo.click_position()); + }); + _start_immediately = start_immediately; +} + +var toggle_node = func() { + if (_listener == nil) { + return; + } + if (_user_point_modes.arr[_N - 1] == 0) { + _user_point_modes.arr[_N - 1] = 1; + } else { + _user_point_modes.arr[_N - 1] = 0; + } + if (_user_point_models[_N - 1] != nil) { + _user_point_models[_N - 1].remove(); + var model = "Models/Autopush/cursor.xml"; + if (_user_point_modes.arr[_N - 1] == 1) { + model = "Models/Autopush/cursor_sharp.xml"; + } + _user_point_models[_N - 1] = geo.put_model(model, _user_points.get_sliced()[_N - 1], 0.0); + } +} + +var done = func() { + _stop(0); +} + +var clear = func() { + _stop(1); + _clear_user_point_models(); + _clear_waypoint_models(); + _N = 0; + _user_points = dynarr.dynarr.new(4); + _user_point_modes = dynarr.dynarr.new(1); +} + +var route = func() { + if (_N < 2) { + return nil; + } + _calculate_route(); + return _route; +} diff --git a/Nasal/brakes.nas b/Nasal/brakes.nas index a9f320df..7ba9422c 100644 --- a/Nasal/brakes.nas +++ b/Nasal/brakes.nas @@ -36,6 +36,7 @@ controls.applyBrakes = func(v, which = 0) { # Set autobrake mode var arm_autobrake = func(mode) { wow0 = getprop("/gear/gear[0]/wow"); + gnd_speed = getprop("/velocities/groundspeed-kt"); if (mode == 0) { # OFF absChk.stop(); if (getprop("/controls/autobrake/active") == 1) { @@ -53,7 +54,7 @@ var arm_autobrake = func(mode) { setprop("/controls/autobrake/decel-rate", 3); setprop("/controls/autobrake/mode", 2); absChk.start(); - } else if (mode == 3 and wow0 == 1) { # MAX + } else if (mode == 3 and wow0 == 1 and gnd_speed < 40) { # MAX setprop("/controls/autobrake/decel-rate", 6); setprop("/controls/autobrake/mode", 3); absChk.start(); diff --git a/Nasal/dynarr.nas b/Nasal/dynarr.nas new file mode 100644 index 00000000..03518aa0 --- /dev/null +++ b/Nasal/dynarr.nas @@ -0,0 +1,61 @@ +# Class for dynamic arrays +# +# Copyright (c) 2018 dynamic arrays authors: +# Michael Danilov +# Merspieler http://gitlab.com/merspieler +# Distribute under the terms of GPLv2. + +## Useage +# to create a new object: var = dynarr.new(); +# to add elements: .add(); +# you can access the full stored array as: .arr +# to get only the used area of the array: var = .get_spliced() + +var dynarr = +{ + new: func(size = 8) + { + var this = {parents:[dynarr]}; + this.maxsize = size; + this.size = 0; + this.arr = setsize([], size); + + return this; + }, + + # add a new element to the array + add: func(obj) + { + # case there's no space left + if (me.size + 1 >= me.maxsize) + { + # double array size + me.maxsize *= 2; + me.arr = setsize(me.arr, me.maxsize); + } + + # add object and increase used counter + me.arr[me.size] = obj; + me.size += 1; + }, + + # delete an element from the array + del: func(id) + { + me.size -= 1; + for(ii = id; ii < me.size - 1; ii += 1){ + me.arr[ii] = me.arr[ii + 1]; + } + }, + + # returns only the filled part of the array or nil if array is empty + get_sliced: func() + { + if (me.size == 0) + { + return nil; + } + + return me.arr[0:me.size - 1]; + } +}; diff --git a/Nasal/light-manager.nas b/Nasal/light-manager.nas index e829f614..ee6db849 100644 --- a/Nasal/light-manager.nas +++ b/Nasal/light-manager.nas @@ -39,16 +39,26 @@ var light_manager = { light3_stretch: 0.0, light3_is_on: 0, - light3_xpos: 0.0, - light3_ypos: 0.0, - light3_zpos: 0.0, - light3_r: 0.0, - light3_g: 0.0, - light3_b: 0.0, - light3_size: 0.0, - light3_stretch: 0.0, + light4_xpos: 0.0, + light4_ypos: 0.0, + light4_zpos: 0.0, + light4_r: 0.0, + light4_g: 0.0, + light4_b: 0.0, + light4_size: 0.0, + light4_stretch: 0.0, light4_is_on: 0, + light5_xpos: 0.0, + light5_ypos: 0.0, + light5_zpos: 0.0, + light5_r: 0.0, + light5_g: 0.0, + light5_b: 0.0, + light5_size: 0.0, + light5_stretch: 0.0, + light5_is_on: 0, + flcpt: 0, prev_view : 1, @@ -71,6 +81,11 @@ var light_manager = { nd_ref_light4_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[3]", 1), nd_ref_light4_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[3]", 1), nd_ref_light4_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[3]", 1), + + nd_ref_light5_x: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-x-m[4]", 1), + nd_ref_light5_y: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-y-m[4]", 1), + nd_ref_light5_z: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/eyerel-z-m[4]", 1), + nd_ref_light5_dir: props.globals.getNode("/sim/rendering/als-secondary-lights/lightspot/dir[4]", 1), init: func { # define your lights here @@ -78,45 +93,53 @@ var light_manager = { # lights ######## # offsets to aircraft center - me.light1_xpos = 70.0; - me.light1_ypos = 3.0; + me.light1_xpos = 100.0; + me.light1_ypos = 0.0; me.light1_zpos = 2.0; - me.light2_xpos = 70.0; - me.light2_ypos = -3.0; + me.light2_xpos = 60.0; + me.light2_ypos = 0.0; me.light2_zpos = 2.0; - me.light3_xpos = 35.0; - me.light3_ypos = 0.5; + me.light3_xpos = -2.0; + me.light3_ypos = 18.0; me.light3_zpos = 2.0; - me.light4_xpos = 35.0; - me.light4_ypos = -0.5; + me.light4_xpos = -2.0; + me.light4_ypos = -18.0; me.light4_zpos = 2.0; + + me.light5_xpos = -25.0; + me.light5_ypos = 0.0; + me.light5_zpos = 2.0; + # color values me.light1_r = 0.7; me.light1_g = 0.7; me.light1_b = 0.7; - me.light2_r = 0.7; - me.light2_g = 0.7; - me.light2_b = 0.7; - me.light3_r = 0.5; - me.light3_g = 0.5; - me.light3_b = 0.5; - me.light4_r = 0.5; - me.light4_g = 0.5; - me.light4_b = 0.5; + me.light2_r = 0.6; + me.light2_g = 0.6; + me.light2_b = 0.6; + me.light3_r = 0.4; + me.light3_g = 0.0; + me.light3_b = 0.0; + me.light4_r = 0.0; + me.light4_g = 0.4; + me.light4_b = 0.0; + me.light5_r = 0.4; + me.light5_g = 0.4; + me.light5_b = 0.4; # spot size me.light1_size = 12; me.light1_stretch = 6; - me.light2_size = 12; + me.light2_size = 6; me.light2_stretch = 6; - me.light3_size = 6; - me.light3_stretch = 8; - me.light4_size = 9; - me.light4_stretch = 8; + me.light3_size = 4; + me.light4_size = 4; + me.light5_size = 5; + setprop("sim/rendering/als-secondary-lights/flash-radius", 13); @@ -124,17 +147,16 @@ var light_manager = { }, start: func { - setprop("/sim/rendering/als-secondary-lights/num-lightspots", 4); + setprop("/sim/rendering/als-secondary-lights/num-lightspots", 5); setprop("/sim/rendering/als-secondary-lights/lightspot/size", me.light1_size); setprop("/sim/rendering/als-secondary-lights/lightspot/size[1]", me.light2_size); setprop("/sim/rendering/als-secondary-lights/lightspot/size[2]", me.light3_size); setprop("/sim/rendering/als-secondary-lights/lightspot/size[3]", me.light4_size); + setprop("/sim/rendering/als-secondary-lights/lightspot/size[4]", me.light5_size); setprop("/sim/rendering/als-secondary-lights/lightspot/stretch", me.light1_stretch); setprop("/sim/rendering/als-secondary-lights/lightspot/stretch[1]", me.light2_stretch); - setprop("/sim/rendering/als-secondary-lights/lightspot/stretch[2]", me.light3_stretch); - setprop("/sim/rendering/als-secondary-lights/lightspot/stretch[3]", me.light4_stretch); me.run = 1; me.update(); @@ -157,7 +179,8 @@ var light_manager = { ll1 = getprop("controls/lighting/landing-lights[1]"); ll2 = getprop("controls/lighting/landing-lights[2]"); ll3 = getprop("sim/model/lights/nose-lights"); - + nav = getprop("/sim/model/lights/nav-lights"); + var apos = geo.aircraft_position(); var vpos = geo.viewer_position(); @@ -172,28 +195,44 @@ var light_manager = { var sh = math.sin(heading); var ch = math.cos(heading); - if (ll1 == 1) { + if ((ll1 == 1 and getprop("/systems/electrical/bus/ac1") != 0) and (ll2 == 1 and getprop("/systems/electrical/bus/ac2") !=0)) { + me.light1_ypos = 0.0; + me.light1_setSize(16); + me.light1_on(); + } else if (ll1 == 1 and getprop("/systems/electrical/bus/ac1") != 0) { + me.light1_ypos = 3.0; + me.light1_setSize(12); + me.light1_on(); + } else if (ll2 == 1 and getprop("/systems/electrical/bus/ac2") !=0) { + me.light1_ypos = -3.0; + me.light1_setSize(12); me.light1_on(); } else { me.light1_off(); } - if (ll2 == 1) { + if (ll3 != 0) { me.light2_on(); } else { me.light2_off(); } - if (ll3 == 0.85) { - me.light3_on(); + if (ll3 == 1) { + me.light2_setSize(8); + me.light2_xpos = 65.0; } else { - me.light3_off(); + me.light2_setSize(6); + me.light2_xpos = 60.0; } - if (ll3 == 1) { + if (nav == 1) { + me.light3_on(); me.light4_on(); + me.light5_on(); } else { + me.light3_off(); me.light4_off(); + me.light5_off(); } @@ -260,7 +299,21 @@ var light_manager = { me.nd_ref_light4_x.setValue(delta_x); me.nd_ref_light4_y.setValue(delta_y); me.nd_ref_light4_z.setValue(delta_z); - me.nd_ref_light4_dir.setValue(heading); + me.nd_ref_light4_dir.setValue(heading); + + # light 5 position + + apos.set_lat(lat + (me.light5_xpos * ch + me.light5_ypos * sh) / me.lat_to_m); + apos.set_lon(lon + (me.light5_xpos * sh - me.light5_ypos * ch) / me.lon_to_m); + + delta_x = (apos.lat() - vpos.lat()) * me.lat_to_m; + delta_y = -(apos.lon() - vpos.lon()) * me.lon_to_m; + delta_z = apos.alt() - vpos.alt(); + + me.nd_ref_light5_x.setValue(delta_x); + me.nd_ref_light5_y.setValue(delta_y); + me.nd_ref_light5_z.setValue(delta_z); + me.nd_ref_light5_dir.setValue(heading); } settimer ( func me.update(), 0.0); @@ -281,6 +334,10 @@ var light_manager = { setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b", 0.0); me.light1_is_on = 0; }, + + light1_setSize : func(size) { + setprop("/sim/rendering/als-secondary-lights/lightspot/size[0]", size); + }, light2_on : func { if (me.light2_is_on == 1) {return;} @@ -297,7 +354,11 @@ var light_manager = { setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[1]", 0.0); me.light2_is_on = 0; }, - + + light2_setSize : func(size) { + setprop("/sim/rendering/als-secondary-lights/lightspot/size[1]", size); + }, + light3_on : func { if (me.light3_is_on == 1) {return;} setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[2]", me.light3_r); @@ -316,9 +377,9 @@ var light_manager = { light4_on : func { if (me.light4_is_on == 1) {return;} - setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", me.light3_r); - setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", me.light3_g); - setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", me.light3_b); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[3]", me.light4_r); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", me.light4_g); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", me.light4_b); me.light4_is_on = 1; }, @@ -328,7 +389,23 @@ var light_manager = { setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[3]", 0.0); setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[3]", 0.0); me.light4_is_on = 0; - }, + }, + + light5_on : func { + if (me.light5_is_on == 1) {return;} + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", me.light5_r); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", me.light5_g); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", me.light5_b); + me.light5_is_on = 1; + }, + + light5_off : func { + if (me.light5_is_on == 0) {return;} + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-r[4]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-g[4]", 0.0); + setprop("/sim/rendering/als-secondary-lights/lightspot/lightspot-b[4]", 0.0); + me.light5_is_on = 0; + }, }; light_manager.init(); diff --git a/Systems/a320-aerodynamics.xml b/Systems/a320-aerodynamics.xml index 126a7601..36ae4f45 100644 --- a/Systems/a320-aerodynamics.xml +++ b/Systems/a320-aerodynamics.xml @@ -592,18 +592,6 @@ - - Yaw moment due to roll rate - - aero/qbar-psf - metrics/Sw-sqft - metrics/bw-ft - aero/bi2vel - velocities/r-aero-rad_sec - -0.2 - - - Yaw moment due to yaw rate @@ -612,7 +600,7 @@ metrics/bw-ft aero/bi2vel velocities/r-aero-rad_sec - -0.1 + -0.3 diff --git a/Systems/a320-external-reactions.xml b/Systems/a320-external-reactions.xml index 18f7a135..b9607ee2 100644 --- a/Systems/a320-external-reactions.xml +++ b/Systems/a320-external-reactions.xml @@ -8,7 +8,7 @@ --> - + 7.52385 0 diff --git a/Systems/pushback.xml b/Systems/pushback.xml deleted file mode 100644 index abb72c46..00000000 --- a/Systems/pushback.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - /sim/model/pushback/target-speed-fps - - - - - - /sim/model/pushback/position-norm gt 0.95 - /gear/gear/wow == 1 - gear/unit[0]/wheel-speed-fps lt 50 - - - - - /sim/model/pushback/target-speed-fps - -gear/unit[0]/wheel-speed-fps - - - - systems/pushback/speed-error - /sim/model/pushback/kp - /sim/model/pushback/ki - /sim/model/pushback/kd - systems/pushback/linked - /sim/model/pushback/force - - - - - - systems/pushback/linked == 0 - - external_reactions/pushback/magnitude - - - - diff --git a/revision.txt b/revision.txt index 556d2861..ea53445d 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4621 \ No newline at end of file +4626 \ No newline at end of file