1
0
Fork 0

Merge branch 'dev' into fuel-prediction

This commit is contained in:
legoboyvdlp R 2020-05-22 14:41:13 +01:00
commit 01a05e3194
13 changed files with 310 additions and 324 deletions

View file

@ -3954,7 +3954,6 @@
<file>Aircraft/A320-family/Nasal/Libraries/buttons.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/shake.nas</file>
<file>Aircraft/A320-family/Nasal/Libraries/zoom-views.nas</file> <file>Aircraft/A320-family/Nasal/Libraries/zoom-views.nas</file>
<file>Aircraft/A320-family/Nasal/Libraries/efis.nas</file>
</libraries> </libraries>
<acconfig> <acconfig>
<file>Aircraft/A320-family/AircraftConfig/acconfig.nas</file> <file>Aircraft/A320-family/AircraftConfig/acconfig.nas</file>
@ -3998,6 +3997,7 @@
</fbw> </fbw>
<fcu> <fcu>
<file>Aircraft/A320-family/Nasal/FMGC/FCU.nas</file> <file>Aircraft/A320-family/Nasal/FMGC/FCU.nas</file>
<file>Aircraft/A320-family/Nasal/Panels/efis.nas</file>
</fcu> </fcu>
<fmgc> <fmgc>
<file>Aircraft/A320-family/Nasal/FMGC/flightplan-waypoints.nas</file> <file>Aircraft/A320-family/Nasal/FMGC/flightplan-waypoints.nas</file>

View file

