Browse Source

git first

PYJ 5 years ago
parent
commit
fcde2d5a20
41 changed files with 3927 additions and 49 deletions
  1. 125 3
      DataRequest/DataRequest.csproj
  2. 126 0
      DataRequest/Debug.Designer.cs
  3. 36 0
      DataRequest/Debug.cs
  4. 123 0
      DataRequest/Debug.resx
  5. 112 0
      DataRequest/Debug_Console.Designer.cs
  6. 164 0
      DataRequest/Debug_Console.cs
  7. 123 0
      DataRequest/Debug_Console.resx
  8. 9 10
      DataRequest/Form1.Designer.cs
  9. 2 2
      DataRequest/Form1.cs
  10. 46 0
      DataRequest/Func/AutoClosingMessageBox.cs
  11. 114 0
      DataRequest/Func/Etc_Function.cs
  12. 272 0
      DataRequest/Func/Serial.cs
  13. 24 0
      DataRequest/Func/crc.cs
  14. 347 0
      DataRequest/Main.Designer.cs
  15. 131 0
      DataRequest/Main.cs
  16. 126 0
      DataRequest/Main.resx
  17. 1 1
      DataRequest/Program.cs
  18. 150 28
      DataRequest/Properties/Resources.Designer.cs
  19. 48 5
      DataRequest/Properties/Resources.resx
  20. BIN
      DataRequest/Resources/bluecell_logo.png
  21. BIN
      DataRequest/Resources/connected_50px.png
  22. BIN
      DataRequest/Resources/console_48px.png
  23. BIN
      DataRequest/Resources/green.png
  24. BIN
      DataRequest/Resources/green_circle_48px.png
  25. BIN
      DataRequest/Resources/green_s.png
  26. BIN
      DataRequest/Resources/menu_48px.png
  27. BIN
      DataRequest/Resources/menu_50px.png
  28. BIN
      DataRequest/Resources/microsoft_excel_48px.png
  29. BIN
      DataRequest/Resources/red.png
  30. BIN
      DataRequest/Resources/red_circle_48px.png
  31. BIN
      DataRequest/Resources/red_s.png
  32. BIN
      DataRequest/Resources/rs-232_female_40px.png
  33. 305 0
      DataRequest/Serial_Config.Designer.cs
  34. 73 0
      DataRequest/Serial_Config.cs
  35. 129 0
      DataRequest/Serial_Config.resx
  36. 263 0
      DataRequest/SubMain.Designer.cs
  37. 32 0
      DataRequest/SubMain.cs
  38. 120 0
      DataRequest/SubMain.resx
  39. 468 0
      DataRequest/Table.Designer.cs
  40. 323 0
      DataRequest/Table.cs
  41. 135 0
      DataRequest/Table.resx

+ 125 - 3
DataRequest/DataRequest.csproj

@@ -35,6 +35,7 @@
35 35
   <ItemGroup>
36 36
     <Reference Include="System" />
37 37
     <Reference Include="System.Core" />
38
+    <Reference Include="System.Windows.Forms.DataVisualization" />
38 39
     <Reference Include="System.Xml.Linq" />
39 40
     <Reference Include="System.Data.DataSetExtensions" />
40 41
     <Reference Include="Microsoft.CSharp" />
@@ -46,14 +47,57 @@
46 47
     <Reference Include="System.Xml" />
47 48
   </ItemGroup>
48 49
   <ItemGroup>
49
-    <Compile Include="Form1.cs">
50
+    <Compile Include="Debug_Console.cs">
50 51
       <SubType>Form</SubType>
51 52
     </Compile>
52
-    <Compile Include="Form1.Designer.cs">
53
-      <DependentUpon>Form1.cs</DependentUpon>
53
+    <Compile Include="Debug_Console.Designer.cs">
54
+      <DependentUpon>Debug_Console.cs</DependentUpon>
55
+    </Compile>
56
+    <Compile Include="Func\AutoClosingMessageBox.cs" />
57
+    <Compile Include="Func\crc.cs" />
58
+    <Compile Include="Func\Etc_Function.cs" />
59
+    <Compile Include="Func\Serial.cs" />
60
+    <Compile Include="Main.cs">
61
+      <SubType>Form</SubType>
62
+    </Compile>
63
+    <Compile Include="Main.Designer.cs">
64
+      <DependentUpon>Main.cs</DependentUpon>
65
+    </Compile>
66
+    <Compile Include="Debug.cs">
67
+      <SubType>Form</SubType>
68
+    </Compile>
69
+    <Compile Include="Debug.Designer.cs">
70
+      <DependentUpon>Debug.cs</DependentUpon>
54 71
     </Compile>
55 72
     <Compile Include="Program.cs" />
56 73
     <Compile Include="Properties\AssemblyInfo.cs" />
74
+    <Compile Include="Serial_Config.cs">
75
+      <SubType>Form</SubType>
76
+    </Compile>
77
+    <Compile Include="Serial_Config.Designer.cs">
78
+      <DependentUpon>Serial_Config.cs</DependentUpon>
79
+    </Compile>
80
+    <Compile Include="SubMain.cs">
81
+      <SubType>Form</SubType>
82
+    </Compile>
83
+    <Compile Include="SubMain.Designer.cs">
84
+      <DependentUpon>SubMain.cs</DependentUpon>
85
+    </Compile>
86
+    <Compile Include="Table.cs">
87
+      <SubType>Form</SubType>
88
+    </Compile>
89
+    <Compile Include="Table.Designer.cs">
90
+      <DependentUpon>Table.cs</DependentUpon>
91
+    </Compile>
92
+    <EmbeddedResource Include="Debug_Console.resx">
93
+      <DependentUpon>Debug_Console.cs</DependentUpon>
94
+    </EmbeddedResource>
95
+    <EmbeddedResource Include="Main.resx">
96
+      <DependentUpon>Main.cs</DependentUpon>
97
+    </EmbeddedResource>
98
+    <EmbeddedResource Include="Debug.resx">
99
+      <DependentUpon>Debug.cs</DependentUpon>
100
+    </EmbeddedResource>
57 101
     <EmbeddedResource Include="Properties\Resources.resx">
58 102
       <Generator>ResXFileCodeGenerator</Generator>
59 103
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -62,7 +106,17 @@
62 106
     <Compile Include="Properties\Resources.Designer.cs">
63 107
       <AutoGen>True</AutoGen>
64 108
       <DependentUpon>Resources.resx</DependentUpon>
109
+      <DesignTime>True</DesignTime>
65 110
     </Compile>
111
+    <EmbeddedResource Include="Serial_Config.resx">
112
+      <DependentUpon>Serial_Config.cs</DependentUpon>
113
+    </EmbeddedResource>
114
+    <EmbeddedResource Include="SubMain.resx">
115
+      <DependentUpon>SubMain.cs</DependentUpon>
116
+    </EmbeddedResource>
117
+    <EmbeddedResource Include="Table.resx">
118
+      <DependentUpon>Table.cs</DependentUpon>
119
+    </EmbeddedResource>
66 120
     <None Include="Properties\Settings.settings">
67 121
       <Generator>SettingsSingleFileGenerator</Generator>
68 122
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -76,5 +130,73 @@
76 130
   <ItemGroup>
77 131
     <None Include="App.config" />
78 132
   </ItemGroup>
133
+  <ItemGroup>
134
+    <None Include="Resources\menu_50px.png" />
135
+  </ItemGroup>
136
+  <ItemGroup>
137
+    <None Include="Resources\console_48px.png" />
138
+  </ItemGroup>
139
+  <ItemGroup>
140
+    <None Include="Resources\microsoft_excel_48px.png" />
141
+  </ItemGroup>
142
+  <ItemGroup>
143
+    <None Include="Resources\menu_48px.png" />
144
+  </ItemGroup>
145
+  <ItemGroup>
146
+    <None Include="Resources\bluecell_logo.png" />
147
+  </ItemGroup>
148
+  <ItemGroup>
149
+    <None Include="Resources\rs-232_female_40px.png" />
150
+  </ItemGroup>
151
+  <ItemGroup>
152
+    <None Include="Resources\connected_50px.png" />
153
+  </ItemGroup>
154
+  <ItemGroup>
155
+    <None Include="Resources\red_circle_48px.png" />
156
+  </ItemGroup>
157
+  <ItemGroup>
158
+    <None Include="Resources\green_circle_48px.png" />
159
+  </ItemGroup>
160
+  <ItemGroup>
161
+    <None Include="Resources\red.png" />
162
+  </ItemGroup>
163
+  <ItemGroup>
164
+    <None Include="Resources\green.png" />
165
+  </ItemGroup>
166
+  <ItemGroup>
167
+    <None Include="Resources\red_s.png" />
168
+  </ItemGroup>
169
+  <ItemGroup>
170
+    <None Include="Resources\green_s.png" />
171
+  </ItemGroup>
172
+  <ItemGroup>
173
+    <COMReference Include="Microsoft.Office.Core">
174
+      <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
175
+      <VersionMajor>2</VersionMajor>
176
+      <VersionMinor>8</VersionMinor>
177
+      <Lcid>0</Lcid>
178
+      <WrapperTool>primary</WrapperTool>
179
+      <Isolated>False</Isolated>
180
+      <EmbedInteropTypes>True</EmbedInteropTypes>
181
+    </COMReference>
182
+    <COMReference Include="Microsoft.Office.Interop.Excel">
183
+      <Guid>{00020813-0000-0000-C000-000000000046}</Guid>
184
+      <VersionMajor>1</VersionMajor>
185
+      <VersionMinor>9</VersionMinor>
186
+      <Lcid>0</Lcid>
187
+      <WrapperTool>primary</WrapperTool>
188
+      <Isolated>False</Isolated>
189
+      <EmbedInteropTypes>True</EmbedInteropTypes>
190
+    </COMReference>
191
+    <COMReference Include="VBIDE">
192
+      <Guid>{0002E157-0000-0000-C000-000000000046}</Guid>
193
+      <VersionMajor>5</VersionMajor>
194
+      <VersionMinor>3</VersionMinor>
195
+      <Lcid>0</Lcid>
196
+      <WrapperTool>primary</WrapperTool>
197
+      <Isolated>False</Isolated>
198
+      <EmbedInteropTypes>True</EmbedInteropTypes>
199
+    </COMReference>
200
+  </ItemGroup>
79 201
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
80 202
 </Project>

+ 126 - 0
DataRequest/Debug.Designer.cs

@@ -0,0 +1,126 @@
1
+namespace DataRequest
2
+{
3
+    partial class Debug
4
+    {
5
+        /// <summary>
6
+        /// Required designer variable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Clean up any resources being used.
12
+        /// </summary>
13
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows Form Designer generated code
24
+
25
+        /// <summary>
26
+        /// Required method for Designer support - do not modify
27
+        /// the contents of this method with the code editor.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.listView_Debug = new System.Windows.Forms.ListView();
32
+            this.panel1 = new System.Windows.Forms.Panel();
33
+            this.dataGridView_Debug = new System.Windows.Forms.DataGridView();
34
+            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
35
+            this.기능ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
36
+            this.debugConsoleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
37
+            this.panel1.SuspendLayout();
38
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_Debug)).BeginInit();
39
+            this.menuStrip1.SuspendLayout();
40
+            this.SuspendLayout();
41
+            // 
42
+            // listView_Debug
43
+            // 
44
+            this.listView_Debug.Dock = System.Windows.Forms.DockStyle.Fill;
45
+            this.listView_Debug.HideSelection = false;
46
+            this.listView_Debug.Location = new System.Drawing.Point(0, 24);
47
+            this.listView_Debug.Name = "listView_Debug";
48
+            this.listView_Debug.Size = new System.Drawing.Size(489, 476);
49
+            this.listView_Debug.TabIndex = 0;
50
+            this.listView_Debug.UseCompatibleStateImageBehavior = false;
51
+            // 
52
+            // panel1
53
+            // 
54
+            this.panel1.Controls.Add(this.listView_Debug);
55
+            this.panel1.Controls.Add(this.menuStrip1);
56
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
57
+            this.panel1.Location = new System.Drawing.Point(0, 0);
58
+            this.panel1.Name = "panel1";
59
+            this.panel1.Size = new System.Drawing.Size(489, 500);
60
+            this.panel1.TabIndex = 1;
61
+            // 
62
+            // dataGridView_Debug
63
+            // 
64
+            this.dataGridView_Debug.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
65
+            this.dataGridView_Debug.Dock = System.Windows.Forms.DockStyle.Fill;
66
+            this.dataGridView_Debug.Location = new System.Drawing.Point(489, 0);
67
+            this.dataGridView_Debug.Name = "dataGridView_Debug";
68
+            this.dataGridView_Debug.RowTemplate.Height = 23;
69
+            this.dataGridView_Debug.Size = new System.Drawing.Size(295, 500);
70
+            this.dataGridView_Debug.TabIndex = 2;
71
+            // 
72
+            // menuStrip1
73
+            // 
74
+            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
75
+            this.기능ToolStripMenuItem});
76
+            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
77
+            this.menuStrip1.Name = "menuStrip1";
78
+            this.menuStrip1.Size = new System.Drawing.Size(489, 24);
79
+            this.menuStrip1.TabIndex = 1;
80
+            this.menuStrip1.Text = "menuStrip1";
81
+            // 
82
+            // 기능ToolStripMenuItem
83
+            // 
84
+            this.기능ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
85
+            this.debugConsoleToolStripMenuItem});
86
+            this.기능ToolStripMenuItem.Name = "기능ToolStripMenuItem";
87
+            this.기능ToolStripMenuItem.Size = new System.Drawing.Size(66, 20);
88
+            this.기능ToolStripMenuItem.Text = "Function";
89
+            // 
90
+            // debugConsoleToolStripMenuItem
91
+            // 
92
+            this.debugConsoleToolStripMenuItem.Name = "debugConsoleToolStripMenuItem";
93
+            this.debugConsoleToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
94
+            this.debugConsoleToolStripMenuItem.Text = "Debug Console";
95
+            this.debugConsoleToolStripMenuItem.Click += new System.EventHandler(this.debugConsoleToolStripMenuItem_Click);
96
+            // 
97
+            // Debug
98
+            // 
99
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
100
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
101
+            this.ClientSize = new System.Drawing.Size(784, 500);
102
+            this.Controls.Add(this.dataGridView_Debug);
103
+            this.Controls.Add(this.panel1);
104
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
105
+            this.MainMenuStrip = this.menuStrip1;
106
+            this.Name = "Debug";
107
+            this.Text = "Debug";
108
+            this.panel1.ResumeLayout(false);
109
+            this.panel1.PerformLayout();
110
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_Debug)).EndInit();
111
+            this.menuStrip1.ResumeLayout(false);
112
+            this.menuStrip1.PerformLayout();
113
+            this.ResumeLayout(false);
114
+
115
+        }
116
+
117
+        #endregion
118
+
119
+        private System.Windows.Forms.ListView listView_Debug;
120
+        private System.Windows.Forms.Panel panel1;
121
+        private System.Windows.Forms.DataGridView dataGridView_Debug;
122
+        private System.Windows.Forms.MenuStrip menuStrip1;
123
+        private System.Windows.Forms.ToolStripMenuItem 기능ToolStripMenuItem;
124
+        private System.Windows.Forms.ToolStripMenuItem debugConsoleToolStripMenuItem;
125
+    }
126
+}

+ 36 - 0
DataRequest/Debug.cs

@@ -0,0 +1,36 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.ComponentModel;
4
+using System.Data;
5
+using System.Drawing;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+using System.Windows.Forms;
10
+
11
+namespace DataRequest
12
+{
13
+    public partial class Debug : Form
14
+    {
15
+        public Debug()
16
+        {
17
+            InitializeComponent();
18
+        }
19
+
20
+        public Debug_Console debug_Console = null;//new Debug_Console();
21
+        private void debugConsoleToolStripMenuItem_Click(object sender, EventArgs e)
22
+        {
23
+            // Debug debug = new Debug();
24
+            foreach (Form frm in Application.OpenForms)
25
+            {
26
+                if (frm.Name == "Debug_Console")
27
+                {
28
+                    frm.Activate();
29
+                    return;
30
+                }
31
+            }
32
+            debug_Console = new Debug_Console();
33
+            debug_Console.Show();
34
+        }
35
+    }
36
+}

+ 123 - 0
DataRequest/Debug.resx

@@ -0,0 +1,123 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
123
+</root>

+ 112 - 0
DataRequest/Debug_Console.Designer.cs

