1
0
Fork 0

GPS PRIMARY LOST

This commit is contained in:
legoboyvdlp R 2021-07-30 11:04:11 +01:00
parent 0b44b47a7d
commit 5eaad7d98f
2 changed files with 22 additions and 7 deletions

View file

@ -707,18 +707,22 @@ canvas.NDStyles["Airbus"] = {
id: "nd_warn_memo",
impl: {
init: func(nd, symbol),
predicate: ALWAYS,
is_true: func(nd) nd.symbols.nd_warn_memo.hide(),
is_false: func(nd),
predicate: func(nd) {
!systems.ADIRS.Operating.aligned[0].getBoolValue() and !systems.ADIRS.Operating.aligned[1].getBoolValue() and !systems.ADIRS.Operating.aligned[2].getBoolValue()
},
is_true: func(nd) nd.symbols.nd_warn_memo.show(),
is_false: func(nd) nd.symbols.nd_warn_memo.hide(),
},
},
{
id: "nd_warn_msgbox",
impl: {
init: func(nd, symbol),
predicate: ALWAYS,
is_true: func(nd) nd.symbols.nd_warn_msgbox.hide(),
is_false: func(nd),
predicate: func(nd) {
!systems.ADIRS.Operating.aligned[0].getBoolValue() and !systems.ADIRS.Operating.aligned[1].getBoolValue() and !systems.ADIRS.Operating.aligned[2].getBoolValue()
},
is_true: func(nd) nd.symbols.nd_warn_msgbox.show(),
is_false: func(nd) nd.symbols.nd_warn_msgbox.hide(),
},
},
{

View file

@ -110,7 +110,6 @@ var ADIRU = {
}
},
stopAlignNoAlign: func() {
print("Stopping alignment or setting unaligned state");
me.inAlign = 0;
me.aligned = 0;
ADIRSnodesND[me.num].setValue(0);
@ -324,6 +323,7 @@ var ADIRS = {
}
),
],
_hasGPSPrimLost: 0,
loop: func(notification) {
if (me._init) {
for (i = 0; i < _NUMADIRU; i = i + 1) {
@ -345,8 +345,19 @@ var ADIRS = {
me.Operating.adr[i].setValue(0);
}
}
if (!me.Operating.aligned[0].getBoolValue() and !me.Operating.aligned[1].getBoolValue() and !me.Operating.aligned[2].getBoolValue()) {
if (!me._hasGPSPrimLost) {
mcdu_scratchpad.messageQueues[0].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("GPS PRIMARY LOST"));
mcdu_scratchpad.messageQueues[1].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("GPS PRIMARY LOST"));
}
me._hasGPSPrimLost = 1;
} else {
me._hasGPSPrimLost = 0;
}
}
# Update VFE
foreach (var update_item; me.update_items) {
update_item.update(notification);