Explorar o código

C# 드래그 시 Form 이동

YJ %!s(int64=5) %!d(string=hai) anos
pai
achega
dec009d1b0

+ 1 - 0
Basic_Terminal/Basic_Terminal.csproj

@@ -51,6 +51,7 @@
51 51
     <Reference Include="PresentationFramework.Aero2" />
52 52
     <Reference Include="System" />
53 53
     <Reference Include="System.Core" />
54
+    <Reference Include="System.Management" />
54 55
     <Reference Include="System.Xaml" />
55 56
     <Reference Include="System.Xml.Linq" />
56 57
     <Reference Include="System.Data.DataSetExtensions" />

+ 97 - 124
Basic_Terminal/Wnd/Menu.Designer.cs

@@ -32,15 +32,16 @@
32 32
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Menu));
33 33
             this.panel_bar = new System.Windows.Forms.Panel();
34 34
             this.metroPanel_Content = new MetroFramework.Controls.MetroPanel();
35
+            this.metroPanel_Terminal = new MetroFramework.Controls.MetroPanel();
36
+            this.richTextBox1 = new System.Windows.Forms.RichTextBox();
37
+            this.metroPanel_about = new MetroFramework.Controls.MetroPanel();
38
+            this.pictureBox2 = new System.Windows.Forms.PictureBox();
35 39
             this.metroPanel_update = new MetroFramework.Controls.MetroPanel();
36 40
             this.label3 = new System.Windows.Forms.Label();
37 41
             this.Update_label = new System.Windows.Forms.Label();
38 42
             this.metroProgressBar1 = new MetroFramework.Controls.MetroProgressBar();
39
-            this.metroPanel_Terminal = new MetroFramework.Controls.MetroPanel();
40
-            this.richTextBox1 = new System.Windows.Forms.RichTextBox();
41 43
             this.metroPanel_config = new MetroFramework.Controls.MetroPanel();
42 44
             this.label7 = new System.Windows.Forms.Label();
43
-            this.metroPanel_about = new MetroFramework.Controls.MetroPanel();
44 45
             this.metroPanel_Operate = new MetroFramework.Controls.MetroPanel();
45 46
             this.label4 = new System.Windows.Forms.Label();
46 47
             this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
@@ -49,9 +50,8 @@
49 50
             this.pictureBox_min = new System.Windows.Forms.PictureBox();
50 51
             this.groupBox9 = new System.Windows.Forms.GroupBox();
51 52
             this.metroTile_portopen = new MetroFramework.Controls.MetroTile();
52
-            this.label1 = new System.Windows.Forms.Label();
53
-            this.metroComboBox2 = new MetroFramework.Controls.MetroComboBox();
54
-            this.metroComboBox1 = new MetroFramework.Controls.MetroComboBox();
53
+            this.metroComboBox_port = new MetroFramework.Controls.MetroComboBox();
54
+            this.metroComboBox_baudrate = new MetroFramework.Controls.MetroComboBox();
55 55
             this.cmCom_Port = new System.Windows.Forms.Label();
56 56
             this.cmBaudRate = new System.Windows.Forms.Label();
57 57
             this.metroTile_portclose = new MetroFramework.Controls.MetroTile();
@@ -67,36 +67,32 @@
67 67
             this.pictureBox6 = new System.Windows.Forms.PictureBox();
68 68
             this.metroTile_about = new MetroFramework.Controls.MetroTile();
69 69
             this.metroTile_terminal = new MetroFramework.Controls.MetroTile();
70
-            this.label_Terminal = new System.Windows.Forms.Label();
71 70
             this.metroTile_operate = new MetroFramework.Controls.MetroTile();
72 71
             this.panel_BluecellLogo = new System.Windows.Forms.Panel();
73 72
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
74 73
             this.timer1 = new System.Windows.Forms.Timer(this.components);
75 74
             this.metroStyleManager1 = new MetroFramework.Components.MetroStyleManager(this.components);
76
-            this.pictureBox2 = new System.Windows.Forms.PictureBox();
77 75
             this.panel_bar.SuspendLayout();
78 76
             this.metroPanel_Content.SuspendLayout();
79
-            this.metroPanel_update.SuspendLayout();
80 77
             this.metroPanel_Terminal.SuspendLayout();
81
-            this.metroPanel_config.SuspendLayout();
82 78
             this.metroPanel_about.SuspendLayout();
79
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
80
+            this.metroPanel_update.SuspendLayout();
81
+            this.metroPanel_config.SuspendLayout();
83 82
             this.metroPanel_Operate.SuspendLayout();