@@ -0,0 +1,112 @@
1
+namespace DataRequest
2
+{
3
+    partial class Debug_Console
4
+    {
5
+        /// <summary>
6
+        /// Required designer variable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Clean up any resources being used.
12
+        /// </summary>
13
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows Form Designer generated code
24
+
25
+        /// <summary>
26
+        /// Required method for Designer support - do not modify
27
+        /// the contents of this method with the code editor.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.richTextBox_Debug = new System.Windows.Forms.RichTextBox();
32
+            this.menuStrip_Console = new System.Windows.Forms.MenuStrip();
33
+            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
34
+            this.aSCIIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
35
+            this.consolClearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
36
+            this.menuStrip_Console.SuspendLayout();
37
+            this.SuspendLayout();
38
+            // 
39
+            // richTextBox_Debug
40
+            // 
41
+            this.richTextBox_Debug.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
42
+            | System.Windows.Forms.AnchorStyles.Left) 
43
+            | System.Windows.Forms.AnchorStyles.Right)));
44
+            this.richTextBox_Debug.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(30)))), ((int)(((byte)(68)))));
45
+            this.richTextBox_Debug.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 14F);
46
+            this.richTextBox_Debug.ForeColor = System.Drawing.Color.Gold;
47
+            this.richTextBox_Debug.Location = new System.Drawing.Point(0, 27);
48
+            this.richTextBox_Debug.Name = "richTextBox_Debug";
49
+            this.richTextBox_Debug.Size = new System.Drawing.Size(920, 422);
50
+            this.richTextBox_Debug.TabIndex = 0;
51
+            this.richTextBox_Debug.Text = "";
52
+            // 
53
+            // menuStrip_Console
54
+            // 
55
+            this.menuStrip_Console.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
56
+            this.fileToolStripMenuItem});
57
+            this.menuStrip_Console.Location = new System.Drawing.Point(0, 0);
58
+            this.menuStrip_Console.Name = "menuStrip_Console";
59
+            this.menuStrip_Console.Size = new System.Drawing.Size(923, 24);
60
+            this.menuStrip_Console.TabIndex = 1;
61
+            this.menuStrip_Console.Text = "menuStrip1";
62
+            // 
63
+            // fileToolStripMenuItem
64
+            // 
65
+            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
66
+            this.aSCIIToolStripMenuItem,
67
+            this.consolClearToolStripMenuItem});
68
+            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
69
+            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
70
+            this.fileToolStripMenuItem.Text = "File";
71
+            // 
72
+            // aSCIIToolStripMenuItem
73
+            // 
74
+            this.aSCIIToolStripMenuItem.CheckOnClick = true;
75
+            this.aSCIIToolStripMenuItem.Name = "aSCIIToolStripMenuItem";
76
+            this.aSCIIToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
77
+            this.aSCIIToolStripMenuItem.Text = "ASCII";
78
+            this.aSCIIToolStripMenuItem.Click += new System.EventHandler(this.aSCIIToolStripMenuItem_Click);
79
+            // 
80
+            // consolClearToolStripMenuItem
81
+            // 
82
+            this.consolClearToolStripMenuItem.Name = "consolClearToolStripMenuItem";
83
+            this.consolClearToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
84
+            this.consolClearToolStripMenuItem.Text = "Console Clear";
85
+            this.consolClearToolStripMenuItem.Click += new System.EventHandler(this.consolClearToolStripMenuItem_Click);
86
+            // 
87
+            // Debug_Console
88
+            // 
89
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
90
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
91
+            this.ClientSize = new System.Drawing.Size(923, 450);
92
+            this.Controls.Add(this.richTextBox_Debug);
93
+            this.Controls.Add(this.menuStrip_Console);
94
+            this.MainMenuStrip = this.menuStrip_Console;
95
+            this.Name = "Debug_Console";
96
+            this.Text = "Debug_Console";
97
+            this.menuStrip_Console.ResumeLayout(false);
98
+            this.menuStrip_Console.PerformLayout();
99
+            this.ResumeLayout(false);
100
+            this.PerformLayout();
101
+
102
+        }
103
+
104
+        #endregion
105
+
106
+        private System.Windows.Forms.RichTextBox richTextBox_Debug;
107
+        private System.Windows.Forms.MenuStrip menuStrip_Console;
108
+        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
109
+        public System.Windows.Forms.ToolStripMenuItem aSCIIToolStripMenuItem;
110
+        private System.Windows.Forms.ToolStripMenuItem consolClearToolStripMenuItem;
111
+    }
112
+}

+ 164 - 0
DataRequest/Debug_Console.cs

@@ -0,0 +1,164 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.ComponentModel;
4
+using System.Data;
5
+using System.Drawing;
6
+using System.Linq;
7
+using System.Runtime.InteropServices;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace DataRequest
13
+{
14
+    public partial class Debug_Console : Form
15
+    {
16
+        public Debug_Console()
17
+        {
18
+            InitializeComponent();
19
+        }
20
+        private delegate void StringSend(object label, String str);
21
+        private delegate void ByteSend(object label, byte[] data);
22
+        private delegate void CharSend(object label, char[] data);
23
+        private delegate int StringLineLength(object label);
24
+        private delegate int StringGetFirstCharIndexFromLine(object label,int Length,int MaxLength);
25
+        private void Byte_Set(object label, byte[] data)
26
+        {
27
+            RichTextBox Temp_label = (RichTextBox)label;
28
+            for (int i = 0; i < data.Length; i++)
29
+            {
30
+                Temp_label.Text += Convert.ToString(data[i], 16);
31
+                Temp_label.Text += "";
32
+            }
33
+        }
34
+        private void Char_Set(object label, char[] data)
35
+        {
36
+            RichTextBox Temp_label = (RichTextBox)label;
37
+            for (int i = 0; i < data.Length; i++)
38
+                Temp_label.Text += data[i].ToString();
39
+        }
40
+        private void TextBox_Text_Set(object label, String str)
41
+        {
42
+            RichTextBox Temp_label = (RichTextBox)label;
43
+            Temp_label.Text = str;
44
+        }
45
+        private void TextBox_Text_Append(object label, String str)
46
+        {
47
+            RichTextBox Temp_label = (RichTextBox)label;
48
+            Temp_label.AppendText(str);
49
+        }
50
+        private void TextBox_Text_SelectedText(object label, String str)
51
+        {
52
+            RichTextBox Temp_label = (RichTextBox)label;
53
+            Temp_label.SelectedText = (str);
54
+        }
55
+        private int TextBox_Text_Lines_Length(object label)
56
+        {
57
+            RichTextBox Temp_label = (RichTextBox)label;
58
+            return Temp_label.Lines.Length;
59
+        }
60
+        private int TextBox_Text_GetFirstCharIndexFromLine(object label, int Length, int MaxLength)
61
+        {
62
+            RichTextBox Temp_label = (RichTextBox)label;
63
+            return Temp_label.GetFirstCharIndexFromLine(Length - MaxLength);
64
+        }
65
+        private int TextBox_Text_Select(object label,int start,int Length)
66
+        {
67
+            RichTextBox Temp_label = (RichTextBox)label;
68
+            Temp_label.Select(start,Length);
69
+            return 0;
70
+        }
71
+        private int TextBox_Text(object label)
72
+        {
73
+            RichTextBox Temp_label = (RichTextBox)label;
74
+            Temp_label.ScrollToCaret();
75
+            return 0;
76
+        }
77
+#if false
78
+        public void RecvData(string str)
79
+        {
80
+            this.Invoke(new StringSend(TextBox_Text_Set), richTextBox_Debug,str); 
81
+            //richTextBox_Debug.Text = str;
82
+
83
+        }
84
+#else
85
+
86
+        public void RecvData(string text)
87
+        {
88
+ 
89
+            int Length = (int)this.Invoke(new StringLineLength(TextBox_Text_Lines_Length), richTextBox_Debug);
90
+            int maxline = 10000;
91
+            int GetFirstCharIndexFromLine_Length = (int)this.Invoke(new StringGetFirstCharIndexFromLine(TextBox_Text_GetFirstCharIndexFromLine), richTextBox_Debug, maxline, Length );
92
+            if (Length > maxline)
93
+            {
94
+                this.Invoke(new StringGetFirstCharIndexFromLine(TextBox_Text_Select), 0, GetFirstCharIndexFromLine_Length);
95
+                this.Invoke(new StringSend(TextBox_Text_SelectedText), richTextBox_Debug, "");
96
+                this.Invoke(new StringSend(TextBox_Text_Append), richTextBox_Debug, "\n");
97
+            }
98
+            else
99
+            {
100
+                this.Invoke(new StringSend(TextBox_Text_Append), richTextBox_Debug, "\n");
101
+            }
102
+            // richTextBox_Debug.ScrollToCaret();
103
+            this.Invoke(new StringLineLength(TextBox_Text), richTextBox_Debug);
104
+            if (aSCIIToolStripMenuItem.Checked == true)
105
+            {
106
+                this.Invoke(new CharSend(Char_Set), richTextBox_Debug, text.ToArray());
107
+            }
108
+            else
109
+            {
110
+                this.Invoke(new StringSend(TextBox_Text_Append), richTextBox_Debug, text);
111
+            }
112
+            /****
113
+              *메모리 누수 방지용 코드
114
+              */
115
+            System.GC.Collect(0, GCCollectionMode.Forced);
116
+            System.GC.WaitForFullGCComplete();
117
+
118
+        }
119
+        public void RecvData(byte[] text)
120
+        {
121
+
122
+            int Length = (int)this.Invoke(new StringLineLength(TextBox_Text_Lines_Length), richTextBox_Debug);
123
+            int maxline = 10000;
124
+            int GetFirstCharIndexFromLine_Length = (int)this.Invoke(new StringGetFirstCharIndexFromLine(TextBox_Text_GetFirstCharIndexFromLine), richTextBox_Debug, maxline, Length);
125
+            if (Length > maxline)
126
+            {
127
+                this.Invoke(new StringGetFirstCharIndexFromLine(TextBox_Text_Select), 0, GetFirstCharIndexFromLine_Length);
128
+                this.Invoke(new StringSend(TextBox_Text_SelectedText), richTextBox_Debug, "");
129
+                this.Invoke(new StringSend(TextBox_Text_Append), richTextBox_Debug, "\n");
130
+            }
131
+            else
132
+            {
133
+                this.Invoke(new StringSend(TextBox_Text_Append), richTextBox_Debug, "\n");
134
+            }
135
+            // richTextBox_Debug.ScrollToCaret();
136
+            this.Invoke(new StringLineLength(TextBox_Text), richTextBox_Debug);
137
+            if (aSCIIToolStripMenuItem.Checked == true)
138
+            {
139
+                this.Invoke(new ByteSend(Byte_Set), richTextBox_Debug, text);
140
+            }
141
+            else
142
+            {
143
+                this.Invoke(new StringSend(TextBox_Text_Append), richTextBox_Debug, text);
144
+            }
145
+            /****
146
+              *메모리 누수 방지용 코드
147
+              */
148
+            System.GC.Collect(0, GCCollectionMode.Forced);
149
+            System.GC.WaitForFullGCComplete();
150
+
151
+        }
152
+        private void aSCIIToolStripMenuItem_Click(object sender, EventArgs e)
153
+        {
154
+            
155
+        }
156
+
157
+        private void consolClearToolStripMenuItem_Click(object sender, EventArgs e)
158
+        {
159
+            this.Invoke(new StringSend(TextBox_Text_Set), richTextBox_Debug, "");
160
+        }
161
+
162
+#endif
163
+    }
164
+}

+ 123 - 0
DataRequest/Debug_Console.resx

@@ -0,0 +1,123 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="menuStrip_Console.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
123
+</root>

+ 9 - 10
DataRequest/Form1.Designer.cs

@@ -1,16 +1,16 @@
1 1
 namespace DataRequest
2 2
 {
3
-    partial class Form1
3
+    partial class Debug_Table
4 4
     {
5 5
         /// <summary>
6
-        /// 필수 디자이너 변수입니다.
6
+        /// Required designer variable.
7 7
         /// </summary>
8 8
         private System.ComponentModel.IContainer components = null;
9 9
 
10 10
         /// <summary>
11
-        /// 사용 중인 모든 리소스를 정리합니다.
11
+        /// Clean up any resources being used.
12 12
         /// </summary>
13
-        /// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
13
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14 14
         protected override void Dispose(bool disposing)
15 15
         {
16 16
             if (disposing && (components != null))
@@ -20,21 +20,20 @@
20 20
             base.Dispose(disposing);
21 21
         }
22 22
 
23
-        #region Windows Form 디자이너에서 생성한 코드
23
+        #region Windows Form Designer generated code
24 24
 
25 25
         /// <summary>
26
-        /// 디자이너 지원에 필요한 메서드입니다. 
27
-        /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
26
+        /// Required method for Designer support - do not modify
27
+        /// the contents of this method with the code editor.
28 28
         /// </summary>
29 29
         private void InitializeComponent()
30 30
         {
31 31
             this.components = new System.ComponentModel.Container();
32 32
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
33 33
             this.ClientSize = new System.Drawing.Size(800, 450);
34
-            this.Text = "Form1";
34
+            this.Text = "Debug_Table";
35 35
         }
36 36
 
37 37
         #endregion
38 38
     }
39
-}
40
-
39
+}

+ 2 - 2
DataRequest/Form1.cs

@@ -10,9 +10,9 @@ using System.Windows.Forms;
10 10
 
11 11
 namespace DataRequest
