@@ -17,7 +17,7 @@ bool standardCursor; // switches between mouse cursor and pointer cursor when mo
1717bool customCursor; // use SMR version or default windows mouse symbol
1818WNDPROC gSourceProc ;
1919HWND 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
2222map<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
127128void 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
321320void 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- /*
15621573LRESULT 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
15741585void 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