1
0
Fork 0

MCDU: split out functions out of the MCDU

This commit is contained in:
legoboyvdlp R 2021-08-09 20:27:42 +01:00
parent 8f6ec0512b
commit 6b1b45199f
3 changed files with 696 additions and 689 deletions

View file

@ -4768,6 +4768,7 @@
<file>Aircraft/A320-family/Models/Instruments/IESI/IESI.nas</file>
</canvas_iesi>
<canvas_mcdu>
<file>Aircraft/A320-family/Models/Instruments/MCDU/MCDU-funcs.nas</file>
<file>Aircraft/A320-family/Models/Instruments/MCDU/MCDU.nas</file>
</canvas_mcdu>
<canvas_qrh>

View file

@ -0,0 +1,359 @@
var showLeft = func (obj, a, b, c, d, e, f) {
if (a != 0) {
if (a >= 1) {
obj["Simple_L1"].show();
} else {
obj["Simple_L1"].hide();
}
}
if (b != 0) {
if (b >= 1) {
obj["Simple_L2"].show();
} else {
obj["Simple_L2"].hide();
}
}
if (c != 0) {
if (c >= 1) {
obj["Simple_L3"].show();
} else {
obj["Simple_L3"].hide();
}
}
if (d != 0) {
if (d >= 1) {
obj["Simple_L4"].show();
} else {
obj["Simple_L4"].hide();
}
}
if (e != 0) {
if (e >= 1) {
obj["Simple_L5"].show();
} else {
obj["Simple_L5"].hide();
}
}
if (f != 0) {
if (f >= 1) {
obj["Simple_L6"].show();
} else {
obj["Simple_L6"].hide();
}
}
};
var showLeftS = func (obj, a, b, c, d, e, f) {
if (a != 0) {
if (a >= 1) {
obj["Simple_L1S"].show();
} else {
obj["Simple_L1S"].hide();
}
}
if (b != 0) {
if (b >= 1) {
obj["Simple_L2S"].show();
} else {
obj["Simple_L2S"].hide();
}
}
if (c != 0) {
if (c >= 1) {
obj["Simple_L3S"].show();
} else {
obj["Simple_L3S"].hide();
}
}
if (d != 0) {
if (d >= 1) {
obj["Simple_L4S"].show();
} else {
obj["Simple_L4S"].hide();
}
}
if (e != 0) {
if (e >= 1) {
obj["Simple_L5S"].show();
} else {
obj["Simple_L5S"].hide();
}
}
if (f != 0) {
if (f >= 1) {
obj["Simple_L6S"].show();
} else {
obj["Simple_L6S"].hide();
}
}
};
var showCenter = func (obj, a, b, c, d, e, f) {
if (a != 0) {
if (a >= 1) {
obj["Simple_C1"].show();
} else {
obj["Simple_C1"].hide();
}
}
if (b != 0) {
if (b >= 1) {
obj["Simple_C2"].show();
} else {
obj["Simple_C2"].hide();
}
}
if (c != 0) {
if (c >= 1) {
obj["Simple_C3"].show();
} else {
obj["Simple_C3"].hide();
}
}
if (d != 0) {
if (d >= 1) {
obj["Simple_C4"].show();
} else {
obj["Simple_C4"].hide();
}
}
if (e != 0) {
if (e >= 1) {
obj["Simple_C5"].show();
} else {
obj["Simple_C5"].hide();
}
}
if (f != 0) {
if (f >= 1) {
obj["Simple_C6"].show();
} else {
obj["Simple_C6"].hide();
}
}
};
var showCenterS = func (obj, a, b, c, d, e, f) {
if (a != 0) {
if (a >= 1) {
obj["Simple_C1S"].show();
} else {
obj["Simple_C1S"].hide();
}
}
if (b != 0) {
if (b >= 1) {
obj["Simple_C2S"].show();
} else {
obj["Simple_C2S"].hide();
}
}
if (c != 0) {
if (c >= 1) {
obj["Simple_C3S"].show();
} else {
obj["Simple_C3S"].hide();
}
}
if (d != 0) {
if (d >= 1) {
obj["Simple_C4S"].show();
} else {
obj["Simple_C4S"].hide();
}
}
if (e != 0) {
if (e >= 1) {
obj["Simple_C5S"].show();
} else {
obj["Simple_C5S"].hide();
}
}
if (f != 0) {
if (f >= 1) {
obj["Simple_C6S"].show();
} else {
obj["Simple_C6S"].hide();
}
}
};
var showRight = func (obj, a, b, c, d, e, f) {
if (a != 0) {
if (a >= 1) {
obj["Simple_R1"].show();
} else {
obj["Simple_R1"].hide();
}
}
if (b != 0) {
if (b >= 1) {
obj["Simple_R2"].show();
} else {
obj["Simple_R2"].hide();
}
}
if (c != 0) {
if (c >= 1) {
obj["Simple_R3"].show();
} else {
obj["Simple_R3"].hide();
}
}
if (d != 0) {
if (d >= 1) {
obj["Simple_R4"].show();
} else {
obj["Simple_R4"].hide();
}
}
if (e != 0) {
if (e >= 1) {
obj["Simple_R5"].show();
} else {
obj["Simple_R5"].hide();
}
}
if (f != 0) {
if (f >= 1) {
obj["Simple_R6"].show();
} else {
obj["Simple_R6"].hide();
}
}
};
var showRightS = func (obj, a, b, c, d, e, f) {
if (a != 0) {
if (a >= 1) {
obj["Simple_R1S"].show();
} else {
obj["Simple_R1S"].hide();
}
}
if (b != 0) {
if (b >= 1) {
obj["Simple_R2S"].show();
} else {
obj["Simple_R2S"].hide();
}
}
if (c != 0) {
if (c >= 1) {
obj["Simple_R3S"].show();
} else {
obj["Simple_R3S"].hide();
}
}
if (d != 0) {
if (d >= 1) {
obj["Simple_R4S"].show();
} else {
obj["Simple_R4S"].hide();
}
}
if (e != 0) {
if (e >= 1) {
obj["Simple_R5S"].show();
} else {
obj["Simple_R5S"].hide();
}
}
if (f != 0) {
if (f >= 1) {
obj["Simple_R6S"].show();
} else {
obj["Simple_R6S"].hide();
}
}
};
var showLeftArrow = func (obj, a, b, c, d, e, f) {
if (a != 0) {
if (a >= 1) {
obj["Simple_L1_Arrow"].show();
} else {
obj["Simple_L1_Arrow"].hide();
}
}
if (b != 0) {
if (b >= 1) {
obj["Simple_L2_Arrow"].show();
} else {
obj["Simple_L2_Arrow"].hide();
}
}
if (c != 0) {
if (c >= 1) {
obj["Simple_L3_Arrow"].show();
} else {
obj["Simple_L3_Arrow"].hide();
}
}
if (d != 0) {
if (d >= 1) {
obj["Simple_L4_Arrow"].show();
} else {
obj["Simple_L4_Arrow"].hide();
}
}
if (e != 0) {
if (e >= 1) {
obj["Simple_L5_Arrow"].show();
} else {
obj["Simple_L5_Arrow"].hide();
}
}
if (f != 0) {
if (f >= 1) {
obj["Simple_L6_Arrow"].show();
} else {
obj["Simple_L6_Arrow"].hide();
}
}
};
var showRightArrow = func (obj, a, b, c, d, e, f) {
if (a != 0) {
if (a >= 1) {
obj["Simple_R1_Arrow"].show();
} else {
obj["Simple_R1_Arrow"].hide();
}
}
if (b != 0) {
if (b >= 1) {
obj["Simple_R2_Arrow"].show();
} else {
obj["Simple_R2_Arrow"].hide();
}
}
if (c != 0) {
if (c >= 1) {
obj["Simple_R3_Arrow"].show();
} else {
obj["Simple_R3_Arrow"].hide();
}
}
if (d != 0) {
if (d >= 1) {
obj["Simple_R4_Arrow"].show();
} else {
obj["Simple_R4_Arrow"].hide();
}
}
if (e != 0) {
if (e >= 1) {
obj["Simple_R5_Arrow"].show();
} else {
obj["Simple_R5_Arrow"].hide();
}
}
if (f != 0) {
if (f >= 1) {
obj["Simple_R6_Arrow"].show();
} else {
obj["Simple_R6_Arrow"].hide();
}
}
};

File diff suppressed because it is too large Load diff