1
0
Fork 0

Merge branch 'master' into fire-fix

This commit is contained in:
legoboyvdlp R 2019-10-24 16:59:05 +01:00
commit 8d035b6811
13 changed files with 810 additions and 185 deletions

View file

@ -15,34 +15,7 @@
</hud>
<model>
<autopush>
<connected type="bool">0</connected>
<position-norm type="double">0</position-norm>
<enabled type="int"/>
<available type="int">1</available>
<chocks alias="/services/chocks/nose"/>
<steer-cmd-norm alias="/fdm/jsbsim/hydraulics/tiller/autopush-cmd"/>
<yaw alias="/fdm/jsbsim/fcs/steer-deg"/>
<yaw-mult type="float">1.0</yaw-mult>
<target-speed-km_h type="float">0.0</target-speed-km_h>
<K_p type="float">0.5</K_p>
<F_p type="float">0.15</F_p>
<K_i type="float">0.25</K_i>
<F_i type="float">0.1</F_i>
<K_d type="float">0.0</K_d>
<F_d type="float">0.0</F_d>
<pitch-deg type="float">0.0</pitch-deg>
<min-turn-radius-m type="float">15</min-turn-radius-m>
<stopping-distance-m type="float">5.0</stopping-distance-m>
<driver>
<F_V type="float">5.5</F_V>
<K_psi type="float">0.03</K_psi>
</driver>
<route>
<show type="bool"/>
</route>
<debug type="bool">false</debug>
</autopush>
<autopush include="AircraftConfig/autopush-config.xml"/>
<icing>
<iceable>
<name>Wing</name>

View file

@ -0,0 +1,30 @@
<PropertyList>
<steer-cmd-norm alias="/fdm/jsbsim/hydraulics/tiller/autopush-cmd"/>
<yaw alias="/fdm/jsbsim/fcs/steer-deg"/>
<yaw-mult type="float">1.0</yaw-mult>
<pitch-deg type="float">0.0</pitch-deg>
<min-turn-radius-m type="float">15</min-turn-radius-m>
<stopping-distance-m type="float">5.0</stopping-distance-m>
<chocks alias="/services/chocks/nose"/>
<available type="int">1</available>
<enabled type="int"/>
<connected type="bool">false</connected>
<target-speed-km_h type="float">0.0</target-speed-km_h>
<K_p type="float">0.5</K_p>
<F_p type="float">0.15</F_p>
<K_i type="float">0.25</K_i>
<F_i type="float">0.1</F_i>
<K_d type="float">0.0</K_d>
<F_d type="float">0.0</F_d>
<driver>
<F_V type="float">5.5</F_V>
<K_psi type="float">0.03</K_psi>
<F_psi type="float">1.0</F_psi>
<K_psidot type="float">0.03</K_psidot>
<F_psidot type="float">1.0</F_psidot>
</driver>
<route>
<show type="bool"/>
</route>
<debug type="int">0</debug>
</PropertyList>

View file

