This commit is contained in:
Joshua Davidson 2017-06-02 16:09:34 -04:00
commit a91bb25c1d
6 changed files with 154 additions and 10 deletions

View file

@ -273,7 +273,7 @@
<name>rtersv2</name> <name>rtersv2</name>
<offsets> <offsets>
<x-m>-0.001</x-m> <x-m>-0.001</x-m>
<y-m>-0.035</y-m> <y-m>-0.045</y-m>
<z-m>0.0505</z-m> <z-m>0.0505</z-m>
</offsets> </offsets>
<alignment>left-center</alignment> <alignment>left-center</alignment>
@ -344,7 +344,7 @@
<name>ldgw</name> <name>ldgw</name>
<offsets> <offsets>
<x-m>-0.001</x-m> <x-m>-0.001</x-m>
<y-m>0.040</y-m> <y-m>0.043</y-m>
<z-m>0.029</z-m> <z-m>0.029</z-m>
</offsets> </offsets>
<alignment>right-center</alignment> <alignment>right-center</alignment>
@ -434,6 +434,31 @@
<height type="int">64</height> <height type="int">64</height>
</font-resolution> </font-resolution>
</text> </text>
<text>
<name>tow</name>
<offsets>
<x-m>-0.001</x-m>
<y-m>0.0405</y-m>
<z-m>0.0335</z-m>
</offsets>
<alignment>right-center</alignment>
<axis-alignment>yz-plane</axis-alignment>
<type type="string">text-value</type>
<format type="string">LW</format>
<truncate type="bool">false</truncate>
<font type="string">BoeingCDU-Large.ttf</font>
<property>autopilot/serviceable</property>
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.0040</character-size>
<font-resolution>
<width type="int">64</width>
<height type="int">64</height>
</font-resolution>
</text>
<text> <text>
<name>altntime</name> <name>altntime</name>
<offsets> <offsets>

View file

@ -273,7 +273,7 @@
<name>rtersv2</name> <name>rtersv2</name>
<offsets> <offsets>
<x-m>-0.001</x-m> <x-m>-0.001</x-m>
<y-m>-0.035</y-m> <y-m>-0.045</y-m>
<z-m>0.0505</z-m> <z-m>0.0505</z-m>
</offsets> </offsets>
<alignment>left-center</alignment> <alignment>left-center</alignment>
@ -344,7 +344,7 @@
<name>ldgw</name> <name>ldgw</name>
<offsets> <offsets>
<x-m>-0.001</x-m> <x-m>-0.001</x-m>
<y-m>0.040</y-m> <y-m>0.043</y-m>
<z-m>0.029</z-m> <z-m>0.029</z-m>
</offsets> </offsets>
<alignment>right-center</alignment> <alignment>right-center</alignment>
@ -434,6 +434,31 @@
<height type="int">64</height> <height type="int">64</height>
</font-resolution> </font-resolution>
</text> </text>
<text>
<name>tow</name>
<offsets>
<x-m>-0.001</x-m>
<y-m>0.0405</y-m>
<z-m>0.0335</z-m>
</offsets>
<alignment>right-center</alignment>
<axis-alignment>yz-plane</axis-alignment>
<type type="string">text-value</type>
<format type="string">LW</format>
<truncate type="bool">false</truncate>
<font type="string">BoeingCDU-Large.ttf</font>
<property>autopilot/serviceable</property>
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.0040</character-size>
<font-resolution>
<width type="int">64</width>
<height type="int">64</height>
</font-resolution>
</text>
<text> <text>
<name>altntime</name> <name>altntime</name>
<offsets> <offsets>

View file

@ -83,15 +83,19 @@ var phasecheck = maketimer(0.2, func {
var vertmode = getprop("/modes/pfd/fma/pitch-mode"); var vertmode = getprop("/modes/pfd/fma/pitch-mode");
if ((((n1_left >= 85) and (n1_right >= 85)) or (gs > 90 )) and flaps < 4 and (mode == "SRS")) { if ((((n1_left >= 85) and (n1_right >= 85)) or (gs > 90 )) and flaps < 4 and (mode == "SRS")) {
setprop("/FMGC/status/phase", "1"); setprop("/FMGC/status/phase", "1");
setprop("/systems/pressurization/mode", "TO");
} }
if ((alt >= 3000) and (alt <= cruisefl) and (phase == "1") and (phase != "4") and (mode != "SRS")) { if ((alt >= 3000) and (alt <= cruisefl) and (phase == "1") and (phase != "4") and (mode != "SRS")) {
setprop("/FMGC/status/phase", "2"); setprop("/FMGC/status/phase", "2");
} }
if ((alt >= cruisefl) and (phase == "2") and (mode != "SRS")) { if ((alt >= cruisefl) and (phase == "2") and (mode != "SRS")) {
setprop("/FMGC/status/phase", "3"); # for now cruise will be level 100 or above until the MCDU is ready setprop("/FMGC/status/phase", "3");
setprop("/systems/pressurization/mode", "CR");
} }
if ((alt <= cruisefl) and (phase == "3")) { # for now it will have to be when we begin descent. if ((alt <= cruisefl) and (phase == "3")) { # for now it will have to be when we begin descent.
setprop("/FMGC/status/phase", "4"); setprop("/FMGC/status/phase", "4");
setprop("/systems/pressurization/mode", "DE");
} }
if (getprop("/FMGC/status/to-state") == 0 and flaps >= 4 and ((phase == "4") or (phase == "2"))) { # add man activation of approach phase in MCDU or DECEL when those things are simulated if (getprop("/FMGC/status/to-state") == 0 and flaps >= 4 and ((phase == "4") or (phase == "2"))) { # add man activation of approach phase in MCDU or DECEL when those things are simulated
setprop("/FMGC/status/phase", "5"); setprop("/FMGC/status/phase", "5");
@ -114,6 +118,7 @@ var phasecheck = maketimer(0.2, func {
mcdu2.MCDU_reset(); mcdu2.MCDU_reset();
setprop("/it-autoflight/input/fd1", fd1); setprop("/it-autoflight/input/fd1", fd1);
setprop("/it-autoflight/input/fd2", fd2); setprop("/it-autoflight/input/fd2", fd2);
press_init();
} }
}); });