84 83
             this.panel_content.SuspendLayout();
85 84
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox_min_red)).BeginInit();
86 85
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox_min)).BeginInit();
87 86
             this.groupBox9.SuspendLayout();
88
-            this.metroTile_portopen.SuspendLayout();
89 87
             this.metroTile_portclose.SuspendLayout();
90 88
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox_X_RED)).BeginInit();
91 89
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox_X)).BeginInit();
92 90
             this.panel_Menu.SuspendLayout();
93 91
             this.panel_SelectMenu.SuspendLayout();
94 92
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
95
-            this.metroTile_terminal.SuspendLayout();
96 93
             this.panel_BluecellLogo.SuspendLayout();
97 94
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
98 95
             ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).BeginInit();
99
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
100 96
             this.SuspendLayout();
101 97
             // 
102 98
             // panel_bar
@@ -112,9 +108,9 @@
112 108
             // 
113 109
             // metroPanel_Content
114 110
             // 
111
+            this.metroPanel_Content.Controls.Add(this.metroPanel_Terminal);
115 112
             this.metroPanel_Content.Controls.Add(this.metroPanel_about);
116 113
             this.metroPanel_Content.Controls.Add(this.metroPanel_update);
117
-            this.metroPanel_Content.Controls.Add(this.metroPanel_Terminal);
118 114
             this.metroPanel_Content.Controls.Add(this.metroPanel_config);
119 115
             this.metroPanel_Content.Controls.Add(this.metroPanel_Operate);
120 116
             this.metroPanel_Content.HorizontalScrollbarBarColor = true;
@@ -128,6 +124,55 @@
128 124
             this.metroPanel_Content.VerticalScrollbarHighlightOnWheel = false;
129 125
             this.metroPanel_Content.VerticalScrollbarSize = 10;
130 126
             // 
127
+            // metroPanel_Terminal
128
+            // 
129
+            this.metroPanel_Terminal.Controls.Add(this.richTextBox1);
130
+            this.metroPanel_Terminal.HorizontalScrollbarBarColor = true;
131
+            this.metroPanel_Terminal.HorizontalScrollbarHighlightOnWheel = false;
132
+            this.metroPanel_Terminal.HorizontalScrollbarSize = 10;
133
+            this.metroPanel_Terminal.Location = new System.Drawing.Point(0, 0);
134
+            this.metroPanel_Terminal.Name = "metroPanel_Terminal";
135
+            this.metroPanel_Terminal.Size = new System.Drawing.Size(800, 480);
136
+            this.metroPanel_Terminal.TabIndex = 138;
137
+            this.metroPanel_Terminal.VerticalScrollbarBarColor = true;
138
+            this.metroPanel_Terminal.VerticalScrollbarHighlightOnWheel = false;
139
+            this.metroPanel_Terminal.VerticalScrollbarSize = 10;
140
+            // 
141
+            // richTextBox1
142
+            // 
143
+            this.richTextBox1.BackColor = System.Drawing.SystemColors.MenuText;
144
+            this.richTextBox1.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
145
+            this.richTextBox1.ForeColor = System.Drawing.SystemColors.Window;
146
+            this.richTextBox1.Location = new System.Drawing.Point(3, 0);
147
+            this.richTextBox1.Name = "richTextBox1";
148
+            this.richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical;
149
+            this.richTextBox1.Size = new System.Drawing.Size(800, 480);
150
+            this.richTextBox1.TabIndex = 2;
151
+            this.richTextBox1.Text = "Text Font 테스트 폰트 ";
152
+            // 
153
+            // metroPanel_about
154
+            // 
155
+            this.metroPanel_about.Controls.Add(this.pictureBox2);
156
+            this.metroPanel_about.HorizontalScrollbarBarColor = true;
157
+            this.metroPanel_about.HorizontalScrollbarHighlightOnWheel = false;
158
+            this.metroPanel_about.HorizontalScrollbarSize = 10;
159
+            this.metroPanel_about.Location = new System.Drawing.Point(0, 0);
160
+            this.metroPanel_about.Name = "metroPanel_about";
161
+            this.metroPanel_about.Size = new System.Drawing.Size(800, 480);
162
+            this.metroPanel_about.TabIndex = 140;
163
+            this.metroPanel_about.VerticalScrollbarBarColor = true;
164
+            this.metroPanel_about.VerticalScrollbarHighlightOnWheel = false;
165
+            this.metroPanel_about.VerticalScrollbarSize = 10;
166
+            // 
167
+            // pictureBox2
168
+            // 
169
+            this.pictureBox2.Image = global::Basic_Terminal.Properties.Resources.bluecell_logo;
170
+            this.pictureBox2.Location = new System.Drawing.Point(307, 179);
171
+            this.pictureBox2.Name = "pictureBox2";
172
+            this.pictureBox2.Size = new System.Drawing.Size(163, 50);
173
+            this.pictureBox2.TabIndex = 2;
174
+            this.pictureBox2.TabStop = false;
175
+            // 
131 176
             // metroPanel_update
