Skip to content

Commit

Permalink
Minor refactoring of tracked flightplans
Browse files Browse the repository at this point in the history
Removed deleted pch header import from IASSureTest.cpp
  • Loading branch information
MorpheusXAUT committed Aug 2, 2022
1 parent 2fa283a commit 7456835
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions IASsure/IASsure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ bool IASsure::IASsure::OnCompileCommand(const char* sCommandLine)
this->LogMessage("Resetting plugin state", "Config");

this->reportedIAS.clear();
this->calculatedIASToggled.clear();
return true;
}
}
Expand Down Expand Up @@ -278,11 +279,12 @@ void IASsure::IASsure::ClearReportedIAS(const EuroScopePlugIn::CFlightPlan& fp)

void IASsure::IASsure::ToggleCalculatedIAS(const EuroScopePlugIn::CFlightPlan& fp)
{
if (this->calculatedIASToggled.contains(fp.GetCallsign())) {
this->calculatedIASToggled.erase(fp.GetCallsign());
std::string cs = fp.GetCallsign();
if (this->calculatedIASToggled.contains(cs)) {
this->calculatedIASToggled.erase(cs);
}
else {
this->calculatedIASToggled.insert({ fp.GetCallsign(), true });
this->calculatedIASToggled.insert(cs);
}
}

Expand Down
7 changes: 4 additions & 3 deletions IASsure/IASsure.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

#include <cmath>
#include <iomanip>
#include <map>
#include <string>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <windows.h>

Expand All @@ -29,8 +30,8 @@ namespace IASsure {
int minReportedIAS;
int maxReportedIAS;
int intervalReportedIAS;
std::map<std::string, int> reportedIAS;
std::map<std::string, bool> calculatedIASToggled;
std::unordered_map<std::string, int> reportedIAS;
std::unordered_set<std::string> calculatedIASToggled;

void RegisterTagItems();

Expand Down
1 change: 0 additions & 1 deletion IASsureTest/IASsureTest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "pch.h"
#include "CppUnitTest.h"

#include "../IASsure/cas.h"
Expand Down

0 comments on commit 7456835

Please sign in to comment.