Merge branch 'dev' into maint
|
@ -16,34 +16,10 @@
|
|||
</livery>
|
||||
</model>
|
||||
|
||||
<rating>
|
||||
<FDM type="int">4</FDM>
|
||||
<systems type="int">5</systems>
|
||||
<cockpit type="int">5</cockpit>
|
||||
<model type="int">4</model>
|
||||
</rating>
|
||||
|
||||
<sound>
|
||||
<path>Aircraft/A320-family/Sounds/cfm56-sound.xml</path>
|
||||
</sound>
|
||||
|
||||
<previews>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/cockpit.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing1.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing2.png</path>
|
||||
</preview>
|
||||
</previews>
|
||||
|
||||
<chase-distance-m type="double" archive="y">-80.0</chase-distance-m>
|
||||
<view>
|
||||
|
|
|
@ -16,35 +16,10 @@
|
|||
</livery>
|
||||
</model>
|
||||
|
||||
<rating>
|
||||
<FDM type="int">4</FDM>
|
||||
<systems type="int">5</systems>
|
||||
<cockpit type="int">5</cockpit>
|
||||
<model type="int">4</model>
|
||||
</rating>
|
||||
|
||||
<sound>
|
||||
<path>Aircraft/A320-family/Sounds/cfm56-sound.xml</path>
|
||||
</sound>
|
||||
|
||||
<previews>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/cockpit.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing1.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing2.png</path>
|
||||
</preview>
|
||||
</previews>
|
||||
|
||||
<chase-distance-m type="double" archive="y">-80.0</chase-distance-m>
|
||||
<view>
|
||||
<name>Pilot View</name>
|
||||
|
|
|
@ -16,35 +16,10 @@
|
|||
</livery>
|
||||
</model>
|
||||
|
||||
<rating>
|
||||
<FDM type="int">4</FDM>
|
||||
<systems type="int">5</systems>
|
||||
<cockpit type="int">5</cockpit>
|
||||
<model type="int">4</model>
|
||||
</rating>
|
||||
|
||||
<sound>
|
||||
<path>Aircraft/A320-family/Sounds/v2500-sound.xml</path>
|
||||
</sound>
|
||||
|
||||
<previews>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/cockpit.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing1.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing2.png</path>
|
||||
</preview>
|
||||
</previews>
|
||||
|
||||
<chase-distance-m type="double" archive="y">-80.0</chase-distance-m>
|
||||
<view>
|
||||
<name>Pilot View</name>
|
||||
|
|
|
@ -80,9 +80,45 @@
|
|||
</flame>
|
||||
</model>
|
||||
|
||||
<startup>
|
||||
<splash-texture>Aircraft/A320-family/Splash/SplashOld.png</splash-texture>
|
||||
</startup>
|
||||
<previews>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/cockpit.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/cockpit2.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/cockpit3.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing1.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing2.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing3.png</path>
|
||||
</preview>
|
||||
</previews>
|
||||
|
||||
<rating>
|
||||
<FDM type="int">4</FDM>
|
||||
<systems type="int">5</systems>
|
||||
<cockpit type="int">5</cockpit>
|
||||
<model type="int">4</model>
|
||||
</rating>
|
||||
|
||||
<tags>
|
||||
<tag>transport</tag>
|
||||
|
@ -492,6 +528,7 @@
|
|||
<y alias="/sim/model/autopush/force-y"/>
|
||||
</tractor>
|
||||
</external_reactions>
|
||||
<zero type="int">0</zero>
|
||||
</jsbsim>
|
||||
</fdm>
|
||||
|
||||
|
@ -936,7 +973,10 @@
|
|||
|
||||
<systems>
|
||||
<acconfig n="0">
|
||||
<autoconfig-running>0</autoconfig-running>
|
||||
<autoconfig-running type="bool">0</autoconfig-running>
|
||||
<options n="0">
|
||||
<seperate-tiller-axis type="bool">0</seperate-tiller-axis>
|
||||
</options>
|
||||
</acconfig>
|
||||
<atc>
|
||||
<transponder-code type="string">2000</transponder-code>
|
||||
|
@ -3957,21 +3997,16 @@
|
|||
<file>Aircraft/A320-family/Nasal/Libraries/property-tree-setup.nas</file>
|
||||
</pts>
|
||||
<libraries>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-main.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Effects/light-manager.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/libraries.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/buttons.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/shake.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/zoom-views.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Libraries/efis.nas</file>
|
||||
</libraries>
|
||||
<acconfig>
|
||||
<file>Aircraft/A320-family/AircraftConfig/acconfig.nas</file>
|
||||
</acconfig>
|
||||
<systems>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/APU.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Effects/effects.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Effects/thunder-effects.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/electrical.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/pneumatics.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/hydraulics.nas</file>
|
||||
|
@ -3980,14 +4015,27 @@
|
|||
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/ADR.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/SwitchingPanel.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/Comm/HF.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/fire.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/brakes.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/brakesystem.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/tyresmoke.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/ground_services.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/payload.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Instruments/clock.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/fire.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/ground_services.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/icing.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/payload.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/tyresmoke.nas</file>
|
||||
</systems>
|
||||
<ecam>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-main.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-controller.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-logic.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-messages.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-phases.nas</file>
|
||||
</ecam>
|
||||
<effects>
|
||||
<file>Aircraft/A320-family/Nasal/Effects/light-manager.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Effects/effects.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Effects/thunder-effects.nas</file>
|
||||
</effects>
|
||||
<fadec>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/FADEC/fadec-common.nas</file>
|
||||
</fadec>
|
||||
|
@ -3996,8 +4044,10 @@
|
|||
</fbw>
|
||||
<fcu>
|
||||
<file>Aircraft/A320-family/Nasal/FMGC/FCU.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Panels/efis.nas</file>
|
||||
</fcu>
|
||||
<fmgc>
|
||||
<file>Aircraft/A320-family/Nasal/FMGC/flightplan-waypoints.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/FMGC/flightplan.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/FMGC/FMGC.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/FMGC/FMGC-b.nas</file>
|
||||
|
@ -4012,6 +4062,7 @@
|
|||
<file>Aircraft/A320-family/Nasal/MCDU/ARRIVAL.nas</file> <!-- dynamic page - init before MCDU -->
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/AIRWAYS.nas</file> <!-- dynamic page - init before MCDU -->
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/CLOSESTAIRPORT.nas</file> <!-- dynamic page - init before MCDU -->
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/PILOTWAYPOINT.nas</file> <!-- dynamic page - init before MCDU -->
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/HOLD.nas</file> <!-- dynamic page - init before MCDU -->
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/F-PLN.nas</file> <!-- dynamic page - init before MCDU -->
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/MCDU.nas</file>
|
||||
|
@ -4034,6 +4085,7 @@
|
|||
<file>Aircraft/A320-family/Nasal/MCDU/DATA.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/MCDU/STATUS.nas</file>
|
||||
</mcdu>
|
||||
<!-- Canvas -->
|
||||
<canvas_pfd>
|
||||
<file>Aircraft/A320-family/Models/Instruments/PFD/PFD.nas</file>
|
||||
</canvas_pfd>
|
||||
|
@ -4050,15 +4102,10 @@
|
|||
<canvas_mcdu>
|
||||
<file>Aircraft/A320-family/Models/Instruments/MCDU/MCDU.nas</file>
|
||||
</canvas_mcdu>
|
||||
<ecam>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-controller.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-logic.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-messages.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/ECAM/ECAM-phases.nas</file>
|
||||
</ecam>
|
||||
<icing>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/icing.nas</file>
|
||||
</icing>
|
||||
<mcdu_scratchpad> <!-- delay till after canvas mcdu -->
|
||||
<file>Aircraft/A320-family/Nasal/FMGC/mcdu-messages.nas</file>
|
||||
</mcdu_scratchpad>
|
||||
<!-- Autopush -->
|
||||
<autopush>
|
||||
<file>Aircraft/A320-family/Nasal/Autopush/autopush.nas</file>
|
||||
</autopush>
|
||||
|
@ -4071,6 +4118,7 @@
|
|||
<autopush_route>
|
||||
<file>Aircraft/A320-family/Nasal/Autopush/autopush_route.nas</file>
|
||||
</autopush_route>
|
||||
<!-- Panels -->
|
||||
<rmp>
|
||||
<file>Aircraft/A320-family/Nasal/Panels/rmp.nas</file>
|
||||
</rmp>
|
||||
|
|
|
@ -16,35 +16,10 @@
|
|||
</livery>
|
||||
</model>
|
||||
|
||||
<rating>
|
||||
<FDM type="int">4</FDM>
|
||||
<systems type="int">5</systems>
|
||||
<cockpit type="int">5</cockpit>
|
||||
<model type="int">4</model>
|
||||
</rating>
|
||||
|
||||
<sound>
|
||||
<path>Aircraft/A320-family/Sounds/leapx-sound.xml</path>
|
||||
</sound>
|
||||
|
||||
<previews>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/cockpit.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing1.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing2.png</path>
|
||||
</preview>
|
||||
</previews>
|
||||
|
||||
<chase-distance-m type="double" archive="y">-80.0</chase-distance-m>
|
||||
<view>
|
||||
<name>Pilot View</name>
|
||||
|
|
|
@ -16,35 +16,10 @@
|
|||
</livery>
|
||||
</model>
|
||||
|
||||
<rating>
|
||||
<FDM type="int">4</FDM>
|
||||
<systems type="int">5</systems>
|
||||
<cockpit type="int">5</cockpit>
|
||||
<model type="int">4</model>
|
||||
</rating>
|
||||
|
||||
<sound>
|
||||
<path>Aircraft/A320-family/Sounds/leapx-sound.xml</path>
|
||||
</sound>
|
||||
|
||||
<previews>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/cockpit.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing1.png</path>
|
||||
</preview>
|
||||
<preview>
|
||||
<type>exterior</type>
|
||||
<splash type="bool">true</splash>
|
||||
<path>Splash/wing2.png</path>
|
||||
</preview>
|
||||
</previews>
|
||||
|
||||
<chase-distance-m type="double" archive="y">-80.0</chase-distance-m>
|
||||
<view>
|
||||
<name>Pilot View</name>
|
||||
|
|
|
@ -98,6 +98,7 @@ setprop("/systems/acconfig/options/allow-oil-consumption", 0);
|
|||
setprop("/systems/acconfig/options/welcome-skip", 0);
|
||||
setprop("/systems/acconfig/options/no-rendering-warn", 0);
|
||||
setprop("/systems/acconfig/options/save-state", 0);
|
||||
setprop("/systems/acconfig/options/seperate-tiller-axis", 0);
|
||||
setprop("/systems/acconfig/options/pfd-rate", 1);
|
||||
setprop("/systems/acconfig/options/nd-rate", 1);
|
||||
setprop("/systems/acconfig/options/uecam-rate", 1);
|
||||
|
|
|
@ -466,10 +466,30 @@
|
|||
</binding>
|
||||
<live>true</live>
|
||||
</checkbox>
|
||||
|
||||
<checkbox>
|
||||
<label>Use Seperate Tiller Axis</label>
|
||||
<halign>left</halign>
|
||||
<property>/systems/acconfig/options/seperate-tiller-axis</property>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/systems/acconfig/options/seperate-tiller-axis</property>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
acconfig.writeSettings();
|
||||
</script>
|
||||
</binding>
|
||||
<live>true</live>
|
||||
</checkbox>
|
||||
|
||||
<checkbox>
|
||||
<!-- TODO there might be a better way to formulate this. -->
|
||||
<label>Save states between sessions</label>
|
||||
<label>Save States Between Sessions</label>
|
||||
<halign>left</halign>
|
||||
<property>/systems/acconfig/options/save-state</property>
|
||||
<binding>
|
||||
|
|
|
@ -4,8 +4,8 @@ Have at least following versions installed:
|
|||
* FlightGear 2019.2.0 or newer
|
||||
|
||||
## Install using ZIP Snapshot
|
||||
[Download](https://github.com/legoboyvdlp/A320-family/archive/master.zip) the zip file.
|
||||
Use your prefered archive utility to unzip the archive.
|
||||
[Download](https://github.com/legoboyvdlp/A320-family/archive/dev.zip) the zip file.
|
||||
Use your preferred archive utility to unzip the archive.
|
||||
Move the unpacked directory to your aircraft directory. This can be FGData/Aircraft, or a custom directory you've specified.
|
||||
|
||||
Rename the directory to `A320-family`.
|
||||
|
|
|
@ -11,61 +11,35 @@
|
|||
|
||||
<condition>
|
||||
<and>
|
||||
<or>
|
||||
<greater-than-equals>
|
||||
<expression>
|
||||
<sum>
|
||||
<product>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>0.1</value>
|
||||
</product>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression>
|
||||
<value>13.5</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<expression>
|
||||
<sum>
|
||||
<product>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>0.1</value>
|
||||
</product>
|
||||
<property>systems/navigation/adr/output/aoa-2</property>
|
||||
</sum>
|
||||
</expression>
|
||||
<value>13.5</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<expression>
|
||||
<sum>
|
||||
<product>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>0.1</value>
|
||||
</product>
|
||||
<property>systems/navigation/adr/output/aoa-3</property>
|
||||
</sum>
|
||||
</expression>
|
||||
<value>13.5</value>
|
||||
</greater-than-equals>
|
||||
</or>
|
||||
<greater-than-equals>
|
||||
<expression>
|
||||
<sum>
|
||||
<product>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>0.075</value>
|
||||
</product>
|
||||
<property>fdm/jsbsim/aero/alpha-deg</property>
|
||||
</sum>
|
||||
</expression>
|
||||
<value>13.5</value>
|
||||
</greater-than-equals>
|
||||
<greater-than>
|
||||
<property>velocities/groundspeed-kt</property>
|
||||
<value>100</value>
|
||||
</greater-than>
|
||||
<less-than>
|
||||
</greater-than>
|
||||
<less-than>
|
||||
<property>velocities/groundspeed-kt</property>
|
||||
<value>210</value>
|
||||
</less-than>
|
||||
<greater-than>
|
||||
</less-than>
|
||||
<greater-than>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>50</value>
|
||||
</greater-than>
|
||||
<less-than-equals>
|
||||
</greater-than>
|
||||
<less-than-equals>
|
||||
<property>environment/temperature-degc</property>
|
||||
<value>28</value>
|
||||
</less-than-equals>
|
||||
<greater-than>
|
||||
</less-than-equals>
|
||||
<greater-than>
|
||||
<property>position/altitude-agl-ft</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
|
@ -73,20 +47,10 @@
|
|||
<property>position/altitude-agl-ft</property>
|
||||
<value>8000</value>
|
||||
</less-than>
|
||||
<or>
|
||||
<greater-than>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
<greater-than>
|
||||
<property>systems/navigation/adr/output/aoa-2</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
<greater-than>
|
||||
<property>systems/navigation/adr/output/aoa-3</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
</or>
|
||||
<greater-than>
|
||||
<property>fdm/jsbsim/aero/alpha-deg</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
|
@ -109,49 +73,49 @@
|
|||
</vertex>
|
||||
</placer>
|
||||
|
||||
<shooter>
|
||||
<theta-min-deg>
|
||||
<!-- <expression>
|
||||
<shooter>
|
||||
<theta-min-deg>
|
||||
<!-- <expression>
|
||||
<sum>
|
||||
<value>70</value>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression> -->
|
||||
<value>90</value>
|
||||
</theta-min-deg>
|
||||
<theta-max-deg>
|
||||
<!-- <expression>
|
||||
<value>70</value>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression> -->
|
||||
<value>90</value>
|
||||
</theta-min-deg>
|
||||
<theta-max-deg>
|
||||
<!-- <expression>
|
||||
<sum>
|
||||
<value>110</value>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression> -->
|
||||
<value>90</value>
|
||||
</theta-max-deg>
|
||||
<phi-min-deg>90</phi-min-deg>
|
||||
<phi-max-deg>90</phi-max-deg>
|
||||
<speed-mps>
|
||||
<!-- <expression>
|
||||
<product>
|
||||
<property>velocities/groundspeed-kt</property>
|
||||
<value>-1</value>
|
||||
</product>
|
||||
</expression> -->
|
||||
<value>0</value>
|
||||
<spread>0</spread>
|
||||
</speed-mps>
|
||||
<rotation-speed>
|
||||
<x-max-deg-sec>180</x-max-deg-sec>
|
||||
<x-min-deg-sec>180</x-min-deg-sec>
|
||||
<y-max-deg-sec>180</y-max-deg-sec>
|
||||
<y-min-deg-sec>-180</y-min-deg-sec>
|
||||
<z-max-deg-sec>-180</z-max-deg-sec>
|
||||
<z-min-deg-sec>-180</z-min-deg-sec>
|
||||
</rotation-speed>
|
||||
</shooter>
|
||||
<value>110</value>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression> -->
|
||||
<value>90</value>
|
||||
</theta-max-deg>
|
||||
<phi-min-deg>90</phi-min-deg>
|
||||
<phi-max-deg>90</phi-max-deg>
|
||||
<speed-mps>
|
||||
<!-- <expression>
|
||||
<product>
|
||||
<property>velocities/groundspeed-kt</property>
|
||||
<value>-1</value>
|
||||
</product>
|
||||
</expression> -->
|
||||
<value>0</value>
|
||||
<spread>0</spread>
|
||||
</speed-mps>
|
||||
<rotation-speed>
|
||||
<x-max-deg-sec>180</x-max-deg-sec>
|
||||
<x-min-deg-sec>180</x-min-deg-sec>
|
||||
<y-max-deg-sec>180</y-max-deg-sec>
|
||||
<y-min-deg-sec>-180</y-min-deg-sec>
|
||||
<z-max-deg-sec>-180</z-max-deg-sec>
|
||||
<z-min-deg-sec>-180</z-min-deg-sec>
|
||||
</rotation-speed>
|
||||
</shooter>
|
||||
|
||||
<counter>
|
||||
<particles-per-sec>
|
||||
<counter>
|
||||
<particles-per-sec>
|
||||
<expression>
|
||||
<product>
|
||||
<value>4</value>
|
||||
|
@ -159,13 +123,13 @@
|
|||
</product>
|
||||
</expression>
|
||||
<spread>10</spread>
|
||||
</particles-per-sec>
|
||||
</counter>
|
||||
</particles-per-sec>
|
||||
</counter>
|
||||
|
||||
<align>billboard</align>
|
||||
<align>billboard</align>
|
||||
|
||||
<particle>
|
||||
<start>
|
||||
<particle>
|
||||
<start>
|
||||
<color>
|
||||
<red>
|
||||
<expression>
|
||||
|
@ -203,8 +167,8 @@
|
|||
<size>
|
||||
<value>1.5</value>
|
||||
</size>
|
||||
</start>
|
||||
<end>
|
||||
</start>
|
||||
<end>
|
||||
<color>
|
||||
<red>
|
||||
<expression>
|
||||
|
@ -239,22 +203,22 @@
|
|||
</expression>
|
||||
</alpha>
|
||||
</color>
|
||||
<size>
|
||||
<value>2</value>
|
||||
</size>
|
||||
</end>
|
||||
<life-sec>
|
||||
<value>0.00001</value>
|
||||
</life-sec>
|
||||
<mass-kg>0.025</mass-kg>
|
||||
<radius-m>0.175</radius-m>
|
||||
</particle>
|
||||
<size>
|
||||
<value>2</value>
|
||||
</size>
|
||||
</end>
|
||||
<life-sec>
|
||||
<value>0.00001</value>
|
||||
</life-sec>
|
||||
<mass-kg>0.025</mass-kg>
|
||||
<radius-m>0.175</radius-m>
|
||||
</particle>
|
||||
|
||||
<program>
|
||||
<fluid>air</fluid>
|
||||
<gravity>true</gravity>
|
||||
<wind>true</wind>
|
||||
</program>
|
||||
<program>
|
||||
<fluid>air</fluid>
|
||||
<gravity>true</gravity>
|
||||
<wind>true</wind>
|
||||
</program>
|
||||
|
||||
</particlesystem>
|
||||
|
||||
|
|
|
@ -11,61 +11,35 @@
|
|||
|
||||
<condition>
|
||||
<and>
|
||||
<or>
|
||||
<greater-than-equals>
|
||||
<expression>
|
||||
<sum>
|
||||
<product>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>0.1</value>
|
||||
</product>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression>
|
||||
<value>13.5</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<expression>
|
||||
<sum>
|
||||
<product>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>0.1</value>
|
||||
</product>
|
||||
<property>systems/navigation/adr/output/aoa-2</property>
|
||||
</sum>
|
||||
</expression>
|
||||
<value>13.5</value>
|
||||
</greater-than-equals>
|
||||
<greater-than-equals>
|
||||
<expression>
|
||||
<sum>
|
||||
<product>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>0.1</value>
|
||||
</product>
|
||||
<property>systems/navigation/adr/output/aoa-3</property>
|
||||
</sum>
|
||||
</expression>
|
||||
<value>13.5</value>
|
||||
</greater-than-equals>
|
||||
</or>
|
||||
<greater-than-equals>
|
||||
<expression>
|
||||
<sum>
|
||||
<product>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>0.075</value>
|
||||
</product>
|
||||
<property>fdm/jsbsim/aero/alpha-deg</property>
|
||||
</sum>
|
||||
</expression>
|
||||
<value>13.5</value>
|
||||
</greater-than-equals>
|
||||
<greater-than>
|
||||
<property>velocities/groundspeed-kt</property>
|
||||
<value>100</value>
|
||||
</greater-than>
|
||||
<less-than>
|
||||
</greater-than>
|
||||
<less-than>
|
||||
<property>velocities/groundspeed-kt</property>
|
||||
<value>210</value>
|
||||
</less-than>
|
||||
<greater-than>
|
||||
</less-than>
|
||||
<greater-than>
|
||||
<property>environment/relative-humidity</property>
|
||||
<value>50</value>
|
||||
</greater-than>
|
||||
<less-than-equals>
|
||||
</greater-than>
|
||||
<less-than-equals>
|
||||
<property>environment/temperature-degc</property>
|
||||
<value>28</value>
|
||||
</less-than-equals>
|
||||
<greater-than>
|
||||
</less-than-equals>
|
||||
<greater-than>
|
||||
<property>position/altitude-agl-ft</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
|
@ -73,20 +47,10 @@
|
|||
<property>position/altitude-agl-ft</property>
|
||||
<value>8000</value>
|
||||
</less-than>
|
||||
<or>
|
||||
<greater-than>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
<greater-than>
|
||||
<property>systems/navigation/adr/output/aoa-2</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
<greater-than>
|
||||
<property>systems/navigation/adr/output/aoa-3</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
</or>
|
||||
<greater-than>
|
||||
<property>fdm/jsbsim/aero/alpha-deg</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
|
@ -109,49 +73,49 @@
|
|||
</vertex>
|
||||
</placer>
|
||||
|
||||
<shooter>
|
||||
<theta-min-deg>
|
||||
<!-- <expression>
|
||||
<shooter>
|
||||
<theta-min-deg>
|
||||
<!-- <expression>
|
||||
<sum>
|
||||
<value>70</value>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression> -->
|
||||
<value>90</value>
|
||||
</theta-min-deg>
|
||||
<theta-max-deg>
|
||||
<!-- <expression>
|
||||
<value>70</value>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression> -->
|
||||
<value>90</value>
|
||||
</theta-min-deg>
|
||||
<theta-max-deg>
|
||||
<!-- <expression>
|
||||
<sum>
|
||||
<value>110</value>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression> -->
|
||||
<value>90</value>
|
||||
</theta-max-deg>
|
||||
<phi-min-deg>90</phi-min-deg>
|
||||
<phi-max-deg>90</phi-max-deg>
|
||||
<speed-mps>
|
||||
<!-- <expression>
|
||||
<product>
|
||||
<property>velocities/groundspeed-kt</property>
|
||||
<value>-1</value>
|
||||
</product>
|
||||
</expression> -->
|
||||
<value>0</value>
|
||||
<spread>0</spread>
|
||||
</speed-mps>
|
||||
<rotation-speed>
|
||||
<x-max-deg-sec>180</x-max-deg-sec>
|
||||
<x-min-deg-sec>180</x-min-deg-sec>
|
||||
<y-max-deg-sec>180</y-max-deg-sec>
|
||||
<y-min-deg-sec>-180</y-min-deg-sec>
|
||||
<z-max-deg-sec>-180</z-max-deg-sec>
|
||||
<z-min-deg-sec>-180</z-min-deg-sec>
|
||||
</rotation-speed>
|
||||
</shooter>
|
||||
<value>110</value>
|
||||
<property>systems/navigation/adr/output/aoa-1</property>
|
||||
</sum>
|
||||
</expression> -->
|
||||
<value>90</value>
|
||||
</theta-max-deg>
|
||||
<phi-min-deg>90</phi-min-deg>
|
||||
<phi-max-deg>90</phi-max-deg>
|
||||
<speed-mps>
|
||||
<!-- <expression>
|
||||
<product>
|
||||
<property>velocities/groundspeed-kt</property>
|
||||
<value>-1</value>
|
||||
</product>
|
||||
</expression> -->
|
||||
<value>0</value>
|
||||
<spread>0</spread>
|
||||
</speed-mps>
|
||||
<rotation-speed>
|
||||
<x-max-deg-sec>180</x-max-deg-sec>
|
||||
<x-min-deg-sec>180</x-min-deg-sec>
|
||||
<y-max-deg-sec>180</y-max-deg-sec>
|
||||
<y-min-deg-sec>-180</y-min-deg-sec>
|
||||
<z-max-deg-sec>-180</z-max-deg-sec>
|
||||
<z-min-deg-sec>-180</z-min-deg-sec>
|
||||
</rotation-speed>
|
||||
</shooter>
|
||||
|
||||
<counter>
|
||||
<particles-per-sec>
|
||||
<counter>
|
||||
<particles-per-sec>
|
||||
<expression>
|
||||
<product>
|
||||
<value>4</value>
|
||||
|
@ -159,13 +123,13 @@
|
|||
</product>
|
||||
</expression>
|
||||
<spread>10</spread>
|
||||
</particles-per-sec>
|
||||
</counter>
|
||||
</particles-per-sec>
|
||||
</counter>
|
||||
|
||||
<align>billboard</align>
|
||||
<align>billboard</align>
|
||||
|
||||
<particle>
|
||||
<start>
|
||||
<particle>
|
||||
<start>
|
||||
<color>
|
||||
<red>
|
||||
<expression>
|
||||
|
@ -203,8 +167,8 @@
|
|||
<size>
|
||||
<value>1.5</value>
|
||||
</size>
|
||||
</start>
|
||||
<end>
|
||||
</start>
|
||||
<end>
|
||||
<color>
|
||||
<red>
|
||||
<expression>
|
||||
|
@ -239,22 +203,22 @@
|
|||
</expression>
|
||||
</alpha>
|
||||
</color>
|
||||
<size>
|
||||
<value>2</value>
|
||||
</size>
|
||||
</end>
|
||||
<life-sec>
|
||||
<value>0.00001</value>
|
||||
</life-sec>
|
||||
<mass-kg>0.025</mass-kg>
|
||||
<radius-m>0.175</radius-m>
|
||||
</particle>
|
||||
<size>
|
||||
<value>2</value>
|
||||
</size>
|
||||
</end>
|
||||
<life-sec>
|
||||
<value>0.00001</value>
|
||||
</life-sec>
|
||||
<mass-kg>0.025</mass-kg>
|
||||
<radius-m>0.175</radius-m>
|
||||
</particle>
|
||||
|
||||
<program>
|
||||
<fluid>air</fluid>
|
||||
<gravity>true</gravity>
|
||||
<wind>true</wind>
|
||||
</program>
|
||||
<program>
|
||||
<fluid>air</fluid>
|
||||
<gravity>true</gravity>
|
||||
<wind>true</wind>
|
||||
</program>
|
||||
|
||||
</particlesystem>
|
||||
|
||||
|
|
|
@ -806,17 +806,10 @@
|
|||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>atc_stby</object-name>
|
||||
<factor>-35</factor>
|
||||
<offset-deg>70</offset-deg>
|
||||
<center>
|
||||
<x-m>0.01146</x-m>
|
||||
<y-m>0.213663</y-m>
|
||||
<z-m>-0.13086</z-m>
|
||||
</center>
|
||||
<factor>35</factor>
|
||||
<offset-deg>-70</offset-deg>
|
||||
<axis>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<z>1</z>
|
||||
<object-name>atc_stby.axis</object-name>
|
||||
</axis>
|
||||
<property>controls/atc/mode-knob</property>
|
||||
</animation>
|
||||
|
@ -1080,8 +1073,6 @@
|
|||
<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>
|
||||
|
@ -2030,7 +2021,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("sts");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("sts");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2049,7 +2040,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("apu");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("apu");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2068,7 +2059,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("bleed");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("bleed");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2087,7 +2078,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("press");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("press");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2106,7 +2097,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("elec");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("elec");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2125,7 +2116,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("hyd");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("hyd");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2144,7 +2135,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("fuel");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("fuel");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2163,7 +2154,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("eng");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("eng");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2182,7 +2173,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("cond");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("cond");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2201,7 +2192,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("door");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("door");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2220,7 +2211,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("wheel");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("wheel");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2239,7 +2230,7 @@
|
|||
</greater-than-equals>
|
||||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>libraries.ECAMControlPanel.sysPageBtn("fctl");</script>
|
||||
<script>ecam.ECAMControlPanel.sysPageBtn("fctl");</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -2509,16 +2500,14 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
libraries.ECAMControlPanel.rclBtn();
|
||||
ecam.ECAMControlPanel.rclBtn();
|
||||
ecam.FWC.Btn.recall.setValue(1);
|
||||
</script>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
ecam.FWC.Btn.recall.setValue(0);
|
||||
</script>
|
||||
<script>ecam.FWC.Btn.recall.setValue(0);</script>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
|
@ -2540,16 +2529,14 @@
|
|||
</condition>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
libraries.ECAMControlPanel.clrBtn();
|
||||
ecam.ECAMControlPanel.clrBtn();
|
||||
ecam.FWC.Btn.clr.setValue(1);
|
||||
</script>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
ecam.FWC.Btn.clr.setValue(0);
|
||||
</script>
|
||||
<script>ecam.FWC.Btn.clr.setValue(0);</script>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
|
@ -3273,9 +3260,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis/inputs/CSTR") != 1) {
|
||||
libraries.cpt_efis_btns("cstr");
|
||||
fcu.cpt_efis_btns("cstr");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
fcu.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3315,9 +3302,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis[1]/inputs/CSTR") != 1) {
|
||||
libraries.fo_efis_btns("cstr");
|
||||
fcu.fo_efis_btns("cstr");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
fcu.fo_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3357,9 +3344,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis/inputs/wpt") != 1) {
|
||||
libraries.cpt_efis_btns("wpt");
|
||||
fcu.cpt_efis_btns("wpt");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
fcu.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3399,9 +3386,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis[1]/inputs/wpt") != 1) {
|
||||
libraries.fo_efis_btns("wpt");
|
||||
fcu.fo_efis_btns("wpt");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
fcu.fo_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3441,9 +3428,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis/inputs/VORD") != 1) {
|
||||
libraries.cpt_efis_btns("vord");
|
||||
fcu.cpt_efis_btns("vord");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
fcu.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3483,9 +3470,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis[1]/inputs/VORD") != 1) {
|
||||
libraries.fo_efis_btns("vord");
|
||||
fcu.fo_efis_btns("vord");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
fcu.fo_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3525,9 +3512,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis/inputs/NDB") != 1) {
|
||||
libraries.cpt_efis_btns("ndb");
|
||||
fcu.cpt_efis_btns("ndb");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
fcu.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3567,9 +3554,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis[1]/inputs/NDB") != 1) {
|
||||
libraries.fo_efis_btns("ndb");
|
||||
fcu.fo_efis_btns("ndb");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
fcu.fo_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3609,9 +3596,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis/inputs/arpt") != 1) {
|
||||
libraries.cpt_efis_btns("arpt");
|
||||
fcu.cpt_efis_btns("arpt");
|
||||
} else {
|
||||
libraries.cpt_efis_btns("off");
|
||||
fcu.cpt_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3651,9 +3638,9 @@
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("instrumentation/efis[1]/inputs/arpt") != 1) {
|
||||
libraries.fo_efis_btns("arpt");
|
||||
fcu.fo_efis_btns("arpt");
|
||||
} else {
|
||||
libraries.fo_efis_btns("off");
|
||||
fcu.fo_efis_btns("off");
|
||||
}
|
||||
setprop("sim/sounde/btn1", 1);
|
||||
</script>
|
||||
|
@ -3686,7 +3673,7 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.setCptND(1);</script>
|
||||
<script>fcu.setCptND(1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -3695,7 +3682,7 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.setCptND(-1);</script>
|
||||
<script>fcu.setCptND(-1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -3724,7 +3711,7 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.setFoND(1);</script>
|
||||
<script>fcu.setFoND(1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -3733,7 +3720,7 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.setFoND(-1);</script>
|
||||
<script>fcu.setFoND(-1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -3762,7 +3749,7 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.setNDRange(0, 1);</script>
|
||||
<script>fcu.setNDRange(0, 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -3771,7 +3758,7 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.setNDRange(0, -1);</script>
|
||||
<script>fcu.setNDRange(0, -1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -3801,7 +3788,7 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.setNDRange(1, 1);</script>
|
||||
<script>fcu.setNDRange(1, 1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
|
@ -3810,7 +3797,7 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.setNDRange(1, -1);</script>
|
||||
<script>fcu.setNDRange(1, -1);</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
@ -6607,8 +6594,8 @@
|
|||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>tiller</object-name>
|
||||
<property>fdm/jsbsim/fbw/rudder-pedal</property>
|
||||
<factor>-70</factor>
|
||||
<property>fdm/jsbsim/fbw/tiller-handle</property>
|
||||
<factor>-75</factor>
|
||||
<axis>
|
||||
<object-name>tiller.axis</object-name>
|
||||
</axis>
|
||||
|
@ -6616,8 +6603,8 @@
|
|||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>tillerFo</object-name>
|
||||
<property>fdm/jsbsim/fbw/rudder-pedal</property>
|
||||
<factor>-70</factor>
|
||||
<property>fdm/jsbsim/fbw/tiller-handle</property>
|
||||
<factor>-75</factor>
|
||||
<axis>
|
||||
<object-name>tillerFo.axis</object-name>
|
||||
</axis>
|
||||
|
|
|
@ -854,6 +854,31 @@
|
|||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>airport</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>mcdu.pagebutton("airport", 0);</script>
|
||||
<condition>
|
||||
<and>
|
||||
<greater-than-equals>
|
||||
<property>systems/electrical/bus/ac-1</property>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than>
|
||||
<property>controls/lighting/DU/mcdu1</property>
|
||||
<value>0.01</value>
|
||||
</greater-than>
|
||||
</and>
|
||||
</condition>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>left</object-name>
|
||||
|
|
|
@ -854,6 +854,31 @@
|
|||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>airport</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>mcdu.pagebutton("airport", 1);</script>
|
||||
<condition>
|
||||
<and>
|
||||
<greater-than-equals>
|
||||
<property>systems/electrical/bus/ac-2</property>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
<greater-than>
|
||||
<property>controls/lighting/DU/mcdu2</property>
|
||||
<value>0.01</value>
|
||||
</greater-than>
|
||||
</and>
|
||||
</condition>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>left</object-name>
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
units="px"
|
||||
inkscape:snap-global="false"
|
||||
showguides="false"
|
||||
inkscape:current-layer="IRSINIT"
|
||||
inkscape:current-layer="Simple_Center"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:window-y="23"
|
||||
inkscape:window-x="0"
|
||||
inkscape:cy="938.61658"
|
||||
inkscape:cx="1070.6893"
|
||||
inkscape:cy="626.44135"
|
||||
inkscape:cx="714.79832"
|
||||
inkscape:zoom="1.7842543"
|
||||
showgrid="true"
|
||||
id="namedview371"
|
||||
|
@ -279,6 +279,32 @@
|
|||
x="520.20905"
|
||||
id="tspan4286"
|
||||
sodipodi:role="line">TEXT</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:12px;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="521.16608"
|
||||
y="421.81097"
|
||||
id="Simple_C3B"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
inkscape:label="#text4244"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4248-3"
|
||||
x="521.16608"
|
||||
y="421.81097"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:1px">TEXT</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
transform="scale(0.991516,1.0085566)"
|
||||
id="Simple_C4B"
|
||||
y="539.16522"
|
||||
x="521.16608"
|
||||
style="font-style:normal;font-weight:normal;font-size:12px;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:1px"
|
||||
y="539.16522"
|
||||
x="521.16608"
|
||||
id="tspan4252-9"
|
||||
sodipodi:role="line">TEXT</tspan></text>
|
||||
</g>
|
||||
<text
|
||||
inkscape:label="#text4244"
|
||||
|
|
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 143 KiB |
|
@ -6,7 +6,7 @@ var __self__ = caller(0)[0];
|
|||
|
||||
canvas.SymbolLayer.Controller.add(name, __self__);
|
||||
canvas.SymbolLayer.add(name, {
|
||||
parents: [canvas.MultiSymbolLayer],
|
||||
parents: [MultiSymbolLayer],
|
||||
type: name, # Symbol type
|
||||
df_controller: __self__, # controller to use by default -- this one
|
||||
df_options: { # default configuration options
|
||||
|
|
|
@ -6,7 +6,7 @@ var __self__ = caller(0)[0];
|
|||
|
||||
canvas.SymbolLayer.Controller.add(name, __self__);
|
||||
canvas.SymbolLayer.add(name, {
|
||||
parents: [canvas.MultiSymbolLayer],
|
||||
parents: [MultiSymbolLayer],
|
||||
type: name, # Symbol type
|
||||
df_controller: __self__, # controller to use by default -- this one
|
||||
df_options: { # default configuration options
|
||||
|
|
|
@ -62,7 +62,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
adf2_frq: "/instrumentation/adf[1]/frequencies/selected-khz",
|
||||
dep_rwy: "/autopilot/route-manager/departure/runway",
|
||||
dest_rwy: "/autopilot/route-manager/destination/runway",
|
||||
wp_count: "autopilot/route-manager/route/num",
|
||||
wp_count: "/FMGC/flightplan[2]/num",
|
||||
level_off_alt: "/autopilot/route-manager/vnav/level-off-alt",
|
||||
athr: "/it-autoflight/output/athr",
|
||||
app_mode: "/instrumentation/nd/app-mode",
|
||||
|
@ -759,13 +759,18 @@ canvas.NDStyles["Airbus"] = {
|
|||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
#var cur_wp = getprop("/autopilot/route-manager/current-wp");
|
||||
var deg = nil;
|
||||
if (nd.get_switch("toggle_true_north")) {
|
||||
var deg = math.round(getprop("/FMGC/flightplan[2]/current-leg-course"));
|
||||
var deg = math.round(getprop("/FMGC/flightplan[2]/current-leg-course")) or 0;
|
||||
} else {
|
||||
var deg = math.round(getprop("/FMGC/flightplan[2]/current-leg-course-mag"));
|
||||
var deg = math.round(getprop("/FMGC/flightplan[2]/current-leg-course-mag")) or 0;
|
||||
}
|
||||
if (deg != nil) {
|
||||
nd.symbols.wpActiveCrs.setText(sprintf("%03.0f", deg) ~ "°");
|
||||
nd.symbols.wpActiveCrs.show();
|
||||
} else {
|
||||
nd.symbols.wpActiveCrs.hide();
|
||||
}
|
||||
nd.symbols.wpActiveCrs.setText((deg or "")~"°");
|
||||
nd.symbols.wpActiveCrs.show();
|
||||
},
|
||||
is_false: func(nd) nd.symbols.wpActiveCrs.hide(),
|
||||
}, # of wpActiveId.impl
|
||||
|
|
|
@ -69,7 +69,6 @@ var alt_inhg = props.globals.getNode("/instrumentation/altimeter/setting-inhg",
|
|||
var target_altitude = props.globals.getNode("/autopilot/settings/target-altitude-ft", 1);
|
||||
var altitude = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft", 1);
|
||||
var altitude_pfd = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft-pfd", 1);
|
||||
var trans_alt = props.globals.getNode("/FMGC/internal/trans-alt", 1);
|
||||
var alt_diff = props.globals.getNode("/instrumentation/pfd/alt-diff", 1);
|
||||
var ground_diff = props.globals.getNode("/instrumentation/pfd/ground-diff", 1);
|
||||
var landing_diff = props.globals.getNode("/instrumentation/pfd/landing-diff", 1);
|
||||
|
@ -645,7 +644,7 @@ var canvas_PFD_base = {
|
|||
me["QNH"].hide();
|
||||
me["QNH_setting"].hide();
|
||||
|
||||
if (altitude.getValue() < trans_alt.getValue() and FMGCphase.getValue() == '4') {
|
||||
if (altitude.getValue() < fmgc.FMGCInternal.transAlt and FMGCphase.getValue() == '4') {
|
||||
if (qnh_going == 0) {
|
||||
qnh_going = 1;
|
||||
}
|
||||
|
@ -670,7 +669,7 @@ var canvas_PFD_base = {
|
|||
me["QNH_std"].hide();
|
||||
me["QNH_box"].hide();
|
||||
|
||||
if (altitude.getValue() >= trans_alt.getValue() and FMGCphase.getValue() == '2') {
|
||||
if (altitude.getValue() >= fmgc.FMGCInternal.transAlt and FMGCphase.getValue() == '2') {
|
||||
if (qnh_going == 0) {
|
||||
qnh_going = 1;
|
||||
}
|
||||
|
@ -695,7 +694,7 @@ var canvas_PFD_base = {
|
|||
|
||||
} else if (alt_inhg_mode.getValue() == 1) {
|
||||
|
||||
if (altitude.getValue() >= trans_alt.getValue() and FMGCphase.getValue() == '2') {
|
||||
if (altitude.getValue() >= fmgc.FMGCInternal.transAlt and FMGCphase.getValue() == '2') {
|
||||
if (qnh_going == 0) {
|
||||
qnh_going = 1;
|
||||
}
|
||||
|
@ -1261,7 +1260,11 @@ var canvas_PFD_1 = {
|
|||
|
||||
if (managed_spd.getValue() == 1) {
|
||||
if (getprop("/FMGC/internal/decel") == 1) {
|
||||
vapp = getprop("/FMGC/internal/computed-speeds/vapp");
|
||||
if (getprop("/FMGC/internal/vapp-speed-set")) {
|
||||
vapp = getprop("/FMGC/internal/computed-speeds/vapp_appr");
|
||||
} else {
|
||||
vapp = getprop("/FMGC/internal/computed-speeds/vapp");
|
||||
}
|
||||
tgt_ias = vapp;
|
||||
tgt_kts = vapp;
|
||||
} else if (FMGCphase.getValue() == 6) {
|
||||
|
@ -1995,7 +1998,11 @@ var canvas_PFD_2 = {
|
|||
|
||||
if (managed_spd.getValue() == 1) {
|
||||
if (getprop("/FMGC/internal/decel") == 1) {
|
||||
vapp = getprop("/FMGC/internal/computed-speeds/vapp");
|
||||
if (getprop("/FMGC/internal/vapp-speed-set")) {
|
||||
vapp = getprop("/FMGC/internal/computed-speeds/vapp_appr");
|
||||
} else {
|
||||
vapp = getprop("/FMGC/internal/computed-speeds/vapp");
|
||||
}
|
||||
tgt_ias = vapp;
|
||||
tgt_kts = vapp;
|
||||
} else if (FMGCphase.getValue() == 6) {
|
||||
|
|
Before Width: | Height: | Size: 366 KiB After Width: | Height: | Size: 367 KiB |
|
@ -104,7 +104,7 @@ var warning = {
|
|||
},
|
||||
callPage: func() {
|
||||
if (me.sdPage == "nil" or me.hasCalled == 1) { return; }
|
||||
libraries.SystemDisplay.failCall(me.sdPage);
|
||||
ecam.SystemDisplay.failCall(me.sdPage);
|
||||
me.hasCalled = 1;
|
||||
}
|
||||
};
|
||||
|
@ -336,7 +336,7 @@ var ECAM_controller = {
|
|||
}
|
||||
|
||||
if (statusFlag == 1 and lines[0].getValue() == "") {
|
||||
libraries.SystemDisplay.manCall("sts");
|
||||
ecam.SystemDisplay.manCall("sts");
|
||||
statusFlag = 0;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1600,13 +1600,13 @@ var messages_right_memo = func {
|
|||
land_asap_a.active = 0;
|
||||
}
|
||||
|
||||
if (libraries.ap_active == 1 and apWarn.getValue() == 1) {
|
||||
if (ecam.ap_active == 1 and apWarn.getValue() == 1) {
|
||||
ap_off.active = 1;
|
||||
} else {
|
||||
ap_off.active = 0;
|
||||
}
|
||||
|
||||
if (libraries.athr_active == 1 and athrWarn.getValue() == 1) {
|
||||
if (ecam.athr_active == 1 and athrWarn.getValue() == 1) {
|
||||
athr_off.active = 1;
|
||||
} else {
|
||||
athr_off.active = 0;
|
||||
|
|
|
@ -102,7 +102,7 @@ var FCUController = {
|
|||
if (me.FCUworking and fbw.FBW.activeLaw.getValue() == 0) {
|
||||
if (!ap1.getBoolValue()) {
|
||||
ap1Input.setValue(1);
|
||||
libraries.apWarnNode.setValue(0);
|
||||
ecam.apWarnNode.setValue(0);
|
||||
} else {
|
||||
apOff("hard", 1);
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ var updateActiveFMGC = func {
|
|||
# Autopilot Disconnection
|
||||
var apOff = func(type, side) {
|
||||
if ((ap1Input.getValue() and (side == 1 or side == 0)) or (ap2Input.getValue() and (side == 2 or side == 0))) {
|
||||
libraries.doApWarn(type);
|
||||
ecam.doApWarn(type);
|
||||
}
|
||||
|
||||
if (side == 0) {
|
||||
|
@ -509,7 +509,7 @@ var athrOff = func(type) {
|
|||
fadec.lockThr();
|
||||
}
|
||||
athrInput.setValue(0);
|
||||
libraries.doAthrWarn(type);
|
||||
ecam.doAthrWarn(type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -403,12 +403,9 @@ var ITAF = {
|
|||
if (FPLN.wpFlyFrom < 0) {
|
||||
FPLN.wpFlyFrom = 0;
|
||||
}
|
||||
FPLN.currentCourse = getprop("/FMGC/flightplan[2]/wp[" ~ FPLN.wpFlyFrom ~ "]/course"); # Best left at getprop
|
||||
FPLN.currentCourse = fmgc.wpCourse[2][FPLN.wpFlyFrom].getValue();
|
||||
FPLN.wpFlyTo = FPLN.currentWPTemp + 1;
|
||||
if (FPLN.wpFlyTo < 0) {
|
||||
FPLN.wpFlyTo = 0;
|
||||
}
|
||||
FPLN.nextCourse = getprop("/FMGC/flightplan[2]/wp[" ~ FPLN.wpFlyTo ~ "]/course"); # Best left at getprop
|
||||
FPLN.nextCourse = fmgc.wpCourse[2][FPLN.wpFlyTo].getValue();
|
||||
FPLN.maxBankLimit = Internal.bankLimit.getValue();
|
||||
|
||||
FPLN.deltaAngle = math.abs(geo.normdeg180(FPLN.currentCourse - FPLN.nextCourse));
|
||||
|
@ -430,7 +427,7 @@ var ITAF = {
|
|||
Internal.lnavAdvanceNm.setValue(FPLN.turnDist);
|
||||
|
||||
# Advance logic done by flightplan controller
|
||||
if (FPLN.wp0Dist.getValue() <= FPLN.turnDist) {
|
||||
if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue()) {
|
||||
flightPlanController.autoSequencing();
|
||||
}
|
||||
}
|
||||
|
|
284
Nasal/FMGC/flightplan-waypoints.nas
Normal file
|
@ -0,0 +1,284 @@
|
|||
# A3XX FMGC Waypoint database
|
||||
# Copyright (c) 2020 Josh Davidson (Octal450) and Jonathan Redpath (legoboyvdlp)
|
||||
|
||||
var nilTree = {
|
||||
"latitude": 0,
|
||||
"longitude": 0,
|
||||
"ident": "",
|
||||
};
|
||||
|
||||
var WaypointDatabase = {
|
||||
waypointsVec: [],
|
||||
confirm: [0, 0],
|
||||
# addWP - adds pilot waypoint to waypoints vector
|
||||
# arg: wpObj - passed pilot waypoint object
|
||||
# return:
|
||||
# 0 - not allowed
|
||||
# 2 - accepted
|
||||
# 4 - database full
|
||||
addWP: func(wpObj) {
|
||||
# validate ghost
|
||||
if (wpObj.wpGhost == nil) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# check size of database
|
||||
if (me.getCount() >= 20) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
if (wpObj.index >= me.getSize()) {
|
||||
# add to end, since index doesn't exist
|
||||
append(me.waypointsVec, wpObj);
|
||||
me.write();
|
||||
return 2;
|
||||
} elsif (me.waypointsVec[wpObj.index] == nil) {
|
||||
# add at passed index
|
||||
me.waypointsVec[wpObj.index] = wpObj;
|
||||
me.write();
|
||||
return 2;
|
||||
} else {
|
||||
# fall back to end
|
||||
logprint(4, "pilotWaypoint constructor claims index " ~ wpObj.index ~ " is nil, but it isn't!");
|
||||
append(me.waypointsVec, wpObj);
|
||||
me.write();
|
||||
return 2;
|
||||
}
|
||||
|
||||
},
|
||||
# delete - empties waypoints vector
|
||||
# callerIdx is the calling mcdu
|
||||
delete: func(callerIdx) {
|
||||
var noDel = 0;
|
||||
for (var i = 0; i < me.getSize(); i = i + 1) {
|
||||
if (me.waypointsVec[i] != nil) {
|
||||
if (fmgc.flightPlanController.flightplans[2].indexOfWP(me.waypointsVec[i].wpGhost) == -1) { # docs says only checks active and secondary
|
||||
me.waypointsVec[i] = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
me.write();
|
||||
if (me.getCount() != 0) {
|
||||
mcdu.mcdu_message(callerIdx, "PILOT ELEMENT RETAINED");
|
||||
}
|
||||
},
|
||||
# deleteAtIndex - delete at specific index. Set to nil, so it still exists in vector
|
||||
deleteAtIndex: func(index) {
|
||||
if (index < 0 or index >= me.getSize() or index >= 20) {
|
||||
return;
|
||||
}
|
||||
me.waypointsVec[index] = nil;
|
||||
me.write();
|
||||
},
|
||||
# getNilIndex - find the first nil
|
||||
# post 2020.1 use dedicated function vecindex()
|
||||
getNilIndex: func() {
|
||||
for (var i = 0; i < me.getSize(); i = i + 1) {
|
||||
if (me.waypointsVec[i] == nil) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
# getNonNilIndex - find the first non-nil
|
||||
# post 2020.1 use dedicated function vecindex()
|
||||
getNonNilIndex: func() {
|
||||
for (var i = 0; i < me.getSize(); i = i + 1) {
|
||||
if (me.waypointsVec[i] != nil) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
# getNextFromIndex - find the next non-nil after a passed index
|
||||
getNextFromIndex: func(index) {
|
||||
for (var i = (index + 1); i < me.getSize(); i = i + 1) {
|
||||
if (me.waypointsVec[i] != nil) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i <= index; i = i + 1) {
|
||||
if (me.waypointsVec[i] != nil) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
},
|
||||
# getPreviousFromIndex - find the next non-nil before a passed index
|
||||
getPreviousFromIndex: func(index) {
|
||||
for (var i = (index - 1); i >= 0; i = i - 1) {
|
||||
if (me.waypointsVec[i] != nil) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = (me.getSize() - 1); i >= index; i = i - 1) {
|
||||
if (me.waypointsVec[i] != nil) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
},
|
||||
# getNoOfIndex - return what number passed item is in list, neglecting "nil"
|
||||
getNoOfIndex: func(index) {
|
||||
var count = 0;
|
||||
for (var i = 0; i <= index; i = i + 1) {
|
||||
if (me.waypointsVec[i] == nil) {
|
||||
continue;
|
||||
}
|
||||
count += 1;
|
||||
}
|
||||
return count;
|
||||
},
|
||||
# getCount - return size, neglecting "nil"
|
||||
getCount: func() {
|
||||
var count = 0;
|
||||
for (var i = 0; i < me.getSize(); i = i + 1) {
|
||||
if (me.waypointsVec[i] == nil) {
|
||||
continue;
|
||||
}
|
||||
count += 1;
|
||||
}
|
||||
return count;
|
||||
},
|
||||
# getSize - return maximum size of vector
|
||||
getSize: func() {
|
||||
return size(me.waypointsVec);
|
||||
},
|
||||
# getWP - try to find waypoint whose name matches passed argument
|
||||
getWP: func(text) {
|
||||
for (var i = 0; i < me.getSize(); i = i + 1) {
|
||||
if (me.waypointsVec[i] == nil) {
|
||||
continue;
|
||||
}
|
||||
if (text == me.waypointsVec[i].wpGhost.wp_name) {
|
||||
return me.waypointsVec[i].wpGhost;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
},
|
||||
# write - write to file, as a hash structure
|
||||
write: func() {
|
||||
var path = getprop("/sim/fg-home") ~ "/Export/A320SavedWaypoints.xml";
|
||||
var tree = {
|
||||
waypoints: {
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
for (var i = 0; i < me.getSize(); i = i + 1) {
|
||||
if (me.waypointsVec[i] != nil) {
|
||||
tree.waypoints["waypoint" ~ i] = me.waypointsVec[i].tree;
|
||||
}
|
||||
}
|
||||
|
||||
io.writexml(path, props.Node.new(tree)); # write the data
|
||||
},
|
||||
# read - read from a file, extract using props interface
|
||||
read: func() {
|
||||
var path = getprop("/sim/fg-home") ~ "/Export/A320SavedWaypoints.xml";
|
||||
# create file if it doesn't exist
|
||||
if (io.stat(path) == nil) {
|
||||
me.write();
|
||||
return;
|
||||
}
|
||||
var data = io.readxml(path).getChild("waypoints");
|
||||
var pilotWP = nil;
|
||||
for (var i = 0; i < 20; i = i + 1) {
|
||||
pilotWP = nil;
|
||||
var childNode = data.getChild("waypoint" ~ i);
|
||||
if (childNode == nil) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var wpt = createWP({lat: num(childNode.getChild("latitude").getValue()), lon: num(childNode.getChild("longitude").getValue())},childNode.getChild("ident").getValue());
|
||||
|
||||
if (left(childNode.getChild("ident").getValue(), 3) == "PBD") {
|
||||
pilotWP = pilotWaypoint.newAtPosition(wpt, "PBD", right(childNode.getChild("ident").getValue(), 1));
|
||||
} else {
|
||||
pilotWP = pilotWaypoint.newAtPosition(wpt, "LL", right(childNode.getChild("ident").getValue(), 1));
|
||||
}
|
||||
me.addWPToPos(pilotWP, right(childNode.getChild("ident").getValue(), 1));
|
||||
}
|
||||
},
|
||||
# addWPToPos - helper for reading - inserts at specific index
|
||||
# will create nil for intermediates
|
||||
addWPToPos: func(wpObj, position) {
|
||||
if (me.getSize() >= position) {
|
||||
me.waypointsVec[position - 1] = wpObj;
|
||||
} else {
|
||||
var numToIns = position - me.getSize();
|
||||
while (numToIns >= 1) {
|
||||
append(me.waypointsVec, nil);
|
||||
numToIns -= 1;
|
||||
}
|
||||
me.waypointsVec[position - 1] = wpObj;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
var pilotWaypoint = {
|
||||
new: func(positioned, typeStr) {
|
||||
var pilotWp = { parents:[pilotWaypoint] };
|
||||
|
||||
# Figure out what the first index is we can use
|
||||
var nilIndex = WaypointDatabase.getNilIndex();
|
||||
var position = nil;
|
||||
|
||||
if (nilIndex == -1) {
|
||||
position = WaypointDatabase.getSize() + 1;
|
||||
} else {
|
||||
position = nilIndex + 1
|
||||
}
|
||||
|
||||
pilotWp.setId(typeStr ~ sprintf("%s", position));
|
||||
pilotWp.index = position - 1;
|
||||
|
||||
# set ghost to created waypoint
|
||||
pilotWp.wpGhost = createWP(positioned, pilotWp.id);
|
||||
|
||||
pilotWp.tree = {
|
||||
"latitude": pilotWp.wpGhost.wp_lat,
|
||||
"longitude": pilotWp.wpGhost.wp_lon,
|
||||
"ident": pilotWp.id,
|
||||
};
|
||||
|
||||
return pilotWp;
|
||||
},
|
||||
newAtPosition: func(positioned, typeStr, position) {
|
||||
var pilotWp = { parents:[pilotWaypoint] };
|
||||
|
||||
pilotWp.setId(typeStr ~ sprintf("%s", position));
|
||||
pilotWp.index = position - 1;
|
||||
|
||||
# set ghost to created waypoint
|
||||
pilotWp.wpGhost = positioned;
|
||||
|
||||
pilotWp.tree = {
|
||||
"latitude": pilotWp.wpGhost.wp_lat,
|
||||
"longitude": pilotWp.wpGhost.wp_lon,
|
||||
"ident": pilotWp.id,
|
||||
};
|
||||
|
||||
return pilotWp;
|
||||
},
|
||||
setId: func(id) {
|
||||
if (typeof(id) == "scalar") { me.id = id; }
|
||||
},
|
||||
getId: func() {
|
||||
if (me.id != nil) { return id; }
|
||||
},
|
||||
};
|
||||
|
||||
setlistener("/MCDU[0]/page", func() {
|
||||
if (getprop("/MCDU[0]/page") != "PILOTWP" and getprop("/MCDU[0]/page") != "STATUS") {
|
||||
WaypointDatabase.confirm[0] = 0;
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
setlistener("/MCDU[1]/page", func() {
|
||||
if (getprop("/MCDU[1]/page") != "PILOTWP" and getprop("/MCDU[1]/page") != "STATUS") {
|
||||
WaypointDatabase.confirm[1] = 0;
|
||||
}
|
||||
}, 0, 0);
|
|
@ -10,8 +10,9 @@ var courseDistanceFrom = nil;
|
|||
var courseDistanceFromPrev = nil;
|
||||
var sizeWP = nil;
|
||||
var magTrueError = 0;
|
||||
var storeCourse = nil;
|
||||
|
||||
var DEBUG_DISCONT = 1;
|
||||
var DEBUG_DISCONT = 0;
|
||||
|
||||
# Props.getNode
|
||||
var magHDG = props.globals.getNode("/orientation/heading-magnetic-deg", 1);
|
||||
|
@ -56,6 +57,14 @@ var flightPlanController = {
|
|||
_timeTemp: nil,
|
||||
_altTemp: nil,
|
||||
|
||||
init: func() {
|
||||
me.resetFlightplan(2);
|
||||
me.insertPPOS(2);
|
||||
me.addDiscontinuity(1, 2, 1);
|
||||
me.currentToWptIndex.setValue(0);
|
||||
me.flightPlanChanged(2);
|
||||
},
|
||||
|
||||
reset: func() {
|
||||
me.temporaryFlag[0] = 0;
|
||||
me.temporaryFlag[1] = 0;
|
||||
|
@ -93,7 +102,7 @@ var flightPlanController = {
|
|||
print("Load failed.");
|
||||
}
|
||||
# try to fix fgfp
|
||||
me.flightplans[3].destination = airportinfo(getprop("FMGC/internal/arr-arpt"));
|
||||
me.flightplans[3].destination = airportinfo(getprop("/FMGC/internal/arr-arpt"));
|
||||
me.destroyTemporaryFlightPlan(3, 1);
|
||||
},
|
||||
|
||||
|
@ -135,7 +144,7 @@ var flightPlanController = {
|
|||
me.flightPlanChanged(plan);
|
||||
},
|
||||
|
||||
autoSequencing: func() {
|
||||
calculateTimeAltitudeOnSequence: func() {
|
||||
me._timeTemp = math.round(getprop("/sim/time/utc/minute") + (getprop("/sim/time/utc/second") / 60));
|
||||
if (me._timeTemp < 10) {
|
||||
me._timeTemp = "0" ~ me._timeTemp;
|
||||
|
@ -143,7 +152,7 @@ var flightPlanController = {
|
|||
me.fromWptTime = getprop("/sim/time/utc/hour") ~ me._timeTemp;
|
||||
me._altTemp = getprop("/systems/navigation/adr/output/baro-alt-corrected-1-capt");
|
||||
|
||||
if (me._altTemp > getprop("FMGC/internal/trans-alt")) {
|
||||
if (me._altTemp > fmgc.FMGCInternal.transAlt) {
|
||||
me.fromWptAlt = "FL" ~ math.round(me._altTemp / 100);
|
||||
} else {
|
||||
if (me._altTemp > 0) {
|
||||
|
@ -152,6 +161,10 @@ var flightPlanController = {
|
|||
me.fromWptAlt = "M" ~ math.round(me._altTemp);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
autoSequencing: func() {
|
||||
me.calculateTimeAltitudeOnSequence();
|
||||
|
||||
# todo setlistener on sim/time/warp to recompute predictions
|
||||
|
||||
|
@ -179,7 +192,7 @@ var flightPlanController = {
|
|||
me.deleteWP(0, 2, 0, 1);
|
||||
} else {
|
||||
me.wptType = me.flightplans[2].getWP(me.currentToWptIndexTemp).wp_type;
|
||||
me.wptTypeNoAdvanceDelete = me.wptType == "radialIntercept" or me.wptType == "vectors" or me.wptType == "hdgToAlt";
|
||||
me.wptTypeNoAdvanceDelete = me.wptType == "radialIntercept" or me.wptType == "vectors" or me.wptType == "dmeIntercept" or me.wptType == "hdgToAlt";
|
||||
if (me.wptTypeNoAdvanceDelete) {
|
||||
me.currentToWptIndex.setValue(2);
|
||||
} else {
|
||||
|
@ -197,8 +210,18 @@ var flightPlanController = {
|
|||
|
||||
# for these two remember to call flightPlanChanged. We are assuming this is called from a function which will all flightPlanChanged itself.
|
||||
|
||||
addDiscontinuity: func(index, plan) {
|
||||
# addDiscontinuity - insert discontinuity at passed index
|
||||
# args: index, plan
|
||||
# index: index to add at
|
||||
# plan: plan to add to
|
||||
# Check if a discontinuity already exists either immediately before or at that index
|
||||
# If it does, don't add another one
|
||||
# Optional flag DEBUG_DISCONT to disable discontinuities totally
|
||||
addDiscontinuity: func(index, plan, force = 0) {
|
||||
if (DEBUG_DISCONT) { return; }
|
||||
if (force) {
|
||||
me.flightplans[plan].insertWP(createDiscontinuity(), index);
|
||||
}
|
||||
if (index > 0) {
|
||||
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY" and me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") {
|
||||
me.flightplans[plan].insertWP(createDiscontinuity(), index);
|
||||
|
@ -220,6 +243,10 @@ var flightPlanController = {
|
|||
me.flightplans[n].insertWP(createWP(geo.aircraft_position(), "T-P"), index);
|
||||
},
|
||||
|
||||
insertPPOS: func(n, index = 0) {
|
||||
me.flightplans[n].insertWP(createWP(geo.aircraft_position(), "PPOS"), index);
|
||||
},
|
||||
|
||||
# childWPBearingDistance - return waypoint at bearing and distance from specified waypoint ghost
|
||||
# args: wpt, bearing, dist, name, typeStr
|
||||
# wpt: waypoint ghost
|
||||
|
@ -228,13 +255,9 @@ var flightPlanController = {
|
|||
# name: name of waypoint to be created
|
||||
# typeStr: optional argument to be passed to createWP, must be one of "sid", "star" "approach" "missed" or "pseudo"
|
||||
|
||||
childWPBearingDistance: func(wpt, bearing, dist, name, typeStr = "") {
|
||||
childWPBearingDistance: func(wpt, bearing, dist) {
|
||||
var coordinates = greatCircleMove(wpt.lat, wpt.lon, num(bearing), num(dist));
|
||||
if (typeStr != "") {
|
||||
return createWP(coordinates, name, typeStr);
|
||||
} else {
|
||||
return createWP(coordinates, name);
|
||||
}
|
||||
return coordinates;
|
||||
},
|
||||
|
||||
# insertNOSID - create default SID and add to flightplan
|
||||
|
@ -250,7 +273,7 @@ var flightPlanController = {
|
|||
}
|
||||
|
||||
# fudge the altitude since we cannot create a hdgtoAlt from nasal. Assume 600 feet per mile - 2.5 miles
|
||||
me.flightplans[n].insertWP(me.childWPBearingDistance(wptStore, me.flightplans[n].departure_runway.heading, 2.5, "1500", "sid"), 1);
|
||||
me.flightplans[n].insertWP(createWP(me.childWPBearingDistance(wptStore, me.flightplans[n].departure_runway.heading, 2.5), "1500", "sid"), 1);
|
||||
}
|
||||
me.flightPlanChanged(n);
|
||||
},
|
||||
|
@ -270,7 +293,7 @@ var flightPlanController = {
|
|||
if (hdg > 360) {
|
||||
hdg = hdg - 360;
|
||||
}
|
||||
me.flightplans[n].insertWP(me.childWPBearingDistance(wptStore, hdg, 5, "CF", "star"), me.arrivalIndex[n]);
|
||||
me.flightplans[n].insertWP(createWP(me.childWPBearingDistance(wptStore, hdg, 5), "CF", "star"), me.arrivalIndex[n]);
|
||||
}
|
||||
me.flightPlanChanged(n);
|
||||
},
|
||||
|
@ -289,13 +312,15 @@ var flightPlanController = {
|
|||
directTo: func(waypointGhost, plan) {
|
||||
if (me.flightplans[plan].indexOfWP(waypointGhost) == -1) {
|
||||
me.insertTP(plan, 1);
|
||||
me.flightplans[plan].insertWP(createWPFrom(waypointGhost), 2);
|
||||
|
||||
# use createWP here as createWPFrom doesn't accept waypoints
|
||||
# createWPFrom worked before... but be sure!
|
||||
me.flightplans[plan].insertWP(createWP(waypointGhost, waypointGhost.wp_name), 2);
|
||||
me.addDiscontinuity(3, plan);
|
||||
} else {
|
||||
# we want to delete the intermediate waypoints up to but not including the waypoint. Leave index 0, we delete it later.
|
||||
# example - waypoint dirto is index 5, we want to delete indexes 1 -> 4. 5 - 1 = 4.
|
||||
# so four individual deletions. Delete index 1 four times.
|
||||
# Add one extra for the TP, so while > 2
|
||||
|
||||
var timesToDelete = me.flightplans[plan].indexOfWP(waypointGhost);
|
||||
while (timesToDelete > 1) {
|
||||
|
@ -305,10 +330,10 @@ var flightPlanController = {
|
|||
# Add TP afterwards, this is essential
|
||||
me.insertTP(plan, 1);
|
||||
}
|
||||
var curAircraftPosDirTo = geo.aircraft_position();
|
||||
canvas_mcdu.myDirTo[plan].updateDist(me.flightplans[plan].getWP(2).courseAndDistanceFrom(curAircraftPosDirTo)[1]);
|
||||
me.deleteWP(0, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
var curAircraftPosDirTo = geo.aircraft_position();
|
||||
canvas_mcdu.myDirTo[plan].updateDist(me.flightplans[plan].getWP(1).courseAndDistanceFrom(curAircraftPosDirTo)[1]);
|
||||
},
|
||||
|
||||
deleteWP: func(index, n, a = 0, s = 0) { # a = 1, means adding a waypoint via deleting intermediate. s = 1, means autosequencing
|
||||
|
@ -332,6 +357,18 @@ var flightPlanController = {
|
|||
}
|
||||
},
|
||||
|
||||
# deleteTillIndex - helper that deletes waypoints up to a passed waypoint already in flightplan
|
||||
# uses a while loop to delete a certain number of waypoints between passed index and
|
||||
# index of waypoint alredy in flightplan
|
||||
deleteTillIndex: func(wpGhost, index, plan) {
|
||||
var numToDel = me.flightplans[plan].indexOfWP(wpGhost) - index;
|
||||
while (numToDel > 0) {
|
||||
me.deleteWP(index, plan, 1);
|
||||
numToDel -= 1;
|
||||
}
|
||||
return 2;
|
||||
},
|
||||
|
||||
# createDuplicateNames - helper to spawn DUPLICATENAMES page
|
||||
# args: ghostContainer, index, flag, plan
|
||||
# ghostContainer: vector of fgPositioned ghosts
|
||||
|
@ -360,34 +397,21 @@ var flightPlanController = {
|
|||
}
|
||||
|
||||
if (size(airport) == 1 or override) {
|
||||
if (!override) {
|
||||
if (me.flightplans[plan].indexOfWP(airport[0]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(airport[0]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
var numToDel = me.flightplans[plan].indexOfWP(airport[0]) - index;
|
||||
while (numToDel > 0) {
|
||||
me.deleteWP(index, plan, 1);
|
||||
numToDel -= 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
var indexToInsert = -1;
|
||||
if (override) {
|
||||
indexToInsert = overrideIndex;
|
||||
} else {
|
||||
if (me.flightplans[plan].indexOfWP(airport[overrideIndex]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(airport[overrideIndex]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
var numToDel = me.flightplans[plan].indexOfWP(airport[overrideIndex]) - index;
|
||||
while (numToDel > 0) {
|
||||
me.deleteWP(index, plan, 1);
|
||||
numToDel -= 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
indexToInsert = 0;
|
||||
}
|
||||
|
||||
var indexPresent = me.flightplans[plan].indexOfWP(airport[indexToInsert]);
|
||||
if (me.flightplans[plan].indexOfWP(airport[indexToInsert]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(airport[indexToInsert]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
return me.deleteTillIndex(airport[indexToInsert], index, plan);
|
||||
}
|
||||
} elsif (size(airport) >= 1) {
|
||||
me.createDuplicateNames(airport, index, 0, plan);
|
||||
|
@ -395,7 +419,7 @@ var flightPlanController = {
|
|||
}
|
||||
},
|
||||
|
||||
insertFix: func(text, index, plan, override = 0, overrideIndex = -1) { # override - means always choose [0]
|
||||
insertFix: func(text, index, plan, override = 0, overrideIndex = -1) {
|
||||
if (index == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -406,34 +430,21 @@ var flightPlanController = {
|
|||
}
|
||||
|
||||
if (size(fix) == 1 or override) {
|
||||
if (!override) {
|
||||
if (me.flightplans[plan].indexOfWP(fix[0]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(fix[0]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
var numToDel = me.flightplans[plan].indexOfWP(fix[0]) - index;
|
||||
while (numToDel > 0) {
|
||||
me.deleteWP(index, plan, 1);
|
||||
numToDel -= 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
var indexToInsert = -1;
|
||||
if (override) {
|
||||
indexToInsert = overrideIndex;
|
||||
} else {
|
||||
if (me.flightplans[plan].indexOfWP(fix[overrideIndex]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(fix[overrideIndex]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
var numToDel = me.flightplans[plan].indexOfWP(fix[overrideIndex]) - index;
|
||||
while (numToDel > 0) {
|
||||
me.deleteWP(index, plan, 1);
|
||||
numToDel -= 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
indexToInsert = 0;
|
||||
}
|
||||
|
||||
var indexPresent = me.flightplans[plan].indexOfWP(fix[indexToInsert]);
|
||||
if (me.flightplans[plan].indexOfWP(fix[indexToInsert]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(fix[indexToInsert]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
return me.deleteTillIndex(fix[indexToInsert], index, plan);
|
||||
}
|
||||
} elsif (size(fix) >= 1) {
|
||||
me.createDuplicateNames(fix, index, 0, plan);
|
||||
|
@ -441,6 +452,55 @@ var flightPlanController = {
|
|||
}
|
||||
},
|
||||
|
||||
insertNavaid: func(text, index, plan, override = 0, overrideIndex = -1) {
|
||||
if (index == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
var navaid = findNavaidsByID(text);
|
||||
if (size(navaid) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (size(navaid) == 1 or override) {
|
||||
var indexToInsert = -1;
|
||||
if (override) {
|
||||
indexToInsert = overrideIndex;
|
||||
} else {
|
||||
indexToInsert = 0;
|
||||
}
|
||||
|
||||
var indexPresent = me.flightplans[plan].indexOfWP(navaid[indexToInsert]);
|
||||
if (me.flightplans[plan].indexOfWP(navaid[indexToInsert]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(navaid[indexToInsert]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
return me.deleteTillIndex(navaid[indexToInsert], index, plan);
|
||||
}
|
||||
} elsif (size(navaid) >= 1) {
|
||||
me.createDuplicateNames(navaid, index, 1, plan);
|
||||
return 2;
|
||||
}
|
||||
},
|
||||
|
||||
insertDBWP: func(wpGhost, index, plan) {
|
||||
if (index == 0 or wpGhost == nil) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (me.flightplans[plan].indexOfWP(wpGhost) == -1) {
|
||||
# use createWP here as createWPFrom doesn't accept waypoints
|
||||
me.flightplans[plan].insertWP(createWP(wpGhost, wpGhost.wp_name), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
return me.deleteTillIndex(wpGhost, index, plan);
|
||||
}
|
||||
},
|
||||
|
||||
insertLatLonFix: func(text, index, plan) {
|
||||
if (index == 0) {
|
||||
return 1;
|
||||
|
@ -455,66 +515,16 @@ var flightPlanController = {
|
|||
return 1;
|
||||
}
|
||||
|
||||
var myWpLatLon = createWP(latDecimal, lonDecimal, "LL" ~ index);
|
||||
if (me.flightplans[plan].indexOfWP(myWpLatLon) == -1) {
|
||||
me.flightplans[plan].insertWP(myWpLatLon, index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
var numToDel = me.flightplans[plan].indexOfWP(myWpLatLon) - index;
|
||||
while (numToDel > 0) {
|
||||
me.deleteWP(index, plan, 1);
|
||||
numToDel -= 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
},
|
||||
|
||||
insertNavaid: func(text, index, plan, override = 0, overrideIndex = -1) {
|
||||
if (index == 0) {
|
||||
return 1;
|
||||
var waypoint = pilotWaypoint.new({lat: latDecimal, lon: lonDecimal}, "LL");
|
||||
var addDb = WaypointDatabase.addWP(waypoint);
|
||||
if (addDb != 2) {
|
||||
return addDb;
|
||||
}
|
||||
|
||||
var navaid = findNavaidsByID(text);
|
||||
if (size(navaid) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (size(navaid) == 1 or override) {
|
||||
if (!override) {
|
||||
if (me.flightplans[plan].indexOfWP(navaid[0]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(navaid[0]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
var numToDel = me.flightplans[plan].indexOfWP(navaid[0]) - index;
|
||||
while (numToDel > 0) {
|
||||
me.deleteWP(index, plan, 1);
|
||||
numToDel -= 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
if (me.flightplans[plan].indexOfWP(navaid[overrideIndex]) == -1) {
|
||||
me.flightplans[plan].insertWP(createWPFrom(navaid[overrideIndex]), index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
} else {
|
||||
var numToDel = me.flightplans[plan].indexOfWP(navaid[overrideIndex]) - index;
|
||||
while (numToDel > 0) {
|
||||
me.deleteWP(index, plan, 1);
|
||||
numToDel -= 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
} elsif (size(navaid) >= 1) {
|
||||
me.createDuplicateNames(navaid, index, 1, plan);
|
||||
return 2;
|
||||
}
|
||||
me.flightplans[plan].insertWP(waypoint.wpGhost, index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
},
|
||||
|
||||
# getWPforPBD - parse scratchpad text to find waypoint ghost for PBD
|
||||
|
@ -564,7 +574,7 @@ var flightPlanController = {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (size(wpGhostContainer) == 0 or override) {
|
||||
if (size(wpGhostContainer) == 1 or override) {
|
||||
if (!override) {
|
||||
wpGhost = wpGhostContainer[0];
|
||||
} else {
|
||||
|
@ -580,8 +590,7 @@ var flightPlanController = {
|
|||
}
|
||||
|
||||
var localMagvar = magvar(wpGhost.lat, wpGhost.lon);
|
||||
me.insertPlaceBearingDistance(wpGhost, textSplit[1] + localMagvar, textSplit[2], index, plan);
|
||||
return 2;
|
||||
return me.insertPlaceBearingDistance(wpGhost, textSplit[1] + localMagvar, textSplit[2], index, plan); # magnetic to true? I don't know. But this works!
|
||||
},
|
||||
|
||||
|
||||
|
@ -593,12 +602,19 @@ var flightPlanController = {
|
|||
# plan: plan to insert to
|
||||
|
||||
insertPlaceBearingDistance: func(wp, bearing, distance, index, plan) {
|
||||
me.flightplans[plan].insertWP(me.childWPBearingDistance(wp, bearing, distance, "PBD" ~ index), index);
|
||||
var waypoint = pilotWaypoint.new(me.childWPBearingDistance(wp, bearing, distance), "PBD");
|
||||
var addDb = WaypointDatabase.addWP(waypoint);
|
||||
if (addDb != 2) {
|
||||
return addDb;
|
||||
}
|
||||
|
||||
me.flightplans[plan].insertWP(waypoint.wpGhost, index);
|
||||
me.addDiscontinuity(index + 1, plan);
|
||||
me.flightPlanChanged(plan);
|
||||
return 2;
|
||||
},
|
||||
|
||||
scratchpad: func(text, index, plan) { # return 0 not in database, 1 not allowed, 2 success, 3 = not allowed due to dir to
|
||||
scratchpad: func(text, index, plan) { # return 0 not in database, 1 not allowed, 2 success, 3 = not allowed due to dir to, 4 = database full
|
||||
if (mcdu.dirToFlag) {
|
||||
return 3;
|
||||
}
|
||||
|
@ -614,6 +630,12 @@ var flightPlanController = {
|
|||
var thePlan = plan;
|
||||
}
|
||||
|
||||
# check waypoints database here
|
||||
var wpFromDB = WaypointDatabase.getWP(text);
|
||||
if (wpFromDB != nil) {
|
||||
return me.insertDBWP(wpFromDB, index, thePlan);
|
||||
}
|
||||
|
||||
if (size(split("/", text)) == 3) {
|
||||
return me.getWPforPBD(text, index, thePlan);
|
||||
} elsif (text == "CLR") {
|
||||
|
@ -643,6 +665,11 @@ var flightPlanController = {
|
|||
append(wpDistancePrev[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/distance-from-prev", 0, "DOUBLE"));
|
||||
}
|
||||
me.updatePlans();
|
||||
# push update to fuel
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
canvas_nd.A3XXRouteDriver.triggerSignal("fp-added");
|
||||
},
|
||||
|
||||
|
@ -733,8 +760,15 @@ var flightPlanController = {
|
|||
me.distToWpt.setValue(me.currentToWpt.courseAndDistanceFrom(curAircraftPos)[1]);
|
||||
|
||||
magTrueError = magHDG.getValue() - trueHDG.getValue();
|
||||
me.courseMagToWpt.setValue(me.courseToWpt.getValue() + magTrueError);
|
||||
|
||||
storeCourse = me.courseToWpt.getValue() + magTrueError;
|
||||
if (storeCourse >= 360) {
|
||||
storeCourse -= 360;
|
||||
} elsif (storeCourse < 0) {
|
||||
storeCourse += 360;
|
||||
}
|
||||
|
||||
me.courseMagToWpt.setValue(storeCourse);
|
||||
}
|
||||
|
||||
if (me.num[india].getValue() != me.flightplans[india].getPlanSize()) {
|
||||
|
|
220
Nasal/FMGC/mcdu-messages.nas
Normal file
|
@ -0,0 +1,220 @@
|
|||
# A3XX FMGC MCDU Message Generator and Control
|
||||
# Copyright (c) 2020 Josh Davidson (Octal450) and Jonathan Redpath (legoboyvdlp)
|
||||
|
||||
var TypeIMessage = {
|
||||
new: func(msgText, isInhibit = 0) {
|
||||
var msg = { parents: [TypeIMessage] };
|
||||
msg.msgText = msgText;
|
||||
msg.colour = "wht";
|
||||
msg.inhibitable = isInhibit;
|
||||
return msg;
|
||||
},
|
||||
};
|
||||
|
||||
var TypeIIMessage = {
|
||||
new: func(msgText, colour = "wht", isInhibit = 0) {
|
||||
var msg = { parents: [TypeIIMessage] };
|
||||
msg.msgText = msgText;
|
||||
msg.colour = colour;
|
||||
msg.inhibitable = isInhibit;
|
||||
return msg;
|
||||
},
|
||||
};
|
||||
|
||||
var MessageQueueController = {
|
||||
new: func(computer) {
|
||||
var msgC = { parents: [MessageQueueController] };
|
||||
msgC.computer = computer;
|
||||
msgC.messages = std.Vector.new(); # show left to right
|
||||
return msgC;
|
||||
},
|
||||
# first in first out
|
||||
addNewMsg: func(msg) {
|
||||
if (me.messages.size() < 5) {
|
||||
if (!me.messages.contains(msg)) {
|
||||
me.messages.append(msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
getNextMsg: func() {
|
||||
if (me.messages.size() >= 1) {
|
||||
return me.messages.vector[0];
|
||||
}
|
||||
return nil;
|
||||
},
|
||||
deleteAtIndex: func(index) {
|
||||
if (num(me.messages.size()) >= (index + 1)) {
|
||||
me.messages.pop(index);
|
||||
}
|
||||
},
|
||||
clearQueue: func() {
|
||||
me.messages.clear();
|
||||
},
|
||||
loop: func() {
|
||||
if (me.getNextMsg() != nil) {
|
||||
if (!scratchpads[me.computer].showTypeIIMsg) {
|
||||
if (scratchpads[me.computer].showTypeII(me.getNextMsg())) {
|
||||
me.deleteAtIndex(me.getNextMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
var scratchpadController = {
|
||||
new: func(mcdu) {
|
||||
var sp = { parents: [scratchpadController] };
|
||||
sp.scratchpad = "";
|
||||
sp.scratchpadSave = "";
|
||||
sp.scratchpadColour = "wht";
|
||||
sp.showTypeIMsg = 0;
|
||||
sp.showTypeIIMsg = 0;
|
||||
sp.mcdu = mcdu;
|
||||
return sp;
|
||||
},
|
||||
|
||||
addChar: func(character) {
|
||||
if (size(me.scratchpad) >= 22) {
|
||||
return;
|
||||
}
|
||||
|
||||
# any shown type ii is hidden
|
||||
if (me.showTypeIIMsg) {
|
||||
me.clearTypeII();
|
||||
}
|
||||
|
||||
# any shown type i is hidden
|
||||
if (me.showTypeIMsg) {
|
||||
me.clearTypeI();
|
||||
}
|
||||
|
||||
me.scratchpad = me.scratchpad ~ character;
|
||||
me.scratchpadColour = "wht";
|
||||
me.update();
|
||||
},
|
||||
showTypeI: func(msg) {
|
||||
# any shown type ii is hidden
|
||||
if (me.showTypeIIMsg) {
|
||||
me.clearTypeII();
|
||||
}
|
||||
|
||||
if (!me.showTypeIMsg) {
|
||||
me.showTypeIMsg = 1;
|
||||
|
||||
# save any data entered
|
||||
me.scratchpadSave = me.scratchpad;
|
||||
}
|
||||
|
||||
me.scratchpad = msg.msgText;
|
||||
me.scratchpadColour = msg.colour;
|
||||
me.update();
|
||||
},
|
||||
showTypeII: func(msg) {
|
||||
# only show if scratchpad empty
|
||||
if (me.scratchpad == "") {
|
||||
me.showTypeIIMsg = 1;
|
||||
me.scratchpad = msg.msgText;
|
||||
me.scratchpadColour = msg.colour;
|
||||
me.update();
|
||||
return 1;
|
||||
}
|
||||
me.update();
|
||||
return 0;
|
||||
},
|
||||
clearTypeI: func() {
|
||||
me.scratchpad = me.scratchpadSave;
|
||||
me.scratchpadSave = nil;
|
||||
me.showTypeIMsg = 0;
|
||||
me.update();
|
||||
},
|
||||
clearTypeII: func() {
|
||||
me.showTypeIIMsg = 0;
|
||||
me.empty();
|
||||
me.update();
|
||||
},
|
||||
override: func(str) {
|
||||
if (me.scratchpad == "USING COST INDEX N") {
|
||||
me.scratchpad = "USING COST INDEX " ~ str;
|
||||
me.update();
|
||||
}
|
||||
},
|
||||
empty: func() {
|
||||
me.scratchpad = "";
|
||||
me.update();
|
||||
},
|
||||
clear: func() {
|
||||
if (me.scratchpad == "CLR") {
|
||||
me.empty();
|
||||
} elsif (me.showTypeIMsg) {
|
||||
me.clearTypeI();
|
||||
} elsif (!me.showTypeIIMsg) {
|
||||
me.scratchpad = left(me.scratchpad, size(me.scratchpad) - 1);
|
||||
} else {
|
||||
me.clearTypeII();
|
||||
}
|
||||
me.update();
|
||||
},
|
||||
update: func() {
|
||||
if (me.mcdu == 1) {
|
||||
canvas_mcdu.MCDU_1.updateScratchpadCall();
|
||||
} else {
|
||||
canvas_mcdu.MCDU_2.updateScratchpadCall();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
var MessageController = {
|
||||
typeIMessages: std.Vector.new([
|
||||
TypeIMessage.new("AOC DISABLED"),TypeIMessage.new("AWY/WPT MISMATCH"),TypeIMessage.new("DIR TO IN PROGRESS"),
|
||||
TypeIMessage.new("ENTRY OUT OF RANGE"),TypeIMessage.new("FORMAT ERROR"),TypeIMessage.new("INSERT/ERASE TMPY FIRST"),
|
||||
TypeIMessage.new("LIST OF 20 IN USE"),TypeIMessage.new("PILOT ELEMENT RETAINED"),TypeIMessage.new("NOT ALLOWED"),
|
||||
TypeIMessage.new("NOT IN DATA BASE"),TypeIMessage.new("ONLY SPD ENTRY ALLOWED"),TypeIMessage.new("REVISION IN PROGRESS"),
|
||||
TypeIMessage.new("TMPY F-PLN EXISTS", 1),TypeIMessage.new("SELECT DESIRED SYSTEM"),TypeIMessage.new("SELECT HDG/TRK FIRST"),
|
||||
TypeIMessage.new("USING COST INDEX N", 1),TypeIMessage.new("WAIT FOR SYSTEM RESPONSE"),
|
||||
]),
|
||||
typeIIMessages: std.Vector.new([
|
||||
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),
|
||||
TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),
|
||||
]),
|
||||
|
||||
getTypeIMsgByText: func(text) {
|
||||
return me.getMsgByText(text, me.typeIMessages.vector);
|
||||
},
|
||||
getTypeIIMsgByText: func(text) {
|
||||
return me.getMsgByText(text, me.typeIIMessages.vector);
|
||||
},
|
||||
getMsgByText: func(text, theVector) {
|
||||
foreach (var message; theVector) {
|
||||
if (message.msgText = text) {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
},
|
||||
};
|
||||
|
||||
var scratchpads = [scratchpadController.new(1), scratchpadController.new(2)];
|
||||
var messageQueues = [MessageQueueController.new(0), MessageQueueController.new(1)];
|
||||
|
||||
var loop1MsgTimer = func() {
|
||||
if (messageQueues[0].getNextMsg() != nil) {
|
||||
if (!scratchpads[messageQueues[0].computer].showTypeIIMsg) {
|
||||
if (scratchpads[messageQueues[0].computer].showTypeII(messageQueues[0].getNextMsg())) {
|
||||
messageQueues[0].deleteAtIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var loop2MsgTimer = func() {
|
||||
if (messageQueues[1].getNextMsg() != nil) {
|
||||
if (!scratchpads[messageQueues[1].computer].showTypeIIMsg) {
|
||||
if (scratchpads[messageQueues[1].computer].showTypeII(messageQueues[1].getNextMsg())) {
|
||||
messageQueues[1].deleteAtIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var mcduMsgtimer1 = maketimer(1, loop1MsgTimer);
|
||||
var mcduMsgtimer2 = maketimer(1, loop2MsgTimer);
|
|
@ -195,7 +195,7 @@ var triggerDoor = func(door, doorName, doorDesc) {
|
|||
|
||||
var systemsInit = func {
|
||||
fbw.FBW.init();
|
||||
light_manager.init();
|
||||
effects.light_manager.init();
|
||||
systems.ELEC.init();
|
||||
systems.PNEU.init();
|
||||
systems.HYD.init();
|
||||
|
@ -203,18 +203,20 @@ var systemsInit = func {
|
|||
systems.ADIRS.init();
|
||||
systems.eng_init();
|
||||
systems.APUController.init();
|
||||
systems.fire_init();
|
||||
systems.autobrake_init();
|
||||
systems.fire_init();
|
||||
systems.icingInit();
|
||||
fmgc.flightPlanController.reset();
|
||||
fadec.FADEC.init();
|
||||
fmgc.ITAF.init();
|
||||
fmgc.FMGCinit();
|
||||
mcdu.MCDU_init(0);
|
||||
mcdu.MCDU_init(1);
|
||||
mcdu_scratchpad.mcduMsgtimer1.start();
|
||||
mcdu_scratchpad.mcduMsgtimer2.start();
|
||||
systemsLoop.start();
|
||||
icing.icingInit();
|
||||
lightsLoop.start();
|
||||
libraries.ECAM.init();
|
||||
ecam.ECAM.init();
|
||||
libraries.variousReset();
|
||||
rmp.init();
|
||||
acp.init();
|
||||
|
@ -222,11 +224,13 @@ var systemsInit = func {
|
|||
atc.init();
|
||||
fcu.FCUController.init();
|
||||
dmc.DMController.init();
|
||||
fmgc.flightPlanController.init();
|
||||
}
|
||||
|
||||
setlistener("/sim/signals/fdm-initialized", func {
|
||||
systemsInit();
|
||||
fmgc.flightPlanTimer.start();
|
||||
fmgc.WaypointDatabase.read();
|
||||
});
|
||||
|
||||
var systemsLoop = maketimer(0.1, func {
|
||||
|
@ -235,7 +239,7 @@ var systemsLoop = maketimer(0.1, func {
|
|||
systems.HYD.loop();
|
||||
systems.FUEL.loop();
|
||||
systems.ADIRS.loop();
|
||||
libraries.ECAM.loop();
|
||||
ecam.ECAM.loop();
|
||||
libraries.BUTTONS.update();
|
||||
fadec.FADEC.loop();
|
||||
rmp.rmpUpdate();
|
||||
|
|
|
@ -6,8 +6,8 @@ var distance = 0;
|
|||
var min_dist = 0;
|
||||
var max_dist = 0;
|
||||
var canChangeZOffset = 0;
|
||||
var decStep = -0.5;
|
||||
var incStep = 0.5;
|
||||
var decStep = -1;
|
||||
var incStep = 1;
|
||||
var viewName = "XX";
|
||||
|
||||
var fovZoom = func(d) {
|
||||
|
|
|
@ -80,9 +80,11 @@ var arrivalPage = {
|
|||
}
|
||||
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
|
||||
me.selectedSTAR = fmgc.flightPlanController.flightplans[me.computer].star;
|
||||
me.selectedTransition = fmgc.flightPlanController.flightplans[me.computer].star_trans;
|
||||
isNoStar[me.computer] = 0;
|
||||
} elsif (fmgc.flightPlanController.flightplans[2].star != nil) {
|
||||
me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star;
|
||||
me.selectedTransition = fmgc.flightPlanController.flightplans[2].star_trans;
|
||||
isNoStar[me.computer] = 0;
|
||||
} elsif (isNoStar[me.computer] == 1) {
|
||||
me.selectedSTAR = "NO STAR";
|
||||
|
@ -504,8 +506,7 @@ var arrivalPage = {
|
|||
me.arrowsColour[0][5] = "yel";
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -591,11 +592,10 @@ var arrivalPage = {
|
|||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
me.scrollRight();
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (size(me.stars) >= (index - 2)) {
|
||||
|
@ -623,11 +623,10 @@ var arrivalPage = {
|
|||
me.updateActiveTransitions();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -638,8 +637,7 @@ var arrivalPage = {
|
|||
me.updateActiveTransitions();
|
||||
me.updateTransitions();
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} elsif (size(me.transitions) >= (index - 1)) {
|
||||
if (!dirToFlag) {
|
||||
|
@ -650,11 +648,10 @@ var arrivalPage = {
|
|||
me.updateTransitions();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
},
|
||||
};
|
|
@ -52,6 +52,11 @@ var closestAirportPage = {
|
|||
},
|
||||
freeze: func() {
|
||||
me.frozen = !me.frozen;
|
||||
if (me.frozen) {
|
||||
me.L6 = [" UNFREEZE", nil, "blu"];
|
||||
} else {
|
||||
me.L6 = [" FREEZE", nil, "blu"];
|
||||
}
|
||||
},
|
||||
update: func() {
|
||||
if (me.frozen) { return; }
|
||||
|
@ -87,12 +92,13 @@ var closestAirportPage = {
|
|||
me.cdVector[1] = courseAndDistance(me.airports[1]);
|
||||
me.cdVector[2] = courseAndDistance(me.airports[2]);
|
||||
me.cdVector[3] = courseAndDistance(me.airports[3]);
|
||||
me.C1 = [math.round(me.cdVector[0][0]) ~ " " ~ math.round(me.cdVector[0][1]), " BRG DIST", "grn"];
|
||||
me.C2 = [math.round(me.cdVector[1][0]) ~ " " ~ math.round(me.cdVector[1][1]), nil, "grn"];
|
||||
me.C3 = [math.round(me.cdVector[2][0]) ~ " " ~ math.round(me.cdVector[2][1]), nil, "grn"];
|
||||
me.C4 = [math.round(me.cdVector[3][0]) ~ " " ~ math.round(me.cdVector[3][1]), nil, "grn"];
|
||||
var magvarLocal = magvar();
|
||||
me.C1 = [math.round(me.cdVector[0][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[0][1]), " BRG DIST", "grn"];
|
||||
me.C2 = [math.round(me.cdVector[1][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[1][1]) , nil, "grn"];
|
||||
me.C3 = [math.round(me.cdVector[2][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[2][1]), nil, "grn"];
|
||||
me.C4 = [math.round(me.cdVector[3][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[3][1]), nil, "grn"];
|
||||
if (me.manAirport != nil) {
|
||||
me.C5 = [math.round(courseAndDistance(me.manAirport)[0]) ~ " " ~ math.round(courseAndDistance(me.manAirport)[1]), nil, "grn"];
|
||||
me.C5 = [math.round(courseAndDistance(me.manAirport)[0] - magvarLocal) ~ " " ~ math.round(courseAndDistance(me.manAirport)[1]), nil, "grn"];
|
||||
}
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
},
|
||||
|
@ -105,7 +111,7 @@ var closestAirportPage = {
|
|||
return;
|
||||
}
|
||||
if (size(id) > 4) {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
if (airportinfo(id) == nil) {
|
||||
notInDataBase(me.computer);
|
||||
|
|
|
@ -77,9 +77,11 @@ var departurePage = {
|
|||
}
|
||||
if (fmgc.flightPlanController.flightplans[me.computer].sid != nil) {
|
||||
me.selectedSID = fmgc.flightPlanController.flightplans[me.computer].sid;
|
||||
me.selectedTransition = fmgc.flightPlanController.flightplans[me.computer].sid_trans;
|
||||
isNoSid[me.computer] = 0;
|
||||
} elsif (fmgc.flightPlanController.flightplans[2].sid != nil) {
|
||||
me.selectedSID = fmgc.flightPlanController.flightplans[2].sid;
|
||||
me.selectedTransition = fmgc.flightPlanController.flightplans[2].sid_trans;
|
||||
isNoSid[me.computer] = 0;
|
||||
} elsif (isNoSid[me.computer] == 1) {
|
||||
me.selectedSID = "NO SID";
|
||||
|
@ -196,7 +198,7 @@ var departurePage = {
|
|||
me.R1 = ["-------", "TRANS ", "wht"];
|
||||
}
|
||||
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid_trans != nil) {
|
||||
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].sid_trans.id, "SID", "yel"];
|
||||
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].sid_trans.id, "SID", "yel"];
|
||||
} else {
|
||||
me.R1 = ["-------", "TRANS ", "wht"];
|
||||
}
|
||||
|
@ -428,8 +430,7 @@ var departurePage = {
|
|||
me.arrowsColour[0][5] = "yel";
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -506,11 +507,10 @@ var departurePage = {
|
|||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
me.scrollRight();
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (size(me.sids) >= (index - 1)) {
|
||||
|
@ -536,11 +536,10 @@ var departurePage = {
|
|||
me.updateActiveTransitions();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -551,23 +550,21 @@ var departurePage = {
|
|||
me.updateActiveTransitions();
|
||||
me.updateTransitions();
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} elsif (size(me.transitions) >= (index - 1)) {
|
||||
if (!dirToFlag) {
|
||||
me.selectedTransition = me.transitions[index - 2];
|
||||
me.makeTmpy();
|
||||
fmgc.flightPlanController.flightplans[me.computer].sid = me.depAirport[0].getSid(me.selectedSID).transition(me.selectedTransition);
|
||||
fmgc.flightPlanController.flightplans[me.computer].sid_trans = me.depAirport[0].getSid(me.selectedSID).transition(me.selectedTransition);
|
||||
me.updateActiveTransitions();
|
||||
me.updateTransitions();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
},
|
||||
};
|
|
@ -148,6 +148,7 @@ var dirTo = {
|
|||
fieldL1: func(text, override = 0, overrideIndex = -1) {
|
||||
me.makeTmpy();
|
||||
me.L1[0] = text;
|
||||
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
|
||||
if (size(text) == 16) {
|
||||
# lat lon
|
||||
var lat = split("/", text)[0];
|
||||
|
@ -156,7 +157,7 @@ var dirTo = {
|
|||
var lonDecimal = mcdu.stringToDegrees(lon, "lon");
|
||||
|
||||
if (latDecimal > 90 or latDecimal < -90 or lonDecimal > 180 or lonDecimal < -180) {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
|
||||
var myWpLatLon = createWP(latDecimal, lonDecimal, "LL" ~ 01);
|
||||
|
@ -229,15 +230,15 @@ var dirTo = {
|
|||
}
|
||||
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
},
|
||||
leftFieldBtn: func(index) {
|
||||
me.makeTmpy();
|
||||
me.L1[0] = me.vector[index + me.scroll - 2].wp_name;
|
||||
fmgc.flightPlanController.directTo(me.vector[index + me.scroll - 2], me.computer);
|
||||
me.L1[0] = me.vector[index - 2].wp_name;
|
||||
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
|
||||
fmgc.flightPlanController.directTo(me.vector[index - 2], me.computer);
|
||||
me.arrowsMatrix[0][1] = 0;
|
||||
# FIGURE OUT HOW TO MAKE IT SO IT DOESN'T DELETE THE WAYPOINTS ON DIR TO BUT DOES IN FLIGHTPLAN
|
||||
#for (var i = 2; i != 6; i = i + 1) {
|
||||
|
@ -252,22 +253,22 @@ var dirTo = {
|
|||
if (fmgc.flightPlanController.temporaryFlag[me.computer] and dirToFlag) {
|
||||
dirToFlag = 0;
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
},
|
||||
fieldR6: func() {
|
||||
if (fmgc.flightPlanController.temporaryFlag[me.computer] and dirToFlag) {
|
||||
dirToFlag = 0;
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA"); # todo - remember horizontal srcoll of f-plna?
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA"); # todo - remember horizontal srcoll of f-plna?
|
||||
},
|
||||
updateDist: func(dist) {
|
||||
me.R1 = ["---- " ~ sprintf("%.0f", dist) ~ " ", "UTC DIST ", "wht"];
|
||||
|
|
|
@ -16,12 +16,12 @@ var fplnItem = {
|
|||
} elsif (me.wp.wp_name != "DISCONTINUITY") {
|
||||
var wptName = split("-", me.wp.wp_name);
|
||||
if (wptName[0] == "VECTORS") {
|
||||
return ["MANUAL", nil, me.colour];
|
||||
return ["MANUAL", me.getSubText(), me.colour];
|
||||
} else {
|
||||
if (size(wptName) == 2) {
|
||||
return[wptName[0] ~ wptName[1], nil, me.colour];
|
||||
return[wptName[0] ~ wptName[1], me.getSubText(), me.colour];
|
||||
} else {
|
||||
return [me.wp.wp_name, nil, me.colour];
|
||||
return [me.wp.wp_name, me.getSubText(), me.colour];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -31,6 +31,9 @@ var fplnItem = {
|
|||
return ["problem", nil, "ack"];
|
||||
}
|
||||
},
|
||||
getSubText: func() {
|
||||
return nil;
|
||||
},
|
||||
updateCenterText: func() {
|
||||
if (me.wp != nil) {
|
||||
if (me.wp.wp_name != "DISCONTINUITY") {
|
||||
|
@ -185,10 +188,10 @@ var staticText = {
|
|||
return [nil, nil, "ack"];
|
||||
},
|
||||
pushButtonLeft: func() {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
},
|
||||
pushButtonRight: func() {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -388,6 +391,11 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
|||
if (index == 6) {
|
||||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
|
||||
# push update to fuel
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
} else {
|
||||
if (canvas_mcdu.myLatRev[me.computer] != nil) {
|
||||
canvas_mcdu.myLatRev[me.computer].del();
|
||||
|
@ -398,24 +406,24 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
|||
}
|
||||
} else {
|
||||
if (size(me.outputList) >= index) {
|
||||
if (size(getprop("MCDU[" ~ me.computer ~ "]/scratchpad")) > 0) {
|
||||
var returny = fmgc.flightPlanController.scratchpad(getprop("MCDU[" ~ me.computer ~ "]/scratchpad"), (index - 1 + me.scroll), me.computer);
|
||||
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) > 0) {
|
||||
var returny = fmgc.flightPlanController.scratchpad(mcdu_scratchpad.scratchpads[me.computer].scratchpad, (index - 1 + me.scroll), me.computer);
|
||||
if (returny == 3) {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
} elsif (returny == 0) {
|
||||
notInDataBase(me.computer);
|
||||
mcdu_message(me.computer, "NOT IN DATA BASE");
|
||||
} elsif (returny == 1) {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
} elsif (returny == 4) {
|
||||
mcdu_message(me.computer, "LIST OF 20 IN USE");
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
}
|
||||
} else {
|
||||
me.outputList[index - 1].pushButtonLeft();
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -424,33 +432,28 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
|||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||
if (dirToFlag) { dirToFlag = 0; }
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
|
||||
# push update to fuel
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (size(me.outputList) >= index) {
|
||||
if (size(getprop("MCDU[" ~ me.computer ~ "]/scratchpad")) > 0) {
|
||||
notAllowed(me.computer);
|
||||
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) > 0) {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
} else {
|
||||
me.outputList[index - 1].pushButtonRight();
|
||||
}
|
||||
} else {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
var notInDataBase = func(i) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "NOT IN DATABASE");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "NOT IN DATABASE");
|
||||
}
|
||||
|
||||
var decimalToShortString = func(dms, type) {
|
||||
var degrees = split(".", sprintf(dms))[0];
|
||||
if (type == "lat") {
|
||||
|
|
|
@ -22,127 +22,145 @@ var min_dest_fob = props.globals.getNode("FMGC/internal/min-dest-fob", 1);
|
|||
var tow = props.globals.getNode("FMGC/internal/tow", 1);
|
||||
var lw = props.globals.getNode("FMGC/internal/lw", 1);
|
||||
var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1);
|
||||
var trip_wind_value = props.globals.getNode("FMGC/internal/trip-wind", 1);
|
||||
var fob = props.globals.getNode("FMGC/internal/fob", 1);
|
||||
var fffq_sensor = props.globals.getNode("FMGC/internal/fffq-sensor", 1);
|
||||
var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1);
|
||||
var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
|
||||
|
||||
var fuelPredInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L3" and blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/rte-rsv", 0.05 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", 5.0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
} else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
setprop("/FMGC/internal/rte-rsv", 0.05 * num(getprop("/FMGC/internal/trip-fuel")));
|
||||
setprop("/FMGC/internal/rte-percent", 5.0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (getprop("/FMGC/internal/trip-fuel") != 0) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) {
|
||||
var perc = num(split("/", scratchpad)[1]);
|
||||
if (perc != nil and perc >= 0.0 and perc <= 15.0) {
|
||||
setprop("FMGC/internal/rte-rsv", num(perc) / 100 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", perc);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/rte-rsv", num(perc) / 100 * num(getprop("/FMGC/internal/trip-fuel")));
|
||||
setprop("/FMGC/internal/rte-percent", perc);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7 and tf / num(trip_fuel.getValue()) <= 0.15) {
|
||||
setprop("FMGC/internal/rte-rsv", scratchpad);
|
||||
setprop("FMGC/internal/rte-percent", scratchpad / num(trip_fuel.getValue()) * 100);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) {
|
||||
setprop("/FMGC/internal/rte-rsv", scratchpad);
|
||||
if (scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100 <= 15.0) {
|
||||
setprop("/FMGC/internal/rte-percent", scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100);
|
||||
} else {
|
||||
setprop("/FMGC/internal/rte-percent", 15.0); # need reasearch on this value
|
||||
}
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4" and blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
} else if (key == "L4" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating") and getprop("/FMGC/internal/alt-set")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/alt-fuel", 0.0);
|
||||
setprop("FMGC/internal/alt-time", "0000");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
setprop("/FMGC/internal/alt-fuel", 0.0);
|
||||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/alt-fuel-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0 and tf < trip_fuel.getValue() + alt_fuel.getValue()) {
|
||||
setprop("FMGC/internal/alt-fuel", tf);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) {
|
||||
setprop("/FMGC/internal/alt-fuel", tf);
|
||||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/alt-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L5" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/final-fuel", 0.0);
|
||||
setprop("/FMGC/internal/final-time", "0030");
|
||||
setprop("/FMGC/internal/final-fuel-set", 0);
|
||||
setprop("/FMGC/internal/final-time-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) {
|
||||
setprop("/FMGC/internal/final-fuel", tf);
|
||||
setprop("/FMGC/internal/final-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4 and tf != nil and ((tf >= 0 and tf <= 59) or (tf >= 100 and tf <= 130))) {
|
||||
setprop("FMGC/internal/alt-time", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/final-time", scratchpad);
|
||||
setprop("/FMGC/internal/final-time-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5" and blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
} else if (key == "L6" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/final-fuel", 0.0);
|
||||
setprop("FMGC/internal/final-time", "0030");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
setprop("/FMGC/internal/min-dest-fob", 0);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0 and tf < trip_fuel.getValue() + final_fuel.getValue()) {
|
||||
setprop("FMGC/internal/final-fuel", tf);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
if (tfs >= 3 and tfs <= 5 and tf != nil and tf >= 0 and tf <= 80.0) {
|
||||
setprop("/FMGC/internal/min-dest-fob", tf);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (num(getprop("/FMGC/internal/min-dest-fob")) < num(getprop("/FMGC/internal/final-fuel") + getprop("/FMGC/internal/alt-fuel"))) {
|
||||
genericMessage(i, "CHECK MIN DEST FOB", "wht");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4 and tf != nil and ((tf >= 0 and tf <= 59) or (tf >= 100 and tf <= 130))) {
|
||||
setprop("FMGC/internal/final-time", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
} else if (key == "R3" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
if (!getprop("/FMGC/internal/cost-index-set")) {
|
||||
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index"));
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
|
||||
}
|
||||
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 0) {
|
||||
var zfw = getprop("fdm/jsbsim/inertia/weight-lbs") - getprop("consumables/fuel/total-fuel-lbs");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "/" ~ sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs");
|
||||
setprop("/FMGC/internal/zfw", sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
setprop("/FMGC/internal/zfw-set", 1);
|
||||
if (getprop("/FMGC/internal/block-set") != 1) {
|
||||
setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("/FMGC/internal/block-set", 1);
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
}
|
||||
} else if (tfs >= 2 and tfs <= 11 and find("/", scratchpad) != -1) {
|
||||
var zfwi = split("/", scratchpad);
|
||||
var zfwcg = num(zfwi[0]);
|
||||
|
@ -150,60 +168,74 @@ var fuelPredInput = func(key, i) {
|
|||
var zfwcgs = size(zfwi[0]);
|
||||
var zfws = size(zfwi[1]);
|
||||
if (zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", zfwcg);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
setprop("/FMGC/internal/zfwcg", zfwcg);
|
||||
setprop("/FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("/FMGC/internal/block-set") != 1) {
|
||||
setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("/FMGC/internal/block-set", 1);
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
}
|
||||
}
|
||||
if (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9) {
|
||||
setprop("FMGC/internal/zfw", zfw);
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
setprop("/FMGC/internal/zfw", zfw);
|
||||
setprop("/FMGC/internal/zfw-set", 1);
|
||||
if (getprop("/FMGC/internal/block-set") != 1) {
|
||||
setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("/FMGC/internal/block-set", 1);
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
}
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
}
|
||||
if ((zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) or (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9)) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
var zfwcg = size(scratchpad);
|
||||
if (num(scratchpad) != nil and zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
setprop("/FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("/FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("/FMGC/internal/block-set") != 1) {
|
||||
setprop("/FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("/FMGC/internal/block-set", 1);
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/fffq-sensor", "FF+FQ");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/fffq-sensor", "FF+FQ");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find("/", scratchpad) == 0) {
|
||||
var sensor = substr(scratchpad, 1);
|
||||
if (sensor == "FF+FQ" or sensor == "FQ+FF" or sensor == "FF" or sensor == "FQ") {
|
||||
setprop("FMGC/internal/fffq-sensor", sensor);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,78 +4,90 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var initInputA = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/alt-airport", "");
|
||||
setprop("FMGC/internal/alt-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/alt-airport", "");
|
||||
setprop("/FMGC/internal/alt-set", 0);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.updateARPT();
|
||||
#} else if (scratchpad == "") {
|
||||
#setprop("FMGC/internal/alt-selected", 1);
|
||||
#setprop("/FMGC/internal/alt-selected", 1);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else if (getprop("FMGC/internal/tofrom-set") == 1) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4) {
|
||||
setprop("FMGC/internal/alt-airport", scratchpad);
|
||||
setprop("FMGC/internal/alt-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.updateARPT();
|
||||
#setprop("FMGC/internal/alt-selected", 1);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else if (getprop("/FMGC/internal/tofrom-set") == 1) {
|
||||
if (!fmgc.flightPlanController.temporaryFlag[i]) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4) {
|
||||
setprop("/FMGC/internal/alt-airport", scratchpad);
|
||||
setprop("/FMGC/internal/alt-set", 1);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.updateARPT();
|
||||
#setprop("/FMGC/internal/alt-selected", 1);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "TMPY F-PLN EXISTS");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("MCDUC/flight-num", "");
|
||||
setprop("MCDUC/flight-num-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var flts = size(scratchpad);
|
||||
if (flts >= 1 and flts <= 8) {
|
||||
setprop("MCDUC/flight-num", scratchpad);
|
||||
setprop("MCDUC/flight-num-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cost-index", 0);
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
if (cis >= 1 and cis <= 3) {
|
||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cruise-ft", 10000);
|
||||
setprop("FMGC/internal/cruise-fl", 100);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("FMGC/internal/cruise-temp", 15);
|
||||
setprop("FMGC/internal/cruise-temp-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cruise-ft", 10000);
|
||||
setprop("/FMGC/internal/cruise-fl", 100);
|
||||
setprop("/FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("/FMGC/internal/cruise-temp", 15);
|
||||
setprop("/FMGC/internal/cruise-temp-set", 0);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find("/", scratchpad) != -1) {
|
||||
var crztemp = split("/", scratchpad);
|
||||
if (find("FL", crztemp[0]) != -1) {
|
||||
|
@ -87,27 +99,35 @@ var initInputA = func(key, i) {
|
|||
}
|
||||
var temp = int(crztemp[1]);
|
||||
var temps = size(crztemp[1]);
|
||||
if (crzs == 0 and temps >= 1 and temps <= 3 and temp != nil and getprop("FMGC/internal/cruise-lvl-set")) {
|
||||
if (crzs == 0 and temps >= 1 and temps <= 3 and temp != nil and getprop("/FMGC/internal/cruise-lvl-set")) {
|
||||
if (temp >= -99 and temp <= 99) {
|
||||
setprop("FMGC/internal/cruise-temp", temp);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cruise-temp", temp);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (crzs >= 1 and crzs <= 3 and crz != nil and temps >= 1 and temps <= 3 and temp != nil) {
|
||||
if (crz > 0 and crz <= 390 and temp >= -99 and temp <= 99) {
|
||||
setprop("FMGC/internal/cruise-ft", crz * 100);
|
||||
setprop("FMGC/internal/cruise-fl", crz);
|
||||
setprop("FMGC/internal/cruise-fl-prog", crz);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 1);
|
||||
setprop("FMGC/internal/cruise-temp", temp);
|
||||
setprop("FMGC/internal/cruise-temp-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cruise-ft", crz * 100);
|
||||
setprop("/FMGC/internal/cruise-fl", crz);
|
||||
setprop("/FMGC/internal/cruise-fl-prog", crz);
|
||||
setprop("/FMGC/internal/cruise-lvl-set", 1);
|
||||
setprop("/FMGC/internal/cruise-temp", temp);
|
||||
setprop("/FMGC/internal/cruise-temp-set", 1);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (find("FL", scratchpad) != -1) {
|
||||
|
@ -119,104 +139,114 @@ var initInputA = func(key, i) {
|
|||
}
|
||||
if (crzs >= 1 and crzs <= 3 and crz != nil) {
|
||||
if (crz > 0 and crz <= 390) {
|
||||
setprop("FMGC/internal/cruise-ft", crz * 100);
|
||||
setprop("FMGC/internal/cruise-fl", crz);
|
||||
setprop("FMGC/internal/cruise-fl-prog", crz);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cruise-ft", crz * 100);
|
||||
setprop("/FMGC/internal/cruise-fl", crz);
|
||||
setprop("/FMGC/internal/cruise-fl-prog", crz);
|
||||
setprop("/FMGC/internal/cruise-lvl-set", 1);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/dep-arpt", "");
|
||||
setprop("FMGC/internal/arr-arpt", "");
|
||||
setprop("FMGC/internal/tofrom-set", 0);
|
||||
setprop("FMGC/internal/align-ref-lat", 0);
|
||||
setprop("FMGC/internal/align-ref-long", 0);
|
||||
setprop("FMGC/internal/align-ref-lat-edit", 0);
|
||||
setprop("FMGC/internal/align-ref-long-edit", 0);
|
||||
fmgc.flightPlanController.reset();
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/dep-arpt", "");
|
||||
setprop("/FMGC/internal/arr-arpt", "");
|
||||
setprop("/FMGC/internal/tofrom-set", 0);
|
||||
setprop("/FMGC/internal/align-ref-lat", 0);
|
||||
setprop("/FMGC/internal/align-ref-long", 0);
|
||||
setprop("/FMGC/internal/align-ref-lat-edit", 0);
|
||||
setprop("/FMGC/internal/align-ref-long-edit", 0);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
fmgc.flightPlanController.reset(2);
|
||||
fmgc.flightPlanController.init();
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
#} else if (scratchpad == "") {
|
||||
#setprop("FMGC/internal/alt-selected", 0);
|
||||
#setprop("/FMGC/internal/alt-selected", 0);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 9 and find("/", scratchpad) != -1) {
|
||||
var fromto = split("/", scratchpad);
|
||||
var froms = size(fromto[0]);
|
||||
var tos = size(fromto[1]);
|
||||
if (froms == 4 and tos == 4) {
|
||||
#route
|
||||
setprop("FMGC/internal/dep-arpt", fromto[0]);
|
||||
setprop("FMGC/internal/arr-arpt", fromto[1]);
|
||||
setprop("FMGC/internal/tofrom-set", 1);
|
||||
#scratchpad
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
|
||||
setprop("FMGC/internal/alt-selected", 0);
|
||||
#ref lat
|
||||
dms = getprop("FMGC/flightplan[2]/wp[0]/lat");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "N" : "S";
|
||||
setprop("FMGC/internal/align-ref-lat-degrees", degrees);
|
||||
setprop("FMGC/internal/align-ref-lat-minutes", minutes);
|
||||
setprop("FMGC/internal/align-ref-lat-sign", sign);
|
||||
#ref long
|
||||
dms = getprop("FMGC/flightplan[2]/wp[0]/lon");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "E" : "W";
|
||||
setprop("FMGC/internal/align-ref-long-degrees", degrees);
|
||||
setprop("FMGC/internal/align-ref-long-minutes", minutes);
|
||||
setprop("FMGC/internal/align-ref-long-sign", sign);
|
||||
#ref edit
|
||||
setprop("FMGC/internal/align-ref-lat-edit", 0);
|
||||
setprop("FMGC/internal/align-ref-long-edit", 0);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
if (!fmgc.flightPlanController.temporaryFlag[i]) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 9 and find("/", scratchpad) != -1) {
|
||||
var fromto = split("/", scratchpad);
|
||||
var froms = size(fromto[0]);
|
||||
var tos = size(fromto[1]);
|
||||
if (froms == 4 and tos == 4) {
|
||||
#route
|
||||
setprop("/FMGC/internal/dep-arpt", fromto[0]);
|
||||
setprop("/FMGC/internal/arr-arpt", fromto[1]);
|
||||
setprop("/FMGC/internal/tofrom-set", 1);
|
||||
#scratchpad
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
|
||||
setprop("/FMGC/internal/alt-selected", 0);
|
||||
#ref lat
|
||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lat");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "N" : "S";
|
||||
setprop("/FMGC/internal/align-ref-lat-degrees", degrees);
|
||||
setprop("/FMGC/internal/align-ref-lat-minutes", minutes);
|
||||
setprop("/FMGC/internal/align-ref-lat-sign", sign);
|
||||
#ref long
|
||||
dms = getprop("/FMGC/flightplan[2]/wp[0]/lon");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "E" : "W";
|
||||
setprop("/FMGC/internal/align-ref-long-degrees", degrees);
|
||||
setprop("/FMGC/internal/align-ref-long-minutes", minutes);
|
||||
setprop("/FMGC/internal/align-ref-long-sign", sign);
|
||||
#ref edit
|
||||
setprop("/FMGC/internal/align-ref-lat-edit", 0);
|
||||
setprop("/FMGC/internal/align-ref-long-edit", 0);
|
||||
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "TMPY F-PLN EXISTS");
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "IRSINIT");
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/tropo", 36090);
|
||||
setprop("FMGC/internal/tropo-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/tropo", 36090);
|
||||
setprop("/FMGC/internal/tropo-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tropo = size(scratchpad);
|
||||
if (tropo == 5 and scratchpad <= 99990) {
|
||||
setprop("FMGC/internal/tropo-set", 1);
|
||||
setprop("FMGC/internal/tropo", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/gndtemp-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil and getprop("FMGC/status/phase") == 0 and size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
||||
setprop("FMGC/internal/gndtemp", scratchpad);
|
||||
setprop("FMGC/internal/gndtemp-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/gndtemp-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil and getprop("/FMGC/status/phase") == 0 and size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
||||
setprop("/FMGC/internal/gndtemp", scratchpad);
|
||||
setprop("/FMGC/internal/gndtemp-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,193 +2,175 @@
|
|||
|
||||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var zfwcg = props.globals.getNode("FMGC/internal/zfwcg", 1);
|
||||
var zfwcgSet = props.globals.getNode("FMGC/internal/zfwcg-set", 1);
|
||||
var zfw = props.globals.getNode("FMGC/internal/zfw", 1);
|
||||
var zfwSet = props.globals.getNode("FMGC/internal/zfw-set", 1);
|
||||
var block = props.globals.getNode("FMGC/internal/block", 1);
|
||||
var blockSet = props.globals.getNode("FMGC/internal/block-set", 1);
|
||||
var taxi_fuel = props.globals.getNode("FMGC/internal/taxi-fuel", 1);
|
||||
var trip_fuel = props.globals.getNode("FMGC/internal/trip-fuel", 1);
|
||||
var trip_time = props.globals.getNode("FMGC/internal/trip-time", 1);
|
||||
var rte_rsv = props.globals.getNode("FMGC/internal/rte-rsv", 1);
|
||||
var rte_percent = props.globals.getNode("FMGC/internal/rte-percent", 1);
|
||||
var alt_fuel = props.globals.getNode("FMGC/internal/alt-fuel", 1);
|
||||
var alt_time = props.globals.getNode("FMGC/internal/alt-time", 1);
|
||||
var final_fuel = props.globals.getNode("FMGC/internal/final-fuel", 1);
|
||||
var final_time = props.globals.getNode("FMGC/internal/final-time", 1);
|
||||
var min_dest_fob = props.globals.getNode("FMGC/internal/min-dest-fob", 1);
|
||||
var tow = props.globals.getNode("FMGC/internal/tow", 1);
|
||||
var lw = props.globals.getNode("FMGC/internal/lw", 1);
|
||||
var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1);
|
||||
var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1);
|
||||
var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
|
||||
|
||||
var initInputB = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L1") {
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("/FMGC/internal/taxi-fuel-set", 0);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
} else if (getprop("/FMGC/internal/fuel-request-set")) {
|
||||
setprop("/FMGC/internal/block-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 4) {
|
||||
if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 9.9) {
|
||||
setprop("FMGC/internal/taxi-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
|
||||
setprop("/FMGC/internal/taxi-fuel", scratchpad);
|
||||
setprop("/FMGC/internal/taxi-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.updateFuel();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
# }
|
||||
# else if (key == "L2") {
|
||||
# if (scratchpad == "CLR") {
|
||||
# notAllowed(i);
|
||||
# } else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
# var tfs = size(scratchpad);
|
||||
# if (tfs >= 1 and tfs <= 4) {
|
||||
# var temp_rte = num(scratchpad * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100));
|
||||
# if (scratchpad >= 0.0 and scratchpad <= block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - temp_rte) {
|
||||
# setprop("FMGC/internal/trip-fuel", scratchpad);
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
#
|
||||
# setprop("FMGC/internal/rte-rsv", temp_rte);
|
||||
# setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
# setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
# } else {
|
||||
# notAllowed(i);
|
||||
# }
|
||||
# } else {
|
||||
# notAllowed(i);
|
||||
# }
|
||||
# } else {
|
||||
# notAllowed(i);
|
||||
# }
|
||||
#
|
||||
} else if (key == "L3" and blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
} else if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/rte-rsv", 0.05 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", 5.0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
} else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
setprop("/FMGC/internal/rte-rsv", 0.05 * num(getprop("/FMGC/internal/trip-fuel")));
|
||||
setprop("/FMGC/internal/rte-rsv-set", 0);
|
||||
setprop("/FMGC/internal/rte-percent", 5.0);
|
||||
setprop("/FMGC/internal/rte-percent-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (getprop("/FMGC/internal/trip-fuel") != 0) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) {
|
||||
var perc = num(split("/", scratchpad)[1]);
|
||||
if (perc != nil and perc >= 0.0 and perc <= 15.0) {
|
||||
setprop("FMGC/internal/rte-rsv", num(perc) / 100 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", perc);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/rte-rsv", num(perc) / 100 * num(getprop("/FMGC/internal/trip-fuel")));
|
||||
setprop("/FMGC/internal/rte-rsv-set", 0);
|
||||
setprop("/FMGC/internal/rte-percent", perc);
|
||||
setprop("/FMGC/internal/rte-percent-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7 and tf / num(trip_fuel.getValue()) <= 0.15) {
|
||||
setprop("FMGC/internal/rte-rsv", scratchpad);
|
||||
setprop("FMGC/internal/rte-percent", scratchpad / num(trip_fuel.getValue()) * 100);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) {
|
||||
setprop("/FMGC/internal/rte-rsv", scratchpad);
|
||||
setprop("/FMGC/internal/rte-rsv-set", 1);
|
||||
if (scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100 <= 15.0) {
|
||||
setprop("/FMGC/internal/rte-percent", scratchpad / num(getprop("/FMGC/internal/trip-fuel")) * 100);
|
||||
} else {
|
||||
setprop("/FMGC/internal/rte-percent", 15.0); # need reasearch on this value
|
||||
}
|
||||
setprop("/FMGC/internal/rte-percent-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4" and blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
} else if (key == "L4" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating") and getprop("/FMGC/internal/alt-set")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/alt-fuel", 0.0);
|
||||
setprop("FMGC/internal/alt-time", "0000");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
setprop("/FMGC/internal/alt-fuel", 0.0);
|
||||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/alt-fuel-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0 and tf < trip_fuel.getValue() + alt_fuel.getValue()) {
|
||||
setprop("FMGC/internal/alt-fuel", tf);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) {
|
||||
setprop("/FMGC/internal/alt-fuel", tf);
|
||||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/alt-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L5" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/final-fuel", 0.0);
|
||||
setprop("/FMGC/internal/final-time", "0030");
|
||||
setprop("/FMGC/internal/final-fuel-set", 0);
|
||||
setprop("/FMGC/internal/final-time-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0) {
|
||||
setprop("/FMGC/internal/final-fuel", tf);
|
||||
setprop("/FMGC/internal/final-fuel-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4 and tf != nil and ((tf >= 0 and tf <= 59) or (tf >= 100 and tf <= 130))) {
|
||||
setprop("FMGC/internal/alt-time", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/final-time", scratchpad);
|
||||
setprop("/FMGC/internal/final-time-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5" and blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
} else if (key == "L6" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/final-fuel", 0.0);
|
||||
setprop("FMGC/internal/final-time", "0030");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
setprop("/FMGC/internal/min-dest-fob", 0);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (find(".", scratchpad) != -1) {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 10.0 and tf < trip_fuel.getValue() + final_fuel.getValue()) {
|
||||
setprop("FMGC/internal/final-fuel", tf);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
if (tfs >= 3 and tfs <= 5 and tf != nil and tf >= 0 and tf <= 80.0) {
|
||||
setprop("/FMGC/internal/min-dest-fob", tf);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (num(getprop("/FMGC/internal/min-dest-fob")) < num(getprop("/FMGC/internal/final-fuel") + getprop("/FMGC/internal/alt-fuel"))) {
|
||||
genericMessage(i, "CHECK MIN DEST FOB", "wht");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
var tf = num(scratchpad);
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4 and tf != nil and ((tf >= 0 and tf <= 59) or (tf >= 100 and tf <= 130))) {
|
||||
setprop("FMGC/internal/final-time", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R1") {
|
||||
} else if (key == "R1" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
if (!getprop("/FMGC/internal/cost-index-set")) {
|
||||
mcdu_message(i, "USING COST INDEX N", getprop("/FMGC/internal/last-cost-index"));
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
setprop("/FMGC/internal/cost-index", getprop("/FMGC/internal/last-cost-index"));
|
||||
}
|
||||
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 0) {
|
||||
var zfw = getprop("fdm/jsbsim/inertia/weight-lbs") - getprop("consumables/fuel/total-fuel-lbs");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "/" ~ sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
var zfw = getprop("/fdm/jsbsim/inertia/weight-lbs") - getprop("/consumables/fuel/total-fuel-lbs");
|
||||
setprop("/FMGC/internal/zfw", sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
setprop("/FMGC/internal/zfw-set", 1);
|
||||
if (!getprop("/FMGC/internal/block-confirmed") and getprop("/FMGC/internal/block-set")) {
|
||||
setprop("/FMGC/internal/tow", num(getprop("/FMGC/internal/zfw") + getprop("/FMGC/internal/block") - getprop("/FMGC/internal/taxi-fuel")));
|
||||
setprop("/FMGC/internal/tow-set", 1);
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
} else if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
} else if (getprop("/FMGC/internal/fuel-request-set")) {
|
||||
setprop("/FMGC/internal/block-calculating", 1);
|
||||
}
|
||||
} else if (tfs >= 2 and tfs <= 11 and find("/", scratchpad) != -1) {
|
||||
var zfwi = split("/", scratchpad);
|
||||
var zfwcg = num(zfwi[0]);
|
||||
|
@ -196,115 +178,167 @@ var initInputB = func(key, i) {
|
|||
var zfwcgs = size(zfwi[0]);
|
||||
var zfws = size(zfwi[1]);
|
||||
if (zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", zfwi[0]);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
setprop("/FMGC/internal/zfwcg", zfwi[0]);
|
||||
setprop("/FMGC/internal/zfwcg-set", 1);
|
||||
}
|
||||
if (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9) {
|
||||
setprop("FMGC/internal/zfw", zfwi[1]);
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
setprop("/FMGC/internal/zfw", zfwi[1]);
|
||||
setprop("/FMGC/internal/zfw-set", 1);
|
||||
if (!getprop("/FMGC/internal/block-confirmed") and getprop("/FMGC/internal/block-set")) {
|
||||
setprop("/FMGC/internal/tow", num(getprop("/FMGC/internal/zfw") + getprop("/FMGC/internal/block") - getprop("/FMGC/internal/taxi-fuel")));
|
||||
setprop("/FMGC/internal/tow-set", 1);
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
} else if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
} else if (getprop("/FMGC/internal/fuel-request-set")) {
|
||||
setprop("/FMGC/internal/block-calculating", 1);
|
||||
}
|
||||
}
|
||||
if ((zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) or (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9)) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
var zfwcg = size(scratchpad);
|
||||
if (num(scratchpad) != nil and zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("/FMGC/internal/zfwcg-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R2") {
|
||||
} else if (key == "R2" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/block", 0.0);
|
||||
setprop("FMGC/internal/block-set", 0);
|
||||
setprop("FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("FMGC/internal/rte-rsv", 0.05 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", 5.0);
|
||||
setprop("FMGC/internal/alt-fuel", 0.0);
|
||||
setprop("FMGC/internal/alt-time", "0000");
|
||||
setprop("FMGC/internal/final-fuel", 0.0);
|
||||
setprop("FMGC/internal/final-time", "0030");
|
||||
setprop("FMGC/internal/extra-fuel", 0.0);
|
||||
setprop("FMGC/internal/extra-time", "0000");
|
||||
setprop("FMGC/internal/min-dest-fob", 0.0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/block", 0.0);
|
||||
setprop("/FMGC/internal/block-set", 0);
|
||||
setprop("/FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("/FMGC/internal/taxi-fuel-set", 0);
|
||||
setprop("/FMGC/internal/trip-fuel", 0);
|
||||
setprop("/FMGC/internal/trip-time", "0000");
|
||||
setprop("/FMGC/internal/rte-rsv", 0);
|
||||
setprop("/FMGC/internal/rte-rsv-set", 0);
|
||||
setprop("/FMGC/internal/rte-percent", 5.0);
|
||||
setprop("/FMGC/internal/rte-percent-set", 0);
|
||||
setprop("/FMGC/internal/alt-fuel", 0);
|
||||
setprop("/FMGC/internal/alt-fuel-set", 0);
|
||||
setprop("/FMGC/internal/alt-time", "0000");
|
||||
setprop("/FMGC/internal/final-fuel", 0);
|
||||
setprop("/FMGC/internal/final-fuel-set", 0);
|
||||
setprop("/FMGC/internal/final-time", "0030");
|
||||
setprop("/FMGC/internal/final-time-set", 0);
|
||||
setprop("/FMGC/internal/min-dest-fob", 0);
|
||||
setprop("/FMGC/internal/min-dest-fob-set", 0);
|
||||
setprop("/FMGC/internal/tow", 0);
|
||||
setprop("/FMGC/internal/lw", 0);
|
||||
setprop("/FMGC/internal/trip-wind", "HD000");
|
||||
setprop("/FMGC/internal/trip-wind-value", 0);
|
||||
setprop("/FMGC/internal/fffq-sensor", "FF+FQ");
|
||||
setprop("/FMGC/internal/extra-fuel", 0);
|
||||
setprop("/FMGC/internal/extra-time", "0000");
|
||||
setprop("/FMGC/internal/fuel-request-set", 0);
|
||||
setprop("/FMGC/internal/fuel-calculating", 0);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
var maxblock = getprop("options/maxblock");
|
||||
var maxblock = getprop("/options/maxblock");
|
||||
if (tfs == 0) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", sprintf("%3.1f", math.round(getprop("consumables/fuel/total-fuel-lbs") / 1000, 0.1)));
|
||||
setprop("/FMGC/internal/block", sprintf("%3.1f", math.round(getprop("/consumables/fuel/total-fuel-lbs") / 1000, 0.1)));
|
||||
setprop("/FMGC/internal/block-set", 1);
|
||||
if (getprop("/FMGC/internal/zfw-set")) {
|
||||
setprop("/FMGC/internal/tow", num(getprop("/FMGC/internal/zfw") + getprop("/FMGC/internal/block") - getprop("/FMGC/internal/taxi-fuel")));
|
||||
setprop("/FMGC/internal/tow-set", 1);
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
if (num(scratchpad) != nil and scratchpad >= 1.0 and scratchpad <= maxblock) {
|
||||
setprop("FMGC/internal/block", scratchpad);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
setprop("FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("FMGC/internal/rte-rsv", 0.05 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", 5.0);
|
||||
setprop("FMGC/internal/alt-fuel", 0.0);
|
||||
setprop("FMGC/internal/alt-time", "0000");
|
||||
setprop("FMGC/internal/final-fuel", 0.0);
|
||||
setprop("FMGC/internal/final-time", "0030");
|
||||
setprop("FMGC/internal/extra-fuel", 0.0);
|
||||
setprop("FMGC/internal/extra-time", "0000");
|
||||
setprop("FMGC/internal/min-dest-fob", 0.0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/block", scratchpad);
|
||||
setprop("/FMGC/internal/block-set", 1);
|
||||
if (getprop("/FMGC/internal/zfw-set")) {
|
||||
setprop("/FMGC/internal/tow", num(getprop("/FMGC/internal/zfw") + getprop("/FMGC/internal/block") - getprop("/FMGC/internal/taxi-fuel")));
|
||||
setprop("/FMGC/internal/tow-set", 1);
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 0);
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad == "" and (!getprop("FMGC/internal/block-set") or !getprop("FMGC/internal/zfw-set"))) {
|
||||
setprop("FMGC/internal/zfw", num((getprop("fdm/jsbsim/inertia/weight-lbs") - getprop("consumables/fuel/total-fuel-lbs")) / 1000));
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
if (scratchpad == "" and getprop("/FMGC/internal/zfw-set") and !getprop("/FMGC/internal/fuel-request-set")) {
|
||||
setprop("/FMGC/internal/fuel-request-set", 1);
|
||||
setprop("/FMGC/internal/block-calculating", 1);
|
||||
} else if (scratchpad == "" and getprop("/FMGC/internal/zfw-set") and getprop("/FMGC/internal/fuel-request-set") and !getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/block-calculating")) {
|
||||
setprop("/FMGC/internal/block-confirmed", 1);
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
} else if (key == "R5" and !getprop("/FMGC/internal/fuel-calculating")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/trip-wind", "HD000");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/trip-wind", "HD000");
|
||||
setprop("/FMGC/internal/trip-wind-value", 0);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
if (find("TL", scratchpad) != -1 or find("HD", scratchpad) != -1) {
|
||||
var effwind = substr(scratchpad, 2);
|
||||
if (int(effwind) != nil and effwind >= 0 and effwind <= 500) {
|
||||
setprop("FMGC/internal/trip-wind", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/trip-wind", scratchpad);
|
||||
setprop("/FMGC/internal/trip-wind-value", effwind);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (find("-", scratchpad) != -1 or find("+", scratchpad) != -1 or find("T", scratchpad) != -1 or find("H", scratchpad) != -1) {
|
||||
var effwind = substr(scratchpad, 1);
|
||||
if (int(effwind) != nil and effwind >= 0 and effwind <= 500) {
|
||||
setprop("FMGC/internal/trip-wind", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/trip-wind", scratchpad);
|
||||
setprop("/FMGC/internal/trip-wind-value", effwind);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
if (num(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 500) {
|
||||
setprop("FMGC/internal/trip-wind", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/trip-wind", scratchpad);
|
||||
setprop("/FMGC/internal/trip-wind-value", scratchpad);
|
||||
if (getprop("/FMGC/internal/block-confirmed")) {
|
||||
setprop("/FMGC/internal/fuel-calculating", 1);
|
||||
}
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ var initInputIRS = func(key, i) {
|
|||
setprop("FMGC/internal/align-ref-long-minutes", getprop("FMGC/internal/align-ref-long-minutes") + 0.1);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "down") {
|
||||
if (getprop("FMGC/internal/align-ref-lat-edit")) {
|
||||
|
@ -59,14 +59,14 @@ var initInputIRS = func(key, i) {
|
|||
setprop("FMGC/internal/align-ref-long-minutes", getprop("FMGC/internal/align-ref-long-minutes") - 0.1);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L1") {
|
||||
if (getprop("FMGC/internal/tofrom-set")) {
|
||||
setprop("FMGC/internal/align-ref-lat-edit", 1);
|
||||
setprop("FMGC/internal/align-ref-long-edit", 0);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
setprop("FMGC/internal/align-ref-lat-edit", 0);
|
||||
|
@ -77,7 +77,7 @@ var initInputIRS = func(key, i) {
|
|||
setprop("FMGC/internal/align-ref-lat-edit", 0);
|
||||
setprop("FMGC/internal/align-ref-long-edit", 1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("FMGC/internal/align-ref-lat-edit", 0);
|
||||
|
@ -91,27 +91,11 @@ var initInputIRS = func(key, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
}
|
||||
} else if (getprop("FMGC/internal/tofrom-set") == 0) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "SELECT REFERENCE") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT REFERENCE");
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT REFERENCE");
|
||||
} else if (getprop("systems/navigation/adr/any-adr-on") == 0) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "IRS NOT ALIGNED") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "IRS NOT ALIGNED");
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "IRS NOT ALIGNED");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,8 +120,7 @@ var latRev = {
|
|||
if (!dirToFlag) {
|
||||
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
me._checkTmpy();
|
||||
}
|
||||
|
@ -129,14 +128,13 @@ var latRev = {
|
|||
nextWpt: func() {
|
||||
me.makeTmpy();
|
||||
|
||||
var returny = fmgc.flightPlanController.scratchpad(getprop("/MCDU[" ~ me.computer ~ "]/scratchpad"), me.index + 1, me.computer);
|
||||
var returny = fmgc.flightPlanController.scratchpad(mcdu_scratchpad.scratchpads[me.computer].scratchpad, me.index + 1, me.computer);
|
||||
if (returny == 0) {
|
||||
notInDataBase(me.computer);
|
||||
} elsif (returny == 1) {
|
||||
notAllowed(me.computer);
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
} else {
|
||||
setprop("/MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||
setprop("/MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[me.computer].empty();
|
||||
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||
if (getprop("/MCDU[" ~ me.computer ~ "]/page") != "DUPLICATENAMES") {
|
||||
setprop("/MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
|
||||
|
|
1055
Nasal/MCDU/MCDU.nas
|
@ -5,37 +5,34 @@ var ldg_config_3_set = props.globals.getNode("/FMGC/internal/ldg-config-3-set",
|
|||
var ldg_config_f_set = props.globals.getNode("/FMGC/internal/ldg-config-f-set", 1);
|
||||
|
||||
var perfAPPRInput = func(key, i) {
|
||||
var scratchpad = getprop("/MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/dest-qnh", -1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (num(scratchpad) != nil and (scratchpad >= 28.06 and scratchpad <= 31.01) or (scratchpad >= 745 and scratchpad <= 1050)) {
|
||||
# doesn't support accidental temp input yet
|
||||
setprop("/FMGC/internal/dest-qnh", scratchpad);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/dest-temp", -999);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (num(scratchpad) != nil and scratchpad >= -99 and scratchpad < 99) {
|
||||
setprop("/FMGC/internal/dest-temp", scratchpad);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
var tfs = size(scratchpad);
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/dest-mag", -1);
|
||||
setprop("/FMGC/internal/dest-wind", -1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (tfs >= 3 and tfs <= 7 and find("/", scratchpad) != -1) {
|
||||
var weather = split("/", scratchpad);
|
||||
var mag = int(weather[0]);
|
||||
|
@ -46,87 +43,92 @@ var perfAPPRInput = func(key, i) {
|
|||
if (mag != nil and wind != nil and mag >= 0 and mag <= 360 and wind >= 0 and wind <= 200) {
|
||||
setprop("/FMGC/internal/dest-mag", weather[0]);
|
||||
setprop("/FMGC/internal/dest-wind", weather[1]);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
fmgc.updateARPT();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/trans-alt", 18000);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 50000) {
|
||||
setprop("/FMGC/internal/trans-alt", scratchpad);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.FMGCInternal.transAlt = 18000;
|
||||
fmgc.FMGCInternal.transAltSet = 0;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
var tfs = size(scratchpad);
|
||||
if (int(scratchpad) != nil and (tfs == 4 or tfs == 5) and scratchpad >= 1000 and scratchpad <= 39000) {
|
||||
fmgc.FMGCInternal.transAlt = math.round(scratchpad, 500);
|
||||
fmgc.FMGCInternal.transAltSet = 1;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} elsif (int(scratchpad) != nil and (tfs == 2 or tfs == 3) and scratchpad >= 10 and scratchpad <= 390) {
|
||||
fmgc.FMGCInternal.transAlt = math.round(scratchpad * 100, 5);
|
||||
fmgc.FMGCInternal.transAltSet = 1;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/vapp-speed-set", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 200) {
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
setprop("/FMGC/internal/vapp-speed-set", 1);
|
||||
setprop("/FMGC/internal/computed-speeds/vapp_appr", scratchpad);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "PERFDES");
|
||||
} else if (key == "R2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/baro", 99999);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil and scratchpad >= getprop("/FMGC/internal/ldg-elev") and scratchpad <= 5000 + getprop("/FMGC/internal/ldg-elev")) {
|
||||
if (getprop("/FMGC/internal/radio-no") == 0) {
|
||||
setprop("/FMGC/internal/radio", 99999);
|
||||
}
|
||||
setprop("/FMGC/internal/baro", scratchpad);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/radio", 99999);
|
||||
setprop("/FMGC/internal/radio-no", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (scratchpad == "NO") {
|
||||
setprop("/FMGC/internal/radio", 99999);
|
||||
setprop("/FMGC/internal/radio-no", 1);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 700) {
|
||||
setprop("/FMGC/internal/baro", 99999);
|
||||
setprop("/FMGC/internal/radio-no", 0);
|
||||
setprop("/FMGC/internal/radio", scratchpad);
|
||||
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "" and ldg_config_f_set.getValue() == 1 and ldg_config_3_set.getValue() == 0) {
|
||||
setprop("/FMGC/internal/ldg-config-3-set", 1);
|
||||
setprop("/FMGC/internal/ldg-config-f-set", 0);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "" and ldg_config_3_set.getValue() == 1 and ldg_config_f_set.getValue() == 0) {
|
||||
setprop("/FMGC/internal/ldg-config-3-set", 0);
|
||||
setprop("/FMGC/internal/ldg-config-f-set", 1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("/MCDU[" ~ i ~ "]/page", "PERFGA");
|
||||
|
|
|
@ -3,47 +3,46 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var perfCLBInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cost-index", 0);
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
if (cis >= 1 and cis <= 3) {
|
||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (getprop("FMGC/status/phase") == 2) {
|
||||
if (getprop("/FMGC/status/phase") == 2) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFTO");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
if (getprop("FMGC/status/phase") == 2) {
|
||||
if (getprop("FMGC/internal/activate-once") == 1) {
|
||||
if (getprop("FMGC/internal/activate-twice") == 0) {
|
||||
setprop("FMGC/internal/activate-twice", 1);
|
||||
setprop("FMGC/status/phase", 5);
|
||||
setprop("FMGC/internal/decel", 1);
|
||||
if (getprop("/FMGC/status/phase") == 2) {
|
||||
if (getprop("/FMGC/internal/activate-once") == 1) {
|
||||
if (getprop("/FMGC/internal/activate-twice") == 0) {
|
||||
setprop("/FMGC/internal/activate-twice", 1);
|
||||
setprop("/FMGC/status/phase", 5);
|
||||
setprop("/FMGC/internal/decel", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("FMGC/internal/activate-once", 1);
|
||||
setprop("/FMGC/internal/activate-once", 1);
|
||||
}
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFTO");
|
||||
|
|
|
@ -3,41 +3,40 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var perfCRZInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cost-index", 0);
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
if (cis >= 1 and cis <= 3) {
|
||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
if (getprop("FMGC/status/phase") == 3) {
|
||||
if (getprop("FMGC/internal/activate-once") == 1) {
|
||||
if (getprop("FMGC/internal/activate-twice") == 0) {
|
||||
setprop("FMGC/internal/activate-twice", 1);
|
||||
setprop("FMGC/status/phase", 5);
|
||||
setprop("FMGC/internal/decel", 1);
|
||||
if (getprop("/FMGC/status/phase") == 3) {
|
||||
if (getprop("/FMGC/internal/activate-once") == 1) {
|
||||
if (getprop("/FMGC/internal/activate-twice") == 0) {
|
||||
setprop("/FMGC/internal/activate-twice", 1);
|
||||
setprop("/FMGC/status/phase", 5);
|
||||
setprop("/FMGC/internal/decel", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("FMGC/internal/activate-once", 1);
|
||||
setprop("/FMGC/internal/activate-once", 1);
|
||||
}
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFCLB");
|
||||
|
|
|
@ -3,41 +3,40 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var perfDESInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cost-index", 0);
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cost-index", 0);
|
||||
setprop("/FMGC/internal/cost-index-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
if (cis >= 1 and cis <= 3) {
|
||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cost-index", ci);
|
||||
setprop("/FMGC/internal/cost-index-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
if (getprop("FMGC/status/phase") == 4) {
|
||||
if (getprop("FMGC/internal/activate-once") == 1) {
|
||||
if (getprop("FMGC/internal/activate-twice") == 0) {
|
||||
setprop("FMGC/internal/activate-twice", 1);
|
||||
setprop("FMGC/status/phase", 5);
|
||||
setprop("FMGC/internal/decel", 1);
|
||||
if (getprop("/FMGC/status/phase") == 4) {
|
||||
if (getprop("/FMGC/internal/activate-once") == 1) {
|
||||
if (getprop("/FMGC/internal/activate-twice") == 0) {
|
||||
setprop("/FMGC/internal/activate-twice", 1);
|
||||
setprop("/FMGC/status/phase", 5);
|
||||
setprop("/FMGC/internal/decel", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
setprop("FMGC/internal/activate-once", 1);
|
||||
setprop("/FMGC/internal/activate-once", 1);
|
||||
}
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFCRZ");
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
# uses universal values, will implement separately once FPLN is finished
|
||||
|
||||
var perfGAInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("FMGC/internal/accel-agl-ft", "1500");
|
||||
setprop("/FMGC/internal/accel-agl-ft", "1500");
|
||||
setprop("MCDUC/thracc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 7 and tfs <= 9 and find("/", scratchpad) != -1) {
|
||||
|
@ -19,32 +18,31 @@ var perfGAInput = func(key, i) {
|
|||
var acc = size(thracc[1]);
|
||||
if (int(thrred) != nil and int(acc) != nil and (thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
|
||||
setprop("systems/thrust/clbreduc-ft", thracc[0]);
|
||||
setprop("FMGC/internal/accel-agl-ft", thracc[1]);
|
||||
setprop("/FMGC/internal/accel-agl-ft", thracc[1]);
|
||||
setprop("MCDUC/thracc-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("/FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (int(scratchpad) != nil and tfs >= 3 and tfs <= 5) {
|
||||
setprop("FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("/FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("MCDUC/reducacc-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,102 +4,99 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var perfTOInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (getprop("FMGC/status/phase") != 1) {
|
||||
if (getprop("/FMGC/status/phase") != 1) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/v1", 0);
|
||||
setprop("FMGC/internal/v1-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/v1", 0);
|
||||
setprop("/FMGC/internal/v1-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
setprop("FMGC/internal/v1", scratchpad);
|
||||
setprop("FMGC/internal/v1-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/v1", scratchpad);
|
||||
setprop("/FMGC/internal/v1-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L2") {
|
||||
if (getprop("FMGC/status/phase") != 1) {
|
||||
if (getprop("/FMGC/status/phase") != 1) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/vr", 0);
|
||||
setprop("FMGC/internal/vr-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vr", 0);
|
||||
setprop("/FMGC/internal/vr-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
setprop("FMGC/internal/vr", scratchpad);
|
||||
setprop("FMGC/internal/vr-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vr", scratchpad);
|
||||
setprop("/FMGC/internal/vr-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (getprop("FMGC/status/phase") != 1) {
|
||||
if (getprop("/FMGC/status/phase") != 1) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/v2", 0);
|
||||
setprop("FMGC/internal/v2-set", 0);
|
||||
setprop("/FMGC/internal/v2", 0);
|
||||
setprop("/FMGC/internal/v2-set", 0);
|
||||
setprop("it-autoflight/settings/togaspd", 157);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
setprop("FMGC/internal/v2", scratchpad);
|
||||
setprop("FMGC/internal/v2-set", 1);
|
||||
setprop("/FMGC/internal/v2", scratchpad);
|
||||
setprop("/FMGC/internal/v2-set", 1);
|
||||
setprop("it-autoflight/settings/togaspd", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/trans-alt", 18000);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.FMGCInternal.transAlt = 18000;
|
||||
fmgc.FMGCInternal.transAltSet = 0;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (int(scratchpad) != nil and (tfs == 4 or tfs <= 5) and scratchpad >= 1000 and scratchpad <= 39000) {
|
||||
setprop("FMGC/internal/trans-alt", int(scratchpad / 10) * 10);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.FMGCInternal.transAlt = int(scratchpad / 10) * 10;
|
||||
fmgc.FMGCInternal.transAltSet = 1;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("systems/thrust/clbreduc-ft", "1500");
|
||||
setprop("FMGC/internal/accel-agl-ft", "1500");
|
||||
setprop("/FMGC/internal/accel-agl-ft", "1500");
|
||||
setprop("MCDUC/thracc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (find("/", scratchpad) != -1) {
|
||||
|
@ -110,29 +107,28 @@ var perfTOInput = func(key, i) {
|
|||
var accs = size(acc);
|
||||
if (int(thrred) != nil and (thrreds >= 3 and thrreds <= 5) and thrred >= 400 and thrred <= 39000 and int(acc) != nil and (accs == 3 or accs == 4 or accs == 5) and acc >= 400 and acc <= 39000) {
|
||||
setprop("systems/thrust/clbreduc-ft", int(thrred / 10) * 10);
|
||||
setprop("FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
|
||||
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
|
||||
setprop("MCDUC/thracc-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (thrreds == 0 and int(acc) != nil and (accs >= 3 and accs <= 5) and acc >= 400 and acc <= 39000) {
|
||||
setprop("FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (num(scratchpad) != nil and (tfs >= 3 and tfs <= 5) and scratchpad >= 400 and scratchpad <= 39000) {
|
||||
setprop("systems/thrust/clbreduc-ft", int(scratchpad / 10) * 10);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/to-flap", 0);
|
||||
setprop("FMGC/internal/to-ths", "0.0");
|
||||
setprop("FMGC/internal/flap-ths-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-flap", 0);
|
||||
setprop("/FMGC/internal/to-ths", "0.0");
|
||||
setprop("/FMGC/internal/flap-ths-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
if (find("/", scratchpad) != -1) {
|
||||
var flapths = split("/", scratchpad);
|
||||
|
@ -144,95 +140,93 @@ var perfTOInput = func(key, i) {
|
|||
var trimb = substr(trim, 0, 3);
|
||||
var validtrima = num(trima) != nil and num(trima) >= 0 and num(trima) <= 7.0;
|
||||
var validtrimb = num(trimb) != nil and num(trimb) >= 0 and num(trimb) <= 7.0;
|
||||
if (flaps == 0 and getprop("FMGC/internal/flap-ths-set")) {
|
||||
if (flaps == 0 and getprop("/FMGC/internal/flap-ths-set")) {
|
||||
if (trims == 5 and find("DN", trim) != -1 and validtrima) {
|
||||
setprop("FMGC/internal/to-ths", -1 * trima);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-ths", -1 * trima);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("DN", trim) != -1 and validtrimb) {
|
||||
setprop("FMGC/internal/to-ths", -1 * trimb);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-ths", -1 * trimb);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("UP", trim) != -1 and validtrima) {
|
||||
setprop("FMGC/internal/to-ths", trima);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-ths", trima);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("UP", trim) != -1 and validtrimb) {
|
||||
setprop("FMGC/internal/to-ths", trimb);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-ths", trimb);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (flaps == 1 and num(flap) != nil and flap >= 0 and flap <= 3) {
|
||||
if (trims == 5 and find("DN", trim) != -1 and validtrima) {
|
||||
setprop("FMGC/internal/to-flap", flap);
|
||||
setprop("FMGC/internal/to-ths", -1 * trima);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-flap", flap);
|
||||
setprop("/FMGC/internal/to-ths", -1 * trima);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("DN", trim) != -1 and validtrimb) {
|
||||
setprop("FMGC/internal/to-flap", flap);
|
||||
setprop("FMGC/internal/to-ths", -1 * trimb);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-flap", flap);
|
||||
setprop("/FMGC/internal/to-ths", -1 * trimb);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("UP", trim) != -1 and validtrima) {
|
||||
setprop("FMGC/internal/to-flap", flap);
|
||||
setprop("FMGC/internal/to-ths", trima);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-flap", flap);
|
||||
setprop("/FMGC/internal/to-ths", trima);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (trims == 5 and find("UP", trim) != -1 and validtrimb) {
|
||||
setprop("FMGC/internal/to-flap", flap);
|
||||
setprop("FMGC/internal/to-ths", trimb);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/to-flap", flap);
|
||||
setprop("/FMGC/internal/to-ths", trimb);
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (size(scratchpad) == 1 and num(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 3) {
|
||||
setprop("FMGC/internal/to-flap", scratchpad);
|
||||
if (!getprop("FMGC/internal/flap-ths-set")) {
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("/FMGC/internal/to-flap", scratchpad);
|
||||
if (!getprop("/FMGC/internal/flap-ths-set")) {
|
||||
setprop("/FMGC/internal/flap-ths-set", 1);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/flex", 0);
|
||||
setprop("FMGC/internal/flex-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/flex", 0);
|
||||
setprop("/FMGC/internal/flex-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 1 or tfs == 2) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 99) {
|
||||
setprop("FMGC/internal/flex", scratchpad);
|
||||
setprop("FMGC/internal/flex-set", 1);
|
||||
var flex_calc = getprop("FMGC/internal/flex") - getprop("environment/temperature-degc");
|
||||
setprop("FMGC/internal/flex-cmd", flex_calc);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/flex", scratchpad);
|
||||
setprop("/FMGC/internal/flex-set", 1);
|
||||
var flex_calc = getprop("/FMGC/internal/flex") - getprop("environment/temperature-degc");
|
||||
setprop("/FMGC/internal/flex-cmd", flex_calc);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("/FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (int(scratchpad) != nil and (tfs == 4 or tfs == 5) and scratchpad >= 1000 and scratchpad <= 39000) {
|
||||
setprop("FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("/FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("MCDUC/reducacc-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
|
|
97
Nasal/MCDU/PILOTWAYPOINT.nas
Normal file
|
@ -0,0 +1,97 @@
|
|||
var pilotWaypointPage = {
|
||||
title: nil,
|
||||
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
||||
L1: [nil, nil, "ack"], # content, title, colour
|
||||
L2: [nil, nil, "ack"],
|
||||
L3: [nil, nil, "ack"],
|
||||
L4: [nil, nil, "ack"],
|
||||
L5: [nil, nil, "ack"],
|
||||
L6: [nil, nil, "ack"],
|
||||
C1: [nil, nil, "ack"],
|
||||
C2: [nil, nil, "ack"],
|
||||
C3: [nil, nil, "ack"],
|
||||
C4: [nil, nil, "ack"],
|
||||
C5: [nil, nil, "ack"],
|
||||
C6: [nil, nil, "ack"],
|
||||
R1: [nil, nil, "ack"],
|
||||
R2: [nil, nil, "ack"],
|
||||
R3: [nil, nil, "ack"],
|
||||
R4: [nil, nil, "ack"],
|
||||
R5: [nil, nil, "ack"],
|
||||
R6: [nil, nil, "ack"],
|
||||
new: func(computer) {
|
||||
var ap = {parents:[pilotWaypointPage]};
|
||||
ap.scroll = fmgc.WaypointDatabase.getNonNilIndex();
|
||||
ap.computer = computer;
|
||||
ap._setupPageWithData();
|
||||
return ap;
|
||||
},
|
||||
del: func() {
|
||||
return nil;
|
||||
},
|
||||
_setupPageWithData: func() {
|
||||
me.title = "PILOTS WAYPOINT";
|
||||
me.L1 = [fmgc.WaypointDatabase.waypointsVec[me.scroll].id, " IDENT", "grn"];
|
||||
|
||||
var ghost = fmgc.WaypointDatabase.waypointsVec[me.scroll].wpGhost;
|
||||
me.L2 = [me.translateLatitude(ghost.lat) ~ "/" ~ me.translateLongitude(ghost.lon), " LAT/LON", "grn"];
|
||||
|
||||
me.R5 = ["WAYPOINT ", "NEW ", "wht"];
|
||||
|
||||
|
||||
me.arrowsMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1]];
|
||||
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "ack"], ["ack", "ack", "ack", "ack", "wht", "blu"]];
|
||||
|
||||
if (fmgc.WaypointDatabase.confirm[me.computer]) {
|
||||
me.R6 = ["CONFIRM DELETE ALL ", nil, "amb"];
|
||||
me.arrowsColour[1][5] = "amb";
|
||||
} else {
|
||||
me.R6 = ["DELETE ALL ", nil, "blu"];
|
||||
me.arrowsColour[1][5] = "blu";
|
||||
}
|
||||
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
},
|
||||
translateLatitude: func(latitude) {
|
||||
var split = split(".", sprintf("%s", latitude));
|
||||
var degree = split[0];
|
||||
if (latitude >= 0) {
|
||||
var decimal = sprintf("%04.1f", (latitude - num(degree)) * 60);
|
||||
return sprintf("%02.0f", degree) ~ decimal ~ "N";
|
||||
} else {
|
||||
var decimal = sprintf("%04.1f", (latitude - num(degree)) * 60);
|
||||
return sprintf("%02.0f", degree) ~ decimal ~ "S";
|
||||
}
|
||||
},
|
||||
translateLongitude: func(longitude) {
|
||||
var split = split(".", sprintf("%s", longitude));
|
||||
var degree = split[0];
|
||||
if (longitude >= 0) {
|
||||
var decimal = sprintf("%04.1f", (longitude - num(degree)) * 60);
|
||||
return sprintf("%03.0f", degree) ~ decimal ~ "E";
|
||||
} else {
|
||||
var decimal = sprintf("%04.1f", (longitude - num(degree)) * 60);
|
||||
return sprintf("%03.0f", degree) ~ decimal ~ "W";
|
||||
}
|
||||
},
|
||||
scrollLeft: func() {
|
||||
me.scroll = fmgc.WaypointDatabase.getPreviousFromIndex(me.scroll);
|
||||
me._setupPageWithData();
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
},
|
||||
scrollRight: func() {
|
||||
me.scroll = fmgc.WaypointDatabase.getNextFromIndex(me.scroll);
|
||||
me._setupPageWithData();
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
},
|
||||
deleteCmd: func() {
|
||||
if (!fmgc.WaypointDatabase.confirm[me.computer]) {
|
||||
fmgc.WaypointDatabase.delete(me.computer);
|
||||
me.scroll = fmgc.WaypointDatabase.getNonNilIndex();
|
||||
}
|
||||
me._setupPageWithData();
|
||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||
},
|
||||
};
|
|
@ -1,34 +1,33 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var progCLBInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cruise-fl-prog", getprop("FMGC/internal/cruise-fl"));
|
||||
if (getprop("FMGC/status/phase") == 5) {
|
||||
setprop("FMGC/status/phase", 3);
|
||||
setprop("FMGC/internal/activate-once", 0);
|
||||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
setprop("/FMGC/internal/cruise-fl-prog", getprop("/FMGC/internal/cruise-fl"));
|
||||
if (getprop("/FMGC/status/phase") == 5) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
setprop("FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
if (getprop("FMGC/status/phase") == 5) {
|
||||
setprop("FMGC/status/phase", 3);
|
||||
setprop("FMGC/internal/activate-once", 0);
|
||||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
setprop("/FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (getprop("/FMGC/status/phase") == 5) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,33 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var progCRZInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cruise-fl-prog", getprop("FMGC/internal/cruise-fl"));
|
||||
if (getprop("FMGC/status/phase") == 5) {
|
||||
setprop("FMGC/status/phase", 3);
|
||||
setprop("FMGC/internal/activate-once", 0);
|
||||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
setprop("/FMGC/internal/cruise-fl-prog", getprop("/FMGC/internal/cruise-fl"));
|
||||
if (getprop("/FMGC/status/phase") == 5) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
setprop("FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
if (getprop("FMGC/status/phase") == 5) {
|
||||
setprop("FMGC/status/phase", 3);
|
||||
setprop("FMGC/internal/activate-once", 0);
|
||||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
setprop("/FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (getprop("/FMGC/status/phase") == 5) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,33 @@
|
|||
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
||||
|
||||
var progDESInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cruise-fl-prog", getprop("FMGC/internal/cruise-fl"));
|
||||
if (getprop("FMGC/status/phase") == 5 or getprop("FMGC/status/phase") == 6) {
|
||||
setprop("FMGC/status/phase", 3);
|
||||
setprop("FMGC/internal/activate-once", 0);
|
||||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
setprop("/FMGC/internal/cruise-fl-prog", getprop("/FMGC/internal/cruise-fl"));
|
||||
if (getprop("/FMGC/status/phase") == 5 or getprop("/FMGC/status/phase") == 6) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
setprop("FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
if (getprop("FMGC/status/phase") == 4 or getprop("FMGC/status/phase") == 5 or getprop("FMGC/status/phase") == 6) {
|
||||
setprop("FMGC/status/phase", 3);
|
||||
setprop("FMGC/internal/activate-once", 0);
|
||||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
setprop("/FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (getprop("/FMGC/status/phase") == 4 or getprop("/FMGC/status/phase") == 5 or getprop("/FMGC/status/phase") == 6) {
|
||||
setprop("/FMGC/status/phase", 3);
|
||||
setprop("/FMGC/internal/activate-once", 0);
|
||||
setprop("/FMGC/internal/activate-twice", 0);
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,22 +3,21 @@
|
|||
var altSet = props.globals.getNode("it-autoflight/input/alt", 1);
|
||||
|
||||
var progTOInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cruise-fl-prog", getprop("FMGC/internal/cruise-fl"));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/cruise-fl-prog", getprop("/FMGC/internal/cruise-fl"));
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100 and getprop("FMGC/internal/cruise-lvl-set")) {
|
||||
setprop("FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100 and getprop("/FMGC/internal/cruise-lvl-set")) {
|
||||
setprop("/FMGC/internal/cruise-fl-prog", scratchpad);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2020 Josh Davidson (Octal450)
|
||||
|
||||
var radnavInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/vor1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor1freq-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -17,47 +16,45 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
|
||||
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
|
||||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/vor1freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor1freq-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
|
||||
setprop("instrumentation/nav[2]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/vor1freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor1freq-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/vor1crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor1crs-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("instrumentation/nav[2]/radials/selected-deg", scratchpad);
|
||||
setprop("FMGC/internal/vor1crs-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor1crs-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/ils1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/ils1freq-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -67,64 +64,61 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
|
||||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/ils1freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
if (num(getprop("FMGC/internal/ils1freq-calculated")) != 0 and num(getprop("FMGC/internal/ils1freq-calculated")) != num(getprop("instrumentation/nav[0]/frequencies/selected-mhz"))) {
|
||||
setprop("/FMGC/internal/ils1freq-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
if (num(getprop("/FMGC/internal/ils1freq-calculated")) != 0 and num(getprop("/FMGC/internal/ils1freq-calculated")) != num(getprop("instrumentation/nav[0]/frequencies/selected-mhz"))) {
|
||||
genericMessage(i, "RWY/LS MISMATCH", "amb");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/ils1crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/ils1crs-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", scratchpad);
|
||||
setprop("FMGC/internal/ils1crs-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/ils1crs-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/adf1freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/adf1freq-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 4) {
|
||||
if (scratchpad >= 190 and scratchpad <= 1750) {
|
||||
setprop("instrumentation/adf[0]/frequencies/selected-khz", scratchpad);
|
||||
setprop("FMGC/internal/adf1freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/adf1freq-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/vor2freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor2freq-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 5 or tfs == 6) {
|
||||
|
@ -133,59 +127,57 @@ var radnavInput = func(key, i) {
|
|||
or scratchpad == 109.10 or scratchpad == 109.15 or scratchpad == 109.30 or scratchpad == 109.35 or scratchpad == 109.50 or scratchpad == 109.55 or scratchpad == 109.70 or scratchpad == 109.75 or scratchpad == 109.90 or scratchpad == 109.95
|
||||
or scratchpad == 110.10 or scratchpad == 110.15 or scratchpad == 110.30 or scratchpad == 110.35 or scratchpad == 110.50 or scratchpad == 110.55 or scratchpad == 110.70 or scratchpad == 110.75 or scratchpad == 110.90 or scratchpad == 110.95
|
||||
or scratchpad == 111.10 or scratchpad == 111.15 or scratchpad == 111.30 or scratchpad == 111.35 or scratchpad == 111.50 or scratchpad == 111.55 or scratchpad == 111.70 or scratchpad == 111.75 or scratchpad == 111.90 or scratchpad == 111.95) {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
} else {
|
||||
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/vor2freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor2freq-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
}
|
||||
} else if (scratchpad >= 112.00 and scratchpad <= 117.95) {
|
||||
setprop("instrumentation/nav[3]/frequencies/selected-mhz", scratchpad);
|
||||
setprop("FMGC/internal/vor2freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor2freq-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/vor2crs-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor2crs-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0 and scratchpad <= 360) {
|
||||
setprop("instrumentation/nav[3]/radials/selected-deg", scratchpad);
|
||||
setprop("FMGC/internal/vor2crs-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/vor2crs-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/adf2freq-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/adf2freq-set", 0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3 or tfs == 4) {
|
||||
if (scratchpad >= 190 and scratchpad <= 1750) {
|
||||
setprop("instrumentation/adf[1]/frequencies/selected-khz", scratchpad);
|
||||
setprop("FMGC/internal/adf2freq-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("/FMGC/internal/adf2freq-set", 1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,5 +5,12 @@
|
|||
var statusInput = func(key, i) {
|
||||
if (key == "L3") {
|
||||
fmgc.switchDatabase();
|
||||
} elsif (key == "R5") {
|
||||
if (fmgc.WaypointDatabase.confirm[i]) {
|
||||
fmgc.WaypointDatabase.delete(i);
|
||||
fmgc.WaypointDatabase.confirm[i] = 0;
|
||||
} else {
|
||||
fmgc.WaypointDatabase.confirm[i] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ var vertRev = {
|
|||
me.L5 = [" WIND DATA", nil, "wht"];
|
||||
me.L6 = [" RETURN", nil, "wht"];
|
||||
me.R2 = ["RTA ", nil, "wht"];
|
||||
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
|
||||
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0]];
|
||||
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
|
||||
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||
} if (me.type == 2) {
|
||||
|
@ -61,12 +61,17 @@ var vertRev = {
|
|||
me.L3 = [" [ ]", " SPD CSTR", "blu"];
|
||||
me.L4 = [" CONSTANT MACH", nil, "wht"];
|
||||
me.L5 = [" WIND DATA", nil, "wht"];
|
||||
me.L6 = [" CLB", nil, "wht"];
|
||||
me.L6 = [" CLB", nil, "amb"];
|
||||
me.R2 = ["RTA ", nil, "wht"];
|
||||
me.R3 = ["[ ] ", "ALT CSTR ", "blu"];
|
||||
me.R6 = ["DES ", nil, "wht"];
|
||||
me.R6 = ["DES ", nil, "amb"];
|
||||
# When the system does vertical planning, L6 should be RETURN and R6 not used if the MCDU knows the waypoint is during climb or descent.
|
||||
# The CLB or DES prompts should only be shown for a vertical revision in the cruise phase.
|
||||
# For now we fake it and allow the user to press either, which both act like RETURN.
|
||||
# When CLB/DES are shown, a small "OR" should be shown between them.
|
||||
# The 'arrows' for CLB/DES should actually be asterisks.
|
||||
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
|
||||
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
|
||||
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "amb"], ["ack", "wht", "ack", "ack", "wht", "amb"]];
|
||||
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0]];
|
||||
} else {
|
||||
me.title = ["VERT REV", " AT ", me.id];
|
||||
|
@ -84,8 +89,7 @@ var vertRev = {
|
|||
me.L5 = [" WIND DATA", nil, "wht"];
|
||||
me.L6 = [" RETURN", nil, "wht"];
|
||||
me.R2 = ["RTA ", nil, "wht"];
|
||||
me.R6 = ["DES ", nil, "wht"];
|
||||
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
|
||||
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0]];
|
||||
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
|
||||
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||
} elsif (me.type == 1) {
|
||||
|
@ -102,8 +106,7 @@ var vertRev = {
|
|||
me.L6 = [" RETURN", nil, "wht"];
|
||||
me.R2 = ["RTA ", nil, "wht"];
|
||||
me.R3 = ["3000", "G/S INTCP", "grn"];
|
||||
me.R6 = ["DES ", nil, "wht"];
|
||||
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
|
||||
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0]];
|
||||
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
|
||||
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||
}
|
||||
|
@ -115,8 +118,7 @@ var vertRev = {
|
|||
if (!dirToFlag) {
|
||||
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||
} else {
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||
mcdu_message(me.computer, "DIR TO IN PROGRESS");
|
||||
}
|
||||
me._checkTmpy();
|
||||
}
|
||||
|
|
|
@ -7,32 +7,56 @@
|
|||
|
||||
# NOTE: This is just temporary until FG allows a full implementation of the audio system.
|
||||
|
||||
var vhf1_recive = props.globals.initNode("/controls/audio/acp[0]/vhf1-recive", 1, "BOOL");
|
||||
var vhf2_recive = props.globals.initNode("/controls/audio/acp[0]/vhf2-recive", 1, "BOOL");
|
||||
var vhf1_capt_recive = props.globals.initNode("/controls/audio/acp[0]/vhf1-recive", 1, "BOOL");
|
||||
var vhf2_capt_recive = props.globals.initNode("/controls/audio/acp[0]/vhf2-recive", 1, "BOOL");
|
||||
var vhf1_capt_volume = props.globals.initNode("/controls/audio/acp[0]/vhf1-volume", 1, "DOUBLE");
|
||||
var vhf2_capt_volume = props.globals.initNode("/controls/audio/acp[0]/vhf2-volume", 1, "DOUBLE");
|
||||
|
||||
var vhf1_volume = props.globals.initNode("/controls/audio/acp[0]/vhf1-volume", 1, "DOUBLE");
|
||||
var vhf2_volume = props.globals.initNode("/controls/audio/acp[0]/vhf2-volume", 1, "DOUBLE");
|
||||
var vhf1_fo_recive = props.globals.initNode("/controls/audio/acp[1]/vhf1-recive", 1, "BOOL");
|
||||
var vhf2_fo_recive = props.globals.initNode("/controls/audio/acp[1]/vhf2-recive", 1, "BOOL");
|
||||
var vhf1_fo_volume = props.globals.initNode("/controls/audio/acp[1]/vhf1-volume", 1, "DOUBLE");
|
||||
var vhf2_fo_volume = props.globals.initNode("/controls/audio/acp[1]/vhf2-volume", 1, "DOUBLE");
|
||||
|
||||
var com1_volume = props.globals.getNode("instrumentation/comm[0]/volume");
|
||||
var com2_volume = props.globals.getNode("instrumentation/comm[1]/volume");
|
||||
|
||||
var init = func() {
|
||||
vhf1_recive.setValue(1);
|
||||
vhf2_recive.setValue(1);
|
||||
vhf1_volume.setValue(1);
|
||||
vhf2_volume.setValue(0.8);
|
||||
vhf1_capt_recive.setValue(1);
|
||||
vhf2_capt_recive.setValue(1);
|
||||
vhf1_capt_volume.setValue(1);
|
||||
vhf2_capt_volume.setValue(0.8);
|
||||
vhf1_fo_recive.setValue(1);
|
||||
vhf2_fo_recive.setValue(1);
|
||||
vhf1_fo_volume.setValue(0.8);
|
||||
vhf2_fo_volume.setValue(1);
|
||||
}
|
||||
|
||||
var update_instruments = func(com_no) {
|
||||
if (com_no == 0) {
|
||||
if (vhf1_recive.getValue()) {
|
||||
com1_volume.setValue(vhf1_volume.getValue());
|
||||
var update_com1 = func() {
|
||||
if (getprop("systems/acconfig/options/fo-view") == 1) {
|
||||
if (vhf1_fo_recive.getValue()) {
|
||||
com1_volume.setValue(vhf1_fo_volume.getValue());
|
||||
} else {
|
||||
com1_volume.setValue(0);
|
||||
}
|
||||
} else if (com_no == 1) {
|
||||
if (vhf2_recive.getValue()) {
|
||||
com2_volume.setValue(vhf2_volume.getValue());
|
||||
} else {
|
||||
if (vhf1_capt_recive.getValue()) {
|
||||
com1_volume.setValue(vhf1_capt_volume.getValue());
|
||||
} else {
|
||||
com1_volume.setValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var update_com2 = func() {
|
||||
if (getprop("systems/acconfig/options/fo-view") == 1) {
|
||||
if (vhf2_fo_recive.getValue()) {
|
||||
com2_volume.setValue(vhf2_fo_volume.getValue());
|
||||
} else {
|
||||
com2_volume.setValue(0);
|
||||
}
|
||||
} else {
|
||||
if (vhf2_capt_recive.getValue()) {
|
||||
com2_volume.setValue(vhf2_capt_volume.getValue());
|
||||
} else {
|
||||
com2_volume.setValue(0);
|
||||
}
|
||||
|
@ -40,17 +64,39 @@ var update_instruments = func(com_no) {
|
|||
}
|
||||
|
||||
setlistener("/controls/audio/acp[0]/vhf1-recive", func {
|
||||
update_instruments(0);
|
||||
update_com1();
|
||||
});
|
||||
|
||||
setlistener("/controls/audio/acp[0]/vhf1-volume", func {
|
||||
update_instruments(0);
|
||||
update_com1();
|
||||
});
|
||||
|
||||
setlistener("/controls/audio/acp[0]/vhf2-recive", func {
|
||||
update_instruments(1);
|
||||
update_com2();
|
||||
});
|
||||
|
||||
setlistener("/controls/audio/acp[0]/vhf2-volume", func {
|
||||
update_instruments(1);
|
||||
update_com2();
|
||||
});
|
||||
|
||||
setlistener("/controls/audio/acp[1]/vhf1-recive", func {
|
||||
update_com1();
|
||||
});
|
||||
|
||||
setlistener("/controls/audio/acp[1]/vhf1-volume", func {
|
||||
update_com1();
|
||||
});
|
||||
|
||||
setlistener("/controls/audio/acp[1]/vhf2-recive", func {
|
||||
update_com2();
|
||||
});
|
||||
|
||||
setlistener("/controls/audio/acp[1]/vhf2-volume", func {
|
||||
update_com2();
|
||||
});
|
||||
|
||||
setlistener("/systems/acconfig/options/fo-view", func {
|
||||
update_com1();
|
||||
update_com2();
|
||||
});
|
||||
|
||||
|
|
|
@ -47,7 +47,9 @@ var default = [
|
|||
"/controls/gear/brake-parking",
|
||||
# electrics
|
||||
"/systems/electrical/sources/bat-1/percent-calc",
|
||||
"/systems/electrical/sources/bat-2/percent-calc"
|
||||
"/systems/electrical/sources/bat-2/percent-calc",
|
||||
# FMGC
|
||||
"/FMGC/internal/last-cost-index",
|
||||
];
|
||||
|
||||
var save = func (saved_props, file) {
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/start/A320_cockpit_starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>20</y>
|
||||
|
@ -28,14 +29,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/start/A320_cockpit_starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>-20</y>
|
||||
|
@ -48,14 +50,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/start/A320_cockpit_startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>20</y>
|
||||
|
@ -68,14 +71,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/start/A320_cockpit_startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>-20</y>
|
||||
|
@ -492,21 +496,23 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
<z>0</z>
|
||||
<inner-angle>225</inner-angle>
|
||||
<outer-angle>135</outer-angle>
|
||||
<outer-gain>0.01</outer-gain>
|
||||
<outer-gain>0.60</outer-gain>
|
||||
</orientation>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -521,21 +527,23 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
<z>0</z>
|
||||
<inner-angle>225</inner-angle>
|
||||
<outer-angle>135</outer-angle>
|
||||
<outer-gain>0.01</outer-gain>
|
||||
<outer-gain>0.60</outer-gain>
|
||||
</orientation>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -550,14 +558,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
|
@ -579,14 +589,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
|
@ -608,14 +620,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-startup-rear.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
<y>0</y>
|
||||
|
@ -637,14 +651,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-startup-rear.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
<y>0</y>
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/start/A320_cockpit_starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>20</y>
|
||||
|
@ -28,14 +29,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/start/A320_cockpit_starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>-20</y>
|
||||
|
@ -48,14 +50,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/start/A320_cockpit_startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>20</y>
|
||||
|
@ -68,14 +71,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/start/A320_cockpit_startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>-20</y>
|
||||
|
@ -448,21 +452,23 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
<z>0</z>
|
||||
<inner-angle>225</inner-angle>
|
||||
<outer-angle>135</outer-angle>
|
||||
<outer-gain>0.01</outer-gain>
|
||||
<outer-gain>0.60</outer-gain>
|
||||
</orientation>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -477,21 +483,23 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
<z>0</z>
|
||||
<inner-angle>225</inner-angle>
|
||||
<outer-angle>135</outer-angle>
|
||||
<outer-gain>0.01</outer-gain>
|
||||
<outer-gain>0.60</outer-gain>
|
||||
</orientation>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -506,14 +514,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
|
@ -535,14 +545,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
|
@ -564,14 +576,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-startup-rear.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
<y>0</y>
|
||||
|
@ -593,14 +607,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/CFM56B/external/cfm-startup-rear.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
<y>0</y>
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/start/v2500-start1.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>20</y>
|
||||
|
@ -28,14 +29,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/start/v2500-start1.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>-20</y>
|
||||
|
@ -48,14 +50,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/start/v2500-start2.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>20</y>
|
||||
|
@ -68,14 +71,15 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/start/v2500-start2.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<position>
|
||||
<x>0</x>
|
||||
<y>-20</y>
|
||||
|
@ -309,21 +313,23 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/external/v2500-starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
<z>0</z>
|
||||
<inner-angle>225</inner-angle>
|
||||
<outer-angle>135</outer-angle>
|
||||
<outer-gain>0.01</outer-gain>
|
||||
<outer-gain>0.60</outer-gain>
|
||||
</orientation>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -338,21 +344,23 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/external/v2500-starter.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
<z>0</z>
|
||||
<inner-angle>225</inner-angle>
|
||||
<outer-angle>135</outer-angle>
|
||||
<outer-gain>0.01</outer-gain>
|
||||
<outer-gain>0.60</outer-gain>
|
||||
</orientation>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -367,14 +375,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/external/v2500-startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
|
@ -396,14 +406,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/external/v2500-startup.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
|
@ -425,14 +437,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/external/v2500-startup-rear.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
<y>0</y>
|
||||
|
@ -454,14 +468,16 @@
|
|||
<mode>once</mode>
|
||||
<path>Aircraft/A320-family/Sounds/SASA/V2500/external/v2500-startup-rear.wav</path>
|
||||
<condition>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
<not><property>/sim/sound/internal-custom</property></not>
|
||||
</and>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>2</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
<y>0</y>
|
||||
|
|
Before Width: | Height: | Size: 459 KiB |
BIN
Splash/cockpit2.png
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
Splash/cockpit3.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
Splash/wing3.png
Normal file
After Width: | Height: | Size: 1.8 MiB |
|
@ -719,15 +719,157 @@
|
|||
|
||||
<channel name="Tiller">
|
||||
|
||||
<switch name="hydraulics/tiller/switch">
|
||||
<switch name="/controls/gear/steering-switched">
|
||||
<default value="/controls/flight/rudder"/>
|
||||
<test logic="AND" value="/controls/flight/aileron">
|
||||
fbw/fmgc/enabled eq 0
|
||||
<test value="0">
|
||||
/gear/gear[0]/wow ne 1
|
||||
</test>
|
||||
<test value="/controls/gear/steering">
|
||||
/systems/acconfig/options/seperate-tiller-axis eq 1
|
||||
</test>
|
||||
<test value="/controls/flight/aileron">
|
||||
/controls/flight/aileron-drives-tiller eq 1
|
||||
</test>
|
||||
<test value="fbw/fmgc/yaw-cmd">
|
||||
</switch>
|
||||
|
||||
<scheduled_gain name="fbw/tiller-handle-scheduled">
|
||||
<input>/controls/gear/steering-switched</input>
|
||||
<table>
|
||||
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
|
||||
<independentVar lookup="column">/systems/acconfig/options/seperate-tiller-axis</independentVar>
|
||||
<tableData>
|
||||
0 1
|
||||
0.5 0 0
|
||||
1.0 1 1
|
||||
20.0 1 1
|
||||
70.0 0 1
|
||||
</tableData>
|
||||
</table>
|
||||
</scheduled_gain>
|
||||
|
||||
<lag_filter name="fbw/tiller-handle">
|
||||
<input>fbw/tiller-handle-scheduled</input>
|
||||
<c1>20</c1>
|
||||
</lag_filter>
|
||||
|
||||
<pure_gain name="/controls/gear/steering-deg">
|
||||
<input>/controls/gear/steering</input>
|
||||
<gain>75</gain>
|
||||
</pure_gain>
|
||||
|
||||
<pure_gain name="hydraulics/tiller/autopush-cmd-deg">
|
||||
<input>hydraulics/tiller/autopush-cmd</input>
|
||||
<gain>75</gain>
|
||||
</pure_gain>
|
||||
|
||||
<scheduled_gain name="hydraulics/tiller/fmgc-cmd-deg">
|
||||
<input>fbw/fmgc/yaw-cmd</input>
|
||||
<table>
|
||||
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
|
||||
<tableData>
|
||||
0.5 0
|
||||
1.0 6
|
||||
40.0 6
|
||||
130.0 0
|
||||
</tableData>
|
||||
</table>
|
||||
</scheduled_gain>
|
||||
|
||||
<switch name="hydraulics/tiller/rudder-cmd-input">
|
||||
<default value="/controls/flight/rudder"/>
|
||||
<test value="/controls/flight/aileron">
|
||||
/controls/flight/aileron-drives-tiller eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<pure_gain name="hydraulics/tiller/rudder-cmd-input-deg">
|
||||
<input>hydraulics/tiller/rudder-cmd-input</input>
|
||||
<gain>75</gain>
|
||||
</pure_gain>
|
||||
|
||||
<fcs_function name="hydraulics/tiller/rudder-cmd-deg"> <!-- Combines rudder and tiller into just rudder -->
|
||||
<function>
|
||||
<table>
|
||||
<independentVar lookup="row">zero</independentVar> <!-- Take advantage of the table lookup to interpolate -->
|
||||
<independentVar lookup="column">hydraulics/tiller/rudder-cmd-input-deg</independentVar>
|
||||
<independentVar lookup="table">/velocities/groundspeed-kt</independentVar>
|
||||
<tableData breakPoint="0.5">
|
||||
-75 -66 -40 -20 -1 1 20 40 66 75
|
||||
0 0 0 0 0 0 0 0 0 0 0
|
||||
1 0 0 0 0 0 0 0 0 0 0
|
||||
</tableData>
|
||||
<tableData breakPoint="1.0">
|
||||
-75 -66 -40 -20 -1 1 20 40 66 75
|
||||
0 -75 -45 -15 -4 0 0 4 15 45 75
|
||||
1 -75 -45 -15 -4 0 0 4 15 45 75
|
||||
</tableData>
|
||||
<tableData breakPoint="20.0">
|
||||
-75 -66 -40 -20 -1 1 20 40 66 75
|
||||
0 -75 -45 -15 -4 0 0 4 15 45 75
|
||||
1 -75 -45 -15 -4 0 0 4 15 45 75
|
||||
</tableData>
|
||||
<tableData breakPoint="40.0">
|
||||
-75 0 75
|
||||
0 -6 0 6
|
||||
1 -6 0 6
|
||||
</tableData>
|
||||
<tableData breakPoint="130.0">
|
||||
-75 0 75
|
||||
0 0 0 0
|
||||
1 0 0 0
|
||||
</tableData>
|
||||
</table>
|
||||
</function>
|
||||
</fcs_function>
|
||||
|
||||
<fcs_function name="hydraulics/tiller/tiller-cmd-deg">
|
||||
<function>
|
||||
<sum>
|
||||
<table>
|
||||
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
|
||||
<independentVar lookup="column">/controls/gear/steering-deg</independentVar>
|
||||
<tableData>
|
||||
-75 -66 -40 -20 -1 1 20 40 66 75
|
||||
0.5 0 0 0 0 0 0 0 0 0 0
|
||||
1.0 -75 -45 -15 -4 0 0 4 15 45 75
|
||||
20.0 -75 -45 -15 -4 0 0 4 15 45 75
|
||||
70.0 0 0 0 0 0 0 0 0 0 0
|
||||
</tableData>
|
||||
</table>
|
||||
<product>
|
||||
<property>hydraulics/tiller/rudder-cmd-input</property>
|
||||
<table>
|
||||
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
|
||||
<tableData>
|
||||
0.5 0
|
||||
1.0 6
|
||||
40.0 6
|
||||
130.0 0
|
||||
</tableData>
|
||||
</table>
|
||||
</product>
|
||||
</sum>
|
||||
</function>
|
||||
</fcs_function>
|
||||
|
||||
<switch name="hydraulics/tiller/cmd-deg">
|
||||
<default value="hydraulics/tiller/rudder-cmd-deg"/>
|
||||
<test value="0">
|
||||
/gear/gear[0]/wow ne 1
|
||||
</test>
|
||||
<test value="hydraulics/tiller/autopush-cmd-deg">
|
||||
/sim/model/autopush/connected eq 1
|
||||
</test>
|
||||
<test value="hydraulics/tiller/fmgc-cmd-deg">
|
||||
fbw/fmgc/enabled eq 1
|
||||
</test>
|
||||
<test value="hydraulics/tiller/tiller-cmd-deg">
|
||||
/systems/acconfig/options/seperate-tiller-axis eq 1
|
||||
</test>
|
||||
<clipto>
|
||||
<min>-75</min>
|
||||
<max>75</max>
|
||||
</clipto>
|
||||
</switch>
|
||||
|
||||
<switch name="hydraulics/tiller/elec-pwr">
|
||||
|
@ -748,56 +890,26 @@
|
|||
/systems/hydraulic/yellow-psi ge 1500
|
||||
/sim/model/autopush/connected eq 0
|
||||
/controls/gear/nws-switch eq 1
|
||||
/engines/engine[0]/state eq 3
|
||||
</test>
|
||||
<test logic="AND" value="1">
|
||||
position/wow eq 1
|
||||
hydraulics/tiller/elec-pwr eq 1
|
||||
/systems/hydraulic/yellow-psi ge 1500
|
||||
/sim/model/autopush/connected eq 0
|
||||
/controls/gear/nws-switch eq 1
|
||||
/engines/engine[1]/state eq 3
|
||||
<test logic="OR">
|
||||
/engines/engine[0]/state eq 3
|
||||
/engines/engine[1]/state eq 3
|
||||
</test>
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<fcs_function name="hydraulics/tiller/function">
|
||||
<function>
|
||||
<ifthen>
|
||||
<eq>
|
||||
<property>/sim/model/autopush/connected</property>
|
||||
<value>1</value>
|
||||
</eq>
|
||||
<product>
|
||||
<property>hydraulics/tiller/autopush-cmd</property>
|
||||
<value>75</value>
|
||||
</product>
|
||||
<table>
|
||||
<independentVar lookup="row">/velocities/groundspeed-kt</independentVar>
|
||||
<independentVar lookup="column">hydraulics/tiller/switch</independentVar>
|
||||
<tableData>
|
||||
-1 0 1
|
||||
0.500 0 0 0
|
||||
1.000 -75 0 75
|
||||
30.000 -47 0 47
|
||||
30.001 -6 0 6
|
||||
135.000 0 0 0
|
||||
</tableData>
|
||||
</table>
|
||||
</ifthen>
|
||||
</function>
|
||||
</fcs_function>
|
||||
|
||||
<switch name="fcs/steer-rate">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="12">
|
||||
hydraulics/tiller/hyd-pwr eq 1
|
||||
<test logic="OR" value="75">
|
||||
/sim/model/autopush/connected eq 1
|
||||
/systems/acconfig/autoconfig-running eq 1
|
||||
</test>
|
||||
<test logic="OR" value="12">
|
||||
hydraulics/tiller/hyd-pwr eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<actuator name="fcs/steer-deg">
|
||||
<input>hydraulics/tiller/function</input>
|
||||
<input>hydraulics/tiller/cmd-deg</input>
|
||||
<rate_limit>fcs/steer-rate</rate_limit>
|
||||
<output>fcs/steer-pos-deg[0]</output>
|
||||
</actuator>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<channel name="Fuel Pumps and Valves">
|
||||
<!-- Pumps -->
|
||||
|
||||
<switch name="/systems/fuel/pumps/apu-operate">
|
||||
<switch name="/systems/fuel/pumps/apu-operate"> <!-- DC HOT 1 ? -->
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/systems/fuel/pumps/all-eng-pump-off eq 1
|
||||
|
|
|
@ -411,7 +411,7 @@
|
|||
</expression>
|
||||
</input>
|
||||
<input>0</input>
|
||||
<output>/sim/sound/cockpit/buzz-1-v</output>
|
||||
<output>/sim/sound/cockpit/buzz-1-p</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
|
|
|
@ -247,11 +247,11 @@
|
|||
<tcas>
|
||||
<name>tcas</name>
|
||||
<number>0</number>
|
||||
<!--<vertical-range-ft>9900</vertical-range-ft>
|
||||
<vertical-range-ft>9900</vertical-range-ft>
|
||||
<lateral-range-nm>30</lateral-range-nm>
|
||||
<intruder-use-own-alt>1</intruder-use-own-alt>
|
||||
<intruder-inhibit-alt-ft>380</intruder-inhibit-alt-ft>
|
||||
<intruder-minimum-own-alt-ft>1700</intruder-minimum-own-alt-ft> uncomment for 2019.3 -->
|
||||
<intruder-minimum-own-alt-ft>1700</intruder-minimum-own-alt-ft>
|
||||
</tcas>
|
||||
|
||||
<radar>
|
||||
|
|
|
@ -508,6 +508,16 @@
|
|||
<legend>AIR</legend>
|
||||
<pref-height>25</pref-height>
|
||||
<pref-width>40</pref-width>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>mcdu.pagebutton("airport", 0);</script>
|
||||
<condition>
|
||||
<greater-than-equals>
|
||||
<property>systems/electrical/bus/ac-1</property>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
</condition>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
|
|
|
@ -508,6 +508,23 @@
|
|||
<legend>AIR</legend>
|
||||
<pref-height>25</pref-height>
|
||||
<pref-width>40</pref-width>
|
||||
<button>
|
||||
<row>0</row>
|
||||
<col>0</col>
|
||||
<legend>AIR</legend>
|
||||
<pref-height>25</pref-height>
|
||||
<pref-width>40</pref-width>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>mcdu.pagebutton("airport", 1);</script>
|
||||
<condition>
|
||||
<greater-than-equals>
|
||||
<property>systems/electrical/bus/ac-2</property>
|
||||
<value>110</value>
|
||||
</greater-than-equals>
|
||||
</condition>
|
||||
</binding>
|
||||
</button>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
|
|
|
@ -1 +1 @@
|
|||
34
|
||||
37
|