12 12
 {
13
-    public partial class Form1 : Form
13
+    public partial class Debug_Table : Form
14 14
     {
15
-        public Form1()
15
+        public Debug_Table()
16 16
         {
17 17
             InitializeComponent();
18 18
         }

+ 46 - 0
DataRequest/Func/AutoClosingMessageBox.cs

@@ -0,0 +1,46 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using System.Windows.Forms;
7
+
8
+namespace DataRequest.Func
9
+{
10
+    class AutoClosingMessageBox
11
+    {
12
+        [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)]
13
+        static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
14
+        [System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
15
+        static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
16
+
17
+        System.Threading.Timer _timeoutTimer; //쓰레드 타이머
18
+        string _caption;
19
+
20
+        const int WM_CLOSE = 0x0010; //close 명령 
21
+
22
+        AutoClosingMessageBox(string text, string caption, int timeout)
23
+        {
24
+            _caption = caption;
25
+            _timeoutTimer = new System.Threading.Timer(OnTimerElapsed,
26
+                null, timeout, System.Threading.Timeout.Infinite);
27
+            MessageBox.Show(text, caption);
28
+        }
29
+
30
+        //생성자 함수
31
+        public static void Show(string text, string caption, int timeout)
32
+        {
33
+            new AutoClosingMessageBox(text, caption, timeout);
34
+        }
35
+
36
+        //시간이 다되면 close 메세지를 보냄
37
+
38
+        void OnTimerElapsed(object state)
39
+        {
40
+            IntPtr mbWnd = FindWindow(null, _caption);
41
+            if (mbWnd != IntPtr.Zero)
42
+                SendMessage(mbWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
43
+            _timeoutTimer.Dispose();
44
+        }
45
+    }
46
+}

+ 114 - 0
DataRequest/Func/Etc_Function.cs

@@ -0,0 +1,114 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using System.Windows.Forms;
7
+using static System.Net.Mime.MediaTypeNames;
8
+
9
+namespace DataRequest.Func
10
+{
11
+    class Etc_Function
12
+    {
13
+        public bool OverLap_Window_Find(string str)
14
+        {
15
+            bool ret = false;
16
+            foreach (Form frm in System.Windows.Forms.Application.OpenForms)
17
+            {
18
+                if (frm.Name == str)
19
+                {
20
+                   // frm.Activate();
21
+                    ret = false;
22
+                    return ret;
23
+                }
24
+            }
25
+            ret = true;
26
+            return ret;
27
+        }
28
+        public string[] ProtocolSplit(string str)
29
+        {
30
+            string[] retstr = null;
31
+            if (str.Contains(",") == true)
32
+            {
33
+                retstr = str.Split(',');
34
+            }
35
+            else if (str.Contains(" ") == true)
36
+            {
37
+                retstr = str.Split(' ');
38
+            }
39
+            return retstr;
40
+        }
41
+        public byte[] StrToConvertByteArray(string[] str)
42
+        {
43
+            byte[] retbyte = new byte[str.Length];
44
+            //string dec = null;//Convert.ToInt32(hex, 10).ToString();
45
+            for (int i = 0; i < str.Length; i++)
46
+            {
47
+                if(str[i].Contains("0x") == true)
48
+                {
49
+                    str[i] = str[i].Substring(2);
50
+                    retbyte[i] = Convert.ToByte(str[i],16);
51
+                }
52
+                else
53
+                {
54
+                    retbyte[i] = Convert.ToByte(str[i]);
55
+                }
56
+             //   dec = Convert.ToInt32(str[i], 10).ToString();
57
+                
58
+            }
59
+            return retbyte;
60
+        }
61
+        public string Str2hex(string strData, Boolean Compotable)
62
+        {
63
+            string resultHex = string.Empty;
64
+            byte[] arr_byteStr = Encoding.Default.GetBytes(strData);
65
+
66
+            foreach (byte byteStr in arr_byteStr)
67
+            {
68
+                if (Compotable == true)
69
+                    resultHex += string.Format("{0:X2}", byteStr) + " ";
70
+                else
71
+                    resultHex += string.Format("{0:X2}", byteStr);
72
+            }
73
+
74
+            return resultHex;
75
+        }
76
+        public enum NessLab_Protocol_Index
77
+        {
78
+            NessLab_Table_Req = 201,
79
+            NessLab_TableSet_Req = 202,
80
+            NessLab_TableSet_Res = 203,
81
+        };
82
+        public byte[] NessLab_Protocol_Create(double[] data, int mode)
83
+        {
84
+            byte[] tmpdata = new byte[(data.Length * 2) + 10];
85
+            int index = 0;
86
+            crc Nesslab_crc = new crc();
87
+            tmpdata[index++] = 0x7E;
88
+            tmpdata[index++] = 0x7E;
89
+            tmpdata[index++] = (byte)mode; //MSG ID
90
+            tmpdata[index++] = 0;          //MSG SN0
91
+            tmpdata[index++] = 0;          //MSG SN1
92
+            tmpdata[index++] = 0xFF;//Reserve
93
+            tmpdata[index++] = (byte)(data.Length * 2);
94
+
95
+            if (mode == (int)NessLab_Protocol_Index.NessLab_TableSet_Req)
96
+            {
97
+                for(int i = 0; i < data.Length; i++)
98
+                {
99
+                    tmpdata[(i * 2) + 7]     = (byte)(((UInt16)((double)data[i] * 1000) & 0xFF00) >> 8);
100
+                    tmpdata[(i * 2) + 7 + 1] = (byte)(((UInt16)((double)data[i] * 1000) & 0x00FF));
101
+                    index = (i * 2) + 7 + 1;
102
+                }
103
+                index++;
104
+            }
105
+            tmpdata[index++] = Nesslab_crc.NessLab_CheckSum(tmpdata, tmpdata[6] + 5);
106
+            tmpdata[index++] = 0x7E;
107
+            tmpdata[index] = 0x7E;
108
+
109
+            return tmpdata;
110
+        }
111
+
112
+    }
113
+
114
+}

+ 272 - 0
DataRequest/Func/Serial.cs

@@ -0,0 +1,272 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO.Ports;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading;
7
+using System.Threading.Tasks;
8
+using System.Windows.Forms;
9
+
10
+namespace DataRequest.Func
11
+{
12
+    public class Serial
13
+    {
14
+        public Form main_form;
15
+        
16
+        private System.IO.Ports.SerialPort serialPort;
17
+        private Debug Debug = new Debug();    // Teminal Text Wnd Open
18
+        //private Debug_Console debug_Console = new Debug_Console();    // Teminal Text Wnd Open
19
+        public string Serial_Name { get => serialPort.PortName; set => serialPort.PortName = value; }
20
+        public Thread reader, writer;    // 시리얼을 통해서 데이터를 읽고, 쓸 스레드 준비
21
+        Etc_Function etc_Function = new Etc_Function();
22
+
23
+        public void SetPortNameValues(object obj)
24
+        {
25
+
26
+            string[] ports = SerialPort.GetPortNames(); // load all name of com ports to string
27
+            try
28
+            {
29
+                ((ComboBox)obj).Items.Clear(); //delete previous names in combobox items
30
+            }
31
+            catch { }
32
+
33
+
34
+            ((ComboBox)obj).DataSource = null;
35
+            foreach (string port in ports) //add this names to comboboxPort items
36
+            {
37
+                ((ComboBox)obj).Items.Add(port); //if there are some com ports ,select first
38
+            }
39
+            if (((ComboBox)obj).Items.Count > 0)
40
+            {
41
+                ((ComboBox)obj).SelectedIndex = 0;
42
+            }
43
+            else
44
+            {
45
+                ((ComboBox)obj).Text = " "; //if there are no com ports ,write Empty
46
+            }
47
+        }
48
+
49
+        public void Serial_Port_name_Set(ref ComboBox cb_port)
50
+        {
51
+            serialPort.PortName = Serial_Name = cb_port.SelectedItem.ToString();
52
+        }
53
+
54
+        public void Serial_Initialize(ref ComboBox cb_port, string baudrate)
55
+        {
56
+            int BaudRate = Convert.ToInt32(baudrate);
57
+            this.serialPort = new System.IO.Ports.SerialPort();
58
+           // this.serialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.Serial_DataRecvFunction);
59
+
60
+            cb_port.BeginUpdate();
61
+            foreach (string comport in SerialPort.GetPortNames())//foreach (string comport in SerialPort_TestProgram.GetPortNames())
62
+            {
63
+                cb_port.Items.Add(comport);
64
+            }
65
+            cb_port.EndUpdate();
66
+            //SerialPort 초기 설정.
67
+            //  serialPort.Encoding = Encoding.GetEncoding("Windows-1252");
68
+
69
+            cb_port.DataSource = SerialPort.GetPortNames();
70
+            try
71
+            {
72
+                serialPort.PortName = Serial_Name = cb_port.SelectedItem.ToString();
73
+                serialPort.BaudRate = (int)BaudRate;
74
+                serialPort.DataBits = (int)8;
75
+                serialPort.Parity = System.IO.Ports.Parity.None;
76
+                serialPort.StopBits = StopBits.One;
77
+            }
78
+            catch { }
79
+
80
+        }
81
+
82
+        public void Start()
83
+        {
84
+            reader = new Thread(new ThreadStart(Read));    // Read()를 수행하는 스레드 reader 생성
85
+            reader.IsBackground = true;    // read는 백그라운드에서 수행하고,
86
+            reader.Start();  // reader 스레드를 실행
87
+//            writer = new Thread(new ThreadStart(Write));    // Write()를 수행하는 스레드 writer 생성
88
+//            writer.Start();    // write는 실제적으로 콘솔창에 입력해야 하므로 foreground로 수행하게 합니다.
89
+        }
90
+        public void Stop()
91
+        {
92
+            //reader = new Thread(new ThreadStart(Read));    // Read()를 수행하는 스레드 reader 생성
93
+            //reader.IsBackground = true;    // read는 백그라운드에서 수행하고,
94
+            reader.Interrupt();
95
+            reader.Abort(); //정지
96
+                           //reader.Join(); //정지
97
+                           //reader.Abort();  // reader 스레드를 실행
98
+                           //            writer = new Thread(new ThreadStart(Write));    // Write()를 수행하는 스레드 writer 생성
99
+                           //            writer.Start();    // write는 실제적으로 콘솔창에 입력해야 하므로 foreground로 수행하게 합니다.
100
+        }
101
+        // Writer thread for Serial port
102
+        public void Write()
103
+        {
104
+            for (;;)
105
+            {
106
+                serialPort.WriteLine(Console.ReadLine());  // 계속 반복하면서 입력된 데이터가 있으면 열려잇는 포트로 데이터 전송
107
+                Thread.Sleep(200);    // 200ms마다 스레드를 잠재워서 다른 스레드가 수행가능하게 합니다.(요건 스레드 프로그래밍을 해보셨으면 아시리라 생각...=_=
108
+            }
109
+        }
110
+        public void Serial_DataSend(byte[] buffer,int Length)
111
+        {
112
+            if(serialPort.IsOpen == true)
113
+                serialPort.Write(buffer, 0, Length);
114
+        }
115
+
116
+        // Reader thread for Serial port
117
+#if true
118
+        public void Read()
119
+        {
120
+            for (;;)
121
+            {
122
+                int nLnegth = serialPort.BytesToRead;
123
+                byte[] btdata = new byte[nLnegth];
124
+                serialPort.Read(btdata, 0, nLnegth);
125
+                string data2 = serialPort.ReadExisting();
126
+               
127
+
128
+                if (nLnegth != 0)
129
+                {
130
+                    string str = Encoding.Default.GetString(btdata);
131
+
132
+                    // ((Main)main_form).table.Table_Setting(btdata);
133
+                    try
134
+                    {
135
+                        ((Main)main_form).subMain.NessLab_Adc_Value_Set(btdata[7] << 8 | btdata[8]);
136
+                        if (etc_Function.OverLap_Window_Find("Debug_Console") == false)
137
+                        {
138
+                            string data = Encoding.Default.GetString(btdata);
139
+                            if (((Main)(this.main_form)).debug.debug_Console.aSCIIToolStripMenuItem.Checked == true)
140
+                            {
141
+                                ((Main)(this.main_form)).debug.debug_Console.RecvData(btdata);
142
+                            }
143
+                            else
144
+                            {
145
+                                ((Main)(this.main_form)).debug.debug_Console.RecvData(Str2hex(data, true));
146
+                            }
147
+                            //main_form.debug.debug_Console.RecvData(data);
148
+                        }
149
+                    }catch{ }
150
+                    
151
+
152
+                        //serialPort.Write(data);    // 열려있는 포트에서 데이터가 존재하면 읽어봐서 콘솔창에 뿌립니다.
153
+                }
154
+                Thread.Sleep(100);    // 위와 마찬가지 이유로 sleep시킴
155
+            }
156
+        }
157
+#else
158
+        public void Read()
159
+        {
160
+            for (; ; )
161
+            {
162
+               
163
+                string data2 = serialPort.ReadExisting();
164
+
165
+
166
+                if (data2.Length != 0)
167
+                {
168
+                   // string str = Encoding.Default.GetString(btdata);
169
+                    ((Main)(this.main_form)).debug.debug_Console.RecvData(Str2hex(data2, true));
170
+
171
+
172
+                    //serialPort.Write(data);    // 열려있는 포트에서 데이터가 존재하면 읽어봐서 콘솔창에 뿌립니다.
173
+                }
174
+                Thread.Sleep(100);    // 위와 마찬가지 이유로 sleep시킴
175
+            }
176
+        }
177
+#endif
178
+        public void Serial_Setting(string baudrate)
179
+        {
180
+            int BaudRate = Convert.ToInt32(baudrate);
181
+            this.serialPort = new System.IO.Ports.SerialPort();
182
+            //this.serialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.Serial_DataRecvFunction);
183
+            //SerialPort 초기 설정.
184
+            //  serialPort.Encoding = Encoding.GetEncoding("Windows-1252");
185
+            try
186
+            {
187
+                serialPort.BaudRate = (int)BaudRate;
188
+                serialPort.DataBits = (int)8;
189
+                serialPort.Parity = System.IO.Ports.Parity.None;
190
+                serialPort.StopBits = StopBits.One;
191
+            }
192
+            catch { }
193
+
194
+        }
195
+        private delegate void StringSend(string Text);
196
+        private delegate void ByteSend(byte[] Text);
197
+
198
+        public string Str2hex(string strData, Boolean Compotable)
199
+        {
200
+            string resultHex = string.Empty;
201
+            //byte[] arr_byteStr = Encoding.Default.GetBytes(strData);
202
+            //byte[] arr_byteStr = Encoding.ASCII.GetBytes(strData);
203
+            byte[] arr_byteStr = System.Text.ASCIIEncoding.ASCII.GetBytes(strData);
204
+            foreach (byte byteStr in arr_byteStr)
205
+            {
206
+                if (Compotable == true)
207
+                    resultHex += string.Format("{0:X2}", byteStr) + " ";
208
+                else
209
+                    resultHex += string.Format("{0:X2}", byteStr);
210
+            }
211
+
212
+            return resultHex;
213
+        }
214
+
215
+        static public byte[] Str2bytes(string byteData)
216
+        {
217
+
218
+#if false
219
+            System.Text.ASCIIEncoding asencoding = new System.Text.ASCIIEncoding();
220
+            return Encoding.Default.GetBytes(byteData);
221
+#else
222
+            byte[] arr_byteStr = Encoding.Default.GetBytes(byteData);
223
+            return arr_byteStr;
224
+#endif
225
+        }
226
+        private delegate void BoolSet();
227
+       
228
+        public byte Serial_PortOpen(ref Button Btn_Portonoff, ref ComboBox cb,string baudrate)
229
+        {
230
+            byte ret = 0;
231
+            try
232
+            {
233
+                if (serialPort.IsOpen)
234
+                { //When the port is open
235
+                    serialPort.Close();
236
+                    Btn_Portonoff.Text = "Connect";
237
+                    Stop();
238
+                    ret = 1;
239
+                    
240
+                }
241
+                else//When the port is close
242
+                {
243
+                    if (cb.Text != "")
244
+                    {
245
+                        //this.main_form.Invoke(new BoolSet(this.main_form.Serial_PortName_get));
246
+                        Serial_Setting(baudrate);
247
+                        serialPort.PortName = cb.Text;
248
+                        serialPort.Open();
249
+                        Btn_Portonoff.Text = "Disconnect";
250
+                        Start();
251
+                        //Debug.Debug_Main_Form_Get(this.main_form);
252
+                    }
253
+                    else
254
+                    {
255
+                        MessageBox.Show("Port is not set");
256
+                        ret = 1;
257
+                    }
258
+                }
259
+
260
+            }
261
+            catch
262
+            {
263
+                MessageBox.Show("already port open " + Serial_Name);
264
+                ret = 2;
265
+            }
266
+            return ret;
267
+        }
268
+
269
+
270
+
271
+    }
272
+}

+ 24 - 0
DataRequest/Func/crc.cs

@@ -0,0 +1,24 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace DataRequest.Func
8
+{
9
+    class crc
10
+    {
11
+        public byte NessLab_CheckSum(byte[] data,int size)
12
+        {
13
+            byte ret_data = 0;
14
+
15
+            for(int i = 2; i < size + 2; i++)
16
+            {
17
+                ret_data += (byte)((data[i]) & 0xFF);
18
+            }
19
+            ret_data = (byte)((~ret_data) + 1);
20
+
21
+            return ret_data;
22
+        }
23
+    }
24
+}

+ 347 - 0
DataRequest/Main.Designer.cs

@@ -0,0 +1,347 @@
1
+namespace DataRequest
2
+{
3
+    partial class Main
4
+    {
5
+        /// <summary>
6
+        /// 필수 디자이너 변수입니다.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// 사용 중인 모든 리소스를 정리합니다.
12
+        /// </summary>
13
+        /// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows Form 디자이너에서 생성한 코드
24
+
25
+        /// <summary>
26
+        /// 디자이너 지원에 필요한 메서드입니다. 
27
+        /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.components = new System.ComponentModel.Container();
32
+            this.panel1 = new System.Windows.Forms.Panel();
33
+            this.panel4 = new System.Windows.Forms.Panel();
34
+            this.comboBox_Baudrate = new System.Windows.Forms.ComboBox();
35
+            this.comboBox_Port = new System.Windows.Forms.ComboBox();
36
+            this.panel3 = new System.Windows.Forms.Panel();
37
+            this.panel2 = new System.Windows.Forms.Panel();
38
+            this.panel_ChildForm = new System.Windows.Forms.Panel();
39
+            this.serialPort1 = new System.IO.Ports.SerialPort(this.components);
40
+            this.timer1 = new System.Windows.Forms.Timer(this.components);
41
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
42
+            this.pictureBox4 = new System.Windows.Forms.PictureBox();
43
+            this.pictureBox_Tx = new System.Windows.Forms.PictureBox();
44
+            this.button_SerialConnect = new System.Windows.Forms.Button();
45
+            this.button_Serial = new System.Windows.Forms.Button();
46
+            this.button_Table = new System.Windows.Forms.Button();
47
+            this.button_Console = new System.Windows.Forms.Button();
48
+            this.button_Main = new System.Windows.Forms.Button();
49
+            this.pictureBox2 = new System.Windows.Forms.PictureBox();
50
+            this.pictureBox3 = new System.Windows.Forms.PictureBox();
51
+            this.pictureBox5 = new System.Windows.Forms.PictureBox();
52
+            this.panel1.SuspendLayout();
53
+            this.panel4.SuspendLayout();
54
+            this.panel3.SuspendLayout();
55
+            this.panel2.SuspendLayout();
56
+            this.panel_ChildForm.SuspendLayout();
57
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
58
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
59
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox_Tx)).BeginInit();
60
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
61
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
62
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
63
+            this.SuspendLayout();
64
+            // 
65
+            // panel1
66
+            // 
67
+            this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(30)))), ((int)(((byte)(68)))));
68
+            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
69
+            this.panel1.Controls.Add(this.pictureBox3);
70
+            this.panel1.Controls.Add(this.pictureBox5);
71
+            this.panel1.Controls.Add(this.pictureBox4);
72
+            this.panel1.Controls.Add(this.pictureBox_Tx);
73
+            this.panel1.Controls.Add(this.panel4);
74
+            this.panel1.Controls.Add(this.button_Serial);
75
+            this.panel1.Controls.Add(this.button_Table);
76
+            this.panel1.Controls.Add(this.button_Console);
77
+            this.panel1.Controls.Add(this.button_Main);
78
+            this.panel1.Controls.Add(this.panel3);
79
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
80
+            this.panel1.ForeColor = System.Drawing.Color.Transparent;
81
+            this.panel1.Location = new System.Drawing.Point(0, 0);
82
+            this.panel1.Name = "panel1";
83
+            this.panel1.Size = new System.Drawing.Size(200, 541);
84
+            this.panel1.TabIndex = 0;
85
+            // 
86
+            // panel4
87
+            // 
88
+            this.panel4.Controls.Add(this.button_SerialConnect);
89
+            this.panel4.Controls.Add(this.comboBox_Baudrate);
90
+            this.panel4.Controls.Add(this.comboBox_Port);
91
+            this.panel4.Dock = System.Windows.Forms.DockStyle.Top;
92
+            this.panel4.Location = new System.Drawing.Point(0, 316);
93
+            this.panel4.Name = "panel4";
94
+            this.panel4.Size = new System.Drawing.Size(198, 145);
95
+            this.panel4.TabIndex = 5;
96
+            // 
97
+            // comboBox_Baudrate
98
+            // 
99
+            this.comboBox_Baudrate.Dock = System.Windows.Forms.DockStyle.Top;
100
+            this.comboBox_Baudrate.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
101
+            this.comboBox_Baudrate.FormattingEnabled = true;
102
+            this.comboBox_Baudrate.Items.AddRange(new object[] {
103
+            "9600",
104
+            "14400",
105
+            "19200",
106
+            "38400",
107
+            "57600",
108
+            "115200",
109
+            "128000",
110
+            "921600"});
111
+            this.comboBox_Baudrate.Location = new System.Drawing.Point(0, 22);
112
+            this.comboBox_Baudrate.Name = "comboBox_Baudrate";
113
+            this.comboBox_Baudrate.Size = new System.Drawing.Size(198, 22);
114
+            this.comboBox_Baudrate.TabIndex = 1;
115
+            this.comboBox_Baudrate.Text = "57600";
116
+            // 
117
+            // comboBox_Port
118
+            // 
119
+            this.comboBox_Port.Dock = System.Windows.Forms.DockStyle.Top;
120
+            this.comboBox_Port.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
121
+            this.comboBox_Port.FormattingEnabled = true;
122
+            this.comboBox_Port.Location = new System.Drawing.Point(0, 0);
123
+            this.comboBox_Port.Name = "comboBox_Port";
124
+            this.comboBox_Port.Size = new System.Drawing.Size(198, 22);
125
+            this.comboBox_Port.TabIndex = 0;
126
+            // 
127
+            // panel3
128
+            // 
129
+            this.panel3.Controls.Add(this.pictureBox2);
130
+            this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
131
+            this.panel3.Location = new System.Drawing.Point(0, 0);
132
+            this.panel3.Name = "panel3";
133
+            this.panel3.Size = new System.Drawing.Size(198, 100);
134
+            this.panel3.TabIndex = 0;
135
+            // 
136
+            // panel2
137
+            // 
138
+            this.panel2.BackColor = System.Drawing.Color.White;
139
+            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
140
+            this.panel2.Controls.Add(this.panel_ChildForm);
141
+            this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
142
+            this.panel2.Location = new System.Drawing.Point(200, 0);
143
+            this.panel2.Name = "panel2";
144
+            this.panel2.Size = new System.Drawing.Size(802, 541);
145
+            this.panel2.TabIndex = 1;
146
+            // 
147
+            // panel_ChildForm
148
+            // 
149
+            this.panel_ChildForm.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(30)))), ((int)(((byte)(45)))));
150
+            this.panel_ChildForm.Controls.Add(this.pictureBox1);
151
+            this.panel_ChildForm.Dock = System.Windows.Forms.DockStyle.Fill;
152
+            this.panel_ChildForm.Location = new System.Drawing.Point(0, 0);
153
+            this.panel_ChildForm.Name = "panel_ChildForm";
154
+            this.panel_ChildForm.Size = new System.Drawing.Size(800, 539);
155
+            this.panel_ChildForm.TabIndex = 1;
156
+            // 
157
+            // timer1
158
+            // 
159
+            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
160
+            // 
161
+            // pictureBox1
162
+            // 
163
+            this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.None;
164
+            this.pictureBox1.Image = global::DataRequest.Properties.Resources.bluecell_logo;
165
+            this.pictureBox1.Location = new System.Drawing.Point(348, 211);
166
+            this.pictureBox1.Name = "pictureBox1";
167
+            this.pictureBox1.Size = new System.Drawing.Size(150, 42);
168
+            this.pictureBox1.TabIndex = 0;
169
+            this.pictureBox1.TabStop = false;
170
+            // 
171
+            // pictureBox4
172
+            // 
173
+            this.pictureBox4.Image = global::DataRequest.Properties.Resources.green_s;
174
+            this.pictureBox4.Location = new System.Drawing.Point(55, 498);
175
+            this.pictureBox4.Name = "pictureBox4";
176
+            this.pictureBox4.Size = new System.Drawing.Size(25, 20);
177
+            this.pictureBox4.TabIndex = 10;
178
+            this.pictureBox4.TabStop = false;
179
+            // 
180
+            // pictureBox_Tx
181
+            // 
182
+            this.pictureBox_Tx.Image = global::DataRequest.Properties.Resources.red_s;
183
+            this.pictureBox_Tx.Location = new System.Drawing.Point(24, 498);
184
+            this.pictureBox_Tx.Name = "pictureBox_Tx";
185
+            this.pictureBox_Tx.Size = new System.Drawing.Size(25, 20);
186
+            this.pictureBox_Tx.TabIndex = 9;
187
+            this.pictureBox_Tx.TabStop = false;
188
+            // 
189
+            // button_SerialConnect
190
+            // 
191
+            this.button_SerialConnect.Dock = System.Windows.Forms.DockStyle.Bottom;
192
+            this.button_SerialConnect.FlatAppearance.BorderSize = 0;
193
+            this.button_SerialConnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
194
+            this.button_SerialConnect.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
195
+            this.button_SerialConnect.Image = global::DataRequest.Properties.Resources.connected_50px;
196
+            this.button_SerialConnect.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
197
+            this.button_SerialConnect.Location = new System.Drawing.Point(0, 102);
198
+            this.button_SerialConnect.Name = "button_SerialConnect";
199
+            this.button_SerialConnect.Size = new System.Drawing.Size(198, 43);
200
+            this.button_SerialConnect.TabIndex = 2;
201
+            this.button_SerialConnect.Text = "Connect";
202
+            this.button_SerialConnect.UseVisualStyleBackColor = true;
203
+            this.button_SerialConnect.Click += new System.EventHandler(this.button_SerialConnect_Click);
204
+            // 
205
+            // button_Serial
206
+            // 
207
+            this.button_Serial.Dock = System.Windows.Forms.DockStyle.Top;
208
+            this.button_Serial.FlatAppearance.BorderSize = 0;
209
+            this.button_Serial.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
210
+            this.button_Serial.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
211
+            this.button_Serial.Image = global::DataRequest.Properties.Resources.rs_232_female_40px;
212
+            this.button_Serial.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
213
+            this.button_Serial.Location = new System.Drawing.Point(0, 262);
214
+            this.button_Serial.Name = "button_Serial";
215
+            this.button_Serial.Size = new System.Drawing.Size(198, 54);
216
+            this.button_Serial.TabIndex = 4;
217
+            this.button_Serial.Text = "Serial";
218
+            this.button_Serial.UseVisualStyleBackColor = true;
219
+            this.button_Serial.Click += new System.EventHandler(this.button_Serial_Click);
220
+            // 
221
+            // button_Table
222
+            // 
223
+            this.button_Table.Dock = System.Windows.Forms.DockStyle.Top;
224
+            this.button_Table.FlatAppearance.BorderSize = 0;
225
+            this.button_Table.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
226
+            this.button_Table.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
227
+            this.button_Table.Image = global::DataRequest.Properties.Resources.microsoft_excel_48px;
228
+            this.button_Table.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
229
+            this.button_Table.Location = new System.Drawing.Point(0, 208);
230
+            this.button_Table.Name = "button_Table";
231
+            this.button_Table.Size = new System.Drawing.Size(198, 54);
232
+            this.button_Table.TabIndex = 3;
233
+            this.button_Table.Text = "Table";
234
+            this.button_Table.UseVisualStyleBackColor = true;
235
+            this.button_Table.Click += new System.EventHandler(this.button_Table_Click);
236
+            // 
237
+            // button_Console
238
+            // 
239
+            this.button_Console.Dock = System.Windows.Forms.DockStyle.Top;
240
+            this.button_Console.FlatAppearance.BorderSize = 0;
241
+            this.button_Console.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
242
+            this.button_Console.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
243
+            this.button_Console.Image = global::DataRequest.Properties.Resources.console_48px;
244
+            this.button_Console.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
245
+            this.button_Console.Location = new System.Drawing.Point(0, 154);
246
+            this.button_Console.Name = "button_Console";
247
+            this.button_Console.Size = new System.Drawing.Size(198, 54);
248
+            this.button_Console.TabIndex = 2;
249
+            this.button_Console.Text = "Console";
250
+            this.button_Console.UseVisualStyleBackColor = true;
251
+            this.button_Console.Click += new System.EventHandler(this.button_Console_Click);
252
+            // 
253
+            // button_Main
254
+            // 
255
+            this.button_Main.Dock = System.Windows.Forms.DockStyle.Top;
256
+            this.button_Main.FlatAppearance.BorderSize = 0;
257
+            this.button_Main.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
258
+            this.button_Main.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
259
+            this.button_Main.Image = global::DataRequest.Properties.Resources.menu_48px;
260
+            this.button_Main.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
261
+            this.button_Main.Location = new System.Drawing.Point(0, 100);
262
+            this.button_Main.Name = "button_Main";
263
+            this.button_Main.Size = new System.Drawing.Size(198, 54);
264
+            this.button_Main.TabIndex = 1;
265
+            this.button_Main.Text = "Main";
266
+            this.button_Main.UseVisualStyleBackColor = true;
267
+            this.button_Main.Click += new System.EventHandler(this.button_Main_Click);
268
+            // 
269
+            // pictureBox2
270
+            // 
271
+            this.pictureBox2.Anchor = System.Windows.Forms.AnchorStyles.None;
272
+            this.pictureBox2.Image = global::DataRequest.Properties.Resources.bluecell_logo;
273
+            this.pictureBox2.Location = new System.Drawing.Point(24, 29);
274
+            this.pictureBox2.Name = "pictureBox2";
275
+            this.pictureBox2.Size = new System.Drawing.Size(150, 42);
276
+            this.pictureBox2.TabIndex = 1;
277
+            this.pictureBox2.TabStop = false;
278
+            // 
279
+            // pictureBox3
280
+            // 
281
+            this.pictureBox3.Image = global::DataRequest.Properties.Resources.green_s;
282
+            this.pictureBox3.Location = new System.Drawing.Point(137, 498);
283
+            this.pictureBox3.Name = "pictureBox3";
284
+            this.pictureBox3.Size = new System.Drawing.Size(25, 20);
285
+            this.pictureBox3.TabIndex = 12;
286
+            this.pictureBox3.TabStop = false;
287
+            // 
288
+            // pictureBox5
289
+            // 
290
+            this.pictureBox5.Image = global::DataRequest.Properties.Resources.red_s;
291
+            this.pictureBox5.Location = new System.Drawing.Point(106, 498);
292
+            this.pictureBox5.Name = "pictureBox5";
293
+            this.pictureBox5.Size = new System.Drawing.Size(25, 20);
294
+            this.pictureBox5.TabIndex = 11;
295
+            this.pictureBox5.TabStop = false;
296
+            // 
297
+            // Main
298
+            // 
299
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
300
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
301
+            this.ClientSize = new System.Drawing.Size(1002, 541);
302
+            this.Controls.Add(this.panel2);
303
+            this.Controls.Add(this.panel1);
304
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
305
+            this.Name = "Main";
306
+            this.Text = "Form1";
307
+            this.Load += new System.EventHandler(this.Main_Load);
308
+            this.panel1.ResumeLayout(false);
309
+            this.panel4.ResumeLayout(false);
310
+            this.panel3.ResumeLayout(false);
311
+            this.panel2.ResumeLayout(false);
312
+            this.panel_ChildForm.ResumeLayout(false);
313
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
314
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
315
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox_Tx)).EndInit();
316
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
317
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
318
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
319
+            this.ResumeLayout(false);
320
+
321
+        }
322
+
323
+        #endregion
324
+
325
+        private System.Windows.Forms.Panel panel1;
326
+        private System.Windows.Forms.Panel panel2;
327
+        private System.Windows.Forms.Button button_Main;
328
+        private System.Windows.Forms.Panel panel3;
329
+        private System.Windows.Forms.Button button_Table;
330
+        private System.Windows.Forms.Button button_Console;
331
+        private System.Windows.Forms.Panel panel_ChildForm;
332
+        private System.Windows.Forms.PictureBox pictureBox1;
333
+        private System.Windows.Forms.Button button_Serial;
334
+        private System.Windows.Forms.Panel panel4;
335
+        private System.Windows.Forms.Button button_SerialConnect;
336
+        private System.Windows.Forms.ComboBox comboBox_Baudrate;
337
+        private System.Windows.Forms.ComboBox comboBox_Port;
338
+        private System.IO.Ports.SerialPort serialPort1;
339
+        private System.Windows.Forms.PictureBox pictureBox2;
340
+        private System.Windows.Forms.PictureBox pictureBox_Tx;
341
+        private System.Windows.Forms.Timer timer1;
342
+        private System.Windows.Forms.PictureBox pictureBox4;
343
+        private System.Windows.Forms.PictureBox pictureBox3;
344
+        private System.Windows.Forms.PictureBox pictureBox5;
345
+    }
346
+}
347
+

