Просмотр исходного кода

Reference Data Add / DLUL Enum Add / Table Layout Method Add (Temp/DET/ATT)/ DataGridView Select Demo Function Add

박영준 лет назад: 5
Родитель
Сommit
48b2bb929c

BIN
.vs/Jdas_Mbic/v15/.suo


BIN
.vs/Jdas_Mbic/v15/Server/sqlite3/storage.ide


BIN
.vs/Jdas_Mbic/v15/Server/sqlite3/storage.ide-shm


BIN
.vs/Jdas_Mbic/v15/Server/sqlite3/storage.ide-wal


+ 19 - 13
Jdas_Mbic/Main.Designer.cs

@@ -120,7 +120,7 @@
120 120
             this.numericUpDown9 = new System.Windows.Forms.NumericUpDown();
121 121
             this.button_AllZeroWrite = new System.Windows.Forms.Button();
122 122
             this.button6 = new System.Windows.Forms.Button();
123
-            this.button7 = new System.Windows.Forms.Button();
123
+            this.button_MultiSet = new System.Windows.Forms.Button();
124 124
             this.button8 = new System.Windows.Forms.Button();
125 125
             this.groupBox3 = new System.Windows.Forms.GroupBox();
126 126
             this.comboBox1 = new System.Windows.Forms.ComboBox();
@@ -1217,7 +1217,7 @@
1217 1217
             this.groupBox6.Controls.Add(this.numericUpDown9);
1218 1218
             this.groupBox6.Controls.Add(this.button_AllZeroWrite);
1219 1219
             this.groupBox6.Controls.Add(this.button6);
1220
-            this.groupBox6.Controls.Add(this.button7);
1220
+            this.groupBox6.Controls.Add(this.button_MultiSet);
1221 1221
             this.groupBox6.Controls.Add(this.button8);
1222 1222
             this.groupBox6.Location = new System.Drawing.Point(338, 136);
1223 1223
             this.groupBox6.Name = "groupBox6";
@@ -1291,14 +1291,15 @@
1291 1291
             this.button6.Text = "APPLY";
1292 1292
             this.button6.UseVisualStyleBackColor = true;
1293 1293
             // 
1294
-            // button7
1294
+            // button_MultiSet
1295 1295
             // 
1296
-            this.button7.Location = new System.Drawing.Point(291, 35);
1297
-            this.button7.Name = "button7";
1298
-            this.button7.Size = new System.Drawing.Size(75, 23);
1299
-            this.button7.TabIndex = 2;
1300
-            this.button7.Text = "APPLY";
1301
-            this.button7.UseVisualStyleBackColor = true;
1296
+            this.button_MultiSet.Location = new System.Drawing.Point(291, 35);
1297
+            this.button_MultiSet.Name = "button_MultiSet";
1298
+            this.button_MultiSet.Size = new System.Drawing.Size(75, 23);
1299
+            this.button_MultiSet.TabIndex = 2;
1300
+            this.button_MultiSet.Text = "APPLY";
1301
+            this.button_MultiSet.UseVisualStyleBackColor = true;
1302
+            this.button_MultiSet.Click += new System.EventHandler(this.button_MultiSet_Click);
1302 1303
             // 
1303 1304
             // button8
1304 1305
             // 
@@ -1357,6 +1358,7 @@
1357 1358
             this.comboBox1.Size = new System.Drawing.Size(318, 20);
1358 1359
             this.comboBox1.TabIndex = 2;
1359 1360
             this.comboBox1.Text = "ATT_DL1";
1361
+            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
1360 1362
             // 
1361 1363
             // label_Function
1362 1364
             // 
@@ -1414,6 +1416,7 @@
1414 1416
             // 
1415 1417
             // dataGridView_TableSetting
1416 1418
             // 
1419
+            this.dataGridView_TableSetting.AllowUserToAddRows = false;
1417 1420
             this.dataGridView_TableSetting.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
1418 1421
             this.dataGridView_TableSetting.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
1419 1422
             this.Column_DB,
@@ -1424,7 +1427,7 @@
1424 1427
             this.dataGridView_TableSetting.RowTemplate.Height = 23;
1425 1428
             this.dataGridView_TableSetting.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.True;
