1
0
Fork 0

Merge branch 'dev' into new-flightplan

This commit is contained in:
Jonathan Redpath 2022-01-25 16:18:46 +00:00
commit 37b032d419
17 changed files with 377 additions and 147 deletions

View file

@ -1521,11 +1521,12 @@
<!-- Cocktpit Door Switch -->
<animation>
<type>slider</type>
<type>knob</type>
<object-name>CockpitDoorSwitch</object-name>
<object-name>CockpitDoorSwitch.mark</object-name>
<property>controls/doors/doorc-switch</property>
<drag-direction>vertical</drag-direction>
<drag-scale-px>14</drag-scale-px>
<action>
<binding>
<command>property-adjust</command>
@ -4705,6 +4706,8 @@
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<not><property>FMGC/FCU-working</property></not>
<equals>
<property>it-autoflight/input/kts-mach</property>
<value>1</value>
@ -4730,6 +4733,7 @@
<property>it-autoflight/input/spd-managed</property>
<value>0</value>
</equals>
<property>FMGC/FCU-working</property>
</and>
</condition>
</animation>
@ -4751,6 +4755,7 @@
<property>it-autoflight/input/spd-managed</property>
<value>0</value>
</equals>
<property>FMGC/FCU-working</property>
</and>
</condition>
</animation>
@ -4793,6 +4798,7 @@
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<not><property>FMGC/FCU-working</property></not>
<equals>
<property>it-autoflight/custom/trk-fpa</property>
<value>0</value>
@ -4811,6 +4817,7 @@
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<not><property>FMGC/FCU-working</property></not>
<equals>
<property>it-autoflight/custom/trk-fpa</property>
<value>1</value>
@ -4832,6 +4839,7 @@
<property>it-autoflight/custom/show-hdg</property>
<value>1</value>
</equals>
<property>FMGC/FCU-working</property>
</and>
</condition>
</animation>
@ -4878,10 +4886,13 @@
<type>select</type>
<object-name>alt-text</object-name>
<condition>
<not-equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</not-equals>
<and>
<property>FMGC/FCU-working</property>
<not-equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</not-equals>
</and>
</condition>
</animation>
@ -4930,6 +4941,7 @@
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<not><property>FMGC/FCU-working</property></not>
<equals>
<property>it-autoflight/custom/trk-fpa</property>
<value>1</value>
@ -4952,6 +4964,7 @@
<property>it-autoflight/output/vert</property>
<value>1</value>
</equals>
<property>FMGC/FCU-working</property>
</and>
</condition>
</animation>
@ -4969,6 +4982,7 @@
<property>it-autoflight/output/vert</property>
<value>5</value>
</equals>
<property>FMGC/FCU-working</property>
</and>
</condition>
</animation>
@ -4990,6 +5004,7 @@
<property>it-autoflight/output/vert</property>
<value>5</value>
</not-equals>
<property>FMGC/FCU-working</property>
</and>
</condition>
</animation>

View file

@ -5,7 +5,7 @@
viewBox="0 0 1024 1024"
version="1.1"
id="svg2"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="iesi.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
@ -38,16 +38,16 @@
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="986"
inkscape:window-height="974"
id="namedview371"
showgrid="true"
inkscape:zoom="0.93517029"
inkscape:cx="815.35952"
inkscape:cy="762.42799"
inkscape:zoom="0.66126526"
inkscape:cx="369.74572"
inkscape:cy="772.76099"
inkscape:window-x="-11"
inkscape:window-y="-11"
inkscape:window-maximized="1"
inkscape:current-layer="ATTflag"
inkscape:current-layer="MsgBox"
showguides="true"
inkscape:snap-global="false"
units="pt"
@ -72,11 +72,11 @@
inkscape:label="MsgBox">
<rect
y="720.3349"
x="304.32764"
x="260.241"
height="91.330338"
width="406.27161"
width="490.202"
id="rect4448"
style="fill:#c9d121;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.17302;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
style="fill:#c9d121;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.48539;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
<text
inkscape:label="#text979"
transform="scale(1.0000144,0.9999856)"
@ -142,11 +142,11 @@
<g
id="ATTwarn">
<rect
style="fill:#c9d121;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
style="fill:#c9d121;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.23675;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
id="rect4484"
width="243.81277"
width="283.81299"
height="91.330353"
x="390.0936"
x="360.09399"
y="287.07605" />
<text
id="text4486"
@ -164,14 +164,15 @@
</g>
</g>
<g
id="ATTflag">
id="ATTflag"
style="display:inline">
<rect
y="720.3349"
x="304.32764"
x="260.241"
height="91.330338"
width="406.27161"
width="490.202"
id="attRstRect"
style="fill:#c9d121;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.17302;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
style="fill:#c9d121;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.48538;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
<text
inkscape:label="#text979"
transform="scale(1.0000144,0.9999856)"
@ -186,12 +187,12 @@
y="796.4032"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:86px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;stroke-width:0.75">ATT : RST</tspan></text>
<rect
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3.21458;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
id="ATTflag_rect"
width="243.81277"
height="91.330353"
x="390.0936"
y="287.07605" />
width="280.59842"
height="91.115768"
x="361.70129"
y="287.18335" />
<text
id="ATTflag_text"
y="363.13785"
@ -212,7 +213,8 @@
inkscape:label="IESI">
<g
id="AI_horizon"
inkscape:label="#g4573">
inkscape:label="#g4573"
style="display:inline">
<g
transform="translate(824.0447,-40.79798)"
inkscape:label="#g4312"
@ -618,7 +620,7 @@
</g>
</g>
<rect
style="opacity:1;fill:#1fa7f8;fill-opacity:1;stroke:none;stroke-width:2.58922;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
style="display:inline;opacity:1;fill:#1fa7f8;fill-opacity:1;stroke:none;stroke-width:2.58922;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="AI_sky_bank"
width="663.18652"
height="124.96"
@ -626,7 +628,7 @@
y="138.78481"
inkscape:label="#rect5809" />
<rect
style="opacity:0.5;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:10.0653;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
style="display:inline;opacity:0.5;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:10.0653;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
id="AI_bank_scale_clip"
width="663.21997"
height="229.7616"
@ -634,7 +636,7 @@
y="138.67441"
inkscape:label="#rect1094" />
<rect
style="opacity:0.46;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1.27697;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
style="display:inline;opacity:0.46;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1.27697;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="AI_horizon_clip"
width="663.21997"
height="608.67889"

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View file

