Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vSMR/SMRPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ bool CSMRPlugin::OnCompileCommand(const char * sCommandLine) {
}
return true;
}
else if (strcmp(sCommandLine, ".smr resetvisuals") == 0) {
for (auto radarScreen : RadarScreensOpened) {
if (radarScreen != nullptr) {
radarScreen->ResetMonitorVisuals();
}
}
return true;
}
else if (strcmp(sCommandLine, ".smr log") == 0) {
Logger::ENABLED = !Logger::ENABLED;
return true;
Expand Down
28 changes: 26 additions & 2 deletions vSMR/SMRRadar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,11 @@ string CSMRRadar::GetBottomLine(const char *Callsign) {

bool CSMRRadar::OnCompileCommand(const char *sCommandLine) {

if (strcmp(sCommandLine, ".smr resetvisuals") == 0) {
ResetMonitorVisuals();
return true;
}

if (strcmp(sCommandLine, ".smr reload") == 0) {
CurrentConfig = new CConfig(ConfigPath);
LoadProfile(CurrentConfig->getActiveProfileName());
Expand All @@ -1667,6 +1672,17 @@ bool CSMRRadar::OnCompileCommand(const char *sCommandLine) {
return false;
}

void CSMRRadar::ResetMonitorVisuals() {
DepartureWindowArea.left = 500;
DepartureWindowArea.top = 300;
DepartureWindowArea.right = 700;
DepartureWindowArea.bottom = 400;
TimePopupAreas.clear();
monitorVisualPreviewUntil = clock() + (5 * CLOCKS_PER_SEC);
OnAsrContentToBeSaved();
RequestRefresh();
}

map<string, string> CSMRRadar::GenerateTagData(
CRadarTarget rt, CFlightPlan fp, bool isAcCorrelated, bool isProMode,
int TransitionAltitude, bool useSpeedForGates, string ActiveAirport,
Expand Down Expand Up @@ -2015,6 +2031,8 @@ void CSMRRadar::OnRefresh(HDC hDC, int Phase) {



bool showVisualResetPreview = clock() < monitorVisualPreviewUntil;

struct Utils {
static RECT GetAreaFromText(CDC *dc, string text, POINT Pos) {
RECT Area = {Pos.x, Pos.y, Pos.x + dc->GetTextExtent(text.c_str()).cx,
Expand Down Expand Up @@ -3029,7 +3047,8 @@ void CSMRRadar::OnRefresh(HDC hDC, int Phase) {
for (std::map<string, bool>::iterator it =
RimcasInstance->MonitoredRunwayArr.begin();
it != RimcasInstance->MonitoredRunwayArr.end(); ++it) {
if (!it->second || RimcasInstance->TimeTable[it->first].empty())
bool hasArrivalData = !RimcasInstance->TimeTable[it->first].empty();
if (!it->second || (!hasArrivalData && !showVisualResetPreview))
continue;

vector<int> TimeDefinition = RimcasInstance->CountdownDefinition;
Expand Down Expand Up @@ -3145,7 +3164,8 @@ void CSMRRadar::OnRefresh(HDC hDC, int Phase) {
// Departure Timer Window
// ==========================================

if (showDepartureWindow && RimcasInstance->DepartedAircraft.size() > 0) {
if ((showDepartureWindow || showVisualResetPreview) &&
(!RimcasInstance->DepartedAircraft.empty() || showVisualResetPreview)) {
// Calculate box dimensions based on content
int maxWidth = 0;
int numColumns = 0;
Expand Down Expand Up @@ -3896,6 +3916,10 @@ void CSMRRadar::OnRefresh(HDC hDC, int Phase) {
DistanceTools);
}

if (showVisualResetPreview) {
RequestRefresh();
}

dc.Detach();
}

Expand Down
2 changes: 2 additions & 0 deletions vSMR/SMRRadar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class CSMRRadar : public EuroScopePlugIn::CRadarScreen {
bool depWindowShowFreq = true;
bool depWindowShowTime = true;
RECT DepartureWindowArea = {500, 300, 700, 400};
clock_t monitorVisualPreviewUntil = 0;

map<string, RECT> TimePopupAreas;

Expand Down Expand Up @@ -272,6 +273,7 @@ class CSMRRadar : public EuroScopePlugIn::CRadarScreen {
//---OnCompileCommand-----------------------------------------

virtual bool OnCompileCommand(const char *sCommandLine);
virtual void ResetMonitorVisuals();

//---RefreshAirportActivity---------------------------------------------

Expand Down
Loading