-
Notifications
You must be signed in to change notification settings - Fork 0
/
AfvBridge.h
51 lines (42 loc) · 1.47 KB
/
AfvBridge.h
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
#pragma once
#include "HiddenWindow.h"
class AfvBridge : public EuroScopePlugIn::CPlugIn
{
public:
AfvBridge(void);
~AfvBridge(void);
void AddMessageToQueue(std::string message);
void OnTimer(int counter) override;
#ifdef _DEBUG
bool OnCompileCommand(const char* command);
#endif // _DEBUG
private:
void ProcessMessage(std::string message);
bool ValidBoolean(std::string boolean) const;
bool ConvertBoolean(std::string boolean) const;
void ToggleFrequency(double frequency, bool receive, bool transmit);
bool IsFrequencyMatch(double targetFrequency, EuroScopePlugIn::CGrountToAirChannel channel);
bool IsAtisChannel(std::string channel) const;
EuroScopePlugIn::CGrountToAirChannel GetPrimaryFrequency(void);
// Lock for the message queue
std::mutex messageLock;
// Internal message quque
std::queue<std::string> messages;
// Allowed deviation in frequencies due to FP rounding
const double frequencyDeviation = 0.0001;
// The window handle so we can kill it
HWND hiddenWindow = NULL;
// Class for our window
WNDCLASS windowClass = {
NULL,
HiddenWindow,
NULL,
NULL,
GetModuleHandle(NULL),
NULL,
NULL,
NULL,
NULL,
L"AfvBridgeHiddenWindowClass"
};
};