@ -111,6 +111,11 @@ var switch_pack1 = props.globals.getNode("/controls/pneumatic/switches/pack1", 1
var switch_pack2 = props.globals.getNode("/controls/pneumatic/switches/pack2", 1);
var oil_qt1_actual = props.globals.getNode("/engines/engine[0]/oil-qt-actual", 1);
var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1);
var fuel_used_lbs1 = props.globals.getNode("/fdm/jsbsim/propulsion/engine[0]/fuel-used-lbs", 1);
var fuel_used_lbs2 = props.globals.getNode("/fdm/jsbsim/propulsion/engine[1]/fuel-used-lbs", 1);
var fuel_left_quantity = props.globals.getNode("/consumables/fuel/tank[0]/level-lbs", 1);
var fuel_center_quantity = props.globals.getNode("/consumables/fuel/tank[1]/level-lbs", 1);
var fuel_right_quantity = props.globals.getNode("/consumables/fuel/tank[2]/level-lbs", 1);
var doorL1_pos = props.globals.getNode("sim/model/door-positions/doorl1/position-norm", 1);
var doorR1_pos = props.globals.getNode("sim/model/door-positions/doorr1/position-norm", 1);
var doorL4_pos = props.globals.getNode("sim/model/door-positions/doorl4/position-norm", 1);
@ -219,6 +224,10 @@ var fadec1 = props.globals.getNode("/systems/fadec/powered1", 1);
var fadec2 = props.globals.getNode("/systems/fadec/powered2", 1);
var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1);
var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1);
var fuel_left_outer_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1);
var fuel_left_inner_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1);
var fuel_right_outer_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1);
var fuel_right_inner_temp = props.globals.getNode("/consumables/fuel/tank[1]/temperature_degC", 1);
var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1);
var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1);
var fuel_xfeed = props.globals.getNode("/controls/fuel/x-feed", 1);
@ -1786,7 +1795,7 @@ var canvas_lowerECAM_eng = {
return m;
},
getKeys: func() {
return ["TAT","SAT","GW","UTCh","UTCm","OilQT1-needle","OilQT2-needle","OilQT1","OilQT2","OilQT1-decimal","OilQT2-decimal","OilPSI1-needle","OilPSI2-needle","OilPSI1","OilPSI2"];
return ["TAT","SAT","GW","UTCh","UTCm","OilQT1-needle","OilQT2-needle","OilQT1","OilQT2","OilQT1-decimal","OilQT2-decimal","OilPSI1-needle","OilPSI2-needle","OilPSI1","OilPSI2","FUEL-used-1","FUEL-used-2"];
},
update: func() {
# Oil Quantity
@ -1821,6 +1830,10 @@ var canvas_lowerECAM_eng = {
me["OilPSI1-needle"].setRotation((oil_psi1.getValue() + 90) * D2R);
me["OilPSI2-needle"].setRotation((oil_psi2.getValue() + 90) * D2R);
# Fuel Used
me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10)));
me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10)));
me.updateBottomStatus();
},
};
@ -2219,23 +2232,23 @@ var canvas_lowerECAM_fuel = {
return m;
},
getKeys: func() {
return["TAT","SAT","GW","UTCh","UTCm","FUEL-Pump-Left-1","FUEL-Pump-Left-2","FUEL-Pump-Center-1","FUEL-Pump-Center-2","FUEL-Pump-Right-1","FUEL-Pump-Right-2","FUEL-Left-blocked","FUEL-Right-blocked","FUEL-Center-blocked","FUEL-Left-Tranfser",
"FUEL-Right-Tranfse","FUEL-Left-Outer-Inacc","FUEL-Left-Inner-Inacc","FUEL-Center-Inacc","FUEL-Right-Inner-Inacc","FUEL-Right-Outer-Inacc","FUEL-Left-Outer-quantity","FUEL-Left-Inner-quantity","FUEL-Center-quantity","FUEL-Right-Inner-quantity",
return["TAT","SAT","GW","UTCh","UTCm","FUEL-Pump-Left-1","FUEL-Pump-Left-2","FUEL-Pump-Center-1","FUEL-Pump-Center-2","FUEL-Pump-Right-1","FUEL-Pump-Right-2","FUEL-Left-blocked","FUEL-Right-blocked","FUEL-Center-blocked","FUEL-Left-Transfer",
"FUEL-Right-Transfer","FUEL-Left-Outer-Inacc","FUEL-Left-Inner-Inacc","FUEL-Center-Inacc","FUEL-Right-Inner-Inacc","FUEL-Right-Outer-Inacc","FUEL-Left-Outer-quantity","FUEL-Left-Inner-quantity","FUEL-Center-quantity","FUEL-Right-Inner-quantity",
"FUEL-Right-Outer-quantity","FUEL-On-Board","FUEL-Flow-per-min","FUEL-APU-arrow","FUEL-APU-label","FUEL-used-1","FUEL-used-both","FUEL-used-2","FUEL-ENG-Master-1","FUEL-ENG-Master-2","FUEL-XFEED","FUEL-XFEED-pipes","FUEL-Left-Outer-temp",
"FUEL-Left-Inner-temp","FUEL-Right-Inner-temp","FUEL-Right-Outer-temp","FUEL-Pump-Left-1-Closed","FUEL-Pump-Left-1-Open","FUEL-Pump-Left-2-Closed","FUEL-Pump-Left-2-Open","FUEL-Pump-Center-1-Open","FUEL-Pump-Center-1-Closed","FUEL-Pump-Center-2-Closed",
"FUEL-Pump-Center-2-Open","FUEL-Pump-Right-1-Closed","FUEL-Pump-Right-1-Open","FUEL-Pump-Right-2-Closed","FUEL-Pump-Right-2-Open","FUEL-ENG-1-label","FUEL-ENG-2-label","FUEL-ENG-1-pipe","FUEL-ENG-2-pipe","FUEL-Right-Tranfser","ENG1idFFlow","ENG2idFFlow"];
"FUEL-Pump-Center-2-Open","FUEL-Pump-Right-1-Closed","FUEL-Pump-Right-1-Open","FUEL-Pump-Right-2-Closed","FUEL-Pump-Right-2-Open","FUEL-ENG-1-label","FUEL-ENG-2-label","FUEL-ENG-1-pipe","FUEL-ENG-2-pipe","ENG1idFFlow","ENG2idFFlow","FUEL-used-1","FUEL-used-2","FUEL-used-both"];
},
update: func() {
# if (getprop("engines/engine[0]/n1-actual") < getprop("/controls/engines/idle-limit")) {
if (eng1_n1.getValue() < 19.7) {
if (eng1_n1.getValue() <= 18.9) {
me["ENG1idFFlow"].setColor(0.7333,0.3803,0);
} else {
me["ENG1idFFlow"].setColor(0.8078,0.8039,0.8078);
}
# if (getprop("engines/engine[1]/n1-actual") < getprop("/controls/engines/idle-limit")) {
if (eng2_n1.getValue() < 19.7) {
if (eng2_n1.getValue() <= 18.9) {
me["ENG2idFFlow"].setColor(0.7333,0.3803,0);
} else {
me["ENG2idFFlow"].setColor(0.8078,0.8039,0.8078);
@ -2246,14 +2259,14 @@ var canvas_lowerECAM_fuel = {
if (fadec1.getValue() == 1 and fadec2.getValue() == 1) {
me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941);
me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((fuel_flow1.getValue() + fuel_flow2.getValue()) / 60, 1)));
me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round((fuel_flow1.getValue() + fuel_flow2.getValue()) / 60, 10)));
} else {
me["FUEL-Flow-per-min"].setColor(0.7333,0.3803,0);
me["FUEL-Flow-per-min"].setText("XX");
}
# this is now bound to the ENG master switch
# TODO use the valve prop and add amber if diffrence between eng master and valve
# TODO use the valve prop and add amber if difference between eng master and valve
# TODO add transition state
# TODO fix amber/green at the same time when closed
if (cutoff_switch1.getValue() == 0) {
@ -2267,7 +2280,7 @@ var canvas_lowerECAM_fuel = {
}
# this is now bound to the ENG master switch
# TODO use the valve prop and add amber if diffrence between eng master and valve
# TODO use the valve prop and add amber if difference between eng master and valve
# TODO add transition state
# TODO fix amber/green at the same time when closed
if (cutoff_switch2.getValue() == 0) {
@ -2364,6 +2377,49 @@ var canvas_lowerECAM_fuel = {
me["FUEL-Pump-Right-2"].setColor(0.7333,0.3803,0);
}
# Fuel Used
me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue(), 10)));
me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue(), 10)));
me["FUEL-used-both"].setText(sprintf("%s", (math.round(fuel_used_lbs1.getValue(), 10) + math.round(fuel_used_lbs2.getValue(), 10))));
# Fuel Temp
me["FUEL-Left-Outer-temp"].setText(sprintf("%s", math.round(fuel_left_outer_temp.getValue())));
me["FUEL-Left-Inner-temp"].setText(sprintf("%s", math.round(fuel_left_inner_temp.getValue())));
me["FUEL-Right-Outer-temp"].setText(sprintf("%s", math.round(fuel_right_outer_temp.getValue())));
me["FUEL-Right-Inner-temp"].setText(sprintf("%s", math.round(fuel_right_inner_temp.getValue())));
# Fuel Quantity
# TODO add LO indication
if (fuel_left_quantity.getValue() >= 3170) {
me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(fuel_left_quantity.getValue() - 1520, 10)));
me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", 1520));
me["FUEL-Left-Transfer"].hide();
} else if (fuel_left_quantity.getValue() >= 1650) {
me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", 1650));
me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", math.round(fuel_left_quantity.getValue() - 1650, 10)));
me["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0);
me["FUEL-Left-Transfer"].show();
} else {
me["FUEL-Left-Inner-quantity"].setText(sprintf("%s", math.round(fuel_left_quantity.getValue())));
me["FUEL-Left-Outer-quantity"].setText(sprintf("%s", 0));
me["FUEL-Left-Transfer"].hide();
}
me["FUEL-Center-quantity"].setText(sprintf("%s", math.round(fuel_center_quantity.getValue())));
if (fuel_right_quantity.getValue() >= 3170) {
me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(fuel_right_quantity.getValue() - 1520, 10)));
me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", 1520));
me["FUEL-Right-Transfer"].hide();
} else if (fuel_right_quantity.getValue() >= 1650) {
me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", 1650));
me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(fuel_right_quantity.getValue() - 1650, 10)));
me["FUEL-Right-Transfer"].show();
me["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0);
} else {
me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(fuel_right_quantity.getValue(), 10)));
me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", 0));
me["FUEL-Right-Transfer"].hide();
}
# Hide not yet implemented features
# TODO add them
me["FUEL-Left-blocked"].hide();
@ -2374,13 +2430,6 @@ var canvas_lowerECAM_fuel = {
me["FUEL-Right-Outer-Inacc"].hide();
me["FUEL-Right-Inner-Inacc"].hide();
me["FUEL-Center-Inacc"].hide();
me["FUEL-Left-Tranfser"].hide();
me["FUEL-Right-Tranfser"].hide();
me["FUEL-Left-Outer-temp"].hide();
me["FUEL-Left-Inner-temp"].hide();
me["FUEL-Right-Outer-temp"].hide();
me["FUEL-Right-Inner-temp"].hide();
me.updateBottomStatus();
},
};