132 177
             // 
133 178
             this.metroPanel_update.Controls.Add(this.label3);
@@ -151,13 +196,13 @@
151 196
             | System.Windows.Forms.AnchorStyles.Right)));
152 197
             this.label3.AutoSize = true;
153 198
             this.label3.BackColor = System.Drawing.Color.Transparent;
154
-            this.label3.Font = new System.Drawing.Font("굴림", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
199
+            this.label3.Font = new System.Drawing.Font("굴림", 23F, System.Drawing.FontStyle.Bold);
155 200
             this.label3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
156
-            this.label3.Location = new System.Drawing.Point(106, 21);
201
+            this.label3.Location = new System.Drawing.Point(21, 21);
157 202
             this.label3.Name = "label3";
158
-            this.label3.Size = new System.Drawing.Size(416, 48);
203
+            this.label3.Size = new System.Drawing.Size(198, 31);
159 204
             this.label3.TabIndex = 136;
160
-            this.label3.Text = "Firmware Update";
205
+            this.label3.Text = "Firm update";
161 206
             // 
162 207
             // Update_label
163 208
             // 
@@ -181,31 +226,6 @@
181 226
             this.metroProgressBar1.Size = new System.Drawing.Size(416, 52);
182 227
             this.metroProgressBar1.TabIndex = 2;
183 228
             // 
184
-            // metroPanel_Terminal
185
-            // 
186
-            this.metroPanel_Terminal.Controls.Add(this.richTextBox1);
187
-            this.metroPanel_Terminal.HorizontalScrollbarBarColor = true;
188
-            this.metroPanel_Terminal.HorizontalScrollbarHighlightOnWheel = false;
189
-            this.metroPanel_Terminal.HorizontalScrollbarSize = 10;
190
-            this.metroPanel_Terminal.Location = new System.Drawing.Point(0, 0);
191
-            this.metroPanel_Terminal.Name = "metroPanel_Terminal";
192
-            this.metroPanel_Terminal.Size = new System.Drawing.Size(800, 480);
193
-            this.metroPanel_Terminal.TabIndex = 138;
194
-            this.metroPanel_Terminal.VerticalScrollbarBarColor = true;
195
-            this.metroPanel_Terminal.VerticalScrollbarHighlightOnWheel = false;
196
-            this.metroPanel_Terminal.VerticalScrollbarSize = 10;
197
-            // 
198
-            // richTextBox1
199
-            // 
200
-            this.richTextBox1.BackColor = System.Drawing.SystemColors.MenuText;
201
-            this.richTextBox1.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
202
-            this.richTextBox1.ForeColor = System.Drawing.SystemColors.Window;
203
-            this.richTextBox1.Location = new System.Drawing.Point(3, 0);
204
-            this.richTextBox1.Name = "richTextBox1";
205
-            this.richTextBox1.Size = new System.Drawing.Size(800, 480);
206
-            this.richTextBox1.TabIndex = 2;
207
-            this.richTextBox1.Text = "Test Font 테스트폰트";
208
-            // 
209 229
             // metroPanel_config
210 230
             // 
211 231
             this.metroPanel_config.Controls.Add(this.label7);
@@ -227,27 +247,13 @@
227 247
             | System.Windows.Forms.AnchorStyles.Right)));
228 248
             this.label7.AutoSize = true;
229 249
             this.label7.BackColor = System.Drawing.Color.Transparent;