View file

@ -152,6 +152,7 @@ setlistener("/sim/signals/fdm-initialized", func {
systems.adirs_init(); systems.adirs_init();
systems.pneu_init(); systems.pneu_init();
systems.hyd_init(); systems.hyd_init();
systems.press_init();
itaf.ap_init(); itaf.ap_init();
externalconnections.start(); externalconnections.start();
fmgc.FMGCinit(); fmgc.FMGCinit();

View file

@ -29,11 +29,93 @@ var pneu_init = func {
setprop("/systems/pneumatic/eng1-starter", 0); setprop("/systems/pneumatic/eng1-starter", 0);
setprop("/systems/pneumatic/eng2-starter", 0); setprop("/systems/pneumatic/eng2-starter", 0);
pneu_timer.start(); pneu_timer.start();
press_timer.start();
}
var press_init = func {
setprop("/FMGC/internal/dep-arpt", "");
setprop("/systems/pressurization/mode", "GN");
setprop("/systems/pressurization/vs", "0");
setprop("/systems/pressurization/auto", 1);
setprop("/systems/pressurization/deltap", "0");
setprop("/systems/pressurization/outflowpos", "0");
var altitude = getprop("/position/altitude-ft");
setprop("/systems/pressurization/cabinalt", altitude); # initially set altitude
}
##############
# Main Loops #
##############
var master_press = func {
var phase = getprop("/FMGC/status/phase");
var pressmode = getprop("/systems/pressurization/mode");
var state1 = getprop("/systems/thrust/state1");
var state2 = getprop("/systems/thrust/state2");
var wowl = getprop("/gear/gear[1]/wow");
var wowr = getprop("/gear/gear[2]/wow");
var deltap = getprop("/systems/pressurization/deltap");
var outflow = getprop("/systems/pressurization/outflowpos");
var speed = getprop("/velocities/groundspeed-kt");
var cabinalt = getprop("/systems/pressurization/cabinalt");
var dep_apt = getprop("autopilot/route-manager/departure/airport");
var airport_dep_elev_ft = getprop("autopilot/route-manager/departure/field-elevation-ft");
var altitude = getprop("/position/altitude-ft");
var airport_arr_elev_ft = getprop("autopilot/route-manager/destination/field-elevation-ft");
var vs = getprop("/systems/pressurization/vs");
var outflowpos = getprop("/systems/pressurization/outflowpos");
var cabinalt = getprop("/systems/pressurization/cabinalt");
# switch mode to TO
if ((pressmode == "GN") and (pressmode != "CL") and (wowl and wowr) and ((state1 == "MCT") or (state1 == "TOGA")) and ((state2 == "MCT") or (state2 == "TOGA"))) {
setprop("/systems/pressurization/mode", "TO");
}
# prepressurization
var pressmode = getprop("/systems/pressurization/mode");
if (pressmode == "TO") {
if (outflowpos == "0") {
interpolate("/systems/pressurization/outflowpos", 1, 1);
}
if (vs > -500 and (outflowpos != 0.5)) {
interpolate("/systems/pressurization/vs", vs - 50, 0.1);
}
if (dep_apt != "") {
if ((cabinalt > (airport_dep_elev_ft - 1)) and (cabinalt < (airport_dep_elev_ft + 1))) {
interpolate("/systems/pressurization/cabinalt", airport_dep_elev_ft - 187, 10);
}
} else {
if ((cabinalt > (altitude - 1)) and (cabinalt < (altitude + 1))) {
interpolate("/systems/pressurization/cabinalt", altitude - 187, 10);
}
}
if (dep_apt != "") {
if (cabinalt < (airport_dep_elev_ft - 183)) {
if (vs < 0) {
interpolate("/systems/pressurization/vs", 0, 1);
}
if (outflowpos == "1") {
interpolate("/systems/pressurization/outflowpos", 0.5, 1);
}
}
} else {
if (cabinalt < (altitude - 183)) {
if (vs < 0) {
interpolate("/systems/pressurization/vs", vs + 50, 0.1);
}
if (outflowpos == "1") {
interpolate("/systems/pressurization/outflowpos", 0.5, 1);
}
}
}
}
# switch mode to CLB
if (((!wowl) or (!wowr)) and (speed > 100) and (pressmode == "TO")) {
setprop("/systems/pressurization/mode", "CL");
}
} }
#######################
# Main Pneumatic Loop #
#######################
var master_pneu = func { var master_pneu = func {
var bleed1_sw = getprop("/controls/pneumatic/switches/bleed1"); var bleed1_sw = getprop("/controls/pneumatic/switches/bleed1");
@ -140,3 +222,9 @@ var update_pneumatic = func {
} }
var pneu_timer = maketimer(0.2, update_pneumatic); var pneu_timer = maketimer(0.2, update_pneumatic);
var update_press = func {
master_press();
}
var press_timer = maketimer(0.1, update_press);

View file

@ -1,5 +1,5 @@
# A320Family # A320Family
A very advanced simulation of the Airbus A320 Family for FlightGear.<br /> A very advanced simulation of the Airbus A320 Family for FlightGear.
Brought to you by: Brought to you by:
- Joshua Davidson (it0uchpods) - Joshua Davidson (it0uchpods)