+ 131 - 0
DataRequest/Main.cs

@@ -0,0 +1,131 @@
1
+using DataRequest.Func;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace DataRequest
13
+{
14
+    public partial class Main : Form
15
+    {
16
+        public Form main_form = null;
17
+        public Serial serial = new Serial();
18
+        public Table table = null;
19
+        public SubMain subMain = null;
20
+        public int TimerIntervalCnt = 0;
21
+
22
+        private Form activeForm = null;
23
+        private Etc_Function etc_Function = new Etc_Function();
24
+        private byte[] protocol = null;
25
+        private int TimerInterVal = 0;
26
+
27
+        public Main()
28
+        {
29
+            InitializeComponent();
30
+        }
31
+
32
+
33
+        private void openChildForm(Form childForm)
34
+        {
35
+            if (activeForm != null)
36
+                activeForm.Close();
37
+
38
+            activeForm = childForm;
39
+            childForm.TopLevel = false;
40
+            childForm.FormBorderStyle = FormBorderStyle.None;
41
+            childForm.Dock = DockStyle.Fill;
42
+            panel_ChildForm.Controls.Add(childForm);
43
+            panel_ChildForm.Tag = childForm;
44
+            childForm.BringToFront();
45
+            childForm.Show();
46
+
47
+
48
+        }
49
+        
50
+        private void button_Table_Click(object sender, EventArgs e)
51
+        {
52
+            openChildForm(table = new Table());
53
+            table.main_form = this;
54
+        }
55
+
56
+        private void button_Main_Click(object sender, EventArgs e)
57
+        {
58
+            openChildForm(subMain = new SubMain());
59
+        }
60
+
61
+        private void Main_Load(object sender, EventArgs e)
62
+        {
63
+            serial.main_form = this;
64
+            serial.Serial_Initialize(ref comboBox_Port, comboBox_Baudrate.Text);
65
+        }
66
+
67
+        private void button_SerialConnect_Click(object sender, EventArgs e)
68
+        {
69
+            byte ret = 0;
70
+            ret = serial.Serial_PortOpen(ref button_SerialConnect,ref comboBox_Port, comboBox_Baudrate.Text);
71
+            if (ret == 0) {
72
+               // serial.Start();
73
+                timer1.Start();
74
+            }
75
+            else
76
+            {
77
+                timer1.Stop();
78
+            }
79
+
80
+            
81
+        }
82
+
83
+        public Debug debug = null;// new Debug();
84
+        private void button_Console_Click(object sender, EventArgs e)
85
+        {
86
+            // Debug debug = new Debug();
87
+            if (etc_Function.OverLap_Window_Find("Debug") == false)
88
+                return;
89
+            else
90
+            {
91
+                debug = new Debug();
92
+                debug.Show();
93
+            }
94
+       
95
+        }
96
+        /*
97
+         Interval 100ms Timer cnt
98
+             */
99
+        private void timer1_Tick(object sender, EventArgs e)
100
+        {
101
+            TimerIntervalCnt++;
102
+            if((TimerInterVal/ 100) <= TimerIntervalCnt)
103
+            {
104
+                if(protocol != null)
105
+                {
106
+                    serial.Serial_DataSend(protocol, protocol.Length);
107
+                }
108
+                TimerIntervalCnt = 0;
109
+            }
110
+
111
+        }
112
+        Serial_Config serial_Config = null;
113
+        private void button_Serial_Click(object sender, EventArgs e)
114
+        {
115
+            openChildForm(serial_Config = new Serial_Config());
116
+            serial_Config.main_form = this;
117
+        // serial_Config.Owner = this;
118
+    }
119
+
120
+        public void Protocol_DataSetting(byte[] data)
121
+        {
122
+            protocol = data;
123
+        }
124
+
125
+        public void Protocol_TimerIntervalSet(int setval)
126
+        {
127
+            TimerInterVal = setval;
128
+        }
129
+        
130
+    }
131
+}

+ 126 - 0
DataRequest/Main.resx

@@ -0,0 +1,126 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="serialPort1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
123
+  <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124
+    <value>127, 17</value>
125
+  </metadata>
126
+</root>

+ 1 - 1
DataRequest/Program.cs

@@ -16,7 +16,7 @@ namespace DataRequest
16 16
         {
17 17
             Application.EnableVisualStyles();
18 18
             Application.SetCompatibleTextRenderingDefault(false);
19
-            Application.Run(new Form1());
19
+            Application.Run(new Main());
20 20
         }
21 21
     }
22 22
 }

+ 150 - 28
DataRequest/Properties/Resources.Designer.cs

@@ -8,64 +8,186 @@
8 8
 // </auto-generated>
9 9
 //------------------------------------------------------------------------------
10 10
 