230
-            this.label7.Font = new System.Drawing.Font("굴림", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
250
+            this.label7.Font = new System.Drawing.Font("굴림", 22F, System.Drawing.FontStyle.Bold);
231 251
             this.label7.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
232 252
             this.label7.Location = new System.Drawing.Point(3, 20);
233 253
             this.label7.Name = "label7";
234
-            this.label7.Size = new System.Drawing.Size(174, 48);
254
+            this.label7.Size = new System.Drawing.Size(122, 30);
235 255
             this.label7.TabIndex = 136;
236
-            this.label7.Text = "Config";
237
-            // 
238
-            // metroPanel_about
239
-            // 
240
-            this.metroPanel_about.Controls.Add(this.pictureBox2);
241
-            this.metroPanel_about.HorizontalScrollbarBarColor = true;
242
-            this.metroPanel_about.HorizontalScrollbarHighlightOnWheel = false;
243
-            this.metroPanel_about.HorizontalScrollbarSize = 10;
244
-            this.metroPanel_about.Location = new System.Drawing.Point(0, 0);
245
-            this.metroPanel_about.Name = "metroPanel_about";
246
-            this.metroPanel_about.Size = new System.Drawing.Size(800, 480);
247
-            this.metroPanel_about.TabIndex = 140;
248
-            this.metroPanel_about.VerticalScrollbarBarColor = true;
249
-            this.metroPanel_about.VerticalScrollbarHighlightOnWheel = false;
250
-            this.metroPanel_about.VerticalScrollbarSize = 10;
256
+            this.label7.Text = "Config ";
251 257
             // 
252 258
             // metroPanel_Operate
253 259
             // 
@@ -270,11 +276,11 @@
270 276
             | System.Windows.Forms.AnchorStyles.Right)));
271 277
             this.label4.AutoSize = true;
272 278
             this.label4.BackColor = System.Drawing.Color.Transparent;
273
-            this.label4.Font = new System.Drawing.Font("굴림", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
279
+            this.label4.Font = new System.Drawing.Font("굴림", 22F, System.Drawing.FontStyle.Bold);
274 280
             this.label4.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
275 281
             this.label4.Location = new System.Drawing.Point(7, 20);
276 282
             this.label4.Name = "label4";
277
-            this.label4.Size = new System.Drawing.Size(205, 48);
283
+            this.label4.Size = new System.Drawing.Size(131, 30);
278 284
             this.label4.TabIndex = 136;
279 285
             this.label4.Text = "Operate";
280 286
             // 
@@ -324,8 +330,8 @@
324 330
             // groupBox9
325 331
             // 
326 332
             this.groupBox9.Controls.Add(this.metroTile_portopen);
327
-            this.groupBox9.Controls.Add(this.metroComboBox2);
328
-            this.groupBox9.Controls.Add(this.metroComboBox1);
333
+            this.groupBox9.Controls.Add(this.metroComboBox_port);
334
+            this.groupBox9.Controls.Add(this.metroComboBox_baudrate);
329 335
             this.groupBox9.Controls.Add(this.cmCom_Port);
330 336
             this.groupBox9.Controls.Add(this.cmBaudRate);
331 337
             this.groupBox9.Controls.Add(this.metroTile_portclose);
@@ -339,7 +345,6 @@
339 345
             // metroTile_portopen
340 346
             // 
341 347
             this.metroTile_portopen.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(159)))), ((int)(((byte)(230)))));
342
-            this.metroTile_portopen.Controls.Add(this.label1);
343 348
             this.metroTile_portopen.CustomBackground = true;
344 349
             this.metroTile_portopen.ForeColor = System.Drawing.Color.Coral;
345 350
             this.metroTile_portopen.Location = new System.Drawing.Point(497, 14);
@@ -358,32 +363,21 @@
358 363
             this.metroTile_portopen.MouseLeave += new System.EventHandler(this.metroTile_MouseLeave);
359 364
             this.metroTile_portopen.MouseMove += new System.Windows.Forms.MouseEventHandler(this.metroTile_MouseMove);
360 365
             // 
361
-            // label1
362
-            // 
363
-            this.label1.AutoSize = true;
364
-            this.label1.BackColor = System.Drawing.Color.Transparent;
365
-            this.label1.Font = new System.Drawing.Font("맑은 고딕", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
366
-            this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(242)))), ((int)(((byte)(247)))));
367
-            this.label1.Location = new System.Drawing.Point(40, 17);
368
-            this.label1.Name = "label1";
369
-            this.label1.Size = new System.Drawing.Size(0, 20);
370
-            this.label1.TabIndex = 0;
366
+            // metroComboBox_port
371 367
             // 
372
-            // metroComboBox2
368
+            this.metroComboBox_port.FormattingEnabled = true;
369
+            this.metroComboBox_port.ItemHeight = 23;
370
+            this.metroComboBox_port.Location = new System.Drawing.Point(101, 20);
371
+            this.metroComboBox_port.Name = "metroComboBox_port";
372
+            this.metroComboBox_port.Size = new System.Drawing.Size(133, 29);
373
+            this.metroComboBox_port.Sorted = true;
374
+            this.metroComboBox_port.TabIndex = 93;
373 375
             // 
