forked from erikkaashoek/NanoVNA-App
-
Notifications
You must be signed in to change notification settings - Fork 9
/
VNAUsartUnit.h
120 lines (99 loc) · 3.62 KB
/
VNAUsartUnit.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
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
111
112
113
114
115
116
117
118
119
120
#ifndef VNAUsartUnitH
#define VNAUsartUnitH
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.Dialogs.hpp>
#include <Vcl.WinXCtrls.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Menus.hpp>
#include <vector>
#include "types.h"
class TVNAUsartCommsForm : public TForm
{
__published: // IDE-managed Components
TButton *CloseButton;
TButton *SaveButton;
TButton *ClearButton;
TMemo *Memo1;
TLabel *Label1;
TEdit *CommandEdit;
TSaveDialog *SaveDialog1;
TComboBox *VNAUsartBaudrateComboBox;
TToggleSwitch *ScrollToggleSwitch;
TGridPanel *GridPanel1;
TButton *CommandsButton1;
TButton *CommandsButton2;
TButton *CommandsButton3;
TButton *CommandsButton4;
TLabel *Label2;
TPopupMenu *CommandsButtonPopupMenu;
TMenuItem *Clearcommand1;
TMenuItem *Editcommand1;
TMenuItem *Copy1;
TMenuItem *Paste1;
TMenuItem *Rename1;
TMenuItem *N1;
TMenuItem *Cancel1;
TComboBox *CommandEndsComboBox;
TEdit *TimeoutEdit;
TLabel *Label3;
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormDestroy(TObject *Sender);
void __fastcall CloseButtonClick(TObject *Sender);
void __fastcall SaveButtonClick(TObject *Sender);
void __fastcall ClearButtonClick(TObject *Sender);
void __fastcall FormShow(TObject *Sender);
void __fastcall FormHide(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall CommandEditKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall CommandEditEnter(TObject *Sender);
void __fastcall CommandEditExit(TObject *Sender);
void __fastcall CommandEditChange(TObject *Sender);
void __fastcall VNAUsartBaudrateComboBoxChange(TObject *Sender);
void __fastcall CommandsButtonPopupMenuPopup(TObject *Sender);
void __fastcall Clearcommand1Click(TObject *Sender);
void __fastcall Editcommand1Click(TObject *Sender);
void __fastcall Copy1Click(TObject *Sender);
void __fastcall Paste1Click(TObject *Sender);
void __fastcall Rename1Click(TObject *Sender);
void __fastcall Cancel1Click(TObject *Sender);
void __fastcall CommandsButtonClick(TObject *Sender);
void __fastcall CommandsButtonDropDownClick(TObject *Sender);
void __fastcall CommandEndsComboBoxClick(TObject *Sender);
void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall TimeoutEditChange(TObject *Sender);
void __fastcall FormMouseEnter(TObject *Sender);
private: // User declarations
bool m_initialised;
int m_command_timeout_ms;
int m_command_history_index;
std::vector <String> m_command_history;
std::vector <String> m_user_commands[VNA_MAX_USER_COMMANDS];
std::vector <String> m_memo_contents;
int m_commands_edit_index;
TButton *m_popup_menu_button;
void __fastcall WMWindowPosChanging(TWMWindowPosChanging &msg);
void __fastcall loadCommandHistory();
void __fastcall saveCommandHistory();
void __fastcall loadUserCommands();
void __fastcall saveUserCommands();
void __fastcall editUserCommand(const int index);
TButton * __fastcall getPopupMenuButton();
protected:
#pragma option push -vi-
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, TWMWindowPosMsg, WMWindowPosChanging);
END_MESSAGE_MAP(TForm)
#pragma option pop
public: // User declarations
__fastcall TVNAUsartCommsForm(TComponent* Owner);
void __fastcall show();
void __fastcall clear();
void __fastcall addText(AnsiString prefix, AnsiString s);
void __fastcall setBaudrate(int baudrate);
void __fastcall update();
};
extern PACKAGE TVNAUsartCommsForm *VNAUsartCommsForm;
#endif