11
-namespace DataRequest.Properties
12
-{
13
-
14
-
11
+namespace DataRequest.Properties {
12
+    using System;
13
+    
14
+    
15 15
     /// <summary>
16 16
     ///   지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
17 17
     /// </summary>
18 18
     // 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
19 19
     // 클래스에서 자동으로 생성되었습니다.
20
-    // 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여
21
-    // ResGen을 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
22
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
20
+    // 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을
21
+    // 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
22
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 23
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 24
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25
-    internal class Resources
26
-    {
27
-
25
+    internal class Resources {
26
+        
28 27
         private static global::System.Resources.ResourceManager resourceMan;
29
-
28
+        
30 29
         private static global::System.Globalization.CultureInfo resourceCulture;
31
-
30
+        
32 31
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33
-        internal Resources()
34
-        {
32
+        internal Resources() {
35 33
         }
36
-
34
+        
37 35
         /// <summary>
38 36
         ///   이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
39 37
         /// </summary>
40 38
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41
-        internal static global::System.Resources.ResourceManager ResourceManager
42
-        {
43
-            get
44
-            {
45
-                if ((resourceMan == null))
46
-                {
39
+        internal static global::System.Resources.ResourceManager ResourceManager {
40
+            get {
41
+                if (object.ReferenceEquals(resourceMan, null)) {
47 42
                     global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataRequest.Properties.Resources", typeof(Resources).Assembly);
48 43
                     resourceMan = temp;
49 44
                 }
50 45
                 return resourceMan;
51 46
             }
52 47
         }
53
-
48
+        
54 49
         /// <summary>
55 50
         ///   이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
56 51
         ///   재정의합니다.
57 52
         /// </summary>
58 53
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59
-        internal static global::System.Globalization.CultureInfo Culture
60
-        {
61
-            get
62
-            {
54
+        internal static global::System.Globalization.CultureInfo Culture {
55
+            get {
63 56
                 return resourceCulture;
64 57
             }
65
-            set
66
-            {
58
+            set {
67 59
                 resourceCulture = value;
68 60
             }
69 61
         }
62
+        
63
+        /// <summary>
64
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
65
+        /// </summary>
66
+        internal static System.Drawing.Bitmap bluecell_logo {
67
+            get {
68
+                object obj = ResourceManager.GetObject("bluecell_logo", resourceCulture);
69
+                return ((System.Drawing.Bitmap)(obj));
70
+            }
71
+        }
72
+        
73
+        /// <summary>
74
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
75
+        /// </summary>
76
+        internal static System.Drawing.Bitmap connected_50px {
77
+            get {
78
+                object obj = ResourceManager.GetObject("connected_50px", resourceCulture);
79
+                return ((System.Drawing.Bitmap)(obj));
80
+            }
81
+        }
82
+        
83
+        /// <summary>
84
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
85
+        /// </summary>
86
+        internal static System.Drawing.Bitmap console_48px {
87
+            get {
88
+                object obj = ResourceManager.GetObject("console_48px", resourceCulture);
89
+                return ((System.Drawing.Bitmap)(obj));
90
+            }
91
+        }
92
+        
93
+        /// <summary>
94
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
95
+        /// </summary>
96
+        internal static System.Drawing.Bitmap green {
97
+            get {
98
+                object obj = ResourceManager.GetObject("green", resourceCulture);
99
+                return ((System.Drawing.Bitmap)(obj));
100
+            }
101
+        }
102
+        
103
+        /// <summary>
104
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
105
+        /// </summary>
106
+        internal static System.Drawing.Bitmap green_circle_48px {
107
+            get {
108
+                object obj = ResourceManager.GetObject("green_circle_48px", resourceCulture);
109
+                return ((System.Drawing.Bitmap)(obj));
110
+            }
111
+        }
112
+        
113
+        /// <summary>
114
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
115
+        /// </summary>
116
+        internal static System.Drawing.Bitmap green_s {
117
+            get {
118
+                object obj = ResourceManager.GetObject("green_s", resourceCulture);
119
+                return ((System.Drawing.Bitmap)(obj));
120
+            }
121
+        }
122
+        
123
+        /// <summary>
124
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
125
+        /// </summary>
126
+        internal static System.Drawing.Bitmap menu_48px {
127
+            get {
128
+                object obj = ResourceManager.GetObject("menu_48px", resourceCulture);
129
+                return ((System.Drawing.Bitmap)(obj));
130
+            }
131
+        }
132
+        
133
+        /// <summary>
134
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
135
+        /// </summary>
136
+        internal static System.Drawing.Bitmap menu_50px {
137
+            get {
138
+                object obj = ResourceManager.GetObject("menu_50px", resourceCulture);
139
+                return ((System.Drawing.Bitmap)(obj));
140
+            }
141
+        }
142
+        
143
+        /// <summary>
144
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
145
+        /// </summary>
146
+        internal static System.Drawing.Bitmap microsoft_excel_48px {
147
+            get {
148
+                object obj = ResourceManager.GetObject("microsoft_excel_48px", resourceCulture);
149
+                return ((System.Drawing.Bitmap)(obj));
150
+            }
151
+        }
152
+        
153
+        /// <summary>
154
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
155
+        /// </summary>
156
+        internal static System.Drawing.Bitmap red {
157
+            get {
158
+                object obj = ResourceManager.GetObject("red", resourceCulture);
159
+                return ((System.Drawing.Bitmap)(obj));
160
+            }
161
+        }
162
+        
163
+        /// <summary>
164
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
165
+        /// </summary>
166
+        internal static System.Drawing.Bitmap red_circle_48px {
167
+            get {
168
+                object obj = ResourceManager.GetObject("red_circle_48px", resourceCulture);
169
+                return ((System.Drawing.Bitmap)(obj));
170
+            }
171
+        }
172
+        
173
+        /// <summary>
174
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
175
+        /// </summary>
176
+        internal static System.Drawing.Bitmap red_s {
177
+            get {
178
+                object obj = ResourceManager.GetObject("red_s", resourceCulture);
179
+                return ((System.Drawing.Bitmap)(obj));
180
+            }
181
+        }
182
+        
183
+        /// <summary>
184
+        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
185
+        /// </summary>
186
+        internal static System.Drawing.Bitmap rs_232_female_40px {
187
+            get {
188
+                object obj = ResourceManager.GetObject("rs-232_female_40px", resourceCulture);
189
+                return ((System.Drawing.Bitmap)(obj));
190
+            }
191
+        }
70 192
     }
71 193
 }

+ 48 - 5
DataRequest/Properties/Resources.resx

@@ -46,7 +46,7 @@
46 46
     
47 47
     mimetype: application/x-microsoft.net.object.binary.base64
48 48
     value   : The object must be serialized with 
49
-            : System.Serialization.Formatters.Binary.BinaryFormatter
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50 50
             : and then encoded with base64 encoding.
51 51
     
52 52
     mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
60 60
             : and then encoded with base64 encoding.
61 61
     -->
62 62
   <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
63 64
     <xsd:element name="root" msdata:IsDataSet="true">
64 65
       <xsd:complexType>
65 66
         <xsd:choice maxOccurs="unbounded">
@@ -68,9 +69,10 @@
68 69
               <xsd:sequence>
69 70
                 <xsd:element name="value" type="xsd:string" minOccurs="0" />
70 71
               </xsd:sequence>
71
-              <xsd:attribute name="name" type="xsd:string" />
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
72 73
               <xsd:attribute name="type" type="xsd:string" />
73 74
               <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
74 76
             </xsd:complexType>
75 77
           </xsd:element>
76 78
           <xsd:element name="assembly">
@@ -85,9 +87,10 @@
85 87
                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86 88
                 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87 89
               </xsd:sequence>
88
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
89 91
               <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90 92
               <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
91 94
             </xsd:complexType>
92 95
           </xsd:element>
93 96
           <xsd:element name="resheader">
@@ -109,9 +112,49 @@
109 112
     <value>2.0</value>
110 113
   </resheader>
111 114
   <resheader name="reader">
112
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113 116
   </resheader>
114 117
   <resheader name="writer">
115
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116 119
   </resheader>
120
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
121
+  <data name="red" type="System.Resources.ResXFileRef, System.Windows.Forms">
122
+    <value>..\Resources\red.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
123
+  </data>
124
+  <data name="rs-232_female_40px" type="System.Resources.ResXFileRef, System.Windows.Forms">
125
+    <value>..\Resources\rs-232_female_40px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126
+  </data>
127
+  <data name="green" type="System.Resources.ResXFileRef, System.Windows.Forms">
128
+    <value>..\Resources\green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
129
+  </data>
130
+  <data name="menu_48px" type="System.Resources.ResXFileRef, System.Windows.Forms">
131
+    <value>..\Resources\menu_48px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
132
+  </data>
133
+  <data name="bluecell_logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
134
+    <value>..\Resources\bluecell_logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
135
+  </data>
136
+  <data name="console_48px" type="System.Resources.ResXFileRef, System.Windows.Forms">
137
+    <value>..\Resources\console_48px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
138
+  </data>
139
+  <data name="microsoft_excel_48px" type="System.Resources.ResXFileRef, System.Windows.Forms">
140
+    <value>..\Resources\microsoft_excel_48px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
141
+  </data>
142
+  <data name="connected_50px" type="System.Resources.ResXFileRef, System.Windows.Forms">
143
+    <value>..\Resources\connected_50px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
144
+  </data>
145
+  <data name="red_circle_48px" type="System.Resources.ResXFileRef, System.Windows.Forms">
146
+    <value>..\Resources\red_circle_48px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
147
+  </data>
148
+  <data name="menu_50px" type="System.Resources.ResXFileRef, System.Windows.Forms">
149
+    <value>..\Resources\menu_50px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
150
+  </data>
151
+  <data name="red_s" type="System.Resources.ResXFileRef, System.Windows.Forms">
152
+    <value>..\Resources\red_s.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
153
+  </data>
154
+  <data name="green_circle_48px" type="System.Resources.ResXFileRef, System.Windows.Forms">
155
+    <value>..\Resources\green_circle_48px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
156
+  </data>
157
+  <data name="green_s" type="System.Resources.ResXFileRef, System.Windows.Forms">
158
+    <value>..\Resources\green_s.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
159
+  </data>
117 160
 </root>

BIN
DataRequest/Resources/bluecell_logo.png


BIN
DataRequest/Resources/connected_50px.png


BIN
DataRequest/Resources/console_48px.png


BIN
DataRequest/Resources/green.png


BIN
DataRequest/Resources/green_circle_48px.png


BIN
DataRequest/Resources/green_s.png


BIN
DataRequest/Resources/menu_48px.png


BIN
DataRequest/Resources/menu_50px.png


BIN
DataRequest/Resources/microsoft_excel_48px.png


BIN
DataRequest/Resources/red.png


BIN
DataRequest/Resources/red_circle_48px.png


BIN
DataRequest/Resources/red_s.png


BIN
DataRequest/Resources/rs-232_female_40px.png


+ 305 - 0
DataRequest/Serial_Config.Designer.cs

@@ -0,0 +1,305 @@
1
+namespace DataRequest
2
+{
3
+    partial class Serial_Config
4
+    {
5
+        /// <summary>
6
+        /// Required designer variable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Clean up any resources being used.
12
+        /// </summary>
13
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows Form Designer generated code
24
+
25
+        /// <summary>
26
+        /// Required method for Designer support - do not modify
27
+        /// the contents of this method with the code editor.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
32
+            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
33
+            this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
34
+            this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
35
+            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
36
+            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
37
+            this.panel1 = new System.Windows.Forms.Panel();
38
+            this.button_Load = new System.Windows.Forms.Button();
39
+            this.button_Save = new System.Windows.Forms.Button();
40
+            this.button_ProtocolApply = new System.Windows.Forms.Button();
41
+            this.label2 = new System.Windows.Forms.Label();
42
+            this.label1 = new System.Windows.Forms.Label();
43
+            this.listView_ProtocolList = new System.Windows.Forms.ListView();
44
+            this.textBox_Protocol = new System.Windows.Forms.TextBox();
45
+            this.button_TimerApply = new System.Windows.Forms.Button();
46
+            this.numericUpDown_ProtocolList = new System.Windows.Forms.NumericUpDown();
47
+            this.numericUpDown_TimerCnt = new System.Windows.Forms.NumericUpDown();
48
+            this.button_ListViewRemove = new System.Windows.Forms.Button();
49
+            this.columnHeader_Index = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
50
+            this.columnHeader_Content = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
51
+            this.menuStrip1.SuspendLayout();
52
+            this.panel1.SuspendLayout();
53
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_ProtocolList)).BeginInit();
54
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_TimerCnt)).BeginInit();
55
+            this.SuspendLayout();
56
+            // 
57
+            // menuStrip1
58
+            // 
59
+            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
60
+            this.fileToolStripMenuItem});
61
+            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
62
+            this.menuStrip1.Name = "menuStrip1";
63
+            this.menuStrip1.Size = new System.Drawing.Size(784, 24);
64
+            this.menuStrip1.TabIndex = 1;
65
+            this.menuStrip1.Text = "menuStrip1";
66
+            // 
67
+            // fileToolStripMenuItem
68
+            // 
69
+            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
70
+            this.saveToolStripMenuItem,
71
+            this.loadToolStripMenuItem});
72
+            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
73
+            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
74
+            this.fileToolStripMenuItem.Text = "File";
75
+            // 
76
+            // saveToolStripMenuItem
77
+            // 
78
+            this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
79
+            this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
80
+            this.saveToolStripMenuItem.Text = "Save";
81
+            this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
82
+            // 
83
+            // loadToolStripMenuItem
84
+            // 
85
+            this.loadToolStripMenuItem.Name = "loadToolStripMenuItem";
86
+            this.loadToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
87
+            this.loadToolStripMenuItem.Text = "Load";
88
+            this.loadToolStripMenuItem.Click += new System.EventHandler(this.loadToolStripMenuItem_Click);
89
+            // 
90
+            // openFileDialog1
91
+            // 
92
+            this.openFileDialog1.FileName = "openFileDialog1";
93
+            // 
94
+            // panel1
95
+            // 
96
+            this.panel1.Controls.Add(this.button_ListViewRemove);
97
+            this.panel1.Controls.Add(this.numericUpDown_TimerCnt);
98
+            this.panel1.Controls.Add(this.numericUpDown_ProtocolList);
99
+            this.panel1.Controls.Add(this.button_TimerApply);
100
+            this.panel1.Controls.Add(this.button_Load);
101
+            this.panel1.Controls.Add(this.button_Save);
102
+            this.panel1.Controls.Add(this.button_ProtocolApply);
103
+            this.panel1.Controls.Add(this.label2);
104
+            this.panel1.Controls.Add(this.label1);
105
+            this.panel1.Controls.Add(this.listView_ProtocolList);
106
+            this.panel1.Controls.Add(this.textBox_Protocol);
107
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
108
+            this.panel1.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 8.999999F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
109
+            this.panel1.Location = new System.Drawing.Point(0, 24);
110
+            this.panel1.Name = "panel1";
111
+            this.panel1.Size = new System.Drawing.Size(784, 476);
112
+            this.panel1.TabIndex = 8;
113
+            // 
114
+            // button_Load
115
+            // 
116
+            this.button_Load.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
117
+            this.button_Load.Location = new System.Drawing.Point(675, 430);
118
+            this.button_Load.Name = "button_Load";
119
+            this.button_Load.Size = new System.Drawing.Size(75, 23);
120
+            this.button_Load.TabIndex = 15;
121
+            this.button_Load.Text = "Load";
122
+            this.button_Load.UseVisualStyleBackColor = true;
123
+            this.button_Load.Click += new System.EventHandler(this.button_Load_Click);
124
+            // 
125
+            // button_Save
126
+            // 
127
+            this.button_Save.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
128
+            this.button_Save.Location = new System.Drawing.Point(593, 430);
129
+            this.button_Save.Name = "button_Save";
130
+            this.button_Save.Size = new System.Drawing.Size(75, 23);
131
+            this.button_Save.TabIndex = 14;
132
+            this.button_Save.Text = "Save";
133
+            this.button_Save.UseVisualStyleBackColor = true;
134
+            this.button_Save.Click += new System.EventHandler(this.button_Save_Click);
135
+            // 
136
+            // button_ProtocolApply
137
+            // 
138
+            this.button_ProtocolApply.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
139
+            this.button_ProtocolApply.Location = new System.Drawing.Point(675, 97);
140
+            this.button_ProtocolApply.Name = "button_ProtocolApply";
141
+            this.button_ProtocolApply.Size = new System.Drawing.Size(75, 23);
142
+            this.button_ProtocolApply.TabIndex = 13;
143
+            this.button_ProtocolApply.Text = "Apply";
144
+            this.button_ProtocolApply.UseVisualStyleBackColor = true;
145
+            this.button_ProtocolApply.Click += new System.EventHandler(this.button_ProtocolApply_Click);
146
+            // 
147
+            // label2
148
+            // 
149
+            this.label2.AutoSize = true;
150
+            this.label2.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
151
+            this.label2.ForeColor = System.Drawing.Color.White;
152
+            this.label2.Location = new System.Drawing.Point(35, 10);
153
+            this.label2.Name = "label2";
154
+            this.label2.Size = new System.Drawing.Size(59, 21);
155
+            this.label2.TabIndex = 11;
156
+            this.label2.Text = "Timer";
157
+            // 
158
+            // label1
159
+            // 
160
+            this.label1.AutoSize = true;
161
+            this.label1.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
162
+            this.label1.ForeColor = System.Drawing.Color.White;
163
+            this.label1.Location = new System.Drawing.Point(35, 99);
164
+            this.label1.Name = "label1";
165
+            this.label1.Size = new System.Drawing.Size(85, 21);
166
+            this.label1.TabIndex = 12;
167
+            this.label1.Text = "Protocol";
168
+            // 
169
+            // listView_ProtocolList
170
+            // 
171
+            this.listView_ProtocolList.AllowColumnReorder = true;
172
+            this.listView_ProtocolList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(30)))), ((int)(((byte)(45)))));
173
+            this.listView_ProtocolList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
174
+            this.columnHeader_Index,
175
+            this.columnHeader_Content});
176
+            this.listView_ProtocolList.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
177
+            this.listView_ProtocolList.ForeColor = System.Drawing.Color.White;
178
+            this.listView_ProtocolList.GridLines = true;
179
+            this.listView_ProtocolList.HideSelection = false;
180
+            this.listView_ProtocolList.HoverSelection = true;
181
+            this.listView_ProtocolList.LabelEdit = true;
182
+            this.listView_ProtocolList.Location = new System.Drawing.Point(128, 128);
183
+            this.listView_ProtocolList.Name = "listView_ProtocolList";
184
+            this.listView_ProtocolList.Size = new System.Drawing.Size(541, 103);
185
+            this.listView_ProtocolList.TabIndex = 10;
186
+            this.listView_ProtocolList.UseCompatibleStateImageBehavior = false;
187
+            this.listView_ProtocolList.View = System.Windows.Forms.View.Details;
188
+            // 
189
+            // textBox_Protocol
190
+            // 
191
+            this.textBox_Protocol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(30)))), ((int)(((byte)(45)))));
192
+            this.textBox_Protocol.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
193
+            this.textBox_Protocol.ForeColor = System.Drawing.Color.White;
194
+            this.textBox_Protocol.Location = new System.Drawing.Point(128, 99);
195
+            this.textBox_Protocol.Name = "textBox_Protocol";
196
+            this.textBox_Protocol.Size = new System.Drawing.Size(541, 21);
197
+            this.textBox_Protocol.TabIndex = 9;
198
+            // 
199
+            // button_TimerApply
200
+            // 
201
+            this.button_TimerApply.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
202
+            this.button_TimerApply.Location = new System.Drawing.Point(215, 10);
203
+            this.button_TimerApply.Name = "button_TimerApply";
204
+            this.button_TimerApply.Size = new System.Drawing.Size(75, 23);
205
+            this.button_TimerApply.TabIndex = 16;
206
+            this.button_TimerApply.Text = "Apply";
207
+            this.button_TimerApply.UseVisualStyleBackColor = true;
208
+            this.button_TimerApply.Click += new System.EventHandler(this.button_TimerApply_Click);
209
+            // 
210
+            // numericUpDown_ProtocolList
211
+            // 
212
+            this.numericUpDown_ProtocolList.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
213
+            this.numericUpDown_ProtocolList.Location = new System.Drawing.Point(39, 128);
214
+            this.numericUpDown_ProtocolList.Name = "numericUpDown_ProtocolList";
215
+            this.numericUpDown_ProtocolList.Size = new System.Drawing.Size(81, 21);
216
+            this.numericUpDown_ProtocolList.TabIndex = 17;
217
+            // 
218
+            // numericUpDown_TimerCnt
219
+            // 
220
+            this.numericUpDown_TimerCnt.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
221
+            this.numericUpDown_TimerCnt.Increment = new decimal(new int[] {
222
+            100,
223
+            0,
224
+            0,
225
+            0});
226
+            this.numericUpDown_TimerCnt.Location = new System.Drawing.Point(128, 11);
227
+            this.numericUpDown_TimerCnt.Maximum = new decimal(new int[] {
228
+            10000,
229
+            0,
230
+            0,
231
+            0});
232
+            this.numericUpDown_TimerCnt.Name = "numericUpDown_TimerCnt";
233
+            this.numericUpDown_TimerCnt.Size = new System.Drawing.Size(81, 21);
234
+            this.numericUpDown_TimerCnt.TabIndex = 18;
235
+            this.numericUpDown_TimerCnt.Value = new decimal(new int[] {
236
+            1500,
237
+            0,
238
+            0,
239
+            0});
240
+            // 
241
+            // button_ListViewRemove
242
+            // 
243
+            this.button_ListViewRemove.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
244
+            this.button_ListViewRemove.Location = new System.Drawing.Point(675, 126);
245
+            this.button_ListViewRemove.Name = "button_ListViewRemove";
246
+            this.button_ListViewRemove.Size = new System.Drawing.Size(75, 23);
247
+            this.button_ListViewRemove.TabIndex = 19;
248
+            this.button_ListViewRemove.Text = "Delete";
249
+            this.button_ListViewRemove.UseVisualStyleBackColor = true;
250
+            this.button_ListViewRemove.Click += new System.EventHandler(this.button_ListViewRemove_Click);
251
+            // 
252
+            // columnHeader_Index
253
+            // 
254
+            this.columnHeader_Index.Text = "Index";
255
+            // 
256
+            // columnHeader_Content
257
+            // 
258
+            this.columnHeader_Content.Text = "Protocol";
259
+            // 
260
+            // Serial_Config
261
+            // 
262
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
263
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
264
+            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(30)))), ((int)(((byte)(45)))));
265
+            this.ClientSize = new System.Drawing.Size(784, 500);
266
+            this.Controls.Add(this.panel1);
267
+            this.Controls.Add(this.menuStrip1);
268
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
269
+            this.MainMenuStrip = this.menuStrip1;
270
+            this.Name = "Serial_Config";
271
+            this.Text = "Serial_Config";
272
+            this.menuStrip1.ResumeLayout(false);
273
+            this.menuStrip1.PerformLayout();
274
+            this.panel1.ResumeLayout(false);
275
+            this.panel1.PerformLayout();
276
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_ProtocolList)).EndInit();
277
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_TimerCnt)).EndInit();
278
+            this.ResumeLayout(false);
279
+            this.PerformLayout();
280
+
281
+        }
282
+
283
+        #endregion
284
+        private System.Windows.Forms.MenuStrip menuStrip1;
285
+        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
286
+        private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
287
+        private System.Windows.Forms.ToolStripMenuItem loadToolStripMenuItem;
288
+        private System.Windows.Forms.OpenFileDialog openFileDialog1;
289
+        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
290
+        private System.Windows.Forms.Panel panel1;
291
+        private System.Windows.Forms.Button button_Load;
292
+        private System.Windows.Forms.Button button_Save;
293
+        private System.Windows.Forms.Button button_ProtocolApply;
294
+        private System.Windows.Forms.Label label2;
295
+        private System.Windows.Forms.Label label1;
296
+        private System.Windows.Forms.ListView listView_ProtocolList;
297
+        private System.Windows.Forms.TextBox textBox_Protocol;
298
+        private System.Windows.Forms.Button button_TimerApply;
299
+        private System.Windows.Forms.NumericUpDown numericUpDown_ProtocolList;
300
+        private System.Windows.Forms.NumericUpDown numericUpDown_TimerCnt;
301
+        private System.Windows.Forms.Button button_ListViewRemove;
302
+        private System.Windows.Forms.ColumnHeader columnHeader_Index;
303
+        private System.Windows.Forms.ColumnHeader columnHeader_Content;
304
+    }
305
+}

