개정판 f0656b3a
issue #000: psn
Change-Id: I13e589d6dd990cb34ca843f143e91a145c87602d
DTI_PID/ID2PSN/DB.cs | ||
---|---|---|
322 | 322 |
dicColCheck.Add("Equipment_OID", "NVARCHAR(255)"); |
323 | 323 |
dicColCheck.Add("NPD", "NVARCHAR(255)"); |
324 | 324 |
dicColCheck.Add("GROUPTAG", "NVARCHAR(255)"); |
325 |
dicColCheck.Add("PipeSystemNetwork_OID", "NVARCHAR(255)"); |
|
325 |
dicColCheck.Add("PipeSystemNetwork_OID_ID2", "NVARCHAR(255)");
|
|
326 | 326 |
dicColCheck.Add("PipeRun_OID", "NVARCHAR(255)"); |
327 |
dicColCheck.Add("ViewPipeSystemNetwork_OID", "NVARCHAR(255)");
|
|
327 |
dicColCheck.Add("PipeSystemNetwork_OID", "NVARCHAR(255)"); |
|
328 | 328 |
|
329 | 329 |
dicColCheck.Add("EqpGroupTag", "NVARCHAR(255)"); |
330 | 330 |
dicColCheck.Add("MainLineTag", "NVARCHAR(255)"); |
... | ... | |
337 | 337 |
{ |
338 | 338 |
var query = $"CREATE TABLE {PSN_PATHITEMS} (OID NVARCHAR(255), SequenceData_OID NVARCHAR(255), " + |
339 | 339 |
"TopologySet_OID NVARCHAR(255), BranchTopologySet_OID NVARCHAR(255), PipeLine_OID NVARCHAR(255), ItemName NVARCHAR(255), ItemTag NVARCHAR(255), DESCRIPTION NVARCHAR(255), " + |
340 |
"CLASS NVARCHAR(255), SUBCLASS NVARCHAR(255), TYPE NVARCHAR(255), MULTIWAY NVARCHAR(255), PIDNAME NVARCHAR(255), Equipment_OID NVARCHAR(255), NPD NVARCHAR(255), GROUPTAG NVARCHAR(255), PipeSystemNetwork_OID NVARCHAR(255), PipeRun_OID NVARCHAR(255), " + |
|
341 |
"ViewPipeSystemNetwork_OID NVARCHAR(255), EqpGroupTag NVARCHAR(255), MainLineTag NVARCHAR(255), EGTConnectedPoint INT, EGFlowDirection NVARCHAR(10))";
|
|
340 |
"CLASS NVARCHAR(255), SUBCLASS NVARCHAR(255), TYPE NVARCHAR(255), MULTIWAY NVARCHAR(255), PIDNAME NVARCHAR(255), Equipment_OID NVARCHAR(255), NPD NVARCHAR(255), GROUPTAG NVARCHAR(255), PipeSystemNetwork_OID_ID2 NVARCHAR(255), PipeRun_OID NVARCHAR(255), " +
|
|
341 |
"PipeSystemNetwork_OID NVARCHAR(255), EqpGroupTag NVARCHAR(255), MainLineTag NVARCHAR(255), EGTConnectedPoint INT, EGFlowDirection NVARCHAR(10))"; |
|
342 | 342 |
using (var cmd = connection.GetSqlStringCommand(query)) |
343 | 343 |
{ |
344 | 344 |
cmd.ExecuteNonQuery(); |
... | ... | |
1881 | 1881 |
DataRow row = item.PathItems.Rows[i]; |
1882 | 1882 |
query = $"INSERT INTO {PSN_PATHITEMS} " + |
1883 | 1883 |
$"(OID, SequenceData_OID, TopologySet_OID, BranchTopologySet_OID, PipeLine_OID, ItemName, ItemTag, DESCRIPTION, CLASS, SUBCLASS, TYPE, MULTIWAY," + |
1884 |
$"PIDNAME, Equipment_OID, NPD, GROUPTAG, PipeSystemNetwork_OID, PipeRun_OID, ViewPipeSystemNetwork_OID, EqpGroupTag, MainLineTag, EGTConnectedPoint, EGFlowDirection) VALUES " +
|
|
1884 |
$"PIDNAME, Equipment_OID, NPD, GROUPTAG, PipeSystemNetwork_OID_ID2, PipeRun_OID, PipeSystemNetwork_OID, EqpGroupTag, MainLineTag, EGTConnectedPoint, EGFlowDirection) VALUES " +
|
|
1885 | 1885 |
$"(@OID, @SequenceData_OID, @TopologySet_OID, @BranchTopologySet_OID, @PipeLine_OID, @ITEMNAME, @ITEMTAG, @DESCRIPTION, @Class, @SubClass, @TYPE, @MULTIWAY, @PIDNAME, " + |
1886 |
$"@Equipment_OID, @NPD, @GROUPTAG, @PipeSystemNetwork_OID,@PipeRun_OID, @ViewPipeSystemNetwork_OID, @EqpGroupTag , @MainLineTag, @EGTConnectedPoint, @EGFlowDirection)";
|
|
1886 |
$"@Equipment_OID, @NPD, @GROUPTAG, @PipeSystemNetwork_OID_ID2,@PipeRun_OID, @PipeSystemNetwork_OID, @EqpGroupTag , @MainLineTag, @EGTConnectedPoint, @EGFlowDirection)";
|
|
1887 | 1887 |
var cmd = connection.GetSqlStringCommand(query); |
1888 | 1888 |
AddWithValue(cmd, "@OID", string.IsNullOrEmpty(row["OID"].ToString()) ? "" : row["OID"].ToString()); |
1889 | 1889 |
AddWithValue(cmd, "@SequenceData_OID", string.IsNullOrEmpty(row["SequenceData_OID"].ToString()) ? "" : row["SequenceData_OID"].ToString()); |
... | ... | |
1901 | 1901 |
AddWithValue(cmd, "@Equipment_OID", string.IsNullOrEmpty(row["Equipment_OID"].ToString()) ? "" : row["Equipment_OID"].ToString()); |
1902 | 1902 |
AddWithValue(cmd, "@NPD", string.IsNullOrEmpty(row["NPD"].ToString()) ? "" : row["NPD"].ToString()); |
1903 | 1903 |
AddWithValue(cmd, "@GROUPTAG", string.IsNullOrEmpty(row["GROUPTAG"].ToString()) ? "" : row["GROUPTAG"].ToString()); |
1904 |
AddWithValue(cmd, "@PipeSystemNetwork_OID_ID2", string.IsNullOrEmpty(row["PipeSystemNetwork_OID_ID2"].ToString()) ? "" : row["PipeSystemNetwork_OID_ID2"].ToString()); |
|
1904 | 1905 |
AddWithValue(cmd, "@PipeSystemNetwork_OID", string.IsNullOrEmpty(row["PipeSystemNetwork_OID"].ToString()) ? "" : row["PipeSystemNetwork_OID"].ToString()); |
1905 |
AddWithValue(cmd, "@ViewPipeSystemNetwork_OID", string.IsNullOrEmpty(row["ViewPipeSystemNetwork_OID"].ToString()) ? "" : row["ViewPipeSystemNetwork_OID"].ToString()); |
|
1906 | 1906 |
AddWithValue(cmd, "@PipeRun_OID", string.IsNullOrEmpty(row["PipeRun_OID"].ToString()) ? "" : row["PipeRun_OID"].ToString()); |
1907 | 1907 |
AddWithValue(cmd, "@EqpGroupTag", string.IsNullOrEmpty(row["EqpGroupTag"].ToString()) ? "" : row["EqpGroupTag"].ToString()); |
1908 | 1908 |
AddWithValue(cmd, "@MainLineTag", string.IsNullOrEmpty(row["MainLineTag"].ToString()) ? "" : row["MainLineTag"].ToString()); |
... | ... | |
2945 | 2945 |
dicColCheck.Add("Equipment_OID", "NVARCHAR(255)"); |
2946 | 2946 |
dicColCheck.Add("NPD", "NVARCHAR(255)"); |
2947 | 2947 |
dicColCheck.Add("GROUPTAG", "NVARCHAR(255)"); |
2948 |
dicColCheck.Add("PipeSystemNetwork_OID", "NVARCHAR(255)"); |
|
2948 |
dicColCheck.Add("PipeSystemNetwork_OID_ID2", "NVARCHAR(255)");
|
|
2949 | 2949 |
dicColCheck.Add("PipeRun_OID", "NVARCHAR(255)"); |
2950 |
dicColCheck.Add("ViewPipeSystemNetwork_OID", "NVARCHAR(255)");
|
|
2950 |
dicColCheck.Add("PipeSystemNetwork_OID", "NVARCHAR(255)"); |
|
2951 | 2951 |
dicColCheck.Add("EqpGroupTag", "NVARCHAR(255)"); |
2952 | 2952 |
dicColCheck.Add("MainLineTag", "NVARCHAR(255)"); |
2953 | 2953 |
dicColCheck.Add("EGTConnectedPoint", "INT"); |
... | ... | |
2956 | 2956 |
{ |
2957 | 2957 |
var query = $"CREATE TABLE {PSN_PATHITEMS} (OID NVARCHAR(255), SequenceData_OID NVARCHAR(255), " + |
2958 | 2958 |
"TopologySet_OID NVARCHAR(255), BranchTopologySet_OID NVARCHAR(255), PipeLine_OID NVARCHAR(255), ItemName NVARCHAR(255), ItemTag NVARCHAR(255), DESCRIPTION NVARCHAR(255), " + |
2959 |
"CLASS NVARCHAR(255), SUBCLASS NVARCHAR(255), TYPE NVARCHAR(255), MULTIWAY NVARCHAR(255), PIDNAME NVARCHAR(255), Equipment_OID NVARCHAR(255), NPD NVARCHAR(255), GROUPTAG NVARCHAR(255), PipeSystemNetwork_OID NVARCHAR(255), PipeRun_OID NVARCHAR(255), " + |
|
2960 |
"ViewPipeSystemNetwork_OID NVARCHAR(255), EqpGroupTag NVARCHAR(255), MainLineTag NVARCHAR(255), EGTConnectedPoint INT, EGFlowDirection NVARCHAR(10))";
|
|
2959 |
"CLASS NVARCHAR(255), SUBCLASS NVARCHAR(255), TYPE NVARCHAR(255), MULTIWAY NVARCHAR(255), PIDNAME NVARCHAR(255), Equipment_OID NVARCHAR(255), NPD NVARCHAR(255), GROUPTAG NVARCHAR(255), PipeSystemNetwork_OID_ID2 NVARCHAR(255), PipeRun_OID NVARCHAR(255), " +
|
|
2960 |
"PipeSystemNetwork_OID NVARCHAR(255), EqpGroupTag NVARCHAR(255), MainLineTag NVARCHAR(255), EGTConnectedPoint INT, EGFlowDirection NVARCHAR(10))"; |
|
2961 | 2961 |
using (var cmd = connection.GetSqlStringCommand(query)) |
2962 | 2962 |
{ |
2963 | 2963 |
cmd.ExecuteNonQuery(); |
... | ... | |
3438 | 3438 |
DataRow row = item.PathItems.Rows[i]; |
3439 | 3439 |
query = $"INSERT INTO {PSN_PATHITEMS} " + |
3440 | 3440 |
$"(OID, SequenceData_OID, TopologySet_OID, BranchTopologySet_OID, PipeLine_OID, ItemName, ItemTag, DESCRIPTION, CLASS, SUBCLASS, TYPE, MULTIWAY, " + |
3441 |
$"PIDNAME, Equipment_OID, NPD, GROUPTAG, PipeSystemNetwork_OID, PipeRun_OID, ViewPipeSystemNetwork_OID, EqpGroupTag , MainLineTag, EGTConnectedPoint, EGFlowDirection ) VALUES " +
|
|
3441 |
$"PIDNAME, Equipment_OID, NPD, GROUPTAG, PipeSystemNetwork_OID_ID2, PipeRun_OID, PipeSystemNetwork_OID, EqpGroupTag , MainLineTag, EGTConnectedPoint, EGFlowDirection ) VALUES " +
|
|
3442 | 3442 |
$"(@OID, @SequenceData_OID, @TopologySet_OID, @BranchTopologySet_OID, @PipeLine_OID, @ITEMNAME, @ITEMTAG, @DESCRIPTION, @Class, @SubClass, @TYPE, @MULTIWAY, @PIDNAME," + |
3443 |
$" @Equipment_OID, @NPD, @GROUPTAG, @PipeSystemNetwork_OID,@PipeRun_OID, @ViewPipeSystemNetwork_OID, @EqpGroupTag , @MainLineTag, @EGTConnectedPoint, @EGFlowDirection )";
|
|
3443 |
$" @Equipment_OID, @NPD, @GROUPTAG, @PipeSystemNetwork_OID_ID2,@PipeRun_OID, @PipeSystemNetwork_OID, @EqpGroupTag , @MainLineTag, @EGTConnectedPoint, @EGFlowDirection )";
|
|
3444 | 3444 |
var cmd = connection.GetSqlStringCommand(query); |
3445 | 3445 |
AddWithValue(cmd, "@OID", string.IsNullOrEmpty(row["OID"].ToString()) ? "" : row["OID"].ToString()); |
3446 | 3446 |
AddWithValue(cmd, "@SequenceData_OID", string.IsNullOrEmpty(row["SequenceData_OID"].ToString()) ? "" : row["SequenceData_OID"].ToString()); |
... | ... | |
3458 | 3458 |
AddWithValue(cmd, "@Equipment_OID", string.IsNullOrEmpty(row["Equipment_OID"].ToString()) ? "" : row["Equipment_OID"].ToString()); |
3459 | 3459 |
AddWithValue(cmd, "@NPD", string.IsNullOrEmpty(row["NPD"].ToString()) ? "" : row["NPD"].ToString()); |
3460 | 3460 |
AddWithValue(cmd, "@GROUPTAG", string.IsNullOrEmpty(row["GROUPTAG"].ToString()) ? "" : row["GROUPTAG"].ToString()); |
3461 |
AddWithValue(cmd, "@PipeSystemNetwork_OID_ID2", string.IsNullOrEmpty(row["PipeSystemNetwork_OID_ID2"].ToString()) ? "" : row["PipeSystemNetwork_OID_ID2"].ToString()); |
|
3461 | 3462 |
AddWithValue(cmd, "@PipeSystemNetwork_OID", string.IsNullOrEmpty(row["PipeSystemNetwork_OID"].ToString()) ? "" : row["PipeSystemNetwork_OID"].ToString()); |
3462 |
AddWithValue(cmd, "@ViewPipeSystemNetwork_OID", string.IsNullOrEmpty(row["ViewPipeSystemNetwork_OID"].ToString()) ? "" : row["ViewPipeSystemNetwork_OID"].ToString()); |
|
3463 | 3463 |
AddWithValue(cmd, "@PipeRun_OID", string.IsNullOrEmpty(row["PipeRun_OID"].ToString()) ? "" : row["PipeRun_OID"].ToString()); |
3464 | 3464 |
AddWithValue(cmd, "@EqpGroupTag", string.IsNullOrEmpty(row["EqpGroupTag"].ToString()) ? "" : row["EqpGroupTag"].ToString()); |
3465 | 3465 |
AddWithValue(cmd, "@MainLineTag", string.IsNullOrEmpty(row["MainLineTag"].ToString()) ? "" : row["MainLineTag"].ToString()); |
DTI_PID/ID2PSN/Form/MainForm.cs | ||
---|---|---|
101 | 101 |
else if (gridControl.Name == "gridControlPSN") |
102 | 102 |
{ |
103 | 103 |
string value = gridView.GetFocusedRowCellValue("OID").ToString(); |
104 |
DataRow[] rows = currentPSN.PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", value)); |
|
104 |
DataRow[] rows = currentPSN.PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", value));
|
|
105 | 105 |
|
106 | 106 |
DataTable distinctTable = rows.CopyToDataTable().DefaultView.ToTable(true, new string[] { "PIDNAME" }); |
107 | 107 |
|
... | ... | |
528 | 528 |
pathItemsDT.Columns.Add("OID", typeof(string)); |
529 | 529 |
pathItemsDT.Columns.Add("SequenceData_OID", typeof(string)); |
530 | 530 |
pathItemsDT.Columns.Add("BranchTopologySet_OID", typeof(string)); |
531 |
pathItemsDT.Columns.Add("PipeSystemNetwork_OID_ID2", typeof(string)); |
|
531 | 532 |
pathItemsDT.Columns.Add("PipeSystemNetwork_OID", typeof(string)); |
532 |
pathItemsDT.Columns.Add("ViewPipeSystemNetwork_OID", typeof(string)); |
|
533 | 533 |
pathItemsDT.Columns.Add("ITEMNAME", typeof(string)); |
534 | 534 |
pathItemsDT.Columns.Add("ITEMTAG", typeof(string)); |
535 | 535 |
pathItemsDT.Columns.Add("DESCRIPTION", typeof(string)); |
... | ... | |
552 | 552 |
|
553 | 553 |
gridViewPathItems.Columns["SequenceData_OID"].Caption = "PathItem ID"; |
554 | 554 |
gridViewPathItems.Columns["BranchTopologySet_OID"].Caption = "Branch Topology ID"; |
555 |
gridViewPathItems.Columns["PipeSystemNetwork_OID"].Visible = false; |
|
556 |
gridViewPathItems.Columns["ViewPipeSystemNetwork_OID"].Caption = "PSN OID";//ID2Info.ProgramName + " OID";
|
|
555 |
gridViewPathItems.Columns["PipeSystemNetwork_OID_ID2"].Visible = false;
|
|
556 |
gridViewPathItems.Columns["PipeSystemNetwork_OID"].Caption = "PSN OID";//ID2Info.ProgramName + " OID"; |
|
557 | 557 |
gridViewPathItems.Columns["ITEMNAME"].Caption = "Item Name"; |
558 | 558 |
gridViewPathItems.Columns["ITEMTAG"].Caption = "Item Tag"; |
559 | 559 |
gridViewPathItems.Columns["PipeLine_OID"].Caption = "PipeLine ID"; |
... | ... | |
664 | 664 |
newRow["OID"] = row["OID"].ToString(); |
665 | 665 |
newRow["SequenceData_OID"] = row["SequenceData_OID"].ToString(); |
666 | 666 |
newRow["BranchTopologySet_OID"] = row["BranchTopologySet_OID"].ToString(); |
667 |
newRow["PipeSystemNetwork_OID_ID2"] = row["PipeSystemNetwork_OID_ID2"].ToString(); |
|
667 | 668 |
newRow["PipeSystemNetwork_OID"] = row["PipeSystemNetwork_OID"].ToString(); |
668 |
newRow["ViewPipeSystemNetwork_OID"] = row["ViewPipeSystemNetwork_OID"].ToString(); |
|
669 | 669 |
newRow["ITEMNAME"] = row["ITEMNAME"].ToString(); |
670 | 670 |
newRow["ITEMTAG"] = row["ITEMTAG"].ToString(); |
671 | 671 |
newRow["PipeLine_OID"] = row["PipeLine_OID"].ToString(); |
... | ... | |
736 | 736 |
string newNozzleTag = string.Format("N{0}", string.Format("{0:D3}", nozzleMaxNumber)); |
737 | 737 |
|
738 | 738 |
// Path Table |
739 |
DataRow[] pathRows = currentPSN.PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", oid)); |
|
739 |
DataRow[] pathRows = currentPSN.PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", oid));
|
|
740 | 740 |
DataRow pathRow = null; |
741 | 741 |
if (column.FieldName == "FROM_DATA") |
742 | 742 |
pathRow = pathRows.First(); |
... | ... | |
779 | 779 |
DataTable dataDT = currentPSN.PathItems; |
780 | 780 |
//SequenceData 데이터 형식 복사 |
781 | 781 |
DataTable datasqDT = currentPSN.SequenceData.Clone(); |
782 |
//DataRow[] rows = dataDT.Select(string.Format("PipeSystemNetwork_OID = '{0}'",toolStripMenuItemPathItems.Tag)); |
|
782 |
//DataRow[] rows = dataDT.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'",toolStripMenuItemPathItems.Tag));
|
|
783 | 783 |
foreach (DataRow row in dataDT.Rows) |
784 | 784 |
{ |
785 |
if (row["PipeSystemNetwork_OID"].ToString() != toolStripMenuItemPathItems.Tag.ToString()) |
|
785 |
if (row["PipeSystemNetwork_OID_ID2"].ToString() != toolStripMenuItemPathItems.Tag.ToString())
|
|
786 | 786 |
continue; |
787 | 787 |
|
788 | 788 |
DataRow newsqRow = datasqDT.NewRow(); |
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
292 | 292 |
DataRow[] nopocketRows = PipeSystemNetwork.Select("Pocket = 'Yes'"); |
293 | 293 |
foreach (DataRow row in nopocketRows) |
294 | 294 |
{ |
295 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", row["OID"].ToString())); |
|
295 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", row["OID"].ToString()));
|
|
296 | 296 |
foreach (DataRow dr in pathItemRows) |
297 | 297 |
{ |
298 | 298 |
if (!string.IsNullOrEmpty(dr["BranchTopologySet_OID"].ToString())) |
... | ... | |
301 | 301 |
|
302 | 302 |
if (rows.First()["SubType"].ToString() == "Bypass") |
303 | 303 |
{ |
304 |
DataRow[] bypassRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", dr.Field<string>("ViewPipeSystemNetwork_OID")));
|
|
304 |
DataRow[] bypassRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", dr.Field<string>("PipeSystemNetwork_OID"))); |
|
305 | 305 |
|
306 | 306 |
foreach (DataRow drby in bypassRows) |
307 | 307 |
{ |
... | ... | |
354 | 354 |
|
355 | 355 |
foreach (DataRow drpipe in dtPipeSystemNetwork.Rows) |
356 | 356 |
{ |
357 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", drpipe["OID"].ToString())); |
|
357 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", drpipe["OID"].ToString()));
|
|
358 | 358 |
DataTable dtSequenceItems = SequenceData.Clone(); |
359 | 359 |
foreach (DataRow drpath in pathItemRows) |
360 | 360 |
{ |
... | ... | |
417 | 417 |
// 1, 2번 |
418 | 418 |
foreach (DataRow dataRow in pumpRows) |
419 | 419 |
{ |
420 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
420 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
|
|
421 | 421 |
|
422 | 422 |
string EGTAG = "EGTAG"; |
423 | 423 |
// string ItemTag = "ItemTag"; |
... | ... | |
495 | 495 |
foreach (DataRow dataRow in pumpRows) |
496 | 496 |
{ |
497 | 497 |
|
498 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
498 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
|
|
499 | 499 |
PSNItem PSNItem = PSNItems.Find(x => x.PSN_OID() == dataRow["OID"].ToString()); |
500 | 500 |
string EGFlowDirection = string.Empty; |
501 | 501 |
|
... | ... | |
520 | 520 |
|
521 | 521 |
foreach (DataRow dr in pathItemRows) |
522 | 522 |
{ |
523 |
if(dr.Field<string>("ViewPipeSystemNetwork_OID") != dataRow["OID"].ToString())
|
|
523 |
if(dr.Field<string>("PipeSystemNetwork_OID") != dataRow["OID"].ToString()) |
|
524 | 524 |
{ |
525 | 525 |
string viewEGFlowDirection = string.Empty; |
526 |
if (PipeSystemNetwork.Select(string.Format("OID = '{0}'", dr.Field<string>("ViewPipeSystemNetwork_OID"))).Count() > 0)
|
|
526 |
if (PipeSystemNetwork.Select(string.Format("OID = '{0}'", dr.Field<string>("PipeSystemNetwork_OID"))).Count() > 0) |
|
527 | 527 |
{ |
528 |
PSNItem viewPSNItem = PSNItems.Find(x => x.PSN_OID() == dr.Field<string>("ViewPipeSystemNetwork_OID"));
|
|
528 |
PSNItem viewPSNItem = PSNItems.Find(x => x.PSN_OID() == dr.Field<string>("PipeSystemNetwork_OID")); |
|
529 | 529 |
|
530 | 530 |
if (viewPSNItem.Groups.First().Items.First().Equipment != null) |
531 | 531 |
{ |
... | ... | |
544 | 544 |
} |
545 | 545 |
} |
546 | 546 |
|
547 |
if (EGFlowDirection.Equals(viewEGFlowDirection) && !lstViewPipeSystemNetwork_OID.Contains(dr.Field<string>("ViewPipeSystemNetwork_OID")))
|
|
548 |
lstViewPipeSystemNetwork_OID.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
|
|
547 |
if (EGFlowDirection.Equals(viewEGFlowDirection) && !lstViewPipeSystemNetwork_OID.Contains(dr.Field<string>("PipeSystemNetwork_OID"))) |
|
548 |
lstViewPipeSystemNetwork_OID.Add(dr.Field<string>("PipeSystemNetwork_OID")); |
|
549 | 549 |
} |
550 | 550 |
else |
551 | 551 |
{ |
... | ... | |
561 | 561 |
{ |
562 | 562 |
if (PipeSystemNetwork.Select(string.Format("PUMP = 'PUMP' AND OID = '{0}'", viewOID)).Count() > 0) |
563 | 563 |
{ |
564 |
selectViewOID = pathItemRows.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID") == viewOID).Last().Field<string>("OID");
|
|
564 |
selectViewOID = pathItemRows.Where(x => x.Field<string>("PipeSystemNetwork_OID") == viewOID).Last().Field<string>("OID"); |
|
565 | 565 |
} |
566 | 566 |
} |
567 | 567 |
} |
... | ... | |
571 | 571 |
{ |
572 | 572 |
if (PipeSystemNetwork.Select(string.Format("PUMP = 'PUMP' AND OID = '{0}'", viewOID)).Count() > 0) |
573 | 573 |
{ |
574 |
selectViewOID = pathItemRows.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID") == viewOID).Last().Field<string>("OID");
|
|
574 |
selectViewOID = pathItemRows.Where(x => x.Field<string>("PipeSystemNetwork_OID") == viewOID).Last().Field<string>("OID"); |
|
575 | 575 |
break; |
576 | 576 |
} |
577 | 577 |
} |
... | ... | |
581 | 581 |
{ |
582 | 582 |
string EqpGroupTag = string.Empty; |
583 | 583 |
|
584 |
if((EGFlowDirection == "O" && lstViewPipeSystemNetwork_OID.Contains(pathItemRows.Last().Field<string>("ViewPipeSystemNetwork_OID"))) ||
|
|
585 |
(EGFlowDirection == "I" && lstViewPipeSystemNetwork_OID.Contains(pathItemRows.First().Field<string>("ViewPipeSystemNetwork_OID"))))
|
|
584 |
if((EGFlowDirection == "O" && lstViewPipeSystemNetwork_OID.Contains(pathItemRows.Last().Field<string>("PipeSystemNetwork_OID"))) || |
|
585 |
(EGFlowDirection == "I" && lstViewPipeSystemNetwork_OID.Contains(pathItemRows.First().Field<string>("PipeSystemNetwork_OID")))) |
|
586 | 586 |
{ |
587 |
DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", pathItemRows.First().Field<string>("ViewPipeSystemNetwork_OID")));
|
|
587 |
DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", pathItemRows.First().Field<string>("PipeSystemNetwork_OID")));
|
|
588 | 588 |
|
589 | 589 |
foreach (DataRow row in viewpathItemRows) |
590 | 590 |
{ |
... | ... | |
670 | 670 |
// 5번 |
671 | 671 |
foreach (DataRow dataRow in pumpRows) |
672 | 672 |
{ |
673 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
673 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
|
|
674 | 674 |
|
675 | 675 |
bool bCheck = false; |
676 | 676 |
string EqpGroupTag = string.Empty; |
... | ... | |
708 | 708 |
if(!lstEqTagRows.Contains(EqpGroupTag)) |
709 | 709 |
lstEqTagRows.Add(EqpGroupTag); |
710 | 710 |
|
711 |
if(dataRow["OID"].ToString() != dr.Field<string>("ViewPipeSystemNetwork_OID"))
|
|
711 |
if(dataRow["OID"].ToString() != dr.Field<string>("PipeSystemNetwork_OID")) |
|
712 | 712 |
{ |
713 |
PSNItem viewPSNItem = PSNItems.Find(x => x.PSN_OID() == dr.Field<string>("ViewPipeSystemNetwork_OID"));
|
|
713 |
PSNItem viewPSNItem = PSNItems.Find(x => x.PSN_OID() == dr.Field<string>("PipeSystemNetwork_OID")); |
|
714 | 714 |
if (viewPSNItem.Groups.Last().Items.Last().Equipment == null) |
715 | 715 |
continue; |
716 | 716 |
|
... | ... | |
743 | 743 |
{ |
744 | 744 |
foreach (string viewPipesystem in lstViewPipeSystemNetwork_OID) |
745 | 745 |
{ |
746 |
DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", viewPipesystem)); |
|
746 |
DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", viewPipesystem));
|
|
747 | 747 |
foreach (DataRow viewdr in viewpathItemRows) |
748 | 748 |
{ |
749 | 749 |
if (!string.IsNullOrEmpty(viewdr["EqpGroupTag"].ToString())) |
... | ... | |
828 | 828 |
EGTAG = Prefix + "-" + EGTAG; |
829 | 829 |
} |
830 | 830 |
|
831 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
831 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
|
|
832 | 832 |
foreach (DataRow dr in pathItemRows) |
833 | 833 |
{ |
834 | 834 |
dr["EqpGroupTag"] = EGTAG; |
... | ... | |
844 | 844 |
if (changePSN.Contains(dataRow["OID"].ToString())) |
845 | 845 |
continue; |
846 | 846 |
|
847 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
847 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
|
|
848 | 848 |
string AFCTag = string.Empty; |
849 | 849 |
if (pathItemRows.Where(x => !string.IsNullOrEmpty(x.Field<string>("EqpGroupTag"))).Count() > 0) |
850 | 850 |
AFCTag = pathItemRows.Where(x => !string.IsNullOrEmpty(x.Field<string>("EqpGroupTag"))).First().Field<string>("EqpGroupTag"); |
851 | 851 |
|
852 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
|
|
852 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList(); |
|
853 | 853 |
|
854 | 854 |
if (dataRow["Type"].ToString() == "E2E") |
855 | 855 |
{ |
... | ... | |
867 | 867 |
|
868 | 868 |
if (p2psn.Count() > 0) |
869 | 869 |
{ |
870 |
DataRow[] viewPathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", lstoid)); |
|
871 |
List<string> lstview = viewPathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
|
|
870 |
DataRow[] viewPathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", lstoid));
|
|
871 |
List<string> lstview = viewPathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList(); |
|
872 | 872 |
lstview.Remove(dataRow["OID"].ToString()); // P1인 자신 제거 |
873 | 873 |
lstview.Remove(lstoid); // P2 자신 제거 |
874 | 874 |
|
... | ... | |
890 | 890 |
else |
891 | 891 |
{ |
892 | 892 |
// P2에 ML값 AGT값 지정 |
893 |
DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", lstoid)); |
|
893 |
DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", lstoid));
|
|
894 | 894 |
DataRow[] pipesystemRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", lstoid)); |
895 | 895 |
foreach (DataRow viewdr in pipesystemRows) |
896 | 896 |
{ |
... | ... | |
905 | 905 |
// 연결된 모든 P1들의 AGT값 치환 |
906 | 906 |
foreach (string pipe in lstnewpipe) |
907 | 907 |
{ |
908 |
viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", pipe)); |
|
908 |
viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", pipe));
|
|
909 | 909 |
foreach (DataRow viewdr in viewpathItemRows) |
910 | 910 |
{ |
911 | 911 |
viewdr["EqpGroupTag"] = AFCTag; |
... | ... | |
921 | 921 |
airFinCoolerRows = PipeSystemNetwork.Select("AFC Like 'P1%'"); |
922 | 922 |
foreach (DataRow dataRow in airFinCoolerRows) |
923 | 923 |
{ |
924 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
924 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
|
|
925 | 925 |
|
926 | 926 |
if (pathItemRows.Count() > 0) |
927 | 927 |
{ |
928 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
|
|
928 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList(); |
|
929 | 929 |
List<string> lstpsn = new List<string>(); |
930 | 930 |
List<string> lstAll = new List<string>(); |
931 | 931 |
string EqpGroupTag = string.Empty; |
... | ... | |
946 | 946 |
{ |
947 | 947 |
//P3의 AGT를 가져와 P1에 입력 |
948 | 948 |
if(string.IsNullOrEmpty(EqpGroupTag)) |
949 |
EqpGroupTag = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", viewOID)).First().Field<string>("EqpGroupTag"); |
|
949 |
EqpGroupTag = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", viewOID)).First().Field<string>("EqpGroupTag");
|
|
950 | 950 |
|
951 | 951 |
foreach (DataRow dr in pathItemRows) |
952 | 952 |
{ |
953 | 953 |
dr["EqpGroupTag"] = EqpGroupTag; |
954 | 954 |
|
955 | 955 |
//P1의 AGT와 같은 모든 AGT를 P3의 AGT로 변경하기위해 |
956 |
if (!string.IsNullOrEmpty(dr.Field<string>("ViewPipeSystemNetwork_OID")) && !lstpsn.Contains(dr.Field<string>("ViewPipeSystemNetwork_OID")))
|
|
956 |
if (!string.IsNullOrEmpty(dr.Field<string>("PipeSystemNetwork_OID")) && !lstpsn.Contains(dr.Field<string>("PipeSystemNetwork_OID")))
|
|
957 | 957 |
{ |
958 | 958 |
//AND MainLineTag = '' |
959 |
if (PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}' ", dr.Field<string>("ViewPipeSystemNetwork_OID"))).Count() > 0)
|
|
959 |
if (PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}' ", dr.Field<string>("PipeSystemNetwork_OID"))).Count() > 0)
|
|
960 | 960 |
{ |
961 |
lstpsn.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
|
|
962 |
lstAll.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
|
|
961 |
lstpsn.Add(dr.Field<string>("PipeSystemNetwork_OID")); |
|
962 |
lstAll.Add(dr.Field<string>("PipeSystemNetwork_OID")); |
|
963 | 963 |
} |
964 | 964 |
} |
965 | 965 |
} |
... | ... | |
968 | 968 |
|
969 | 969 |
while (lstpsn.Count() != 0) |
970 | 970 |
{ |
971 |
DataRow[] rule4pathItems = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", lstpsn[0])); |
|
971 |
DataRow[] rule4pathItems = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", lstpsn[0]));
|
|
972 | 972 |
foreach (DataRow dr in rule4pathItems) |
973 | 973 |
{ |
974 |
if (!string.IsNullOrEmpty(dr.Field<string>("ViewPipeSystemNetwork_OID")) && !lstAll.Contains(dr.Field<string>("ViewPipeSystemNetwork_OID")))
|
|
974 |
if (!string.IsNullOrEmpty(dr.Field<string>("PipeSystemNetwork_OID")) && !lstAll.Contains(dr.Field<string>("PipeSystemNetwork_OID")))
|
|
975 | 975 |
{ |
976 | 976 |
DataRow viewPSN = null; |
977 | 977 |
|
978 |
if (airFinCoolerRows.Where(x => x.Field<string>("OID") == dr.Field<string>("ViewPipeSystemNetwork_OID")).Count() > 0)
|
|
979 |
viewPSN = airFinCoolerRows.Where(x => x.Field<string>("OID") == dr.Field<string>("ViewPipeSystemNetwork_OID")).First();
|
|
978 |
if (airFinCoolerRows.Where(x => x.Field<string>("OID") == dr.Field<string>("PipeSystemNetwork_OID")).Count() > 0) |
|
979 |
viewPSN = airFinCoolerRows.Where(x => x.Field<string>("OID") == dr.Field<string>("PipeSystemNetwork_OID")).First(); |
|
980 | 980 |
|
981 | 981 |
if (viewPSN != null) |
982 | 982 |
{ |
983 |
lstpsn.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
|
|
984 |
lstAll.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
|
|
983 |
lstpsn.Add(dr.Field<string>("PipeSystemNetwork_OID")); |
|
984 |
lstAll.Add(dr.Field<string>("PipeSystemNetwork_OID")); |
|
985 | 985 |
} |
986 | 986 |
} |
987 | 987 |
|
... | ... | |
996 | 996 |
|
997 | 997 |
foreach(DataRow dr in PipeSystemNetwork.Rows) |
998 | 998 |
{ |
999 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}' AND MainLineTag = 'M'", dr["OID"].ToString())); |
|
999 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}' AND MainLineTag = 'M'", dr["OID"].ToString()));
|
|
1000 | 1000 |
if(pathItemRows.Count() > 0) |
1001 | 1001 |
{ |
1002 | 1002 |
if(dr["Type"].ToString() == "HD2") |
1003 | 1003 |
{ |
1004 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
|
|
1004 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList(); |
|
1005 | 1005 |
foreach(string viewpsn in lstViewPipeSystemNetwork_OID) |
1006 | 1006 |
{ |
1007 | 1007 |
if (PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC = 'P2'", viewpsn)).Count() > 0) |
1008 | 1008 |
{ |
1009 |
foreach(DataRow dataRow in pathItemRows.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID") == viewpsn))
|
|
1009 |
foreach(DataRow dataRow in pathItemRows.Where(x => x.Field<string>("PipeSystemNetwork_OID") == viewpsn)) |
|
1010 | 1010 |
{ |
1011 | 1011 |
dataRow["EGTConnectedPoint"] = "1"; |
1012 | 1012 |
} |
... | ... | |
1039 | 1039 |
|
1040 | 1040 |
if (!string.IsNullOrEmpty(EGFlowDirection)) |
1041 | 1041 |
{ |
1042 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
|
|
1042 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList(); |
|
1043 | 1043 |
string lastP1 = string.Empty; |
1044 | 1044 |
|
1045 | 1045 |
foreach (string viewpsn in lstViewPipeSystemNetwork_OID) |
... | ... | |
1075 | 1075 |
dataRow["EGFlowDirection"] = string.Empty; |
1076 | 1076 |
} |
1077 | 1077 |
|
1078 |
if (dataRow.Field<string>("ViewPipeSystemNetwork_OID").Equals(lastP1))
|
|
1078 |
if (dataRow.Field<string>("PipeSystemNetwork_OID").Equals(lastP1)) |
|
1079 | 1079 |
{ |
1080 | 1080 |
bCheck = true; |
1081 | 1081 |
dataRow["EGTConnectedPoint"] = 1; |
... | ... | |
1086 | 1086 |
{ |
1087 | 1087 |
foreach (DataRow dataRow in pathItemRows) |
1088 | 1088 |
{ |
1089 |
if (dataRow.Field<string>("ViewPipeSystemNetwork_OID").Equals(lastP1))
|
|
1089 |
if (dataRow.Field<string>("PipeSystemNetwork_OID").Equals(lastP1)) |
|
1090 | 1090 |
{ |
1091 | 1091 |
dataRow["EGTConnectedPoint"] = 1; |
1092 | 1092 |
break; |
... | ... | |
1108 | 1108 |
//psn data 정리 |
1109 | 1109 |
foreach(DataRow pipesystem in PipeSystemNetwork.Rows) |
1110 | 1110 |
{ |
1111 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", pipesystem["OID"].ToString())); |
|
1111 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", pipesystem["OID"].ToString()));
|
|
1112 | 1112 |
string EGTag = string.Empty; |
1113 | 1113 |
string HasMLTags = "False"; |
1114 | 1114 |
|
... | ... | |
1165 | 1165 |
continue; |
1166 | 1166 |
|
1167 | 1167 |
string[] valvetag = drPathitem["GROUPTAG"].ToString().Split(new string[] { "\\" }, StringSplitOptions.None); |
1168 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", drPathitem["PipeSystemNetwork_OID"].ToString()));
|
|
1168 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", drPathitem["PipeSystemNetwork_OID_ID2"].ToString()));
|
|
1169 | 1169 |
ValveGroupItem valveitem = ValveGrouping.ValveGroupItems.Where(x => x.SppidSymbolName == valvetag[0]).FirstOrDefault(); |
1170 | 1170 |
if (valveitem == null || valveitem.GroupType == "Scope Break") |
1171 | 1171 |
continue; |
... | ... | |
1250 | 1250 |
{ |
1251 | 1251 |
if(TopologySet.Select(string.Format("OID = '{0}'", dr["BranchTopologySet_OID"].ToString())).First().Field<string>("SubType") == "Bypass") |
1252 | 1252 |
{ |
1253 |
DataRow[] rows = keyValuePair.Value.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID").Equals(dr["ViewPipeSystemNetwork_OID"].ToString())).ToArray();
|
|
1253 |
DataRow[] rows = keyValuePair.Value.Where(x => x.Field<string>("PipeSystemNetwork_OID").Equals(dr["PipeSystemNetwork_OID"].ToString())).ToArray();
|
|
1254 | 1254 |
foreach(DataRow path in rows) |
1255 | 1255 |
{ |
1256 | 1256 |
DataRow topology = TopologySet.Select(string.Format("OID = '{0}'", path["BranchTopologySet_OID"].ToString())).First(); |
... | ... | |
1308 | 1308 |
{ |
1309 | 1309 |
if (TopologySet.Select(string.Format("OID = '{0}'", dr["BranchTopologySet_OID"].ToString())).First().Field<string>("SubType") == "Bypass") |
1310 | 1310 |
{ |
1311 |
DataRow[] rows = keyValuePair.Value.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID").Equals(dr["ViewPipeSystemNetwork_OID"].ToString())).ToArray();
|
|
1311 |
DataRow[] rows = keyValuePair.Value.Where(x => x.Field<string>("PipeSystemNetwork_OID").Equals(dr["PipeSystemNetwork_OID"].ToString())).ToArray();
|
|
1312 | 1312 |
foreach (DataRow path in rows) |
1313 | 1313 |
{ |
1314 | 1314 |
DataRow topology = TopologySet.Select(string.Format("OID = '{0}'", path["BranchTopologySet_OID"].ToString())).First(); |
... | ... | |
1330 | 1330 |
|
1331 | 1331 |
if (valveitems.GroupType.Contains("PSV")) |
1332 | 1332 |
{ |
1333 |
DataRow[] psnRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", drPathitem["PipeSystemNetwork_OID"].ToString())); |
|
1333 |
DataRow[] psnRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", drPathitem["PipeSystemNetwork_OID_ID2"].ToString()));
|
|
1334 | 1334 |
foreach (DataRow row in psnRows) |
1335 | 1335 |
row["Pocket"] = "Yes"; |
1336 | 1336 |
} |
... | ... | |
1342 | 1342 |
|
1343 | 1343 |
if(valveitem.GroupType.Contains("PSV")) |
1344 | 1344 |
{ |
1345 |
DataRow[] psnRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", drPathitem["PipeSystemNetwork_OID"].ToString())); |
|
1345 |
DataRow[] psnRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", drPathitem["PipeSystemNetwork_OID_ID2"].ToString()));
|
|
1346 | 1346 |
foreach (DataRow row in psnRows) |
1347 | 1347 |
row["Pocket"] = "Yes"; |
1348 | 1348 |
} |
... | ... | |
2261 | 2261 |
pathItemsDT.Columns.Add("Equipment_OID", typeof(string)); |
2262 | 2262 |
pathItemsDT.Columns.Add("NPD", typeof(string)); |
2263 | 2263 |
pathItemsDT.Columns.Add("GROUPTAG", typeof(string)); |
2264 |
pathItemsDT.Columns.Add("PipeSystemNetwork_OID_ID2", typeof(string)); |
|
2264 | 2265 |
pathItemsDT.Columns.Add("PipeSystemNetwork_OID", typeof(string)); |
2265 |
pathItemsDT.Columns.Add("ViewPipeSystemNetwork_OID", typeof(string)); |
|
2266 | 2266 |
pathItemsDT.Columns.Add("PipeRun_OID", typeof(string)); |
2267 | 2267 |
pathItemsDT.Columns.Add("EqpGroupTag", typeof(string)); |
2268 | 2268 |
pathItemsDT.Columns.Add("MainLineTag", typeof(string)); |
... | ... | |
2693 | 2693 |
newRow["NPD"] = null; |
2694 | 2694 |
|
2695 | 2695 |
newRow["GROUPTAG"] = GROUPTAG; |
2696 |
newRow["PipeSystemNetwork_OID"] = PSNItem.PSN_OID(); |
|
2696 |
newRow["PipeSystemNetwork_OID_ID2"] = PSNItem.PSN_OID();
|
|
2697 | 2697 |
if (branchItem == null) |
2698 |
newRow["ViewPipeSystemNetwork_OID"] = PSNItem.PSN_OID();
|
|
2698 |
newRow["PipeSystemNetwork_OID"] = PSNItem.PSN_OID(); |
|
2699 | 2699 |
else |
2700 |
newRow["ViewPipeSystemNetwork_OID"] = branchItem.PSNItem.PSN_OID();
|
|
2700 |
newRow["PipeSystemNetwork_OID"] = branchItem.PSNItem.PSN_OID(); |
|
2701 | 2701 |
|
2702 | 2702 |
newRow["PipeRun_OID"] = item.LineNumber != null ? item.LineNumber.Name : string.Empty; |
2703 | 2703 |
newRow["EGTConnectedPoint"] = 0; |
... | ... | |
3052 | 3052 |
if (rows.Length == 1) |
3053 | 3053 |
{ |
3054 | 3054 |
rows.First()["BranchTopologySet_OID"] = topologyName; |
3055 |
rows.First()["ViewPipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
|
|
3055 |
rows.First()["PipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID(); |
|
3056 | 3056 |
} |
3057 | 3057 |
else if (rows.Length > 1) |
3058 | 3058 |
{ |
... | ... | |
3075 | 3075 |
if (targetRow != null) |
3076 | 3076 |
{ |
3077 | 3077 |
targetRow["BranchTopologySet_OID"] = topologyName; |
3078 |
targetRow["ViewPipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
|
|
3078 |
targetRow["PipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID(); |
|
3079 | 3079 |
} |
3080 | 3080 |
} |
3081 | 3081 |
} |
... | ... | |
3088 | 3088 |
if (rows.Length == 1) |
3089 | 3089 |
{ |
3090 | 3090 |
rows.First()["BranchTopologySet_OID"] = topologyName; |
3091 |
rows.First()["ViewPipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
|
|
3091 |
rows.First()["PipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID(); |
|
3092 | 3092 |
} |
3093 | 3093 |
else if (rows.Length > 1) |
3094 | 3094 |
{ |
... | ... | |
3111 | 3111 |
if (targetRow != null) |
3112 | 3112 |
{ |
3113 | 3113 |
targetRow["BranchTopologySet_OID"] = topologyName; |
3114 |
targetRow["ViewPipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
|
|
3114 |
targetRow["PipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID(); |
|
3115 | 3115 |
} |
3116 | 3116 |
} |
3117 | 3117 |
} |
... | ... | |
3375 | 3375 |
|
3376 | 3376 |
if (dataRow.Field<string>("From_Data") == "ENDOFHEADER") |
3377 | 3377 |
{ |
3378 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3378 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
|
|
3379 | 3379 |
DataRow dr = pathItemRows.First(); |
3380 | 3380 |
dr["CLASS"] = PSNItem.Groups.First().Items.First().ID2DBName; |
3381 | 3381 |
dr["TYPE"] = "End"; |
... | ... | |
3385 | 3385 |
|
3386 | 3386 |
if (dataRow.Field<string>("To_Data") == "ENDOFHEADER") |
3387 | 3387 |
{ |
3388 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3388 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
|
|
3389 | 3389 |
DataRow dr = pathItemRows.Last(); |
3390 | 3390 |
dr["CLASS"] = PSNItem.Groups.Last().Items.Last().ID2DBName; |
3391 | 3391 |
dr["TYPE"] = "End"; |
... | ... | |
3403 | 3403 |
|
3404 | 3404 |
if (dataRow.Field<string>("From_Data") == keyitem.Keyword) |
3405 | 3405 |
{ |
3406 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3406 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
|
|
3407 | 3407 |
|
3408 | 3408 |
// |
3409 | 3409 |
//if(.) |
... | ... | |
3420 | 3420 |
|
3421 | 3421 |
if (dataRow.Field<string>("To_Data") == keyitem.Keyword) |
3422 | 3422 |
{ |
3423 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3423 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
|
|
3424 | 3424 |
|
3425 | 3425 |
if (PSNItem.Groups.Last().Items.Last().Name.Equals(keyitem.Name)) |
3426 | 3426 |
{ |
... | ... | |
3451 | 3451 |
if (!PSNItem.EnableType(PSNItem.StartType)) |
3452 | 3452 |
{ |
3453 | 3453 |
|
3454 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3454 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
|
|
3455 | 3455 |
int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()); |
3456 | 3456 |
|
3457 | 3457 |
Item item = PSNItem.Groups.First().Items.First(); |
... | ... | |
3497 | 3497 |
} |
3498 | 3498 |
else |
3499 | 3499 |
{ |
3500 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).First()), insertIndex); |
|
3500 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID_ID2 = '{1}'", item.PSNPipeLineID, dataRow["OID"])).First()), insertIndex);
|
|
3501 | 3501 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First(), FROM_DATA), insertIndex); |
3502 | 3502 |
|
3503 | 3503 |
bCheck = true; |
... | ... | |
3548 | 3548 |
|
3549 | 3549 |
if (!PSNItem.EnableType(PSNItem.EndType)) |
3550 | 3550 |
{ |
3551 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3551 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
|
|
3552 | 3552 |
//int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()) + pathItemRows.Count() - 1; |
3553 | 3553 |
DataRow dr = pathItemRows.Last(); |
3554 | 3554 |
if (change) |
... | ... | |
3607 | 3607 |
else |
3608 | 3608 |
{ |
3609 | 3609 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last(), TO_DATA), insertIndex); |
3610 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex); |
|
3610 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID_ID2 = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex);
|
|
3611 | 3611 |
} |
3612 | 3612 |
} |
3613 | 3613 |
else |
... | ... | |
3662 | 3662 |
for (int i = 0; i < PathItems.Rows.Count; i++) |
3663 | 3663 |
{ |
3664 | 3664 |
DataRow row = PathItems.Rows[i]; |
3665 |
if (row["PipeSystemNetwork_OID"].ToString() != dataRow["OID"].ToString()) |
|
3665 |
if (row["PipeSystemNetwork_OID_ID2"].ToString() != dataRow["OID"].ToString())
|
|
3666 | 3666 |
continue; |
3667 | 3667 |
string sequenceData = row["SequenceData_OID"].ToString(); |
3668 | 3668 |
string[] split = sequenceData.Split(new char[] { '_' }); |
... | ... | |
3714 | 3714 |
newRow["MULTIWAY"] = ""; |
3715 | 3715 |
newRow["PIDNAME"] = itemRow["PIDNAME"]; |
3716 | 3716 |
newRow["NPD"] = itemRow["NPD"]; |
3717 |
newRow["PipeSystemNetwork_OID_ID2"] = itemRow["PipeSystemNetwork_OID_ID2"]; |
|
3717 | 3718 |
newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"]; |
3718 |
newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"]; |
|
3719 | 3719 |
newRow["PipeRun_OID"] = itemRow["PipeRun_OID"]; |
3720 | 3720 |
newRow["EGTConnectedPoint"] = "0"; |
3721 | 3721 |
return newRow; |
... | ... | |
3737 | 3737 |
newRow["MULTIWAY"] = ""; |
3738 | 3738 |
newRow["PIDNAME"] = itemRow["PIDNAME"]; |
3739 | 3739 |
newRow["NPD"] = itemRow["NPD"]; |
3740 |
newRow["PipeSystemNetwork_OID_ID2"] = itemRow["PipeSystemNetwork_OID_ID2"]; |
|
3740 | 3741 |
newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"]; |
3741 |
newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"]; |
|
3742 | 3742 |
newRow["PipeRun_OID"] = itemRow["PipeRun_OID"]; |
3743 | 3743 |
newRow["EGTConnectedPoint"] = "0"; |
3744 | 3744 |
return newRow; |
... | ... | |
3765 | 3765 |
DataRow[] pipeSystem = PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID())); |
3766 | 3766 |
if (PSNItem.StartType == PSNType.Branch) |
3767 | 3767 |
{ |
3768 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID())); |
|
3768 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID()));
|
|
3769 | 3769 |
int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()); |
3770 | 3770 |
Item Teeitem = PSNItem.Groups.First().Items.First(); |
3771 | 3771 |
try |
... | ... | |
3779 | 3779 |
PathItems.Rows.InsertAt(createTeeRow(pathItemRows.First()), insertIndex); |
3780 | 3780 |
change = true; |
3781 | 3781 |
pathItemRows.First().SetField("BranchTopologySet_OID", string.Empty); |
3782 |
pathItemRows.First().SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
|
|
3782 |
pathItemRows.First().SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString()); |
|
3783 | 3783 |
} |
3784 | 3784 |
else |
3785 | 3785 |
{ //dicMultiwaySymbolUID.Add(item.UID, 1); |
... | ... | |
3790 | 3790 |
PathItems.Rows.InsertAt(createMultiWayConnRow(PathItems.Select(string.Format("OID = '{0}'", Teeitem.Relations[0].Item.UID + "_M1")).First(), multiItemOID, pathItemRows.First()), insertIndex); |
3791 | 3791 |
change = true; |
3792 | 3792 |
pathItemRows.First().SetField("BranchTopologySet_OID", string.Empty); |
3793 |
pathItemRows.First().SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
|
|
3793 |
pathItemRows.First().SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString()); |
|
3794 | 3794 |
|
3795 | 3795 |
SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(pathItemRows.First(), multiItemOID, 0), 0); |
3796 | 3796 |
|
... | ... | |
3811 | 3811 |
dicMultiwaySymbolUID[_items[0].UID] = index; |
3812 | 3812 |
PathItems.Rows.InsertAt(createMultiWayConnRow(PathItems.Select(string.Format("OID = '{0}'", _items[0].UID + "_M1")).First(), multiItemOID, pathItemRows.First()), insertIndex); |
3813 | 3813 |
pathItemRows.First().SetField("BranchTopologySet_OID", string.Empty); |
3814 |
pathItemRows.First().SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
|
|
3814 |
pathItemRows.First().SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString()); |
|
3815 | 3815 |
|
3816 | 3816 |
change = true; |
3817 | 3817 |
|
... | ... | |
3835 | 3835 |
if (PSNItem.EndType == PSNType.Branch) |
3836 | 3836 |
{ |
3837 | 3837 |
//change = true; |
3838 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID())); |
|
3838 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID()));
|
|
3839 | 3839 |
|
3840 | 3840 |
Item Teeitem = PSNItem.Groups.Last().Items.Last(); |
3841 | 3841 |
|
... | ... | |
3856 | 3856 |
PathItems.Rows.InsertAt(createTeeRow(dr), insertIndex); |
3857 | 3857 |
change = true; |
3858 | 3858 |
dr.SetField("BranchTopologySet_OID", string.Empty); |
3859 |
dr.SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
|
|
3859 |
dr.SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString()); |
|
3860 | 3860 |
} |
3861 | 3861 |
else |
3862 | 3862 |
{ |
... | ... | |
3866 | 3866 |
PathItems.Rows.InsertAt(createMultiWayConnRow(PathItems.Select(string.Format("OID = '{0}'", Teeitem.Relations[1].Item.UID + "_M1")).First(), multiItemOID, dr), insertIndex); |
3867 | 3867 |
change = true; |
3868 | 3868 |
dr.SetField("BranchTopologySet_OID", string.Empty); |
3869 |
dr.SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
|
|
3869 |
dr.SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString()); |
|
3870 | 3870 |
|
3871 |
SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(dr, multiItemOID, PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID())).Count()), 0); |
|
3871 |
SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(dr, multiItemOID, PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID())).Count()), 0);
|
|
3872 | 3872 |
|
3873 | 3873 |
foreach (DataRow pipedr in pipeSystem) |
3874 | 3874 |
{ |
... | ... | |
3891 | 3891 |
PathItems.Rows.InsertAt(createMultiWayConnRow(PathItems.Select(string.Format("OID = '{0}'", _items[0].UID + "_M1")).First(), multiItemOID, dr), insertIndex); |
3892 | 3892 |
change = true; |
3893 | 3893 |
dr.SetField("BranchTopologySet_OID", string.Empty); |
3894 |
dr.SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
|
|
3895 |
SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(dr, multiItemOID, PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID())).Count()), 0); |
|
3894 |
dr.SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString()); |
|
3895 |
SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(dr, multiItemOID, PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID())).Count()), 0);
|
|
3896 | 3896 |
|
3897 | 3897 |
foreach (DataRow pipedr in pipeSystem) |
3898 | 3898 |
{ |
... | ... | |
3910 | 3910 |
|
3911 | 3911 |
if (change) |
3912 | 3912 |
{ |
3913 |
//DataRow[] pathItemRows = pathItemsDT.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID())); |
|
3913 |
//DataRow[] pathItemRows = pathItemsDT.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID()));
|
|
3914 | 3914 |
int rowIndex = 0; |
3915 | 3915 |
for (int i = 0; i < PathItems.Rows.Count; i++) |
3916 | 3916 |
{ |
3917 | 3917 |
DataRow row = PathItems.Rows[i]; |
3918 |
if (row["PipeSystemNetwork_OID"].ToString() != PSNItem.PSN_OID()) |
|
3918 |
if (row["PipeSystemNetwork_OID_ID2"].ToString() != PSNItem.PSN_OID())
|
|
3919 | 3919 |
continue; |
3920 | 3920 |
string sequenceData = row["SequenceData_OID"].ToString(); |
3921 | 3921 |
string[] split = sequenceData.Split(new char[] { '_' }); |
... | ... | |
3967 | 3967 |
newRow["MULTIWAY"] = itemRow["MULTIWAY"]; |
3968 | 3968 |
newRow["PIDNAME"] = itemRow["PIDNAME"]; |
3969 | 3969 |
newRow["NPD"] = itemRow["NPD"]; |
3970 |
newRow["PipeSystemNetwork_OID_ID2"] = itemRow["PipeSystemNetwork_OID_ID2"]; |
|
3970 | 3971 |
newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"]; |
3971 |
newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"]; |
|
3972 | 3972 |
newRow["PipeRun_OID"] = itemRow["PipeRun_OID"]; |
3973 | 3973 |
|
3974 | 3974 |
newRow["EGTConnectedPoint"] = 0; |
... | ... | |
4003 | 4003 |
newRow["MULTIWAY"] = itemRow["MULTIWAY"]; |
4004 | 4004 |
newRow["PIDNAME"] = itemRow["PIDNAME"]; |
4005 | 4005 |
newRow["NPD"] = itemRow["NPD"]; |
4006 |
newRow["PipeSystemNetwork_OID_ID2"] = itemRow2["PipeSystemNetwork_OID_ID2"]; |
|
4006 | 4007 |
newRow["PipeSystemNetwork_OID"] = itemRow2["PipeSystemNetwork_OID"]; |
4007 |
newRow["ViewPipeSystemNetwork_OID"] = itemRow2["ViewPipeSystemNetwork_OID"]; |
|
4008 | 4008 |
newRow["PipeRun_OID"] = itemRow2["PipeRun_OID"]; |
4009 | 4009 |
newRow["EGTConnectedPoint"] = itemRow["EGTConnectedPoint"]; |
4010 | 4010 |
return newRow; |
내보내기 Unified diff