374
-            this.metroComboBox2.FormattingEnabled = true;
375
-            this.metroComboBox2.ItemHeight = 23;
376
-            this.metroComboBox2.Location = new System.Drawing.Point(101, 20);
377
-            this.metroComboBox2.Name = "metroComboBox2";
378
-            this.metroComboBox2.Size = new System.Drawing.Size(133, 29);
379
-            this.metroComboBox2.Sorted = true;
380
-            this.metroComboBox2.TabIndex = 93;
376
+            // metroComboBox_baudrate
381 377
             // 
382
-            // metroComboBox1
383
-            // 
384
-            this.metroComboBox1.FormattingEnabled = true;
385
-            this.metroComboBox1.ItemHeight = 23;
386
-            this.metroComboBox1.Items.AddRange(new object[] {
378
+            this.metroComboBox_baudrate.FormattingEnabled = true;
379
+            this.metroComboBox_baudrate.ItemHeight = 23;
380
+            this.metroComboBox_baudrate.Items.AddRange(new object[] {
387 381
             "110",
388 382
             "300",
389 383
             "600",
@@ -399,10 +393,10 @@
399 393
             "230400",
400 394
             "460800",
401 395
             "921600"});
402
-            this.metroComboBox1.Location = new System.Drawing.Point(345, 20);
403
-            this.metroComboBox1.Name = "metroComboBox1";
404
-            this.metroComboBox1.Size = new System.Drawing.Size(133, 29);
405
-            this.metroComboBox1.TabIndex = 93;
396
+            this.metroComboBox_baudrate.Location = new System.Drawing.Point(345, 20);
397
+            this.metroComboBox_baudrate.Name = "metroComboBox_baudrate";
398
+            this.metroComboBox_baudrate.Size = new System.Drawing.Size(133, 29);
399
+            this.metroComboBox_baudrate.TabIndex = 93;
406 400
             // 
407 401
             // cmCom_Port
408 402
             // 
@@ -620,7 +614,6 @@
620 614
             // metroTile_terminal
621 615
             // 
622 616
             this.metroTile_terminal.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(159)))), ((int)(((byte)(200)))));
623
-            this.metroTile_terminal.Controls.Add(this.label_Terminal);
624 617
             this.metroTile_terminal.CustomBackground = true;
625 618
             this.metroTile_terminal.ForeColor = System.Drawing.Color.Coral;
626 619
             this.metroTile_terminal.Location = new System.Drawing.Point(0, 66);
@@ -639,17 +632,6 @@
639 632
             this.metroTile_terminal.MouseLeave += new System.EventHandler(this.metroTile_MouseLeave);
640 633
             this.metroTile_terminal.MouseMove += new System.Windows.Forms.MouseEventHandler(this.metroTile_MouseMove);
641 634
             // 
642
-            // label_Terminal
643
-            // 
644
-            this.label_Terminal.AutoSize = true;
645
-            this.label_Terminal.BackColor = System.Drawing.Color.Transparent;
646
-            this.label_Terminal.Font = new System.Drawing.Font("맑은 고딕", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
647
-            this.label_Terminal.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(242)))), ((int)(((byte)(247)))));
648
-            this.label_Terminal.Location = new System.Drawing.Point(40, 17);
649
-            this.label_Terminal.Name = "label_Terminal";
650
-            this.label_Terminal.Size = new System.Drawing.Size(0, 20);
651
-            this.label_Terminal.TabIndex = 0;
652
-            // 
653 635
             // metroTile_operate
654 636
             // 
655 637
             this.metroTile_operate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(159)))), ((int)(((byte)(200)))));
@@ -679,6 +661,9 @@
679 661
             this.panel_BluecellLogo.Name = "panel_BluecellLogo";
680 662
             this.panel_BluecellLogo.Size = new System.Drawing.Size(200, 70);
681 663
             this.panel_BluecellLogo.TabIndex = 20;
664
+            this.panel_BluecellLogo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Panel_BluecellLogo_MouseDown);
665
+            this.panel_BluecellLogo.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Panel_BluecellLogo_MouseMove);
666
+            this.panel_BluecellLogo.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Panel_BluecellLogo_MouseUp);
682 667
             // 
683 668
             // pictureBox1
684 669
             // 
