개정판 45529c16
issue #000: Validity 수정 0, 1, -1 적용
Change-Id: Id2e85bb48c220b2f5def76b6bc28e655634735a9
DTI_PID/ID2PSN/DB.cs | ||
---|---|---|
1 | 1 |
using System; |
2 | 2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using System.Data.SQLite; |
|
7 | 3 |
using System.Data; |
8 |
using System.Globalization; |
|
9 |
using System.Text.RegularExpressions; |
|
10 | 4 |
using System.Data.Common; |
11 |
using System.Data.SqlClient; |
|
5 |
using System.Data.SQLite; |
|
6 |
using System.Linq; |
|
7 |
using System.Text.RegularExpressions; |
|
12 | 8 | |
13 | 9 |
namespace ID2PSN |
14 | 10 |
{ |
15 |
public class DB
|
|
11 |
public class DB |
|
16 | 12 |
{ |
17 | 13 |
const string PSN_TOPOLOGY_RULE = "T_PSN_TOPOLOGY_RULE"; |
18 | 14 |
const string PSN_HEADER_SETTING = "T_PSN_HEADER_SETTING"; |
... | ... | |
25 | 21 |
const string PSN_EQUIPMENT = "SPPIDEquipment"; |
26 | 22 |
const string PSN_NOZZLE = "SPPIDNozzle"; |
27 | 23 |
const string PSN_FLUIDCODE = "SPPIDFluidCode"; |
28 |
const string PSN_PIPINGMATLCLASS = "SPPIDPipingMatClass";
|
|
24 |
const string PSN_PIPINGMATLCLASS = "SPPIDPipingMatClass"; |
|
29 | 25 |
const string PSN_TOPOLOGYSET = "SPPIDTopologySet"; |
30 | 26 | |
31 | 27 |
/// <summary> |
... | ... | |
226 | 222 |
Log.Write(ex.Message + "\r\n" + ex.StackTrace); |
227 | 223 |
} |
228 | 224 |
} |
229 |
|
|
225 | ||
230 | 226 |
return result; |
231 | 227 |
} |
232 | 228 | |
... | ... | |
310 | 306 | |
311 | 307 |
return dt; |
312 | 308 |
} |
313 |
|
|
309 | ||
314 | 310 |
public static DataTable SelectFluidCode() |
315 | 311 |
{ |
316 | 312 |
DataTable dt = null; |
... | ... | |
321 | 317 |
try |
322 | 318 |
{ |
323 | 319 |
var query = "SELECT * FROM FluidCode"; |
324 |
using(var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
|
320 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query)))
|
|
325 | 321 |
{ |
326 | 322 |
dt = ds.Tables[0].Copy(); |
327 | 323 |
} |
... | ... | |
459 | 455 |
} |
460 | 456 | |
461 | 457 |
return dt; |
462 |
}
|
|
458 |
} |
|
463 | 459 | |
464 | 460 |
public static double[] GetDrawingSize() |
465 | 461 |
{ |
... | ... | |
478 | 474 |
string value = ds.Tables[0].Rows[0][0].ToString(); |
479 | 475 |
string[] split = value.Split(new char[] { ',' }); |
480 | 476 |
result = new double[] { |
481 |
Convert.ToDouble(Regex.Replace(split[0], @"[^0-9]", "")),
|
|
482 |
Convert.ToDouble(Regex.Replace(split[1], @"[^0-9]", "")),
|
|
483 |
Convert.ToDouble(Regex.Replace(split[2], @"[^0-9]", "")),
|
|
484 |
Convert.ToDouble(Regex.Replace(split[3], @"[^0-9]", ""))
|
|
477 |
Convert.ToDouble(Regex.Replace(split[0], @"[^0-9]", string.Empty)),
|
|
478 |
Convert.ToDouble(Regex.Replace(split[1], @"[^0-9]", string.Empty)),
|
|
479 |
Convert.ToDouble(Regex.Replace(split[2], @"[^0-9]", string.Empty)),
|
|
480 |
Convert.ToDouble(Regex.Replace(split[3], @"[^0-9]", string.Empty))
|
|
485 | 481 |
}; |
486 | 482 |
result = new double[] { |
487 | 483 |
Math.Min(result[0], result[2]), |
... | ... | |
789 | 785 | |
790 | 786 |
return dt; |
791 | 787 |
} |
792 |
|
|
788 | ||
793 | 789 |
private static void AddWithValue(DbCommand cmd, string PropName, object Value) |
794 | 790 |
{ |
795 | 791 |
var param = cmd.CreateParameter(); |
... | ... | |
917 | 913 |
AddWithValue(cmd, "@PSNRevisionNumber", row["PSNRevisionNumber"].ToString()); |
918 | 914 |
AddWithValue(cmd, "@PBS", row["PBS"].ToString()); |
919 | 915 |
AddWithValue(cmd, "@PIDDrawings", row["PIDDrawings"].ToString()); |
920 |
AddWithValue(cmd, "@Validity", row["Validity"].ToString()); |
|
916 |
int Validity = 0; |
|
917 |
if (row["Validity"].ToString() == "OK") |
|
918 |
Validity = 0; |
|
919 |
else if (row["Validity"].ToString() == "InValid") |
|
920 |
Validity = 1; |
|
921 |
else if (row["Validity"].ToString() == "Error") |
|
922 |
Validity = -1; |
|
923 |
AddWithValue(cmd, "@Validity", Validity); |
|
921 | 924 |
AddWithValue(cmd, "@Status", row["Status"].ToString()); |
922 | 925 |
connection.ExecuteNonQuery(cmd, txn); |
923 | 926 |
} |
... | ... | |
1155 | 1158 |
var query = $"SELECT * FROM {PSN_PIPESYSTEMNETWORK} WHERE PSNRevisionNumber = '{string.Format("V{0:D4}", GetRevision())}'"; |
1156 | 1159 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
1157 | 1160 |
{ |
1158 |
result.PipeSystemNetwork = ds.Tables[0].Copy(); |
|
1161 |
result.PipeSystemNetwork = ds.Tables[0].Clone(); |
|
1162 |
result.PipeSystemNetwork.Columns["Validity"].DataType = typeof(string); |
|
1163 | ||
1164 |
foreach (DataRow row in ds.Tables[0].Rows) |
|
1165 |
{ |
|
1166 |
DataRow newRow = result.PipeSystemNetwork.NewRow(); |
|
1167 |
newRow["OID"] = row["OID"].ToString(); |
|
1168 |
newRow["Type"] = row["Type"].ToString(); |
|
1169 |
newRow["OrderNumber"] = row["OrderNumber"].ToString(); |
|
1170 |
newRow["Pipeline_OID"] = row["Pipeline_OID"].ToString(); |
|
1171 |
newRow["FROM_DATA"] = row["FROM_DATA"].ToString(); |
|
1172 |
newRow["TO_DATA"] = row["TO_DATA"].ToString(); |
|
1173 |
newRow["TopologySet_OID_Key"] = row["TopologySet_OID_Key"].ToString(); |
|
1174 |
newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString(); |
|
1175 |
newRow["PBS"] = row["PBS"].ToString(); |
|
1176 |
newRow["PIDDrawings"] = row["PIDDrawings"].ToString(); |
|
1177 |
string Validity = string.Empty; |
|
1178 | ||
1179 |
if (Convert.ToInt32(row["Validity"].ToString()) == 0) |
|
1180 |
Validity = string.Empty;//"OK"; |
|
1181 |
else if (Convert.ToInt32(row["Validity"].ToString()) == 1) |
|
1182 |
Validity = "InValid"; |
|
1183 |
else if (Convert.ToInt32(row["Validity"].ToString()) == -1) |
|
1184 |
Validity = "Error"; |
|
1185 | ||
1186 |
newRow["Validity"] = Validity; |
|
1187 | ||
1188 |
newRow["Status"] = row["Status"].ToString(); |
|
1189 |
result.PipeSystemNetwork.Rows.Add(newRow); |
|
1190 |
} |
|
1159 | 1191 |
} |
1160 | 1192 | |
1161 | 1193 |
query = $"SELECT * FROM {PSN_EQUIPMENT}"; |
... | ... | |
1287 | 1319 |
var query = $"SELECT * FROM {PSN_PIPESYSTEMNETWORK} WHERE PSNRevisionNumber = '{string.Format("V{0:D4}", GetRevision())}'"; |
1288 | 1320 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
1289 | 1321 |
{ |
1290 |
dt = ds.Tables[0].Copy(); |
|
1322 |
dt = ds.Tables[0].Clone(); |
|
1323 |
dt.Columns["Validity"].DataType = typeof(string); |
|
1324 |
foreach (DataRow row in ds.Tables[0].Rows) |
|
1325 |
{ |
|
1326 |
DataRow newRow = dt.NewRow(); |
|
1327 |
newRow["OID"] = row["OID"].ToString(); |
|
1328 |
newRow["Type"] = row["Type"].ToString(); |
|
1329 |
newRow["OrderNumber"] = row["OrderNumber"].ToString(); |
|
1330 |
newRow["Pipeline_OID"] = row["Pipeline_OID"].ToString(); |
|
1331 |
newRow["FROM_DATA"] = row["FROM_DATA"].ToString(); |
|
1332 |
newRow["TO_DATA"] = row["TO_DATA"].ToString(); |
|
1333 |
newRow["TopologySet_OID_Key"] = row["TopologySet_OID_Key"].ToString(); |
|
1334 |
newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString(); |
|
1335 |
newRow["PBS"] = row["PBS"].ToString(); |
|
1336 |
newRow["PIDDrawings"] = row["PIDDrawings"].ToString(); |
|
1337 |
string Validity = string.Empty; |
|
1338 | ||
1339 |
if (Convert.ToInt32(row["Validity"].ToString()) == 0) |
|
1340 |
Validity = string.Empty;//"OK"; |
|
1341 |
else if (Convert.ToInt32(row["Validity"].ToString()) == 1) |
|
1342 |
Validity = "InValid"; |
|
1343 |
else if (Convert.ToInt32(row["Validity"].ToString()) == -1) |
|
1344 |
Validity = "Error"; |
|
1345 | ||
1346 |
newRow["Validity"] = Validity; |
|
1347 | ||
1348 |
newRow["Status"] = row["Status"].ToString(); |
|
1349 |
dt.Rows.Add(newRow); |
|
1350 |
} |
|
1291 | 1351 |
} |
1292 | 1352 |
} |
1293 | 1353 |
catch (Exception ex) |
DTI_PID/ID2PSN/Form/HeaderSettingForm.Designer.cs | ||
---|---|---|
94 | 94 |
this.ribbonControl.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False; |
95 | 95 |
this.ribbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages; |
96 | 96 |
this.ribbonControl.ShowToolbarCustomizeItem = false; |
97 |
this.ribbonControl.Size = new System.Drawing.Size(904, 32);
|
|
97 |
this.ribbonControl.Size = new System.Drawing.Size(912, 32);
|
|
98 | 98 |
this.ribbonControl.Toolbar.ShowCustomizeItem = false; |
99 | 99 |
// |
100 | 100 |
// layoutControl1 |
... | ... | |
110 | 110 |
this.layoutControl1.Location = new System.Drawing.Point(0, 32); |
111 | 111 |
this.layoutControl1.Name = "layoutControl1"; |
112 | 112 |
this.layoutControl1.Root = this.Root; |
113 |
this.layoutControl1.Size = new System.Drawing.Size(904, 623);
|
|
113 |
this.layoutControl1.Size = new System.Drawing.Size(912, 627);
|
|
114 | 114 |
this.layoutControl1.TabIndex = 1; |
115 | 115 |
this.layoutControl1.Text = "layoutControl1"; |
116 | 116 |
// |
... | ... | |
120 | 120 |
this.labelControlToolTip.ImageAlignToText = DevExpress.XtraEditors.ImageAlignToText.RightCenter; |
121 | 121 |
this.labelControlToolTip.ImageOptions.Alignment = System.Drawing.ContentAlignment.MiddleLeft; |
122 | 122 |
this.labelControlToolTip.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("labelControlToolTip.ImageOptions.Image"))); |
123 |
this.labelControlToolTip.Location = new System.Drawing.Point(822, 12);
|
|
123 |
this.labelControlToolTip.Location = new System.Drawing.Point(830, 12);
|
|
124 | 124 |
this.labelControlToolTip.Name = "labelControlToolTip"; |
125 | 125 |
this.labelControlToolTip.Size = new System.Drawing.Size(70, 16); |
126 | 126 |
this.labelControlToolTip.StyleController = this.layoutControl1; |
... | ... | |
129 | 129 |
// |
130 | 130 |
// btnAddType |
131 | 131 |
// |
132 |
this.btnAddType.Location = new System.Drawing.Point(354, 63);
|
|
132 |
this.btnAddType.Location = new System.Drawing.Point(357, 63);
|
|
133 | 133 |
this.btnAddType.Name = "btnAddType"; |
134 |
this.btnAddType.Size = new System.Drawing.Size(77, 22);
|
|
134 |
this.btnAddType.Size = new System.Drawing.Size(78, 22);
|
|
135 | 135 |
this.btnAddType.StyleController = this.layoutControl1; |
136 | 136 |
this.btnAddType.TabIndex = 0; |
137 | 137 |
this.btnAddType.Text = "Add Type"; |
... | ... | |
139 | 139 |
// |
140 | 140 |
// gridControlSymbol |
141 | 141 |
// |
142 |
this.gridControlSymbol.Location = new System.Drawing.Point(471, 89);
|
|
142 |
this.gridControlSymbol.Location = new System.Drawing.Point(475, 89);
|
|
143 | 143 |
this.gridControlSymbol.MainView = this.gridViewSymbol; |
144 | 144 |
this.gridControlSymbol.MenuManager = this.ribbonControl; |
145 | 145 |
this.gridControlSymbol.Name = "gridControlSymbol"; |
146 |
this.gridControlSymbol.Size = new System.Drawing.Size(409, 470);
|
|
146 |
this.gridControlSymbol.Size = new System.Drawing.Size(413, 474);
|
|
147 | 147 |
this.gridControlSymbol.TabIndex = 4; |
148 | 148 |
this.gridControlSymbol.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { |
149 | 149 |
this.gridViewSymbol}); |
... | ... | |
160 | 160 |
this.gridControlType.MainView = this.gridViewType; |
161 | 161 |
this.gridControlType.MenuManager = this.ribbonControl; |
162 | 162 |
this.gridControlType.Name = "gridControlType"; |
163 |
this.gridControlType.Size = new System.Drawing.Size(407, 470);
|
|
163 |
this.gridControlType.Size = new System.Drawing.Size(411, 474);
|
|
164 | 164 |
this.gridControlType.TabIndex = 3; |
165 | 165 |
this.gridControlType.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { |
166 | 166 |
this.gridViewType}); |
... | ... | |
176 | 176 |
// btnClose |
177 | 177 |
// |
178 | 178 |
this.btnClose.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.ImageOptions.Image"))); |
179 |
this.btnClose.Location = new System.Drawing.Point(822, 575);
|
|
179 |
this.btnClose.Location = new System.Drawing.Point(830, 579);
|
|
180 | 180 |
this.btnClose.Name = "btnClose"; |
181 | 181 |
this.btnClose.Size = new System.Drawing.Size(70, 36); |
182 | 182 |
this.btnClose.StyleController = this.layoutControl1; |
... | ... | |
187 | 187 |
// btnSave |
188 | 188 |
// |
189 | 189 |
this.btnSave.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.ImageOptions.Image"))); |
190 |
this.btnSave.Location = new System.Drawing.Point(730, 575);
|
|
190 |
this.btnSave.Location = new System.Drawing.Point(738, 579);
|
|
191 | 191 |
this.btnSave.Name = "btnSave"; |
192 | 192 |
this.btnSave.Size = new System.Drawing.Size(68, 36); |
193 | 193 |
this.btnSave.StyleController = this.layoutControl1; |
... | ... | |
197 | 197 |
// |
198 | 198 |
// btnAddSymbol |
199 | 199 |
// |
200 |
this.btnAddSymbol.Location = new System.Drawing.Point(791, 63);
|
|
200 |
this.btnAddSymbol.Location = new System.Drawing.Point(798, 63);
|
|
201 | 201 |
this.btnAddSymbol.Name = "btnAddSymbol"; |
202 |
this.btnAddSymbol.Size = new System.Drawing.Size(89, 22);
|
|
202 |
this.btnAddSymbol.Size = new System.Drawing.Size(90, 22);
|
|
203 | 203 |
this.btnAddSymbol.StyleController = this.layoutControl1; |
204 | 204 |
this.btnAddSymbol.TabIndex = 2; |
205 | 205 |
this.btnAddSymbol.Text = " Add Symbol"; |
... | ... | |
220 | 220 |
this.layoutControlItem7, |
221 | 221 |
this.emptySpaceItem5}); |
222 | 222 |
this.Root.Name = "Root"; |
223 |
this.Root.Size = new System.Drawing.Size(904, 623);
|
|
223 |
this.Root.Size = new System.Drawing.Size(912, 627);
|
|
224 | 224 |
this.Root.TextVisible = false; |
225 | 225 |
// |
226 | 226 |
// splitterItem1 |
227 | 227 |
// |
228 | 228 |
this.splitterItem1.AllowHotTrack = true; |
229 |
this.splitterItem1.Location = new System.Drawing.Point(435, 20);
|
|
229 |
this.splitterItem1.Location = new System.Drawing.Point(439, 20);
|
|
230 | 230 |
this.splitterItem1.Name = "splitterItem1"; |
231 |
this.splitterItem1.Size = new System.Drawing.Size(12, 543);
|
|
231 |
this.splitterItem1.Size = new System.Drawing.Size(12, 547);
|
|
232 | 232 |
// |
233 | 233 |
// emptySpaceItem3 |
234 | 234 |
// |
235 | 235 |
this.emptySpaceItem3.AllowHotTrack = false; |
236 |
this.emptySpaceItem3.Location = new System.Drawing.Point(0, 563);
|
|
236 |
this.emptySpaceItem3.Location = new System.Drawing.Point(0, 567);
|
|
237 | 237 |
this.emptySpaceItem3.Name = "emptySpaceItem3"; |
238 |
this.emptySpaceItem3.Size = new System.Drawing.Size(718, 40);
|
|
238 |
this.emptySpaceItem3.Size = new System.Drawing.Size(726, 40);
|
|
239 | 239 |
this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0); |
240 | 240 |
// |
241 | 241 |
// layoutControlItem4 |
242 | 242 |
// |
243 | 243 |
this.layoutControlItem4.Control = this.btnSave; |
244 |
this.layoutControlItem4.Location = new System.Drawing.Point(718, 563);
|
|
244 |
this.layoutControlItem4.Location = new System.Drawing.Point(726, 567);
|
|
245 | 245 |
this.layoutControlItem4.MaxSize = new System.Drawing.Size(72, 40); |
246 | 246 |
this.layoutControlItem4.MinSize = new System.Drawing.Size(72, 40); |
247 | 247 |
this.layoutControlItem4.Name = "layoutControlItem4"; |
... | ... | |
253 | 253 |
// layoutControlItem5 |
254 | 254 |
// |
255 | 255 |
this.layoutControlItem5.Control = this.btnClose; |
256 |
this.layoutControlItem5.Location = new System.Drawing.Point(810, 563);
|
|
256 |
this.layoutControlItem5.Location = new System.Drawing.Point(818, 567);
|
|
257 | 257 |
this.layoutControlItem5.MaxSize = new System.Drawing.Size(74, 40); |
258 | 258 |
this.layoutControlItem5.MinSize = new System.Drawing.Size(74, 40); |
259 | 259 |
this.layoutControlItem5.Name = "layoutControlItem5"; |
... | ... | |
265 | 265 |
// emptySpaceItem2 |
266 | 266 |
// |
267 | 267 |
this.emptySpaceItem2.AllowHotTrack = false; |
268 |
this.emptySpaceItem2.Location = new System.Drawing.Point(790, 563);
|
|
268 |
this.emptySpaceItem2.Location = new System.Drawing.Point(798, 567);
|
|
269 | 269 |
this.emptySpaceItem2.MaxSize = new System.Drawing.Size(20, 40); |
270 | 270 |
this.emptySpaceItem2.MinSize = new System.Drawing.Size(20, 40); |
271 | 271 |
this.emptySpaceItem2.Name = "emptySpaceItem2"; |
... | ... | |
281 | 281 |
this.emptySpaceItem4}); |
282 | 282 |
this.layoutControlGroup1.Location = new System.Drawing.Point(0, 20); |
283 | 283 |
this.layoutControlGroup1.Name = "layoutControlGroup1"; |
284 |
this.layoutControlGroup1.Size = new System.Drawing.Size(435, 543);
|
|
284 |
this.layoutControlGroup1.Size = new System.Drawing.Size(439, 547);
|
|
285 | 285 |
this.layoutControlGroup1.Text = "Header Type"; |
286 | 286 |
// |
287 | 287 |
// layoutControlItem2 |
... | ... | |
289 | 289 |
this.layoutControlItem2.Control = this.gridControlType; |
290 | 290 |
this.layoutControlItem2.Location = new System.Drawing.Point(0, 26); |
291 | 291 |
this.layoutControlItem2.Name = "layoutControlItem2"; |
292 |
this.layoutControlItem2.Size = new System.Drawing.Size(411, 474);
|
|
292 |
this.layoutControlItem2.Size = new System.Drawing.Size(415, 478);
|
|
293 | 293 |
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); |
294 | 294 |
this.layoutControlItem2.TextVisible = false; |
295 | 295 |
// |
296 | 296 |
// layoutControlItem1 |
297 | 297 |
// |
298 | 298 |
this.layoutControlItem1.Control = this.btnAddType; |
299 |
this.layoutControlItem1.Location = new System.Drawing.Point(330, 0);
|
|
299 |
this.layoutControlItem1.Location = new System.Drawing.Point(333, 0);
|
|
300 | 300 |
this.layoutControlItem1.Name = "layoutControlItem1"; |
301 |
this.layoutControlItem1.Size = new System.Drawing.Size(81, 26);
|
|
301 |
this.layoutControlItem1.Size = new System.Drawing.Size(82, 26);
|
|
302 | 302 |
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); |
303 | 303 |
this.layoutControlItem1.TextVisible = false; |
304 | 304 |
// |
... | ... | |
307 | 307 |
this.emptySpaceItem4.AllowHotTrack = false; |
308 | 308 |
this.emptySpaceItem4.Location = new System.Drawing.Point(0, 0); |
309 | 309 |
this.emptySpaceItem4.Name = "emptySpaceItem4"; |
310 |
this.emptySpaceItem4.Size = new System.Drawing.Size(330, 26);
|
|
310 |
this.emptySpaceItem4.Size = new System.Drawing.Size(333, 26);
|
|
311 | 311 |
this.emptySpaceItem4.TextSize = new System.Drawing.Size(0, 0); |
312 | 312 |
// |
313 | 313 |
// layoutControlGroup2 |
... | ... | |
316 | 316 |
this.layoutControlItem6, |
317 | 317 |
this.layoutControlItem3, |
318 | 318 |
this.emptySpaceItem1}); |
319 |
this.layoutControlGroup2.Location = new System.Drawing.Point(447, 20);
|
|
319 |
this.layoutControlGroup2.Location = new System.Drawing.Point(451, 20);
|
|
320 | 320 |
this.layoutControlGroup2.Name = "layoutControlGroup2"; |
321 |
this.layoutControlGroup2.Size = new System.Drawing.Size(437, 543);
|
|
321 |
this.layoutControlGroup2.Size = new System.Drawing.Size(441, 547);
|
|
322 | 322 |
this.layoutControlGroup2.Text = "Type Items"; |
323 | 323 |
// |
324 | 324 |
// layoutControlItem6 |
... | ... | |
326 | 326 |
this.layoutControlItem6.Control = this.gridControlSymbol; |
327 | 327 |
this.layoutControlItem6.Location = new System.Drawing.Point(0, 26); |
328 | 328 |
this.layoutControlItem6.Name = "layoutControlItem6"; |
329 |
this.layoutControlItem6.Size = new System.Drawing.Size(413, 474);
|
|
329 |
this.layoutControlItem6.Size = new System.Drawing.Size(417, 478);
|
|
330 | 330 |
this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); |
331 | 331 |
this.layoutControlItem6.TextVisible = false; |
332 | 332 |
// |
333 | 333 |
// layoutControlItem3 |
334 | 334 |
// |
335 | 335 |
this.layoutControlItem3.Control = this.btnAddSymbol; |
336 |
this.layoutControlItem3.Location = new System.Drawing.Point(320, 0);
|
|
336 |
this.layoutControlItem3.Location = new System.Drawing.Point(323, 0);
|
|
337 | 337 |
this.layoutControlItem3.Name = "layoutControlItem3"; |
338 |
this.layoutControlItem3.Size = new System.Drawing.Size(93, 26);
|
|
338 |
this.layoutControlItem3.Size = new System.Drawing.Size(94, 26);
|
|
339 | 339 |
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0); |
340 | 340 |
this.layoutControlItem3.TextVisible = false; |
341 | 341 |
// |
... | ... | |
344 | 344 |
this.emptySpaceItem1.AllowHotTrack = false; |
345 | 345 |
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 0); |
346 | 346 |
this.emptySpaceItem1.Name = "emptySpaceItem1"; |
347 |
this.emptySpaceItem1.Size = new System.Drawing.Size(320, 26);
|
|
347 |
this.emptySpaceItem1.Size = new System.Drawing.Size(323, 26);
|
|
348 | 348 |
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); |
349 | 349 |
// |
350 | 350 |
// layoutControlItem7 |
351 | 351 |
// |
352 | 352 |
this.layoutControlItem7.Control = this.labelControlToolTip; |
353 |
this.layoutControlItem7.Location = new System.Drawing.Point(810, 0);
|
|
353 |
this.layoutControlItem7.Location = new System.Drawing.Point(818, 0);
|
|
354 | 354 |
this.layoutControlItem7.MaxSize = new System.Drawing.Size(74, 20); |
355 | 355 |
this.layoutControlItem7.MinSize = new System.Drawing.Size(74, 20); |
356 | 356 |
this.layoutControlItem7.Name = "layoutControlItem7"; |
... | ... | |
364 | 364 |
this.emptySpaceItem5.AllowHotTrack = false; |
365 | 365 |
this.emptySpaceItem5.Location = new System.Drawing.Point(0, 0); |
366 | 366 |
this.emptySpaceItem5.Name = "emptySpaceItem5"; |
367 |
this.emptySpaceItem5.Size = new System.Drawing.Size(810, 20);
|
|
367 |
this.emptySpaceItem5.Size = new System.Drawing.Size(818, 20);
|
|
368 | 368 |
this.emptySpaceItem5.TextSize = new System.Drawing.Size(0, 0); |
369 | 369 |
// |
370 | 370 |
// HeaderSettingForm |
371 | 371 |
// |
372 | 372 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); |
373 | 373 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
374 |
this.ClientSize = new System.Drawing.Size(904, 655);
|
|
374 |
this.ClientSize = new System.Drawing.Size(912, 659);
|
|
375 | 375 |
this.Controls.Add(this.layoutControl1); |
376 | 376 |
this.Controls.Add(this.ribbonControl); |
377 | 377 |
this.Name = "HeaderSettingForm"; |
DTI_PID/ID2PSN/Form/MainForm.cs | ||
---|---|---|
382 | 382 |
newRow["FROM_DATA"] = row["FROM_DATA"].ToString(); |
383 | 383 |
newRow["TO_DATA"] = row["TO_DATA"].ToString(); |
384 | 384 |
newRow["TopologySet_OID_Key"] = row["TopologySet_OID_Key"].ToString(); |
385 |
newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString(); |
|
385 |
newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString();
|
|
386 | 386 |
newRow["Validity"] = row["Validity"].ToString(); |
387 | 387 |
newRow["Status"] = row["Status"].ToString(); |
388 | 388 | |
... | ... | |
640 | 640 | |
641 | 641 |
private void MainForm_FormClosed(object sender, FormClosedEventArgs e) |
642 | 642 |
{ |
643 |
try |
|
644 |
{ |
|
645 |
using (TcpClient tcpClient = new TcpClient()) |
|
646 |
{ |
|
647 |
tcpClient.SendTimeout = 500; |
|
648 |
tcpClient.Connect("localhost", 2549); |
|
649 | ||
650 |
var _params = new Dictionary<string, string>() |
|
651 |
{ |
|
652 |
{"request", "ProcessEnd" } |
|
653 |
}; |
|
654 |
var json = JsonConvert.SerializeObject(_params, Formatting.Indented); |
|
655 |
byte[] message = Encoding.UTF8.GetBytes(json); |
|
656 | ||
657 |
using (NetworkStream networkStream = tcpClient.GetStream()) |
|
658 |
{ |
|
659 |
networkStream.Write(message, 0, message.Length); |
|
660 |
} |
|
661 |
tcpClient.Close(); |
|
662 |
} |
|
663 |
} |
|
664 |
catch (Exception ex) |
|
665 |
{ |
|
666 |
MessageBox.Show("Failed to open ID2 drawing.", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
667 |
} |
|
643 |
// try
|
|
644 |
// {
|
|
645 |
// using (TcpClient tcpClient = new TcpClient())
|
|
646 |
// {
|
|
647 |
// tcpClient.SendTimeout = 500;
|
|
648 |
// tcpClient.Connect("localhost", 2549);
|
|
649 | ||
650 |
// var _params = new Dictionary<string, string>()
|
|
651 |
// {
|
|
652 |
// {"request", "ProcessEnd" }
|
|
653 |
// };
|
|
654 |
// var json = JsonConvert.SerializeObject(_params, Formatting.Indented);
|
|
655 |
// byte[] message = Encoding.UTF8.GetBytes(json);
|
|
656 | ||
657 |
// using (NetworkStream networkStream = tcpClient.GetStream())
|
|
658 |
// {
|
|
659 |
// networkStream.Write(message, 0, message.Length);
|
|
660 |
// }
|
|
661 |
// tcpClient.Close();
|
|
662 |
// }
|
|
663 |
// }
|
|
664 |
// catch (Exception ex)
|
|
665 |
// {
|
|
666 |
// MessageBox.Show("Failed to open ID2 drawing.", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
667 |
// }
|
|
668 | 668 |
} |
669 | 669 |
} |
670 | 670 |
} |
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
21 | 21 |
OPC, |
22 | 22 |
} |
23 | 23 | |
24 |
public enum ErrorType |
|
25 |
{ |
|
26 |
Error = -1, |
|
27 |
OK, |
|
28 |
InValid //이값은 들어가는데가 없음.. |
|
29 |
} |
|
30 | ||
24 | 31 |
public class PSN |
25 | 32 |
{ |
26 | 33 |
private double[] DrawingSize = null; |
... | ... | |
1250 | 1257 |
} |
1251 | 1258 |
private void UpdateErrorForPSN() |
1252 | 1259 |
{ |
1253 |
DataRow[] errorRows = PipeSystemNetwork.Select(" Type = 'Error'");
|
|
1260 |
DataRow[] errorRows = PipeSystemNetwork.Select(string.Format(" Type = '{0}'", ErrorType.Error));
|
|
1254 | 1261 |
foreach (DataRow dataRow in errorRows) |
1255 | 1262 |
{ |
1256 | 1263 |
PSNItem PSNItem = PSNItems.Find(x=>x.PSN_OID() == dataRow["OID"].ToString()); |
... | ... | |
1262 | 1269 |
PSNItem.EndType = PSNType.Equipment; |
1263 | 1270 | |
1264 | 1271 |
dataRow["Type"] = PSNItem.GetPSNType(); |
1265 |
} |
|
1266 | ||
1267 |
|
|
1272 |
} |
|
1268 | 1273 |
} |
1269 | 1274 |
} |
1270 | 1275 |
내보내기 Unified diff