+ 73 - 0
DataRequest/Serial_Config.cs

@@ -0,0 +1,73 @@
1
+using DataRequest.Func;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+
12
+namespace DataRequest
13
+{
14
+    public partial class Serial_Config : Form
15
+    {
16
+        Etc_Function etc_Function = new Etc_Function();
17
+        public Form main_form;
18
+        public Serial_Config()
19
+        {
20
+            InitializeComponent();
21
+        }
22
+
23
+        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
24
+        {
25
+            saveFileDialog1.OpenFile();
26
+
27
+        }
28
+
29
+        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
30
+        {
31
+            openFileDialog1.OpenFile();
32
+        }
33
+        
34
+        private void button_ProtocolApply_Click(object sender, EventArgs e)
35
+        {
36
+            string[] retstr = null;
37
+            byte[] protocol;
38
+            List<string> arr = new List<string>();
39
+
40
+            arr.Add(listView_ProtocolList.Items.Count.ToString());
41
+            arr.Add(textBox_Protocol.Text);
42
+
43
+            retstr = etc_Function.ProtocolSplit(textBox_Protocol.Text);
44
+            protocol = etc_Function.StrToConvertByteArray(retstr);
45
+           
46
+            ((Main)this.main_form).Protocol_DataSetting(protocol);
47
+
48
+
49
+            ListViewItem lvi = new ListViewItem(arr.ToArray());
50
+            listView_ProtocolList.Items.Add(lvi);
51
+        }
52
+
53
+        private void button_TimerApply_Click(object sender, EventArgs e)
54
+        {
55
+            ((Main)this.main_form).Protocol_TimerIntervalSet((int)numericUpDown_TimerCnt.Value);
56
+        }
57
+
58
+        private void button_Load_Click(object sender, EventArgs e)
59
+        {
60
+
61
+        }
62
+
63
+        private void button_Save_Click(object sender, EventArgs e)
64
+        {
65
+
66
+        }
67
+
68
+        private void button_ListViewRemove_Click(object sender, EventArgs e)
69
+        {
70
+
71
+        }
72
+    }
73
+}

+ 129 - 0
DataRequest/Serial_Config.resx

@@ -0,0 +1,129 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
123
+  <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124
+    <value>133, 17</value>
125
+  </metadata>
126
+  <metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127
+    <value>275, 17</value>
128
+  </metadata>
129
+</root>

+ 263 - 0
DataRequest/SubMain.Designer.cs

@@ -0,0 +1,263 @@
1
+namespace DataRequest
2
+{
3
+    partial class SubMain
4
+    {
5
+        /// <summary>
6
+        /// Required designer variable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Clean up any resources being used.
12
+        /// </summary>
13
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows Form Designer generated code
24
+
25
+        /// <summary>
26
+        /// Required method for Designer support - do not modify
27
+        /// the contents of this method with the code editor.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.panel1 = new System.Windows.Forms.Panel();
32
+            this.pictureBox3 = new System.Windows.Forms.PictureBox();
33
+            this.pictureBox5 = new System.Windows.Forms.PictureBox();
34
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
35
+            this.pictureBox2 = new System.Windows.Forms.PictureBox();
36
+            this.pictureBox8 = new System.Windows.Forms.PictureBox();
37
+            this.pictureBox9 = new System.Windows.Forms.PictureBox();
38
+            this.textBox_Adc_Value = new System.Windows.Forms.TextBox();
39
+            this.textBox2 = new System.Windows.Forms.TextBox();
40
+            this.panel2 = new System.Windows.Forms.Panel();
41
+            this.pictureBox4 = new System.Windows.Forms.PictureBox();
42
+            this.pictureBox6 = new System.Windows.Forms.PictureBox();
43
+            this.pictureBox7 = new System.Windows.Forms.PictureBox();
44
+            this.pictureBox10 = new System.Windows.Forms.PictureBox();
45
+            this.pictureBox11 = new System.Windows.Forms.PictureBox();
46
+            this.pictureBox12 = new System.Windows.Forms.PictureBox();
47
+            this.panel1.SuspendLayout();
48
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
49
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
50
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
51
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
52
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).BeginInit();
53
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit();
54
+            this.panel2.SuspendLayout();
55
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
56
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
57
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
58
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).BeginInit();
59
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).BeginInit();
60
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).BeginInit();
61
+            this.SuspendLayout();
62
+            // 
63
+            // panel1
64
+            // 
65
+            this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(30)))), ((int)(((byte)(45)))));
66
+            this.panel1.Controls.Add(this.panel2);
67
+            this.panel1.Controls.Add(this.textBox2);
68
+            this.panel1.Controls.Add(this.textBox_Adc_Value);
69
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
70
+            this.panel1.Location = new System.Drawing.Point(0, 0);
71
+            this.panel1.Name = "panel1";
72
+            this.panel1.Size = new System.Drawing.Size(768, 461);
73
+            this.panel1.TabIndex = 0;
74
+            // 
75
+            // pictureBox3
76
+            // 
77
+            this.pictureBox3.Image = global::DataRequest.Properties.Resources.green_s;
78
+            this.pictureBox3.Location = new System.Drawing.Point(69, 38);
79
+            this.pictureBox3.Name = "pictureBox3";
80
+            this.pictureBox3.Size = new System.Drawing.Size(25, 20);
81
+            this.pictureBox3.TabIndex = 16;
82
+            this.pictureBox3.TabStop = false;
83
+            // 
84
+            // pictureBox5
85
+            // 
86
+            this.pictureBox5.Image = global::DataRequest.Properties.Resources.red_s;
87
+            this.pictureBox5.Location = new System.Drawing.Point(38, 38);
88
+            this.pictureBox5.Name = "pictureBox5";
89
+            this.pictureBox5.Size = new System.Drawing.Size(25, 20);
90
+            this.pictureBox5.TabIndex = 15;
91
+            this.pictureBox5.TabStop = false;
92
+            // 
93
+            // pictureBox1
94
+            // 
95
+            this.pictureBox1.Image = global::DataRequest.Properties.Resources.green_s;
96
+            this.pictureBox1.Location = new System.Drawing.Point(69, 64);
97
+            this.pictureBox1.Name = "pictureBox1";
98
+            this.pictureBox1.Size = new System.Drawing.Size(25, 20);
99
+            this.pictureBox1.TabIndex = 20;
100
+            this.pictureBox1.TabStop = false;
101
+            // 
102
+            // pictureBox2
103
+            // 
104
+            this.pictureBox2.Image = global::DataRequest.Properties.Resources.red_s;
105
+            this.pictureBox2.Location = new System.Drawing.Point(38, 64);
106
+            this.pictureBox2.Name = "pictureBox2";
107
+            this.pictureBox2.Size = new System.Drawing.Size(25, 20);
108
+            this.pictureBox2.TabIndex = 19;
109
+            this.pictureBox2.TabStop = false;
110
+            // 
111
+            // pictureBox8
112
+            // 
113
+            this.pictureBox8.Image = global::DataRequest.Properties.Resources.green_s;
114
+            this.pictureBox8.Location = new System.Drawing.Point(69, 12);
115
+            this.pictureBox8.Name = "pictureBox8";
116
+            this.pictureBox8.Size = new System.Drawing.Size(25, 20);
117
+            this.pictureBox8.TabIndex = 24;
118
+            this.pictureBox8.TabStop = false;
119
+            // 
120
+            // pictureBox9
121
+            // 
122
+            this.pictureBox9.Image = global::DataRequest.Properties.Resources.red_s;
123
+            this.pictureBox9.Location = new System.Drawing.Point(38, 12);
124
+            this.pictureBox9.Name = "pictureBox9";
125
+            this.pictureBox9.Size = new System.Drawing.Size(25, 20);
126
+            this.pictureBox9.TabIndex = 23;
127
+            this.pictureBox9.TabStop = false;
128
+            // 
129
+            // textBox_Adc_Value
130
+            // 
131
+            this.textBox_Adc_Value.Location = new System.Drawing.Point(138, 141);
132
+            this.textBox_Adc_Value.Name = "textBox_Adc_Value";
133
+            this.textBox_Adc_Value.Size = new System.Drawing.Size(100, 21);
134
+            this.textBox_Adc_Value.TabIndex = 25;
135
+            // 
136
+            // textBox2
137
+            // 
138
+            this.textBox2.Location = new System.Drawing.Point(244, 141);
139
+            this.textBox2.Name = "textBox2";
140
+            this.textBox2.Size = new System.Drawing.Size(100, 21);
141
+            this.textBox2.TabIndex = 26;
142
+            // 
143
+            // panel2
144
+            // 
145
+            this.panel2.Controls.Add(this.pictureBox12);
146
+            this.panel2.Controls.Add(this.pictureBox11);
147
+            this.panel2.Controls.Add(this.pictureBox9);
148
+            this.panel2.Controls.Add(this.pictureBox10);
149
+            this.panel2.Controls.Add(this.pictureBox5);
150
+            this.panel2.Controls.Add(this.pictureBox7);
151
+            this.panel2.Controls.Add(this.pictureBox3);
152
+            this.panel2.Controls.Add(this.pictureBox6);
153
+            this.panel2.Controls.Add(this.pictureBox8);
154
+            this.panel2.Controls.Add(this.pictureBox4);
155
+            this.panel2.Controls.Add(this.pictureBox2);
156
+            this.panel2.Controls.Add(this.pictureBox1);
157
+            this.panel2.Location = new System.Drawing.Point(419, 129);
158
+            this.panel2.Name = "panel2";
159
+            this.panel2.Size = new System.Drawing.Size(134, 181);
160
+            this.panel2.TabIndex = 27;
161
+            // 
162
+            // pictureBox4
163
+            // 
164
+            this.pictureBox4.Image = global::DataRequest.Properties.Resources.green_s;
165
+            this.pictureBox4.Location = new System.Drawing.Point(69, 142);
166
+            this.pictureBox4.Name = "pictureBox4";
167
+            this.pictureBox4.Size = new System.Drawing.Size(25, 20);
168
+            this.pictureBox4.TabIndex = 20;
169
+            this.pictureBox4.TabStop = false;
170
+            // 
171
+            // pictureBox6
172
+            // 
173
+            this.pictureBox6.Image = global::DataRequest.Properties.Resources.red_s;
174
+            this.pictureBox6.Location = new System.Drawing.Point(38, 142);
175
+            this.pictureBox6.Name = "pictureBox6";
176
+            this.pictureBox6.Size = new System.Drawing.Size(25, 20);
177
+            this.pictureBox6.TabIndex = 19;
178
+            this.pictureBox6.TabStop = false;
179
+            // 
180
+            // pictureBox7
181
+            // 
182
+            this.pictureBox7.Image = global::DataRequest.Properties.Resources.green_s;
183
+            this.pictureBox7.Location = new System.Drawing.Point(69, 90);
184
+            this.pictureBox7.Name = "pictureBox7";
185
+            this.pictureBox7.Size = new System.Drawing.Size(25, 20);
186
+            this.pictureBox7.TabIndex = 24;
187
+            this.pictureBox7.TabStop = false;
188
+            // 
189
+            // pictureBox10
190
+            // 
191
+            this.pictureBox10.Image = global::DataRequest.Properties.Resources.green_s;
192
+            this.pictureBox10.Location = new System.Drawing.Point(69, 116);
193
+            this.pictureBox10.Name = "pictureBox10";
194
+            this.pictureBox10.Size = new System.Drawing.Size(25, 20);
195
+            this.pictureBox10.TabIndex = 16;
196
+            this.pictureBox10.TabStop = false;
197
+            // 
198
+            // pictureBox11
199
+            // 
200
+            this.pictureBox11.Image = global::DataRequest.Properties.Resources.red_s;
201
+            this.pictureBox11.Location = new System.Drawing.Point(38, 116);
202
+            this.pictureBox11.Name = "pictureBox11";
203
+            this.pictureBox11.Size = new System.Drawing.Size(25, 20);
204
+            this.pictureBox11.TabIndex = 15;
205
+            this.pictureBox11.TabStop = false;
206
+            // 
207
+            // pictureBox12
208
+            // 
209
+            this.pictureBox12.Image = global::DataRequest.Properties.Resources.red_s;
210
+            this.pictureBox12.Location = new System.Drawing.Point(38, 90);
211
+            this.pictureBox12.Name = "pictureBox12";
212
+            this.pictureBox12.Size = new System.Drawing.Size(25, 20);
213
+            this.pictureBox12.TabIndex = 23;
214
+            this.pictureBox12.TabStop = false;
215
+            // 
216
+            // SubMain
217
+            // 
218
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
219
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
220
+            this.ClientSize = new System.Drawing.Size(768, 461);
221
+            this.Controls.Add(this.panel1);
222
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
223
+            this.Name = "SubMain";
224
+            this.Text = "SubMain";
225
+            this.panel1.ResumeLayout(false);
226
+            this.panel1.PerformLayout();
227
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
228
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
229
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
230
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
231
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).EndInit();
232
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit();
233
+            this.panel2.ResumeLayout(false);
234
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
235
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit();
236
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit();
237
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).EndInit();
238
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).EndInit();
239
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).EndInit();
240
+            this.ResumeLayout(false);
241
+
242
+        }
243
+
244
+        #endregion
245
+
246
+        private System.Windows.Forms.Panel panel1;
247
+        private System.Windows.Forms.PictureBox pictureBox8;
248
+        private System.Windows.Forms.PictureBox pictureBox9;
249
+        private System.Windows.Forms.PictureBox pictureBox1;
250
+        private System.Windows.Forms.PictureBox pictureBox2;
251
+        private System.Windows.Forms.PictureBox pictureBox3;
252
+        private System.Windows.Forms.PictureBox pictureBox5;
253
+        private System.Windows.Forms.TextBox textBox2;
254
+        private System.Windows.Forms.TextBox textBox_Adc_Value;
255
+        private System.Windows.Forms.Panel panel2;
256
+        private System.Windows.Forms.PictureBox pictureBox12;
257
+        private System.Windows.Forms.PictureBox pictureBox11;
258
+        private System.Windows.Forms.PictureBox pictureBox10;
259
+        private System.Windows.Forms.PictureBox pictureBox7;
260
+        private System.Windows.Forms.PictureBox pictureBox6;
261
+        private System.Windows.Forms.PictureBox pictureBox4;
262
+    }
263
+}

+ 32 - 0
DataRequest/SubMain.cs

@@ -0,0 +1,32 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.ComponentModel;
4
+using System.Data;
5
+using System.Drawing;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+using System.Windows.Forms;
10
+
11
+namespace DataRequest
12
+{
13
+    public partial class SubMain : Form
14
+    {
15
+        public SubMain()
16
+        {
17
+            InitializeComponent();
18
+        }
19
+        private delegate void StringSend(object label, String str);
20
+        private void TextBox_Text_Set(object label, String str)
21
+        {
22
+            TextBox Temp_label = (TextBox)label;
23
+            Temp_label.Text = str;
24
+        }
25
+        public void NessLab_Adc_Value_Set(object data)
26
+        {
27
+            double adc_value = Convert.ToDouble(data);
28
+            adc_value *= 0.001;
29
+            this.Invoke(new StringSend(TextBox_Text_Set), textBox_Adc_Value, adc_value.ToString());
30
+        }
31
+    }
32
+}

+ 120 - 0
DataRequest/SubMain.resx

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 468 - 0
DataRequest/Table.Designer.cs