@@ -688,6 +673,9 @@
688 673
             this.pictureBox1.Size = new System.Drawing.Size(150, 42);
689 674
             this.pictureBox1.TabIndex = 0;
690 675
             this.pictureBox1.TabStop = false;
676
+            this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Panel_BluecellLogo_MouseDown);
677
+            this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Panel_BluecellLogo_MouseMove);
678
+            this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Panel_BluecellLogo_MouseUp);
691 679
             // 
692 680
             // timer1
693 681
             // 
@@ -699,15 +687,6 @@
699 687
             this.metroStyleManager1.Owner = null;
700 688
             this.metroStyleManager1.Style = MetroFramework.MetroColorStyle.Blue;
701 689
             // 
702
-            // pictureBox2
703
-            // 
704
-            this.pictureBox2.Image = global::Basic_Terminal.Properties.Resources.bluecell_logo;
705
-            this.pictureBox2.Location = new System.Drawing.Point(307, 179);
706
-            this.pictureBox2.Name = "pictureBox2";
707
-            this.pictureBox2.Size = new System.Drawing.Size(163, 50);
708
-            this.pictureBox2.TabIndex = 2;
709
-            this.pictureBox2.TabStop = false;
710
-            // 
711 690
             // Menu
712 691
             // 
713 692
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -729,12 +708,13 @@
729 708
             this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Menu_MouseUp);
730 709
             this.panel_bar.ResumeLayout(false);
731 710
             this.metroPanel_Content.ResumeLayout(false);
711
+            this.metroPanel_Terminal.ResumeLayout(false);
712
+            this.metroPanel_about.ResumeLayout(false);
713
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
732 714
             this.metroPanel_update.ResumeLayout(false);
733 715
             this.metroPanel_update.PerformLayout();
734
-            this.metroPanel_Terminal.ResumeLayout(false);
735 716
             this.metroPanel_config.ResumeLayout(false);
736 717
             this.metroPanel_config.PerformLayout();
737
-            this.metroPanel_about.ResumeLayout(false);
738 718
             this.metroPanel_Operate.ResumeLayout(false);
739 719
             this.metroPanel_Operate.PerformLayout();
740 720
             this.panel_content.ResumeLayout(false);
@@ -742,8 +722,6 @@
742 722
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox_min)).EndInit();
743 723
             this.groupBox9.ResumeLayout(false);
744 724
             this.groupBox9.PerformLayout();
745
-            this.metroTile_portopen.ResumeLayout(false);
746
-            this.metroTile_portopen.PerformLayout();
747 725
             this.metroTile_portclose.ResumeLayout(false);
748 726
             this.metroTile_portclose.PerformLayout();
749 727
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox_X_RED)).EndInit();
@@ -752,12 +730,9 @@
752 730
             this.panel_SelectMenu.ResumeLayout(false);
753 731
             this.panel_SelectMenu.PerformLayout();
754 732
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit();
755
-            this.metroTile_terminal.ResumeLayout(false);
756
-            this.metroTile_terminal.PerformLayout();
757 733
             this.panel_BluecellLogo.ResumeLayout(false);
758 734
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
759 735
             ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).EndInit();
760
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
761 736
             this.ResumeLayout(false);
762 737
 
763 738
         }
@@ -775,7 +750,6 @@
775 750
         private System.Windows.Forms.PictureBox pictureBox6;
776 751
         private MetroFramework.Controls.MetroTile metroTile_about;
777 752
         private MetroFramework.Controls.MetroTile metroTile_terminal;
778
-        private System.Windows.Forms.Label label_Terminal;
779 753
         private MetroFramework.Controls.MetroTile metroTile_operate;
780 754
         private System.Windows.Forms.Panel panel_BluecellLogo;
781 755
         private System.Windows.Forms.PictureBox pictureBox1;
@@ -788,12 +762,11 @@
788 762
         private System.Windows.Forms.PictureBox pictureBox_min;
789 763
         private MetroFramework.Controls.MetroPanel metroPanel_Content;
790 764
         private System.Windows.Forms.GroupBox groupBox9;
791
-        private MetroFramework.Controls.MetroComboBox metroComboBox2;
765
+        private MetroFramework.Controls.MetroComboBox metroComboBox_port;
792 766
         private System.Windows.Forms.Label cmCom_Port;
793 767
         private System.Windows.Forms.Label cmBaudRate;
794
-        private MetroFramework.Controls.MetroComboBox metroComboBox1;
768
+        private MetroFramework.Controls.MetroComboBox metroComboBox_baudrate;
795 769
         private MetroFramework.Controls.MetroTile metroTile_portopen;
