Skip to content

Commit b18878c

Browse files
authored
Merge pull request #1 from pierr3/master
Pulling updates from pierr3's repo
2 parents 2cfb436 + 6b6fdfd commit b18878c

File tree

6 files changed

+46
-17
lines changed

6 files changed

+46
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ The nightly build is always up to date with the latest commit, however it may be
2626

2727
### Thanks
2828

29-
Special thanks to Even Rognlien, Juha Holopainen and Lionel Bischof for their help with the code and thanks to Sam White and Theo Bearman for their help on the wiki!
29+
Special thanks to Daniel Lange, Even Rognlien, Juha Holopainen, Lionel Bischof and Wenjun Zhou for their help with the code and thanks to Sam White and Theo Bearman for their help on the wiki!

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#---------------------------------#
1010

1111
# version format
12-
version: 1.3.3.{build}
12+
version: 1.4.0r{build}
1313

1414
# branches to build
1515
branches:

vSMR/Constant.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ const int TAG_CITEM_RWY = 1913;
283283
const int TAG_CITEM_GATE = 1914;
284284
const int TAG_CITEM_MANUALCORRELATE = 1915;
285285
const int TAG_CITEM_SID = 1916;
286+
const int TAG_CITEM_GROUNDSTATUS = 1917;
286287

287288
const int FUNC_MANUAL_CALLSIGN = 2000;
288289

vSMR/InsetWindow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ void CInsetWindow::render(HDC hDC, CSMRRadar * radar_screen, Graphics* gdi, POIN
413413
TagClickableMap[TagReplacingMap["tssr"]] = TAG_CITEM_NO;
414414
TagClickableMap[TagReplacingMap["ssid"]] = TagClickableMap[TagReplacingMap["asid"]] = TAG_CITEM_SID;
415415
TagClickableMap[TagReplacingMap["systemid"]] = TAG_CITEM_MANUALCORRELATE;
416+
TagClickableMap[TagReplacingMap["gstatus"]] = TAG_CITEM_GROUNDSTATUS;
416417

417418
//
418419
// ----- Now the hard part, drawing (using gdi+) -------

vSMR/SMRPlugin.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include "Logger.h"
1515

1616
#define MY_PLUGIN_NAME "vSMR"
17-
#define MY_PLUGIN_VERSION "1.3.3-e32"
18-
#define MY_PLUGIN_DEVELOPER "Pierre Ferran"
17+
#define MY_PLUGIN_VERSION "1.4.0-e32"
18+
#define MY_PLUGIN_DEVELOPER "Pierre Ferran, Even Rognlien, Lionel Bischof, Daniel Lange, Juha Holopainen"
1919
#define MY_PLUGIN_COPYRIGHT "GPL v3"
2020
#define MY_PLUGIN_VIEW_AVISO "SMR radar display"
2121

vSMR/SMRRadar.cpp

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bool standardCursor; // switches between mouse cursor and pointer cursor when mo
1717
bool customCursor; // use SMR version or default windows mouse symbol
1818
WNDPROC gSourceProc;
1919
HWND pluginWindow;
20-
//LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
20+
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
2121

2222
map<string, string> CSMRRadar::vStripsStands;
2323

@@ -122,6 +122,7 @@ CSMRRadar::~CSMRRadar()
122122
}
123123
// Shutting down GDI+
124124
GdiplusShutdown(m_gdiplusToken);
125+
delete CurrentConfig;
125126
}
126127

127128
void CSMRRadar::LoadCustomFont() {
@@ -313,9 +314,7 @@ void CSMRRadar::OnAsrContentToBeSaved()
313314
if (appWindowDisplays[i])
314315
to_save = "1";
315316
SaveDataToAsr(string(prefix + "Display").c_str(), "Display Secondary Radar Window", to_save.c_str());
316-
}
317-
318-
delete CurrentConfig;
317+
}
319318
}
320319

321320
void CSMRRadar::OnMoveScreenObject(int ObjectType, const char * sObjectId, POINT Pt, RECT Area, bool Released) {
@@ -359,7 +358,7 @@ void CSMRRadar::OnMoveScreenObject(int ObjectType, const char * sObjectId, POINT
359358
}
360359
}
361360