@@ -0,0 +1,468 @@
1
+namespace DataRequest
2
+{
3
+    partial class Table
4
+    {
5
+        /// <summary>
6
+        /// Required designer variable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Clean up any resources being used.
12
+        /// </summary>
13
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows Form Designer generated code
24
+
25
+        /// <summary>
26
+        /// Required method for Designer support - do not modify
27
+        /// the contents of this method with the code editor.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
32
+            System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
33
+            System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
34
+            this.dataGridView_TableSetting = new System.Windows.Forms.DataGridView();
35
+            this.button_Dev_Load = new System.Windows.Forms.Button();
36
+            this.button_Dev_Save = new System.Windows.Forms.Button();
37
+            this.button_ExcelSave = new System.Windows.Forms.Button();
38
+            this.button_ExcelLoad = new System.Windows.Forms.Button();
39
+            this.panel1 = new System.Windows.Forms.Panel();
40
+            this.panel2 = new System.Windows.Forms.Panel();
41
+            this.button_Set = new System.Windows.Forms.Button();
42
+            this.textBox1 = new System.Windows.Forms.TextBox();
43
+            this.chart_Table = new System.Windows.Forms.DataVisualization.Charting.Chart();
44
+            this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
45
+            this.numericUpDown_TableLength = new System.Windows.Forms.NumericUpDown();
46
+            this.label1 = new System.Windows.Forms.Label();
47
+            this.button_LengthApply = new System.Windows.Forms.Button();
48
+            this.Column_DB = new System.Windows.Forms.DataGridViewTextBoxColumn();
49
+            this.Column_Offset = new System.Windows.Forms.DataGridViewTextBoxColumn();
50
+            this.label31 = new System.Windows.Forms.Label();
51
+            this.label30 = new System.Windows.Forms.Label();
52
+            this.label29 = new System.Windows.Forms.Label();
53
+            this.numericUpDown_CurrentOutput = new System.Windows.Forms.NumericUpDown();
54
+            this.numericUpDown_MultiOffset = new System.Windows.Forms.NumericUpDown();
55
+            this.numericUpDown_MultiSet = new System.Windows.Forms.NumericUpDown();
56
+            this.button_CurrentOutput = new System.Windows.Forms.Button();
57
+            this.button_MultiSet = new System.Windows.Forms.Button();
58
+            this.button_MultiOffset = new System.Windows.Forms.Button();
59
+            this.button_Initialize = new System.Windows.Forms.Button();
60
+            this.button_Expansion = new System.Windows.Forms.Button();
61
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_TableSetting)).BeginInit();
62
+            this.panel1.SuspendLayout();
63
+            this.panel2.SuspendLayout();
64
+            ((System.ComponentModel.ISupportInitialize)(this.chart_Table)).BeginInit();
65
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_TableLength)).BeginInit();
66
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_CurrentOutput)).BeginInit();
67
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_MultiOffset)).BeginInit();
68
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_MultiSet)).BeginInit();
69
+            this.SuspendLayout();
70
+            // 
71
+            // dataGridView_TableSetting
72
+            // 
73
+            this.dataGridView_TableSetting.AllowUserToAddRows = false;
74
+            this.dataGridView_TableSetting.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
75
+            this.dataGridView_TableSetting.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
76
+            this.Column_DB,
77
+            this.Column_Offset});
78
+            this.dataGridView_TableSetting.Dock = System.Windows.Forms.DockStyle.Fill;
79
+            this.dataGridView_TableSetting.Location = new System.Drawing.Point(0, 0);
80
+            this.dataGridView_TableSetting.Name = "dataGridView_TableSetting";
81
+            this.dataGridView_TableSetting.RowTemplate.Height = 23;
82
+            this.dataGridView_TableSetting.Size = new System.Drawing.Size(269, 500);
83
+            this.dataGridView_TableSetting.TabIndex = 0;
84
+            // 
85
+            // button_Dev_Load
86
+            // 
87
+            this.button_Dev_Load.Dock = System.Windows.Forms.DockStyle.Top;
88
+            this.button_Dev_Load.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
89
+            this.button_Dev_Load.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
90
+            this.button_Dev_Load.ForeColor = System.Drawing.Color.White;
91
+            this.button_Dev_Load.Location = new System.Drawing.Point(0, 88);
92
+            this.button_Dev_Load.Name = "button_Dev_Load";
93
+            this.button_Dev_Load.Size = new System.Drawing.Size(164, 44);
94
+            this.button_Dev_Load.TabIndex = 2;
95
+            this.button_Dev_Load.Text = "Load";
96
+            this.button_Dev_Load.UseVisualStyleBackColor = true;
97
+            this.button_Dev_Load.Click += new System.EventHandler(this.button_Dev_Load_Click);
98
+            // 
99
+            // button_Dev_Save
100
+            // 
101
+            this.button_Dev_Save.Dock = System.Windows.Forms.DockStyle.Top;
102
+            this.button_Dev_Save.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
103
+            this.button_Dev_Save.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
104
+            this.button_Dev_Save.ForeColor = System.Drawing.Color.White;
105
+            this.button_Dev_Save.Location = new System.Drawing.Point(0, 132);
106
+            this.button_Dev_Save.Name = "button_Dev_Save";
107
+            this.button_Dev_Save.Size = new System.Drawing.Size(164, 44);
108
+            this.button_Dev_Save.TabIndex = 3;
109
+            this.button_Dev_Save.Text = "Save";
110
+            this.button_Dev_Save.UseVisualStyleBackColor = true;
111
+            this.button_Dev_Save.Click += new System.EventHandler(this.button_Dev_Save_Click);
112
+            // 
113
+            // button_ExcelSave
114
+            // 
115
+            this.button_ExcelSave.Dock = System.Windows.Forms.DockStyle.Top;
116
+            this.button_ExcelSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
117
+            this.button_ExcelSave.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
118
+            this.button_ExcelSave.ForeColor = System.Drawing.Color.White;
119
+            this.button_ExcelSave.Location = new System.Drawing.Point(0, 44);
120
+            this.button_ExcelSave.Name = "button_ExcelSave";
121
+            this.button_ExcelSave.Size = new System.Drawing.Size(164, 44);
122
+            this.button_ExcelSave.TabIndex = 6;
123
+            this.button_ExcelSave.Text = "Excel Save";
124
+            this.button_ExcelSave.UseVisualStyleBackColor = true;
125
+            this.button_ExcelSave.Click += new System.EventHandler(this.button_ExcelSave_Click);
126
+            // 
127
+            // button_ExcelLoad
128
+            // 
129
+            this.button_ExcelLoad.Dock = System.Windows.Forms.DockStyle.Top;
130
+            this.button_ExcelLoad.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
131
+            this.button_ExcelLoad.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
132
+            this.button_ExcelLoad.ForeColor = System.Drawing.Color.White;
133
+            this.button_ExcelLoad.Location = new System.Drawing.Point(0, 0);
134
+            this.button_ExcelLoad.Name = "button_ExcelLoad";
135
+            this.button_ExcelLoad.Size = new System.Drawing.Size(164, 44);
136
+            this.button_ExcelLoad.TabIndex = 5;
137
+            this.button_ExcelLoad.Text = "Excel Load";
138
+            this.button_ExcelLoad.UseVisualStyleBackColor = true;
139
+            this.button_ExcelLoad.Click += new System.EventHandler(this.button_ExcelLoad_Click);
140
+            // 
141
+            // panel1
142
+            // 
143
+            this.panel1.Controls.Add(this.dataGridView_TableSetting);
144
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
145
+            this.panel1.Location = new System.Drawing.Point(0, 0);
146
+            this.panel1.Name = "panel1";
147
+            this.panel1.Size = new System.Drawing.Size(269, 500);
148
+            this.panel1.TabIndex = 7;
149
+            // 
150
+            // panel2
151
+            // 
152
+            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
153
+            this.panel2.Controls.Add(this.button_Expansion);
154
+            this.panel2.Controls.Add(this.button_Initialize);
155
+            this.panel2.Controls.Add(this.textBox1);
156
+            this.panel2.Controls.Add(this.button_Set);
157
+            this.panel2.Controls.Add(this.button_Dev_Save);
158
+            this.panel2.Controls.Add(this.button_Dev_Load);
159
+            this.panel2.Controls.Add(this.button_ExcelSave);
160
+            this.panel2.Controls.Add(this.button_ExcelLoad);
161
+            this.panel2.Dock = System.Windows.Forms.DockStyle.Right;
162
+            this.panel2.Location = new System.Drawing.Point(618, 0);
163
+            this.panel2.Name = "panel2";
164
+            this.panel2.Size = new System.Drawing.Size(166, 500);
165
+            this.panel2.TabIndex = 8;
166
+            // 
167
+            // button_Set
168
+            // 
169
+            this.button_Set.Dock = System.Windows.Forms.DockStyle.Top;
170
+            this.button_Set.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
171
+            this.button_Set.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
172
+            this.button_Set.ForeColor = System.Drawing.Color.White;
173
+            this.button_Set.Location = new System.Drawing.Point(0, 176);
174
+            this.button_Set.Name = "button_Set";
175
+            this.button_Set.Size = new System.Drawing.Size(164, 44);
176
+            this.button_Set.TabIndex = 7;
177
+            this.button_Set.Text = "Set";
178
+            this.button_Set.UseVisualStyleBackColor = true;
179
+            this.button_Set.Click += new System.EventHandler(this.button_Set_Click);
180
+            // 
181
+            // textBox1
182
+            // 
183
+            this.textBox1.Dock = System.Windows.Forms.DockStyle.Top;
184
+            this.textBox1.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 15F);
185
+            this.textBox1.Location = new System.Drawing.Point(0, 220);
186
+            this.textBox1.Multiline = true;
187
+            this.textBox1.Name = "textBox1";
188
+            this.textBox1.Size = new System.Drawing.Size(164, 44);
189
+            this.textBox1.TabIndex = 8;
190
+            this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
191
+            // 
192
+            // chart_Table
193
+            // 
194
+            chartArea4.Name = "ChartArea1";
195
+            this.chart_Table.ChartAreas.Add(chartArea4);
196
+            legend4.Name = "Legend1";
197
+            this.chart_Table.Legends.Add(legend4);
198
+            this.chart_Table.Location = new System.Drawing.Point(275, 320);
199
+            this.chart_Table.Name = "chart_Table";
200
+            series4.ChartArea = "ChartArea1";
201
+            series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
202
+            series4.Legend = "Legend1";
203
+            series4.Name = "Series1";
204
+            this.chart_Table.Series.Add(series4);
205
+            this.chart_Table.Size = new System.Drawing.Size(338, 168);
206
+            this.chart_Table.TabIndex = 160;
207
+            this.chart_Table.Text = "chart1";
208
+            // 
209
+            // numericUpDown_TableLength
210
+            // 
211
+            this.numericUpDown_TableLength.Location = new System.Drawing.Point(370, 1);
212
+            this.numericUpDown_TableLength.Name = "numericUpDown_TableLength";
213
+            this.numericUpDown_TableLength.Size = new System.Drawing.Size(120, 21);
214
+            this.numericUpDown_TableLength.TabIndex = 161;
215
+            // 
216
+            // label1
217
+            // 
218
+            this.label1.AutoSize = true;
219
+            this.label1.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
220
+            this.label1.ForeColor = System.Drawing.Color.White;
221
+            this.label1.Location = new System.Drawing.Point(275, 5);
222
+            this.label1.Name = "label1";
223
+            this.label1.Size = new System.Drawing.Size(45, 14);
224
+            this.label1.TabIndex = 162;
225
+            this.label1.Text = "Length";
226
+            // 
227
+            // button_LengthApply
228
+            // 
229
+            this.button_LengthApply.Location = new System.Drawing.Point(507, 1);
230
+            this.button_LengthApply.Name = "button_LengthApply";
231
+            this.button_LengthApply.Size = new System.Drawing.Size(75, 23);
232
+            this.button_LengthApply.TabIndex = 163;
233
+            this.button_LengthApply.Text = "Apply";
234
+            this.button_LengthApply.UseVisualStyleBackColor = true;
235
+            this.button_LengthApply.Click += new System.EventHandler(this.button_LengthApply_Click);
236
+            // 
237
+            // Column_DB
238
+            // 
239
+            this.Column_DB.HeaderText = "DB";
240
+            this.Column_DB.Name = "Column_DB";
241
+            // 
242
+            // Column_Offset
243
+            // 
244
+            this.Column_Offset.HeaderText = "Offset";
245
+            this.Column_Offset.Name = "Column_Offset";
246
+            // 
247
+            // label31
248
+            // 
249
+            this.label31.AutoSize = true;
250
+            this.label31.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
251
+            this.label31.ForeColor = System.Drawing.Color.White;
252
+            this.label31.Location = new System.Drawing.Point(274, 97);
253
+            this.label31.Name = "label31";
254
+            this.label31.Size = new System.Drawing.Size(89, 14);
255
+            this.label31.TabIndex = 170;
256
+            this.label31.Text = "Current Output";
257
+            // 
258
+            // label30
259
+            // 
260
+            this.label30.AutoSize = true;
261
+            this.label30.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
262
+            this.label30.ForeColor = System.Drawing.Color.White;
263
+            this.label30.Location = new System.Drawing.Point(275, 64);
264
+            this.label30.Name = "label30";
265
+            this.label30.Size = new System.Drawing.Size(72, 14);
266
+            this.label30.TabIndex = 171;
267
+            this.label30.Text = "Multi Offset";
268
+            // 
269
+            // label29
270
+            // 
271
+            this.label29.AutoSize = true;
272
+            this.label29.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
273
+            this.label29.ForeColor = System.Drawing.Color.White;
274
+            this.label29.Location = new System.Drawing.Point(275, 34);
275
+            this.label29.Name = "label29";
276
+            this.label29.Size = new System.Drawing.Size(57, 14);
277
+            this.label29.TabIndex = 172;
278
+            this.label29.Text = "Multi Set";
279
+            // 
280
+            // numericUpDown_CurrentOutput
281
+            // 
282
+            this.numericUpDown_CurrentOutput.DecimalPlaces = 3;
283
+            this.numericUpDown_CurrentOutput.Increment = new decimal(new int[] {
284
+            1,
285
+            0,
286
+            0,
287
+            131072});
288
+            this.numericUpDown_CurrentOutput.Location = new System.Drawing.Point(370, 92);
289
+            this.numericUpDown_CurrentOutput.Maximum = new decimal(new int[] {
290
+            5,
291
+            0,
292
+            0,
293
+            0});
294
+            this.numericUpDown_CurrentOutput.Name = "numericUpDown_CurrentOutput";
295
+            this.numericUpDown_CurrentOutput.Size = new System.Drawing.Size(120, 21);
296
+            this.numericUpDown_CurrentOutput.TabIndex = 167;
297
+            // 
298
+            // numericUpDown_MultiOffset
299
+            // 
300
+            this.numericUpDown_MultiOffset.DecimalPlaces = 1;
301
+            this.numericUpDown_MultiOffset.Increment = new decimal(new int[] {
302
+            5,
303
+            0,
304
+            0,
305
+            65536});
306
+            this.numericUpDown_MultiOffset.Location = new System.Drawing.Point(370, 59);
307
+            this.numericUpDown_MultiOffset.Maximum = new decimal(new int[] {
308
+            315,
309
+            0,
310
+            0,
311
+            65536});
312
+            this.numericUpDown_MultiOffset.Minimum = new decimal(new int[] {
313
+            315,
314
+            0,
315
+            0,
316
+            -2147418112});
317
+            this.numericUpDown_MultiOffset.Name = "numericUpDown_MultiOffset";
318
+            this.numericUpDown_MultiOffset.Size = new System.Drawing.Size(120, 21);
319
+            this.numericUpDown_MultiOffset.TabIndex = 168;
320
+            // 
321
+            // numericUpDown_MultiSet
322
+            // 
323
+            this.numericUpDown_MultiSet.DecimalPlaces = 1;
324
+            this.numericUpDown_MultiSet.Increment = new decimal(new int[] {
325
+            5,
326
+            0,
327
+            0,
328
+            65536});
329
+            this.numericUpDown_MultiSet.Location = new System.Drawing.Point(370, 29);
330
+            this.numericUpDown_MultiSet.Maximum = new decimal(new int[] {
331
+            315,
332
+            0,
333
+            0,
334
+            65536});
335
+            this.numericUpDown_MultiSet.Minimum = new decimal(new int[] {
336
+            315,
337
+            0,
338
+            0,
339
+            -2147418112});
340
+            this.numericUpDown_MultiSet.Name = "numericUpDown_MultiSet";
341
+            this.numericUpDown_MultiSet.Size = new System.Drawing.Size(120, 21);
342
+            this.numericUpDown_MultiSet.TabIndex = 169;
343
+            // 
344
+            // button_CurrentOutput
345
+            // 
346
+            this.button_CurrentOutput.Location = new System.Drawing.Point(507, 92);
347
+            this.button_CurrentOutput.Name = "button_CurrentOutput";
348
+            this.button_CurrentOutput.Size = new System.Drawing.Size(75, 23);
349
+            this.button_CurrentOutput.TabIndex = 164;
350
+            this.button_CurrentOutput.Text = "Apply";
351
+            this.button_CurrentOutput.UseVisualStyleBackColor = true;
352
+            // 
353
+            // button_MultiSet
354
+            // 
355
+            this.button_MultiSet.Location = new System.Drawing.Point(507, 29);
356
+            this.button_MultiSet.Name = "button_MultiSet";
357
+            this.button_MultiSet.Size = new System.Drawing.Size(75, 23);
358
+            this.button_MultiSet.TabIndex = 165;
359
+            this.button_MultiSet.Text = "Apply";
360
+            this.button_MultiSet.UseVisualStyleBackColor = true;
361
+            this.button_MultiSet.Click += new System.EventHandler(this.button_MultiSet_Click);
362
+            // 
363
+            // button_MultiOffset
364
+            // 
365
+            this.button_MultiOffset.Location = new System.Drawing.Point(507, 62);
366
+            this.button_MultiOffset.Name = "button_MultiOffset";
367
+            this.button_MultiOffset.Size = new System.Drawing.Size(75, 23);
368
+            this.button_MultiOffset.TabIndex = 166;
369
+            this.button_MultiOffset.Text = "Apply";
370
+            this.button_MultiOffset.UseVisualStyleBackColor = true;
371
+            // 
372
+            // button_Initialize
373
+            // 
374
+            this.button_Initialize.Dock = System.Windows.Forms.DockStyle.Bottom;
375
+            this.button_Initialize.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
376
+            this.button_Initialize.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
377
+            this.button_Initialize.ForeColor = System.Drawing.Color.White;
378
+            this.button_Initialize.Location = new System.Drawing.Point(0, 454);
379
+            this.button_Initialize.Name = "button_Initialize";
380
+            this.button_Initialize.Size = new System.Drawing.Size(164, 44);
381
+            this.button_Initialize.TabIndex = 9;
382
+            this.button_Initialize.Text = "Initialize";
383
+            this.button_Initialize.UseVisualStyleBackColor = true;
384
+            this.button_Initialize.Click += new System.EventHandler(this.button_Initialize_Click);
385
+            // 
386
+            // button_Expansion
387
+            // 
388
+            this.button_Expansion.Dock = System.Windows.Forms.DockStyle.Bottom;
389
+            this.button_Expansion.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
390
+            this.button_Expansion.Font = new System.Drawing.Font("나눔고딕 ExtraBold", 9F);
391
+            this.button_Expansion.ForeColor = System.Drawing.Color.White;
392
+            this.button_Expansion.Location = new System.Drawing.Point(0, 410);
393
+            this.button_Expansion.Name = "button_Expansion";
394
+            this.button_Expansion.Size = new System.Drawing.Size(164, 44);
395
+            this.button_Expansion.TabIndex = 10;
396
+            this.button_Expansion.Text = "Expansion";
397
+            this.button_Expansion.UseVisualStyleBackColor = true;
398
+            this.button_Expansion.Click += new System.EventHandler(this.button_Expansion_Click);
399
+            // 
400
+            // Table
401
+            // 
402
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
403
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
404
+            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(30)))), ((int)(((byte)(45)))));
405
+            this.ClientSize = new System.Drawing.Size(784, 500);
406
+            this.Controls.Add(this.label31);
407
+            this.Controls.Add(this.label30);
408
+            this.Controls.Add(this.label29);
409
+            this.Controls.Add(this.numericUpDown_CurrentOutput);
410
+            this.Controls.Add(this.numericUpDown_MultiOffset);
411
+            this.Controls.Add(this.numericUpDown_MultiSet);
412
+            this.Controls.Add(this.button_CurrentOutput);
413
+            this.Controls.Add(this.button_MultiSet);
414
+            this.Controls.Add(this.button_MultiOffset);
415
+            this.Controls.Add(this.button_LengthApply);
416
+            this.Controls.Add(this.label1);
417
+            this.Controls.Add(this.numericUpDown_TableLength);
418
+            this.Controls.Add(this.chart_Table);
419
+            this.Controls.Add(this.panel2);
420
+            this.Controls.Add(this.panel1);
421
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
422
+            this.Name = "Table";
423
+            this.Text = "Table";
424
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_TableSetting)).EndInit();
425
+            this.panel1.ResumeLayout(false);
426
+            this.panel2.ResumeLayout(false);
427
+            this.panel2.PerformLayout();
428
+            ((System.ComponentModel.ISupportInitialize)(this.chart_Table)).EndInit();
429
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_TableLength)).EndInit();
430
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_CurrentOutput)).EndInit();
431
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_MultiOffset)).EndInit();
432
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_MultiSet)).EndInit();
433
+            this.ResumeLayout(false);
434
+            this.PerformLayout();
435
+
436
+        }
437
+
438
+        #endregion
439
+
440
+        private System.Windows.Forms.DataGridView dataGridView_TableSetting;
441
+        private System.Windows.Forms.Button button_Dev_Load;
442
+        private System.Windows.Forms.Button button_Dev_Save;
443
+        private System.Windows.Forms.Button button_ExcelSave;
444
+        private System.Windows.Forms.Button button_ExcelLoad;
445
+        private System.Windows.Forms.Panel panel1;
446
+        private System.Windows.Forms.Panel panel2;
447
+        private System.Windows.Forms.TextBox textBox1;
448
+        private System.Windows.Forms.Button button_Set;
449
+        private System.Windows.Forms.DataVisualization.Charting.Chart chart_Table;
450
+        private System.Windows.Forms.SaveFileDialog saveFileDialog1;
451
+        private System.Windows.Forms.NumericUpDown numericUpDown_TableLength;
452
+        private System.Windows.Forms.Label label1;
453
+        private System.Windows.Forms.Button button_LengthApply;
454
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column_DB;
455
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column_Offset;
456
+        private System.Windows.Forms.Label label31;
457
+        private System.Windows.Forms.Label label30;
458
+        private System.Windows.Forms.Label label29;
459
+        public System.Windows.Forms.NumericUpDown numericUpDown_CurrentOutput;
460
+        private System.Windows.Forms.NumericUpDown numericUpDown_MultiOffset;
461
+        private System.Windows.Forms.NumericUpDown numericUpDown_MultiSet;
462
+        private System.Windows.Forms.Button button_CurrentOutput;
463
+        private System.Windows.Forms.Button button_MultiSet;
464
+        private System.Windows.Forms.Button button_MultiOffset;
465
+        private System.Windows.Forms.Button button_Expansion;
466
+        private System.Windows.Forms.Button button_Initialize;
467
+    }
468
+}