View file

@ -654,4 +654,28 @@
d="m 628.98193,436.8605 42.77869,0"
style="fill:#001104;fill-opacity:0.32941176;stroke:#0dc04b;stroke-width:6;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:transform-center-x="70.6625" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:12px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:0.75"
x="264.69138"
y="181.87299"
id="FUEL-used-1"
inkscape:label="#text5832"><tspan
sodipodi:role="line"
id="tspan5830-5-2"
x="264.69138"
y="181.87299"
style="font-size:30.00000191px;line-height:1.25;fill:#0dc04b;fill-opacity:1;stroke-width:0.75">0000</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:12px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:0.75"
x="682.74243"
y="181.74864"
id="FUEL-used-2"
inkscape:label="#text5832"><tspan
sodipodi:role="line"
id="tspan5830"
x="682.74243"
y="181.74864"
style="font-size:30.00000191px;line-height:1.25;fill:#0dc04b;fill-opacity:1;stroke-width:0.75">0000</tspan></text>
</svg>

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

@ -1108,14 +1108,14 @@
<path
style="fill:none;stroke:#0dc04b;stroke-width:2.77499986;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.80000019;stroke-dasharray:none;stroke-opacity:1"
d="m 888.74997,513.99998 15.75,-7.5 16.5,-8.25 v 17.25 15.30854 c 0,0 -1.69343,-0.68362 -19.69533,-10.2091 -11.05467,-5.84944 -12.55467,-6.59944 -12.55467,-6.59944 z"
id="FUEL-Right-Tranfser"
id="FUEL-Right-Transfer"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccsc"
inkscape:label="#path5824-0" />
<path
style="fill:none;stroke:#0dc04b;stroke-width:2.77499986;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4.80000019;stroke-dasharray:none;stroke-opacity:1"
d="m 129.75,512.19144 -15.75,-7.5 -16.500003,-8.25 v 17.25 15.30854 c 0,0 1.69343,-0.68362 19.695333,-10.2091 C 128.25,512.94144 129.75,512.19144 129.75,512.19144 Z"
id="FUEL-Left-Tranfser"
id="FUEL-Left-Transfer"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccsc"
inkscape:label="#path5824-0" />

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View file