@ -11,61 +11,35 @@
<condition> <condition>
<and> <and>
<or> <greater-than-equals>
<greater-than-equals> <expression>
<expression> <sum>
<sum> <product>
<product> <property>environment/relative-humidity</property>
<property>environment/relative-humidity</property> <value>0.075</value>
<value>0.1</value> </product>
</product> <property>fdm/jsbsim/aero/alpha-deg</property>
<property>systems/navigation/adr/output/aoa-1</property> </sum>
</sum> </expression>
</expression> <value>13.5</value>
<value>13.5</value> </greater-than-equals>
</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> <greater-than>
<property>velocities/groundspeed-kt</property> <property>velocities/groundspeed-kt</property>
<value>100</value> <value>100</value>
</greater-than> </greater-than>
<less-than> <less-than>
<property>velocities/groundspeed-kt</property> <property>velocities/groundspeed-kt</property>
<value>210</value> <value>210</value>
</less-than> </less-than>
<greater-than> <greater-than>
<property>environment/relative-humidity</property> <property>environment/relative-humidity</property>
<value>50</value> <value>50</value>
</greater-than> </greater-than>
<less-than-equals> <less-than-equals>
<property>environment/temperature-degc</property> <property>environment/temperature-degc</property>
<value>28</value> <value>28</value>
</less-than-equals> </less-than-equals>
<greater-than> <greater-than>
<property>position/altitude-agl-ft</property> <property>position/altitude-agl-ft</property>
<value>0</value> <value>0</value>
</greater-than> </greater-than>
@ -73,20 +47,10 @@
<property>position/altitude-agl-ft</property> <property>position/altitude-agl-ft</property>
<value>8000</value> <value>8000</value>
</less-than> </less-than>
<or> <greater-than>
<greater-than> <property>fdm/jsbsim/aero/alpha-deg</property>
<property>systems/navigation/adr/output/aoa-1</property> <value>0</value>
<value>0</value> </greater-than>
</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>
</and> </and>
</condition> </condition>
@ -109,49 +73,49 @@
</vertex> </vertex>
</placer> </placer>
<shooter> <shooter>
<theta-min-deg> <theta-min-deg>
<!-- <expression> <!-- <expression>
<sum> <sum>
<value>70</value> <value>70</value>
<property>systems/navigation/adr/output/aoa-1</property> <property>systems/navigation/adr/output/aoa-1</property>
</sum> </sum>
</expression> --> </expression> -->
<value>90</value> <value>90</value>
</theta-min-deg> </theta-min-deg>
<theta-max-deg> <theta-max-deg>
<!-- <expression> <!-- <expression>
<sum> <sum>
<value>110</value> <value>110</value>
<property>systems/navigation/adr/output/aoa-1</property> <property>systems/navigation/adr/output/aoa-1</property>
</sum> </sum>
</expression> --> </expression> -->
<value>90</value> <value>90</value>
</theta-max-deg> </theta-max-deg>
<phi-min-deg>90</phi-min-deg> <phi-min-deg>90</phi-min-deg>
<phi-max-deg>90</phi-max-deg> <phi-max-deg>90</phi-max-deg>
<speed-mps> <speed-mps>
<!-- <expression> <!-- <expression>
<product> <product>
<property>velocities/groundspeed-kt</property> <property>velocities/groundspeed-kt</property>
<value>-1</value> <value>-1</value>
</product> </product>
</expression> --> </expression> -->
<value>0</value> <value>0</value>
<spread>0</spread> <spread>0</spread>
</speed-mps> </speed-mps>
<rotation-speed> <rotation-speed>
<x-max-deg-sec>180</x-max-deg-sec> <x-max-deg-sec>180</x-max-deg-sec>
<x-min-deg-sec>180</x-min-deg-sec> <x-min-deg-sec>180</x-min-deg-sec>
<y-max-deg-sec>180</y-max-deg-sec> <y-max-deg-sec>180</y-max-deg-sec>
<y-min-deg-sec>-180</y-min-deg-sec> <y-min-deg-sec>-180</y-min-deg-sec>
<z-max-deg-sec>-180</z-max-deg-sec> <z-max-deg-sec>-180</z-max-deg-sec>
<z-min-deg-sec>-180</z-min-deg-sec> <z-min-deg-sec>-180</z-min-deg-sec>
</rotation-speed> </rotation-speed>
</shooter> </shooter>
<counter> <counter>
<particles-per-sec> <particles-per-sec>
<expression> <expression>
<product> <product>
<value>4</value> <value>4</value>
@ -159,13 +123,13 @@
</product> </product>
</expression> </expression>
<spread>10</spread> <spread>10</spread>
</particles-per-sec> </particles-per-sec>
</counter> </counter>
<align>billboard</align> <align>billboard</align>
<particle> <particle>
<start> <start>
<color> <color>
<red> <red>
<expression> <expression>
@ -203,8 +167,8 @@
<size> <size>
<value>1.5</value> <value>1.5</value>
</size> </size>
</start> </start>
<end> <end>
<color> <color>
<red> <red>
<expression> <expression>
@ -239,22 +203,22 @@
</expression> </expression>
</alpha> </alpha>
</color> </color>
<size> <size>
<value>2</value> <value>2</value>
</size> </size>
</end> </end>
<life-sec> <life-sec>
<value>0.00001</value> <value>0.00001</value>
</life-sec> </life-sec>
<mass-kg>0.025</mass-kg> <mass-kg>0.025</mass-kg>
<radius-m>0.175</radius-m> <radius-m>0.175</radius-m>
</particle> </particle>
<program> <program>
<fluid>air</fluid> <fluid>air</fluid>
<gravity>true</gravity> <gravity>true</gravity>
<wind>true</wind> <wind>true</wind>
</program> </program>
</particlesystem> </particlesystem>

View file