@ -101,9 +101,6 @@ var altitude = props.globals.getNode("/instrumentation/altimeter/indicated-altit
var clbReducFt = props.globals.getNode("/systems/thrust/clbreduc-ft", 1);
var reducFt = props.globals.getNode("/FMGC/internal/accel-agl-ft", 1); # It's not AGL anymore
var thrAccSet = props.globals.getNode("/MCDUC/thracc-set", 1);
var flapTO = props.globals.getNode("/FMGC/internal/to-flap", 1);
var THSTO = props.globals.getNode("/FMGC/internal/to-ths", 1);
var flapTHSSet = props.globals.getNode("/FMGC/internal/flap-ths-set", 1);
var flex = props.globals.getNode("/FMGC/internal/flex", 1);
var flexSet = props.globals.getNode("/FMGC/internal/flex-set", 1);
var engOutAcc = props.globals.getNode("/FMGC/internal/eng-out-reduc", 1);
@ -4113,12 +4110,12 @@ var canvas_MCDU_base = {
me["Simple_L5"].setFontSize(small);
}
if (flapTHSSet.getValue() == 1) {
if (fmgc.FMGCInternal.toFlapThsSet) {
me["Simple_R3"].setFontSize(normal);
if (THSTO.getValue() >= 0) {
me["Simple_R3"].setText(sprintf("%s", flapTO.getValue()) ~ sprintf("/UP%2.1f", THSTO.getValue()));
if (fmgc.FMGCInternal.toThs) {
me["Simple_R3"].setText(sprintf("%s", fmgc.FMGCInternal.toFlap) ~ sprintf("/UP%2.1f", fmgc.FMGCInternal.toThs));
} else {
me["Simple_R3"].setText(sprintf("%s", flapTO.getValue()) ~ sprintf("/DN%2.1f", -1 * THSTO.getValue()));
me["Simple_R3"].setText(sprintf("%s", fmgc.FMGCInternal.toFlap) ~ sprintf("/DN%2.1f", -1 * fmgc.FMGCInternal.toThs));
}
} else {
me["Simple_R3"].setFontSize(small);

View file

@ -19,6 +19,7 @@ var engOpt = props.globals.getNode("/options/eng", 1);
var thrustState = [nil, nil];
# local variables
var takeoffConfig = 0;
var transmitFlag1 = 0;
var transmitFlag2 = 0;
var phaseVar3 = nil;
@ -2325,6 +2326,40 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(fctlSpdBrkStillOut);
}
if (fctlPitchTrimDisag.clearFlag == 0 and takeoffConfig and fmgc.FMGCInternal.toFlapThsSet and abs(-getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") - fmgc.FMGCInternal.toThs) >= 1.3) {
fctlPitchTrimDisag.active = 1;
fctlPitchTrimDisag2.active = 1;
} else {
ECAM_controller.warningReset(fctlPitchTrimDisag);
ECAM_controller.warningReset(fctlPitchTrimDisag2);
}
if (fctlFlapsDisag.clearFlag == 0 and takeoffConfig and fmgc.FMGCInternal.toFlapThsSet and (fmgc.FMGCInternal.toFlap + 1 != pts.Controls.Flight.flapsPos.getValue())) {
fctlFlapsDisag.active = 1;
} else {
ECAM_controller.warningReset(fctlFlapsDisag);
}
if (toSpdsDisag.clearFlag == 0 and takeoffConfig and fmgc.FMGCInternal.v1set and fmgc.FMGCInternal.vrset and fmgc.FMGCInternal.v2set and !(fmgc.FMGCInternal.v1 <= fmgc.FMGCInternal.vr and fmgc.FMGCInternal.vr <= fmgc.FMGCInternal.v2)) {
toSpdsDisag.active = 1;
} else {
ECAM_controller.warningReset(toSpdsDisag);
}
if (toSpdsTooLow.clearFlag == 0 and takeoffConfig and
fmgc.FMGCInternal.toFlapThsSet and fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet and fmgc.FMGCInternal.v1set and fmgc.FMGCInternal.vrset and fmgc.FMGCInternal.v2set
and (fmgc.FMGCInternal.v1 < mcdu.VMCG.getValue() or fmgc.FMGCInternal.vr < (mcdu.VMCA.getValue() * 1.05) or fmgc.FMGCInternal.v2 < (mcdu.VMCA.getValue() * 1.10) or fmgc.FMGCInternal.v2 < (1.13 * mcdu.chooseVS1G()))) {
toSpdsTooLow.active = 1;
} else {
ECAM_controller.warningReset(toSpdsTooLow);
}
if (toSpdsNotInserted.clearFlag == 0 and takeoffConfig and (!fmgc.FMGCInternal.v1set or !fmgc.FMGCInternal.vrset or !fmgc.FMGCInternal.v2set)) {
toSpdsNotInserted.active = 1;
} else {
ECAM_controller.warningReset(toSpdsNotInserted);
}
gearPosition = pts.Gear.position[1].getValue();
if (directLaw.clearFlag == 0 and warningNodes.Timers.directLaw.getValue() == 1 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) {
directLaw.active = 1;

View file

@ -494,6 +494,12 @@ var warnings = std.Vector.new([
# F/CTL SPD BRK STILL OUT
var fctlSpdBrkStillOut = warning.new(msg: "F/CTL SPD BRK STILL OUT ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var fctlPitchTrimDisag = warning.new(msg: "F/CTL", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var fctlPitchTrimDisag2 = warning.new(msg: "PITCH TRIM/MCDU/CG DISAGREE", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var fctlFlapsDisag = warning.new(msg: "F/CTL FLAPS/MCDU DISAGREE", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var toSpdsDisag = warning.new(msg: "T.O V1/VR/V2 DISAGREE ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var toSpdsTooLow = warning.new(msg: "T.O SPEEDS TOO LOW ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var toSpdsNotInserted = warning.new(msg: "T.O SPEEDS NOT INSERTED ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
# DIRECT LAW
var directLaw = warning.new(msg: "F/CTL DIRECT LAW", colour: "a", aural: 1, light: 1, isMainMsg: 1),

View file

@ -46,6 +46,7 @@ var Misc = {
};
var Position = {
airborne5Secs: props.globals.getNode("/systems/fmgc/airborne-5-secs"),
gearAglFtTemp: 0,
gearAglFt: props.globals.getNode("/position/gear-agl-ft", 1),
indicatedAltitudeFt: props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft", 1),
@ -449,7 +450,7 @@ var ITAF = {
},
ap1Master: func(s) {
if (s == 1) {
if (Output.vert.getValue() != 6 and !Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue() and systems.ELEC.Bus.acEss.getValue() >= 110 and fbw.FBW.apOff == 0 and Position.gearAglFt.getValue() >= 100) {
if (Output.vert.getValue() != 6 and !Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue() and FMGCNodes.Power.FMGC1Powered.getBoolValue() and fbw.FBW.apOff == 0 and Position.gearAglFt.getValue() >= 100 and Position.airborne5Secs.getBoolValue()) {
Output.ap1.setBoolValue(1);
me.updateFma();
Output.latTemp = Output.lat.getValue();
@ -471,7 +472,7 @@ var ITAF = {
},
ap2Master: func(s) {
if (s == 1) {
if (Output.vert.getValue() != 6 and !Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue() and systems.ELEC.Bus.acEss.getValue() >= 110 and fbw.FBW.apOff == 0 and Position.gearAglFt.getValue() >= 100) {
if (Output.vert.getValue() != 6 and !Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue() and FMGCNodes.Power.FMGC2Powered.getBoolValue() and fbw.FBW.apOff == 0 and Position.gearAglFt.getValue() >= 100 and Position.airborne5Secs.getBoolValue()) {
Output.ap2.setBoolValue(1);
me.updateFma();
Output.latTemp = Output.lat.getValue();
@ -502,7 +503,7 @@ var ITAF = {
},
athrMaster: func(s) {
if (s == 1) {
if (systems.ELEC.Bus.acEss.getValue() >= 110 and !pts.FMGC.CasCompare.casRejectAll.getBoolValue() and fbw.FBW.apOff == 0) {
if ((FMGCNodes.Power.FMGC1Powered.getBoolValue() or FMGCNodes.Power.FMGC2Powered.getBoolValue()) and !pts.FMGC.CasCompare.casRejectAll.getBoolValue() and fbw.FBW.apOff == 0) {
Output.athr.setBoolValue(1);
Custom.ThrLock.setValue(0);
Custom.Sound.enableAthrOff = 1;

View file

@ -132,6 +132,9 @@ var FMGCInternal = {
vrset: 0,
v2: 0,
v2set: 0,
toFlap: 0,
toThs: 0,
toFlapThsSet: 0,
# PERF APPR
destMag: 0,
@ -264,6 +267,10 @@ var FMGCNodes = {
ktsToMachFactor: props.globals.getNode("/FMGC/internal/kts-to-mach-factor"),
machToKtsFactor: props.globals.getNode("/FMGC/internal/mach-to-kts-factor"),
mngMachAlt: props.globals.getNode("/FMGC/internal/mng-alt-mach"),
Power: {
FMGC1Powered: props.globals.getNode("systems/fmgc/power/power-1-on"),
FMGC2Powered: props.globals.getNode("systems/fmgc/power/power-2-on"),
},
toFromSet: props.globals.initNode("/FMGC/internal/tofrom-set", 0, "BOOL"),
toState: props.globals.initNode("/FMGC/internal/to-state", 0, "BOOL"),
v1: props.globals.initNode("/FMGC/internal/v1", 0, "DOUBLE"),

View file

@ -195,7 +195,7 @@ var MessageController = {
typeIIMessages: std.Vector.new([
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),
TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),TypeIIMessage.new("V1/VR/V2 DISAGREE", "amb", 0),
TypeIIMessage.new("TO SPEED TOO LOW", "amb", 0),
TypeIIMessage.new("T.O SPEEDS TOO LOW", "amb", 0),TypeIIMessage.new("CHECK TAKE OFF DATA", "amb", 0),
TypeIIMessage.new("CHECK DEST DATA", "amb", 0), #p.533
TypeIIMessage.new("GPS PRIMARY"),TypeIIMessage.new("GPS PRIMARY LOST", "amb", 0),
]),

View file

@ -558,6 +558,19 @@ var departurePage = {
me.selectedRunway = me.depAirport[0].runway(me.runways[index - 2 + me.scrollRwy]);
me.makeTmpy();
fmgc.flightPlanController.flightplans[me.computer].departure_runway = me.selectedRunway;
mcdu.perfToCheckTakeoffData(me.computer);
if (fmgc.FMGCInternal.v1set) {
fmgc.FMGCInternal.v1set = 0;
fmgc.FMGCInternal.v1 = 0;
}
if (fmgc.FMGCInternal.vrset) {
fmgc.FMGCInternal.vrset = 0;
fmgc.FMGCInternal.vr = 0;
}
if (fmgc.FMGCInternal.v2set) {
fmgc.FMGCInternal.v2set = 0;
fmgc.FMGCInternal.v2 = 0;
}
me.updateRunways();
me.updatePage();
fmgc.flightPlanController.flightPlanChanged(me.computer);

View file

@ -5,11 +5,7 @@ var OOOIReport = {
new: func(state,time=0,fob="") {
var report = {parents:[OOOIReport]};
report.state = state;
if (acconfig_weight_kgs.getValue() == 1) {
report.fob = (fob != "") ? fob : fmgc.FMGCInternal.fob * LBS2KGS;
} else {
report.fob = (fob != "") ? fob : fmgc.FMGCInternal.fob;
}
report.fob = (fob != "") ? fob : fmgc.FMGCInternal.fob;
if (time != 0) {
report.time = formatSecToHHMM(time);
report.elapsed = time;

View file

@ -169,6 +169,7 @@ var fuelPredInput = func(key, i) {
fmgc.fuelCalculating.setValue(1);
}
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
} else if (find("/", scratchpad) != -1) {
if (acconfig_weight_kgs.getValue() == 1) {
scratchpad = scratchpad / LBS2KGS;
@ -199,6 +200,7 @@ var fuelPredInput = func(key, i) {
fmgc.fuelCalculating.setValue(1);
}
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
} else {
mcdu_message(i, "ENTRY OUT OF RANGE");
}
@ -235,6 +237,7 @@ var fuelPredInput = func(key, i) {
fmgc.fuelCalculating.setValue(1);
}
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
} else {
mcdu_message(i, "ENTRY OUT OF RANGE");
}

View file

@ -207,6 +207,7 @@ var initInputB = func(key, i) {
fmgc.blockCalculating.setValue(1);
}
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
} else if (find("/", scratchpad) != -1) {
if (acconfig_weight_kgs.getValue() == 1) {
scratchpad = scratchpad / LBS2KGS;
@ -238,6 +239,7 @@ var initInputB = func(key, i) {
fmgc.blockCalculating.setValue(1);
}
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
} else {
mcdu_message(i, "ENTRY OUT OF RANGE");
}
@ -275,6 +277,7 @@ var initInputB = func(key, i) {
fmgc.blockCalculating.setValue(1);
}
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
} else {
mcdu_message(i, "ENTRY OUT OF RANGE");
}

View file

@ -155,9 +155,9 @@ var MCDU_reset = func(i) {
fmgc.FMGCInternal.v2set = 0;
setprop("/FMGC/internal/accel-agl-ft", 1500); #eventually set to 1500 above runway
setprop("/MCDUC/thracc-set", 0);
setprop("/FMGC/internal/to-flap", 0);
setprop("/FMGC/internal/to-ths", "0.0");
setprop("/FMGC/internal/flap-ths-set", 0);
fmgc.FMGCInternal.toFlap = 0;
fmgc.FMGCInternal.toThs = 0.0;
fmgc.FMGCInternal.toFlapThsSet = 0;
setprop("/FMGC/internal/flex", 0);
setprop("/FMGC/internal/flex-set", 0);
setprop("/FMGC/internal/eng-out-reduc", "1500");
@ -1534,17 +1534,16 @@ var button = func(btn, i, event = "") {
} else if (btn == "DOT") {
mcdu_scratchpad.scratchpads[i].addChar(".");
} else if (btn == "PLUSMINUS") {
if (right(mcdu_scratchpad.scratchpads[i].scratchpad, 1) == "-") {
var _toggle = right(scratchpad,1);
if (_toggle == "+" or _toggle == "-") {
_toggle = (_toggle == "-") ? "+" : "-";
mcdu_scratchpad.scratchpads[i].clear();
mcdu_scratchpad.scratchpads[i].addChar("+");
} else if (right(mcdu_scratchpad.scratchpads[i].scratchpad, 1) == "+") {
mcdu_scratchpad.scratchpads[i].clear();
mcdu_scratchpad.scratchpads[i].addChar("-");
mcdu_scratchpad.scratchpads[i].addChar(_toggle);
} else {
mcdu_scratchpad.scratchpads[i].addChar("-");
}
} else if (btn == "OVFY") {
if (mcdu_scratchpad.scratchpads[i].scratchpad == "") {
if (size(scratchpad) == 0) {
mcdu_scratchpad.scratchpads[i].addChar("@");
} else {
mcdu_message(i, "NOT ALLOWED");

View file

@ -3,19 +3,55 @@
# Copyright (c) 2020 Josh Davidson (Octal450)
# Copyright (c) 2020 Matthew Maring (mattmaring)
# VMCA 109.5 at 0ft
# VMCG 106.5 at 0ft all conf
var standard_VMCA = 109.5; # TODO calculate VMCA/VMCG on altitude (ft) of departure airport (read below)
var standard_VMCG = 106.5;
# TODO - DepArp elevation or current elevation (on ground only!!) -> math.round(fmgc.flightPlanController.flightplans[2].departure.elevation * M2FT))
var perfTOCheckVSpeeds = func(i) {
if (fmgc.FMGCInternal.v1set == 1 and fmgc.FMGCInternal.vrset == 1 and fmgc.FMGCInternal.v2set == 1) { # only when v1/vr/v2 all sets
if (fmgc.FMGCInternal.v1>fmgc.FMGCInternal.vr or fmgc.FMGCInternal.vr > fmgc.FMGCInternal.v2) mcdu_messageTypeII(i,"V1/VR/V2 DISAGREE");
else if (fmgc.FMGCInternal.v1<standard_VMCG or fmgc.FMGCInternal.vr<(standard_VMCA*1.05) or fmgc.FMGCInternal.v2<(standard_VMCA*1.10)) mcdu_messageTypeII(i,"TO SPEED TOO LOW");
#else if (Vr<KVr*VS1G or V2<KV2*VS1G) mcdu_messageTypeII(i,"TO SPEED TOO LOW"); #TODO - check to VS1G and look constant KVr KV2 on manual, not own by me :/
var doneMessageCheck = 0;
var perfToCheckTakeoffData = func(i) {
if (fmgc.FMGCInternal.v1set and fmgc.FMGCInternal.vrset and fmgc.FMGCInternal.v2set) {
if (doneMessageCheck) {
mcdu_scratchpad.messageQueues[i].deleteWithText("CHECK TAKE OFF DATA");
}
mcdu_scratchpad.messageQueues[i].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("CHECK TAKE OFF DATA"));
doneMessageCheck = 1;
}
}
var doneMessageDisag = 0;
var perfTOCheckVSpeedsConsistency = func(i) {
if (fmgc.FMGCInternal.v1set and fmgc.FMGCInternal.vrset and fmgc.FMGCInternal.v2set) {
if (!(fmgc.FMGCInternal.v1 <= fmgc.FMGCInternal.vr and fmgc.FMGCInternal.vr <= fmgc.FMGCInternal.v2)) {
if (doneMessageDisag) {
mcdu_scratchpad.messageQueues[i].deleteWithText("V1/VR/V2 DISAGREE");
}
mcdu_scratchpad.messageQueues[i].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("V1/VR/V2 DISAGREE"));
doneMessageDisag = 1;
}
}
}
var VMCA = props.globals.getNode("/FMGC/internal/vmca-kt");
var VMCG = props.globals.getNode("/FMGC/internal/vmcg-kt");
var chooseVS1G = func() {
if (fmgc.FMGCInternal.toFlap == 1) {
return fmgc.FMGCInternal.vs1g_conf_1f;
} elsif (fmgc.FMGCInternal.toFlap == 2) {
return fmgc.FMGCInternal.vs1g_conf_2;
} elsif (fmgc.FMGCInternal.toFlap == 3) {
return fmgc.FMGCInternal.vs1g_conf_3;
}
};
var doneMessageToLow = 0;
var perfTOCheckVSpeedsLimitations = func(i) {
if (fmgc.FMGCInternal.toFlapThsSet and fmgc.FMGCInternal.zfwSet and fmgc.FMGCInternal.blockSet and fmgc.FMGCInternal.v1set and fmgc.FMGCInternal.vrset and fmgc.FMGCInternal.v2set) {
if (fmgc.FMGCInternal.v1 < VMCG.getValue() or fmgc.FMGCInternal.vr < (VMCA.getValue() * 1.05) or fmgc.FMGCInternal.v2 < (VMCA.getValue() * 1.10) or fmgc.FMGCInternal.v2 < (1.13 * chooseVS1G())) {
if (doneMessageToLow) {
mcdu_scratchpad.messageQueues[i].deleteWithText("T.O SPEEDS TOO LOW");
}
mcdu_scratchpad.messageQueues[i].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("T.O SPEEDS TOO LOW"));
doneMessageToLow = 1;
}
}
}
@ -42,7 +78,8 @@ var perfTOInput = func(key, i) {
fmgc.FMGCNodes.v1set.setValue(1);
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeeds(i); # do V-speeds validation
perfTOCheckVSpeedsConsistency(i);
perfTOCheckVSpeedsLimitations(i);
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -63,7 +100,8 @@ var perfTOInput = func(key, i) {
fmgc.FMGCInternal.vrset = 1;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeeds(i); # do V-speeds validation
perfTOCheckVSpeedsConsistency(i);
perfTOCheckVSpeedsLimitations(i);
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -87,7 +125,8 @@ var perfTOInput = func(key, i) {
setprop("/it-autoflight/settings/togaspd", scratchpad);
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeeds(i); # do V-speeds validation
perfTOCheckVSpeedsConsistency(i);
perfTOCheckVSpeedsLimitations(i);
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -152,9 +191,9 @@ var perfTOInput = func(key, i) {
}
} else if (key == "R3" and modifiable) {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/to-flap", 0);
setprop("/FMGC/internal/to-ths", "0.0");
setprop("/FMGC/internal/flap-ths-set", 0);
fmgc.FMGCInternal.toFlap = 0;
fmgc.FMGCInternal.toThs = 0;
fmgc.FMGCInternal.toFlapThsSet = 0;
mcdu_scratchpad.scratchpads[i].empty();
} else {
if (find("/", scratchpad) != -1) {
@ -165,45 +204,71 @@ var perfTOInput = func(key, i) {
var trims = size(trim);
var trima = substr(trim, 2);
var trimb = substr(trim, 0, 3);
var validtrima = num(trima) != nil and num(trima) >= 0 and num(trima) <= 7.0;
var validtrimb = num(trimb) != nil and num(trimb) >= 0 and num(trimb) <= 7.0;
if (flaps == 0 and getprop("/FMGC/internal/flap-ths-set")) {
if (flaps == 0 and fmgc.FMGCInternal.toFlapThsSet) {
if (trims == 5 and find("DN", trim) != -1 and validtrima) {
setprop("/FMGC/internal/to-ths", -1 * trima);
fmgc.FMGCInternal.toThs = -1 * trima;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
perfToCheckTakeoffData(i);
} else if (trims == 5 and find("DN", trim) != -1 and validtrimb) {
setprop("/FMGC/internal/to-ths", -1 * trimb);
fmgc.FMGCInternal.toThs = -1 * trimb;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
perfToCheckTakeoffData(i);
} else if (trims == 5 and find("UP", trim) != -1 and validtrima) {
setprop("/FMGC/internal/to-ths", trima);
fmgc.FMGCInternal.toThs = trima;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
perfToCheckTakeoffData(i);
} else if (trims == 5 and find("UP", trim) != -1 and validtrimb) {
setprop("/FMGC/internal/to-ths", trimb);
fmgc.FMGCInternal.toThs = trimb;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
perfToCheckTakeoffData(i);
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (flaps == 1 and num(flap) != nil and flap >= 0 and flap <= 3) {
if (trims == 5 and find("DN", trim) != -1 and validtrima) {
setprop("/FMGC/internal/to-flap", flap);
setprop("/FMGC/internal/to-ths", -1 * trima);
setprop("/FMGC/internal/flap-ths-set", 1);
fmgc.FMGCInternal.toFlap = flap;
fmgc.FMGCInternal.toThs = -1 * trima;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
if (fmgc.FMGCInternal.toFlapThsSet) {
perfToCheckTakeoffData(i);
}
fmgc.FMGCInternal.toFlapThsSet = 1;
} else if (trims == 5 and find("DN", trim) != -1 and validtrimb) {
setprop("/FMGC/internal/to-flap", flap);
setprop("/FMGC/internal/to-ths", -1 * trimb);
setprop("/FMGC/internal/flap-ths-set", 1);
fmgc.FMGCInternal.toFlap = flap;
fmgc.FMGCInternal.toThs = -1 * trimb;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
if (fmgc.FMGCInternal.toFlapThsSet) {
perfToCheckTakeoffData(i);
}
fmgc.FMGCInternal.toFlapThsSet = 1;
} else if (trims == 5 and find("UP", trim) != -1 and validtrima) {
setprop("/FMGC/internal/to-flap", flap);
setprop("/FMGC/internal/to-ths", trima);
setprop("/FMGC/internal/flap-ths-set", 1);
fmgc.FMGCInternal.toFlap = flap;
fmgc.FMGCInternal.toThs = trima;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
if (fmgc.FMGCInternal.toFlapThsSet) {
perfToCheckTakeoffData(i);
}
fmgc.FMGCInternal.toFlapThsSet = 1;
} else if (trims == 5 and find("UP", trim) != -1 and validtrimb) {
setprop("/FMGC/internal/to-flap", flap);
setprop("/FMGC/internal/to-ths", trimb);
setprop("/FMGC/internal/flap-ths-set", 1);
fmgc.FMGCInternal.toFlap = flap;
fmgc.FMGCInternal.toThs = trimb;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
if (fmgc.FMGCInternal.toFlapThsSet) {
perfToCheckTakeoffData(i);
}
fmgc.FMGCInternal.toFlapThsSet = 1;
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -211,11 +276,13 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
} else if (size(scratchpad) == 1 and num(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 3) {
setprop("/FMGC/internal/to-flap", scratchpad);
if (!getprop("/FMGC/internal/flap-ths-set")) {
setprop("/FMGC/internal/flap-ths-set", 1);
}
fmgc.FMGCInternal.toFlap = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeedsLimitations(i);
if (fmgc.FMGCInternal.toFlapThsSet) {
perfToCheckTakeoffData(i);
}
fmgc.FMGCInternal.toFlapThsSet = 1;
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -233,6 +300,8 @@ var perfTOInput = func(key, i) {
setprop("/FMGC/internal/flex-set", 1);
var flex_calc = getprop("/FMGC/internal/flex") - getprop("environment/temperature-degc");
setprop("/FMGC/internal/flex-cmd", flex_calc);
perfTOCheckVSpeedsLimitations(i);
perfToCheckTakeoffData(i);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");

View file

@ -1,15 +1,5 @@
# A3XX Electrical System
# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
# Local vars
var battery1_sw = 0;
var battery2_sw = 0;
var batt1_fail = 0;
var batt2_fail = 0;
var battery1_percent = 0;
var battery2_percent = 0;
var dc1 = 0;
var dc2 = 0;
# Copyright (c) 2021 Jonathan Redpath (legoboyvdlp)
# Main class
var ELEC = {
@ -202,47 +192,33 @@ var ELEC = {
me.Fail.tr1Fault.setBoolValue(0);
me.Fail.tr2Fault.setBoolValue(0);
},
_FMGC1: 0,
_FMGC2: 0,
_activeFMGC: nil,
_timer1On: 0,
_timer2On: 0,
loop: func(notification) {
# Autopilot Disconnection routines
me._activeFMGC = fcu.FCUController.activeFMGC.getValue();
me._FMGC1 = fmgc.Output.ap1.getValue();
me._FMGC2 = fmgc.Output.ap2.getValue();
if (notification.dcEssShed < 25) {
if (me._FMGC1 and !me._timer1On) { # delay 1 cycle to avoid spurious
me._timer1On = 1;
} elsif (me._FMGC1) {
if (notification.dcEssShed < 25) {
fcu.apOff("hard", 1);
if (me._activeFMGC == 1) {
fcu.athrOff("hard");
}
}
me._timer1On = 0;
}
}
if (notification.dc2 < 25) {
if (me._FMGC2 and !me._timer2On) { # delay 1 cycle to avoid spurious
me._timer2On = 1;
} elsif (me._FMGC2) {
if (notification.dc2 < 25) {
fcu.apOff("hard", 2);
if (me._activeFMGC == 2) {
fcu.athrOff("hard");
}
}
me._timer2On = 0;
}
}
loop: func() {
# Empty
},
};
setlistener("/systems/fmgc/power/power-1-on", func(val) {
if (!val.getBoolValue()) {
if (fmgc.Output.ap1.getValue()) {
fcu.apOff("hard", 1);
}
if (fcu.FCUController.activeFMGC.getValue() == 1 and fmgc.Output.athr.getValue()) {
fcu.athrOff("hard");
}
}
}, 0, 0);
setlistener("/systems/fmgc/power/power-2-on", func(val) {
if (!val.getBoolValue()) {
if (fmgc.Output.ap2.getValue()) {
fcu.apOff("hard", 2);
}
if (fcu.FCUController.activeFMGC.getValue() == 2 and fmgc.Output.athr.getValue()) {
fcu.athrOff("hard");
}
}
}, 0, 0);
# Emesary
var A320Electrical = notifications.SystemRecipient.new("A320 Electrical",ELEC.loop,ELEC);
emesary.GlobalTransmitter.Register(A320Electrical);

View file

@ -4,7 +4,120 @@
<system name="A320: FMGC">
<channel name="FMGC Power" execrate="8">
<switch name="/systems/fmgc/power/power-1">
<default value="0"/>
<test logic="OR" value="1">
/systems/electrical/bus/dc-ess-shed ge 25
</test>
</switch>
<switch name="/systems/fmgc/power/power-2">
<default value="0"/>
<test logic="OR" value="1">
/systems/electrical/bus/dc-2 ge 25
</test>
</switch>
<actuator name="/systems/fmgc/power/power-1-timer">
<input>/systems/fmgc/power/power-1</input>
<rate_limit sense="decr">5</rate_limit>
<rate_limit sense="incr">100</rate_limit>
</actuator>
<actuator name="/systems/fmgc/power/power-2-timer">
<input>/systems/fmgc/power/power-2</input>
<rate_limit sense="decr">5</rate_limit>
<rate_limit sense="incr">100</rate_limit>
</actuator>
<switch name="/systems/fmgc/power/power-1-on">
<default value="0"/>
<test logic="OR" value="1">
/systems/fmgc/power/power-1-timer ne 0
</test>
</switch>
<switch name="/systems/fmgc/power/power-2-on">
<default value="0"/>
<test logic="OR" value="1">
/systems/fmgc/power/power-2-timer ne 0
</test>
</switch>
</channel>
<channel name="Envelope Protection" execrate="8">
<!-- VMCA -->
<fcs_function name="/FMGC/internal/vmca-kt">
<function>
<table>
<independentVar lookup="row">/position/altitude-ft</independentVar>
<tableData>
-2000 112.0
0 110.0
2000 108.0
4000 107.5
6000 105.5
8000 103.0
9200 101.2
10000 100.0
12000 96.5
14100 93.5
</tableData>
</table>
</function>
</fcs_function>
<!-- VMCG -->
<fcs_function name="/FMGC/internal/vmcg-kt">
<function>
<table>
<independentVar lookup="row">/position/altitude-ft</independentVar>
<independentVar lookup="column">fcs/flap-pos-deg</independentVar>
<tableData>
10 15 20
-2000 111.5 109.5 109.0
0 109.5 107.5 107.0
2000 107.5 105.5 105.0
4000 107.0 105.0 104.5
6000 105.0 103.0 103.0
8000 103.0 101.0 100.5
9200 101.0 99.0 98.5
10000 100.0 98.0 97.5
12000 96.5 94.5 94.0
14100 93.0 91.0 91.0
</tableData>
</table>
</function>
</fcs_function>
</channel>
<channel name="FMGC" execrate="8">
<switch name="/systems/fmgc/airborne">
<default value="0"/>
<test logic="OR" value="1">
/gear/gear[1]/wow eq 0
/gear/gear[2]/wow eq 0
</test>
</switch>
<actuator name="/systems/fmgc/airborne-timer">
<input>/systems/fmgc/airborne</input>
<rate_limit sense="decr">100</rate_limit>
<rate_limit sense="incr">0.2</rate_limit>
</actuator>
<switch name="/systems/fmgc/airborne-5-secs">
<default value="0"/>
<test logic="OR" value="1">
/systems/fmgc/airborne-timer eq 1
</test>
</switch>
<fcs_function name="/systems/fmgc/cas-compare/cas-1-to-3">
<function>

View file

@ -168,11 +168,6 @@
<suction>/systems/vacuum/suction-inhg</suction>
</heading-indicator>
<KT-70>
<name>kt-70</name>
<number>0</number>
</KT-70>
<magnetic-compass>
<name>magnetic-compass</name>
<number>0</number>