1426 1429
             this.dataGridView_TableSetting.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
1427
-            this.dataGridView_TableSetting.Size = new System.Drawing.Size(282, 338);
1430
+            this.dataGridView_TableSetting.Size = new System.Drawing.Size(296, 338);
1428 1431
             this.dataGridView_TableSetting.TabIndex = 0;
1429 1432
             this.dataGridView_TableSetting.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_TableSetting_CellClick);
1430 1433
             // 
@@ -1432,11 +1435,14 @@
1432 1435
             // 
1433 1436
             this.Column_DB.HeaderText = "DB";
1434 1437
             this.Column_DB.Name = "Column_DB";
1438
+            this.Column_DB.ReadOnly = true;
1439
+            this.Column_DB.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
1435 1440
             // 
1436 1441
             // Column_Offset
1437 1442
             // 
1438 1443
             this.Column_Offset.HeaderText = "Offset";
1439 1444
             this.Column_Offset.Name = "Column_Offset";
1445
+            this.Column_Offset.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
1440 1446
             // 
1441 1447
             // JdasMbic
1442 1448
             // 
@@ -1596,8 +1602,6 @@
1596 1602
         private System.Windows.Forms.ComboBox comboBox_baudrate;
1597 1603
         private System.Windows.Forms.TabPage tabPage_Setting;
1598 1604
         private System.Windows.Forms.DataGridView dataGridView_TableSetting;
1599
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column_DB;
1600
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column_Offset;
1601 1605
         private System.Windows.Forms.GroupBox groupBox6;
1602 1606
         private System.Windows.Forms.Label label31;
1603 1607
         private System.Windows.Forms.Label label30;
@@ -1607,7 +1611,7 @@
1607 1611
         private System.Windows.Forms.NumericUpDown numericUpDown9;
1608 1612
         private System.Windows.Forms.Button button_AllZeroWrite;
1609 1613
         private System.Windows.Forms.Button button6;
1610
-        private System.Windows.Forms.Button button7;
1614
+        private System.Windows.Forms.Button button_MultiSet;
1611 1615
         private System.Windows.Forms.Button button8;
1612 1616
         private System.Windows.Forms.GroupBox groupBox3;
1613 1617
         private System.Windows.Forms.ComboBox comboBox1;
@@ -1617,6 +1621,8 @@
1617 1621
         private System.Windows.Forms.Button button_FileLoad;
1618 1622
         private System.Windows.Forms.Button button_FileSave;
1619 1623
         private System.Windows.Forms.Button button_Initalize;
1624
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column_DB;
1625
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column_Offset;
1620 1626
     }
1621 1627
 }
1622 1628
 

+ 165 - 13
Jdas_Mbic/Main.cs

