Merge pull request #43 from legoboyvdlp/master

update INITB, add pressuriztion basic prepressurization system
This commit is contained in:
Joshua Davidson 2017-06-02 11:11:17 -04:00 committed by GitHub
commit 187116e6aa
7 changed files with 157 additions and 11 deletions

View file

@ -273,7 +273,7 @@
<name>rtersv2</name>
<offsets>
<x-m>-0.001</x-m>
<y-m>-0.035</y-m>
<y-m>-0.045</y-m>
<z-m>0.0505</z-m>
</offsets>
<alignment>left-center</alignment>
@ -344,7 +344,7 @@
<name>ldgw</name>
<offsets>
<x-m>-0.001</x-m>
<y-m>0.040</y-m>
<y-m>0.043</y-m>
<z-m>0.029</z-m>
</offsets>
<alignment>right-center</alignment>
@ -434,6 +434,31 @@
<height type="int">64</height>
</font-resolution>
</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>
<name>altntime</name>
<offsets>

View file

@ -273,7 +273,7 @@
<name>rtersv2</name>
<offsets>
<x-m>-0.001</x-m>
<y-m>-0.035</y-m>
<y-m>-0.045</y-m>
<z-m>0.0505</z-m>
</offsets>
<alignment>left-center</alignment>
@ -344,7 +344,7 @@
<name>ldgw</name>
<offsets>
<x-m>-0.001</x-m>
<y-m>0.040</y-m>
<y-m>0.043</y-m>
<z-m>0.029</z-m>
</offsets>
<alignment>right-center</alignment>
@ -434,6 +434,31 @@
<height type="int">64</height>
</font-resolution>
</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>
<name>altntime</name>
<offsets>

View file

@ -83,15 +83,19 @@ var phasecheck = maketimer(0.2, func {
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")) {
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")) {
setprop("/FMGC/status/phase", "2");
}
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.
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
setprop("/FMGC/status/phase", "5");
@ -114,6 +118,7 @@ var phasecheck = maketimer(0.2, func {
mcdu2.MCDU_reset();
setprop("/it-autoflight/input/fd1", fd1);
setprop("/it-autoflight/input/fd2", fd2);
press_init();
}
});

View file

@ -310,8 +310,8 @@ var master_elec = func {
setprop("/controls/hydraulic/rat-deployed", 1);
setprop("/controls/hydraulic/rat", 1);
setprop("/controls/electrical/switches/emer-gen", 1);
setprop("/systems/electrical/bus/dc-ess", ac_volt_std);
setprop("/systems/electrical/bus/ac-ess", dc_volt_std);
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
setprop("/systems/electrical/bus/ac-ess", ac_volt_std);
}
if (rat and (gs < 100)) {

View file

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

View file

@ -29,11 +29,93 @@ var pneu_init = func {
setprop("/systems/pneumatic/eng1-starter", 0);
setprop("/systems/pneumatic/eng2-starter", 0);
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 bleed1_sw = getprop("/controls/pneumatic/switches/bleed1");
@ -140,3 +222,9 @@ var update_pneumatic = func {
}
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
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:
- Joshua Davidson (it0uchpods)
@ -10,3 +10,5 @@ Including repaints by:
- Suleman Siddiqui (pakistan-1)
- Sven Seipp (D-SVEN)
- Various Others
Includes the RAT from the 787-9, positioned by Jonathan Redpath