796
-        private System.Windows.Forms.Label label1;
797 770
         private MetroFramework.Controls.MetroTile metroTile_portclose;
798 771
         private System.Windows.Forms.Label label2;
799 772
         private MetroFramework.Controls.MetroPanel metroPanel_config;

+ 108 - 17
Basic_Terminal/Wnd/Menu.cs

@@ -9,6 +9,14 @@ using System.Text;
9 9
 using System.Threading.Tasks;
10 10
 using System.Windows.Forms;
11 11
 using MetroFramework.Forms;
12
+using System.Management;
13
+
14
+//Add code
15
+using System.Windows.Forms;
16
+using System.IO;
17
+using System.IO.Ports;
18
+using System.Data;
19
+
12 20
 namespace Basic_Terminal
13 21
 {
14 22
     public enum BluecellLayer_t
@@ -26,9 +34,14 @@ namespace Basic_Terminal
26 34
         private int Curr_Layer;
27 35
         private int Pre_Layer;
28 36
 
37
+        Serial serial = new Serial(); // Uart Open
38
+        private System.IO.Ports.SerialPort serialPort;
39
+        Bluecell_BootProtocol bluecell_BootProtocol = new Bluecell_BootProtocol();
40
+        Update_Serial file = new Update_Serial();
29 41
         int[] panelWidth = new int[(int)BluecellLayer_t.bluecell_lastlayer];
30 42
         bool[] Hidden = new bool[(int)BluecellLayer_t.bluecell_lastlayer];
31 43
         int [] temp_panelWidth = new int[(int)BluecellLayer_t.bluecell_lastlayer];
44
+        public string Serial_Name { get => serialPort.PortName; set => serialPort.PortName = value; }
32 45
         MetroFramework.Controls.MetroPanel main_panel;// = new MetroFramework.Controls.MetroPanel[(int)BluecellLayer_t.bluecell_lastlayer];
33 46
         private void bool_init(ref bool[] data,int size,bool set)
34 47
         {
@@ -61,6 +74,7 @@ namespace Basic_Terminal
61 74
             metroPanel_update.Visible = false;
62 75
             metroPanel_Terminal.Visible = false;
63 76
             metroPanel_config.Visible = false;
77
+            this.Serial_Initialize(ref metroComboBox_port);
64 78
             /*    Metro_FontSize_Control(metroTile_terminal, MetroFramework.MetroTileTextSize.Tall);
65 79
                 Metro_FontSize_Control(metroTile_operate, MetroFramework.MetroTileTextSize.Tall);
66 80
                 Metro_FontSize_Control(metroTile_update, MetroFramework.MetroTileTextSize.Tall);
@@ -72,6 +86,33 @@ namespace Basic_Terminal
72 86
                 Metro_FontSize_Weight(metroTile_about, MetroFramework.MetroTileTextWeight.Regular);
73 87
                 Metro_FontSize_Weight(metroTile_quit, MetroFramework.MetroTileTextWeight.Regular);*/
74 88
 
89
+        }
90
+        public void Serial_Initialize(ref MetroFramework.Controls.MetroComboBox cb_port)
91
+        {
92
+
93
+
94
+            this.serialPort = new System.IO.Ports.SerialPort();
95
+            this.serialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.Serial_DataRecvFunction);
96
+
97
+            cb_port.BeginUpdate();
98
+            foreach (string comport in SerialPort.GetPortNames())//foreach (string comport in SerialPort_TestProgram.GetPortNames())
99
+            {
100
+                cb_port.Items.Add(comport);
101
+            }
102
+            cb_port.EndUpdate();
103
+            //SerialPort 초기 설정.
104
+            //  serialPort.Encoding = Encoding.GetEncoding("Windows-1252");
105
+            cb_port.DataSource = SerialPort.GetPortNames();
106
+            try
107
+            {
108
+                serialPort.PortName = Serial_Name = cb_port.SelectedItem.ToString();
109
+                serialPort.BaudRate = (int)115200;
110
+                serialPort.DataBits = (int)8;
111
+                serialPort.Parity = System.IO.Ports.Parity.None;
112
+                serialPort.StopBits = StopBits.One;
113
+            }
114
+            catch { }
115
+
75 116
         }
76 117
         private void Metro_FontSize_Control(object target, MetroFramework.MetroTileTextSize size)
