@@ -72,6 +72,13 @@ void CSiTRadar::OnRefresh(HDC hdc, int phase)
7272 continue ;
7373 }
7474
75+ // aircraft equipment parsing
76+ string icaoACData = radarTarget.GetCorrelatedFlightPlan ().GetFlightPlanData ().GetAircraftInfo ();
77+ regex icaoRVSM (" (.*)\\ /(.*)\\ -(.*)[W](.*)\\ /(.*)" , regex::icase);
78+ bool isRVSM = regex_search (icaoACData, icaoRVSM);
79+ regex icaoADSB (" (.*)\\ /(.*)\\ -(.*)\\ /(.*)(E|L|B1|B2|U1|U2|V1|V2)(.*)" );
80+ bool isADSB = regex_search (icaoACData, icaoADSB);
81+
7582 // get the target's position on the screen and add it as a screen object
7683 POINT p = ConvertCoordFromPositionToPixel (radarTarget.GetPosition ().GetPosition ());
7784 RECT prect;
@@ -81,19 +88,14 @@ void CSiTRadar::OnRefresh(HDC hdc, int phase)
8188 prect.bottom = p.y + 5 ;
8289 AddScreenObject (AIRCRAFT_SYMBOL, radarTarget.GetCallsign (), prect, FALSE , " " );
8390
84- // Handoff warning system: if the plane is within 2 minutes of exiting your airspace, CJS will blink
91+ // Handoff warning system: if the plane is within 2 minutes of exiting your airspace, CJS will blink
8592
8693 if (radarTarget.GetCorrelatedFlightPlan ().GetTrackingControllerIsMe ()) {
8794 if (radarTarget.GetCorrelatedFlightPlan ().GetSectorExitMinutes () <= 2
8895 && radarTarget.GetCorrelatedFlightPlan ().GetSectorExitMinutes () >= 0 ) {
8996 // blink the CJS
9097 string callsign = radarTarget.GetCallsign ();
9198 isBlinking[callsign] = TRUE ;
92-
93- if (isBlinking.find (radarTarget.GetCallsign ()) != isBlinking.end ()
94- && halfSecTick) {
95- continue ; // skips CJS symbol drawing when blinked out
96- }
9799 }
98100 }
99101 else {
@@ -120,9 +122,14 @@ void CSiTRadar::OnRefresh(HDC hdc, int phase)
120122 lgfont.lfHeight = 12 ;
121123 font.CreateFontIndirect (&lgfont);
122124
123- dc.SelectObject (font);
124125 dc.SetTextColor (RGB (255 , 255 , 255 ));
125126
127+ dc.SelectObject (font);
128+ if (isBlinking.find (radarTarget.GetCallsign ()) != isBlinking.end ()
129+ && halfSecTick) {
130+ handOffText=" " ; // blank CJS symbol drawing when blinked out
131+ }
132+
126133 RECT rectCJS;
127134 rectCJS.left = p.x - 6 ;
128135 rectCJS.right = p.x + 75 ;
@@ -175,6 +182,34 @@ void CSiTRadar::OnRefresh(HDC hdc, int phase)
175182 }
176183 }
177184
185+ // ADSB targets; if no primary or secondary radar, but the plane has ADSB equipment suffix (assumed space based ADS-B with no gaps)
186+
187+ if (radarTarget.GetPosition ().GetRadarFlags () == 0 ) { // need to add ADSB equipment logic
188+
189+ COLORREF targetPenColor;
190+ targetPenColor = RGB (202 , 205 , 169 ); // amber colour
191+ HPEN targetPen;
192+ targetPen = CreatePen (PS_SOLID, 1 , targetPenColor);
193+ dc.SelectObject (targetPen);
194+ dc.SelectStockObject (NULL_BRUSH);
195+
196+ // draw the shape
197+ dc.MoveTo (p.x - 5 , p.y - 5 );
198+ dc.LineTo (p.x + 5 , p.y -5 );
199+ dc.LineTo (p.x + 5 , p.y + 5 );
200+ dc.LineTo (p.x - 5 , p.y + 5 );
201+ dc.LineTo (p.x - 5 , p.y - 5 );
202+
203+ // if primary and secondary target, draw the middle line
204+ if (isRVSM) {
205+ dc.MoveTo (p.x , p.y - 5 );
206+ dc.LineTo (p.x , p.y + 5 );
207+ }
208+
209+ // cleanup
210+ DeleteObject (targetPen);
211+ }
212+
178213 // if primary target draw the symbol in magenta
179214
180215 if (radarTarget.GetPosition ().GetRadarFlags () == 1 ) {
@@ -199,16 +234,13 @@ void CSiTRadar::OnRefresh(HDC hdc, int phase)
199234
200235 // if RVSM draw the RVSM diamond
201236
202- string icaoACData = radarTarget.GetCorrelatedFlightPlan ().GetFlightPlanData ().GetAircraftInfo ();
203- regex isRVSM (" (.*)\\ /(.*)\\ -(.*)[W](.*)\\ /(.*)" , regex::icase);
204- bool icaoRVSM = regex_search (icaoACData,isRVSM);
205-
206237 if ((radarTarget.GetCorrelatedFlightPlan ().GetFlightPlanData ().GetCapibilities () == ' L' ||
207238 radarTarget.GetCorrelatedFlightPlan ().GetFlightPlanData ().GetCapibilities () == ' W' ||
208239 radarTarget.GetCorrelatedFlightPlan ().GetFlightPlanData ().GetCapibilities () == ' Z' || // FAA RVSM
209- icaoRVSM ) // ICAO equpmnet code indicates RVSM -- contains 'W'
240+ isRVSM ) // ICAO equpmnet code indicates RVSM -- contains 'W'
210241
211- && radarTarget.GetPosition ().GetRadarFlags () != 0 ) {
242+ && radarTarget.GetPosition ().GetRadarFlags () != 0 &&
243+ radarTarget.GetPosition ().GetRadarFlags () != 1 ) {
212244
213245 COLORREF targetPenColor;
214246 targetPenColor = RGB (202 , 205 , 169 ); // amber colour
@@ -235,7 +267,8 @@ void CSiTRadar::OnRefresh(HDC hdc, int phase)
235267 else {
236268
237269 if (strcmp (radarTarget.GetCorrelatedFlightPlan ().GetFlightPlanData ().GetPlanType (), " I" ) == 0
238- && radarTarget.GetPosition ().GetRadarFlags () != 0 ) {
270+ && radarTarget.GetPosition ().GetRadarFlags () != 0
271+ && radarTarget.GetPosition ().GetRadarFlags () != 1 ) {
239272 COLORREF targetPenColor;
240273 targetPenColor = RGB (202 , 205 , 169 ); // white when squawking ident
241274 HPEN targetPen;
@@ -271,7 +304,8 @@ void CSiTRadar::OnRefresh(HDC hdc, int phase)
271304 // if VFR
272305 if (strcmp (radarTarget.GetCorrelatedFlightPlan ().GetFlightPlanData ().GetPlanType (), " V" ) == 0
273306 && radarTarget.GetPosition ().GetTransponderC () == TRUE
274- && radarTarget.GetPosition ().GetRadarFlags () != 0 ) {
307+ && radarTarget.GetPosition ().GetRadarFlags () != 0
308+ && radarTarget.GetPosition ().GetRadarFlags () != 1 ) {
275309
276310 COLORREF targetPenColor;
277311 targetPenColor = RGB (242 , 120 , 57 ); // PPS orange color
@@ -532,6 +566,26 @@ void CSiTRadar::OnClickScreenObject(int ObjectType,
532566 altFilterOn = !altFilterOn;
533567 }
534568
569+
570+
571+ if (Button == BUTTON_MIDDLE) {
572+ // open Free Text menu
573+
574+ RECT freeTextPopUp;
575+ freeTextPopUp.left = Pt.x ;
576+ freeTextPopUp.top = Pt.y ;
577+ freeTextPopUp.right = Pt.x + 20 ;
578+ freeTextPopUp.bottom = Pt.y + 10 ;
579+
580+ GetPlugIn ()->OpenPopupList (freeTextPopUp, " Free Text" , 1 );
581+
582+ GetPlugIn ()->AddPopupListElement (" ADD FREE TEXT" , " " , ADD_FREE_TEXT);
583+ GetPlugIn ()->AddPopupListElement (" DELETE" , " " , DELETE_FREE_TEXT, FALSE , POPUP_ELEMENT_NO_CHECKBOX, true , false );
584+ GetPlugIn ()->AddPopupListElement (" DELETE ALL" , " " , DELETE_ALL_FREE_TEXT);
585+
586+ }
587+
588+
535589}
536590
537591void CSiTRadar::OnFunctionCall (int FunctionId,
0 commit comments