@ -241,6 +241,11 @@
<!-- Knob -->
<!-- TODO add bindings for VOR, LS and ADF -->
<!-- We use a little hack to get 8.33MHz spacing working:
First we assign our current STBY freq we want to adjust to the default instrument.
Then we change the channel there.
Finally we assign the value back to out own prop.
-->
<animation>
<type>pick</type>
<object-name>radio_rot1</object-name>
@ -266,14 +271,51 @@
</equals>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[0]/vhf1-standby</property>
<step>0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf1</value>
</equals>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[0]/vhf1-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -293,14 +335,51 @@
</equals>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[0]/vhf2-standby</property>
<step>0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf2</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf2</value>
</equals>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[0]/vhf2-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -326,14 +405,63 @@
</not>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[0]/vhf3-standby</property>
<step>0.025</step>
<resolution>0.025</resolution>
<min>0.0</min>
<max>1.0</max>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf3</value>
</equals>
<not>
<equals>
<property>systems/radio/rmp[0]/vhf3-standby</property>
<value>0</value>
</equals>
</not>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf3</value>
</equals>
<not>
<equals>
<property>systems/radio/rmp[0]/vhf3-standby</property>
<value>0</value>
</equals>
</not>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[0]/vhf3-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -409,14 +537,51 @@
</equals>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[0]/vhf1-standby</property>
<step>-0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>-1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf1</value>
</equals>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[0]/vhf1-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -436,14 +601,51 @@
</equals>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[0]/vhf2-standby</property>
<step>-0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf2</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>-1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf2</value>
</equals>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[0]/vhf2-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -469,14 +671,63 @@
</not>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[0]/vhf3-standby</property>
<step>-0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf3</value>
</equals>
<not>
<equals>
<property>systems/radio/rmp[0]/vhf3-standby</property>
<value>0</value>
</equals>
</not>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>-1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[0]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[0]/sel_chan</property>
<value type="string">vhf3</value>
</equals>
<not>
<equals>
<property>systems/radio/rmp[0]/vhf3-standby</property>
<value>0</value>
</equals>
</not>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[0]/vhf3-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>