77 118
         {
@@ -299,29 +340,79 @@ namespace Basic_Terminal
299 340
             metroTile_portclose.Visible = true;
300 341
             metroTile_portopen.Visible = false;
301 342
         }
343
+        public void Serial_DataRecvFunction(object sender, SerialDataReceivedEventArgs e)
344
+        {
345
+           
346
+            /****
347
+             *메모리 누수 방지용 코드
348
+             */
349
+            System.GC.Collect(0, GCCollectionMode.Forced);
350
+            System.GC.WaitForFullGCComplete();
351
+        }
352
+        public struct POINT { public int X, Y; }
353
+        [DllImport("user32.dll")] // 현재 마우스 위치를 얻기위한 API함수.
354
+        public extern static void GetCursorPos(out POINT point);
355
+
356
+        Point FormLocation; // 현재 폼 위치
357
+        POINT LastLocation = new POINT(); // 방금 전의 마우스 위치
358
+        POINT CurrentLocation = new POINT(); // 현재 마우스 위치
359
+                                             // 폼이 움직일 양 = CurrentLocation - LastLocation.
360
+        bool IsMouseMoveStart = false; // 현재 마우스 움직이기 기능이 켜져있는가.
361
+                                       // 만약 이게 없으면 그냥 폼위에서
362
+
363
+
364
+        private void Panel_BluecellLogo_MouseDown(object sender, MouseEventArgs e)
365
+        {
366
+
367
+            GetCursorPos(out CurrentLocation);
368
+            FormLocation = this.Location;
369
+            IsMouseMoveStart = true;
370
+        }
371
+
372
+    private void Panel_BluecellLogo_MouseMove(object sender, MouseEventArgs e)
373
+        {
374
+            // 마우스의 움직임에 맞춰서 폼을 움직인다.
375
+
376
+            // 마우스의 움직임에 맞춰서 폼을 움직인다.
377
+
378
+            if (!IsMouseMoveStart) return;
379
+
380
+            GetCursorPos(out LastLocation);
381
+            FormLocation.X -= (CurrentLocation.X - LastLocation.X);
382
+            FormLocation.Y -= (CurrentLocation.Y - LastLocation.Y);
383
+            this.Location = FormLocation;
384
+            CurrentLocation = LastLocation;
385
+  
386
+
387
+        }
388
+
389
+        private void Panel_BluecellLogo_MouseUp(object sender, MouseEventArgs e)
390
+        {
391
+            IsMouseMoveStart = false;
392
+        }
302 393
 
303 394
 
304 395
         /*
305
-private void label_WndMin_MouseHover(object sender, EventArgs e)
306
-{
307
-label_WndMin.ForeColor = Color.FromArgb(255, 255, 0);
308
-}
396
+    private void label_WndMin_MouseHover(object sender, EventArgs e)
397
+    {
398
+    label_WndMin.ForeColor = Color.FromArgb(255, 255, 0);
399
+    }
309 400
 
310
-private void label_WndClose_MouseHover(object sender, EventArgs e)
311
-{
312
-label_WndClose.ForeColor = Color.FromArgb(255, 255, 0);
313
-}
401
+    private void label_WndClose_MouseHover(object sender, EventArgs e)
402
+    {
403
+    label_WndClose.ForeColor = Color.FromArgb(255, 255, 0);
404
+    }
314 405
 
315
-private void label_WndClose_MouseLeave(object sender, EventArgs e)
316
-{
317
-label_WndMin.ForeColor = Color.FromArgb(255, 255, 255);
318
-}
406
+    private void label_WndClose_MouseLeave(object sender, EventArgs e)
407
+    {
408
+    label_WndMin.ForeColor = Color.FromArgb(255, 255, 255);
409
+    }
319 410
 
320
-private void label_WndMin_MouseLeave(object sender, EventArgs e)
321
-{
322
-label_WndMin.ForeColor = Color.FromArgb(255, 255, 255);
323
-}
324
-*/
411
+    private void label_WndMin_MouseLeave(object sender, EventArgs e)
412
+    {
413
+    label_WndMin.ForeColor = Color.FromArgb(255, 255, 255);
414
+    }
415
+    */
325 416
     }
326 417
     public static class Util
327 418
     {

+ 1 - 1
Basic_Terminal/Wnd/Menu.resx

@@ -118,7 +118,7 @@
118 118
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 119
   </resheader>
120 120
   <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
-    <value>487, 17</value>
121
+    <value>182, 12</value>
122 122
   </metadata>
123 123
   <metadata name="metroStyleManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124 124
     <value>9, 6</value>