+ 323 - 0
DataRequest/Table.cs

@@ -0,0 +1,323 @@
1
+using DataRequest.Func;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Linq;
8
+using System.Reflection;
9
+using System.Text;
10
+using System.Threading.Tasks;
11
+using System.Windows.Forms;
12
+using Excel = Microsoft.Office.Interop.Excel;
13
+
14
+namespace DataRequest
15
+{
16
+    public partial class Table : Form
17
+    {
18
+        public Form main_form;
19
+        public Table()
20
+        {
21
+            InitializeComponent();
22
+        }
23
+
24
+        private void button_Set_Click(object sender, EventArgs e)
25
+        {
26
+
27
+        }
28
+
29
+        private void button_ExcelSave_Click(object sender, EventArgs e)
30
+        {
31
+            GridViewExcel(this.dataGridView_TableSetting);
32
+           // button_ExcelKill_Click(null, null);
33
+        }
34
+        const string Filename = "NessLab";
35
+        private void button_ExcelLoad_Click(object sender, EventArgs e)
36
+        {
37
+            string path = Application.StartupPath + "\\" + Filename + ".xls";
38
+            ReadExcelData(path);
39
+        }
40
+        public void GridViewExcel(DataGridView grid)
41
+        {
42
+            Excel.Application oXL;
43
+            Excel._Workbook oWB;
44
+            Excel._Worksheet oSheet;
45
+            //Excel.Range oRng;
46
+            object missingType = Type.Missing;
47
+
48
+            this.saveFileDialog1.FileName = Application.StartupPath + "\\" + Filename;
49
+            this.saveFileDialog1.DefaultExt = "xls";
50
+            this.saveFileDialog1.Filter = "Excel files (*.xls)|*.xls";
51
+            this.saveFileDialog1.InitialDirectory = "{Desktop}";
52
+            //DialogResult result = saveFileDialog1.ShowDialog();
53
+            //if (result == DialogResult.OK)
54
+            {
55
+                try
56
+                {
57
+                    //Start Excel and get Application object.
58
+                    oXL = new Excel.Application();
59
+                    oXL.Visible = false;
60
+
61
+                    //Get a new workbook.
62
+                    oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));
63
+                    //oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));
64
+                    oSheet = (Excel._Worksheet)oWB.ActiveSheet;
65
+                    //oSheet = oWB.Worksheets.get_Item(1) as Excel.Worksheet;
66
+                    //oSheet = (Excel.Worksheet)oWB.Worksheets.Item[2] as Excel._Worksheet;
67
+
68
+                    //oWB.Worksheets.Item[1] as Excel._Worksheet;
69
+
70
+                    //Add table headers going cell by cell.
71
+                    int k = 0;
72
+                    string[] colHeader = new string[grid.ColumnCount];
73
+                    for (int i = 0; i < grid.Columns.Count; i++)
74
+                    {
75
+                        oSheet.Cells[1, i + 1] = grid.Columns[i].HeaderText;
76
+
77
+                        k = i + 65;
78
+                        colHeader[i] = Convert.ToString((char)k);
79
+                    }
80
+                    //Format A1:D1 as bold, vertical alignment = center.
81
+                    oSheet.get_Range("A1", colHeader[colHeader.Length - 1] + "1").Font.Bold = true;
82
+                    oSheet.get_Range("A1", colHeader[colHeader.Length - 1] + "1").VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;
83
+
84
+                    // Create an array to multiple values at once.
85
+                    object[,] saNames = new object[grid.RowCount, grid.ColumnCount];
86
+
87
+                    string tp;
88
+                    for (int i = 0; i < grid.RowCount; i++)
89
+                    {
90
+                        for (int j = 0; j < grid.ColumnCount; j++)
91
+                        {
92
+                            tp = grid.Rows[i].Cells[j].ValueType.Name;
93
+                            if (tp == "String") //2000-01-01 형태의 날짜 필터하기 위함(숫자로 변환 방지)
94
+                                saNames[i, j] = "'" + grid.Rows[i].Cells[j].Value.ToString();
95
+                            else
96
+                                saNames[i, j] = grid.Rows[i].Cells[j].Value;
97
+                        }
98
+                    }
99
+
100
+                    //Fill A2:B6 with an array of values (First and Last Names).
101
+                    //oSheet.get_Range("A2", "B6").Value2 = saNames;
102
+                    oSheet.get_Range(colHeader[0] + "2", colHeader[colHeader.Length - 1] + (grid.RowCount + 1)).Value2 = saNames;
103
+
104
+                    oXL.Visible = false;
105
+                    oXL.UserControl = false;
106
+                    oWB.SaveAs(saveFileDialog1.FileName,
107
+                    Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal,
108
+                    missingType, missingType, missingType, missingType,
109
+                    Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange,
110
+                    missingType, missingType, missingType, missingType, missingType);
111
+                    oWB.Close(false, missingType, missingType);
112
+                    //Cursor.Current = Cursors.Default;
113
+                    //MessageBox.Show("Save Success!!!");
114
+                    AutoClosingMessageBox.Show("Save Success", "알림", 100);
115
+                }
116
+                catch (Exception theException)
117
+                {
118
+                    String errorMessage;
119
+                    errorMessage = "Error: ";
120
+                    errorMessage = String.Concat(errorMessage, theException.Message);
121
+                    errorMessage = String.Concat(errorMessage, " Line: ");
122
+                    errorMessage = String.Concat(errorMessage, theException.Source);
123
+
124
+                    MessageBox.Show(errorMessage, "Error");
125
+                }
126
+            }
127
+
128
+        }
129
+        public void ReadExcelData(string path)
130
+        { // path는 Excel파일의 전체 경로입니다.
131
+          // 예. D:\test\test.xslx
132
+            Excel.Application excelApp = null;
133
+            Excel.Workbook wb = null;
134
+            Excel.Worksheet ws = null;
135
+            try
136
+            {
137
+                excelApp = new Excel.Application();
138
+                wb = excelApp.Workbooks.Open(path);
139
+                // path 대신 문자열도 가능합니다
140
+                // 예. Open(@"D:\test\test.xslx");
141
+                ws = wb.Worksheets.get_Item(1) as Excel.Worksheet;
142
+                // 첫번째 Worksheet를 선택합니다.
143
+                Excel.Range rng = ws.UsedRange;   // '여기'
144
+                                                  // 현재 Worksheet에서 사용된 셀 전체를 선택합니다.
145
+                object[,] data = rng.Value;
146
+                // 열들에 들어있는 Data를 배열 (One-based array)로 받아옵니다.
147
+                for (int r = 1; r < data.GetLength(0); r++)
148
+                {
149
+                    for (int c = 1; c <= data.GetLength(1); c++)
150
+                    {
151
+                        if (data[r, c] == null)
152
+                        {
153
+                            continue;
154
+                        }
155
+                        //dataGridView_TableSetting.SelectedRows(r - 1).Cells(c - 1).Value = data[r + 1, c];
156
+
157
+
158
+                        // Data 빼오기
159
+                        // data[r, c] 는 excel의 (r, c) 셀 입니다.
160
+                        // data.GetLength(0)은 엑셀에서 사용되는 행의 수를 가져오는 것이고,
161
+                        // data.GetLength(1)은 엑셀에서 사용되는 열의 수를 가져오는 것입니다.
162
+                        // GetLength와 [ r, c] 의 순서를 바꿔서 사용할 수 있습니다.
163
+                    }
164
+                    dataGridView_TableSetting.Rows[r - 1].Cells[1].Value = data[r + 1, 2];
165
+                }
166
+                wb.Close(true);
167
+                excelApp.Quit();
168
+            }
169
+            catch (Exception ex)
170
+            {
171
+                ReleaseExcelObject(ws);
172
+                ReleaseExcelObject(wb);
173
+                ReleaseExcelObject(excelApp);
174
+               // button_ExcelKill_Click(null, null);
175
+                return;
176
+                throw ex;
177
+            }
178
+            finally
179
+            {
180
+                ReleaseExcelObject(ws);
181
+                ReleaseExcelObject(wb);
182
+                ReleaseExcelObject(excelApp);
183
+              //  button_ExcelKill_Click(null, null);
184
+            }
185
+        }
186
+        private void ReleaseExcelObject(object obj)
187
+        {
188
+            try
189
+            {
190
+                System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
191
+                obj = null;
192
+            }
193
+            catch (Exception ex)
194
+            {
195
+                obj = null;
196
+                MessageBox.Show("Unable to release the Object " + ex.ToString());
197
+            }
198
+            finally
199
+            {
200
+                GC.Collect();
201
+            }
202
+        }
203
+
204
+        private void button_LengthApply_Click(object sender, EventArgs e)
205
+        {
206
+            
207
+            int TempDbmData = 1;
208
+            string tempstr = "";
209
+            for (int i = 0; i < numericUpDown_TableLength.Value; i++)
210
+            {
211
+                dataGridView_TableSetting.Rows.Add();
212
+                tempstr = string.Format("{0:0.0}", TempDbmData);
213
+                dataGridView_TableSetting[0, i].Value = Convert.ToString(tempstr) + " dBm"; ;
214
+                dataGridView_TableSetting[1, i].Value = "0";
215
+                TempDbmData = TempDbmData + 1;
216
+            }
217
+
218
+            foreach (DataGridViewRow row in this.dataGridView_TableSetting.Rows)
219
+            {
220
+                row.HeaderCell.Value = String.Format("{0}", row.Index + 1);
221
+            }
222
+            this.dataGridView_TableSetting.AutoResizeRowHeadersWidth(
223
+            DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
224
+            this.dataGridView_TableSetting.TopLeftHeaderCell.Value = "No.";
225
+            dataGridView_TableSetting.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
226
+            dataGridView_TableSetting.ClearSelection();
227
+        }
228
+        private void GridView_array(ref double[] data)
229
+        {
230
+            for (int i = 0; i < dataGridView_TableSetting.RowCount; i++)
231
+            {
232
+                data[i] = Convert.ToDouble(dataGridView_TableSetting[1, i].Value);
233
+            }
234
+        }
235
+        private void button_Dev_Save_Click(object sender, EventArgs e)
236
+        {
237
+            double[] temp_array = new double[dataGridView_TableSetting.RowCount];
238
+            byte[] ret_array = new byte[temp_array.Length * 2 + 10];
239
+            Etc_Function etc_Function = new Etc_Function();
240
+            GridView_array(ref temp_array);
241
+            ret_array = etc_Function.NessLab_Protocol_Create(temp_array, (int)Etc_Function.NessLab_Protocol_Index.NessLab_TableSet_Req);
242
+
243
+            ((Main)main_form).serial.Serial_DataSend(ret_array, ret_array.Length);
244
+            ((Main)main_form).TimerIntervalCnt = 0;
245
+        }
246
+
247
+        private void button_Dev_Load_Click(object sender, EventArgs e)
248
+        {
249
+            //byte[] temp_array =
250
+            //((Main)main_form).serial.Serial_DataSend(, temp_array.Length);
251
+            //((Main)main_form).TimerIntervalCnt = 0;
252
+        }
253
+
254
+        private void button_Initialize_Click(object sender, EventArgs e)
255
+        {
256
+
257
+        }
258
+
259
+        private void button_Expansion_Click(object sender, EventArgs e)
260
+        {
261
+
262
+        }
263
+
264
+        private void button_MultiSet_Click(object sender, EventArgs e)
265
+        {
266
+            List<int> TmpList = new List<int>();
267
+            TmpList = DataGridViewIndexOutput();
268
+            for (int i = 0; i < TmpList.Count; i++)
269
+            {
270
+                dataGridView_TableSetting[1, TmpList[i]].Value = numericUpDown_MultiSet.Value.ToString();
271
+            }
272
+        }
273
+        private List<int> DataGridViewIndexOutput()
274
+        {
275
+            List<int> Tmplist = new List<int>();
276
+
277
+            Int32 selectedCellCount =
278
+            dataGridView_TableSetting.GetCellCount(DataGridViewElementStates.Selected);
279
+            if (selectedCellCount > 0)
280
+            {
281
+                System.Text.StringBuilder sb =
282
+                    new System.Text.StringBuilder();
283
+
284
+                //for (int i = 0;i < selectedCellCount; i++)
285
+                for (int i = 0; i < selectedCellCount; i += 2)
286
+                {
287
+                    sb.Append("Row: ");
288
+                    sb.Append(dataGridView_TableSetting.SelectedCells[i].RowIndex.ToString());
289
+                    Tmplist.Add(dataGridView_TableSetting.SelectedCells[i].RowIndex);
290
+                    /*sb.Append(", Column: ");
291
+                    sb.Append(dataGridView_TableSetting.SelectedCells[i].ColumnIndex.ToString());*/
292
+                    sb.Append(Environment.NewLine);
293
+                }
294
+
295
+                // sb.Append("Total: " + selectedCellCount.ToString());
296
+                // MessageBox.Show(sb.ToString(), "Selected Cells");
297
+            }
298
+            return Tmplist;
299
+        }
300
+        enum NessLab_Index{
301
+            NessLab_Header0 = 0,
302
+            NessLab_Header1,
303
+            NessLab_MsgID0,
304
+            NessLab_MsgSN0,
305
+            NessLab_MsgSN1,
306
+            NessLab_Reserve0,
307
+            NessLab_DataLength,
308
+        };
309
+        
310
+        public void Table_Setting(byte[] data)
311
+        {
312
+            //dataGridView_TableSetting.RowCount = data[(int)NessLab_Index.NessLab_DataLength];
313
+            double ret = 0;
314
+
315
+            for (int i = 0; i < dataGridView_TableSetting.RowCount; i++)
316
+            {
317
+                ret = (double)((data[(int)((i * 2) + NessLab_Index.NessLab_DataLength)] << 8) | data[(int)((i * 2) + NessLab_Index.NessLab_DataLength + 1)]) / 1000;
318
+                dataGridView_TableSetting[1, i].Value = ret;
319
+            }
320
+
321
+        }
322
+    }
323
+}

+ 135 - 0
DataRequest/Table.resx

@@ -0,0 +1,135 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="Column_DB.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
121
+    <value>True</value>
122
+  </metadata>
123
+  <metadata name="Column_Offset.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
124
+    <value>True</value>
125
+  </metadata>
126
+  <metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127
+    <value>17, 17</value>
128
+  </metadata>
129
+  <metadata name="Column_DB.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
130
+    <value>True</value>
131
+  </metadata>
132
+  <metadata name="Column_Offset.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
133
+    <value>True</value>
134
+  </metadata>
135
+</root>