Skip to content

Commit

Permalink
Fix incorrect CJS showing in missed approach alarm ACK button in towe…
Browse files Browse the repository at this point in the history
…r unit when scratchpad string is occupied
  • Loading branch information
EightSmart committed Aug 5, 2024
1 parent bd83a70 commit 333519e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions MissedApproach/MissedApproachAlarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,11 @@ void MissedApproachAlarm::OnFlightPlanControllerAssignedDataUpdate(CFlightPlan F
}
}

// Trigger alarm (APP)
// Clear Scratchpad
scratchPadString.erase(0, strlen("MISAP_"));
controllerData.SetScratchPadString(scratchPadString.c_str());

// Don't add to vector unless runway is selected and active
// Don't Trigger alarm (APP) unless runway is selected and active
if (find(activeMAPPRunways.begin(), activeMAPPRunways.end(), data.GetArrivalRwy()) == activeMAPPRunways.end()) return;
missedAcftData.push_back(FlightPlan.GetCallsign());
missedAcftData.push_back(data.GetDestination());
Expand Down
8 changes: 4 additions & 4 deletions MissedApproach/MissedApproachPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ void MissedApproachPlugin::ackMissedApproach(const char* callsign) {
data = fpl.GetFlightPlanData();
controllerData = fpl.GetControllerAssignedData();

string buf = controllerData.GetScratchPadString();
buf.append("MISAP-ACK_");
string buf = "MISAP-ACK_";
buf.append(myself.GetPositionId());
buf.append(controllerData.GetScratchPadString());
controllerData.SetScratchPadString(buf.c_str());
//couldn't find it, handle error
}

void MissedApproachPlugin::resetMissedApproach(const char* callsign) {
Expand Down Expand Up @@ -118,5 +117,6 @@ bool MissedApproachPlugin::matchArrivalAirport(const char* arrivalArpt) {
}

string MissedApproachPlugin::checkForAck(string scratchPadString) {
return scratchPadString.substr(10, 2);
auto it = scratchPadString.find("MISAP-ACK_");
return scratchPadString.substr(it + 10, 2);
}

0 comments on commit 333519e

Please sign in to comment.