1
0
Fork 0

ATIS: set type when pulling flightplan, or resetting to default

This commit is contained in:
Jonathan Redpath 2022-02-10 15:12:07 +00:00
parent 7c2c7f3ffc
commit 9c1fd555d7
3 changed files with 11 additions and 0 deletions

View file

@ -112,7 +112,9 @@ var SimbriefParser = {
fmgc.FMGCInternal.arrApt = destinationID; fmgc.FMGCInternal.arrApt = destinationID;
atsu.ATISInstances[0].newStation(departureID); atsu.ATISInstances[0].newStation(departureID);
atsu.ATISInstances[0].setType(1);
atsu.ATISInstances[1].newStation(destinationID); atsu.ATISInstances[1].newStation(destinationID);
atsu.ATISInstances[1].setType(0);
fmgc.FMGCInternal.toFromSet = 1; fmgc.FMGCInternal.toFromSet = 1;
fmgc.FMGCNodes.toFromSet.setValue(1); fmgc.FMGCNodes.toFromSet.setValue(1);
@ -139,6 +141,7 @@ var SimbriefParser = {
if (size(alternates) != 0) { if (size(alternates) != 0) {
fmgc.FMGCInternal.altAirport = alternateID; fmgc.FMGCInternal.altAirport = alternateID;
atsu.ATISInstances[2].newStation(alternateID); atsu.ATISInstances[2].newStation(alternateID);
atsu.ATISInstances[2].setType(0);
fmgc.FMGCInternal.altAirportSet = 1; fmgc.FMGCInternal.altAirportSet = 1;
} }
} }

View file

@ -291,6 +291,7 @@ var lskbutton = func(btn, i) {
if (atsu.ATISInstances[0].sent != 1) { if (atsu.ATISInstances[0].sent != 1) {
if (fmgc.FMGCInternal.depApt != "") { if (fmgc.FMGCInternal.depApt != "") {
atsu.ATISInstances[0].newStation(fmgc.FMGCInternal.depApt); atsu.ATISInstances[0].newStation(fmgc.FMGCInternal.depApt);
atsu.ATISInstances[0].setType(1);
} else { } else {
atsu.ATISInstances[0].station = nil; atsu.ATISInstances[0].station = nil;
} }
@ -433,6 +434,7 @@ var lskbutton = func(btn, i) {
if (atsu.ATISInstances[1].sent != 1) { if (atsu.ATISInstances[1].sent != 1) {
if (fmgc.FMGCInternal.arrApt != "") { if (fmgc.FMGCInternal.arrApt != "") {
atsu.ATISInstances[1].newStation(fmgc.FMGCInternal.arrApt); atsu.ATISInstances[1].newStation(fmgc.FMGCInternal.arrApt);
atsu.ATISInstances[1].setType(0);
} else { } else {
atsu.ATISInstances[1].station = nil; atsu.ATISInstances[1].station = nil;
} }
@ -560,6 +562,7 @@ var lskbutton = func(btn, i) {
if (atsu.ATISInstances[2].sent != 1) { if (atsu.ATISInstances[2].sent != 1) {
if (fmgc.FMGCInternal.altAirportSet) { if (fmgc.FMGCInternal.altAirportSet) {
atsu.ATISInstances[2].newStation(fmgc.FMGCInternal.altAirport); atsu.ATISInstances[2].newStation(fmgc.FMGCInternal.altAirport);
atsu.ATISInstances[1].setType(0);
} else { } else {
atsu.ATISInstances[2].station = nil; atsu.ATISInstances[2].station = nil;
} }

View file

@ -302,6 +302,11 @@ var ATIS = {
return 1; return 1;
} }
}, },
setType: func(i) {
if (i >= 0 and i <= 1) {
me.type = i;
}
},
sendReq: func(i) { sendReq: func(i) {
if (me.station == nil or (me.sent and !me.received)) { if (me.station == nil or (me.sent and !me.received)) {
return 1; return 1;