362-
if (ObjectType == DRAWING_TAG || ObjectType == TAG_CITEM_MANUALCORRELATE ||ObjectType == TAG_CITEM_CALLSIGN || ObjectType == TAG_CITEM_FPBOX || ObjectType == TAG_CITEM_RWY || ObjectType == TAG_CITEM_SID || ObjectType == TAG_CITEM_GATE || ObjectType == TAG_CITEM_NO) {
361+
if (ObjectType == DRAWING_TAG || ObjectType == TAG_CITEM_MANUALCORRELATE ||ObjectType == TAG_CITEM_CALLSIGN || ObjectType == TAG_CITEM_FPBOX || ObjectType == TAG_CITEM_RWY || ObjectType == TAG_CITEM_SID || ObjectType == TAG_CITEM_GATE || ObjectType == TAG_CITEM_NO || ObjectType == TAG_CITEM_GROUNDSTATUS) {
363362
CRadarTarget rt = GetPlugIn()->RadarTargetSelect(sObjectId);
364363

365364
if (!Released)
@@ -797,7 +796,7 @@ void CSMRRadar::OnClickScreenObject(int ObjectType, const char * sObjectId, POIN
797796
}
798797
}
799798

800-
if (ObjectType == TAG_CITEM_CALLSIGN || ObjectType == TAG_CITEM_FPBOX || ObjectType == TAG_CITEM_RWY || ObjectType == TAG_CITEM_SID || ObjectType == TAG_CITEM_GATE || ObjectType == TAG_CITEM_NO) {
799+
if (ObjectType == TAG_CITEM_CALLSIGN || ObjectType == TAG_CITEM_FPBOX || ObjectType == TAG_CITEM_RWY || ObjectType == TAG_CITEM_SID || ObjectType == TAG_CITEM_GATE || ObjectType == TAG_CITEM_NO || ObjectType == TAG_CITEM_GROUNDSTATUS) {
801800

802801
CRadarTarget rt = GetPlugIn()->RadarTargetSelect(sObjectId);
803802
GetPlugIn()->SetASELAircraft(GetPlugIn()->FlightPlanSelect(sObjectId));
@@ -834,6 +833,12 @@ void CSMRRadar::OnClickScreenObject(int ObjectType, const char * sObjectId, POIN
834833
StartTagFunction(rt.GetCallsign(), NULL, TAG_CITEM_GATE, rt.GetCallsign(), NULL, EuroScopePlugIn::TAG_ITEM_FUNCTION_EDIT_SCRATCH_PAD, Pt, Area);
835834

836835
break;
836+
837+
case TAG_CITEM_GROUNDSTATUS:
838+
if (Button == EuroScopePlugIn::BUTTON_RIGHT)
839+
StartTagFunction(rt.GetCallsign(), NULL, TAG_CITEM_GROUNDSTATUS, rt.GetCallsign(), NULL, EuroScopePlugIn::TAG_ITEM_FUNCTION_SET_GROUND_STATUS, Pt, Area);
840+
841+
break;
837842
}
838843

839844
}
@@ -1491,6 +1496,12 @@ map<string, string> CSMRRadar::GenerateTagData(CRadarTarget rt, CFlightPlan fp,
14911496
sdep += dep.substr(dep.size() - 2, dep.size());
14921497
}
14931498

1499+
// ----- GSTAT -------
1500+
string gstat = "";
1501+
if (fp.IsValid() && isAcCorrelated) {
1502+
gstat = fp.GetGroundState();
1503+
}
1504+
14941505
// ----- Generating the replacing map -----
14951506
map<string, string> TagReplacingMap;
14961507

@@ -1543,6 +1554,7 @@ map<string, string> CSMRRadar::GenerateTagData(CRadarTarget rt, CFlightPlan fp,
15431554
TagReplacingMap["ssr"] = tssr;
15441555
TagReplacingMap["asid"] = dep;
15451556
TagReplacingMap["ssid"] = sdep;
1557+
TagReplacingMap["groundstatus"] = gstat;
15461558

15471559
return TagReplacingMap;
15481560
}
@@ -1558,7 +1570,6 @@ void CSMRRadar::OnFlightPlanDisconnect(CFlightPlan FlightPlan)
15581570
}
15591571
}
15601572

1561-
/*
15621573
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
15631574
{
15641575
switch (uMsg)
@@ -1569,7 +1580,7 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
15691580
default:
15701581
return CallWindowProc(gSourceProc, hwnd, uMsg, wParam, lParam);
15711582
}
1572-
}*/
1583+
}
15731584