View file

@ -241,6 +241,11 @@
<!-- Knob -->
<!-- TODO add bindings for VOR, LS and ADF -->
<!-- We use a little hack to get 8.33MHz spacing working:
First we assign our current STBY freq we want to adjust to the default instrument.
Then we change the channel there.
Finally we assign the value back to out own prop.
-->
<animation>
<type>pick</type>
<object-name>radio_rot1</object-name>
@ -266,14 +271,51 @@
</equals>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[1]/vhf1-standby</property>
<step>0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf1</value>
</equals>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[1]/vhf1-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -293,14 +335,51 @@
</equals>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[1]/vhf2-standby</property>
<step>0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf2</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf2</value>
</equals>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[1]/vhf2-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -326,14 +405,63 @@
</not>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[1]/vhf3-standby</property>
<step>0.025</step>
<resolution>0.025</resolution>
<min>0.0</min>
<max>1.0</max>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf3</value>
</equals>
<not>
<equals>
<property>systems/radio/rmp[1]/vhf3-standby</property>
<value>0</value>
</equals>
</not>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf3</value>
</equals>
<not>
<equals>
<property>systems/radio/rmp[1]/vhf3-standby</property>
<value>0</value>
</equals>
</not>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[1]/vhf3-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -409,14 +537,51 @@
</equals>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[1]/vhf1-standby</property>
<step>-0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf1</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>-1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf1</value>
</equals>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[1]/vhf1-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -436,14 +601,51 @@
</equals>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[1]/vhf2-standby</property>
<step>-0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf2</value>
</equals>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>-1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf2</value>
</equals>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[1]/vhf2-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>
@ -469,14 +671,63 @@
</not>
</and>
</condition>
<command>property-adjust</command>
<command>property-assign</command>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
<property>systems/radio/rmp[1]/vhf3-standby</property>
<step>-0.025</step>
<min>0.0</min>
<max>1.0</max>
<resolution>0.025</resolution>
<wrap>true</wrap>
<mask>decimal</mask>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf3</value>
</equals>
<not>
<equals>
<property>systems/radio/rmp[1]/vhf3-standby</property>
<value>0</value>
</equals>
</not>
</and>
</condition>
<command>property-adjust</command>
<property>instrumentation/comm[0]/frequencies/standby-channel</property>
<step>-1</step>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>controls/radio/rmp[1]/on</property>
<value>1</value>
</equals>
<equals>
<property>systems/radio/rmp[1]/sel_chan</property>
<value type="string">vhf3</value>
</equals>
<not>
<equals>
<property>systems/radio/rmp[1]/vhf3-standby</property>
<value>0</value>
</equals>
</not>
</and>
</condition>
<command>property-assign</command>
<property>systems/radio/rmp[1]/vhf3-standby</property>
<property>instrumentation/comm[0]/frequencies/standby-mhz</property>
</binding>
<binding>

View file

