-
Notifications
You must be signed in to change notification settings - Fork 5
/
requestMenu.hpp
110 lines (70 loc) · 2.48 KB
/
requestMenu.hpp
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#pragma once
#include "EuroScopePlugIn.h"
#include "usefulStuff.hpp"
#include <iostream>
#include <map>
#include "Constant.hpp"
#include <thread>
#include "internet.hpp"
using namespace std;
using namespace EuroScopePlugIn;
const string MY_PLUGIN_NAME = "VCH";
const string MY_PLUGIN_VERSION = "0.8.4";
const string MY_PLUGIN_DEVELOPER = "Jan Fries";
const string MY_PLUGIN_COPYRIGHT = "GPL v3";
const string MY_PLUGIN_VIEW_AVISO = "Kleine Helferlein in Euroscope";
typedef struct requestBox {
char type{};
int time = -1;
int lastSeen = -1;
bool active() {
return getTime() - 10 < lastSeen;
}
bool erase() {
return getTime() - 600 > lastSeen;
}
int age() {
return getTime() - time;
}
};
class CVCHPlugin: public EuroScopePlugIn::CPlugIn
{
public:
// Euroscope functions
CVCHPlugin();
virtual ~CVCHPlugin();
virtual void OnGetTagItem(CFlightPlan flightPlan, CRadarTarget RadarTarget, int ItemCode, int TagData, char sItemString[16], int * pColorCode, COLORREF * pRGB, double * pFontSize);
virtual void OnFunctionCall(int FunctionId, const char * sItemString, POINT Pt, RECT Area);
virtual bool OnCompileCommand(const char* sCommandLine);
virtual void OnTimer(int Counter);
// Plugin functions
// Request section
virtual void createRequest(string callsign, string requestString);
virtual void deleteRequest(string callsign);
virtual bool hasRequest(string callsign);
virtual void setStatus(string status, CFlightPlan *flightPlan);
virtual string getStatus(CFlightPlan *flightPlan);
virtual string getSequence(string callsign, char type);
virtual void cleanRequests();
virtual COLORREF getTimeColor(int time);
virtual COLORREF getTextColor(int tagItem);
// Hold-short section
virtual void setHoldShort(string holdShort, CFlightPlan *flightPlan);
virtual string getHoldShort(CFlightPlan *flightPlan);
// Cleared-to-land section
virtual void setClearedToLand(CFlightPlan *flightPlan);
virtual bool isClearedToLand(CFlightPlan *flightPlan);
// Reminder section
virtual void switchReminder(CFlightPlan *flightPlan);
virtual bool hasReminder(CFlightPlan *flightPlan);
// Common section
virtual void versionCheck();
virtual void displayMessage(string message);
virtual void displayError(string message);
virtual void displayDebug(string message);
virtual bool isLanding(double distance);
virtual bool isDeparting(double distance);
virtual bool getTracking(bool tracking);
//virtual int getAltitudeAboveAirport(CFlightPlan flightPlan);
string getAirport();
};