-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrameModbusFunctions.h
139 lines (130 loc) · 5.57 KB
/
FrameModbusFunctions.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//---------------------------------------------------------------------------
#ifndef FrameModbusFunctionsH
#define FrameModbusFunctionsH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <cstdint>
#include "Utils.h"
#include "Modbus.h"
//---------------------------------------------------------------------------
class TfrmeModbusFunctions : public TFrame
{
__published: // IDE-managed Components
TPanel *Panel4;
TPageControl *pgctrlFunctions;
TTabSheet *tbshrFnReadHoldingRegisters;
TLabel *Label3;
TLabel *Label4;
TButton *Button2;
TEdit *edtReadHoldingRegistersAddr;
TEdit *edtReadHoldingRegistersPtCnt;
TTabSheet *tbshrFnReadInputRegisters;
TLabel *Label12;
TLabel *Label13;
TButton *Button6;
TEdit *edtReadInputRegistersAddr;
TEdit *edtReadInputRegistersPtCnt;
TTabSheet *tbshtFnPresetSingleRegister;
TLabel *Label8;
TLabel *Label9;
TButton *Button3;
TEdit *edtPresetSingleRegisterAddr;
TEdit *edtPresetSingleRegisterValue;
TTabSheet *tbshtFnPresetMultipleRegisters;
TLabel *Label10;
TLabel *Label11;
TButton *Button5;
TEdit *edtPresetMultipleRegistersAddr;
TEdit *edtPresetMultipleRegistersData;
TCheckBox *cboxPresetSingleRegisterPulsed;
TEdit *edtPresetSingleRegisterPulseTime;
TLabel *Label2;
TCheckBox *cboxPresetMultipleRegisterPulsed;
TEdit *edtPresetMultipleRegisterPulseTime;
TLabel *Label1;
private: // User declarations
int GetFnIdx() const;
void SetFnIdx( int Val );
Modbus::RegAddrType GetReadHoldingRegistersAddr() const;
void SetReadHoldingRegistersAddr( Modbus::RegAddrType Val );
Modbus::RegCountType GetReadHoldingRegistersPtCnt() const;
void SetReadHoldingRegistersPtCnt( Modbus::RegCountType Val );
Modbus::RegAddrType GetReadInputRegistersAddr() const;
void SetReadInputRegistersAddr( Modbus::RegAddrType Val );
Modbus::RegCountType GetReadInputRegistersPtCnt() const;
void SetReadInputRegistersPtCnt( Modbus::RegCountType Val );
Modbus::RegAddrType GetPresetSingleRegisterAddr() const;
void SetPresetSingleRegisterAddr( Modbus::RegAddrType Val );
Modbus::RegDataType GetPresetSingleRegisterValue() const;
void SetPresetSingleRegisterValue( Modbus::RegDataType Val );
Modbus::RegAddrType GetPresetMultipleRegistersAddr() const;
void SetPresetMultipleRegistersAddr( Modbus::RegAddrType Val );
String GetPresetMultipleRegistersData() const;
void SetPresetMultipleRegistersData( String Val );
bool GetPresetSingleRegisterPulsed() const;
void SetPresetSingleRegisterPulsed( bool Val );
uint32_t GetPresetSingleRegisterPulseTime() const;
void SetPresetSingleRegisterPulseTime( uint32_t Val );
bool GetPresetMultipleRegisterPulsed() const;
void SetPresetMultipleRegisterPulsed( bool Val );
uint32_t GetPresetMultipleRegisterPulseTime() const;
void SetPresetMultipleRegisterPulseTime( uint32_t Val );
public: // User declarations
__fastcall TfrmeModbusFunctions(TComponent* Owner);
__property int FnIdx = { read = GetFnIdx, write = SetFnIdx };
__property Modbus::RegAddrType ReadHoldingRegistersAddr = {
read = GetReadHoldingRegistersAddr, write = SetReadHoldingRegistersAddr
};
__property Modbus::RegCountType ReadHoldingRegistersPtCnt = {
read = GetReadHoldingRegistersPtCnt, write = SetReadHoldingRegistersPtCnt
};
__property Modbus::RegAddrType ReadInputRegistersAddr = {
read = GetReadInputRegistersAddr, write = SetReadInputRegistersAddr
};
__property Modbus::RegCountType ReadInputRegistersPtCnt = {
read = GetReadInputRegistersPtCnt, write = SetReadInputRegistersPtCnt
};
__property Modbus::RegAddrType PresetSingleRegisterAddr = {
read = GetPresetSingleRegisterAddr, write = SetPresetSingleRegisterAddr
};
__property Modbus::RegDataType PresetSingleRegisterValue = {
read = GetPresetSingleRegisterValue, write = SetPresetSingleRegisterValue
};
__property Modbus::RegAddrType PresetMultipleRegistersAddr = {
read = GetPresetMultipleRegistersAddr, write = SetPresetMultipleRegistersAddr
};
__property String PresetMultipleRegistersData = {
read = GetPresetMultipleRegistersData, write = SetPresetMultipleRegistersData
};
__property bool PresetSingleRegisterPulsed = {
read = GetPresetSingleRegisterPulsed, write = SetPresetSingleRegisterPulsed
};
__property uint32_t PresetSingleRegisterPulseTime = {
read = GetPresetSingleRegisterPulseTime,
write = SetPresetSingleRegisterPulseTime
};
__property bool PresetMultipleRegisterPulsed = {
read = GetPresetMultipleRegisterPulsed, write = SetPresetMultipleRegisterPulsed
};
__property uint32_t PresetMultipleRegisterPulseTime = {
read = GetPresetMultipleRegisterPulseTime,
write = SetPresetMultipleRegisterPulseTime
};
template<typename OutIt>
void CopyPresetMultipleRegistersData( OutIt It );
};
//---------------------------------------------------------------------------
template<typename OutIt>
void TfrmeModbusFunctions::CopyPresetMultipleRegistersData( OutIt It )
{
StringToSaturatedWords( PresetMultipleRegistersData, It );
}
//---------------------------------------------------------------------------
//extern PACKAGE TfrmeModbusFunctions *frmeModbusFunctions;
//---------------------------------------------------------------------------
#endif