@ -926,6 +926,16 @@ var messages_priority_3 = func {
}
var messages_priority_2 = func {
# DC EMER CONFIG
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dcEss.getValue() < 25 and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25) {
dcEmerconfig.active = 1;
dcEmerconfigManOn.active = 1;
} else {
ECAM_controller.warningReset(dcEmerconfig);
ECAM_controller.warningReset(dcEmerconfigManOn);
}
# APU EMER SHUT DOWN
if (apuEmerShutdown.clearFlag == 0 and systems.apuEmerShutdown.getBoolValue() and !getprop("/systems/fire/apu/warning-active") and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) {
apuEmerShutdown.active = 1;
} elsif (apuEmerShutdown.clearFlag == 1) {

View file

@ -140,7 +140,7 @@ var warnings = std.Vector.new([
var essBusOnBatLGCB = warning.new(msg: "-LGCIU1 C/B (C09)..PULL", colour: "c"),
var essBusOnBatManOn2 = warning.new(msg: "-EMER ELEC PWR...MAN ON", colour: "c"),
# ESS Bus on Bat
# Emer Config
var emerconfig = warning.new(msg: "ELEC EMER CONFIG", colour: "r", aural: 0, light: 0, hasSubmsg: 1),
var emerconfigMinRat = warning.new(msg: "MIN RAT SPD......140 KT", colour: "c"),
var emerconfigGen = warning.new(msg: "-GEN 1+2....OFF THEN ON", colour: "c"),
@ -161,6 +161,10 @@ var warnings = std.Vector.new([
var emerconfigProt = warning.new(msg: " (PROT LOST)", colour: "a"),
var emerconfigMaxSpeed = warning.new(msg: " MAX SPEED........320 KT", colour: "c"),
# DC EMER CONFIG
var dcEmerconfig = warning.new(msg: "ELEC DC EMER CONFIG", colour: "a", aural: 1, light: 0, hasSubmsg: 1),
var dcEmerconfigManOn = warning.new(msg: " -EMER ELEC PWR...MAN ON", colour: "c"),
# APU shutdown
var apuEmerShutdown = warning.new(msg: "APU EMER SHUT DOWN", colour: "a", aural: 1, light: 1, hasSubmsg: 1),
var apuEmerShutdownMast = warning.new(msg: " -MASTER SW..........OFF", colour: "c"),

View file

@ -8,7 +8,6 @@
# Distribute under the terms of GPLv2.
var _enabled = 0;
var _K_p = nil;
var _F_p = nil;
var _K_i = nil;
@ -134,10 +133,9 @@ var _stop = func() {
setlistener("/sim/model/autopush/enabled", func(p) {
var enabled = p.getValue();
if ((enabled > _enabled) and getprop("/sim/model/autopush/available")) {
if ((enabled) and getprop("/sim/model/autopush/available")) {
_start();
} else if (enabled < _enabled) {
} else {
_stop();
}
_enabled = enabled;
});
}, 1, 0);

View file

@ -15,14 +15,19 @@ var _F_V = nil;
var _R_turn_min = nil;
var _D_stop = nil;
var _K_psi = nil;
var _F_psi = nil;
var _K_psidot = nil;
var _F_psidot = nil;
var _debug = nil;
var _psi = nil;
var _time = nil;
var _route = nil;
var _route_reverse = nil;
var _push = nil;
var _sign = nil;
var _to_wp = 1;
var _to_wp = 0;
var _is_last_wp = 0;
var _is_reverse_wp = 0;
@ -45,12 +50,17 @@ var _loop = func() {
stop();
return;
}
var psi = getprop("/orientation/heading-deg") + _push * 180.0;
var (A, D) = courseAndDistance(_route[_to_wp]);
D *= NM2M;
var (psi_leg, D_leg) = courseAndDistance(_route[_to_wp - 1], _route[_to_wp]);
var deltapsi = geo.normdeg180(A - psi_leg);
var deltaA = geo.normdeg180(A - psi);
var psi = getprop("/orientation/heading-deg") + _push * 180.0;
var deltaA = math.min(math.max(_K_psi * geo.normdeg180(A - psi), -_F_psi), _F_psi);
var time = getprop("/sim/time/elapsed-sec");
var dt = time - _time;
var minus_psidot = (dt > 0.002) * math.min(math.max(_K_psidot * (_psi - psi) / dt, -_F_psidot), _F_psidot);
_psi = psi;
_time = time;
# TODO Either use _K_V and total remaining distance or turn radius to calculate speed.
# TODO Make slider input override speed.
var V = _F_V;
@ -69,12 +79,11 @@ var _loop = func() {
_advance_wp();
}
}
var steering = math.min(math.max(_sign * (deltaA + minus_psidot), -1.0), 1.0);
if (_debug > 1) {
print("autopush_driver to_wp " ~ _to_wp ~ ", psi_target " ~ geo.normdeg(A) ~ ", deltapsi " ~ deltapsi ~ ", deltapsi_steer " ~ _sign * deltaA);
print("autopush_driver to_wp " ~ _to_wp ~ ", A " ~ geo.normdeg(A) ~ ", deltaA " ~ deltaA ~ ", minus_psidot " ~ minus_psidot);
}
setprop("/sim/model/autopush/target-speed-km_h", _sign * V);
steering = math.min(math.max(_sign * _K_psi * deltaA, -1.0), 1.0);
setprop("/sim/model/autopush/steer-cmd-norm", steering);
}
@ -100,7 +109,7 @@ var start = func() {
if ((_route == nil) or size(_route) < 2) {
gui.popupTip("Pushback route empty or invalid");
return;
}else{
} else {
autopush_route.done();
}
_K_V = getprop("/sim/model/autopush/driver/K_V");
@ -108,12 +117,18 @@ var start = func() {
_R_turn_min = getprop("/sim/model/autopush/min-turn-radius-m");
_D_stop = getprop("/sim/model/autopush/stopping-distance-m");
_K_psi = getprop("/sim/model/autopush/driver/K_psi");
_F_psi = getprop("/sim/model/autopush/driver/F_psi");
_K_psidot = getprop("/sim/model/autopush/driver/K_psidot");
_F_psidot = getprop("/sim/model/autopush/driver/F_psidot");
_debug = getprop("/sim/model/autopush/debug") or 0;
if (_to_wp == 1) {
if (!_to_wp) {
var (psi_park, D_park) = courseAndDistance(_route[0], _route[1]);
_push = (abs(geo.normdeg180(getprop("/orientation/heading-deg") - psi_park)) > 90.0);
_sign = 1.0 - 2.0 * _push;
_advance_wp();
_psi = 0.0;
}
_time = getprop("/sim/time/elapsed-sec");
_timer.start();
var endsign = _sign;
for (ii = _to_wp; ii < size(_route_reverse); ii += 1) {
@ -123,9 +138,9 @@ var start = func() {
}
var (psi_twy, D_twy) = courseAndDistance(_route[size(_route) - 2], _route[size(_route) - 1]);
if (endsign < 0.0) {
screen.log.write("(pushback): Push back facing " ~ int(geo.normdeg(psi_twy + 180.0 - magvar())) ~ ".");
screen.log.write("(pushback): Push back facing " ~ math.round(geo.normdeg(psi_twy + 180.0 - magvar()), 1.0) ~ ".");
} else {
screen.log.write("(pushback): Tow facing " ~ int(geo.normdeg(psi_twy - magvar())) ~ ".");
screen.log.write("(pushback): Tow facing " ~ math.round(geo.normdeg(psi_twy - magvar()), 1.0) ~ ".");
}
}
@ -136,7 +151,5 @@ var pause = func() {
var stop = func() {
pause();
_to_wp = 1;
_is_last_wp = 0;
_is_reverse_wp = 0;
_to_wp = 0;
}

View file

@ -15,15 +15,25 @@ var _user_point_modes = dynarr.dynarr.new(4); # Modes: 0 = Bezier node, 1 = Bezi
var _route = [];
var _route_hdg = [];
var _route_reverse = [];
var _view_index = nil;
var _top_view_index = nil;
var _top_view_heading_offset_deg = 180.0;
var _reset_view_index = nil;
var _view_z_offset = nil;
var _view_pitch_offset_deg = nil;
var _view_heading_offset_deg = nil;
var _user_point_models = [];
var _waypoint_models = [];
var _N = 0;
var _show = 0;
var _view_changed_or_external = 0;
var _R_turn_min = 0;
var _invalid = 0;
# Make top-down view point north in old FG.
var __fg_version = num(string.replace(getprop("/sim/version/flightgear"),".",""));
if (__fg_version < 201920) {
_top_view_heading_offset_deg = 94.5;
}
var _add = func(pos) {
if (_N) {
@ -77,11 +87,11 @@ var _stop = func(fail = 0) {
_listener = nil;
if (!fail) {
settimer(func() {
_reset_view();
_finalize_top_view();
gui.popupTip("Done");
}, 1.0);
} else {
_reset_view();
_finalize_top_view();
}
}
}
@ -129,31 +139,36 @@ var _clear_waypoint_models = func() {
setsize(_waypoint_models, 0);
}
var _set_view = func() {
if (!getprop("/sim/current-view/internal")){
_view_changed_or_external = 1;
var top_view = func() {
if (_view_listener != nil) {
return;
}
_view_index = getprop("/sim/current-view/view-number");
# While "Chase View Without Yaw" would have looked better, only "Model View" resets its z-offset back to normal by itself.
setprop("/sim/current-view/view-number", view.indexof("Model View"));
_top_view_index = view.indexof("Chase View Without Yaw");
_reset_view_index = getprop("/sim/current-view/view-number");
setprop("/sim/current-view/view-number", _top_view_index);
_view_pitch_offset_deg = getprop("/sim/current-view/pitch-offset-deg");
_view_heading_offset_deg = getprop("/sim/current-view/heading-offset-deg");
_view_z_offset = getprop("/sim/current-view/z-offset-m");
setprop("/sim/current-view/z-offset-m", -500.0);
setprop("/sim/current-view/heading-offset-deg", _top_view_heading_offset_deg);
setprop("/sim/current-view/pitch-offset-deg", 90.0);
setprop("/sim/current-view/heading-offset-deg", 0.0);
_view_changed_or_external = 0;
_view_listener = setlistener("/sim/current-view/name", func {
_view_changed_or_external = 1;
});
_finalize_top_view();
}, 0, 0);
}
var _reset_view = func() {
if (!_view_changed_or_external) {
setprop("/sim/current-view/view-number", _view_index);
}
if (_view_listener != nil) {
removelistener(_view_listener);
_view_listener = nil;
var _finalize_top_view = func() {
if (_view_listener == nil) {
return;
}
removelistener(_view_listener);
_view_listener = nil;
# Go back to the view to restore settings, in case user has switched away.
setprop("/sim/current-view/view-number", _top_view_index);
setprop("/sim/current-view/z-offset-m", _view_z_offset);
setprop("/sim/current-view/heading-offset-deg", _view_heading_offset_deg);
setprop("/sim/current-view/pitch-offset-deg", _view_pitch_offset_deg);
setprop("/sim/current-view/view-number", _reset_view_index);
if (!_show) {
_clear_user_point_models();
_clear_waypoint_models();
@ -238,20 +253,24 @@ var _calculate_bezier = func(user_points) {
len += user_points[i].distance_to(user_points[i + 1]);
}
var step = _R_turn_min / len;
if (len < _R_turn_min) {
route.add(geo.Coord.new(user_points[PNumber - 1]))
} else {
var step = _R_turn_min / len;
for (var i = step; i < 1 - step; i+= step) {
# start iterating from 1 cause we don't need to iterate over Pn
for (var j = 1; j < PNumber; j += 1) {
for (var k = 0; k < PNumber - j; k += 1) {
pointList[j][k] = geo.Coord.new(pointList[j - 1][k]);
var dist = pointList[j - 1][k].distance_to(pointList[j - 1][k + 1]);
var course = pointList[j - 1][k].course_to(pointList[j - 1][k + 1]);
pointList[j][k].apply_course_distance(course, dist * i);
for (var i = step; i < 1 - step; i+= step) {
# start iterating from 1 cause we don't need to iterate over Pn
for (var j = 1; j < PNumber; j += 1) {
for (var k = 0; k < PNumber - j; k += 1) {
pointList[j][k] = geo.Coord.new(pointList[j - 1][k]);
var dist = pointList[j - 1][k].distance_to(pointList[j - 1][k + 1]);
var course = pointList[j - 1][k].course_to(pointList[j - 1][k + 1]);
pointList[j][k].apply_course_distance(course, dist * i);
}
}
pointList[PNumber - 1][0].set_alt(geo.elevation(pointList[PNumber - 1][0].lat(),pointList[PNumber - 1][0].lon()));
route.add(geo.Coord.new(pointList[PNumber - 1][0]));
}
pointList[PNumber - 1][0].set_alt(geo.elevation(pointList[PNumber - 1][0].lat(),pointList[PNumber - 1][0].lon()));
route.add(geo.Coord.new(pointList[PNumber - 1][0]));
}
}
@ -317,21 +336,21 @@ var _check_turn_radius = func() {
setlistener("/sim/model/autopush/route/show", func(p) {
var show = p.getValue();
if (_listener == nil) {
if (show > _show) {
if (show) {
_place_user_point_models();
_place_waypoint_models();
} else if (show < _show) {
} else {
_clear_user_point_models();
_clear_waypoint_models();
}
}
_show = show;
});
}, 1, 0);
var enter = func() {
clear();
_set_view();
top_view();
_R_turn_min = getprop("/sim/model/autopush/min-turn-radius-m");
var wp = geo.aircraft_position();
var H = geo.elevation(wp.lat(), wp.lon());

View file

@ -47,16 +47,19 @@
<comm-radio>
<name>comm</name>
<number>0</number>
<eight-point-three>1</eight-point-three>
</comm-radio>
<comm-radio>
<name>comm</name>
<number>1</number>
<eight-point-three>1</eight-point-three>
</comm-radio>
<comm-radio>
<name>comm</name>
<number>2</number>
<eight-point-three>1</eight-point-three>
</comm-radio>
<dme>