-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathCDMScreen.h
More file actions
77 lines (63 loc) · 2.17 KB
/
CDMScreen.h
File metadata and controls
77 lines (63 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include <vector>
#include <string>
#include <windows.h>
#include "EuroScopePlugIn.h"
#include <map>
#include <chrono>
#pragma comment(lib, "Gdi32.lib")
#pragma comment(lib, "User32.lib")
using namespace std;
using namespace EuroScopePlugIn;
class CDM;
struct PendingMasterChange {
std::chrono::steady_clock::time_point startTime;
bool adding; // true=add, false=remove
};
class CDMScreen : public CRadarScreen {
public:
CDMScreen(CDM* pCDM);
virtual ~CDMScreen();
std::map<std::string, PendingMasterChange> pendingMasterChanges;
void OnAsrContentToBeClosed(void);
void OnAsrContentToBeSaved(void);
void OnAsrContentLoaded(bool Loaded);
void OnRefresh(HDC hDC, int Phase);
void DrawMasterAirportPanel(HDC hDC);
void ToggleMasterAirport(const std::string& icao);
void OnClickScreenObject(int ObjectType, const char* sObjectId, POINT Pt, RECT Area, int Button);
void OnMoveScreenObject(int ObjectType, const char* sObjectId, POINT Pt, RECT Area, bool Released);
void OnMouseMove(POINT Pt);
static constexpr int MAX_AIRPORTS_DISPLAYED = 9999;
int CalculatePanelHeight(int airportCount) const;
void CheckPendingMasterChanges();
void MarkAirportPending(const std::string& icao, bool adding);
// -----------------------
// Flights panel (reads from CDM::relevantFlights)
// -----------------------
void DrawRelevantFlightsPanel(HDC hDC);
std::vector<std::vector<std::string>> GetFilteredRelevantFlightsRows() const;
// -----------------------
// Airport panel geometry
// -----------------------
RECT masterAirportPanelRect;
RECT masterAirportBtnRects[MAX_AIRPORTS_DISPLAYED];
RECT plusBtnRect;
RECT minBtnRect;
std::vector<std::string> cached_airports;
POINT panelPosition;
bool minimized;
// -----------------------
// Flights panel state
// -----------------------
POINT flightsPanelPos{ 40, 640 };
RECT flightsPanelRect{ 0,0,0,0 };
RECT flightsHeaderRect{ 0,0,0,0 };
bool showAtfcmAllFlights = false;
bool showAtfcmAllCdmFlights = false;
RECT flightsFilterRect;
int sortColumn;
bool sortAscending;
private:
CDM* cdm;
};