00a4b8f3 |
1 | #pragma once |
2 | |
00a4b8f3 |
3 | namespace GUIapp { |
4 | |
0725bb21 |
5 | using namespace System; |
6 | using namespace System::ComponentModel; |
7 | using namespace System::Collections; |
8 | using namespace System::Windows::Forms; |
9 | using namespace System::Drawing; |
10 | |
11 | const int MaxRelaysNum = 8; |
00a4b8f3 |
12 | |
0725bb21 |
13 | /// <summary> |
14 | /// Main form for the demo app |
15 | /// |
16 | /// WARNING: If you change the name of this class, you will need to change the |
17 | /// 'Resource File Name' property for the managed resource compiler tool |
18 | /// associated with all .resx files this class depends on. Otherwise, |
19 | /// the designers will not be able to interact properly with localized |
20 | /// resources associated with this form. |
21 | /// </summary> |
22 | public ref class Form1 : public System::Windows::Forms::Form |
23 | { |
24 | public: |
25 | Form1(void) |
26 | { |
27 | InitializeComponent(); |
00a4b8f3 |
28 | |
0725bb21 |
29 | // |
30 | // >>> Added constructor code |
31 | // |
32 | txtMsg->Visible = false; |
00a4b8f3 |
33 | |
00a4b8f3 |
34 | arrayFill(aIndicators, IndOn1, IndOn2, IndOn3, IndOn4, IndOn5, IndOn6, IndOn7, IndOn8); |
0725bb21 |
35 | arrayFill(aRNames, Rname1, Rname2, Rname3, Rname4, Rname5, Rname6, Rname7, Rname8); |
36 | arrayFill(aButtonsOpen, Ropen1, Ropen2, Ropen3, Ropen4, Ropen5, Ropen6, Ropen7, Ropen8); |
37 | arrayFill(aButtonsClose, Rclose1, Rclose2, Rclose3, Rclose4, Rclose5, Rclose6, Rclose7, Rclose8); |
00a4b8f3 |
38 | |
0725bb21 |
39 | for ( int i = 0; i < MaxRelaysNum; i++ ) { |
40 | System::Windows::Forms::Button^ b; |
41 | b = static_cast<System::Windows::Forms::Button^>(aButtonsOpen->GetValue(i)); |
42 | b->Text = L"Open"; |
43 | b->Click += gcnew System::EventHandler(this, &Form1::Ropen1_Click); |
44 | b = static_cast<System::Windows::Forms::Button^>(aButtonsClose->GetValue(i)); |
45 | b->Text = L"Close"; |
46 | b->Click += gcnew System::EventHandler(this, &Form1::Rclose1_Click); |
47 | System::Windows::Forms::TextBox^ t; |
48 | t = static_cast<System::Windows::Forms::TextBox^>(aRNames->GetValue(i)); |
49 | t->Text = L"Relay " + i.ToString(); |
50 | t = static_cast<System::Windows::Forms::TextBox^>(aIndicators->GetValue(i)); |
51 | } |
52 | } |
00a4b8f3 |
53 | |
0725bb21 |
54 | private: |
55 | Array^ aButtonsOpen; |
56 | Array^ aButtonsClose; |
57 | Array^ aRNames; |
58 | Array^ aIndicators; |
00a4b8f3 |
59 | |
0725bb21 |
60 | System::Windows::Forms::Label^ txtMsg; |
00a4b8f3 |
61 | |
0725bb21 |
62 | template<typename Ty> void arrayFill( Array^% aa, Ty t0, Ty t1, Ty t2, Ty t3, Ty t4, Ty t5, Ty t6, Ty t7) |
63 | { |
64 | aa = Array::CreateInstance(Ty::typeid, MaxRelaysNum); |
00a4b8f3 |
65 | aa->SetValue(t0, 0); |
66 | aa->SetValue(t1, 1); |
67 | aa->SetValue(t2, 2); |
68 | aa->SetValue(t3, 3); |
69 | aa->SetValue(t4, 4); |
70 | aa->SetValue(t5, 5); |
71 | aa->SetValue(t6, 6); |
72 | aa->SetValue(t7, 7); |
73 | |
0725bb21 |
74 | t0->Tag = gcnew System::Int16(0); |
75 | t1->Tag = gcnew System::Int16(1); |
76 | t2->Tag = gcnew System::Int16(2); |
77 | t3->Tag = gcnew System::Int16(3); |
78 | t4->Tag = gcnew System::Int16(4); |
79 | t5->Tag = gcnew System::Int16(5); |
80 | t6->Tag = gcnew System::Int16(6); |
81 | t7->Tag = gcnew System::Int16(7); |
82 | } |
00a4b8f3 |
83 | |
0725bb21 |
84 | //---------- End of added construction code -------------- |
00a4b8f3 |
85 | |
0725bb21 |
86 | protected: |
87 | /// <summary> |
88 | /// Clean up any resources being used. |
89 | /// </summary> |
90 | ~Form1() |
91 | { |
92 | if (components) |
93 | { |
94 | delete components; |
95 | } |
96 | } |
00a4b8f3 |
97 | |
0725bb21 |
98 | private: System::Windows::Forms::Button^ buttonFind; |
99 | private: System::Windows::Forms::ComboBox^ comboDevices; |
100 | private: System::Windows::Forms::Button^ buttonOpen; |
101 | private: System::Windows::Forms::TextBox^ IndOpen; |
102 | private: System::Windows::Forms::Button^ buttonClose; |
103 | private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanel1; |
00a4b8f3 |
104 | |
0725bb21 |
105 | private: System::Windows::Forms::TextBox^ Rname1; |
106 | private: System::Windows::Forms::TextBox^ Rname2; |
107 | private: System::Windows::Forms::TextBox^ Rname3; |
108 | private: System::Windows::Forms::TextBox^ Rname4; |
109 | private: System::Windows::Forms::TextBox^ Rname5; |
110 | private: System::Windows::Forms::TextBox^ Rname6; |
111 | private: System::Windows::Forms::TextBox^ Rname7; |
112 | private: System::Windows::Forms::TextBox^ Rname8; |
00a4b8f3 |
113 | |
0725bb21 |
114 | private: System::Windows::Forms::TextBox^ IndOn1; |
115 | private: System::Windows::Forms::TextBox^ IndOn2; |
116 | private: System::Windows::Forms::TextBox^ IndOn3; |
117 | private: System::Windows::Forms::TextBox^ IndOn4; |
118 | private: System::Windows::Forms::TextBox^ IndOn5; |
119 | private: System::Windows::Forms::TextBox^ IndOn6; |
120 | private: System::Windows::Forms::TextBox^ IndOn7; |
121 | private: System::Windows::Forms::TextBox^ IndOn8; |
00a4b8f3 |
122 | |
0725bb21 |
123 | private: System::Windows::Forms::Button^ Rclose8; |
124 | private: System::Windows::Forms::Button^ Rclose7; |
125 | private: System::Windows::Forms::Button^ Rclose6; |
126 | private: System::Windows::Forms::Button^ Rclose5; |
127 | private: System::Windows::Forms::Button^ Rclose4; |
128 | private: System::Windows::Forms::Button^ Rclose3; |
129 | private: System::Windows::Forms::Button^ Rclose2; |
130 | private: System::Windows::Forms::Button^ Rclose1; |
00a4b8f3 |
131 | |
0725bb21 |
132 | private: System::Windows::Forms::Button^ Ropen1; |
133 | private: System::Windows::Forms::Button^ Ropen2; |
134 | private: System::Windows::Forms::Button^ Ropen3; |
135 | private: System::Windows::Forms::Button^ Ropen4; |
136 | private: System::Windows::Forms::Button^ Ropen5; |
137 | private: System::Windows::Forms::Button^ Ropen6; |
138 | private: System::Windows::Forms::Button^ Ropen7; |
139 | private: System::Windows::Forms::Button^ Ropen8; |
00a4b8f3 |
140 | |
0725bb21 |
141 | private: System::Windows::Forms::Button^ RopenAll; |
142 | private: System::Windows::Forms::Button^ RcloseAll; |
00a4b8f3 |
143 | |
144 | |
0725bb21 |
145 | private: |
146 | /// <summary> |
147 | /// Required designer variable. |
148 | /// </summary> |
149 | System::ComponentModel::Container ^components; |
00a4b8f3 |
150 | |
151 | #pragma region Windows Form Designer generated code |
0725bb21 |
152 | /// <summary> |
153 | /// Required method for Designer support - do not modify |
154 | /// the contents of this method with the code editor. |
155 | /// </summary> |
156 | void InitializeComponent(void) |
157 | { |
158 | this->buttonFind = (gcnew System::Windows::Forms::Button()); |
159 | this->comboDevices = (gcnew System::Windows::Forms::ComboBox()); |
160 | this->buttonOpen = (gcnew System::Windows::Forms::Button()); |
161 | this->IndOpen = (gcnew System::Windows::Forms::TextBox()); |
162 | this->buttonClose = (gcnew System::Windows::Forms::Button()); |
163 | this->tableLayoutPanel1 = (gcnew System::Windows::Forms::TableLayoutPanel()); |
164 | this->Rclose8 = (gcnew System::Windows::Forms::Button()); |
165 | this->Rclose7 = (gcnew System::Windows::Forms::Button()); |
166 | this->Rclose6 = (gcnew System::Windows::Forms::Button()); |
167 | this->Rclose5 = (gcnew System::Windows::Forms::Button()); |
168 | this->Rclose4 = (gcnew System::Windows::Forms::Button()); |
169 | this->Rclose3 = (gcnew System::Windows::Forms::Button()); |
170 | this->Rclose2 = (gcnew System::Windows::Forms::Button()); |
171 | this->Rname1 = (gcnew System::Windows::Forms::TextBox()); |
172 | this->Rname2 = (gcnew System::Windows::Forms::TextBox()); |
173 | this->Rname3 = (gcnew System::Windows::Forms::TextBox()); |
174 | this->Rname4 = (gcnew System::Windows::Forms::TextBox()); |
175 | this->Rname5 = (gcnew System::Windows::Forms::TextBox()); |
176 | this->Rname6 = (gcnew System::Windows::Forms::TextBox()); |
177 | this->Rname7 = (gcnew System::Windows::Forms::TextBox()); |
178 | this->Rname8 = (gcnew System::Windows::Forms::TextBox()); |
179 | this->IndOn2 = (gcnew System::Windows::Forms::TextBox()); |
180 | this->IndOn3 = (gcnew System::Windows::Forms::TextBox()); |
181 | this->IndOn4 = (gcnew System::Windows::Forms::TextBox()); |
182 | this->IndOn5 = (gcnew System::Windows::Forms::TextBox()); |
183 | this->IndOn6 = (gcnew System::Windows::Forms::TextBox()); |
184 | this->IndOn7 = (gcnew System::Windows::Forms::TextBox()); |
185 | this->IndOn8 = (gcnew System::Windows::Forms::TextBox()); |
186 | this->Ropen1 = (gcnew System::Windows::Forms::Button()); |
187 | this->Ropen2 = (gcnew System::Windows::Forms::Button()); |
188 | this->Ropen3 = (gcnew System::Windows::Forms::Button()); |
189 | this->Ropen4 = (gcnew System::Windows::Forms::Button()); |
190 | this->Ropen5 = (gcnew System::Windows::Forms::Button()); |
191 | this->Ropen6 = (gcnew System::Windows::Forms::Button()); |
192 | this->Ropen7 = (gcnew System::Windows::Forms::Button()); |
193 | this->Ropen8 = (gcnew System::Windows::Forms::Button()); |
194 | this->IndOn1 = (gcnew System::Windows::Forms::TextBox()); |
195 | this->Rclose1 = (gcnew System::Windows::Forms::Button()); |
196 | this->RopenAll = (gcnew System::Windows::Forms::Button()); |
197 | this->RcloseAll = (gcnew System::Windows::Forms::Button()); |
198 | this->txtMsg = (gcnew System::Windows::Forms::Label()); |
199 | this->tableLayoutPanel1->SuspendLayout(); |
200 | this->SuspendLayout(); |
201 | // |
202 | // buttonFind |
203 | // |
204 | this->buttonFind->Location = System::Drawing::Point(7, 9); |
205 | this->buttonFind->Name = L"buttonFind"; |
206 | this->buttonFind->Size = System::Drawing::Size(104, 24); |
207 | this->buttonFind->TabIndex = 0; |
208 | this->buttonFind->Tag = L"99"; |
209 | this->buttonFind->Text = L"Find device"; |
210 | this->buttonFind->UseVisualStyleBackColor = true; |
211 | this->buttonFind->Click += gcnew System::EventHandler(this, &Form1::buttonFind_Click); |
212 | // |
213 | // comboDevices |
214 | // |
215 | this->comboDevices->FormattingEnabled = true; |
216 | this->comboDevices->ItemHeight = 13; |
217 | this->comboDevices->Location = System::Drawing::Point(137, 11); |
218 | this->comboDevices->Name = L"comboDevices"; |
219 | this->comboDevices->Size = System::Drawing::Size(167, 21); |
220 | this->comboDevices->TabIndex = 1; |
221 | // |
222 | // buttonOpen |
223 | // |
224 | this->buttonOpen->Location = System::Drawing::Point(7, 67); |
225 | this->buttonOpen->Name = L"buttonOpen"; |
226 | this->buttonOpen->Size = System::Drawing::Size(104, 24); |
227 | this->buttonOpen->TabIndex = 2; |
228 | this->buttonOpen->Text = L"Open device"; |
229 | this->buttonOpen->UseVisualStyleBackColor = true; |
230 | this->buttonOpen->Click += gcnew System::EventHandler(this, &Form1::buttonOpen_Click); |
231 | // |
232 | // IndOpen |
233 | // |
234 | this->IndOpen->BackColor = System::Drawing::Color::Red; |
235 | this->IndOpen->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
236 | this->IndOpen->Location = System::Drawing::Point(126, 71); |
237 | this->IndOpen->Name = L"IndOpen"; |
238 | this->IndOpen->Size = System::Drawing::Size(42, 20); |
239 | this->IndOpen->TabIndex = 3; |
240 | this->IndOpen->TabStop = false; |
241 | // |
242 | // buttonClose |
243 | // |
244 | this->buttonClose->Location = System::Drawing::Point(187, 68); |
245 | this->buttonClose->Name = L"buttonClose"; |
246 | this->buttonClose->Size = System::Drawing::Size(116, 24); |
247 | this->buttonClose->TabIndex = 4; |
248 | this->buttonClose->Text = L"Close device"; |
249 | this->buttonClose->UseVisualStyleBackColor = true; |
250 | this->buttonClose->Click += gcnew System::EventHandler(this, &Form1::buttonClose_Click); |
251 | // |
252 | // tableLayoutPanel1 |
253 | // |
254 | this->tableLayoutPanel1->ColumnCount = 4; |
255 | this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, |
256 | 30))); |
257 | this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, |
258 | 25))); |
259 | this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, |
260 | 20))); |
261 | this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, |
262 | 25))); |
263 | this->tableLayoutPanel1->Controls->Add(this->Rclose8, 3, 7); |
264 | this->tableLayoutPanel1->Controls->Add(this->Rclose7, 3, 6); |
265 | this->tableLayoutPanel1->Controls->Add(this->Rclose6, 3, 5); |
266 | this->tableLayoutPanel1->Controls->Add(this->Rclose5, 3, 4); |
267 | this->tableLayoutPanel1->Controls->Add(this->Rclose4, 3, 3); |
268 | this->tableLayoutPanel1->Controls->Add(this->Rclose3, 3, 2); |
269 | this->tableLayoutPanel1->Controls->Add(this->Rclose2, 3, 1); |
270 | this->tableLayoutPanel1->Controls->Add(this->Rname1, 0, 0); |
271 | this->tableLayoutPanel1->Controls->Add(this->Rname2, 0, 1); |
272 | this->tableLayoutPanel1->Controls->Add(this->Rname3, 0, 2); |
273 | this->tableLayoutPanel1->Controls->Add(this->Rname4, 0, 3); |
274 | this->tableLayoutPanel1->Controls->Add(this->Rname5, 0, 4); |
275 | this->tableLayoutPanel1->Controls->Add(this->Rname6, 0, 5); |
276 | this->tableLayoutPanel1->Controls->Add(this->Rname7, 0, 6); |
277 | this->tableLayoutPanel1->Controls->Add(this->Rname8, 0, 7); |
278 | this->tableLayoutPanel1->Controls->Add(this->IndOn2, 2, 1); |
279 | this->tableLayoutPanel1->Controls->Add(this->IndOn3, 2, 2); |
280 | this->tableLayoutPanel1->Controls->Add(this->IndOn4, 2, 3); |
281 | this->tableLayoutPanel1->Controls->Add(this->IndOn5, 2, 4); |
282 | this->tableLayoutPanel1->Controls->Add(this->IndOn6, 2, 5); |
283 | this->tableLayoutPanel1->Controls->Add(this->IndOn7, 2, 6); |
284 | this->tableLayoutPanel1->Controls->Add(this->IndOn8, 2, 7); |
285 | this->tableLayoutPanel1->Controls->Add(this->Ropen1, 1, 0); |
286 | this->tableLayoutPanel1->Controls->Add(this->Ropen2, 1, 1); |
287 | this->tableLayoutPanel1->Controls->Add(this->Ropen3, 1, 2); |
288 | this->tableLayoutPanel1->Controls->Add(this->Ropen4, 1, 3); |
289 | this->tableLayoutPanel1->Controls->Add(this->Ropen5, 1, 4); |
290 | this->tableLayoutPanel1->Controls->Add(this->Ropen6, 1, 5); |
291 | this->tableLayoutPanel1->Controls->Add(this->Ropen7, 1, 6); |
292 | this->tableLayoutPanel1->Controls->Add(this->Ropen8, 1, 7); |
293 | this->tableLayoutPanel1->Controls->Add(this->IndOn1, 2, 0); |
294 | this->tableLayoutPanel1->Controls->Add(this->Rclose1, 3, 0); |
295 | this->tableLayoutPanel1->Location = System::Drawing::Point(11, 101); |
296 | this->tableLayoutPanel1->Name = L"tableLayoutPanel1"; |
297 | this->tableLayoutPanel1->RowCount = 8; |
298 | this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); |
299 | this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); |
300 | this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); |
301 | this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); |
302 | this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); |
303 | this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); |
304 | this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); |
305 | this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 12.5F))); |
306 | this->tableLayoutPanel1->Size = System::Drawing::Size(292, 291); |
307 | this->tableLayoutPanel1->TabIndex = 5; |
308 | // |
309 | // Rclose8 |
310 | // |
311 | this->Rclose8->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
312 | this->Rclose8->Location = System::Drawing::Point(221, 261); |
313 | this->Rclose8->Name = L"Rclose8"; |
314 | this->Rclose8->Size = System::Drawing::Size(68, 20); |
315 | this->Rclose8->TabIndex = 30; |
316 | this->Rclose8->Text = L"button19"; |
317 | this->Rclose8->UseVisualStyleBackColor = true; |
318 | // |
319 | // Rclose7 |
320 | // |
321 | this->Rclose7->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
322 | this->Rclose7->Location = System::Drawing::Point(221, 224); |
323 | this->Rclose7->Name = L"Rclose7"; |
324 | this->Rclose7->Size = System::Drawing::Size(68, 20); |
325 | this->Rclose7->TabIndex = 29; |
326 | this->Rclose7->Text = L"button18"; |
327 | this->Rclose7->UseVisualStyleBackColor = true; |
328 | // |
329 | // Rclose6 |
330 | // |
331 | this->Rclose6->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
332 | this->Rclose6->Location = System::Drawing::Point(221, 188); |
333 | this->Rclose6->Name = L"Rclose6"; |
334 | this->Rclose6->Size = System::Drawing::Size(68, 20); |
335 | this->Rclose6->TabIndex = 28; |
336 | this->Rclose6->Text = L"button17"; |
337 | this->Rclose6->UseVisualStyleBackColor = true; |
338 | // |
339 | // Rclose5 |
340 | // |
341 | this->Rclose5->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
342 | this->Rclose5->Location = System::Drawing::Point(221, 152); |
343 | this->Rclose5->Name = L"Rclose5"; |
344 | this->Rclose5->Size = System::Drawing::Size(68, 20); |
345 | this->Rclose5->TabIndex = 27; |
346 | this->Rclose5->Text = L"button16"; |
347 | this->Rclose5->UseVisualStyleBackColor = true; |
348 | // |
349 | // Rclose4 |
350 | // |
351 | this->Rclose4->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
352 | this->Rclose4->Location = System::Drawing::Point(221, 116); |
353 | this->Rclose4->Name = L"Rclose4"; |
354 | this->Rclose4->Size = System::Drawing::Size(68, 20); |
355 | this->Rclose4->TabIndex = 26; |
356 | this->Rclose4->Text = L"button15"; |
357 | this->Rclose4->UseVisualStyleBackColor = true; |
358 | // |
359 | // Rclose3 |
360 | // |
361 | this->Rclose3->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
362 | this->Rclose3->Location = System::Drawing::Point(221, 80); |
363 | this->Rclose3->Name = L"Rclose3"; |
364 | this->Rclose3->Size = System::Drawing::Size(68, 20); |
365 | this->Rclose3->TabIndex = 25; |
366 | this->Rclose3->Text = L"button14"; |
367 | this->Rclose3->UseVisualStyleBackColor = true; |
368 | // |
369 | // Rclose2 |
370 | // |
371 | this->Rclose2->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
372 | this->Rclose2->Location = System::Drawing::Point(221, 44); |
373 | this->Rclose2->Name = L"Rclose2"; |
374 | this->Rclose2->Size = System::Drawing::Size(68, 20); |
375 | this->Rclose2->TabIndex = 24; |
376 | this->Rclose2->Text = L"button13"; |
377 | this->Rclose2->UseVisualStyleBackColor = true; |
378 | // |
379 | // Rname1 |
380 | // |
381 | this->Rname1->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
382 | this->Rname1->Location = System::Drawing::Point(3, 8); |
383 | this->Rname1->MaxLength = 64; |
384 | this->Rname1->Name = L"Rname1"; |
385 | this->Rname1->Size = System::Drawing::Size(81, 20); |
386 | this->Rname1->TabIndex = 0; |
387 | // |
388 | // Rname2 |
389 | // |
390 | this->Rname2->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
391 | this->Rname2->Location = System::Drawing::Point(3, 44); |
392 | this->Rname2->MaxLength = 64; |
393 | this->Rname2->Name = L"Rname2"; |
394 | this->Rname2->Size = System::Drawing::Size(81, 20); |
395 | this->Rname2->TabIndex = 1; |
396 | // |
397 | // Rname3 |
398 | // |
399 | this->Rname3->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
400 | this->Rname3->Location = System::Drawing::Point(3, 80); |
401 | this->Rname3->MaxLength = 64; |
402 | this->Rname3->Name = L"Rname3"; |
403 | this->Rname3->Size = System::Drawing::Size(81, 20); |
404 | this->Rname3->TabIndex = 2; |
405 | // |
406 | // Rname4 |
407 | // |
408 | this->Rname4->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
409 | this->Rname4->Location = System::Drawing::Point(3, 116); |
410 | this->Rname4->MaxLength = 64; |
411 | this->Rname4->Name = L"Rname4"; |
412 | this->Rname4->Size = System::Drawing::Size(81, 20); |
413 | this->Rname4->TabIndex = 3; |
414 | // |
415 | // Rname5 |
416 | // |
417 | this->Rname5->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
418 | this->Rname5->Location = System::Drawing::Point(3, 152); |
419 | this->Rname5->MaxLength = 64; |
420 | this->Rname5->Name = L"Rname5"; |
421 | this->Rname5->Size = System::Drawing::Size(81, 20); |
422 | this->Rname5->TabIndex = 4; |
423 | // |
424 | // Rname6 |
425 | // |
426 | this->Rname6->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
427 | this->Rname6->Location = System::Drawing::Point(3, 188); |
428 | this->Rname6->MaxLength = 64; |
429 | this->Rname6->Name = L"Rname6"; |
430 | this->Rname6->Size = System::Drawing::Size(81, 20); |
431 | this->Rname6->TabIndex = 5; |
432 | // |
433 | // Rname7 |
434 | // |
435 | this->Rname7->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
436 | this->Rname7->Location = System::Drawing::Point(3, 224); |
437 | this->Rname7->MaxLength = 64; |
438 | this->Rname7->Name = L"Rname7"; |
439 | this->Rname7->Size = System::Drawing::Size(81, 20); |
440 | this->Rname7->TabIndex = 6; |
441 | // |
442 | // Rname8 |
443 | // |
444 | this->Rname8->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
445 | this->Rname8->Location = System::Drawing::Point(3, 261); |
446 | this->Rname8->MaxLength = 64; |
447 | this->Rname8->Name = L"Rname8"; |
448 | this->Rname8->Size = System::Drawing::Size(81, 20); |
449 | this->Rname8->TabIndex = 7; |
450 | // |
451 | // IndOn2 |
452 | // |
453 | this->IndOn2->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
454 | this->IndOn2->BackColor = System::Drawing::Color::Red; |
455 | this->IndOn2->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
456 | this->IndOn2->Location = System::Drawing::Point(163, 44); |
457 | this->IndOn2->Name = L"IndOn2"; |
458 | this->IndOn2->ReadOnly = true; |
459 | this->IndOn2->Size = System::Drawing::Size(52, 20); |
460 | this->IndOn2->TabIndex = 8; |
461 | this->IndOn2->TabStop = false; |
462 | // |
463 | // IndOn3 |
464 | // |
465 | this->IndOn3->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
466 | this->IndOn3->BackColor = System::Drawing::Color::Red; |
467 | this->IndOn3->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
468 | this->IndOn3->Location = System::Drawing::Point(163, 80); |
469 | this->IndOn3->Name = L"IndOn3"; |
470 | this->IndOn3->ReadOnly = true; |
471 | this->IndOn3->Size = System::Drawing::Size(52, 20); |
472 | this->IndOn3->TabIndex = 9; |
473 | this->IndOn3->TabStop = false; |
474 | // |
475 | // IndOn4 |
476 | // |
477 | this->IndOn4->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
478 | this->IndOn4->BackColor = System::Drawing::Color::Red; |
479 | this->IndOn4->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
480 | this->IndOn4->Location = System::Drawing::Point(163, 116); |
481 | this->IndOn4->Name = L"IndOn4"; |
482 | this->IndOn4->ReadOnly = true; |
483 | this->IndOn4->Size = System::Drawing::Size(52, 20); |
484 | this->IndOn4->TabIndex = 10; |
485 | this->IndOn4->TabStop = false; |
486 | // |
487 | // IndOn5 |
488 | // |
489 | this->IndOn5->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
490 | this->IndOn5->BackColor = System::Drawing::Color::Red; |
491 | this->IndOn5->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
492 | this->IndOn5->Location = System::Drawing::Point(163, 152); |
493 | this->IndOn5->Name = L"IndOn5"; |
494 | this->IndOn5->ReadOnly = true; |
495 | this->IndOn5->Size = System::Drawing::Size(52, 20); |
496 | this->IndOn5->TabIndex = 11; |
497 | this->IndOn5->TabStop = false; |
498 | // |
499 | // IndOn6 |
500 | // |
501 | this->IndOn6->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
502 | this->IndOn6->BackColor = System::Drawing::Color::Red; |
503 | this->IndOn6->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
504 | this->IndOn6->Location = System::Drawing::Point(163, 188); |
505 | this->IndOn6->Name = L"IndOn6"; |
506 | this->IndOn6->ReadOnly = true; |
507 | this->IndOn6->Size = System::Drawing::Size(52, 20); |
508 | this->IndOn6->TabIndex = 12; |
509 | this->IndOn6->TabStop = false; |
510 | // |
511 | // IndOn7 |
512 | // |
513 | this->IndOn7->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
514 | this->IndOn7->BackColor = System::Drawing::Color::Red; |
515 | this->IndOn7->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
516 | this->IndOn7->Location = System::Drawing::Point(163, 224); |
517 | this->IndOn7->Name = L"IndOn7"; |
518 | this->IndOn7->ReadOnly = true; |
519 | this->IndOn7->Size = System::Drawing::Size(52, 20); |
520 | this->IndOn7->TabIndex = 13; |
521 | this->IndOn7->TabStop = false; |
522 | // |
523 | // IndOn8 |
524 | // |
525 | this->IndOn8->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
526 | this->IndOn8->BackColor = System::Drawing::Color::Red; |
527 | this->IndOn8->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
528 | this->IndOn8->Location = System::Drawing::Point(163, 261); |
529 | this->IndOn8->Name = L"IndOn8"; |
530 | this->IndOn8->ReadOnly = true; |
531 | this->IndOn8->Size = System::Drawing::Size(52, 20); |
532 | this->IndOn8->TabIndex = 14; |
533 | this->IndOn8->TabStop = false; |
534 | // |
535 | // Ropen1 |
536 | // |
537 | this->Ropen1->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
538 | this->Ropen1->Location = System::Drawing::Point(90, 8); |
539 | this->Ropen1->Name = L"Ropen1"; |
540 | this->Ropen1->Size = System::Drawing::Size(67, 20); |
541 | this->Ropen1->TabIndex = 15; |
542 | this->Ropen1->Text = L"button4"; |
543 | this->Ropen1->UseVisualStyleBackColor = true; |
544 | // |
545 | // Ropen2 |
546 | // |
547 | this->Ropen2->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
548 | this->Ropen2->Location = System::Drawing::Point(90, 44); |
549 | this->Ropen2->Name = L"Ropen2"; |
550 | this->Ropen2->Size = System::Drawing::Size(67, 20); |
551 | this->Ropen2->TabIndex = 16; |
552 | this->Ropen2->Text = L"button5"; |
553 | this->Ropen2->UseVisualStyleBackColor = true; |
554 | // |
555 | // Ropen3 |
556 | // |
557 | this->Ropen3->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
558 | this->Ropen3->Location = System::Drawing::Point(90, 80); |
559 | this->Ropen3->Name = L"Ropen3"; |
560 | this->Ropen3->Size = System::Drawing::Size(67, 20); |
561 | this->Ropen3->TabIndex = 17; |
562 | this->Ropen3->Text = L"button6"; |
563 | this->Ropen3->UseVisualStyleBackColor = true; |
564 | // |
565 | // Ropen4 |
566 | // |
567 | this->Ropen4->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
568 | this->Ropen4->Location = System::Drawing::Point(90, 116); |
569 | this->Ropen4->Name = L"Ropen4"; |
570 | this->Ropen4->Size = System::Drawing::Size(67, 20); |
571 | this->Ropen4->TabIndex = 18; |
572 | this->Ropen4->Text = L"button7"; |
573 | this->Ropen4->UseVisualStyleBackColor = true; |
574 | // |
575 | // Ropen5 |
576 | // |
577 | this->Ropen5->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
578 | this->Ropen5->Location = System::Drawing::Point(90, 152); |
579 | this->Ropen5->Name = L"Ropen5"; |
580 | this->Ropen5->Size = System::Drawing::Size(67, 20); |
581 | this->Ropen5->TabIndex = 19; |
582 | this->Ropen5->Text = L"button8"; |
583 | this->Ropen5->UseVisualStyleBackColor = true; |
584 | // |
585 | // Ropen6 |
586 | // |
587 | this->Ropen6->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
588 | this->Ropen6->Location = System::Drawing::Point(90, 188); |
589 | this->Ropen6->Name = L"Ropen6"; |
590 | this->Ropen6->Size = System::Drawing::Size(67, 20); |
591 | this->Ropen6->TabIndex = 20; |
592 | this->Ropen6->Text = L"button9"; |
593 | this->Ropen6->UseVisualStyleBackColor = true; |
594 | // |
595 | // Ropen7 |
596 | // |
597 | this->Ropen7->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
598 | this->Ropen7->Location = System::Drawing::Point(90, 224); |
599 | this->Ropen7->Name = L"Ropen7"; |
600 | this->Ropen7->Size = System::Drawing::Size(67, 20); |
601 | this->Ropen7->TabIndex = 21; |
602 | this->Ropen7->Text = L"button10"; |
603 | this->Ropen7->UseVisualStyleBackColor = true; |
604 | // |
605 | // Ropen8 |
606 | // |
607 | this->Ropen8->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
608 | this->Ropen8->Location = System::Drawing::Point(90, 261); |
609 | this->Ropen8->Name = L"Ropen8"; |
610 | this->Ropen8->Size = System::Drawing::Size(67, 20); |
611 | this->Ropen8->TabIndex = 22; |
612 | this->Ropen8->Text = L"button11"; |
613 | this->Ropen8->UseVisualStyleBackColor = true; |
614 | // |
615 | // IndOn1 |
616 | // |
617 | this->IndOn1->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
618 | this->IndOn1->BackColor = System::Drawing::Color::Red; |
619 | this->IndOn1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; |
620 | this->IndOn1->Location = System::Drawing::Point(163, 8); |
621 | this->IndOn1->Name = L"IndOn1"; |
622 | this->IndOn1->ReadOnly = true; |
623 | this->IndOn1->Size = System::Drawing::Size(52, 20); |
624 | this->IndOn1->TabIndex = 6; |
625 | this->IndOn1->TabStop = false; |
626 | // |
627 | // Rclose1 |
628 | // |
629 | this->Rclose1->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right)); |
630 | this->Rclose1->Location = System::Drawing::Point(221, 8); |
631 | this->Rclose1->Name = L"Rclose1"; |
632 | this->Rclose1->Size = System::Drawing::Size(68, 20); |
633 | this->Rclose1->TabIndex = 23; |
634 | this->Rclose1->Text = L"button12"; |
635 | this->Rclose1->UseVisualStyleBackColor = true; |
636 | // |
637 | // RopenAll |
638 | // |
639 | this->RopenAll->Location = System::Drawing::Point(11, 398); |
640 | this->RopenAll->Name = L"RopenAll"; |
641 | this->RopenAll->Size = System::Drawing::Size(108, 35); |
642 | this->RopenAll->TabIndex = 6; |
643 | this->RopenAll->Text = L"Open All"; |
644 | this->RopenAll->UseVisualStyleBackColor = true; |
645 | this->RopenAll->Click += gcnew System::EventHandler(this, &Form1::RopenAll_Click); |
646 | // |
647 | // RcloseAll |
648 | // |
649 | this->RcloseAll->Location = System::Drawing::Point(191, 398); |
650 | this->RcloseAll->Name = L"RcloseAll"; |
651 | this->RcloseAll->Size = System::Drawing::Size(108, 35); |
652 | this->RcloseAll->TabIndex = 7; |
653 | this->RcloseAll->Text = L"Close All"; |
654 | this->RcloseAll->UseVisualStyleBackColor = true; |
655 | this->RcloseAll->Click += gcnew System::EventHandler(this, &Form1::RcloseAll_Click); |
656 | // |
657 | // txtMsg |
658 | // |
659 | this->txtMsg->AutoSize = true; |
660 | this->txtMsg->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, |
661 | static_cast<System::Byte>(0))); |
662 | this->txtMsg->ForeColor = System::Drawing::Color::White; |
663 | this->txtMsg->Location = System::Drawing::Point(12, 41); |
664 | this->txtMsg->Name = L"txtMsg"; |
665 | this->txtMsg->Size = System::Drawing::Size(46, 17); |
666 | this->txtMsg->TabIndex = 8; |
667 | this->txtMsg->Text = L"label1"; |
668 | this->txtMsg->Click += gcnew System::EventHandler(this, &Form1::txtMsg_Click); |
669 | // |
670 | // Form1 |
671 | // |
672 | this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); |
673 | this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; |
674 | this->ClientSize = System::Drawing::Size(318, 448); |
675 | this->Controls->Add(this->txtMsg); |
676 | this->Controls->Add(this->RcloseAll); |
677 | this->Controls->Add(this->RopenAll); |
678 | this->Controls->Add(this->tableLayoutPanel1); |
679 | this->Controls->Add(this->buttonClose); |
680 | this->Controls->Add(this->IndOpen); |
681 | this->Controls->Add(this->buttonOpen); |
682 | this->Controls->Add(this->comboDevices); |
683 | this->Controls->Add(this->buttonFind); |
684 | this->Name = L"Form1"; |
685 | this->Text = L"USB Relay Manager"; |
686 | this->tableLayoutPanel1->ResumeLayout(false); |
687 | this->tableLayoutPanel1->PerformLayout(); |
688 | this->ResumeLayout(false); |
689 | this->PerformLayout(); |
00a4b8f3 |
690 | |
0725bb21 |
691 | } |
00a4b8f3 |
692 | #pragma endregion |
0725bb21 |
693 | |
00a4b8f3 |
694 | private: System::Void buttonFind_Click(System::Object^ sender, System::EventArgs^ e); |
0725bb21 |
695 | |
00a4b8f3 |
696 | private: System::Void buttonOpen_Click(System::Object^ sender, System::EventArgs^ e); |
0725bb21 |
697 | |
00a4b8f3 |
698 | private: System::Void buttonClose_Click(System::Object^ sender, System::EventArgs^ e); |
0725bb21 |
699 | |
00a4b8f3 |
700 | private: System::Void RopenAll_Click(System::Object^ sender, System::EventArgs^ e); |
0725bb21 |
701 | |
00a4b8f3 |
702 | private: System::Void RcloseAll_Click(System::Object^ sender, System::EventArgs^ e); |
0725bb21 |
703 | |
00a4b8f3 |
704 | private: System::Void Ropen1_Click(System::Object^ sender, System::EventArgs^ e); |
0725bb21 |
705 | |
00a4b8f3 |
706 | private: System::Void Rclose1_Click(System::Object^ sender, System::EventArgs^ e); |
0725bb21 |
707 | |
00a4b8f3 |
708 | private: System::Void txtMsg_Click(System::Object^ sender, System::EventArgs^ e) { |
0725bb21 |
709 | txtMsg->Visible = false; |
710 | } |
00a4b8f3 |
711 | |
712 | public: |
0725bb21 |
713 | // Show a message in txtMsg field |
714 | // The message is green or green, depending on param err |
715 | // Hide txtMsg field if msg is null |
716 | System::Void setMsg(System::String^ msg, bool err) |
717 | { |
718 | if (!msg) { |
719 | txtMsg->Visible = false; |
720 | } else { |
721 | System::Drawing::Color color = err ? System::Drawing::Color::Red : System::Drawing::Color::Green; |
722 | txtMsg->Text = msg; |
723 | txtMsg->BackColor = color; |
724 | txtMsg->Visible = true; |
725 | } |
726 | } |
00a4b8f3 |
727 | }; |
00a4b8f3 |
728 | |
0725bb21 |
729 | } |