1
0
Fork 0

Merge branch 'dev' into 3D

This commit is contained in:
Jonathan Redpath 2022-01-03 21:59:06 +00:00
commit 8ae328ff78
8 changed files with 418 additions and 312 deletions

View file

@ -1421,15 +1421,22 @@
</fuel>
<gear type="bool">0</gear>
<hydraulic>
<blue-edp type="bool">0</blue-edp>
<blue-elec type="bool">0</blue-elec>
<blue-elec-ovht type="bool">0</blue-elec-ovht>
<blue-leak type="bool">0</blue-leak>
<blue-reservoir-air-press-lo type="bool">0</blue-reservoir-air-press-lo> <!-- true at 22 psi relative, false at 25 psi relative -->
<blue-reservoir-ovht type="bool">0</blue-reservoir-ovht> <!-- 95 deg, cancel at 88.4 deg -->
<green-edp type="bool">0</green-edp>
<green-leak type="bool">0</green-leak>
<green-reservoir-air-press-lo type="bool">0</green-reservoir-air-press-lo>
<green-reservoir-ovht type="bool">0</green-reservoir-ovht>
<ptu type="bool">0</ptu>
<yellow-edp type="bool">0</yellow-edp>
<yellow-elec type="bool">0</yellow-elec>
<yellow-elec-ovht type="bool">0</yellow-elec-ovht> <!-- 162 deg -->
<yellow-leak type="bool">0</yellow-leak>
<yellow-reservoir-air-press-lo type="bool">0</yellow-reservoir-air-press-lo>
<yellow-reservoir-ovht type="bool">0</yellow-reservoir-ovht>
</hydraulic>
<icing>
<wing-left-valve type="bool">0</wing-left-valve>

View file

