개정판 522be0fa
dev issue #000 : edit project
Change-Id: Ibd6ede2eace08c031703144b2a987013a403f0a9
DTI_PID/SPPIDConverter_AutoModeling/App.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<configuration> |
|
3 |
<configSections> |
|
4 |
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342" /> |
|
5 |
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System"> |
|
6 |
<section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection" requirePermission="false" /> |
|
7 |
</sectionGroup> |
|
8 |
</configSections> |
|
9 |
<applicationSettings> |
|
10 |
<DevExpress.LookAndFeel.Design.AppSettings> |
|
11 |
<setting name="DefaultAppSkin" serializeAs="String"> |
|
12 |
<value>Skin/Office 2016 Colorful</value> |
|
13 |
</setting> |
|
14 |
<setting name="DefaultPalette" serializeAs="String"> |
|
15 |
<value></value> |
|
16 |
</setting> |
|
17 |
<setting name="TouchUI" serializeAs="String"> |
|
18 |
<value></value> |
|
19 |
</setting> |
|
20 |
<setting name="TouchScaleFactor" serializeAs="String"> |
|
21 |
<value></value> |
|
22 |
</setting> |
|
23 |
<setting name="DirectX" serializeAs="String"> |
|
24 |
<value></value> |
|
25 |
</setting> |
|
26 |
<setting name="RegisterUserSkins" serializeAs="String"> |
|
27 |
<value></value> |
|
28 |
</setting> |
|
29 |
<setting name="FontBehavior" serializeAs="String"> |
|
30 |
<value></value> |
|
31 |
</setting> |
|
32 |
<setting name="DefaultAppFont" serializeAs="String"> |
|
33 |
<value></value> |
|
34 |
</setting> |
|
35 |
<setting name="DPIAwarenessMode" serializeAs="String"> |
|
36 |
<value></value> |
|
37 |
</setting> |
|
38 |
</DevExpress.LookAndFeel.Design.AppSettings> |
|
39 |
</applicationSettings> |
|
40 |
<system.data> |
|
41 |
<DbProviderFactories> |
|
42 |
<remove invariant="Oracle.ManagedDataAccess.Client" /> |
|
43 |
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342" /> |
|
44 |
</DbProviderFactories> |
|
45 |
</system.data> |
|
46 |
<runtime> |
|
47 |
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|
48 |
<dependentAssembly> |
|
49 |
<publisherPolicy apply="no" /> |
|
50 |
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" /> |
|
51 |
<bindingRedirect oldVersion="4.122.0.0 - 4.65535.65535.65535" newVersion="4.122.18.3" /> |
|
52 |
</dependentAssembly> |
|
53 |
</assemblyBinding> |
|
54 |
</runtime> |
|
55 |
<oracle.manageddataaccess.client> |
|
56 |
<version number="*"> |
|
57 |
<dataSources> |
|
58 |
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " /> |
|
59 |
</dataSources> |
|
60 |
</version> |
|
61 |
</oracle.manageddataaccess.client> |
|
62 |
</configuration> |
DTI_PID/SPPIDConverter_AutoModeling/DB/DB.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using Oracle.ManagedDataAccess.Client; |
|
7 |
using Oracle.ManagedDataAccess.Types; |
|
8 |
using SPPID.Model; |
|
9 |
using System.Data; |
|
10 |
using System.Globalization; |
|
11 |
using System.IO; |
|
12 |
|
|
13 |
namespace SPPID.DB |
|
14 |
{ |
|
15 |
public class DB |
|
16 |
{ |
|
17 |
private const string oConnString = "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST ={0}" + @")(PORT = {1})) ) (CONNECT_DATA = (SERVICE_NAME = {2})))"; |
|
18 |
|
|
19 |
public static bool CheckAndSetDBInformation() |
|
20 |
{ |
|
21 |
bool bResult = false; |
|
22 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
23 |
try |
|
24 |
{ |
|
25 |
if (dbInfo.DBType == "ORACLE") |
|
26 |
{ |
|
27 |
string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service); |
|
28 |
connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword; |
|
29 |
|
|
30 |
using (OracleConnection conn = new OracleConnection(connString)) |
|
31 |
{ |
|
32 |
conn.Open(); |
|
33 |
if (conn.State == System.Data.ConnectionState.Open) |
|
34 |
{ |
|
35 |
using (OracleCommand cmd = new OracleCommand()) |
|
36 |
{ |
|
37 |
cmd.Connection = conn; |
|
38 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT NAME, PATH FROM {0}.T_ROOTITEM", dbInfo.Site); |
|
39 |
|
|
40 |
using (OracleDataReader reader = cmd.ExecuteReader()) |
|
41 |
{ |
|
42 |
while (reader.Read()) |
|
43 |
{ |
|
44 |
dbInfo.Plant = reader["NAME"].ToString(); |
|
45 |
dbInfo.PlantPath = reader["PATH"].ToString(); |
|
46 |
} |
|
47 |
|
|
48 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, @"SELECT SP_SCHEMA_TYPE, USERNAME |
|
49 |
FROM {0}.T_DB_DATA DB_DATA |
|
50 |
INNER JOIN {0}.T_ROOTITEM ROOTITEM ON DB_DATA.SP_ROOTITEMID = ROOTITEM.SP_ID |
|
51 |
WHERE ROOTITEM.NAME = '{1}'", dbInfo.Site, dbInfo.Plant); |
|
52 |
|
|
53 |
|
|
54 |
using (OracleDataAdapter adapter = new OracleDataAdapter()) |
|
55 |
{ |
|
56 |
DataTable dt = new DataTable(); |
|
57 |
adapter.SelectCommand = cmd; |
|
58 |
adapter.Fill(dt); |
|
59 |
|
|
60 |
foreach (DataRow row in dt.Rows) |
|
61 |
{ |
|
62 |
string sType = row["SP_SCHEMA_TYPE"].ToString(); |
|
63 |
switch (sType) |
|
64 |
{ |
|
65 |
case "SPPIDDATA_DICTIONARY": |
|
66 |
dbInfo.PlantPIDDic = row["USERNAME"].ToString(); |
|
67 |
break; |
|
68 |
case "DATA_DICTIONARY": |
|
69 |
dbInfo.PlantDic = row["USERNAME"].ToString(); |
|
70 |
break; |
|
71 |
case "SPAPLANT": |
|
72 |
dbInfo.Plant = row["USERNAME"].ToString(); |
|
73 |
break; |
|
74 |
case "SPPID": |
|
75 |
dbInfo.PlantPID = row["USERNAME"].ToString(); |
|
76 |
break; |
|
77 |
default: |
|
78 |
break; |
|
79 |
} |
|
80 |
} |
|
81 |
bResult = true; |
|
82 |
} |
|
83 |
} |
|
84 |
} |
|
85 |
} |
|
86 |
} |
|
87 |
} |
|
88 |
else |
|
89 |
{ |
|
90 |
|
|
91 |
} |
|
92 |
} |
|
93 |
catch (Exception ex) |
|
94 |
{ |
|
95 |
|
|
96 |
} |
|
97 |
|
|
98 |
return bResult; |
|
99 |
} |
|
100 |
|
|
101 |
public static bool SetPlantDBSetting() |
|
102 |
{ |
|
103 |
bool bResult = false; |
|
104 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
105 |
try |
|
106 |
{ |
|
107 |
if (dbInfo.DBType == "ORACLE") |
|
108 |
{ |
|
109 |
string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service); |
|
110 |
connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword; |
|
111 |
|
|
112 |
using (OracleConnection conn = new OracleConnection(connString)) |
|
113 |
{ |
|
114 |
conn.Open(); |
|
115 |
if (conn.State == System.Data.ConnectionState.Open) |
|
116 |
{ |
|
117 |
using (OracleCommand cmd = new OracleCommand()) |
|
118 |
{ |
|
119 |
cmd.Connection = conn; |
|
120 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, @"SELECT SP_SCHEMA_TYPE, USERNAME |
|
121 |
FROM {0}.T_DB_DATA DB_DATA |
|
122 |
INNER JOIN {0}.T_ROOTITEM ROOTITEM ON DB_DATA.SP_ROOTITEMID = ROOTITEM.SP_ID |
|
123 |
WHERE ROOTITEM.NAME = '{1}'", dbInfo.Site, dbInfo.Plant); |
|
124 |
using (OracleDataAdapter adapter = new OracleDataAdapter()) |
|
125 |
{ |
|
126 |
DataTable dt = new DataTable(); |
|
127 |
adapter.SelectCommand = cmd; |
|
128 |
adapter.Fill(dt); |
|
129 |
|
|
130 |
foreach (DataRow row in dt.Rows) |
|
131 |
{ |
|
132 |
string sType = row["SP_SCHEMA_TYPE"].ToString(); |
|
133 |
switch (sType) |
|
134 |
{ |
|
135 |
case "SPPIDDATA_DICTIONARY": |
|
136 |
dbInfo.PlantPIDDic = row["USERNAME"].ToString(); |
|
137 |
break; |
|
138 |
case "DATA_DICTIONARY": |
|
139 |
dbInfo.PlantDic = row["USERNAME"].ToString(); |
|
140 |
break; |
|
141 |
case "SPAPLANT": |
|
142 |
dbInfo.Plant = row["USERNAME"].ToString(); |
|
143 |
break; |
|
144 |
case "SPPID": |
|
145 |
dbInfo.PlantPID = row["USERNAME"].ToString(); |
|
146 |
break; |
|
147 |
default: |
|
148 |
break; |
|
149 |
} |
|
150 |
} |
|
151 |
bResult = true; |
|
152 |
} |
|
153 |
} |
|
154 |
} |
|
155 |
} |
|
156 |
} |
|
157 |
else |
|
158 |
{ |
|
159 |
|
|
160 |
} |
|
161 |
} |
|
162 |
catch (Exception ex) |
|
163 |
{ |
|
164 |
|
|
165 |
} |
|
166 |
|
|
167 |
return bResult; |
|
168 |
} |
|
169 |
|
|
170 |
public static List<string> GetPlantList() |
|
171 |
{ |
|
172 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
173 |
List<string> plantList = new List<string>(); |
|
174 |
try |
|
175 |
{ |
|
176 |
if (dbInfo.DBType == "ORACLE") |
|
177 |
{ |
|
178 |
string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service); |
|
179 |
connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword; |
|
180 |
|
|
181 |
using (OracleConnection conn = new OracleConnection(connString)) |
|
182 |
{ |
|
183 |
conn.Open(); |
|
184 |
if (conn.State == System.Data.ConnectionState.Open) |
|
185 |
{ |
|
186 |
using (OracleCommand cmd = new OracleCommand()) |
|
187 |
{ |
|
188 |
cmd.Connection = conn; |
|
189 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT NAME, PATH FROM {0}.T_ROOTITEM", dbInfo.Site); |
|
190 |
|
|
191 |
using (OracleDataReader reader = cmd.ExecuteReader()) |
|
192 |
{ |
|
193 |
while (reader.Read()) |
|
194 |
{ |
|
195 |
plantList.Add(reader["NAME"].ToString()); |
|
196 |
} |
|
197 |
} |
|
198 |
} |
|
199 |
} |
|
200 |
} |
|
201 |
} |
|
202 |
else |
|
203 |
{ |
|
204 |
|
|
205 |
} |
|
206 |
} |
|
207 |
catch (Exception ex) |
|
208 |
{ |
|
209 |
|
|
210 |
} |
|
211 |
|
|
212 |
return plantList; |
|
213 |
} |
|
214 |
|
|
215 |
public static DataTable GetUnitTree() |
|
216 |
{ |
|
217 |
DataTable dt = new DataTable(); |
|
218 |
try |
|
219 |
{ |
|
220 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
221 |
|
|
222 |
if (dbInfo.DBType == "ORACLE") |
|
223 |
{ |
|
224 |
string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service); |
|
225 |
connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword; |
|
226 |
|
|
227 |
using (OracleConnection conn = new OracleConnection(connString)) |
|
228 |
{ |
|
229 |
conn.Open(); |
|
230 |
if (conn.State == System.Data.ConnectionState.Open) |
|
231 |
{ |
|
232 |
string sQuery = string.Format(CultureInfo.CurrentCulture, |
|
233 |
@"SELECT SP_ID, PARENTID, NAME |
|
234 |
FROM {0}.T_PLANTGROUP |
|
235 |
START WITH PARENTID='-1' |
|
236 |
CONNECT BY PRIOR SP_ID=PARENTID", dbInfo.Plant); |
|
237 |
|
|
238 |
using (OracleCommand cmd = new OracleCommand(sQuery, conn)) |
|
239 |
using (OracleDataAdapter adapter = new OracleDataAdapter()) |
|
240 |
{ |
|
241 |
adapter.SelectCommand = cmd; |
|
242 |
adapter.Fill(dt); |
|
243 |
} |
|
244 |
} |
|
245 |
} |
|
246 |
} |
|
247 |
else |
|
248 |
{ |
|
249 |
|
|
250 |
} |
|
251 |
} |
|
252 |
catch (Exception ex) |
|
253 |
{ |
|
254 |
|
|
255 |
} |
|
256 |
|
|
257 |
return dt; |
|
258 |
} |
|
259 |
|
|
260 |
public static string GetPlantPID_T_OPTIONSETTING_Value(string name) |
|
261 |
{ |
|
262 |
string TemplatePath = string.Empty; |
|
263 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
264 |
try |
|
265 |
{ |
|
266 |
if (dbInfo.DBType == "ORACLE") |
|
267 |
{ |
|
268 |
string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service); |
|
269 |
connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword; |
|
270 |
|
|
271 |
using (OracleConnection conn = new OracleConnection(connString)) |
|
272 |
{ |
|
273 |
conn.Open(); |
|
274 |
if (conn.State == System.Data.ConnectionState.Open) |
|
275 |
{ |
|
276 |
using (OracleCommand cmd = new OracleCommand()) |
|
277 |
{ |
|
278 |
cmd.Connection = conn; |
|
279 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT VALUE FROM {0}.T_OPTIONSETTING WHERE NAME = '{1}'", dbInfo.PlantPID, name); |
|
280 |
|
|
281 |
using (OracleDataReader reader = cmd.ExecuteReader()) |
|
282 |
{ |
|
283 |
while (reader.Read()) |
|
284 |
{ |
|
285 |
TemplatePath = reader["VALUE"].ToString(); |
|
286 |
break; |
|
287 |
} |
|
288 |
} |
|
289 |
} |
|
290 |
} |
|
291 |
} |
|
292 |
} |
|
293 |
else |
|
294 |
{ |
|
295 |
|
|
296 |
} |
|
297 |
|
|
298 |
} |
|
299 |
catch (Exception ex) |
|
300 |
{ |
|
301 |
|
|
302 |
} |
|
303 |
|
|
304 |
return TemplatePath; |
|
305 |
} |
|
306 |
|
|
307 |
public static List<string> GetSPPIDAttribute() |
|
308 |
{ |
|
309 |
List<string> attributes = new List<string>(); |
|
310 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
311 |
try |
|
312 |
{ |
|
313 |
if (dbInfo.DBType == "ORACLE") |
|
314 |
{ |
|
315 |
string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service); |
|
316 |
connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword; |
|
317 |
|
|
318 |
using (OracleConnection conn = new OracleConnection(connString)) |
|
319 |
{ |
|
320 |
conn.Open(); |
|
321 |
if (conn.State == System.Data.ConnectionState.Open) |
|
322 |
{ |
|
323 |
using (OracleCommand cmd = new OracleCommand()) |
|
324 |
{ |
|
325 |
cmd.Connection = conn; |
|
326 |
|
|
327 |
// 정리 필요 |
|
328 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_EQUIPMENT"); |
|
329 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
330 |
{ |
|
331 |
DataTable dt = reader.GetSchemaTable(); |
|
332 |
foreach (DataRow row in dt.Rows) |
|
333 |
attributes.Add(row["ColumnName"].ToString()); |
|
334 |
} |
|
335 |
|
|
336 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_NOZZLE"); |
|
337 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
338 |
{ |
|
339 |
DataTable dt = reader.GetSchemaTable(); |
|
340 |
foreach (DataRow row in dt.Rows) |
|
341 |
attributes.Add(row["ColumnName"].ToString()); |
|
342 |
} |
|
343 |
|
|
344 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_PIPINGCOMP"); |
|
345 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
346 |
{ |
|
347 |
DataTable dt = reader.GetSchemaTable(); |
|
348 |
foreach (DataRow row in dt.Rows) |
|
349 |
attributes.Add(row["ColumnName"].ToString()); |
|
350 |
} |
|
351 |
|
|
352 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_PIPERUN"); |
|
353 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
354 |
{ |
|
355 |
|
|
356 |
DataTable dt = reader.GetSchemaTable(); |
|
357 |
foreach (DataRow row in dt.Rows) |
|
358 |
attributes.Add(row["ColumnName"].ToString()); |
|
359 |
} |
|
360 |
|
|
361 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_INSTRUMENT"); |
|
362 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
363 |
{ |
|
364 |
DataTable dt = reader.GetSchemaTable(); |
|
365 |
foreach (DataRow row in dt.Rows) |
|
366 |
attributes.Add(row["ColumnName"].ToString()); |
|
367 |
} |
|
368 |
|
|
369 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_INLINECOMP"); |
|
370 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
371 |
{ |
|
372 |
DataTable dt = reader.GetSchemaTable(); |
|
373 |
foreach (DataRow row in dt.Rows) |
|
374 |
attributes.Add(row["ColumnName"].ToString()); |
|
375 |
} |
|
376 |
|
|
377 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_VESSEL"); |
|
378 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
379 |
{ |
|
380 |
DataTable dt = reader.GetSchemaTable(); |
|
381 |
foreach (DataRow row in dt.Rows) |
|
382 |
attributes.Add(row["ColumnName"].ToString()); |
|
383 |
} |
|
384 |
|
|
385 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_EXCHANGER"); |
|
386 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
387 |
{ |
|
388 |
DataTable dt = reader.GetSchemaTable(); |
|
389 |
foreach (DataRow row in dt.Rows) |
|
390 |
attributes.Add(row["ColumnName"].ToString()); |
|
391 |
} |
|
392 |
|
|
393 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_MECHANICAL"); |
|
394 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
395 |
{ |
|
396 |
DataTable dt = reader.GetSchemaTable(); |
|
397 |
foreach (DataRow row in dt.Rows) |
|
398 |
attributes.Add(row["ColumnName"].ToString()); |
|
399 |
} |
|
400 |
|
|
401 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_EQUIPCOMPONENT"); |
|
402 |
using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) |
|
403 |
{ |
|
404 |
DataTable dt = reader.GetSchemaTable(); |
|
405 |
foreach (DataRow row in dt.Rows) |
|
406 |
attributes.Add(row["ColumnName"].ToString()); |
|
407 |
} |
|
408 |
|
|
409 |
} |
|
410 |
} |
|
411 |
} |
|
412 |
} |
|
413 |
else |
|
414 |
{ |
|
415 |
|
|
416 |
} |
|
417 |
} |
|
418 |
catch (Exception ex) |
|
419 |
{ |
|
420 |
|
|
421 |
} |
|
422 |
|
|
423 |
|
|
424 |
|
|
425 |
return attributes.Distinct().ToList(); |
|
426 |
} |
|
427 |
} |
|
428 |
} |
DTI_PID/SPPIDConverter_AutoModeling/DB/DBInformation.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
|
|
7 |
namespace SPPID.DB |
|
8 |
{ |
|
9 |
public sealed class DBInformation |
|
10 |
{ |
|
11 |
private static DBInformation dbInfo; |
|
12 |
|
|
13 |
private string _DBType = string.Empty; |
|
14 |
private string _Service = string.Empty; |
|
15 |
private string _Site = string.Empty; |
|
16 |
private string _ServerIP = string.Empty; |
|
17 |
private string _Port = string.Empty; |
|
18 |
private string _DBUser = string.Empty; |
|
19 |
private string _DBPassword = string.Empty; |
|
20 |
private List<string> _PlantList = new List<string>(); |
|
21 |
private string _SelectedPlant = string.Empty; |
|
22 |
|
|
23 |
private string _PlantPath = string.Empty; |
|
24 |
private string _Plant = string.Empty; |
|
25 |
private string _PlantDic = string.Empty; |
|
26 |
private string _PlantPID = string.Empty; |
|
27 |
private string _PlantPIDDic = string.Empty; |
|
28 |
|
|
29 |
private bool _Status = false; |
|
30 |
|
|
31 |
public string DBType { get => _DBType; set => _DBType = value; } |
|
32 |
public string Service { get => _Service; set => _Service = value; } |
|
33 |
public string Site { get => _Site; set => _Site = value; } |
|
34 |
public string ServerIP { get => _ServerIP; set => _ServerIP = value; } |
|
35 |
public string Port { get => _Port; set => _Port = value; } |
|
36 |
public string DBUser { get => _DBUser; set => _DBUser = value; } |
|
37 |
public string DBPassword { get => _DBPassword; set => _DBPassword = value; } |
|
38 |
public string PlantPath { get => _PlantPath; set => _PlantPath = value; } |
|
39 |
public string PlantDic { get => _PlantDic; set => _PlantDic = value; } |
|
40 |
public string PlantPID { get => _PlantPID; set => _PlantPID = value; } |
|
41 |
public string PlantPIDDic { get => _PlantPIDDic; set => _PlantPIDDic = value; } |
|
42 |
public string Plant { get => _Plant; set => _Plant = value; } |
|
43 |
public bool Status { get => _Status; set => _Status = value; } |
|
44 |
public string SelectedPlant { get => _SelectedPlant; set => _SelectedPlant = value; } |
|
45 |
public List<string> PlantList { get => _PlantList; set => _PlantList = value; } |
|
46 |
|
|
47 |
public static DBInformation GetInstance() |
|
48 |
{ |
|
49 |
if (dbInfo == null) |
|
50 |
dbInfo = new DBInformation(); |
|
51 |
|
|
52 |
return dbInfo; |
|
53 |
} |
|
54 |
} |
|
55 |
} |
DTI_PID/SPPIDConverter_AutoModeling/ItemMapData.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
|
|
7 |
namespace SPPIDConverter_AutoModeling |
|
8 |
{ |
|
9 |
public class ItemMapData |
|
10 |
{ |
|
11 |
|
|
12 |
} |
|
13 |
} |
DTI_PID/SPPIDConverter_AutoModeling/MainControl.Designer.cs | ||
---|---|---|
1 |
namespace SPPIDConverter_AutoModeling |
|
2 |
{ |
|
3 |
partial class MainControl |
|
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 구성 요소 디자이너에서 생성한 코드 |
|
24 |
|
|
25 |
/// <summary> |
|
26 |
/// 디자이너 지원에 필요한 메서드입니다. |
|
27 |
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. |
|
28 |
/// </summary> |
|
29 |
private void InitializeComponent() |
|
30 |
{ |
|
31 |
Telerik.WinControls.UI.GridViewCheckBoxColumn gridViewCheckBoxColumn1 = new Telerik.WinControls.UI.GridViewCheckBoxColumn(); |
|
32 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
33 |
Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn1 = new Telerik.WinControls.UI.GridViewCommandColumn(); |
|
34 |
Telerik.WinControls.UI.GridViewComboBoxColumn gridViewComboBoxColumn1 = new Telerik.WinControls.UI.GridViewComboBoxColumn(); |
|
35 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn2 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
36 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn3 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
37 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn4 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
38 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn5 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
39 |
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition(); |
|
40 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn6 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
41 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn7 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
42 |
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition2 = new Telerik.WinControls.UI.TableViewDefinition(); |
|
43 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn8 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
44 |
Telerik.WinControls.UI.GridViewComboBoxColumn gridViewComboBoxColumn2 = new Telerik.WinControls.UI.GridViewComboBoxColumn(); |
|
45 |
Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn2 = new Telerik.WinControls.UI.GridViewCommandColumn(); |
|
46 |
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition3 = new Telerik.WinControls.UI.TableViewDefinition(); |
|
47 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn9 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
48 |
Telerik.WinControls.UI.GridViewComboBoxColumn gridViewComboBoxColumn3 = new Telerik.WinControls.UI.GridViewComboBoxColumn(); |
|
49 |
Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn3 = new Telerik.WinControls.UI.GridViewCommandColumn(); |
|
50 |
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition4 = new Telerik.WinControls.UI.TableViewDefinition(); |
|
51 |
this.panelMain = new System.Windows.Forms.Panel(); |
|
52 |
this.pageView = new Telerik.WinControls.UI.RadPageView(); |
|
53 |
this.telerikMetroBlueTheme = new Telerik.WinControls.Themes.TelerikMetroBlueTheme(); |
|
54 |
this.materialBlueGreyTheme = new Telerik.WinControls.Themes.MaterialBlueGreyTheme(); |
|
55 |
this.pageConverter = new Telerik.WinControls.UI.RadPageViewPage(); |
|
56 |
this.radPanel2 = new Telerik.WinControls.UI.RadPanel(); |
|
57 |
this.gridViewDrawingList = new Telerik.WinControls.UI.RadGridView(); |
|
58 |
this.radPanel1 = new Telerik.WinControls.UI.RadPanel(); |
|
59 |
this.btnLoadFiles = new Telerik.WinControls.UI.RadButton(); |
|
60 |
this.btnRun = new Telerik.WinControls.UI.RadButton(); |
|
61 |
this.pageSetting = new Telerik.WinControls.UI.RadPageViewPage(); |
|
62 |
this.radPanel3 = new Telerik.WinControls.UI.RadPanel(); |
|
63 |
this.gridViewDB = new Telerik.WinControls.UI.RadGridView(); |
|
64 |
this.radPanel5 = new Telerik.WinControls.UI.RadPanel(); |
|
65 |
this.btnLoadiniFile = new Telerik.WinControls.UI.RadButton(); |
|
66 |
this.btnSPPIDDBTest = new Telerik.WinControls.UI.RadButton(); |
|
67 |
this.btnSave = new Telerik.WinControls.UI.RadButton(); |
|
68 |
this.pageItemMapping = new Telerik.WinControls.UI.RadPageViewPage(); |
|
69 |
this.radPanel4 = new Telerik.WinControls.UI.RadPanel(); |
|
70 |
this.radSplitContainer1 = new Telerik.WinControls.UI.RadSplitContainer(); |
|
71 |
this.splitPanel1 = new Telerik.WinControls.UI.SplitPanel(); |
|
72 |
this.gridViewItemMapping = new Telerik.WinControls.UI.RadGridView(); |
|
73 |
this.splitPanel2 = new Telerik.WinControls.UI.SplitPanel(); |
|
74 |
this.gridViewAttribute = new Telerik.WinControls.UI.RadGridView(); |
|
75 |
this.radPanel6 = new Telerik.WinControls.UI.RadPanel(); |
|
76 |
this.btnMappingSave = new Telerik.WinControls.UI.RadButton(); |
|
77 |
this.pageReport = new Telerik.WinControls.UI.RadPageViewPage(); |
|
78 |
this.panelMain.SuspendLayout(); |
|
79 |
((System.ComponentModel.ISupportInitialize)(this.pageView)).BeginInit(); |
|
80 |
this.pageView.SuspendLayout(); |
|
81 |
this.pageConverter.SuspendLayout(); |
|
82 |
((System.ComponentModel.ISupportInitialize)(this.radPanel2)).BeginInit(); |
|
83 |
this.radPanel2.SuspendLayout(); |
|
84 |
((System.ComponentModel.ISupportInitialize)(this.gridViewDrawingList)).BeginInit(); |
|
85 |
((System.ComponentModel.ISupportInitialize)(this.gridViewDrawingList.MasterTemplate)).BeginInit(); |
|
86 |
((System.ComponentModel.ISupportInitialize)(this.radPanel1)).BeginInit(); |
|
87 |
this.radPanel1.SuspendLayout(); |
|
88 |
((System.ComponentModel.ISupportInitialize)(this.btnLoadFiles)).BeginInit(); |
|
89 |
((System.ComponentModel.ISupportInitialize)(this.btnRun)).BeginInit(); |
|
90 |
this.pageSetting.SuspendLayout(); |
|
91 |
((System.ComponentModel.ISupportInitialize)(this.radPanel3)).BeginInit(); |
|
92 |
this.radPanel3.SuspendLayout(); |
|
93 |
((System.ComponentModel.ISupportInitialize)(this.gridViewDB)).BeginInit(); |
|
94 |
((System.ComponentModel.ISupportInitialize)(this.gridViewDB.MasterTemplate)).BeginInit(); |
|
95 |
((System.ComponentModel.ISupportInitialize)(this.radPanel5)).BeginInit(); |
|
96 |
this.radPanel5.SuspendLayout(); |
|
97 |
((System.ComponentModel.ISupportInitialize)(this.btnLoadiniFile)).BeginInit(); |
|
98 |
((System.ComponentModel.ISupportInitialize)(this.btnSPPIDDBTest)).BeginInit(); |
|
99 |
((System.ComponentModel.ISupportInitialize)(this.btnSave)).BeginInit(); |
|
100 |
this.pageItemMapping.SuspendLayout(); |
|
101 |
((System.ComponentModel.ISupportInitialize)(this.radPanel4)).BeginInit(); |
|
102 |
this.radPanel4.SuspendLayout(); |
|
103 |
((System.ComponentModel.ISupportInitialize)(this.radSplitContainer1)).BeginInit(); |
|
104 |
this.radSplitContainer1.SuspendLayout(); |
|
105 |
((System.ComponentModel.ISupportInitialize)(this.splitPanel1)).BeginInit(); |
|
106 |
this.splitPanel1.SuspendLayout(); |
|
107 |
((System.ComponentModel.ISupportInitialize)(this.gridViewItemMapping)).BeginInit(); |
|
108 |
((System.ComponentModel.ISupportInitialize)(this.gridViewItemMapping.MasterTemplate)).BeginInit(); |
|
109 |
((System.ComponentModel.ISupportInitialize)(this.splitPanel2)).BeginInit(); |
|
110 |
this.splitPanel2.SuspendLayout(); |
|
111 |
((System.ComponentModel.ISupportInitialize)(this.gridViewAttribute)).BeginInit(); |
|
112 |
((System.ComponentModel.ISupportInitialize)(this.gridViewAttribute.MasterTemplate)).BeginInit(); |
|
113 |
((System.ComponentModel.ISupportInitialize)(this.radPanel6)).BeginInit(); |
|
114 |
this.radPanel6.SuspendLayout(); |
|
115 |
((System.ComponentModel.ISupportInitialize)(this.btnMappingSave)).BeginInit(); |
|
116 |
this.SuspendLayout(); |
|
117 |
// |
|
118 |
// panelMain |
|
119 |
// |
|
120 |
this.panelMain.Controls.Add(this.pageView); |
|
121 |
this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill; |
|
122 |
this.panelMain.Location = new System.Drawing.Point(0, 0); |
|
123 |
this.panelMain.Name = "panelMain"; |
|
124 |
this.panelMain.Size = new System.Drawing.Size(735, 900); |
|
125 |
this.panelMain.TabIndex = 0; |
|
126 |
// |
|
127 |
// pageView |
|
128 |
// |
|
129 |
this.pageView.Controls.Add(this.pageConverter); |
|
130 |
this.pageView.Controls.Add(this.pageSetting); |
|
131 |
this.pageView.Controls.Add(this.pageItemMapping); |
|
132 |
this.pageView.Controls.Add(this.pageReport); |
|
133 |
this.pageView.Dock = System.Windows.Forms.DockStyle.Fill; |
|
134 |
this.pageView.Location = new System.Drawing.Point(0, 0); |
|
135 |
this.pageView.Name = "pageView"; |
|
136 |
this.pageView.SelectedPage = this.pageItemMapping; |
|
137 |
this.pageView.Size = new System.Drawing.Size(735, 900); |
|
138 |
this.pageView.TabIndex = 0; |
|
139 |
this.pageView.ThemeName = "TelerikMetroBlue"; |
|
140 |
this.pageView.SelectedPageChanged += new System.EventHandler(this.pageView_SelectedPageChanged); |
|
141 |
((Telerik.WinControls.UI.RadPageViewStripElement)(this.pageView.GetChildAt(0))).StripButtons = Telerik.WinControls.UI.StripViewButtons.None; |
|
142 |
// |
|
143 |
// pageConverter |
|
144 |
// |
|
145 |
this.pageConverter.Controls.Add(this.radPanel2); |
|
146 |
this.pageConverter.Controls.Add(this.radPanel1); |
|
147 |
this.pageConverter.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.Convert; |
|
148 |
this.pageConverter.ItemSize = new System.Drawing.SizeF(98F, 40F); |
|
149 |
this.pageConverter.Location = new System.Drawing.Point(5, 46); |
|
150 |
this.pageConverter.Name = "pageConverter"; |
|
151 |
this.pageConverter.Size = new System.Drawing.Size(725, 849); |
|
152 |
this.pageConverter.Text = "Converter"; |
|
153 |
// |
|
154 |
// radPanel2 |
|
155 |
// |
|
156 |
this.radPanel2.Controls.Add(this.gridViewDrawingList); |
|
157 |
this.radPanel2.Dock = System.Windows.Forms.DockStyle.Fill; |
|
158 |
this.radPanel2.Location = new System.Drawing.Point(0, 33); |
|
159 |
this.radPanel2.Name = "radPanel2"; |
|
160 |
this.radPanel2.Size = new System.Drawing.Size(725, 816); |
|
161 |
this.radPanel2.TabIndex = 1; |
|
162 |
this.radPanel2.Text = "radPanel2"; |
|
163 |
this.radPanel2.ThemeName = "MaterialBlueGrey"; |
|
164 |
// |
|
165 |
// gridViewDrawingList |
|
166 |
// |
|
167 |
this.gridViewDrawingList.Dock = System.Windows.Forms.DockStyle.Fill; |
|
168 |
this.gridViewDrawingList.Location = new System.Drawing.Point(0, 0); |
|
169 |
// |
|
170 |
// |
|
171 |
// |
|
172 |
this.gridViewDrawingList.MasterTemplate.AllowAddNewRow = false; |
|
173 |
this.gridViewDrawingList.MasterTemplate.AllowCellContextMenu = false; |
|
174 |
this.gridViewDrawingList.MasterTemplate.AllowColumnHeaderContextMenu = false; |
|
175 |
this.gridViewDrawingList.MasterTemplate.AllowDeleteRow = false; |
|
176 |
this.gridViewDrawingList.MasterTemplate.AllowRowHeaderContextMenu = false; |
|
177 |
gridViewCheckBoxColumn1.EnableHeaderCheckBox = true; |
|
178 |
gridViewCheckBoxColumn1.HeaderCheckBoxAlignment = System.Drawing.ContentAlignment.MiddleCenter; |
|
179 |
gridViewCheckBoxColumn1.HeaderText = ""; |
|
180 |
gridViewCheckBoxColumn1.MaxWidth = 30; |
|
181 |
gridViewCheckBoxColumn1.MinWidth = 30; |
|
182 |
gridViewCheckBoxColumn1.Name = "colCheckBox"; |
|
183 |
gridViewCheckBoxColumn1.RowSpan = 100; |
|
184 |
gridViewCheckBoxColumn1.Width = 30; |
|
185 |
gridViewTextBoxColumn1.HeaderText = "Drawing File Name"; |
|
186 |
gridViewTextBoxColumn1.Name = "colDrawingFileName"; |
|
187 |
gridViewTextBoxColumn1.ReadOnly = true; |
|
188 |
gridViewTextBoxColumn1.RowSpan = 100; |
|
189 |
gridViewTextBoxColumn1.Width = 130; |
|
190 |
gridViewCommandColumn1.HeaderText = "Unit"; |
|
191 |
gridViewCommandColumn1.Name = "colUnit"; |
|
192 |
gridViewCommandColumn1.Width = 70; |
|
193 |
gridViewComboBoxColumn1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; |
|
194 |
gridViewComboBoxColumn1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown; |
|
195 |
gridViewComboBoxColumn1.HeaderText = "Template"; |
|
196 |
gridViewComboBoxColumn1.Name = "colTemplate"; |
|
197 |
gridViewComboBoxColumn1.Width = 140; |
|
198 |
gridViewTextBoxColumn2.HeaderText = "Drawing Number"; |
|
199 |
gridViewTextBoxColumn2.Name = "colDrawingNumber"; |
|
200 |
gridViewTextBoxColumn2.Width = 119; |
|
201 |
gridViewTextBoxColumn3.HeaderText = "Drawing Name"; |
|
202 |
gridViewTextBoxColumn3.Name = "colDrawingName"; |
|
203 |
gridViewTextBoxColumn3.Width = 104; |
|
204 |
gridViewTextBoxColumn4.HeaderText = "Status"; |
|
205 |
gridViewTextBoxColumn4.MinWidth = 100; |
|
206 |
gridViewTextBoxColumn4.Name = "colStatus"; |
|
207 |
gridViewTextBoxColumn4.ReadOnly = true; |
|
208 |
gridViewTextBoxColumn4.RowSpan = 100; |
|
209 |
gridViewTextBoxColumn4.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; |
|
210 |
gridViewTextBoxColumn4.Width = 100; |
|
211 |
gridViewTextBoxColumn5.HeaderText = "DrawingFullName"; |
|
212 |
gridViewTextBoxColumn5.IsVisible = false; |
|
213 |
gridViewTextBoxColumn5.Name = "colDrawingFullName"; |
|
214 |
gridViewTextBoxColumn5.ReadOnly = true; |
|
215 |
gridViewTextBoxColumn5.Width = 43; |
|
216 |
this.gridViewDrawingList.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { |
|
217 |
gridViewCheckBoxColumn1, |
|
218 |
gridViewTextBoxColumn1, |
|
219 |
gridViewCommandColumn1, |
|
220 |
gridViewComboBoxColumn1, |
|
221 |
gridViewTextBoxColumn2, |
|
222 |
gridViewTextBoxColumn3, |
|
223 |
gridViewTextBoxColumn4, |
|
224 |
gridViewTextBoxColumn5}); |
|
225 |
this.gridViewDrawingList.MasterTemplate.EnableGrouping = false; |
|
226 |
this.gridViewDrawingList.MasterTemplate.ViewDefinition = tableViewDefinition1; |
|
227 |
this.gridViewDrawingList.Name = "gridViewDrawingList"; |
|
228 |
this.gridViewDrawingList.Size = new System.Drawing.Size(725, 816); |
|
229 |
this.gridViewDrawingList.TabIndex = 0; |
|
230 |
this.gridViewDrawingList.ThemeName = "TelerikMetroBlue"; |
|
231 |
this.gridViewDrawingList.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.gridViewDrawingList_CellFormatting); |
|
232 |
this.gridViewDrawingList.CellClick += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gridViewDrawingList_CellClick); |
|
233 |
this.gridViewDrawingList.CellValueChanged += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gridViewDrawingList_CellValueChanged); |
|
234 |
// |
|
235 |
// radPanel1 |
|
236 |
// |
|
237 |
this.radPanel1.Controls.Add(this.btnLoadFiles); |
|
238 |
this.radPanel1.Controls.Add(this.btnRun); |
|
239 |
this.radPanel1.Dock = System.Windows.Forms.DockStyle.Top; |
|
240 |
this.radPanel1.Location = new System.Drawing.Point(0, 0); |
|
241 |
this.radPanel1.Name = "radPanel1"; |
|
242 |
this.radPanel1.Size = new System.Drawing.Size(725, 33); |
|
243 |
this.radPanel1.TabIndex = 0; |
|
244 |
this.radPanel1.ThemeName = "MaterialBlueGrey"; |
|
245 |
// |
|
246 |
// btnLoadFiles |
|
247 |
// |
|
248 |
this.btnLoadFiles.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.Open; |
|
249 |
this.btnLoadFiles.Location = new System.Drawing.Point(0, 0); |
|
250 |
this.btnLoadFiles.Name = "btnLoadFiles"; |
|
251 |
this.btnLoadFiles.Size = new System.Drawing.Size(81, 26); |
|
252 |
this.btnLoadFiles.TabIndex = 1; |
|
253 |
this.btnLoadFiles.Text = "Load Files "; |
|
254 |
this.btnLoadFiles.TextAlignment = System.Drawing.ContentAlignment.MiddleRight; |
|
255 |
this.btnLoadFiles.ThemeName = "TelerikMetroBlue"; |
|
256 |
this.btnLoadFiles.Click += new System.EventHandler(this.btnLoadFiles_Click); |
|
257 |
// |
|
258 |
// btnRun |
|
259 |
// |
|
260 |
this.btnRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); |
|
261 |
this.btnRun.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.Start; |
|
262 |
this.btnRun.Location = new System.Drawing.Point(677, 0); |
|
263 |
this.btnRun.Name = "btnRun"; |
|
264 |
this.btnRun.Size = new System.Drawing.Size(48, 26); |
|
265 |
this.btnRun.TabIndex = 0; |
|
266 |
this.btnRun.Text = "Run "; |
|
267 |
this.btnRun.TextAlignment = System.Drawing.ContentAlignment.MiddleRight; |
|
268 |
this.btnRun.ThemeName = "TelerikMetroBlue"; |
|
269 |
this.btnRun.Click += new System.EventHandler(this.btnRun_Click); |
|
270 |
// |
|
271 |
// pageSetting |
|
272 |
// |
|
273 |
this.pageSetting.Controls.Add(this.radPanel3); |
|
274 |
this.pageSetting.Controls.Add(this.radPanel5); |
|
275 |
this.pageSetting.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.Setting; |
|
276 |
this.pageSetting.ItemSize = new System.Drawing.SizeF(83F, 40F); |
|
277 |
this.pageSetting.Location = new System.Drawing.Point(5, 46); |
|
278 |
this.pageSetting.Name = "pageSetting"; |
|
279 |
this.pageSetting.Size = new System.Drawing.Size(725, 849); |
|
280 |
this.pageSetting.Text = "Setting"; |
|
281 |
// |
|
282 |
// radPanel3 |
|
283 |
// |
|
284 |
this.radPanel3.Controls.Add(this.gridViewDB); |
|
285 |
this.radPanel3.Dock = System.Windows.Forms.DockStyle.Fill; |
|
286 |
this.radPanel3.Location = new System.Drawing.Point(0, 30); |
|
287 |
this.radPanel3.Name = "radPanel3"; |
|
288 |
this.radPanel3.Size = new System.Drawing.Size(725, 819); |
|
289 |
this.radPanel3.TabIndex = 32; |
|
290 |
this.radPanel3.Text = "radPanel3"; |
|
291 |
this.radPanel3.ThemeName = "MaterialBlueGrey"; |
|
292 |
// |
|
293 |
// gridViewDB |
|
294 |
// |
|
295 |
this.gridViewDB.BackColor = System.Drawing.Color.White; |
|
296 |
this.gridViewDB.Cursor = System.Windows.Forms.Cursors.Default; |
|
297 |
this.gridViewDB.Dock = System.Windows.Forms.DockStyle.Fill; |
|
298 |
this.gridViewDB.Font = new System.Drawing.Font("Segoe UI", 9F); |
|
299 |
this.gridViewDB.ForeColor = System.Drawing.SystemColors.ControlText; |
|
300 |
this.gridViewDB.ImeMode = System.Windows.Forms.ImeMode.NoControl; |
|
301 |
this.gridViewDB.Location = new System.Drawing.Point(0, 0); |
|
302 |
// |
|
303 |
// |
|
304 |
// |
|
305 |
this.gridViewDB.MasterTemplate.AllowAddNewRow = false; |
|
306 |
this.gridViewDB.MasterTemplate.AllowDeleteRow = false; |
|
307 |
this.gridViewDB.MasterTemplate.AllowDragToGroup = false; |
|
308 |
this.gridViewDB.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; |
|
309 |
gridViewTextBoxColumn6.EnableExpressionEditor = false; |
|
310 |
gridViewTextBoxColumn6.HeaderText = "Key"; |
|
311 |
gridViewTextBoxColumn6.Name = "colKey"; |
|
312 |
gridViewTextBoxColumn6.ReadOnly = true; |
|
313 |
gridViewTextBoxColumn6.Width = 51; |
|
314 |
gridViewTextBoxColumn7.EnableExpressionEditor = false; |
|
315 |
gridViewTextBoxColumn7.HeaderText = "Value"; |
|
316 |
gridViewTextBoxColumn7.Name = "colValue"; |
|
317 |
gridViewTextBoxColumn7.Width = 674; |
|
318 |
this.gridViewDB.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { |
|
319 |
gridViewTextBoxColumn6, |
|
320 |
gridViewTextBoxColumn7}); |
|
321 |
this.gridViewDB.MasterTemplate.EnableGrouping = false; |
|
322 |
this.gridViewDB.MasterTemplate.EnableSorting = false; |
|
323 |
this.gridViewDB.MasterTemplate.ShowRowHeaderColumn = false; |
|
324 |
this.gridViewDB.MasterTemplate.ViewDefinition = tableViewDefinition2; |
|
325 |
this.gridViewDB.Name = "gridViewDB"; |
|
326 |
this.gridViewDB.RightToLeft = System.Windows.Forms.RightToLeft.No; |
|
327 |
this.gridViewDB.Size = new System.Drawing.Size(725, 819); |
|
328 |
this.gridViewDB.TabIndex = 29; |
|
329 |
this.gridViewDB.ThemeName = "TelerikMetroBlue"; |
|
330 |
this.gridViewDB.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.gridViewDB_CellFormatting); |
|
331 |
// |
|
332 |
// radPanel5 |
|
333 |
// |
|
334 |
this.radPanel5.Controls.Add(this.btnLoadiniFile); |
|
335 |
this.radPanel5.Controls.Add(this.btnSPPIDDBTest); |
|
336 |
this.radPanel5.Controls.Add(this.btnSave); |
|
337 |
this.radPanel5.Dock = System.Windows.Forms.DockStyle.Top; |
|
338 |
this.radPanel5.Location = new System.Drawing.Point(0, 0); |
|
339 |
this.radPanel5.Name = "radPanel5"; |
|
340 |
this.radPanel5.Size = new System.Drawing.Size(725, 30); |
|
341 |
this.radPanel5.TabIndex = 31; |
|
342 |
this.radPanel5.ThemeName = "MaterialBlueGrey"; |
|
343 |
// |
|
344 |
// btnLoadiniFile |
|
345 |
// |
|
346 |
this.btnLoadiniFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); |
|
347 |
this.btnLoadiniFile.Location = new System.Drawing.Point(0, 3); |
|
348 |
this.btnLoadiniFile.Name = "btnLoadiniFile"; |
|
349 |
this.btnLoadiniFile.Size = new System.Drawing.Size(110, 24); |
|
350 |
this.btnLoadiniFile.TabIndex = 13; |
|
351 |
this.btnLoadiniFile.Text = "Load Plant ini File"; |
|
352 |
this.btnLoadiniFile.ThemeName = "TelerikMetroBlue"; |
|
353 |
this.btnLoadiniFile.Click += new System.EventHandler(this.btnLoadiniFile_Click); |
|
354 |
// |
|
355 |
// btnSPPIDDBTest |
|
356 |
// |
|
357 |
this.btnSPPIDDBTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); |
|
358 |
this.btnSPPIDDBTest.Location = new System.Drawing.Point(555, 3); |
|
359 |
this.btnSPPIDDBTest.Name = "btnSPPIDDBTest"; |
|
360 |
this.btnSPPIDDBTest.Size = new System.Drawing.Size(82, 24); |
|
361 |
this.btnSPPIDDBTest.TabIndex = 25; |
|
362 |
this.btnSPPIDDBTest.Text = "DB Test"; |
|
363 |
this.btnSPPIDDBTest.ThemeName = "TelerikMetroBlue"; |
|
364 |
this.btnSPPIDDBTest.Click += new System.EventHandler(this.btnSPPIDDBTest_Click); |
|
365 |
// |
|
366 |
// btnSave |
|
367 |
// |
|
368 |
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); |
|
369 |
this.btnSave.Enabled = false; |
|
370 |
this.btnSave.Location = new System.Drawing.Point(643, 3); |
|
371 |
this.btnSave.Name = "btnSave"; |
|
372 |
this.btnSave.Size = new System.Drawing.Size(82, 24); |
|
373 |
this.btnSave.TabIndex = 28; |
|
374 |
this.btnSave.Text = "Save"; |
|
375 |
this.btnSave.ThemeName = "TelerikMetroBlue"; |
|
376 |
this.btnSave.Click += new System.EventHandler(this.btnSave_Click); |
|
377 |
// |
|
378 |
// pageItemMapping |
|
379 |
// |
|
380 |
this.pageItemMapping.Controls.Add(this.radPanel4); |
|
381 |
this.pageItemMapping.Controls.Add(this.radPanel6); |
|
382 |
this.pageItemMapping.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.ItemMapping; |
|
383 |
this.pageItemMapping.ItemSize = new System.Drawing.SizeF(122F, 40F); |
|
384 |
this.pageItemMapping.Location = new System.Drawing.Point(5, 46); |
|
385 |
this.pageItemMapping.Name = "pageItemMapping"; |
|
386 |
this.pageItemMapping.Size = new System.Drawing.Size(725, 849); |
|
387 |
this.pageItemMapping.Text = "Item Mapping"; |
|
388 |
// |
|
389 |
// radPanel4 |
|
390 |
// |
|
391 |
this.radPanel4.Controls.Add(this.radSplitContainer1); |
|
392 |
this.radPanel4.Dock = System.Windows.Forms.DockStyle.Fill; |
|
393 |
this.radPanel4.Location = new System.Drawing.Point(0, 30); |
|
394 |
this.radPanel4.Name = "radPanel4"; |
|
395 |
this.radPanel4.Size = new System.Drawing.Size(725, 819); |
|
396 |
this.radPanel4.TabIndex = 5; |
|
397 |
this.radPanel4.ThemeName = "MaterialBlueGrey"; |
|
398 |
// |
|
399 |
// radSplitContainer1 |
|
400 |
// |
|
401 |
this.radSplitContainer1.Controls.Add(this.splitPanel1); |
|
402 |
this.radSplitContainer1.Controls.Add(this.splitPanel2); |
|
403 |
this.radSplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; |
|
404 |
this.radSplitContainer1.Location = new System.Drawing.Point(0, 0); |
|
405 |
this.radSplitContainer1.Name = "radSplitContainer1"; |
|
406 |
this.radSplitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; |
|
407 |
// |
|
408 |
// |
|
409 |
// |
|
410 |
this.radSplitContainer1.RootElement.MinSize = new System.Drawing.Size(25, 25); |
|
411 |
this.radSplitContainer1.Size = new System.Drawing.Size(725, 819); |
|
412 |
this.radSplitContainer1.TabIndex = 4; |
|
413 |
this.radSplitContainer1.TabStop = false; |
|
414 |
this.radSplitContainer1.ThemeName = "TelerikMetroBlue"; |
|
415 |
// |
|
416 |
// splitPanel1 |
|
417 |
// |
|
418 |
this.splitPanel1.Controls.Add(this.gridViewItemMapping); |
|
419 |
this.splitPanel1.Location = new System.Drawing.Point(0, 0); |
|
420 |
this.splitPanel1.Name = "splitPanel1"; |
|
421 |
// |
|
422 |
// |
|
423 |
// |
|
424 |
this.splitPanel1.RootElement.MinSize = new System.Drawing.Size(25, 25); |
|
425 |
this.splitPanel1.Size = new System.Drawing.Size(725, 408); |
|
426 |
this.splitPanel1.TabIndex = 0; |
|
427 |
this.splitPanel1.TabStop = false; |
|
428 |
this.splitPanel1.Text = "splitPanel1"; |
|
429 |
this.splitPanel1.ThemeName = "TelerikMetroBlue"; |
|
430 |
// |
|
431 |
// gridViewItemMapping |
|
432 |
// |
|
433 |
this.gridViewItemMapping.Dock = System.Windows.Forms.DockStyle.Fill; |
|
434 |
this.gridViewItemMapping.Location = new System.Drawing.Point(0, 0); |
|
435 |
// |
|
436 |
// |
|
437 |
// |
|
438 |
this.gridViewItemMapping.MasterTemplate.AllowAddNewRow = false; |
|
439 |
this.gridViewItemMapping.MasterTemplate.AllowCellContextMenu = false; |
|
440 |
this.gridViewItemMapping.MasterTemplate.AllowColumnHeaderContextMenu = false; |
|
441 |
this.gridViewItemMapping.MasterTemplate.AllowRowHeaderContextMenu = false; |
|
442 |
gridViewTextBoxColumn8.HeaderText = "Item Name"; |
|
443 |
gridViewTextBoxColumn8.Name = "colItemName"; |
|
444 |
gridViewTextBoxColumn8.Width = 80; |
|
445 |
gridViewComboBoxColumn2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; |
|
446 |
gridViewComboBoxColumn2.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown; |
|
447 |
gridViewComboBoxColumn2.HeaderText = "SPPID Name"; |
|
448 |
gridViewComboBoxColumn2.Name = "colSPPIDName"; |
|
449 |
gridViewComboBoxColumn2.Width = 89; |
|
450 |
gridViewCommandColumn2.HeaderText = "Select in Explorer"; |
|
451 |
gridViewCommandColumn2.Name = "colSelect"; |
|
452 |
gridViewCommandColumn2.Width = 118; |
|
453 |
this.gridViewItemMapping.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { |
|
454 |
gridViewTextBoxColumn8, |
|
455 |
gridViewComboBoxColumn2, |
|
456 |
gridViewCommandColumn2}); |
|
457 |
this.gridViewItemMapping.MasterTemplate.EnableGrouping = false; |
|
458 |
this.gridViewItemMapping.MasterTemplate.ViewDefinition = tableViewDefinition3; |
|
459 |
this.gridViewItemMapping.Name = "gridViewItemMapping"; |
|
460 |
this.gridViewItemMapping.ShowGroupPanel = false; |
|
461 |
this.gridViewItemMapping.Size = new System.Drawing.Size(725, 408); |
|
462 |
this.gridViewItemMapping.TabIndex = 0; |
|
463 |
this.gridViewItemMapping.ThemeName = "TelerikMetroBlue"; |
|
464 |
this.gridViewItemMapping.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.gridViewItemMapping_CellFormatting); |
|
465 |
// |
|
466 |
// splitPanel2 |
|
467 |
// |
|
468 |
this.splitPanel2.Controls.Add(this.gridViewAttribute); |
|
469 |
this.splitPanel2.Location = new System.Drawing.Point(0, 412); |
|
470 |
this.splitPanel2.Name = "splitPanel2"; |
|
471 |
// |
|
472 |
// |
|
473 |
// |
|
474 |
this.splitPanel2.RootElement.MinSize = new System.Drawing.Size(25, 25); |
|
475 |
this.splitPanel2.Size = new System.Drawing.Size(725, 407); |
|
476 |
this.splitPanel2.TabIndex = 1; |
|
477 |
this.splitPanel2.TabStop = false; |
|
478 |
this.splitPanel2.Text = "splitPanel2"; |
|
479 |
this.splitPanel2.ThemeName = "TelerikMetroBlue"; |
|
480 |
// |
|
481 |
// gridViewAttribute |
|
482 |
// |
|
483 |
this.gridViewAttribute.Dock = System.Windows.Forms.DockStyle.Fill; |
|
484 |
this.gridViewAttribute.Location = new System.Drawing.Point(0, 0); |
|
485 |
// |
|
486 |
// |
|
487 |
// |
|
488 |
this.gridViewAttribute.MasterTemplate.AllowAddNewRow = false; |
|
489 |
this.gridViewAttribute.MasterTemplate.AllowCellContextMenu = false; |
|
490 |
this.gridViewAttribute.MasterTemplate.AllowColumnHeaderContextMenu = false; |
|
491 |
this.gridViewAttribute.MasterTemplate.AllowRowHeaderContextMenu = false; |
|
492 |
gridViewTextBoxColumn9.HeaderText = "Attribute"; |
|
493 |
gridViewTextBoxColumn9.Name = "colAttribute"; |
|
494 |
gridViewTextBoxColumn9.Width = 66; |
|
495 |
gridViewComboBoxColumn3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; |
|
496 |
gridViewComboBoxColumn3.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown; |
|
497 |
gridViewComboBoxColumn3.HeaderText = "SPPID Attribute"; |
|
498 |
gridViewComboBoxColumn3.Name = "colSPPIDAttribute"; |
|
499 |
gridViewComboBoxColumn3.Width = 108; |
|
500 |
gridViewCommandColumn3.HeaderText = "Select in Explorer"; |
|
501 |
gridViewCommandColumn3.Name = "colSelect"; |
|
502 |
gridViewCommandColumn3.Width = 118; |
|
503 |
this.gridViewAttribute.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { |
|
504 |
gridViewTextBoxColumn9, |
|
505 |
gridViewComboBoxColumn3, |
|
506 |
gridViewCommandColumn3}); |
|
507 |
this.gridViewAttribute.MasterTemplate.EnableGrouping = false; |
|
508 |
this.gridViewAttribute.MasterTemplate.ViewDefinition = tableViewDefinition4; |
|
509 |
this.gridViewAttribute.Name = "gridViewAttribute"; |
|
510 |
this.gridViewAttribute.ShowGroupPanel = false; |
|
511 |
this.gridViewAttribute.Size = new System.Drawing.Size(725, 407); |
|
512 |
this.gridViewAttribute.TabIndex = 1; |
|
513 |
this.gridViewAttribute.ThemeName = "TelerikMetroBlue"; |
|
514 |
this.gridViewAttribute.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.gridViewAttribute_CellFormatting); |
|
515 |
// |
|
516 |
// radPanel6 |
|
517 |
// |
|
518 |
this.radPanel6.Controls.Add(this.btnMappingSave); |
|
519 |
this.radPanel6.Dock = System.Windows.Forms.DockStyle.Top; |
|
520 |
this.radPanel6.Location = new System.Drawing.Point(0, 0); |
|
521 |
this.radPanel6.Name = "radPanel6"; |
|
522 |
this.radPanel6.Size = new System.Drawing.Size(725, 30); |
|
523 |
this.radPanel6.TabIndex = 4; |
|
524 |
this.radPanel6.ThemeName = "MaterialBlueGrey"; |
|
525 |
// |
|
526 |
// btnMappingSave |
|
527 |
// |
|
528 |
this.btnMappingSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); |
|
529 |
this.btnMappingSave.Location = new System.Drawing.Point(643, 3); |
|
530 |
this.btnMappingSave.Name = "btnMappingSave"; |
|
531 |
this.btnMappingSave.Size = new System.Drawing.Size(82, 24); |
|
532 |
this.btnMappingSave.TabIndex = 29; |
|
533 |
this.btnMappingSave.Text = "Save"; |
|
534 |
this.btnMappingSave.ThemeName = "TelerikMetroBlue"; |
|
535 |
this.btnMappingSave.Click += new System.EventHandler(this.btnMappingSave_Click); |
|
536 |
// |
|
537 |
// pageReport |
|
538 |
// |
|
539 |
this.pageReport.Enabled = false; |
|
540 |
this.pageReport.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.Report; |
|
541 |
this.pageReport.ItemSize = new System.Drawing.SizeF(81F, 40F); |
|
542 |
this.pageReport.Location = new System.Drawing.Point(5, 46); |
|
543 |
this.pageReport.Name = "pageReport"; |
|
544 |
this.pageReport.Size = new System.Drawing.Size(725, 849); |
|
545 |
this.pageReport.Text = "Report"; |
|
546 |
// |
|
547 |
// MainControl |
|
548 |
// |
|
549 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); |
|
550 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|
551 |
this.Controls.Add(this.panelMain); |
|
552 |
this.Name = "MainControl"; |
|
553 |
this.Size = new System.Drawing.Size(735, 900); |
|
554 |
this.panelMain.ResumeLayout(false); |
|
555 |
((System.ComponentModel.ISupportInitialize)(this.pageView)).EndInit(); |
|
556 |
this.pageView.ResumeLayout(false); |
|
557 |
this.pageConverter.ResumeLayout(false); |
|
558 |
((System.ComponentModel.ISupportInitialize)(this.radPanel2)).EndInit(); |
|
559 |
this.radPanel2.ResumeLayout(false); |
|
560 |
((System.ComponentModel.ISupportInitialize)(this.gridViewDrawingList.MasterTemplate)).EndInit(); |
|
561 |
((System.ComponentModel.ISupportInitialize)(this.gridViewDrawingList)).EndInit(); |
|
562 |
((System.ComponentModel.ISupportInitialize)(this.radPanel1)).EndInit(); |
|
563 |
this.radPanel1.ResumeLayout(false); |
|
564 |
((System.ComponentModel.ISupportInitialize)(this.btnLoadFiles)).EndInit(); |
|
565 |
((System.ComponentModel.ISupportInitialize)(this.btnRun)).EndInit(); |
|
566 |
this.pageSetting.ResumeLayout(false); |
|
567 |
((System.ComponentModel.ISupportInitialize)(this.radPanel3)).EndInit(); |
|
568 |
this.radPanel3.ResumeLayout(false); |
|
569 |
((System.ComponentModel.ISupportInitialize)(this.gridViewDB.MasterTemplate)).EndInit(); |
|
570 |
((System.ComponentModel.ISupportInitialize)(this.gridViewDB)).EndInit(); |
|
571 |
((System.ComponentModel.ISupportInitialize)(this.radPanel5)).EndInit(); |
|
572 |
this.radPanel5.ResumeLayout(false); |
|
573 |
((System.ComponentModel.ISupportInitialize)(this.btnLoadiniFile)).EndInit(); |
|
574 |
((System.ComponentModel.ISupportInitialize)(this.btnSPPIDDBTest)).EndInit(); |
|
575 |
((System.ComponentModel.ISupportInitialize)(this.btnSave)).EndInit(); |
|
576 |
this.pageItemMapping.ResumeLayout(false); |
|
577 |
((System.ComponentModel.ISupportInitialize)(this.radPanel4)).EndInit(); |
|
578 |
this.radPanel4.ResumeLayout(false); |
|
579 |
((System.ComponentModel.ISupportInitialize)(this.radSplitContainer1)).EndInit(); |
|
580 |
this.radSplitContainer1.ResumeLayout(false); |
|
581 |
((System.ComponentModel.ISupportInitialize)(this.splitPanel1)).EndInit(); |
|
582 |
this.splitPanel1.ResumeLayout(false); |
|
583 |
((System.ComponentModel.ISupportInitialize)(this.gridViewItemMapping.MasterTemplate)).EndInit(); |
|
584 |
((System.ComponentModel.ISupportInitialize)(this.gridViewItemMapping)).EndInit(); |
|
585 |
((System.ComponentModel.ISupportInitialize)(this.splitPanel2)).EndInit(); |
|
586 |
this.splitPanel2.ResumeLayout(false); |
|
587 |
((System.ComponentModel.ISupportInitialize)(this.gridViewAttribute.MasterTemplate)).EndInit(); |
|
588 |
((System.ComponentModel.ISupportInitialize)(this.gridViewAttribute)).EndInit(); |
|
589 |
((System.ComponentModel.ISupportInitialize)(this.radPanel6)).EndInit(); |
|
590 |
this.radPanel6.ResumeLayout(false); |
|
591 |
((System.ComponentModel.ISupportInitialize)(this.btnMappingSave)).EndInit(); |
|
592 |
this.ResumeLayout(false); |
|
593 |
|
|
594 |
} |
|
595 |
|
|
596 |
#endregion |
|
597 |
|
|
598 |
private System.Windows.Forms.Panel panelMain; |
|
599 |
private Telerik.WinControls.UI.RadPageView pageView; |
|
600 |
private Telerik.WinControls.UI.RadPageViewPage pageConverter; |
|
601 |
private Telerik.WinControls.UI.RadPageViewPage pageItemMapping; |
|
602 |
private Telerik.WinControls.UI.RadPageViewPage pageReport; |
|
603 |
private Telerik.WinControls.Themes.TelerikMetroBlueTheme telerikMetroBlueTheme; |
|
604 |
private Telerik.WinControls.Themes.MaterialBlueGreyTheme materialBlueGreyTheme; |
|
605 |
private Telerik.WinControls.UI.RadPanel radPanel2; |
|
606 |
private Telerik.WinControls.UI.RadPanel radPanel1; |
|
607 |
private Telerik.WinControls.UI.RadGridView gridViewDrawingList; |
|
608 |
private Telerik.WinControls.UI.RadButton btnLoadFiles; |
|
609 |
private Telerik.WinControls.UI.RadButton btnRun; |
|
610 |
private Telerik.WinControls.UI.RadPageViewPage pageSetting; |
|
611 |
private Telerik.WinControls.UI.RadButton btnSPPIDDBTest; |
|
612 |
private Telerik.WinControls.UI.RadButton btnLoadiniFile; |
|
613 |
private Telerik.WinControls.UI.RadButton btnSave; |
|
614 |
private Telerik.WinControls.UI.RadPanel radPanel3; |
|
615 |
private Telerik.WinControls.UI.RadGridView gridViewDB; |
|
616 |
private Telerik.WinControls.UI.RadPanel radPanel5; |
|
617 |
private Telerik.WinControls.UI.RadPanel radPanel4; |
|
618 |
private Telerik.WinControls.UI.RadSplitContainer radSplitContainer1; |
|
619 |
private Telerik.WinControls.UI.SplitPanel splitPanel1; |
|
620 |
private Telerik.WinControls.UI.RadGridView gridViewItemMapping; |
|
621 |
private Telerik.WinControls.UI.SplitPanel splitPanel2; |
|
622 |
private Telerik.WinControls.UI.RadPanel radPanel6; |
|
623 |
private Telerik.WinControls.UI.RadButton btnMappingSave; |
|
624 |
private Telerik.WinControls.UI.RadGridView gridViewAttribute; |
|
625 |
} |
|
626 |
} |
DTI_PID/SPPIDConverter_AutoModeling/MainControl.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.ComponentModel; |
|
4 |
using System.Drawing; |
|
5 |
using System.Data; |
|
6 |
using System.Linq; |
|
7 |
using System.Text; |
|
8 |
using System.Threading.Tasks; |
|
9 |
using System.Windows.Forms; |
|
10 |
using Microsoft.Win32; |
|
11 |
using Telerik.WinControls.UI; |
|
12 |
using System.IO; |
|
13 |
using System.Threading; |
|
14 |
using SPPID.Modeling; |
|
15 |
using SPPID.Model; |
|
16 |
using SPPID.Utill; |
|
17 |
using SPPID.DB; |
|
18 |
using Microsoft.VisualBasic; |
|
19 |
using Newtonsoft.Json; |
|
20 |
|
|
21 |
namespace SPPIDConverter_AutoModeling |
|
22 |
{ |
|
23 |
public partial class MainControl : UserControl |
|
24 |
{ |
|
25 |
Thread autoModelingThread; |
|
26 |
|
|
27 |
private Dictionary<string, string> symbolMapping = new Dictionary<string, string>(); |
|
28 |
private Dictionary<string, string> attributeMapping = new Dictionary<string, string>(); |
|
29 |
private DataTable dUnit = new DataTable(); |
|
30 |
private string TemplatePath; |
|
31 |
private string SymbolPath; |
|
32 |
|
|
33 |
public MainControl() |
|
34 |
{ |
|
35 |
InitializeComponent(); |
|
36 |
|
|
37 |
if (SetPath()) |
|
38 |
{ |
|
39 |
if (SPPIDUtill.LoadDB()) |
|
40 |
InitDBInformation(); |
|
41 |
else |
|
42 |
MessageBox.Show("Please Check DB Setting", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
43 |
InitGridViewDB(); |
|
44 |
} |
|
45 |
else |
|
46 |
{ |
|
47 |
|
|
48 |
} |
|
49 |
} |
|
50 |
|
|
51 |
private bool SetPath() |
|
52 |
{ |
|
53 |
try |
|
54 |
{ |
|
55 |
RegistryKey key = Registry.LocalMachine; |
|
56 |
RegistryKey software = key.OpenSubKey("SOFTWARE"); |
|
57 |
RegistryKey DOFTECH = software.OpenSubKey("DOFTECH"); |
|
58 |
if (DOFTECH != null) |
|
59 |
{ |
|
60 |
RegistryKey ID2 = DOFTECH.OpenSubKey("ID2"); |
|
61 |
if (ID2 != null) |
|
62 |
{ |
|
63 |
SPPIDUtill.defaultPath = ID2.GetValue("Path").ToString(); |
|
64 |
Log.logPath = SPPIDUtill.defaultPath + @"Converter\SPPID Converter.log"; |
|
65 |
SPPIDUtill.mappingFilePath = SPPIDUtill.defaultPath + @"Converter\mapping.xml"; |
|
66 |
SPPIDUtill.dbFilePath = SPPIDUtill.defaultPath + @"Converter\DB.config"; |
|
67 |
|
|
68 |
return true; |
|
69 |
} |
|
70 |
} |
|
71 |
} |
|
72 |
catch (Exception ex) |
|
73 |
{ |
|
74 |
|
|
75 |
} |
|
76 |
|
|
77 |
return false; |
|
78 |
} |
|
79 |
|
|
80 |
#region Init Data Setting |
|
81 |
|
|
82 |
public void InitDBInformation() |
|
83 |
{ |
|
84 |
// Unit DataTable |
|
85 |
dUnit = DB.GetUnitTree(); |
|
86 |
|
|
87 |
// Template List |
|
88 |
TemplatePath = DB.GetPlantPID_T_OPTIONSETTING_Value("PID Template Path"); |
|
89 |
GridViewComboBoxColumn colTemplate = gridViewDrawingList.Columns["colTemplate"] as GridViewComboBoxColumn; |
|
90 |
colTemplate.DataSource = Directory.GetFiles(TemplatePath, "*.pid").ToList().Select(filePath => Path.GetFileName(filePath)); |
|
91 |
|
|
92 |
// Load Mapping |
|
93 |
SPPIDUtill.LoadMapping(symbolMapping, attributeMapping); |
|
94 |
|
|
95 |
// Symbol Path |
|
96 |
SymbolPath = DB.GetPlantPID_T_OPTIONSETTING_Value("Catalog Explorer root path"); |
|
97 |
GridViewComboBoxColumn colSPPIDName = gridViewItemMapping.Columns["colSPPIDName"] as GridViewComboBoxColumn; |
|
98 |
colSPPIDName.DataSource = Directory.GetFiles(SymbolPath, "*.sym", SearchOption.AllDirectories).ToList().Select(symbol => symbol.Remove(0, SymbolPath.Length)); |
|
99 |
|
|
100 |
// Load Mapping |
|
101 |
SPPIDUtill.LoadMapping(symbolMapping, attributeMapping); |
|
102 |
gridViewItemMapping.BeginUpdate(); |
|
103 |
foreach (var item in symbolMapping) |
|
104 |
gridViewItemMapping.Rows.Add(new object[] {item.Key,item.Value, "View" }); |
|
105 |
gridViewItemMapping.BestFitColumns(); |
|
106 |
gridViewItemMapping.EndUpdate(); |
|
107 |
|
|
108 |
// Attribute |
|
109 |
GridViewComboBoxColumn colSPPIDAttribute = gridViewAttribute.Columns["colSPPIDAttribute"] as GridViewComboBoxColumn; |
|
110 |
colSPPIDAttribute.DataSource = DB.GetSPPIDAttribute(); |
|
111 |
|
|
112 |
// Load Attribute |
|
113 |
gridViewAttribute.BeginUpdate(); |
|
114 |
foreach (var item in attributeMapping) |
|
115 |
gridViewAttribute.Rows.Add(new object[] { item.Key, item.Value, "View" }); |
|
116 |
gridViewAttribute.BestFitColumns(); |
|
117 |
gridViewAttribute.EndUpdate(); |
|
118 |
} |
|
119 |
|
|
120 |
#endregion |
|
121 |
|
|
122 |
|
|
123 |
#region Setting Page |
|
124 |
private const string _DBType = "DB Type"; |
|
125 |
private const string _ServiceName = "Service Name"; |
|
126 |
private const string _SiteName = "Site Name"; |
|
127 |
private const string _ServerIP = "Server IP"; |
|
128 |
private const string _Port = "Port"; |
|
129 |
private const string _DBUser = "DB User"; |
|
130 |
private const string _DBPassword = "DB Password"; |
|
131 |
|
|
132 |
private void InitGridViewDB() |
|
133 |
{ |
|
134 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
135 |
|
|
136 |
gridViewDB.Rows.Add(new object[] { _DBType , dbInfo.DBType}); |
|
137 |
gridViewDB.Rows.Add(new object[] { _ServiceName, dbInfo.Service }); |
|
138 |
gridViewDB.Rows.Add(new object[] { _SiteName, dbInfo.Site}); |
|
139 |
gridViewDB.Rows.Add(new object[] { _ServerIP, dbInfo.ServerIP}); |
|
140 |
gridViewDB.Rows.Add(new object[] { _Port, dbInfo.Port}); |
|
141 |
gridViewDB.Rows.Add(new object[] { _DBUser, dbInfo.DBUser}); |
|
142 |
gridViewDB.Rows.Add(new object[] { _DBPassword, dbInfo.DBPassword}); |
|
143 |
gridViewDB.BestFitColumns(); |
|
144 |
|
|
145 |
this.gridViewDB.RowFormatting += new Telerik.WinControls.UI.RowFormattingEventHandler(this.gridViewDB_RowFormatting); |
|
146 |
this.gridViewDB.CellBeginEdit += new Telerik.WinControls.UI.GridViewCellCancelEventHandler(this.gridViewDB_CellBeginEdit); |
|
147 |
this.gridViewDB.CellValueChanged += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gridViewDB_CellValueChanged); |
|
148 |
} |
|
149 |
|
|
150 |
private void gridViewDB_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) |
|
151 |
{ |
|
152 |
string sKey = (string)e.Row.Cells["colKey"].Value; |
|
153 |
if (sKey == _DBType || |
|
154 |
sKey == _ServiceName || |
|
155 |
sKey == _SiteName) |
|
156 |
{ |
|
157 |
e.Cancel = true; |
|
158 |
} |
|
159 |
else |
|
160 |
{ |
|
161 |
|
|
162 |
} |
|
163 |
} |
|
164 |
|
|
165 |
private void gridViewDB_RowFormatting(object sender, RowFormattingEventArgs e) |
|
166 |
{ |
|
167 |
string sKey = (string)e.RowElement.RowInfo.Cells["colKey"].Value; |
|
168 |
if (sKey == _DBType || |
|
169 |
sKey == _ServiceName || |
|
170 |
sKey == _SiteName) |
|
171 |
{ |
|
172 |
e.RowElement.DrawFill = true; |
|
173 |
e.RowElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; |
|
174 |
e.RowElement.BackColor = Color.Aquamarine; |
|
175 |
} |
|
176 |
} |
|
177 |
|
|
178 |
private void gridViewDB_CellValueChanged(object sender, GridViewCellEventArgs e) |
|
179 |
{ |
|
180 |
btnSave.Enabled = false; |
|
181 |
} |
|
182 |
|
|
183 |
private void btnLoadiniFile_Click(object sender, EventArgs e) |
|
184 |
{ |
|
185 |
try |
|
186 |
{ |
|
187 |
OpenFileDialog dialog = new OpenFileDialog(); |
|
188 |
dialog.Multiselect = false; |
|
189 |
dialog.Filter = "ini File(*.ini)|*.ini"; |
|
190 |
if (dialog.ShowDialog() == DialogResult.OK) |
|
191 |
{ |
|
192 |
string sDBTYPE = string.Empty; |
|
193 |
string sSERVICENAME = string.Empty; |
|
194 |
string sUID = string.Empty; |
|
195 |
|
|
196 |
string[] texts = File.ReadAllLines(dialog.FileName); |
|
197 |
|
|
198 |
bool find = false; |
|
199 |
for (int i = 0; i < texts.Length; i++) |
|
200 |
{ |
|
201 |
string text = texts[i]; |
|
202 |
|
|
203 |
if (text.Trim() == "[SITESCHEMA]") |
|
204 |
find = true; |
|
205 |
|
|
206 |
if (find) |
|
207 |
{ |
|
208 |
if (text.StartsWith("DBTYPE=") && string.IsNullOrEmpty(sDBTYPE)) |
|
209 |
sDBTYPE = text.Remove(0, "DBTYPE=".Length); |
|
210 |
else if (text.StartsWith("DBSERVER=") && string.IsNullOrEmpty(sSERVICENAME)) |
|
211 |
sSERVICENAME = text.Remove(0, "DBSERVER=".Length); |
|
212 |
else if (text.StartsWith("UID=") && string.IsNullOrEmpty(sUID)) |
|
213 |
sUID = text.Remove(0, "UID=".Length); |
|
214 |
} |
|
215 |
} |
|
216 |
|
|
217 |
if (string.IsNullOrEmpty(sDBTYPE) || string.IsNullOrEmpty(sSERVICENAME) || string.IsNullOrEmpty(sUID)) |
|
218 |
MessageBox.Show("Unavailable ini file.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
219 |
else |
|
220 |
{ |
|
221 |
foreach (GridViewRowInfo rowInfo in gridViewDB.Rows) |
|
222 |
{ |
|
223 |
string sKey = (string)rowInfo.Cells["colKey"].Value; |
|
224 |
if (sKey == _DBType) |
|
225 |
rowInfo.Cells["colValue"].Value = sDBTYPE; |
|
226 |
else if (sKey == _ServiceName) |
|
227 |
rowInfo.Cells["colValue"].Value = sSERVICENAME; |
|
228 |
else if (sKey == _SiteName) |
|
229 |
rowInfo.Cells["colValue"].Value = sUID; |
|
230 |
} |
|
231 |
} |
|
232 |
} |
|
233 |
} |
|
234 |
catch (Exception ex) |
|
235 |
{ |
|
236 |
MessageBox.Show("Unavailable ini file.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
237 |
} |
|
238 |
} |
|
239 |
|
|
240 |
private void btnSPPIDDBTest_Click(object sender, EventArgs e) |
|
241 |
{ |
|
242 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
243 |
dbInfo.Status = false; |
|
244 |
foreach (GridViewRowInfo rowInfo in gridViewDB.Rows) |
|
245 |
{ |
|
246 |
string sKey = (string)rowInfo.Cells["colKey"].Value; |
|
247 |
string sValue = (string)rowInfo.Cells["colValue"].Value; |
|
248 |
|
|
249 |
switch (sKey) |
|
250 |
{ |
|
251 |
case _DBType: |
|
252 |
dbInfo.DBType = sValue; |
|
253 |
break; |
|
254 |
case _ServiceName: |
|
255 |
dbInfo.Service = sValue; |
|
256 |
break; |
|
257 |
case _SiteName: |
|
258 |
dbInfo.Site = sValue; |
|
259 |
break; |
|
260 |
case _ServerIP: |
|
261 |
dbInfo.ServerIP = sValue; |
|
262 |
break; |
|
263 |
case _Port: |
|
264 |
dbInfo.Port = sValue; |
|
265 |
break; |
|
266 |
case _DBUser: |
|
267 |
dbInfo.DBUser = sValue; |
|
268 |
break; |
|
269 |
case _DBPassword: |
|
270 |
dbInfo.DBPassword = sValue; |
|
271 |
break; |
|
272 |
default: |
내보내기 Unified diff