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