@ -1,15 +1,6 @@
# A3XX Lower ECAM Canvas
# Copyright (c) 2021 Josh Davidson (Octal450) and Jonathan Redpath
var elec_pump_y_ovht = props.globals.initNode("/systems/hydraulic/elec-pump-yellow-ovht", 0, "BOOL");
var elec_pump_b_ovht = props.globals.initNode("/systems/hydraulic/elec-pump-blue-ovht", 0, "BOOL");
var y_resv_ovht = props.globals.initNode("/systems/hydraulic/yellow-resv-ovht", 0, "BOOL");
var b_resv_ovht = props.globals.initNode("/systems/hydraulic/blue-resv-ovht", 0, "BOOL");
var g_resv_ovht = props.globals.initNode("/systems/hydraulic/green-resv-ovht", 0, "BOOL");
var y_resv_lo_press = props.globals.initNode("/systems/hydraulic/yellow-resv-lo-air-press", 0, "BOOL");
var b_resv_lo_press = props.globals.initNode("/systems/hydraulic/blue-resv-lo-air-press", 0, "BOOL");
var g_resv_lo_press = props.globals.initNode("/systems/hydraulic/green-resv-lo-air-press", 0, "BOOL");
var canvas_lowerECAMPageHyd =
{
new: func(svg,name) {
@ -46,22 +37,33 @@ var canvas_lowerECAMPageHyd =
# init
obj.update_items = [
props.UpdateManager.FromHashValue("blue", 25, func(val) {
if (val >= 100) {
obj["Press-Blue"].setText(sprintf("%s", math.round(val, 50)));
} else {
obj["Press-Blue"].setText(sprintf("%s", 0));
}
if (val > 1450) {
obj["Blue-Line"].setColor(0.0509,0.7529,0.2941);
obj["Blue-Line"].setColorFill(0.0509,0.7529,0.2941);
obj["Blue-Line-Top"].setColorFill(0.0509,0.7529,0.2941);
obj["Blue-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941);
obj["Blue-Indicator"].setColor(0.0509,0.7529,0.2941);
obj["Press-Blue"].setColor(0.0509,0.7529,0.2941);
obj["Blue-label"].setColor(0.8078,0.8039,0.8078);
props.UpdateManager.FromHashList(["blue", "dcEssShed"], 25, func(val) {
if (val.dcEssShed >= 25) {
if (val.blue >= 100) {
obj["Press-Blue"].setText(sprintf("%s", math.round(val.blue, 50)));
} else {
obj["Press-Blue"].setText(sprintf("%s", 0));
}
if (val.blue > 1450) {
obj["Blue-Line"].setColor(0.0509,0.7529,0.2941);
obj["Blue-Line"].setColorFill(0.0509,0.7529,0.2941);
obj["Blue-Line-Top"].setColorFill(0.0509,0.7529,0.2941);
obj["Blue-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941);
obj["Blue-Indicator"].setColor(0.0509,0.7529,0.2941);
obj["Press-Blue"].setColor(0.0509,0.7529,0.2941);
obj["Blue-label"].setColor(0.8078,0.8039,0.8078);
} else {
obj["Blue-Line"].setColor(0.7333,0.3803,0);
obj["Blue-Line"].setColorFill(0.7333,0.3803,0);
obj["Blue-Line-Top"].setColorFill(0.7333,0.3803,0);
obj["Blue-Line-Bottom"].setColorFill(0.7333,0.3803,0);
obj["Blue-Indicator"].setColor(0.7333,0.3803,0);
obj["Press-Blue"].setColor(0.7333,0.3803,0);
obj["Blue-label"].setColor(0.7333,0.3803,0);
}
} else {
obj["Press-Blue"].setText(sprintf("%s", "XX"));
obj["Blue-Line"].setColor(0.7333,0.3803,0);
obj["Blue-Line"].setColorFill(0.7333,0.3803,0);
obj["Blue-Line-Top"].setColorFill(0.7333,0.3803,0);
@ -71,23 +73,35 @@ var canvas_lowerECAMPageHyd =
obj["Blue-label"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("yellow", 25, func(val) {
if (val >= 100) {
obj["Press-Yellow"].setText(sprintf("%s", math.round(val, 50)));
} else {
obj["Press-Yellow"].setText(sprintf("%s", 0));
}
if (val > 1450) {
obj["Yellow-Line"].setColor(0.0509,0.7529,0.2941);
obj["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941);
obj["Yellow-Line-Top"].setColorFill(0.0509,0.7529,0.2941);
obj["Yellow-Line-Middle"].setColorFill(0.0509,0.7529,0.2941);
obj["Yellow-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941);
obj["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941);
obj["Press-Yellow"].setColor(0.0509,0.7529,0.2941);
obj["Yellow-label"].setColor(0.8078,0.8039,0.8078);
props.UpdateManager.FromHashList(["yellow", "dcEssShed"], 25, func(val) {
if (val.dcEssShed >= 25) {
if (val.yellow >= 100) {
obj["Press-Yellow"].setText(sprintf("%s", math.round(val.yellow, 50)));
} else {
obj["Press-Yellow"].setText(sprintf("%s", 0));
}
if (val.yellow > 1450) {
obj["Yellow-Line"].setColor(0.0509,0.7529,0.2941);
obj["Yellow-Line"].setColorFill(0.0509,0.7529,0.2941);
obj["Yellow-Line-Top"].setColorFill(0.0509,0.7529,0.2941);
obj["Yellow-Line-Middle"].setColorFill(0.0509,0.7529,0.2941);
obj["Yellow-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941);
obj["Yellow-Indicator"].setColor(0.0509,0.7529,0.2941);
obj["Press-Yellow"].setColor(0.0509,0.7529,0.2941);
obj["Yellow-label"].setColor(0.8078,0.8039,0.8078);
} else {
obj["Yellow-Line"].setColor(0.7333,0.3803,0);
obj["Yellow-Line"].setColorFill(0.7333,0.3803,0);
obj["Yellow-Line-Top"].setColorFill(0.7333,0.3803,0);
obj["Yellow-Line-Middle"].setColorFill(0.7333,0.3803,0);
obj["Yellow-Line-Bottom"].setColorFill(0.7333,0.3803,0);
obj["Yellow-Indicator"].setColor(0.7333,0.3803,0);
obj["Press-Yellow"].setColor(0.7333,0.3803,0);
obj["Yellow-label"].setColor(0.7333,0.3803,0);
}
} else {
obj["Press-Yellow"].setText(sprintf("%s", "XX"));
obj["Yellow-Line"].setColor(0.7333,0.3803,0);
obj["Yellow-Line"].setColorFill(0.7333,0.3803,0);
obj["Yellow-Line-Top"].setColorFill(0.7333,0.3803,0);
@ -98,23 +112,35 @@ var canvas_lowerECAMPageHyd =
obj["Yellow-label"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("green", 25, func(val) {
if (val >= 100) {
obj["Press-Green"].setText(sprintf("%s", math.round(val, 50)));
} else {
obj["Press-Green"].setText(sprintf("%s", 0));
}
if (val > 1450) {
obj["Green-Line"].setColor(0.0509,0.7529,0.2941);
obj["Green-Line"].setColorFill(0.0509,0.7529,0.2941);
obj["Green-Line-Top"].setColorFill(0.0509,0.7529,0.2941);
obj["Green-Line-Middle"].setColorFill(0.0509,0.7529,0.2941);
obj["Green-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941);
obj["Green-Indicator"].setColor(0.0509,0.7529,0.2941);
obj["Press-Green"].setColor(0.0509,0.7529,0.2941);
obj["Green-label"].setColor(0.8078,0.8039,0.8078);
props.UpdateManager.FromHashList(["green", "dcEssShed"], 25, func(val) {
if (val.dcEssShed) {
if (val.green >= 100) {
obj["Press-Green"].setText(sprintf("%s", math.round(val.green, 50)));
} else {
obj["Press-Green"].setText(sprintf("%s", 0));
}
if (val.green > 1450) {
obj["Green-Line"].setColor(0.0509,0.7529,0.2941);
obj["Green-Line"].setColorFill(0.0509,0.7529,0.2941);
obj["Green-Line-Top"].setColorFill(0.0509,0.7529,0.2941);
obj["Green-Line-Middle"].setColorFill(0.0509,0.7529,0.2941);
obj["Green-Line-Bottom"].setColorFill(0.0509,0.7529,0.2941);
obj["Green-Indicator"].setColor(0.0509,0.7529,0.2941);
obj["Press-Green"].setColor(0.0509,0.7529,0.2941);
obj["Green-label"].setColor(0.8078,0.8039,0.8078);
} else {
obj["Green-Line"].setColor(0.7333,0.3803,0);
obj["Green-Line"].setColorFill(0.7333,0.3803,0);
obj["Green-Line-Top"].setColorFill(0.7333,0.3803,0);
obj["Green-Line-Middle"].setColorFill(0.7333,0.3803,0);
obj["Green-Line-Bottom"].setColorFill(0.7333,0.3803,0);
obj["Green-Indicator"].setColor(0.7333,0.3803,0);
obj["Press-Green"].setColor(0.7333,0.3803,0);
obj["Green-label"].setColor(0.7333,0.3803,0);
}
} else {
obj["Press-Green"].setText(sprintf("%s", "XX"));
obj["Green-Line"].setColor(0.7333,0.3803,0);
obj["Green-Line"].setColorFill(0.7333,0.3803,0);
obj["Green-Line-Top"].setColorFill(0.7333,0.3803,0);
@ -514,14 +540,14 @@ var canvas_lowerECAMPageHyd =
};
var input = {
hydBlueResvOvht: "/systems/hydraulic/blue-resv-ovht",
hydGreenResvOvht: "/systems/hydraulic/green-resv-ovht",
hydYellowResvOvht: "/systems/hydraulic/yellow-resv-ovht",
hydBlueResvLoPrs: "/systems/hydraulic/blue-resv-lo-air-press",
hydGreenResvLoPrs: "/systems/hydraulic/green-resv-lo-air-press",
hydYellowResvLoPrs: "/systems/hydraulic/yellow-resv-lo-air-press",
hydYellowElecPumpOvht: "/systems/hydraulic/elec-pump-yellow-ovht",
hydBlueElecPumpOvht: "/systems/hydraulic/elec-pump-blue-ovht",
hydBlueResvOvht: "/systems/hydraulic/relays/blue-reservoir-overheat",
hydGreenResvOvht: "/systems/hydraulic/relays/green-reservoir-overheat",
hydYellowResvOvht: "/systems/hydraulic/relays/yellow-reservoir-overheat",
hydBlueResvLoPrs: "/systems/failures/hydraulic/blue-reservoir-air-press-lo",
hydGreenResvLoPrs: "/systems/failures/hydraulic/green-reservoir-air-press-lo",
hydYellowResvLoPrs: "/systems/failures/hydraulic/yellow-reservoir-air-press-lo",
hydBlueElecPumpOvht: "/systems/failures/hydraulic/blue-elec-ovht",
hydYellowElecPumpOvht: "/systems/failures/hydraulic/yellow-elec-ovht",
hydRATPosition: "/systems/hydraulic/sources/rat/position",
hydGreenFireValve: "/systems/hydraulic/sources/green-edp/fire-valve",
hydYellowFireValve: "/systems/hydraulic/sources/yellow-edp/fire-valve",
@ -531,7 +557,7 @@ var input = {
hydYellowEDPPumpSwitch: "/controls/hydraulic/switches/yellow-edp",
hydPTUSwitch: "/controls/hydraulic/switches/ptu",
hydPTUFault: "/systems/failures/hydraulic/ptu",
hydPTUActive: "/systems/hydraulic/sources/ptu/ptu-hydraulic-condition",
hydPTUActive: "/systems/hydraulic/sources/ptu/ptu-loop-sound-cmd",
hydPTUDiff: "/systems/hydraulic/yellow-psi-diff",
hydBlueQTY: "/systems/hydraulic/blue-qty",
hydGreenQTY: "/systems/hydraulic/green-qty",

View file

@ -261,22 +261,6 @@
</condition>
</animation>
<animation>
<type>material</type>
<object-name>Battery-volt</object-name>
<object-name>Battery-volt-test</object-name>
<emission>
<red>1</red>
<green>1</green>
<blue>1</blue>
</emission>
<diffuse>
<red>1</red>
<green>1</green>
<blue>1</blue>
</diffuse>
</animation>
<!-- Ventilation -->
<animation>
<type>select</type>
@ -2030,12 +2014,6 @@
<button>0</button>
<repeatable>false</repeatable>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/hydraulic/switches/green-edp</property>
</binding>
@ -2051,20 +2029,8 @@
<object-name>GreenEngPump1F</object-name>
<condition>
<or>
<and>
<equals>
<property>systems/hydraulic/lights/green-edp-fault</property>
<value>1</value>
</equals>
<equals>
<property>controls/hydraulic/switches/green-edp</property>
<value>1</value>
</equals>
</and>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<property>systems/hydraulic/lights/green-edp-fault</property>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2074,14 +2040,10 @@
<object-name>GreenEngPump2O</object-name>
<condition>
<or>
<equals>
<not>
<property>controls/hydraulic/switches/green-edp</property>
<value>0</value>
</equals>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
</not>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2198,12 +2160,6 @@
<button>0</button>
<repeatable>false</repeatable>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/hydraulic/switches/blue-elec</property>
</binding>
@ -2219,20 +2175,8 @@
<object-name>BlueElecPump1F</object-name>
<condition>
<or>
<and>
<equals>
<property>systems/hydraulic/lights/blue-elec-fault</property>
<value>1</value>
</equals>
<equals>
<property>controls/hydraulic/switches/blue-elec</property>
<value>1</value>
</equals>
</and>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<property>systems/hydraulic/lights/blue-elec-fault</property>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2242,14 +2186,10 @@
<object-name>BlueElecPump2O</object-name>
<condition>
<or>
<equals>
<not>
<property>controls/hydraulic/switches/blue-elec</property>
<value>0</value>
</equals>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
</not>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2265,12 +2205,6 @@
<button>0</button>
<repeatable>false</repeatable>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/hydraulic/switches/ptu</property>
</binding>
@ -2286,20 +2220,8 @@
<object-name>PTU1F</object-name>
<condition>
<or>
<and>
<equals>
<property>systems/hydraulic/lights/ptu-fault</property>
<value>1</value>
</equals>
<equals>
<property>controls/hydraulic/switches/ptu</property>
<value>1</value>
</equals>
</and>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<property>systems/hydraulic/lights/ptu-fault</property>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2309,14 +2231,10 @@
<object-name>PTU2O</object-name>
<condition>
<or>
<equals>
<not>
<property>controls/hydraulic/switches/ptu</property>
<value>0</value>
</equals>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
</not>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2332,12 +2250,6 @@
<button>0</button>
<repeatable>false</repeatable>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/hydraulic/switches/yellow-edp</property>
</binding>
@ -2353,20 +2265,8 @@
<object-name>YellowEngPump1F</object-name>
<condition>
<or>
<and>
<equals>
<property>systems/hydraulic/lights/yellow-edp-fault</property>
<value>1</value>
</equals>
<equals>
<property>controls/hydraulic/switches/yellow-edp</property>
<value>1</value>
</equals>
</and>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<property>systems/hydraulic/lights/yellow-edp-fault</property>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2376,14 +2276,10 @@
<object-name>YellowEngPump2O</object-name>
<condition>
<or>
<equals>
<not>
<property>controls/hydraulic/switches/yellow-edp</property>
<value>0</value>
</equals>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
</not>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2399,12 +2295,6 @@
<button>0</button>
<repeatable>false</repeatable>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/hydraulic/switches/yellow-elec</property>
</binding>
@ -2420,20 +2310,8 @@
<object-name>YellowElecPump1F</object-name>
<condition>
<or>
<and>
<equals>
<property>systems/hydraulic/lights/yellow-elec-fault</property>
<value>1</value>
</equals>
<equals>
<property>controls/hydraulic/switches/yellow-elec</property>
<value>1</value>
</equals>
</and>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<property>systems/hydraulic/lights/yellow-elec-fault</property>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>
@ -2443,14 +2321,8 @@
<object-name>YellowElecPump2O</object-name>
<condition>
<or>
<equals>
<property>controls/hydraulic/switches/yellow-elec</property>
<value>1</value>
</equals>
<equals>
<property>controls/switches/annun-test</property>
<value>1</value>
</equals>
<property>controls/hydraulic/switches/yellow-elec</property>
<property>controls/switches/annun-test</property>
</or>
</condition>
</animation>

View file

@ -2058,7 +2058,7 @@ var messages_priority_2 = func {
}
gearPosition = pts.Gear.position[1].getValue();
if (directLaw.clearFlag == 0 and warningNodes.Timers.directLaw.getValue() and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) {
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;
directLawProt.active = 1;
if (directLawMaxSpeed.clearFlag == 0 and !fbw.tripleADRFail and gearPosition != 1) {
@ -2096,7 +2096,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(directLawSpdBrk2);
}
if (altnLaw.clearFlag == 0 and warningNodes.Timers.altnLaw.getValue() and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) {
if (altnLaw.clearFlag == 0 and warningNodes.Timers.altnLaw.getValue() == 1 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8) {
altnLaw.active = 1;
altnLawProt.active = 1;
if (altnLawMaxSpeed.clearFlag == 0 and altnLawMaxSpeed2.clearFlag == 0 and !fbw.tripleADRFail) {

View file

@ -96,6 +96,6 @@ var setPhase = func(newPhase) {
}
}
setlistener("/ECAM/buttons/recall-btn", func() {
FWC.Flipflop.recallSet.setValue(FWC.Btn.recall.getBoolValue());
setlistener("/ECAM/buttons/recall-btn", func(val) {
FWC.Flipflop.recallSet.setValue(val.getBoolValue());
}, 0, 0);

View file

@ -17,13 +17,21 @@ var HYD = {
},
Fail: {
blueElec: props.globals.getNode("/systems/failures/hydraulic/blue-elec"),
blueElecOvht: props.globals.getNode("/systems/failures/hydraulic/blue-elec-ovht"),
blueLeak: props.globals.getNode("/systems/failures/hydraulic/blue-leak"),
blueReservoirAirPressLow: props.globals.getNode("/systems/failures/hydraulic/blue-reservoir-air-press-lo"),
blueReservoirOvht: props.globals.getNode("/systems/failures/hydraulic/blue-reservoir-ovht"),
greenEng: props.globals.getNode("/systems/failures/hydraulic/green-edp"),
greenLeak: props.globals.getNode("/systems/failures/hydraulic/green-leak"),
greenReservoirAirPressLow: props.globals.getNode("/systems/failures/hydraulic/green-reservoir-air-press-lo"),
greenReservoirOvht: props.globals.getNode("/systems/failures/hydraulic/green-reservoir-ovht"),
ptuFault: props.globals.getNode("/systems/failures/hydraulic/ptu"),
yellowEng: props.globals.getNode("/systems/failures/hydraulic/yellow-edp"),
yellowElec: props.globals.getNode("/systems/failures/hydraulic/yellow-elec"),
yellowElecOvht: props.globals.getNode("/systems/failures/hydraulic/yellow-elec-ovht"),
yellowLeak: props.globals.getNode("/systems/failures/hydraulic/yellow-leak"),
yellowReservoirAirPressLow: props.globals.getNode("/systems/failures/hydraulic/yellow-reservoir-air-press-lo"),
yellowReservoirOvht: props.globals.getNode("/systems/failures/hydraulic/yellow-reservoir-ovht"),
},
Psi: {
blue: props.globals.getNode("/systems/hydraulic/blue-psi"),
@ -83,13 +91,21 @@ var HYD = {
},
resetFailures: func() {
me.Fail.blueElec.setBoolValue(0);
me.Fail.blueElecOvht.setBoolValue(0);
me.Fail.blueLeak.setBoolValue(0);
me.Fail.blueReservoirAirPressLow.setBoolValue(0);
me.Fail.blueReservoirOvht.setBoolValue(0);
me.Fail.greenEng.setBoolValue(0);
me.Fail.greenLeak.setBoolValue(0);
me.Fail.greenReservoirAirPressLow.setBoolValue(0);
me.Fail.greenReservoirOvht.setBoolValue(0);
me.Fail.ptuFault.setBoolValue(0);
me.Fail.yellowEng.setBoolValue(0);
me.Fail.yellowElec.setBoolValue(0);
me.Fail.yellowElecOvht.setBoolValue(0);
me.Fail.yellowLeak.setBoolValue(0);
me.Fail.yellowReservoirAirPressLow.setBoolValue(0);
me.Fail.yellowReservoirOvht.setBoolValue(0);
},
loop: func(notification) {
# Decrease accumPressPsi when green and yellow hydraulics aren't pressurized

View file

@ -5,7 +5,8 @@
<system name="A320: Hydraulic">
<property value="500">/systems/hydraulic/sys-incr-rate</property> <!-- 2 seconds per 1000 psi -->
<channel name="SYS Leak Logic" execrate="8">
<channel name="Reservoir Quantity" execrate="8">
<!-- Blue -->
<switch name="/systems/hydraulic/blue-qty-cmd">
@ -84,7 +85,7 @@
</channel>
<channel name="Main Hydraulic" execrate="8">
<channel name="Sources" execrate="8">
<!-- Common -->
<switch name="/systems/hydraulic/sys-decr-rate">
@ -193,6 +194,16 @@
<default value="/systems/hydraulic/sources/rat/source-psi"/>
</switch>
<!-- TODO PSI according to flow rate
0 L / M = 2987 psi
23 L / M = 2854 psi
32 L / M = 2175 psi
Power Draw 45A at speed of 7600 RPM to 8000 RPM max load
Startup Draw 138A
-->
<!-- Elec Blue -->
<switch name="/systems/hydraulic/sources/blue-elec/pump-operate">
<default value="0"/>
@ -264,6 +275,11 @@
</test>
</switch>
<!-- TODO PSI according to flow rate
0 L / M = 3000 psi
140 L / M = 2854 psi
-->
<!-- EDP Green -->
<fcs_function name="/systems/hydraulic/sources/green-edp/source-psi">
<function>
@ -293,7 +309,6 @@
<default value="0"/>
<test value="/systems/hydraulic/sources/green-edp/source-psi">
/controls/hydraulic/switches/green-edp eq 1
/systems/hydraulic/sources/green-edp/fire-valve lt 0.10
</test>
</switch>
@ -310,6 +325,15 @@
</test>
</switch>
<!-- TODO PSI according to flow rate
0 L / M = 2987 psi
23 L / M = 2842 psi
32 L / M = 2175 psi
Power Draw 45A at full speed of 7700 RPM
Startup 138A
-->
<fcs_function name="/systems/hydraulic/sources/yellow-elec/source-psi">
<function>
<table>
@ -329,6 +353,12 @@
</test>
</switch>
<!-- TODO PSI according to flow rate
0 L / M = 3000 psi
140 L / M = 2854 psi
-->
<!-- EDP Yellow -->
<fcs_function name="/systems/hydraulic/sources/yellow-edp/source-psi">
<function>
@ -358,10 +388,13 @@
<default value="0"/>
<test value="/systems/hydraulic/sources/yellow-edp/source-psi">
/controls/hydraulic/switches/yellow-edp eq 1
/systems/hydraulic/sources/yellow-edp/fire-valve lt 0.10
</test>
</switch>
</channel>
<channel name="Pressure Totals" execrate="8">
<!-- Blue PSI -->
<fcs_function name="/systems/hydraulic/blue-psi-cmd">
<function>
@ -401,17 +434,23 @@
<fcs_function name="/systems/hydraulic/green-psi-cmd">
<function>
<ifthen>
<ge>
<property>/systems/hydraulic/green-qty</property>
<value>1.0</value>
</ge>
<max>
<property>/systems/hydraulic/green-psi-cmd-pump</property>
<property>/systems/hydraulic/sources/ptu/yellow-green</property>
</max>
<value>0</value>
</ifthen>
<product>
<ifthen>
<ge>
<property>/systems/hydraulic/green-qty</property>
<value>1.0</value>
</ge>
<max>
<property>/systems/hydraulic/green-psi-cmd-pump</property>
<property>/systems/hydraulic/sources/ptu/yellow-green</property>
</max>
<value>0</value>
</ifthen>
<difference>
<value>1</value>
<property>/systems/hydraulic/sources/green-edp/fire-valve</property>
</difference>
</product>
</function>
</fcs_function>
@ -445,17 +484,23 @@
<fcs_function name="/systems/hydraulic/yellow-psi-cmd">
<function>
<ifthen>
<ge>
<property>/systems/hydraulic/yellow-qty</property>
<value>1.0</value>
</ge>
<max>
<property>/systems/hydraulic/yellow-psi-cmd-pump</property>
<property>/systems/hydraulic/sources/ptu/green-yellow</property>
</max>
<value>0</value>
</ifthen>
<product>
<ifthen>
<ge>
<property>/systems/hydraulic/yellow-qty</property>
<value>1.0</value>
</ge>
<max>
<property>/systems/hydraulic/yellow-psi-cmd-pump</property>
<property>/systems/hydraulic/sources/ptu/green-yellow</property>
</max>
<value>0</value>
</ifthen>
<difference>
<value>1</value>
<property>/systems/hydraulic/sources/yellow-edp/fire-valve</property>
</difference>
</product>
</function>
</fcs_function>
@ -498,7 +543,6 @@
<rate_limit sense="decr">/systems/hydraulic/sys-decr-rate</rate_limit>
</actuator>
<!-- PTU -->
<fcs_function name="/systems/hydraulic/yellow-psi-diff">
<function>
<difference>
@ -508,9 +552,15 @@
</function>
</fcs_function>
</channel>
<channel name="Power Transfer Unit" execrate="8">
<!-- PTU -->
<!-- todo - add yellow pump running to close cargo doors inhibits PTU -->
<switch name="/systems/hydraulic/sources/ptu/ptu-inhibited">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-service-bus ge 25
/gear/gear[0]/compression-norm ne 0
<test logic="OR">
<test logic="AND">
@ -554,18 +604,38 @@
</test>
</switch>
<!-- Direction -->
<switch name="/systems/hydraulic/sources/ptu/green-yellow">
<default value="0"/>
<test logic="AND" value="/systems/hydraulic/green-psi-ptu">
<test logic="OR">
/position/altitude-ft ge 1500
/gear/gear[0]/compression-norm ne 0
</test>
/systems/electrical/bus/dc-service-bus ge 25
/controls/hydraulic/switches/ptu eq 1
/systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1
/systems/hydraulic/sources/ptu/ptu-inhibited eq 0
/systems/electrical/bus/dc-2 ge 25
/systems/failures/hydraulic/ptu ne 1
/systems/hydraulic/sources/yellow-edp/fire-valve lt 0.10
</test>
</switch>
<switch name="/systems/hydraulic/sources/ptu/yellow-green">
<default value="0"/>
<test logic="AND" value="/systems/hydraulic/yellow-psi-ptu">
<test logic="OR">
/position/gear-agl-ft ge 1500
/gear/gear[0]/compression-norm ne 0
</test>
/systems/electrical/bus/dc-service-bus ge 25
/controls/hydraulic/switches/ptu eq 1
/systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1
/systems/hydraulic/sources/ptu/ptu-inhibited eq 0
/systems/failures/hydraulic/ptu ne 1
</test>
</switch>
<!-- fade in loop sound over 1 second -->
<switch name="/systems/hydraulic/sources/ptu/ptu-loop-sound-cmd">
<default value="0"/>
<test logic="OR" value="1">
@ -580,18 +650,6 @@
<rate_limit sense="decr">120</rate_limit> <!-- instant -->
</actuator>
<switch name="/systems/hydraulic/sources/ptu/yellow-green">
<default value="0"/>
<test logic="AND" value="/systems/hydraulic/yellow-psi-ptu">
/controls/hydraulic/switches/ptu eq 1
/systems/hydraulic/sources/ptu/ptu-hydraulic-condition eq 1
/systems/hydraulic/sources/ptu/ptu-inhibited eq 0
/systems/electrical/bus/dc-2 ge 25
/systems/failures/hydraulic/ptu ne 1
/systems/hydraulic/sources/green-edp/fire-valve lt 0.10
</test>
</switch>
</channel>
<channel name="Brakes" execrate="8">
@ -614,11 +672,18 @@
</test>
</switch>
<lag_filter name="/systems/hydraulic/yellow-accumulator-psi-output">
<lag_filter name="/systems/hydraulic/yellow-accumulator-psi-output-filter">
<input>/systems/hydraulic/yellow-accumulator-psi</input>
<c1>9</c1>
</lag_filter>
<switch name="/systems/hydraulic/yellow-accumulator-psi-output">
<default value="/systems/hydraulic/yellow-accumulator-psi-output-filter"/>
<test value="0">
/systems/electrical/bus/dc-ess lt 25
</test>
</switch>
<switch name="/systems/hydraulic/brakes/pressure-left-psi-input">
<default value="0"/>
<test logic="AND" value="/systems/hydraulic/brakes/pressure-left-psi">
@ -633,85 +698,105 @@
</test>
</switch>
<lag_filter name="/systems/hydraulic/brakes/pressure-left-psi-output">
<lag_filter name="/systems/hydraulic/brakes/pressure-left-psi-output-filter">
<input>/systems/hydraulic/brakes/pressure-left-psi-input</input>
<c1>9</c1>
</lag_filter>
<lag_filter name="/systems/hydraulic/brakes/pressure-right-psi-output">
<switch name="/systems/hydraulic/brakes/pressure-left-psi-output">
<default value="/systems/hydraulic/brakes/pressure-left-psi-output-filter"/>
<test value="0">
/systems/electrical/bus/dc-ess lt 25
</test>
</switch>
<lag_filter name="/systems/hydraulic/brakes/pressure-right-psi-output-filter">
<input>/systems/hydraulic/brakes/pressure-right-psi-input</input>
<c1>9</c1>
</lag_filter>
<switch name="/systems/hydraulic/brakes/pressure-right-psi-output">
<default value="/systems/hydraulic/brakes/pressure-right-psi-output-filter"/>
<test value="0">
/systems/electrical/bus/dc-ess lt 25
</test>
</switch>
</channel>
<channel name="Lights" execrate="8">
<channel name="Relays for Warnings" execrate="8">
<switch name="/systems/hydraulic/lights/blue-elec-fault">
<switch name="/systems/hydraulic/relays/blue-reservoir-low-qty-switch">
<default value="0"/>
<test logic="OR" value="1">
<test logic="AND">
/systems/hydraulic/sources/blue-elec/output-psi le 1450
<test logic="OR">
/engines/engine[0]/state eq 3
/engines/engine[1]/state eq 3
</test>
</test>
/systems/hydraulic/blue-qty lt 2.4
<test logic="AND" value="1">
/systems/electrical/bus/dc-1 ge 25
/systems/hydraulic/blue-qty lt 2.2
</test>
</switch>
<switch name="/systems/hydraulic/lights/green-edp-fault">
<switch name="/systems/hydraulic/relays/green-reservoir-low-qty-switch">
<default value="0"/>
<test logic="OR" value="1">
<test logic="AND">
/systems/hydraulic/sources/green-edp/output-psi le 1750
/engines/engine[0]/state eq 3
</test>
<test>
/systems/hydraulic/green-qty lt 3.5
<test logic="AND" value="1">
/systems/electrical/bus/dc-1 ge 25
/systems/hydraulic/green-qty lt 3.0
</test>
</switch>
<switch name="/systems/hydraulic/relays/yellow-reservoir-low-qty-switch">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-1 ge 25
/systems/hydraulic/yellow-qty lt 3.0
</test>
</switch>
<switch name="/systems/hydraulic/relays/green-reservoir-low-qty-air-press-fault">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-1 ge 25
<test logic="OR">
/systems/hydraulic/relays/green-reservoir-low-qty-switch eq 1
/systems/failures/hydraulic/green-reservoir-air-press-lo eq 1
</test>
</test>
</switch>
<switch name="/systems/hydraulic/lights/yellow-edp-fault">
<switch name="/systems/hydraulic/relays/yellow-reservoir-low-qty-air-press-fault">
<default value="0"/>
<test logic="OR" value="1">
<test logic="AND">
/systems/hydraulic/sources/yellow-edp/output-psi le 1750
/engines/engine[1]/state eq 3
</test>
<test>
/systems/hydraulic/yellow-qty lt 3.5
<test logic="AND" value="1">
/systems/electrical/bus/dc-2 ge 25
<test logic="OR">
/systems/hydraulic/relays/yellow-reservoir-low-qty-switch eq 1
/systems/failures/hydraulic/yellow-reservoir-air-press-lo eq 1
</test>
</test>
</switch>
<switch name="/systems/hydraulic/lights/yellow-elec-fault">
<switch name="/systems/hydraulic/relays/blue-reservoir-overheat">
<default value="0"/>
<test logic="OR" value="1">
<test logic="AND">
/systems/hydraulic/sources/yellow-elec/output-psi le 1450
/systems/hydraulic/sources/yellow-edp/output-psi le 1750
<test logic="AND">
/systems/hydraulic/sources/ptu/green-yellow le 1750
/systems/hydraulic/sources/ptu/yellow-green le 1750
</test>
</test>
<test>
/systems/hydraulic/yellow-qty lt 3.5
</test>
<test logic="AND" value="1">
/systems/electrical/bus/dc-ess ge 25
/systems/failures/hydraulic/blue-reservoir-ovht eq 1
</test>
</switch>
<switch name="/systems/hydraulic/lights/ptu-fault">
<switch name="/systems/hydraulic/relays/green-reservoir-overheat">
<default value="0"/>
<test logic="OR" value="1">
/systems/hydraulic/yellow-qty lt 3.5
/systems/hydraulic/green-qty lt 3.5
<test logic="AND" value="1">
/systems/electrical/bus/dc-1 ge 25
/systems/failures/hydraulic/green-reservoir-ovht eq 1
</test>
</switch>
<switch name="/systems/hydraulic/relays/yellow-reservoir-overheat">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-2 ge 25
/systems/failures/hydraulic/yellow-reservoir-ovht eq 1
</test>
</switch>
<!-- These are a physical switch, so there is no need for transducer power -->
<switch name="/systems/hydraulic/warnings/blue-lo-pr">
<default value="0"/>
<test logic="OR" value="1">
@ -747,4 +832,104 @@
</channel>
<channel name="Lights" execrate="8">
<switch name="/systems/hydraulic/lights/ptu-fault">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-2 ge 25
<test logic="OR">
/systems/hydraulic/relays/yellow-reservoir-overheat eq 1
/systems/hydraulic/relays/green-reservoir-overheat eq 1
<test logic="AND">
<test logic="OR">
/systems/hydraulic/relays/green-reservoir-low-qty-air-press-fault eq 1
/systems/hydraulic/relays/yellow-reservoir-low-qty-air-press-fault eq 1
</test>
/controls/hydraulic/switches/ptu eq 1
</test>
</test>
</test>
</switch>
<switch name="/systems/hydraulic/lights/green-edp-fault">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-1 ge 25
<test logic="OR">
/systems/hydraulic/relays/green-reservoir-overheat eq 1
<test logic="AND">
<test logic="OR">
<test logic="AND">
/systems/hydraulic/sources/green-edp/output-psi le 1750
/engines/engine[0]/state eq 3 <!-- TODO - oil pressure 73-25 SCH 09 -->
</test>
/systems/hydraulic/relays/green-reservoir-low-qty-air-press-fault eq 1
</test>
/controls/hydraulic/switches/green-edp eq 1
</test>
</test>
</test>
</switch>
<switch name="/systems/hydraulic/lights/yellow-edp-fault">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-2 ge 25
<test logic="OR">
/systems/hydraulic/relays/yellow-reservoir-overheat eq 1
<test logic="AND">
<test logic="OR">
<test logic="AND">
/systems/hydraulic/sources/yellow-edp/output-psi le 1750
/engines/engine[1]/state eq 3 <!-- TODO - oil pressure 73-25 SCH 09 -->
</test>
/systems/hydraulic/relays/yellow-reservoir-low-qty-air-press-fault eq 1
</test>
/controls/hydraulic/switches/yellow-edp eq 1
</test>
</test>
</test>
</switch>
<switch name="/systems/hydraulic/lights/blue-elec-fault">
<default value="0"/>
<test logic="OR" value="1">
/systems/hydraulic/relays/blue-reservoir-overheat eq 1
/systems/failures/hydraulic/blue-elec-ovht eq 1
<test logic="AND">
<test logic="OR">
/systems/hydraulic/relays/blue-reservoir-low-qty-switch eq 1
/systems/failures/hydraulic/blue-reservoir-air-press-lo eq 1
<test logic="AND">
/systems/hydraulic/sources/blue-elec/output-psi le 1450
<test logic="OR">
/engines/engine[0]/state eq 3 <!-- TODO - oil pressure 73-25 SCH 09 -->
/engines/engine[1]/state eq 3
/controls/hydraulic/switches/blue-elec-ovrd eq 1
</test>
</test>
</test>
/controls/hydraulic/switches/blue-elec eq 1
</test>
</test>
</switch>
<switch name="/systems/hydraulic/lights/yellow-elec-fault">
<default value="0"/>
<test logic="OR" value="1">
/systems/hydraulic/relays/yellow-reservoir-overheat eq 1
/systems/failures/hydraulic/yellow-elec-ovht eq 1
<test logic="AND">
<test logic="OR">
/systems/hydraulic/relays/yellow-reservoir-low-qty-switch eq 1
/systems/failures/hydraulic/yellow-reservoir-air-press-lo eq 1
/systems/hydraulic/sources/yellow-elec/output-psi le 1450
</test>
/controls/hydraulic/switches/yellow-elec eq 1
</test>
</test>
</switch>
</channel>
</system>

View file

@ -316,11 +316,11 @@
<default value="/systems/oxygen/passenger-oxygen/sys-on-light"/>
<test logic="OR" value="0">
/controls/oxygen/passenger-mask-reset eq 1
/systems/electrical/bus/dc-ess lt 25
/systems/electrical/bus/dc-ess-shed lt 25
</test>
<test logic="AND" value="1">
/systems/oxygen/passenger-oxygen/masks-deploy-cmd eq 1
/systems/electrical/bus/dc-ess ge 25
/systems/electrical/bus/dc-ess-shed ge 25
</test>
<output>/systems/oxygen/passenger-oxygen/sys-on-light</output>
</switch>