@ -11,61 +11,35 @@
<condition> <condition>
<and> <and>
<or> <greater-than-equals>
<greater-than-equals> <expression>
<expression> <sum>
<sum> <product>
<product> <property>environment/relative-humidity</property>
<property>environment/relative-humidity</property> <value>0.075</value>
<value>0.1</value> </product>
</product> <property>fdm/jsbsim/aero/alpha-deg</property>
<property>systems/navigation/adr/output/aoa-1</property> </sum>
</sum> </expression>
</expression> <value>13.5</value>
<value>13.5</value> </greater-than-equals>
</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> <greater-than>
<property>velocities/groundspeed-kt</property> <property>velocities/groundspeed-kt</property>
<value>100</value> <value>100</value>
</greater-than> </greater-than>
<less-than> <less-than>
<property>velocities/groundspeed-kt</property> <property>velocities/groundspeed-kt</property>
<value>210</value> <value>210</value>
</less-than> </less-than>
<greater-than> <greater-than>
<property>environment/relative-humidity</property> <property>environment/relative-humidity</property>
<value>50</value> <value>50</value>
</greater-than> </greater-than>
<less-than-equals> <less-than-equals>
<property>environment/temperature-degc</property> <property>environment/temperature-degc</property>
<value>28</value> <value>28</value>
</less-than-equals> </less-than-equals>
<greater-than> <greater-than>
<property>position/altitude-agl-ft</property> <property>position/altitude-agl-ft</property>
<value>0</value> <value>0</value>
</greater-than> </greater-than>
@ -73,20 +47,10 @@
<property>position/altitude-agl-ft</property> <property>position/altitude-agl-ft</property>
<value>8000</value> <value>8000</value>
</less-than> </less-than>
<or> <greater-than>
<greater-than> <property>fdm/jsbsim/aero/alpha-deg</property>
<property>systems/navigation/adr/output/aoa-1</property> <value>0</value>
<value>0</value> </greater-than>
</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>
</and> </and>
</condition> </condition>
@ -109,49 +73,49 @@
</vertex> </vertex>
</placer> </placer>
<shooter> <shooter>
<theta-min-deg> <theta-min-deg>
<!-- <expression> <!-- <expression>
<sum> <sum>
<value>70</value> <value>70</value>
<property>systems/navigation/adr/output/aoa-1</property> <property>systems/navigation/adr/output/aoa-1</property>
</sum> </sum>
</expression> --> </expression> -->
<value>90</value> <value>90</value>
</theta-min-deg> </theta-min-deg>
<theta-max-deg> <theta-max-deg>
<!-- <expression> <!-- <expression>
<sum> <sum>
<value>110</value> <value>110</value>
<property>systems/navigation/adr/output/aoa-1</property> <property>systems/navigation/adr/output/aoa-1</property>
</sum> </sum>
</expression> --> </expression> -->
<value>90</value> <value>90</value>
</theta-max-deg> </theta-max-deg>
<phi-min-deg>90</phi-min-deg> <phi-min-deg>90</phi-min-deg>
<phi-max-deg>90</phi-max-deg> <phi-max-deg>90</phi-max-deg>
<speed-mps> <speed-mps>
<!-- <expression> <!-- <expression>
<product> <product>
<property>velocities/groundspeed-kt</property> <property>velocities/groundspeed-kt</property>
<value>-1</value> <value>-1</value>
</product> </product>
</expression> --> </expression> -->
<value>0</value> <value>0</value>
<spread>0</spread> <spread>0</spread>
</speed-mps> </speed-mps>
<rotation-speed> <rotation-speed>
<x-max-deg-sec>180</x-max-deg-sec> <x-max-deg-sec>180</x-max-deg-sec>
<x-min-deg-sec>180</x-min-deg-sec> <x-min-deg-sec>180</x-min-deg-sec>
<y-max-deg-sec>180</y-max-deg-sec> <y-max-deg-sec>180</y-max-deg-sec>
<y-min-deg-sec>-180</y-min-deg-sec> <y-min-deg-sec>-180</y-min-deg-sec>
<z-max-deg-sec>-180</z-max-deg-sec> <z-max-deg-sec>-180</z-max-deg-sec>
<z-min-deg-sec>-180</z-min-deg-sec> <z-min-deg-sec>-180</z-min-deg-sec>
</rotation-speed> </rotation-speed>
</shooter> </shooter>
<counter> <counter>
<particles-per-sec> <particles-per-sec>
<expression> <expression>
<product> <product>
<value>4</value> <value>4</value>
@ -159,13 +123,13 @@
</product> </product>
</expression> </expression>
<spread>10</spread> <spread>10</spread>
</particles-per-sec> </particles-per-sec>
</counter> </counter>
<align>billboard</align> <align>billboard</align>
<particle> <particle>
<start> <start>
<color> <color>
<red> <red>
<expression> <expression>
@ -203,8 +167,8 @@
<size> <size>
<value>1.5</value> <value>1.5</value>
</size> </size>
</start> </start>
<end> <end>
<color> <color>
<red> <red>
<expression> <expression>
@ -239,22 +203,22 @@
</expression> </expression>
</alpha> </alpha>
</color> </color>
<size> <size>
<value>2</value> <value>2</value>
</size> </size>
</end> </end>
<life-sec> <life-sec>
<value>0.00001</value> <value>0.00001</value>
</life-sec> </life-sec>
<mass-kg>0.025</mass-kg> <mass-kg>0.025</mass-kg>
<radius-m>0.175</radius-m> <radius-m>0.175</radius-m>
</particle> </particle>
<program> <program>
<fluid>air</fluid> <fluid>air</fluid>
<gravity>true</gravity> <gravity>true</gravity>
<wind>true</wind> <wind>true</wind>
</program> </program>
</particlesystem> </particlesystem>

