1 |
32 |
robfinch |
#pragma once
|
2 |
|
|
#include "stdafx.h"
|
3 |
|
|
extern clsSystem system1;
|
4 |
|
|
|
5 |
|
|
namespace emuThor {
|
6 |
|
|
|
7 |
|
|
using namespace System;
|
8 |
|
|
using namespace System::ComponentModel;
|
9 |
|
|
using namespace System::Collections;
|
10 |
|
|
using namespace System::Windows::Forms;
|
11 |
|
|
using namespace System::Data;
|
12 |
|
|
using namespace System::Drawing;
|
13 |
|
|
using namespace System::Runtime::InteropServices;
|
14 |
|
|
using namespace System::Threading;
|
15 |
|
|
|
16 |
|
|
/// <summary>
|
17 |
|
|
/// Summary for frmUart
|
18 |
|
|
/// </summary>
|
19 |
|
|
public ref class frmUart : public System::Windows::Forms::Form
|
20 |
|
|
{
|
21 |
|
|
public:
|
22 |
|
|
frmUart(Mutex^ m)
|
23 |
|
|
{
|
24 |
|
|
mut = m;
|
25 |
|
|
InitializeComponent();
|
26 |
|
|
//
|
27 |
|
|
//TODO: Add the constructor code here
|
28 |
|
|
//
|
29 |
35 |
robfinch |
do_send = false;
|
30 |
32 |
robfinch |
}
|
31 |
|
|
|
32 |
|
|
protected:
|
33 |
|
|
/// <summary>
|
34 |
|
|
/// Clean up any resources being used.
|
35 |
|
|
/// </summary>
|
36 |
|
|
~frmUart()
|
37 |
|
|
{
|
38 |
|
|
if (components)
|
39 |
|
|
{
|
40 |
|
|
delete components;
|
41 |
|
|
}
|
42 |
|
|
}
|
43 |
|
|
private: System::Windows::Forms::TextBox^ txtToUart;
|
44 |
|
|
protected:
|
45 |
|
|
|
46 |
|
|
protected:
|
47 |
|
|
private: System::Windows::Forms::Label^ label1;
|
48 |
|
|
private: System::Windows::Forms::Label^ label2;
|
49 |
|
|
private: System::Windows::Forms::TextBox^ txtFromUart;
|
50 |
|
|
|
51 |
35 |
robfinch |
|
52 |
32 |
robfinch |
private: System::Windows::Forms::Button^ button2;
|
53 |
|
|
private: System::Windows::Forms::Label^ label3;
|
54 |
|
|
private: System::Windows::Forms::TextBox^ txtCM0;
|
55 |
|
|
private: System::Windows::Forms::TextBox^ txtCM1;
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
private: System::Windows::Forms::Label^ label4;
|
59 |
|
|
private: System::Windows::Forms::TextBox^ txtCM2;
|
60 |
|
|
|
61 |
|
|
private: System::Windows::Forms::Label^ label5;
|
62 |
|
|
private: System::Windows::Forms::TextBox^ txtCM3;
|
63 |
|
|
|
64 |
|
|
private: System::Windows::Forms::Label^ label6;
|
65 |
|
|
private: System::Windows::Forms::Label^ label7;
|
66 |
|
|
private: System::Windows::Forms::TextBox^ txtTB;
|
67 |
|
|
private: System::Windows::Forms::TextBox^ txtLS;
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
private: System::Windows::Forms::Label^ label8;
|
71 |
|
|
private: System::Windows::Forms::TextBox^ txtMS;
|
72 |
|
|
|
73 |
|
|
private: System::Windows::Forms::Label^ label9;
|
74 |
|
|
private: System::Windows::Forms::TextBox^ txtIS;
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
private: System::Windows::Forms::Label^ label10;
|
78 |
|
|
private: System::Windows::Forms::TextBox^ txtIER;
|
79 |
|
|
private: System::Windows::Forms::Label^ label11;
|
80 |
|
|
private: System::Windows::Forms::TextBox^ txtFF;
|
81 |
|
|
|
82 |
|
|
private: System::Windows::Forms::Label^ label12;
|
83 |
|
|
private: System::Windows::Forms::TextBox^ txtMC;
|
84 |
|
|
|
85 |
|
|
private: System::Windows::Forms::Label^ label13;
|
86 |
|
|
private: System::Windows::Forms::TextBox^ txtCTRL;
|
87 |
|
|
|
88 |
|
|
private: System::Windows::Forms::Label^ label14;
|
89 |
|
|
private: System::Windows::Forms::TextBox^ txtFC;
|
90 |
|
|
|
91 |
|
|
private: System::Windows::Forms::Label^ label15;
|
92 |
|
|
private: System::Windows::Forms::Timer^ timer1;
|
93 |
|
|
private: System::Windows::Forms::CheckBox^ checkBox1;
|
94 |
|
|
private: System::Windows::Forms::CheckBox^ checkBox2;
|
95 |
|
|
private: System::Windows::Forms::CheckBox^ checkBox3;
|
96 |
|
|
private: System::Windows::Forms::TextBox^ txtRB;
|
97 |
|
|
|
98 |
|
|
private: System::Windows::Forms::Label^ label16;
|
99 |
|
|
private: System::ComponentModel::IContainer^ components;
|
100 |
|
|
|
101 |
|
|
private:
|
102 |
|
|
/// <summary>
|
103 |
|
|
/// Required designer variable.
|
104 |
|
|
/// </summary>
|
105 |
|
|
private: bool do_send;
|
106 |
35 |
robfinch |
private: Mutex^ mut;
|
107 |
32 |
robfinch |
|
108 |
|
|
#pragma region Windows Form Designer generated code
|
109 |
|
|
/// <summary>
|
110 |
|
|
/// Required method for Designer support - do not modify
|
111 |
|
|
/// the contents of this method with the code editor.
|
112 |
|
|
/// </summary>
|
113 |
|
|
void InitializeComponent(void)
|
114 |
|
|
{
|
115 |
|
|
this->components = (gcnew System::ComponentModel::Container());
|
116 |
|
|
this->txtToUart = (gcnew System::Windows::Forms::TextBox());
|
117 |
|
|
this->label1 = (gcnew System::Windows::Forms::Label());
|
118 |
|
|
this->label2 = (gcnew System::Windows::Forms::Label());
|
119 |
|
|
this->txtFromUart = (gcnew System::Windows::Forms::TextBox());
|
120 |
|
|
this->button2 = (gcnew System::Windows::Forms::Button());
|
121 |
|
|
this->label3 = (gcnew System::Windows::Forms::Label());
|
122 |
|
|
this->txtCM0 = (gcnew System::Windows::Forms::TextBox());
|
123 |
|
|
this->txtCM1 = (gcnew System::Windows::Forms::TextBox());
|
124 |
|
|
this->label4 = (gcnew System::Windows::Forms::Label());
|
125 |
|
|
this->txtCM2 = (gcnew System::Windows::Forms::TextBox());
|
126 |
|
|
this->label5 = (gcnew System::Windows::Forms::Label());
|
127 |
|
|
this->txtCM3 = (gcnew System::Windows::Forms::TextBox());
|
128 |
|
|
this->label6 = (gcnew System::Windows::Forms::Label());
|
129 |
|
|
this->label7 = (gcnew System::Windows::Forms::Label());
|
130 |
|
|
this->txtTB = (gcnew System::Windows::Forms::TextBox());
|
131 |
|
|
this->txtLS = (gcnew System::Windows::Forms::TextBox());
|
132 |
|
|
this->label8 = (gcnew System::Windows::Forms::Label());
|
133 |
|
|
this->txtMS = (gcnew System::Windows::Forms::TextBox());
|
134 |
|
|
this->label9 = (gcnew System::Windows::Forms::Label());
|
135 |
|
|
this->txtIS = (gcnew System::Windows::Forms::TextBox());
|
136 |
|
|
this->label10 = (gcnew System::Windows::Forms::Label());
|
137 |
|
|
this->txtIER = (gcnew System::Windows::Forms::TextBox());
|
138 |
|
|
this->label11 = (gcnew System::Windows::Forms::Label());
|
139 |
|
|
this->txtFF = (gcnew System::Windows::Forms::TextBox());
|
140 |
|
|
this->label12 = (gcnew System::Windows::Forms::Label());
|
141 |
|
|
this->txtMC = (gcnew System::Windows::Forms::TextBox());
|
142 |
|
|
this->label13 = (gcnew System::Windows::Forms::Label());
|
143 |
|
|
this->txtCTRL = (gcnew System::Windows::Forms::TextBox());
|
144 |
|
|
this->label14 = (gcnew System::Windows::Forms::Label());
|
145 |
|
|
this->txtFC = (gcnew System::Windows::Forms::TextBox());
|
146 |
|
|
this->label15 = (gcnew System::Windows::Forms::Label());
|
147 |
|
|
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
|
148 |
|
|
this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
|
149 |
|
|
this->checkBox2 = (gcnew System::Windows::Forms::CheckBox());
|
150 |
|
|
this->checkBox3 = (gcnew System::Windows::Forms::CheckBox());
|
151 |
|
|
this->txtRB = (gcnew System::Windows::Forms::TextBox());
|
152 |
|
|
this->label16 = (gcnew System::Windows::Forms::Label());
|
153 |
|
|
this->SuspendLayout();
|
154 |
|
|
//
|
155 |
|
|
// txtToUart
|
156 |
|
|
//
|
157 |
35 |
robfinch |
this->txtToUart->Location = System::Drawing::Point(27, 67);
|
158 |
32 |
robfinch |
this->txtToUart->Multiline = true;
|
159 |
|
|
this->txtToUart->Name = L"txtToUart";
|
160 |
35 |
robfinch |
this->txtToUart->ScrollBars = System::Windows::Forms::ScrollBars::Both;
|
161 |
32 |
robfinch |
this->txtToUart->Size = System::Drawing::Size(318, 124);
|
162 |
|
|
this->txtToUart->TabIndex = 0;
|
163 |
|
|
//
|
164 |
|
|
// label1
|
165 |
|
|
//
|
166 |
|
|
this->label1->AutoSize = true;
|
167 |
35 |
robfinch |
this->label1->Location = System::Drawing::Point(24, 51);
|
168 |
32 |
robfinch |
this->label1->Name = L"label1";
|
169 |
|
|
this->label1->Size = System::Drawing::Size(53, 13);
|
170 |
|
|
this->label1->TabIndex = 1;
|
171 |
|
|
this->label1->Text = L"To UART";
|
172 |
|
|
//
|
173 |
|
|
// label2
|
174 |
|
|
//
|
175 |
|
|
this->label2->AutoSize = true;
|
176 |
35 |
robfinch |
this->label2->Location = System::Drawing::Point(24, 209);
|
177 |
32 |
robfinch |
this->label2->Name = L"label2";
|
178 |
|
|
this->label2->Size = System::Drawing::Size(95, 13);
|
179 |
|
|
this->label2->TabIndex = 2;
|
180 |
|
|
this->label2->Text = L"UART Transmitted";
|
181 |
|
|
//
|
182 |
|
|
// txtFromUart
|
183 |
|
|
//
|
184 |
35 |
robfinch |
this->txtFromUart->Location = System::Drawing::Point(27, 225);
|
185 |
32 |
robfinch |
this->txtFromUart->Multiline = true;
|
186 |
|
|
this->txtFromUart->Name = L"txtFromUart";
|
187 |
35 |
robfinch |
this->txtFromUart->ReadOnly = true;
|
188 |
|
|
this->txtFromUart->ScrollBars = System::Windows::Forms::ScrollBars::Both;
|
189 |
32 |
robfinch |
this->txtFromUart->Size = System::Drawing::Size(318, 124);
|
190 |
|
|
this->txtFromUart->TabIndex = 3;
|
191 |
|
|
//
|
192 |
|
|
// button2
|
193 |
|
|
//
|
194 |
35 |
robfinch |
this->button2->Location = System::Drawing::Point(351, 65);
|
195 |
32 |
robfinch |
this->button2->Name = L"button2";
|
196 |
|
|
this->button2->Size = System::Drawing::Size(75, 23);
|
197 |
|
|
this->button2->TabIndex = 5;
|
198 |
|
|
this->button2->Text = L"Send";
|
199 |
|
|
this->button2->UseVisualStyleBackColor = true;
|
200 |
|
|
this->button2->Click += gcnew System::EventHandler(this, &frmUart::button2_Click);
|
201 |
|
|
//
|
202 |
|
|
// label3
|
203 |
|
|
//
|
204 |
|
|
this->label3->AutoSize = true;
|
205 |
35 |
robfinch |
this->label3->Location = System::Drawing::Point(471, 112);
|
206 |
32 |
robfinch |
this->label3->Name = L"label3";
|
207 |
|
|
this->label3->Size = System::Drawing::Size(29, 13);
|
208 |
|
|
this->label3->TabIndex = 6;
|
209 |
|
|
this->label3->Text = L"CM0";
|
210 |
|
|
//
|
211 |
|
|
// txtCM0
|
212 |
|
|
//
|
213 |
35 |
robfinch |
this->txtCM0->Location = System::Drawing::Point(506, 109);
|
214 |
32 |
robfinch |
this->txtCM0->Name = L"txtCM0";
|
215 |
|
|
this->txtCM0->ReadOnly = true;
|
216 |
|
|
this->txtCM0->Size = System::Drawing::Size(39, 20);
|
217 |
|
|
this->txtCM0->TabIndex = 7;
|
218 |
|
|
this->txtCM0->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
219 |
|
|
//
|
220 |
|
|
// txtCM1
|
221 |
|
|
//
|
222 |
35 |
robfinch |
this->txtCM1->Location = System::Drawing::Point(506, 135);
|
223 |
32 |
robfinch |
this->txtCM1->Name = L"txtCM1";
|
224 |
|
|
this->txtCM1->ReadOnly = true;
|
225 |
|
|
this->txtCM1->Size = System::Drawing::Size(39, 20);
|
226 |
|
|
this->txtCM1->TabIndex = 9;
|
227 |
|
|
this->txtCM1->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
228 |
|
|
//
|
229 |
|
|
// label4
|
230 |
|
|
//
|
231 |
|
|
this->label4->AutoSize = true;
|
232 |
35 |
robfinch |
this->label4->Location = System::Drawing::Point(471, 138);
|
233 |
32 |
robfinch |
this->label4->Name = L"label4";
|
234 |
|
|
this->label4->Size = System::Drawing::Size(29, 13);
|
235 |
|
|
this->label4->TabIndex = 8;
|
236 |
|
|
this->label4->Text = L"CM1";
|
237 |
|
|
//
|
238 |
|
|
// txtCM2
|
239 |
|
|
//
|
240 |
35 |
robfinch |
this->txtCM2->Location = System::Drawing::Point(506, 161);
|
241 |
32 |
robfinch |
this->txtCM2->Name = L"txtCM2";
|
242 |
|
|
this->txtCM2->ReadOnly = true;
|
243 |
|
|
this->txtCM2->Size = System::Drawing::Size(39, 20);
|
244 |
|
|
this->txtCM2->TabIndex = 11;
|
245 |
|
|
this->txtCM2->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
246 |
|
|
//
|
247 |
|
|
// label5
|
248 |
|
|
//
|
249 |
|
|
this->label5->AutoSize = true;
|
250 |
35 |
robfinch |
this->label5->Location = System::Drawing::Point(471, 164);
|
251 |
32 |
robfinch |
this->label5->Name = L"label5";
|
252 |
|
|
this->label5->Size = System::Drawing::Size(29, 13);
|
253 |
|
|
this->label5->TabIndex = 10;
|
254 |
|
|
this->label5->Text = L"CM2";
|
255 |
|
|
//
|
256 |
|
|
// txtCM3
|
257 |
|
|
//
|
258 |
35 |
robfinch |
this->txtCM3->Location = System::Drawing::Point(506, 187);
|
259 |
32 |
robfinch |
this->txtCM3->Name = L"txtCM3";
|
260 |
|
|
this->txtCM3->ReadOnly = true;
|
261 |
|
|
this->txtCM3->Size = System::Drawing::Size(39, 20);
|
262 |
|
|
this->txtCM3->TabIndex = 13;
|
263 |
|
|
this->txtCM3->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
264 |
|
|
//
|
265 |
|
|
// label6
|
266 |
|
|
//
|
267 |
|
|
this->label6->AutoSize = true;
|
268 |
35 |
robfinch |
this->label6->Location = System::Drawing::Point(471, 190);
|
269 |
32 |
robfinch |
this->label6->Name = L"label6";
|
270 |
|
|
this->label6->Size = System::Drawing::Size(29, 13);
|
271 |
|
|
this->label6->TabIndex = 12;
|
272 |
|
|
this->label6->Text = L"CM3";
|
273 |
|
|
//
|
274 |
|
|
// label7
|
275 |
|
|
//
|
276 |
|
|
this->label7->AutoSize = true;
|
277 |
35 |
robfinch |
this->label7->Location = System::Drawing::Point(374, 112);
|
278 |
32 |
robfinch |
this->label7->Name = L"label7";
|
279 |
|
|
this->label7->Size = System::Drawing::Size(21, 13);
|
280 |
|
|
this->label7->TabIndex = 14;
|
281 |
|
|
this->label7->Text = L"TB";
|
282 |
|
|
//
|
283 |
|
|
// txtTB
|
284 |
|
|
//
|
285 |
35 |
robfinch |
this->txtTB->Location = System::Drawing::Point(409, 109);
|
286 |
32 |
robfinch |
this->txtTB->Name = L"txtTB";
|
287 |
|
|
this->txtTB->ReadOnly = true;
|
288 |
|
|
this->txtTB->Size = System::Drawing::Size(39, 20);
|
289 |
|
|
this->txtTB->TabIndex = 15;
|
290 |
|
|
this->txtTB->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
291 |
|
|
//
|
292 |
|
|
// txtLS
|
293 |
|
|
//
|
294 |
35 |
robfinch |
this->txtLS->Location = System::Drawing::Point(409, 164);
|
295 |
32 |
robfinch |
this->txtLS->Name = L"txtLS";
|
296 |
|
|
this->txtLS->ReadOnly = true;
|
297 |
|
|
this->txtLS->Size = System::Drawing::Size(39, 20);
|
298 |
|
|
this->txtLS->TabIndex = 17;
|
299 |
|
|
this->txtLS->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
300 |
|
|
//
|
301 |
|
|
// label8
|
302 |
|
|
//
|
303 |
|
|
this->label8->AutoSize = true;
|
304 |
35 |
robfinch |
this->label8->Location = System::Drawing::Point(374, 167);
|
305 |
32 |
robfinch |
this->label8->Name = L"label8";
|
306 |
|
|
this->label8->Size = System::Drawing::Size(20, 13);
|
307 |
|
|
this->label8->TabIndex = 16;
|
308 |
|
|
this->label8->Text = L"LS";
|
309 |
|
|
//
|
310 |
|
|
// txtMS
|
311 |
|
|
//
|
312 |
35 |
robfinch |
this->txtMS->Location = System::Drawing::Point(409, 190);
|
313 |
32 |
robfinch |
this->txtMS->Name = L"txtMS";
|
314 |
|
|
this->txtMS->ReadOnly = true;
|
315 |
|
|
this->txtMS->Size = System::Drawing::Size(39, 20);
|
316 |
|
|
this->txtMS->TabIndex = 19;
|
317 |
|
|
this->txtMS->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
318 |
|
|
//
|
319 |
|
|
// label9
|
320 |
|
|
//
|
321 |
|
|
this->label9->AutoSize = true;
|
322 |
35 |
robfinch |
this->label9->Location = System::Drawing::Point(374, 193);
|
323 |
32 |
robfinch |
this->label9->Name = L"label9";
|
324 |
|
|
this->label9->Size = System::Drawing::Size(23, 13);
|
325 |
|
|
this->label9->TabIndex = 18;
|
326 |
|
|
this->label9->Text = L"MS";
|
327 |
|
|
//
|
328 |
|
|
// txtIS
|
329 |
|
|
//
|
330 |
35 |
robfinch |
this->txtIS->Location = System::Drawing::Point(409, 216);
|
331 |
32 |
robfinch |
this->txtIS->Name = L"txtIS";
|
332 |
|
|
this->txtIS->ReadOnly = true;
|
333 |
|
|
this->txtIS->Size = System::Drawing::Size(39, 20);
|
334 |
|
|
this->txtIS->TabIndex = 21;
|
335 |
|
|
this->txtIS->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
336 |
|
|
//
|
337 |
|
|
// label10
|
338 |
|
|
//
|
339 |
|
|
this->label10->AutoSize = true;
|
340 |
35 |
robfinch |
this->label10->Location = System::Drawing::Point(374, 219);
|
341 |
32 |
robfinch |
this->label10->Name = L"label10";
|
342 |
|
|
this->label10->Size = System::Drawing::Size(17, 13);
|
343 |
|
|
this->label10->TabIndex = 20;
|
344 |
|
|
this->label10->Text = L"IS";
|
345 |
|
|
//
|
346 |
|
|
// txtIER
|
347 |
|
|
//
|
348 |
35 |
robfinch |
this->txtIER->Location = System::Drawing::Point(409, 242);
|
349 |
32 |
robfinch |
this->txtIER->Name = L"txtIER";
|
350 |
|
|
this->txtIER->Size = System::Drawing::Size(39, 20);
|
351 |
|
|
this->txtIER->TabIndex = 23;
|
352 |
|
|
this->txtIER->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
353 |
|
|
//
|
354 |
|
|
// label11
|
355 |
|
|
//
|
356 |
|
|
this->label11->AutoSize = true;
|
357 |
35 |
robfinch |
this->label11->Location = System::Drawing::Point(374, 245);
|
358 |
32 |
robfinch |
this->label11->Name = L"label11";
|
359 |
|
|
this->label11->Size = System::Drawing::Size(25, 13);
|
360 |
|
|
this->label11->TabIndex = 22;
|
361 |
|
|
this->label11->Text = L"IER";
|
362 |
|
|
//
|
363 |
|
|
// txtFF
|
364 |
|
|
//
|
365 |
35 |
robfinch |
this->txtFF->Location = System::Drawing::Point(409, 268);
|
366 |
32 |
robfinch |
this->txtFF->Name = L"txtFF";
|
367 |
|
|
this->txtFF->Size = System::Drawing::Size(39, 20);
|
368 |
|
|
this->txtFF->TabIndex = 25;
|
369 |
|
|
this->txtFF->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
370 |
|
|
//
|
371 |
|
|
// label12
|
372 |
|
|
//
|
373 |
|
|
this->label12->AutoSize = true;
|
374 |
35 |
robfinch |
this->label12->Location = System::Drawing::Point(374, 271);
|
375 |
32 |
robfinch |
this->label12->Name = L"label12";
|
376 |
|
|
this->label12->Size = System::Drawing::Size(19, 13);
|
377 |
|
|
this->label12->TabIndex = 24;
|
378 |
|
|
this->label12->Text = L"FF";
|
379 |
|
|
//
|
380 |
|
|
// txtMC
|
381 |
|
|
//
|
382 |
35 |
robfinch |
this->txtMC->Location = System::Drawing::Point(409, 294);
|
383 |
32 |
robfinch |
this->txtMC->Name = L"txtMC";
|
384 |
|
|
this->txtMC->Size = System::Drawing::Size(39, 20);
|
385 |
|
|
this->txtMC->TabIndex = 27;
|
386 |
|
|
this->txtMC->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
387 |
|
|
//
|
388 |
|
|
// label13
|
389 |
|
|
//
|
390 |
|
|
this->label13->AutoSize = true;
|
391 |
35 |
robfinch |
this->label13->Location = System::Drawing::Point(374, 297);
|
392 |
32 |
robfinch |
this->label13->Name = L"label13";
|
393 |
|
|
this->label13->Size = System::Drawing::Size(23, 13);
|
394 |
|
|
this->label13->TabIndex = 26;
|
395 |
|
|
this->label13->Text = L"MC";
|
396 |
|
|
//
|
397 |
|
|
// txtCTRL
|
398 |
|
|
//
|
399 |
35 |
robfinch |
this->txtCTRL->Location = System::Drawing::Point(409, 320);
|
400 |
32 |
robfinch |
this->txtCTRL->Name = L"txtCTRL";
|
401 |
|
|
this->txtCTRL->Size = System::Drawing::Size(39, 20);
|
402 |
|
|
this->txtCTRL->TabIndex = 29;
|
403 |
|
|
this->txtCTRL->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
404 |
|
|
//
|
405 |
|
|
// label14
|
406 |
|
|
//
|
407 |
|
|
this->label14->AutoSize = true;
|
408 |
35 |
robfinch |
this->label14->Location = System::Drawing::Point(374, 323);
|
409 |
32 |
robfinch |
this->label14->Name = L"label14";
|
410 |
|
|
this->label14->Size = System::Drawing::Size(35, 13);
|
411 |
|
|
this->label14->TabIndex = 28;
|
412 |
|
|
this->label14->Text = L"CTRL";
|
413 |
|
|
//
|
414 |
|
|
// txtFC
|
415 |
|
|
//
|
416 |
35 |
robfinch |
this->txtFC->Location = System::Drawing::Point(506, 216);
|
417 |
32 |
robfinch |
this->txtFC->Name = L"txtFC";
|
418 |
|
|
this->txtFC->Size = System::Drawing::Size(39, 20);
|
419 |
|
|
this->txtFC->TabIndex = 31;
|
420 |
|
|
this->txtFC->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
421 |
|
|
//
|
422 |
|
|
// label15
|
423 |
|
|
//
|
424 |
|
|
this->label15->AutoSize = true;
|
425 |
35 |
robfinch |
this->label15->Location = System::Drawing::Point(471, 219);
|
426 |
32 |
robfinch |
this->label15->Name = L"label15";
|
427 |
|
|
this->label15->Size = System::Drawing::Size(20, 13);
|
428 |
|
|
this->label15->TabIndex = 30;
|
429 |
|
|
this->label15->Text = L"FC";
|
430 |
|
|
//
|
431 |
|
|
// timer1
|
432 |
|
|
//
|
433 |
|
|
this->timer1->Enabled = true;
|
434 |
|
|
this->timer1->Tick += gcnew System::EventHandler(this, &frmUart::timer1_Tick);
|
435 |
|
|
//
|
436 |
|
|
// checkBox1
|
437 |
|
|
//
|
438 |
|
|
this->checkBox1->AutoSize = true;
|
439 |
|
|
this->checkBox1->Checked = true;
|
440 |
|
|
this->checkBox1->CheckState = System::Windows::Forms::CheckState::Checked;
|
441 |
35 |
robfinch |
this->checkBox1->Location = System::Drawing::Point(27, 355);
|
442 |
32 |
robfinch |
this->checkBox1->Name = L"checkBox1";
|
443 |
|
|
this->checkBox1->Size = System::Drawing::Size(47, 17);
|
444 |
|
|
this->checkBox1->TabIndex = 32;
|
445 |
|
|
this->checkBox1->Text = L"CTS";
|
446 |
|
|
this->checkBox1->UseVisualStyleBackColor = true;
|
447 |
|
|
//
|
448 |
|
|
// checkBox2
|
449 |
|
|
//
|
450 |
|
|
this->checkBox2->AutoSize = true;
|
451 |
|
|
this->checkBox2->Checked = true;
|
452 |
|
|
this->checkBox2->CheckState = System::Windows::Forms::CheckState::Checked;
|
453 |
35 |
robfinch |
this->checkBox2->Location = System::Drawing::Point(27, 378);
|
454 |
32 |
robfinch |
this->checkBox2->Name = L"checkBox2";
|
455 |
|
|
this->checkBox2->Size = System::Drawing::Size(49, 17);
|
456 |
|
|
this->checkBox2->TabIndex = 33;
|
457 |
|
|
this->checkBox2->Text = L"DSR";
|
458 |
|
|
this->checkBox2->UseVisualStyleBackColor = true;
|
459 |
|
|
//
|
460 |
|
|
// checkBox3
|
461 |
|
|
//
|
462 |
|
|
this->checkBox3->AutoSize = true;
|
463 |
|
|
this->checkBox3->Checked = true;
|
464 |
|
|
this->checkBox3->CheckState = System::Windows::Forms::CheckState::Checked;
|
465 |
35 |
robfinch |
this->checkBox3->Location = System::Drawing::Point(27, 401);
|
466 |
32 |
robfinch |
this->checkBox3->Name = L"checkBox3";
|
467 |
|
|
this->checkBox3->Size = System::Drawing::Size(49, 17);
|
468 |
|
|
this->checkBox3->TabIndex = 34;
|
469 |
|
|
this->checkBox3->Text = L"DCD";
|
470 |
|
|
this->checkBox3->UseVisualStyleBackColor = true;
|
471 |
|
|
//
|
472 |
|
|
// txtRB
|
473 |
|
|
//
|
474 |
35 |
robfinch |
this->txtRB->Location = System::Drawing::Point(409, 135);
|
475 |
32 |
robfinch |
this->txtRB->Name = L"txtRB";
|
476 |
|
|
this->txtRB->ReadOnly = true;
|
477 |
|
|
this->txtRB->Size = System::Drawing::Size(39, 20);
|
478 |
|
|
this->txtRB->TabIndex = 36;
|
479 |
|
|
this->txtRB->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
|
480 |
|
|
//
|
481 |
|
|
// label16
|
482 |
|
|
//
|
483 |
|
|
this->label16->AutoSize = true;
|
484 |
35 |
robfinch |
this->label16->Location = System::Drawing::Point(374, 138);
|
485 |
32 |
robfinch |
this->label16->Name = L"label16";
|
486 |
|
|
this->label16->Size = System::Drawing::Size(22, 13);
|
487 |
|
|
this->label16->TabIndex = 35;
|
488 |
|
|
this->label16->Text = L"RB";
|
489 |
|
|
//
|
490 |
|
|
// frmUart
|
491 |
|
|
//
|
492 |
|
|
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
|
493 |
|
|
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
494 |
35 |
robfinch |
this->ClientSize = System::Drawing::Size(571, 429);
|
495 |
32 |
robfinch |
this->Controls->Add(this->txtRB);
|
496 |
|
|
this->Controls->Add(this->label16);
|
497 |
|
|
this->Controls->Add(this->checkBox3);
|
498 |
|
|
this->Controls->Add(this->checkBox2);
|
499 |
|
|
this->Controls->Add(this->checkBox1);
|
500 |
|
|
this->Controls->Add(this->txtFC);
|
501 |
|
|
this->Controls->Add(this->label15);
|
502 |
|
|
this->Controls->Add(this->txtCTRL);
|
503 |
|
|
this->Controls->Add(this->label14);
|
504 |
|
|
this->Controls->Add(this->txtMC);
|
505 |
|
|
this->Controls->Add(this->label13);
|
506 |
|
|
this->Controls->Add(this->txtFF);
|
507 |
|
|
this->Controls->Add(this->label12);
|
508 |
|
|
this->Controls->Add(this->txtIER);
|
509 |
|
|
this->Controls->Add(this->label11);
|
510 |
|
|
this->Controls->Add(this->txtIS);
|
511 |
|
|
this->Controls->Add(this->label10);
|
512 |
|
|
this->Controls->Add(this->txtMS);
|
513 |
|
|
this->Controls->Add(this->label9);
|
514 |
|
|
this->Controls->Add(this->txtLS);
|
515 |
|
|
this->Controls->Add(this->label8);
|
516 |
|
|
this->Controls->Add(this->txtTB);
|
517 |
|
|
this->Controls->Add(this->label7);
|
518 |
|
|
this->Controls->Add(this->txtCM3);
|
519 |
|
|
this->Controls->Add(this->label6);
|
520 |
|
|
this->Controls->Add(this->txtCM2);
|
521 |
|
|
this->Controls->Add(this->label5);
|
522 |
|
|
this->Controls->Add(this->txtCM1);
|
523 |
|
|
this->Controls->Add(this->label4);
|
524 |
|
|
this->Controls->Add(this->txtCM0);
|
525 |
|
|
this->Controls->Add(this->label3);
|
526 |
|
|
this->Controls->Add(this->button2);
|
527 |
|
|
this->Controls->Add(this->txtFromUart);
|
528 |
|
|
this->Controls->Add(this->label2);
|
529 |
|
|
this->Controls->Add(this->label1);
|
530 |
|
|
this->Controls->Add(this->txtToUart);
|
531 |
|
|
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
|
532 |
|
|
this->Name = L"frmUart";
|
533 |
|
|
this->Text = L"rtfSimpleUart Emulator";
|
534 |
35 |
robfinch |
this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &frmUart::frmUart_FormClosing);
|
535 |
32 |
robfinch |
this->ResumeLayout(false);
|
536 |
|
|
this->PerformLayout();
|
537 |
|
|
|
538 |
|
|
}
|
539 |
|
|
#pragma endregion
|
540 |
|
|
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
|
541 |
|
|
do_send = true;
|
542 |
|
|
}
|
543 |
|
|
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) {
|
544 |
|
|
int dat;
|
545 |
35 |
robfinch |
char buf[20];
|
546 |
|
|
|
547 |
32 |
robfinch |
if (do_send && txtToUart->Text->Length > 0) {
|
548 |
|
|
char* str = (char*)(void*)Marshal::StringToHGlobalAnsi(txtToUart->Text->Substring(0,1));
|
549 |
|
|
txtToUart->Text = txtToUart->Text->Substring(1);
|
550 |
|
|
mut->WaitOne();
|
551 |
|
|
system1.uart1.RxPort(str[0]);
|
552 |
|
|
mut->ReleaseMutex();
|
553 |
|
|
}
|
554 |
|
|
if (txtToUart->Text->Length <= 0)
|
555 |
|
|
do_send = false;
|
556 |
|
|
mut->WaitOne();
|
557 |
|
|
dat = system1.uart1.TxPort() & 0xFF;
|
558 |
|
|
mut->ReleaseMutex();
|
559 |
|
|
buf[0] = dat;
|
560 |
|
|
buf[1] = '\0';
|
561 |
|
|
if (dat != 0xFF)
|
562 |
|
|
txtFromUart->Text = txtFromUart->Text + gcnew String(buf);
|
563 |
35 |
robfinch |
|
564 |
32 |
robfinch |
mut->WaitOne();
|
565 |
|
|
sprintf(buf, "%02X", system1.uart1.cm1);
|
566 |
|
|
txtCM1->Text = gcnew String(buf);
|
567 |
|
|
sprintf(buf, "%02X", system1.uart1.cm2);
|
568 |
|
|
txtCM2->Text = gcnew String(buf);
|
569 |
|
|
sprintf(buf, "%02X", system1.uart1.cm3);
|
570 |
|
|
txtCM3->Text = gcnew String(buf);
|
571 |
|
|
sprintf(buf, "%02X", system1.uart1.ls);
|
572 |
|
|
txtLS->Text = gcnew String(buf);
|
573 |
|
|
sprintf(buf, "%02X", system1.uart1.rb);
|
574 |
|
|
txtRB->Text = gcnew String(buf);
|
575 |
|
|
sprintf(buf, "%02X", system1.uart1.tb);
|
576 |
|
|
txtTB->Text = gcnew String(buf);
|
577 |
|
|
sprintf(buf, "%02X", system1.uart1.ier);
|
578 |
|
|
txtIER->Text = gcnew String(buf);
|
579 |
|
|
sprintf(buf, "%02X", system1.uart1.is);
|
580 |
|
|
mut->ReleaseMutex();
|
581 |
|
|
txtIS->Text = gcnew String(buf);
|
582 |
|
|
}
|
583 |
35 |
robfinch |
private: System::Void frmUart_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {
|
584 |
|
|
if (e->CloseReason==CloseReason::UserClosing)
|
585 |
|
|
e->Cancel = true;
|
586 |
|
|
}
|
587 |
32 |
robfinch |
};
|
588 |
|
|
}
|