15741585
void CSMRRadar::OnRefresh(HDC hDC, int Phase)
15751586
{
@@ -1581,15 +1592,16 @@ void CSMRRadar::OnRefresh(HDC hDC, int Phase)
15811592
smrCursor = CopyCursor((HCURSOR)::LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDC_SMRCURSOR), IMAGE_CURSOR, 0, 0, LR_SHARED));
15821593
// This got broken because of threading as far as I can tell
15831594
// The cursor does change for some milliseconds but gets reset almost instantly by external MFC code
1595+
15841596
}
15851597
else {
15861598
smrCursor = (HCURSOR)::LoadCursor(NULL, IDC_ARROW);
15871599
}
15881600

15891601
if (smrCursor != nullptr)
1590-
{
1591-
//pluginWindow = GetActiveWindow();
1592-
//gSourceProc = (WNDPROC)SetWindowLong(pluginWindow, GWL_WNDPROC, (LONG)WindowProc);
1602+
{
1603+
pluginWindow = GetActiveWindow();
1604+
gSourceProc = (WNDPROC)SetWindowLong(pluginWindow, GWL_WNDPROC, (LONG)WindowProc);
15931605
}
15941606
initCursor = false;
15951607
}
@@ -2117,6 +2129,7 @@ void CSMRRadar::OnRefresh(HDC hDC, int Phase)
21172129
TagClickableMap[TagReplacingMap["tssr"]] = TAG_CITEM_NO;
21182130
TagClickableMap[TagReplacingMap["asid"]] = TagClickableMap[TagReplacingMap["ssid"]] = TAG_CITEM_SID;
21192131
TagClickableMap[TagReplacingMap["systemid"]] = TAG_CITEM_NO;
2132+
TagClickableMap[TagReplacingMap["groundstatus"]] = TAG_CITEM_GROUNDSTATUS;
21202133

21212134
//
21222135
// ----- Now the hard part, drawing (using gdi+) -------
@@ -2212,6 +2225,12 @@ void CSMRRadar::OnRefresh(HDC hDC, int Phase)
22122225
SolidBrush SquawkErrorColor(ColorManager->get_corrected_color("label",
22132226
CurrentConfig->getConfigColor(LabelsSettings["squawk_error_color"])));
22142227
SolidBrush RimcasTextColor(CurrentConfig->getConfigColor(CurrentConfig->getActiveProfile()["rimcas"]["alert_text_color"]));
2228+
SolidBrush GroundPushColor(ColorManager->get_corrected_color("label",
2229+
CurrentConfig->getConfigColor(LabelsSettings["groundstatus_colors"]["push"])));
2230+
SolidBrush GroundTaxiColor(ColorManager->get_corrected_color("label",
2231+
CurrentConfig->getConfigColor(LabelsSettings["groundstatus_colors"]["taxi"])));
2232+
SolidBrush GroundDepaColor(ColorManager->get_corrected_color("label",
2233+
CurrentConfig->getConfigColor(LabelsSettings["groundstatus_colors"]["depa"])));
22152234

22162235

22172236
// Drawing the leader line
@@ -2274,6 +2293,14 @@ void CSMRRadar::OnRefresh(HDC hDC, int Phase)
22742293
if (RimcasInstance->getAlert(rt.GetCallsign()) != CRimcas::NoAlert)
22752294
color = &RimcasTextColor;
22762295

2296+
// Ground tag colors
2297+
if (strcmp(element.c_str(), "PUSH") == 0)
2298+
color = &GroundPushColor;
2299+
if (strcmp(element.c_str(), "TAXI") == 0)
2300+
color = &GroundTaxiColor;
2301+
if (strcmp(element.c_str(), "DEPA") == 0)
2302+
color = &GroundDepaColor;
2303+
22772304
RectF mRect(0, 0, 0, 0);
22782305

22792306
wstring welement = wstring(element.begin(), element.end());
@@ -2805,8 +2832,8 @@ void CSMRRadar::EuroScopePlugInExitCustom()
28052832
{
28062833
AFX_MANAGE_STATE(AfxGetStaticModuleState())
28072834

2808-
/*if (smrCursor != nullptr && smrCursor != NULL)
2835+
if (smrCursor != nullptr && smrCursor != NULL)
28092836
{
28102837
SetWindowLong(pluginWindow, GWL_WNDPROC, (LONG)gSourceProc);
2811-
}*/
2838+
}
28122839
}

0 commit comments

Comments
 (0)