View file

@ -3262,9 +3262,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis/inputs/CSTR") != 1) { if (getprop("instrumentation/efis/inputs/CSTR") != 1) {
libraries.cpt_efis_btns("cstr"); fcu.cpt_efis_btns("cstr");
} else { } else {
libraries.cpt_efis_btns("off"); fcu.cpt_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3304,9 +3304,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis[1]/inputs/CSTR") != 1) { if (getprop("instrumentation/efis[1]/inputs/CSTR") != 1) {
libraries.fo_efis_btns("cstr"); fcu.fo_efis_btns("cstr");
} else { } else {
libraries.fo_efis_btns("off"); fcu.fo_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3346,9 +3346,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis/inputs/wpt") != 1) { if (getprop("instrumentation/efis/inputs/wpt") != 1) {
libraries.cpt_efis_btns("wpt"); fcu.cpt_efis_btns("wpt");
} else { } else {
libraries.cpt_efis_btns("off"); fcu.cpt_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3388,9 +3388,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis[1]/inputs/wpt") != 1) { if (getprop("instrumentation/efis[1]/inputs/wpt") != 1) {
libraries.fo_efis_btns("wpt"); fcu.fo_efis_btns("wpt");
} else { } else {
libraries.fo_efis_btns("off"); fcu.fo_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3430,9 +3430,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis/inputs/VORD") != 1) { if (getprop("instrumentation/efis/inputs/VORD") != 1) {
libraries.cpt_efis_btns("vord"); fcu.cpt_efis_btns("vord");
} else { } else {
libraries.cpt_efis_btns("off"); fcu.cpt_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3472,9 +3472,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis[1]/inputs/VORD") != 1) { if (getprop("instrumentation/efis[1]/inputs/VORD") != 1) {
libraries.fo_efis_btns("vord"); fcu.fo_efis_btns("vord");
} else { } else {
libraries.fo_efis_btns("off"); fcu.fo_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3514,9 +3514,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis/inputs/NDB") != 1) { if (getprop("instrumentation/efis/inputs/NDB") != 1) {
libraries.cpt_efis_btns("ndb"); fcu.cpt_efis_btns("ndb");
} else { } else {
libraries.cpt_efis_btns("off"); fcu.cpt_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3556,9 +3556,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis[1]/inputs/NDB") != 1) { if (getprop("instrumentation/efis[1]/inputs/NDB") != 1) {
libraries.fo_efis_btns("ndb"); fcu.fo_efis_btns("ndb");
} else { } else {
libraries.fo_efis_btns("off"); fcu.fo_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3598,9 +3598,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis/inputs/arpt") != 1) { if (getprop("instrumentation/efis/inputs/arpt") != 1) {
libraries.cpt_efis_btns("arpt"); fcu.cpt_efis_btns("arpt");
} else { } else {
libraries.cpt_efis_btns("off"); fcu.cpt_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3640,9 +3640,9 @@
<command>nasal</command> <command>nasal</command>
<script> <script>
if (getprop("instrumentation/efis[1]/inputs/arpt") != 1) { if (getprop("instrumentation/efis[1]/inputs/arpt") != 1) {
libraries.fo_efis_btns("arpt"); fcu.fo_efis_btns("arpt");
} else { } else {
libraries.fo_efis_btns("off"); fcu.fo_efis_btns("off");
} }
setprop("sim/sounde/btn1", 1); setprop("sim/sounde/btn1", 1);
</script> </script>
@ -3675,7 +3675,7 @@
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.setCptND(1);</script> <script>fcu.setCptND(1);</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -3684,7 +3684,7 @@
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.setCptND(-1);</script> <script>fcu.setCptND(-1);</script>
</binding> </binding>
</action> </action>
</animation> </animation>
@ -3713,7 +3713,7 @@
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.setFoND(1);</script> <script>fcu.setFoND(1);</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -3722,7 +3722,7 @@
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.setFoND(-1);</script> <script>fcu.setFoND(-1);</script>
</binding> </binding>
</action> </action>
</animation> </animation>
@ -3751,7 +3751,7 @@
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.setNDRange(0, 1);</script> <script>fcu.setNDRange(0, 1);</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -3760,7 +3760,7 @@
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.setNDRange(0, -1);</script> <script>fcu.setNDRange(0, -1);</script>
</binding> </binding>
</action> </action>
</animation> </animation>
@ -3790,7 +3790,7 @@
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.setNDRange(1, 1);</script> <script>fcu.setNDRange(1, 1);</script>
</binding> </binding>
</action> </action>
<action> <action>
@ -3799,7 +3799,7 @@
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>libraries.setNDRange(1, -1);</script> <script>fcu.setNDRange(1, -1);</script>
</binding> </binding>
</action> </action>
</animation> </animation>

View file

@ -56,6 +56,14 @@ var flightPlanController = {
_timeTemp: nil, _timeTemp: nil,
_altTemp: 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() { reset: func() {
me.temporaryFlag[0] = 0; me.temporaryFlag[0] = 0;
me.temporaryFlag[1] = 0; me.temporaryFlag[1] = 0;
@ -208,8 +216,11 @@ var flightPlanController = {
# Check if a discontinuity already exists either immediately before or at that index # Check if a discontinuity already exists either immediately before or at that index
# If it does, don't add another one # If it does, don't add another one
# Optional flag DEBUG_DISCONT to disable discontinuities totally # Optional flag DEBUG_DISCONT to disable discontinuities totally
addDiscontinuity: func(index, plan) { addDiscontinuity: func(index, plan, force = 0) {
if (DEBUG_DISCONT) { return; } if (DEBUG_DISCONT) { return; }
if (force) {
me.flightplans[plan].insertWP(createDiscontinuity(), index);
}
if (index > 0) { if (index > 0) {
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY" and me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") { 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); me.flightplans[plan].insertWP(createDiscontinuity(), index);
@ -231,6 +242,10 @@ var flightPlanController = {
me.flightplans[n].insertWP(createWP(geo.aircraft_position(), "T-P"), index); 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 # childWPBearingDistance - return waypoint at bearing and distance from specified waypoint ghost
# args: wpt, bearing, dist, name, typeStr # args: wpt, bearing, dist, name, typeStr
# wpt: waypoint ghost # wpt: waypoint ghost

View file

@ -222,6 +222,7 @@ var systemsInit = func {
atc.init(); atc.init();
fcu.FCUController.init(); fcu.FCUController.init();
dmc.DMController.init(); dmc.DMController.init();
fmgc.flightPlanController.init();
} }
setlistener("/sim/signals/fdm-initialized", func { setlistener("/sim/signals/fdm-initialized", func {

View file

@ -80,9 +80,11 @@ var arrivalPage = {
} }
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) { if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
me.selectedSTAR = fmgc.flightPlanController.flightplans[me.computer].star; me.selectedSTAR = fmgc.flightPlanController.flightplans[me.computer].star;
me.selectedTransition = fmgc.flightPlanController.flightplans[me.computer].star_trans;
isNoStar[me.computer] = 0; isNoStar[me.computer] = 0;
} elsif (fmgc.flightPlanController.flightplans[2].star != nil) { } elsif (fmgc.flightPlanController.flightplans[2].star != nil) {
me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star; me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star;
me.selectedTransition = fmgc.flightPlanController.flightplans[2].star_trans;
isNoStar[me.computer] = 0; isNoStar[me.computer] = 0;
} elsif (isNoStar[me.computer] == 1) { } elsif (isNoStar[me.computer] == 1) {
me.selectedSTAR = "NO STAR"; me.selectedSTAR = "NO STAR";

View file

@ -77,9 +77,11 @@ var departurePage = {
} }
if (fmgc.flightPlanController.flightplans[me.computer].sid != nil) { if (fmgc.flightPlanController.flightplans[me.computer].sid != nil) {
me.selectedSID = fmgc.flightPlanController.flightplans[me.computer].sid; me.selectedSID = fmgc.flightPlanController.flightplans[me.computer].sid;
me.selectedTransition = fmgc.flightPlanController.flightplans[me.computer].sid_trans;
isNoSid[me.computer] = 0; isNoSid[me.computer] = 0;
} elsif (fmgc.flightPlanController.flightplans[2].sid != nil) { } elsif (fmgc.flightPlanController.flightplans[2].sid != nil) {
me.selectedSID = fmgc.flightPlanController.flightplans[2].sid; me.selectedSID = fmgc.flightPlanController.flightplans[2].sid;
me.selectedTransition = fmgc.flightPlanController.flightplans[2].sid_trans;
isNoSid[me.computer] = 0; isNoSid[me.computer] = 0;
} elsif (isNoSid[me.computer] == 1) { } elsif (isNoSid[me.computer] == 1) {
me.selectedSID = "NO SID"; me.selectedSID = "NO SID";
@ -196,7 +198,7 @@ var departurePage = {
me.R1 = ["-------", "TRANS ", "wht"]; me.R1 = ["-------", "TRANS ", "wht"];
} }
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid_trans != nil) { } 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 { } else {
me.R1 = ["-------", "TRANS ", "wht"]; me.R1 = ["-------", "TRANS ", "wht"];
} }
@ -558,7 +560,7 @@ var departurePage = {
if (!dirToFlag) { if (!dirToFlag) {
me.selectedTransition = me.transitions[index - 2]; me.selectedTransition = me.transitions[index - 2];
me.makeTmpy(); 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.updateActiveTransitions();
me.updateTransitions(); me.updateTransitions();
fmgc.flightPlanController.flightPlanChanged(me.computer); fmgc.flightPlanController.flightPlanChanged(me.computer);

View file

@ -168,7 +168,8 @@ var initInputA = func(key, i) {
setprop("/FMGC/internal/fuel-calculating", 0); setprop("/FMGC/internal/fuel-calculating", 0);
setprop("/FMGC/internal/fuel-calculating", 1); setprop("/FMGC/internal/fuel-calculating", 1);
} }
fmgc.flightPlanController.reset(); fmgc.flightPlanController.reset(2);
fmgc.flightPlanController.init();
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0); setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
mcdu.clearScratchpad(i); mcdu.clearScratchpad(i);
#} else if (scratchpad == "") { #} else if (scratchpad == "") {

View file

@ -772,42 +772,33 @@ var pagebutton = func(btn, i) {
setprop("/MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM"); setprop("/MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
setprop("/MCDU[" ~ i ~ "]/page", "MCDU"); setprop("/MCDU[" ~ i ~ "]/page", "MCDU");
} else if (btn == "f-pln" or btn == "airport") { } else if (btn == "f-pln" or btn == "airport") {
if (fmgc.flightPlanController.active.getBoolValue()) { if (canvas_mcdu.myFpln[i] == nil) {
if (canvas_mcdu.myFpln[i] == nil) { canvas_mcdu.myFpln[i] = fplnPage.new(2, i);
canvas_mcdu.myFpln[i] = fplnPage.new(2, i); }
} if (btn == "airport") {
if (btn == "airport") { if (getprop("FMGC/status/phase") == 0 or getprop("FMGC/status/phase") == 1) {
if (getprop("FMGC/status/phase") == 0 or getprop("FMGC/status/phase") == 1) { canvas_mcdu.myFpln[i].scroll = 0;
canvas_mcdu.myFpln[i].scroll = 0; } else {
if (fmgc.flightPlanController.temporaryFlag[i]) {
canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[i];
} else { } else {
if (fmgc.flightPlanController.temporaryFlag[i]) { canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[2];
canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[i];
} else {
canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[2];
}
} }
} }
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
} else {
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("/MCDU[" ~ i ~ "]/scratchpad", "ERROR. INITIALIZE ROUTE"); # Should be ERROR:, but the : character doesn't show in our MCDU font right now...
} }
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
} else if (btn == "fuel-pred") { } else if (btn == "fuel-pred") {
setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED"); setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED");
} else if (btn == "dirto") { } else if (btn == "dirto") {
if (fmgc.flightPlanController.active.getBoolValue()) { if (fmgc.flightPlanController.temporaryFlag[i] and !dirToFlag) {
if (fmgc.flightPlanController.temporaryFlag[i] and !dirToFlag) {
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("/MCDU[" ~ i ~ "]/scratchpad", "INSRT / ERASE TMPY FIRST");
return;
} elsif (canvas_mcdu.myDirTo[i] == nil) {
canvas_mcdu.myDirTo[i] = dirTo.new(i);
}
setprop("/MCDU[" ~ i ~ "]/page", "DIRTO");
} else {
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1); setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("/MCDU[" ~ i ~ "]/scratchpad", "ERROR. INITIALIZE ROUTE"); # Should be ERROR:, but the : character doesn't show in our MCDU font right now... setprop("/MCDU[" ~ i ~ "]/scratchpad", "INSRT / ERASE TMPY FIRST");
return;
} elsif (canvas_mcdu.myDirTo[i] == nil) {
canvas_mcdu.myDirTo[i] = dirTo.new(i);
} }
setprop("/MCDU[" ~ i ~ "]/page", "DIRTO");
} }
} }
} }

View file

@ -82,7 +82,7 @@ var perfAPPRInput = func(key, i) {
setprop("/FMGC/internal/vapp-speed-set", 0); setprop("/FMGC/internal/vapp-speed-set", 0);
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0); setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
mcdu.clearScratchpad(i); mcdu.clearScratchpad(i);
} else if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 200) { } else if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
setprop("/FMGC/internal/vapp-speed-set", 1); setprop("/FMGC/internal/vapp-speed-set", 1);
setprop("/FMGC/internal/computed-speeds/vapp_appr", scratchpad); setprop("/FMGC/internal/computed-speeds/vapp_appr", scratchpad);
mcdu.clearScratchpad(i); mcdu.clearScratchpad(i);

View file

@ -7,32 +7,56 @@
# NOTE: This is just temporary until FG allows a full implementation of the audio system. # 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 vhf1_capt_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 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 vhf1_fo_recive = props.globals.initNode("/controls/audio/acp[1]/vhf1-recive", 1, "BOOL");
var vhf2_volume = props.globals.initNode("/controls/audio/acp[0]/vhf2-volume", 1, "DOUBLE"); 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 com1_volume = props.globals.getNode("instrumentation/comm[0]/volume");
var com2_volume = props.globals.getNode("instrumentation/comm[1]/volume"); var com2_volume = props.globals.getNode("instrumentation/comm[1]/volume");
var init = func() { var init = func() {
vhf1_recive.setValue(1); vhf1_capt_recive.setValue(1);
vhf2_recive.setValue(1); vhf2_capt_recive.setValue(1);
vhf1_volume.setValue(1); vhf1_capt_volume.setValue(1);
vhf2_volume.setValue(0.8); 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) { var update_com1 = func() {
if (com_no == 0) { if (getprop("systems/acconfig/options/fo-view") == 1) {
if (vhf1_recive.getValue()) { if (vhf1_fo_recive.getValue()) {
com1_volume.setValue(vhf1_volume.getValue()); com1_volume.setValue(vhf1_fo_volume.getValue());
} else { } else {
com1_volume.setValue(0); com1_volume.setValue(0);
} }
} else if (com_no == 1) { } else {
if (vhf2_recive.getValue()) { if (vhf1_capt_recive.getValue()) {
com2_volume.setValue(vhf2_volume.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 { } else {
com2_volume.setValue(0); com2_volume.setValue(0);
} }
@ -40,17 +64,39 @@ var update_instruments = func(com_no) {
} }
setlistener("/controls/audio/acp[0]/vhf1-recive", func { setlistener("/controls/audio/acp[0]/vhf1-recive", func {
update_instruments(0); update_com1();
}); });
setlistener("/controls/audio/acp[0]/vhf1-volume", func { setlistener("/controls/audio/acp[0]/vhf1-volume", func {
update_instruments(0); update_com1();
}); });
setlistener("/controls/audio/acp[0]/vhf2-recive", func { setlistener("/controls/audio/acp[0]/vhf2-recive", func {
update_instruments(1); update_com2();
}); });
setlistener("/controls/audio/acp[0]/vhf2-volume", func { 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();
});