@@ -12,6 +12,18 @@ namespace Jdas_Mbic
12 12
 {
13 13
     public partial class JdasMbic : Form
14 14
     {
15
+        const double Table_Dbm_DefaultValue = 31.5;
16
+        const int Table_DL_DefaultValue = 5;
17
+        const int Table_UL_DefaultValue = -15;
18
+        const int Table_Temp_DefaultValue = -10;
19
+
20
+        enum DLUL_Category
21
+        {
22
+            DL_DET = 0,
23
+            UL_DET
24
+        };
25
+
26
+
15 27
         public JdasMbic()
16 28
         {
17 29
             InitializeComponent();
@@ -19,21 +31,22 @@ namespace Jdas_Mbic
19 31
 
20 32
         private void JdasMbic_Load(object sender, EventArgs e)
21 33
         {
22
-            HeaderIndexNumSet();
34
+            ATT_TableLayoutSetting();
23 35
         }
24
-        const double TableDbmDefaultValue = 31.5;
25
-        private void HeaderIndexNumSet()
36
+        
37
+        private void ATT_TableLayoutSetting()
26 38
         {
27
-            double TempDbmData = 0;
28
-            for (int i = 0; i < 65; i++)
39
+            double TempDbmData = Table_Dbm_DefaultValue;
40
+            string tempstr = "";
41
+            for (int i = 0; i < 64; i++)
29 42
             {
30 43
                 dataGridView_TableSetting.Rows.Add();
31
-                dataGridView_TableSetting[0, i].Value = Convert.ToString(TempDbmData);
32
-                TempDbmData = TableDbmDefaultValue - 0.5;
44
+                tempstr = string.Format("{0:0.0}", TempDbmData);
45
+                dataGridView_TableSetting[0, i].Value = Convert.ToString(tempstr) + " dBm"; ;
46
+                TempDbmData = TempDbmData - 0.5;
33 47
                 
34 48
             }
35 49
 
36
-            //   dataGridView_TableSetting.RowHeadersWidth = 70;    
37 50
             foreach (DataGridViewRow row in this.dataGridView_TableSetting.Rows)
38 51
             {
39 52
                 row.HeaderCell.Value = String.Format("{0}", row.Index + 1);
@@ -41,11 +54,62 @@ namespace Jdas_Mbic
41 54
             this.dataGridView_TableSetting.AutoResizeRowHeadersWidth(
42 55
             DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
43 56
             this.dataGridView_TableSetting.TopLeftHeaderCell.Value = "No.";
44
-           //init = true;
45
-           // SetDoNotSort(dataGridView1);
46
-           //  dataGridView_TableSetting.Columns["DB"].ReadOnly = true;
47
-           //dataGridView1.RowHeadersWidth = 30;
48
-           //  dataGridView1.RowHeadersAlign = 20;
57
+            dataGridView_TableSetting.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
58
+            dataGridView_TableSetting.ClearSelection();
59
+        }
60
+
61
+
62
+        private void DET_TableLayoutSetting(DLUL_Category cat)
63
+        {
64
+            string tempstr = "";
65
+            DLUL_Category tempenum = cat;
66
+
67
+            switch (tempenum) {
68
+                case DLUL_Category.DL_DET:
69
+                    double Temp_DL_Data = Table_DL_DefaultValue;
70
+                    for (int i = 0; i < 31; i++)
71
+                    {
72
+                        dataGridView_TableSetting.Rows.Add();
73
+                        tempstr = string.Format("{0:0}", Temp_DL_Data);
74
+                        dataGridView_TableSetting[0, i].Value = Convert.ToString(tempstr) + " dBm";
75
+                        Temp_DL_Data = Temp_DL_Data - 1;
76
+
77
+                    }
78
+                    break;
79
+                case DLUL_Category.UL_DET:
80
+                    double Temp_UL_Data = Table_UL_DefaultValue;
81
+                    for (int i = 0; i < 46; i++)
82
+                    {
83
+                        dataGridView_TableSetting.Rows.Add();
84
+                        tempstr = string.Format("{0:0}", Temp_UL_Data);
85
+                        dataGridView_TableSetting[0, i].Value = Convert.ToString(tempstr) + " dBm";
86
+                        Temp_UL_Data = Temp_UL_Data - 1;
87
+
88
+                    }
89
+                    break;
90
+            }
91
+            
92
+        }
93
+        private void Temp_TableLayoutSetting()
94
+        {
95
+            string tempstr = "";
96
+            
97
+            double Temp_Data = Table_Temp_DefaultValue;
98
+            for (int i = 0; i < 46; i++)
99
+            {
100
+                dataGridView_TableSetting.Rows.Add();
101
+                tempstr = string.Format("{0:0}", Temp_Data);
102
+                dataGridView_TableSetting[0, i].Value = Convert.ToString(tempstr) + " ℃";
103
+                Temp_Data = Temp_Data - 1;
104
+
105
+            }
106
+            foreach (DataGridViewRow row in this.dataGridView_TableSetting.Rows)
107
+            {
108
+                row.HeaderCell.Value = String.Format("{0}", row.Index + 1);
109
+            }
110
+            this.dataGridView_TableSetting.AutoResizeRowHeadersWidth(
111
+            DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
112
+            this.dataGridView_TableSetting.TopLeftHeaderCell.Value = "No.";
49 113
             dataGridView_TableSetting.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
50 114
             dataGridView_TableSetting.ClearSelection();
51 115
         }
@@ -54,5 +118,93 @@ namespace Jdas_Mbic
54 118
         {
55 119
 
56 120
         }
121
+        /*
122
+         * 
123
+         * TABLE Setting Area
124
+         * 
125
+         */
126
+        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
127
+        {
128
+            ComboBox comboBox = (ComboBox)sender;
129
+            string tempstr = comboBox.Text;
130
+
131
+            switch (tempstr)
132
+            {
133
+                case "ATT_DL1":
134
+                case "ATT_UL1": 
135
+                case "ATT_DL2": 
136
+                case "ATT_UL2": 
137
+                case "ATT_DL3": 
138
+                case "ATT_UL3": 
139
+                case "ATT_DL4": 
140
+                case "ATT_UL4": 
141
+                    dataGridView_TableSetting.Rows.Clear();
142
+                    ATT_TableLayoutSetting();
143
+                    break;
144
+                case "DET_DL1": 
145
+                case "DET_DL2": 
146
+                case "DET_DL3": 
147
+                case "DET_DL4":
148
+                    dataGridView_TableSetting.Rows.Clear();
149
+                    DET_TableLayoutSetting(DLUL_Category.DL_DET);
150
+                    break;
151
+                case "DET_UL1": 
152
+                case "DET_UL2": 
153
+                case "DET_UL3": 
154
+                case "DET_UL4":
155
+                    dataGridView_TableSetting.Rows.Clear();
156
+                    DET_TableLayoutSetting(DLUL_Category.UL_DET);
157
+                    break;
158
+                case "TEMP_DL1": 
159
+                case "TEMP_UL1": 
160
+                case "TEMP_DL2": 
161
+                case "TEMP_UL2": 
162
+                case "TEMP_DL3": 
163
+                case "TEMP_UL3": 
164
+                case "TEMP_DL4": 
165
+                case "TEMP_UL4": 
166
+                    dataGridView_TableSetting.Rows.Clear();
167
+                    Temp_TableLayoutSetting();
168
+                    break;
169
+                default:
170
+                    MessageBox.Show("존재하지 않는 ComboBox 입니다.\r\n 확인해주세요.");
171
+                    break;
172
+            }
173
+           
174
+                
175
+        }
176
+
177
+        private void button_MultiSet_Click(object sender, EventArgs e)
178
+        {
179
+            Int32 selectedCellCount =
180
+            dataGridView_TableSetting.GetCellCount(DataGridViewElementStates.Selected);
181
+            if (selectedCellCount > 0)
182
+            {
183
+                if (dataGridView_TableSetting.AreAllCellsSelected(true))
184
+                {
185
+                    MessageBox.Show("All cells are selected", "Selected Cells");
186
+                }
187
+                else
188
+                {
189
+                    System.Text.StringBuilder sb =
190
+                        new System.Text.StringBuilder();
191
+
192
+                    for (int i = 0;
193
+                        i < selectedCellCount; i++)
194
+                    {
195
+                        sb.Append("Row: ");
196
+                        sb.Append(dataGridView_TableSetting.SelectedCells[i].RowIndex
197
+                            .ToString());
198
+                        sb.Append(", Column: ");
199
+                        sb.Append(dataGridView_TableSetting.SelectedCells[i].ColumnIndex
200
+                            .ToString());
201
+                        sb.Append(Environment.NewLine);
202
+                    }
203
+
204
+                    sb.Append("Total: " + selectedCellCount.ToString());
205
+                    MessageBox.Show(sb.ToString(), "Selected Cells");
206
+                }
207
+            }
208
+        }
57 209
     }
58 210
 }

+ 6 - 0
Jdas_Mbic/Main.resx

@@ -1264,4 +1264,10 @@
1264 1264
         AAAASUVORK5CYII=
1265 1265
 </value>
1266 1266
   </data>
1267
+  <metadata name="Column_DB.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
1268
+    <value>True</value>
1269
+  </metadata>
1270
+  <metadata name="Column_Offset.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
1271
+    <value>True</value>
1272
+  </metadata>
1267 1273
 </root>

BIN
Jdas_Mbic/bin/Debug/Jdas_Mbic.exe


BIN
Jdas_Mbic/bin/Debug/Jdas_Mbic.pdb


BIN
Jdas_Mbic/obj/Debug/Jdas_Mbic.csproj.GenerateResource.cache


BIN
Jdas_Mbic/obj/Debug/Jdas_Mbic.exe


BIN
Jdas_Mbic/obj/Debug/Jdas_Mbic.pdb