개정판 eb44d82c
issue #000: keyword 기능 수정, pipenetword system 데이터 저장 수정, 오류 시 wating form 안꺼지는 문제 수정, end of teminator 적용 시 라인이 끊겨있는 데이터일 경우 오류 발생 시 message 창 띄우고 return
Change-Id: I6dfcb62ad63d1dafa2e9c0651638974e4c8c34c1
DTI_PID/ID2PSN/DB.cs | ||
---|---|---|
980 | 980 |
connection.ExecuteNonQuery(connection.GetSqlStringCommand(query), txn); |
981 | 981 |
foreach (DataRow row in item.PipeSystemNetwork.Rows) |
982 | 982 |
{ |
983 |
query = $"INSERT INTO {PSN_PIPESYSTEMNETWORK} VALUES (@OID, @Type, @OrderNumber, @Pipeline_OID, @FROM_DATA, @TO_DATA, @TopologySet_OID_Key, @PSNRevisionNumber, " + |
|
984 |
$"@IsValid, @Status, @PBS, @Drawings, @IncludingVirtualData, @PSNAccuracy)"; |
|
983 |
query = $"INSERT INTO {PSN_PIPESYSTEMNETWORK} " + |
|
984 |
$"(OID, Type, OrderNumber, Pipeline_OID, FROM_DATA, TO_DATA, TopologySet_OID_Key, PSNRevisionNumber, PBS, Drawings, IsValid, Status, IncludingVirtualData, PSNAccuracy) VALUES " + |
|
985 |
$"(@OID, @Type, @OrderNumber, @Pipeline_OID, @FROM_DATA, @TO_DATA, @TopologySet_OID_Key, @PSNRevisionNumber, @PBS, @Drawings, @IsValid, @Status, @IncludingVirtualData, @PSNAccuracy)"; |
|
985 | 986 |
var cmd = connection.GetSqlStringCommand(query); |
986 | 987 |
AddWithValue(cmd, "@OID", row["OID"].ToString()); |
987 | 988 |
AddWithValue(cmd, "@Type", row["Type"].ToString()); |
... | ... | |
991 | 992 |
AddWithValue(cmd, "@TO_DATA", row["TO_DATA"].ToString()); |
992 | 993 |
AddWithValue(cmd, "@TopologySet_OID_Key", row["TopologySet_OID_Key"].ToString()); |
993 | 994 |
AddWithValue(cmd, "@PSNRevisionNumber", row["PSNRevisionNumber"].ToString()); |
994 |
AddWithValue(cmd, "@PBS", row["PBS"].ToString()); |
|
995 |
AddWithValue(cmd, "@Drawings", row["Drawings"].ToString()); |
|
995 |
|
|
996 | 996 |
int IsValid = 0; |
997 |
if (row["IsValid"].ToString() == "OK") |
|
997 |
if (row["IsValid"].ToString() == string.Empty || row["IsValid"].ToString() == "OK")
|
|
998 | 998 |
IsValid = 0; |
999 | 999 |
else if (row["IsValid"].ToString() == "InValid") |
1000 | 1000 |
IsValid = 1; |
... | ... | |
1002 | 1002 |
IsValid = -1; |
1003 | 1003 |
AddWithValue(cmd, "@IsValid", IsValid); |
1004 | 1004 |
AddWithValue(cmd, "@Status", row["Status"].ToString()); |
1005 |
|
|
1006 |
AddWithValue(cmd, "@PBS", row["PBS"].ToString()); |
|
1007 |
AddWithValue(cmd, "@Drawings", row["Drawings"].ToString()); |
|
1008 |
|
|
1005 | 1009 |
AddWithValue(cmd, "@IncludingVirtualData", row["IncludingVirtualData"].ToString()); |
1006 | 1010 |
AddWithValue(cmd, "@PSNAccuracy", row["PSNAccuracy"].ToString()); |
1007 | 1011 |
connection.ExecuteNonQuery(cmd, txn); |
... | ... | |
1237 | 1241 |
{ |
1238 | 1242 |
try |
1239 | 1243 |
{ |
1240 |
var query = $"SELECT * FROM {PSN_PIPESYSTEMNETWORK} WHERE PSNRevisionNumber = '{string.Format("V{0:D4}", GetRevision())}'"; |
|
1241 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
|
1242 |
{ |
|
1243 |
result.PipeSystemNetwork = ds.Tables[0].Clone(); |
|
1244 |
result.PipeSystemNetwork.Columns["IsValid"].DataType = typeof(string); |
|
1245 |
|
|
1246 |
foreach (DataRow row in ds.Tables[0].Rows) |
|
1247 |
{ |
|
1248 |
DataRow newRow = result.PipeSystemNetwork.NewRow(); |
|
1249 |
newRow["OID"] = row["OID"].ToString(); |
|
1250 |
newRow["Type"] = row["Type"].ToString(); |
|
1251 |
newRow["OrderNumber"] = row["OrderNumber"].ToString(); |
|
1252 |
newRow["Pipeline_OID"] = row["Pipeline_OID"].ToString(); |
|
1253 |
newRow["FROM_DATA"] = row["FROM_DATA"].ToString(); |
|
1254 |
newRow["TO_DATA"] = row["TO_DATA"].ToString(); |
|
1255 |
newRow["TopologySet_OID_Key"] = row["TopologySet_OID_Key"].ToString(); |
|
1256 |
newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString(); |
|
1257 |
newRow["PBS"] = row["PBS"].ToString(); |
|
1258 |
newRow["Drawings"] = row["Drawings"].ToString(); |
|
1259 |
string IsValid = string.Empty; |
|
1260 |
|
|
1261 |
if (Convert.ToInt32(row["IsValid"].ToString()) == 0) |
|
1262 |
IsValid = string.Empty;//"OK"; |
|
1263 |
else if (Convert.ToInt32(row["IsValid"].ToString()) == 1) |
|
1264 |
IsValid = "InValid"; |
|
1265 |
else if (Convert.ToInt32(row["IsValid"].ToString()) == -1) |
|
1266 |
IsValid = "Error"; |
|
1267 |
|
|
1268 |
newRow["IsValid"] = IsValid; |
|
1269 |
|
|
1270 |
newRow["Status"] = row["Status"].ToString(); |
|
1271 |
newRow["IncludingVirtualData"] = row["IncludingVirtualData"].ToString(); |
|
1272 |
newRow["PSNAccuracy"] = row["PSNAccuracy"].ToString(); |
|
1273 |
|
|
1274 |
result.PipeSystemNetwork.Rows.Add(newRow); |
|
1275 |
} |
|
1276 |
} |
|
1277 |
|
|
1278 |
query = $"SELECT * FROM {PSN_EQUIPMENT}"; |
|
1244 |
//var query = $"SELECT * FROM {PSN_PIPESYSTEMNETWORK} WHERE PSNRevisionNumber = '{string.Format("V{0:D4}", GetRevision())}'"; |
|
1245 |
//using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
|
1246 |
//{ |
|
1247 |
// result.PipeSystemNetwork = ds.Tables[0].Clone(); |
|
1248 |
// result.PipeSystemNetwork.Columns["IsValid"].DataType = typeof(string); |
|
1249 |
|
|
1250 |
// foreach (DataRow row in ds.Tables[0].Rows) |
|
1251 |
// { |
|
1252 |
// DataRow newRow = result.PipeSystemNetwork.NewRow(); |
|
1253 |
// newRow["OID"] = row["OID"].ToString(); |
|
1254 |
// newRow["Type"] = row["Type"].ToString(); |
|
1255 |
// newRow["OrderNumber"] = row["OrderNumber"].ToString(); |
|
1256 |
// newRow["Pipeline_OID"] = row["Pipeline_OID"].ToString(); |
|
1257 |
// newRow["FROM_DATA"] = row["FROM_DATA"].ToString(); |
|
1258 |
// newRow["TO_DATA"] = row["TO_DATA"].ToString(); |
|
1259 |
// newRow["TopologySet_OID_Key"] = row["TopologySet_OID_Key"].ToString(); |
|
1260 |
// newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString(); |
|
1261 |
|
|
1262 |
// string IsValid = string.Empty; |
|
1263 |
|
|
1264 |
// if (Convert.ToInt32(row["IsValid"].ToString()) == 0) |
|
1265 |
// IsValid = string.Empty;//"OK"; |
|
1266 |
// else if (Convert.ToInt32(row["IsValid"].ToString()) == 1) |
|
1267 |
// IsValid = "InValid"; |
|
1268 |
// else if (Convert.ToInt32(row["IsValid"].ToString()) == -1) |
|
1269 |
// IsValid = "Error"; |
|
1270 |
|
|
1271 |
// newRow["IsValid"] = IsValid; |
|
1272 |
|
|
1273 |
// newRow["Status"] = row["Status"].ToString(); |
|
1274 |
// newRow["PBS"] = row["PBS"].ToString(); |
|
1275 |
// newRow["Drawings"] = row["Drawings"].ToString(); |
|
1276 |
|
|
1277 |
// newRow["IncludingVirtualData"] = row["IncludingVirtualData"].ToString(); |
|
1278 |
// newRow["PSNAccuracy"] = row["PSNAccuracy"].ToString(); |
|
1279 |
|
|
1280 |
// result.PipeSystemNetwork.Rows.Add(newRow); |
|
1281 |
// } |
|
1282 |
//} |
|
1283 |
|
|
1284 |
var query = $"SELECT * FROM {PSN_EQUIPMENT}"; |
|
1279 | 1285 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
1280 | 1286 |
{ |
1281 | 1287 |
result.Equipment = ds.Tables[0].Copy(); |
... | ... | |
1435 | 1441 |
newRow["TO_DATA"] = row["TO_DATA"].ToString(); |
1436 | 1442 |
newRow["TopologySet_OID_Key"] = row["TopologySet_OID_Key"].ToString(); |
1437 | 1443 |
newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString(); |
1438 |
newRow["PBS"] = row["PBS"].ToString(); |
|
1439 |
newRow["Drawings"] = row["Drawings"].ToString(); |
|
1444 |
|
|
1440 | 1445 |
string IsValid = string.Empty; |
1441 | 1446 |
|
1442 | 1447 |
if (Convert.ToInt32(row["IsValid"].ToString()) == 0) |
... | ... | |
1447 | 1452 |
IsValid = "Error"; |
1448 | 1453 |
|
1449 | 1454 |
newRow["IsValid"] = IsValid; |
1450 |
|
|
1451 | 1455 |
newRow["Status"] = row["Status"].ToString(); |
1456 |
|
|
1457 |
newRow["PBS"] = row["PBS"].ToString(); |
|
1458 |
newRow["Drawings"] = row["Drawings"].ToString(); |
|
1459 |
|
|
1452 | 1460 |
newRow["IncludingVirtualData"] = row["IncludingVirtualData"].ToString(); |
1453 |
newRow["PSNAccuracy"] = row["PSNAccuracy"].ToString(); |
|
1461 |
newRow["PSNAccuracy"] = row["PSNAccuracy"].ToString(); |
|
1462 |
|
|
1454 | 1463 |
dt.Rows.Add(newRow); |
1455 | 1464 |
} |
1456 | 1465 |
} |
DTI_PID/ID2PSN/Document.cs | ||
---|---|---|
68 | 68 |
foreach (XElement element in xml.Element("TEXTINFOS").Elements("ATTRIBUTE")) |
69 | 69 |
TextInfos.Add(GetTextInfo(element)); |
70 | 70 |
|
71 |
|
|
72 | 71 |
List<Item> segmentBreaks = Items.FindAll(x => x.ID2DBType.ToUpper() == "Segment Breaks".ToUpper() || x.ID2DBType.ToUpper() == "End Break".ToUpper()); |
73 | 72 |
SegmentBreaks.AddRange(segmentBreaks); |
74 | 73 |
foreach (var item in segmentBreaks) |
... | ... | |
470 | 469 |
} |
471 | 470 |
#endregion |
472 | 471 |
|
472 |
//#region KeywordSetting |
|
473 |
////List<KeywordInfo> KeywordInfos = new List<KeywordInfo>(); |
|
474 |
//DataTable dtKeyword = DB.SelectKeywordsSetting(); |
|
475 |
//KeywordInfo KeywordInfos = new KeywordInfo(); |
|
476 |
|
|
477 |
//foreach (DataRow row in dtKeyword.Rows) |
|
478 |
//{ |
|
479 |
// int index = Convert.ToInt32(row["INDEX"]); |
|
480 |
// string name = row["NAME"].ToString(); |
|
481 |
// string keyword = row["KEYWORD"].ToString(); |
|
482 |
|
|
483 |
// KeywordInfos.KeywordItems.Add(new KeywordItem() |
|
484 |
// { |
|
485 |
// Index = index, |
|
486 |
// Name = name, |
|
487 |
// Keyword = keyword |
|
488 |
// }); |
|
489 |
//} |
|
490 |
|
|
491 |
//KeywordInfos.KeywordItems = KeywordInfos.KeywordItems.OrderBy(x => x.Index).ToList(); |
|
492 |
|
|
493 |
//foreach (Group group in Groups) |
|
494 |
//{ |
|
495 |
// //List<KeywordItem> endInfos = new List<KeywordItem>(); |
|
496 |
// bool bFind = false; |
|
497 |
// for (int i = 0; i < group.Items.Count; i++) |
|
498 |
// { |
|
499 |
// Item item = group.Items[i]; |
|
500 |
// foreach (KeywordItem keyword in KeywordInfos.KeywordItems) |
|
501 |
// { |
|
502 |
// if (endInfos.Contains(keyword)) |
|
503 |
// continue; |
|
504 |
|
|
505 |
// if (!keyword.Name.Equals(item.Name)) |
|
506 |
// { |
|
507 |
// endInfos.Add(keyword); |
|
508 |
// continue; |
|
509 |
// } |
|
510 |
|
|
511 |
// if (KeywordInfos.KeywordItems.Count.Equals(i + 1)) |
|
512 |
// { |
|
513 |
// for (int j = 0; j < i + 1; j++) |
|
514 |
// group.Items[j].Keyword = keyword.Keyword; |
|
515 |
// bFind = true; |
|
516 |
// break; |
|
517 |
// } |
|
518 |
// } |
|
519 |
|
|
520 |
// if (bFind || endInfos.Count.Equals(KeywordInfos.KeywordItems.Count)) |
|
521 |
// break; |
|
522 |
// } |
|
523 |
|
|
524 |
// endInfos = new List<KeywordItem>(); |
|
525 |
// bFind = false; |
|
526 |
// for (int i = 0; i < group.Items.Count; i++) |
|
527 |
// { |
|
528 |
// Item item = group.Items[group.Items.Count - i - 1]; |
|
529 |
// foreach (KeywordItem keyword in KeywordInfos.KeywordItems) |
|
530 |
// { |
|
531 |
// if (endInfos.Contains(keyword)) |
|
532 |
// continue; |
|
533 |
|
|
534 |
// if (!keyword.Name.Equals(item.Name)) |
|
535 |
// { |
|
536 |
// endInfos.Add(keyword); |
|
537 |
// continue; |
|
538 |
// } |
|
539 |
|
|
540 |
// if (KeywordInfos.KeywordItems.Count.Equals(i + 1)) |
|
541 |
// { |
|
542 |
// for (int j = 0; j < i + 1; j++) |
|
543 |
// group.Items[group.Items.Count - j - 1].Keyword = keyword.Keyword; |
|
544 |
// bFind = true; |
|
545 |
// break; |
|
546 |
// } |
|
547 |
// } |
|
548 |
|
|
549 |
// if (bFind || endInfos.Count.Equals(KeywordInfos.KeywordItems.Count)) |
|
550 |
// break; |
|
551 |
// } |
|
552 |
//} |
|
553 |
//#endregion |
|
554 |
|
|
473 | 555 |
int GetConnectedItemCount(Item item) |
474 | 556 |
{ |
475 | 557 |
return item.Relations.FindAll(x => x.Item != null).Count; |
DTI_PID/ID2PSN/Form/MainForm.cs | ||
---|---|---|
46 | 46 |
SetDataTable(DB.GetTopologySet(), |
47 | 47 |
DB.GetPipeSystemNetwork()); |
48 | 48 |
|
49 |
currentPSN = DB.GetDBPSN();
|
|
49 |
currentPSN = DB.GetDBPSN(); |
|
50 | 50 |
|
51 | 51 |
SetPathItem(currentPSN.PathItems); |
52 | 52 |
|
... | ... | |
199 | 199 |
} |
200 | 200 |
catch(Exception ex) |
201 | 201 |
{ |
202 |
splashScreenManager1.CloseWaitForm(); |
|
202 | 203 |
MessageBox.Show(ex.Message, "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error); |
203 | 204 |
} |
204 | 205 |
finally |
... | ... | |
308 | 309 |
PSNPageDT.Columns.Add("PSNRevisionNumber", typeof(string)); |
309 | 310 |
PSNPageDT.Columns.Add("PBS", typeof(string)); |
310 | 311 |
PSNPageDT.Columns.Add("Drawings", typeof(string)); |
312 |
|
|
311 | 313 |
PSNPageDT.Columns.Add("IsValid", typeof(string)); |
312 |
PSNPageDT.Columns.Add("Status", typeof(string)); |
|
314 |
PSNPageDT.Columns.Add("Status", typeof(string)); |
|
315 |
|
|
313 | 316 |
PSNPageDT.Columns.Add("IncludingVirtualData", typeof(string)); |
314 | 317 |
PSNPageDT.Columns.Add("PSNAccuracy", typeof(string)); |
315 | 318 |
PSNPageDT.Columns.Add("Show", typeof(string)); |
... | ... | |
410 | 413 |
newRow["FROM_DATA"] = row["FROM_DATA"].ToString(); |
411 | 414 |
newRow["TO_DATA"] = row["TO_DATA"].ToString(); |
412 | 415 |
newRow["TopologySet_OID_Key"] = row["TopologySet_OID_Key"].ToString(); |
413 |
newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString(); |
|
414 |
newRow["IsValid"] = row["IsValid"].ToString(); |
|
416 |
newRow["PSNRevisionNumber"] = row["PSNRevisionNumber"].ToString(); |
|
417 |
|
|
418 |
newRow["IsValid"] = row["IsValid"].ToString(); |
|
415 | 419 |
newRow["Status"] = row["Status"].ToString(); |
416 |
newRow["IncludingVirtualData"] = row["IncludingVirtualData"].ToString(); |
|
417 |
newRow["PSNAccuracy"] = row["PSNAccuracy"].ToString() + "%"; |
|
420 |
|
|
418 | 421 |
newRow["PBS"] = row["PBS"].ToString(); |
419 | 422 |
newRow["Drawings"] = row["Drawings"].ToString(); |
423 |
|
|
424 |
newRow["IncludingVirtualData"] = row["IncludingVirtualData"].ToString(); |
|
425 |
newRow["PSNAccuracy"] = row["PSNAccuracy"].ToString() + "%"; |
|
420 | 426 |
PSNPageDT.Rows.Add(newRow); |
421 | 427 |
} |
422 | 428 |
|
423 |
|
|
424 | 429 |
gridControlPSN.EndUpdate(); |
425 | 430 |
gridControlTopologys.EndUpdate(); |
426 | 431 |
} |
... | ... | |
464 | 469 |
SetDataTable(currentPSN.TopologySet, |
465 | 470 |
currentPSN.PipeSystemNetwork); |
466 | 471 |
|
467 |
currentPSN = DB.GetDBPSN(); |
|
472 |
// currentPSN = DB.GetDBPSN();
|
|
468 | 473 |
|
469 | 474 |
SetPathItem(currentPSN.PathItems); |
470 | 475 |
} |
DTI_PID/ID2PSN/Form/TransformKeywordsSettingForm.Designer.cs | ||
---|---|---|
79 | 79 |
this.ribbonControl.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False; |
80 | 80 |
this.ribbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages; |
81 | 81 |
this.ribbonControl.ShowToolbarCustomizeItem = false; |
82 |
this.ribbonControl.Size = new System.Drawing.Size(480, 32);
|
|
82 |
this.ribbonControl.Size = new System.Drawing.Size(488, 32);
|
|
83 | 83 |
this.ribbonControl.Toolbar.ShowCustomizeItem = false; |
84 | 84 |
// |
85 | 85 |
// layoutControl1 |
... | ... | |
94 | 94 |
this.layoutControl1.Name = "layoutControl1"; |
95 | 95 |
this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(488, 408, 650, 400); |
96 | 96 |
this.layoutControl1.Root = this.Root; |
97 |
this.layoutControl1.Size = new System.Drawing.Size(480, 639);
|
|
97 |
this.layoutControl1.Size = new System.Drawing.Size(488, 643);
|
|
98 | 98 |
this.layoutControl1.TabIndex = 1; |
99 | 99 |
this.layoutControl1.Text = "layoutControl1"; |
100 | 100 |
// |
... | ... | |
104 | 104 |
this.labelControlToolTip.ImageAlignToText = DevExpress.XtraEditors.ImageAlignToText.RightCenter; |
105 | 105 |
this.labelControlToolTip.ImageOptions.Alignment = System.Drawing.ContentAlignment.MiddleLeft; |
106 | 106 |
this.labelControlToolTip.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("labelControlToolTip.ImageOptions.Image"))); |
107 |
this.labelControlToolTip.Location = new System.Drawing.Point(398, 12);
|
|
107 |
this.labelControlToolTip.Location = new System.Drawing.Point(406, 12);
|
|
108 | 108 |
this.labelControlToolTip.Name = "labelControlToolTip"; |
109 | 109 |
this.labelControlToolTip.Size = new System.Drawing.Size(70, 16); |
110 | 110 |
this.labelControlToolTip.StyleController = this.layoutControl1; |
... | ... | |
117 | 117 |
this.gridControlKeyword.MainView = this.gridViewKeyword; |
118 | 118 |
this.gridControlKeyword.MenuManager = this.ribbonControl; |
119 | 119 |
this.gridControlKeyword.Name = "gridControlKeyword"; |
120 |
this.gridControlKeyword.Size = new System.Drawing.Size(432, 486);
|
|
120 |
this.gridControlKeyword.Size = new System.Drawing.Size(440, 490);
|
|
121 | 121 |
this.gridControlKeyword.TabIndex = 4; |
122 | 122 |
this.gridControlKeyword.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { |
123 | 123 |
this.gridViewKeyword}); |
... | ... | |
131 | 131 |
// btnClose |
132 | 132 |
// |
133 | 133 |
this.btnClose.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.ImageOptions.Image"))); |
134 |
this.btnClose.Location = new System.Drawing.Point(398, 591);
|
|
134 |
this.btnClose.Location = new System.Drawing.Point(406, 595);
|
|
135 | 135 |
this.btnClose.Name = "btnClose"; |
136 | 136 |
this.btnClose.Size = new System.Drawing.Size(70, 36); |
137 | 137 |
this.btnClose.StyleController = this.layoutControl1; |
... | ... | |
142 | 142 |
// btnSave |
143 | 143 |
// |
144 | 144 |
this.btnSave.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.ImageOptions.Image"))); |
145 |
this.btnSave.Location = new System.Drawing.Point(306, 591);
|
|
145 |
this.btnSave.Location = new System.Drawing.Point(314, 595);
|
|
146 | 146 |
this.btnSave.Name = "btnSave"; |
147 | 147 |
this.btnSave.Size = new System.Drawing.Size(68, 36); |
148 | 148 |
this.btnSave.StyleController = this.layoutControl1; |
... | ... | |
152 | 152 |
// |
153 | 153 |
// btnAddSymbol |
154 | 154 |
// |
155 |
this.btnAddSymbol.Location = new System.Drawing.Point(361, 63);
|
|
155 |
this.btnAddSymbol.Location = new System.Drawing.Point(367, 63);
|
|
156 | 156 |
this.btnAddSymbol.Name = "btnAddSymbol"; |
157 |
this.btnAddSymbol.Size = new System.Drawing.Size(95, 22);
|
|
157 |
this.btnAddSymbol.Size = new System.Drawing.Size(97, 22);
|
|
158 | 158 |
this.btnAddSymbol.StyleController = this.layoutControl1; |
159 | 159 |
this.btnAddSymbol.TabIndex = 2; |
160 | 160 |
this.btnAddSymbol.Text = " Add Symbol"; |
... | ... | |
173 | 173 |
this.layoutControlItem7, |
174 | 174 |
this.emptySpaceItem5}); |
175 | 175 |
this.Root.Name = "Root"; |
176 |
this.Root.Size = new System.Drawing.Size(480, 639);
|
|
176 |
this.Root.Size = new System.Drawing.Size(488, 643);
|
|
177 | 177 |
this.Root.TextVisible = false; |
178 | 178 |
// |
179 | 179 |
// emptySpaceItem3 |
180 | 180 |
// |
181 | 181 |
this.emptySpaceItem3.AllowHotTrack = false; |
182 |
this.emptySpaceItem3.Location = new System.Drawing.Point(0, 579);
|
|
182 |
this.emptySpaceItem3.Location = new System.Drawing.Point(0, 583);
|
|
183 | 183 |
this.emptySpaceItem3.Name = "emptySpaceItem3"; |
184 |
this.emptySpaceItem3.Size = new System.Drawing.Size(294, 40);
|
|
184 |
this.emptySpaceItem3.Size = new System.Drawing.Size(302, 40);
|
|
185 | 185 |
this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0); |
186 | 186 |
// |
187 | 187 |
// layoutControlItem4 |
188 | 188 |
// |
189 | 189 |
this.layoutControlItem4.Control = this.btnSave; |
190 |
this.layoutControlItem4.Location = new System.Drawing.Point(294, 579);
|
|
190 |
this.layoutControlItem4.Location = new System.Drawing.Point(302, 583);
|
|
191 | 191 |
this.layoutControlItem4.MaxSize = new System.Drawing.Size(72, 40); |
192 | 192 |
this.layoutControlItem4.MinSize = new System.Drawing.Size(72, 40); |
193 | 193 |
this.layoutControlItem4.Name = "layoutControlItem4"; |
... | ... | |
199 | 199 |
// layoutControlItem5 |
200 | 200 |
// |
201 | 201 |
this.layoutControlItem5.Control = this.btnClose; |
202 |
this.layoutControlItem5.Location = new System.Drawing.Point(386, 579);
|
|
202 |
this.layoutControlItem5.Location = new System.Drawing.Point(394, 583);
|
|
203 | 203 |
this.layoutControlItem5.MaxSize = new System.Drawing.Size(74, 40); |
204 | 204 |
this.layoutControlItem5.MinSize = new System.Drawing.Size(74, 40); |
205 | 205 |
this.layoutControlItem5.Name = "layoutControlItem5"; |
... | ... | |
211 | 211 |
// emptySpaceItem2 |
212 | 212 |
// |
213 | 213 |
this.emptySpaceItem2.AllowHotTrack = false; |
214 |
this.emptySpaceItem2.Location = new System.Drawing.Point(366, 579);
|
|
214 |
this.emptySpaceItem2.Location = new System.Drawing.Point(374, 583);
|
|
215 | 215 |
this.emptySpaceItem2.MaxSize = new System.Drawing.Size(20, 40); |
216 | 216 |
this.emptySpaceItem2.MinSize = new System.Drawing.Size(20, 40); |
217 | 217 |
this.emptySpaceItem2.Name = "emptySpaceItem2"; |
... | ... | |
228 | 228 |
this.emptySpaceItem1}); |
229 | 229 |
this.layoutControlGroup2.Location = new System.Drawing.Point(0, 20); |
230 | 230 |
this.layoutControlGroup2.Name = "layoutControlGroup2"; |
231 |
this.layoutControlGroup2.Size = new System.Drawing.Size(460, 559);
|
|
231 |
this.layoutControlGroup2.Size = new System.Drawing.Size(468, 563);
|
|
232 | 232 |
this.layoutControlGroup2.Text = "Keyword Items"; |
233 | 233 |
// |
234 | 234 |
// layoutControlItem6 |
... | ... | |
236 | 236 |
this.layoutControlItem6.Control = this.gridControlKeyword; |
237 | 237 |
this.layoutControlItem6.Location = new System.Drawing.Point(0, 26); |
238 | 238 |
this.layoutControlItem6.Name = "layoutControlItem6"; |
239 |
this.layoutControlItem6.Size = new System.Drawing.Size(436, 490);
|
|
239 |
this.layoutControlItem6.Size = new System.Drawing.Size(444, 494);
|
|
240 | 240 |
this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); |
241 | 241 |
this.layoutControlItem6.TextVisible = false; |
242 | 242 |
// |
243 | 243 |
// layoutControlItem3 |
244 | 244 |
// |
245 | 245 |
this.layoutControlItem3.Control = this.btnAddSymbol; |
246 |
this.layoutControlItem3.Location = new System.Drawing.Point(337, 0);
|
|
246 |
this.layoutControlItem3.Location = new System.Drawing.Point(343, 0);
|
|
247 | 247 |
this.layoutControlItem3.Name = "layoutControlItem3"; |
248 |
this.layoutControlItem3.Size = new System.Drawing.Size(99, 26);
|
|
248 |
this.layoutControlItem3.Size = new System.Drawing.Size(101, 26);
|
|
249 | 249 |
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0); |
250 | 250 |
this.layoutControlItem3.TextVisible = false; |
251 | 251 |
// |
... | ... | |
254 | 254 |
this.emptySpaceItem1.AllowHotTrack = false; |
255 | 255 |
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 0); |
256 | 256 |
this.emptySpaceItem1.Name = "emptySpaceItem1"; |
257 |
this.emptySpaceItem1.Size = new System.Drawing.Size(337, 26);
|
|
257 |
this.emptySpaceItem1.Size = new System.Drawing.Size(343, 26);
|
|
258 | 258 |
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); |
259 | 259 |
// |
260 | 260 |
// layoutControlItem7 |
261 | 261 |
// |
262 | 262 |
this.layoutControlItem7.Control = this.labelControlToolTip; |
263 |
this.layoutControlItem7.Location = new System.Drawing.Point(386, 0);
|
|
263 |
this.layoutControlItem7.Location = new System.Drawing.Point(394, 0);
|
|
264 | 264 |
this.layoutControlItem7.MaxSize = new System.Drawing.Size(74, 20); |
265 | 265 |
this.layoutControlItem7.MinSize = new System.Drawing.Size(74, 20); |
266 | 266 |
this.layoutControlItem7.Name = "layoutControlItem7"; |
... | ... | |
274 | 274 |
this.emptySpaceItem5.AllowHotTrack = false; |
275 | 275 |
this.emptySpaceItem5.Location = new System.Drawing.Point(0, 0); |
276 | 276 |
this.emptySpaceItem5.Name = "emptySpaceItem5"; |
277 |
this.emptySpaceItem5.Size = new System.Drawing.Size(386, 20);
|
|
277 |
this.emptySpaceItem5.Size = new System.Drawing.Size(394, 20);
|
|
278 | 278 |
this.emptySpaceItem5.TextSize = new System.Drawing.Size(0, 0); |
279 | 279 |
// |
280 | 280 |
// TransformKeywordsSettingForm |
281 | 281 |
// |
282 | 282 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); |
283 | 283 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
284 |
this.ClientSize = new System.Drawing.Size(480, 671);
|
|
284 |
this.ClientSize = new System.Drawing.Size(488, 675);
|
|
285 | 285 |
this.Controls.Add(this.layoutControl1); |
286 | 286 |
this.Controls.Add(this.ribbonControl); |
287 | 287 |
this.Name = "TransformKeywordsSettingForm"; |
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
60 | 60 |
|
61 | 61 |
ID2Info id2Info = ID2Info.GetInstance(); |
62 | 62 |
|
63 |
|
|
64 |
|
|
63 | 65 |
const string FluidPriorityType = "FLUIDCODE"; |
64 | 66 |
const string PipingMaterialsPriorityType = "PIPINGMATERIALSCLASS"; |
65 | 67 |
|
... | ... | |
1007 | 1009 |
} |
1008 | 1010 |
|
1009 | 1011 |
#region Keyword Info |
1010 |
List<KeywordInfo> KeywordInfos = new List<KeywordInfo>();
|
|
1012 |
KeywordInfo KeywordInfos = new KeywordInfo();
|
|
1011 | 1013 |
DataTable dtKeyword = DB.SelectKeywordsSetting(); |
1012 | 1014 |
foreach (DataRow row in dtKeyword.Rows) |
1013 | 1015 |
{ |
... | ... | |
1015 | 1017 |
string name = row["NAME"].ToString(); |
1016 | 1018 |
string keyword = row["KEYWORD"].ToString(); |
1017 | 1019 |
|
1018 |
KeywordInfo keywordInfo = new KeywordInfo(); |
|
1019 |
keywordInfo.KeywordItems.Add(new KeywordItem()
|
|
1020 |
//KeywordInfo keywordInfo = new KeywordInfo();
|
|
1021 |
KeywordInfos.KeywordItems.Add(new KeywordItem()
|
|
1020 | 1022 |
{ |
1021 | 1023 |
Index = index, |
1022 | 1024 |
Name = name, |
... | ... | |
1082 | 1084 |
} |
1083 | 1085 |
} |
1084 | 1086 |
|
1085 |
foreach (KeywordInfo keywordInfo in KeywordInfos) |
|
1086 |
keywordInfo.KeywordItems = keywordInfo.KeywordItems.OrderBy(x => x.Index).ToList(); |
|
1087 |
//foreach (KeywordInfo keywordInfo in KeywordInfos)
|
|
1088 |
// keywordInfo.KeywordItems = keywordInfo.KeywordItems.OrderBy(x => x.Index).ToList();
|
|
1087 | 1089 |
|
1088 | 1090 |
try |
1089 | 1091 |
{ |
... | ... | |
1197 | 1199 |
|
1198 | 1200 |
DataRow newRow = pipeSystemNetworkDT.NewRow(); |
1199 | 1201 |
newRow["OID"] = PSNItem.PSN_OID(); |
1200 |
newRow["Type"] = PSNItem.GetPSNType(); |
|
1202 |
|
|
1201 | 1203 |
newRow["OrderNumber"] = psnOrder; |
1202 | 1204 |
newRow["Pipeline_OID"] = item.PSNPipeLineID; |
1205 |
PSNItem.KeywordInfos = KeywordInfos; |
|
1206 |
newRow["FROM_DATA"] = PSNItem.GetFromData(); |
|
1207 |
|
|
1208 |
if (PSNItem.IsValid == "Keyword") |
|
1209 |
PSNItem.StartType = PSNType.Equipment; |
|
1203 | 1210 |
|
1204 |
newRow["FROM_DATA"] = PSNItem.GetFromData(); |
|
1205 | 1211 |
newRow["TO_DATA"] = PSNItem.GetToData(); |
1206 | 1212 |
|
1213 |
if (PSNItem.IsValid == "Keyword") |
|
1214 |
PSNItem.EndType = PSNType.Equipment; |
|
1215 |
|
|
1216 |
newRow["Type"] = PSNItem.GetPSNType(); |
|
1217 |
|
|
1207 | 1218 |
newRow["TopologySet_OID_Key"] = item.Topology.FullName; |
1208 | 1219 |
newRow["PSNRevisionNumber"] = string.Format("V{0:D4}", Revision); |
1209 |
newRow["PBS"] = PSNItem.GetPBSData(); |
|
1220 |
|
|
1210 | 1221 |
newRow["IsValid"] = PSNItem.IsValid; |
1211 | 1222 |
newRow["Status"] = !string.IsNullOrEmpty(PSNItem.Status) ? PSNItem.Status.Remove(0, 2) : string.Empty; |
1212 |
newRow["IncludingVirtualData"] = "No"; |
|
1213 |
|
|
1214 |
newRow["PSNAccuracy"] = "100"; |
|
1215 |
|
|
1223 |
newRow["PBS"] = PSNItem.GetPBSData(); |
|
1224 |
|
|
1216 | 1225 |
List<string> drawingNames = new List<string>(); |
1217 | 1226 |
foreach (Group _group in PSNItem.Groups) |
1218 | 1227 |
{ |
... | ... | |
1225 | 1234 |
drawingNames.Add(_group.Document.DrawingName); |
1226 | 1235 |
} |
1227 | 1236 |
} |
1228 |
|
|
1237 |
newRow["IncludingVirtualData"] = "No"; |
|
1238 |
newRow["PSNAccuracy"] = "100"; |
|
1229 | 1239 |
pipeSystemNetworkDT.Rows.Add(newRow); |
1230 | 1240 |
} |
1231 | 1241 |
} |
... | ... | |
1528 | 1538 |
bool bCheckRule5 = false; |
1529 | 1539 |
foreach (DataRow dataRow in errorRows) |
1530 | 1540 |
{ |
1531 |
PSNItem PSNItem = PSNItems.Find(x=>x.PSN_OID() == dataRow["OID"].ToString()); |
|
1532 |
bool change = false; |
|
1533 |
bCheckRule5 = false; |
|
1534 |
|
|
1535 |
if (!PSNItem.EnableType(PSNItem.StartType)) |
|
1541 |
try |
|
1536 | 1542 |
{ |
1537 |
change = true;
|
|
1538 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"]));
|
|
1539 |
int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First());
|
|
1543 |
PSNItem PSNItem = PSNItems.Find(x => x.PSN_OID() == dataRow["OID"].ToString());
|
|
1544 |
bool change = false;
|
|
1545 |
bCheckRule5 = false;
|
|
1540 | 1546 |
|
1541 |
Item item = PSNItem.Groups.First().Items.First(); |
|
1542 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
1543 |
loopRow["FROM_DATA"] = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex); |
|
1544 |
tieInPointIndex++; |
|
1545 |
|
|
1546 |
|
|
1547 |
if (item.ItemType == ItemType.Line) |
|
1547 |
if (!PSNItem.EnableType(PSNItem.StartType)) |
|
1548 | 1548 |
{ |
1549 |
//createTerminatorRow - Rule 5번 |
|
1550 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First()), insertIndex); |
|
1549 |
change = true; |
|
1550 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
1551 |
int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()); |
|
1551 | 1552 |
|
1552 |
bCheckRule5 = true; |
|
1553 |
} |
|
1554 |
else |
|
1555 |
{ |
|
1556 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND ItemName = 'PipeRun' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).First()), insertIndex); |
|
1557 |
//createTerminatorRow - Rule 5번 |
|
1558 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First()), insertIndex); |
|
1553 |
Item item = PSNItem.Groups.First().Items.First(); |
|
1554 |
try |
|
1555 |
{ |
|
1556 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
1557 |
loopRow["FROM_DATA"] = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex); |
|
1558 |
tieInPointIndex++; |
|
1559 | 1559 |
|
1560 |
bCheckRule5 = true; |
|
1561 |
} |
|
1562 | 1560 |
|
1563 |
PSNItem.StartType = PSNType.Equipment; |
|
1564 |
} |
|
1561 |
if (item.ItemType == ItemType.Line) |
|
1562 |
{ |
|
1563 |
//createTerminatorRow - Rule 5번 |
|
1564 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First()), insertIndex); |
|
1565 | 1565 |
|
1566 |
bCheckRule5 = true; |
|
1567 |
} |
|
1568 |
else |
|
1569 |
{ |
|
1570 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND ItemName = 'PipeRun' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).First()), insertIndex); |
|
1571 |
//createTerminatorRow - Rule 5번 |
|
1572 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First()), insertIndex); |
|
1566 | 1573 |
|
1567 |
if (!PSNItem.EnableType(PSNItem.EndType)) |
|
1568 |
{ |
|
1569 |
change = true; |
|
1570 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
1571 |
int insertIndex = PathItems.Rows.IndexOf(pathItemRows.Last()); |
|
1574 |
bCheckRule5 = true; |
|
1575 |
} |
|
1572 | 1576 |
|
1573 |
Item item = PSNItem.Groups.Last().Items.Last(); |
|
1574 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
1575 |
loopRow["TO_DATA"] = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex); |
|
1576 |
tieInPointIndex++; |
|
1577 |
PSNItem.StartType = PSNType.Equipment; |
|
1578 |
} |
|
1579 |
catch (Exception ex) |
|
1580 |
{ |
|
1581 |
MessageBox.Show("Please check the item.\r\nDrawingName : " + item.Document.DrawingName + "\r\nUID : " + item.UID, "ID2 " + id2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
1582 |
return; |
|
1583 |
} |
|
1584 |
} |
|
1577 | 1585 |
|
1578 | 1586 |
|
1579 |
if (item.ItemType == ItemType.Line)
|
|
1587 |
if (!PSNItem.EnableType(PSNItem.EndType))
|
|
1580 | 1588 |
{ |
1581 |
//createTerminatorRow - Rule 5번 |
|
1582 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last()), insertIndex + 1); |
|
1589 |
change = true; |
|
1590 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
1591 |
int insertIndex = PathItems.Rows.IndexOf(pathItemRows.Last()); |
|
1592 |
Item item = PSNItem.Groups.Last().Items.Last(); |
|
1593 |
try |
|
1594 |
{ |
|
1595 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
1596 |
loopRow["TO_DATA"] = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex); |
|
1597 |
tieInPointIndex++; |
|
1598 |
|
|
1599 |
|
|
1600 |
if (item.ItemType == ItemType.Line) |
|
1601 |
{ |
|
1602 |
//createTerminatorRow - Rule 5번 |
|
1603 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last()), insertIndex + 1); |
|
1604 |
|
|
1605 |
bCheckRule5 = true; |
|
1606 |
} |
|
1607 |
else |
|
1608 |
{ |
|
1609 |
//createTerminatorRow - Rule 5번 |
|
1610 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last()), insertIndex + 1); |
|
1611 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND ItemName = 'PipeRun' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex + 1); |
|
1612 |
|
|
1613 |
bCheckRule5 = true; |
|
1614 |
} |
|
1583 | 1615 |
|
1616 |
PSNItem.EndType = PSNType.Equipment; |
|
1617 |
} |
|
1618 |
catch(Exception ex) |
|
1619 |
{ |
|
1620 |
MessageBox.Show("Please check the item.\r\nDrawingName : " + item.Document.DrawingName + "\r\nUID : " + item.UID, "ID2 " + id2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
1621 |
return; |
|
1622 |
} |
|
1584 | 1623 |
} |
1585 |
else |
|
1624 |
|
|
1625 |
dataRow["Type"] = PSNItem.GetPSNType(); |
|
1626 |
if (change) |
|
1586 | 1627 |
{ |
1587 |
//createTerminatorRow - Rule 5번 |
|
1588 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last()), insertIndex + 1); |
|
1589 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND ItemName = 'PipeRun' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex + 1); |
|
1628 |
int rowIndex = 0; |
|
1629 |
for (int i = 0; i < PathItems.Rows.Count; i++) |
|
1630 |
{ |
|
1631 |
DataRow row = PathItems.Rows[i]; |
|
1632 |
if (row["PipeSystemNetwork_OID"].ToString() != dataRow["OID"].ToString()) |
|
1633 |
continue; |
|
1634 |
string sequenceData = row["SequenceData_OID"].ToString(); |
|
1635 |
string[] split = sequenceData.Split(new char[] { '_' }); |
|
1636 |
|
|
1637 |
StringBuilder sb = new StringBuilder(); |
|
1638 |
for (int j = 0; j < split.Length - 1; j++) |
|
1639 |
sb.Append(split[j] + "_"); |
|
1640 |
sb.Append(rowIndex++); |
|
1641 |
row["SequenceData_OID"] = sb.ToString(); |
|
1642 |
} |
|
1643 |
} |
|
1590 | 1644 |
|
1591 |
bCheckRule5 = true; |
|
1645 |
if (bCheckRule5) |
|
1646 |
{ |
|
1647 |
string PSNAccuracy = "0.6"; |
|
1648 |
dataRow["IncludingVirtualData"] = "Yes"; |
|
1649 |
dataRow["PSNAccuracy"] = PSNAccuracy; |
|
1650 |
|
|
1592 | 1651 |
} |
1593 | 1652 |
|
1594 |
PSNItem.EndType = PSNType.Equipment; |
|
1595 |
} |
|
1653 |
DataRow createTerminatorRow(DataRow itemRow) |
|
1654 |
{ |
|
1655 |
DataRow newRow = PathItems.NewRow(); |
|
1656 |
newRow["OID"] = Guid.NewGuid().ToString(); |
|
1657 |
newRow["SequenceData_OID"] = itemRow["SequenceData_OID"]; |
|
1658 |
newRow["TopologySet_OID"] = itemRow["TopologySet_OID"]; |
|
1659 |
newRow["BranchTopologySet_OID"] = itemRow["BranchTopologySet_OID"]; |
|
1660 |
newRow["PipeLine_OID"] = itemRow["PipeLine_OID"]; |
|
1661 |
newRow["ITEMNAME"] = "End of line terminator"; |
|
1662 |
newRow["ITEMTAG"] = itemRow["ITEMTAG"]; |
|
1663 |
newRow["Class"] = "End of line terminator"; |
|
1664 |
newRow["SubClass"] = "End of line terminator"; |
|
1665 |
newRow["TYPE"] = "End of line terminator"; |
|
1666 |
newRow["PIDNAME"] = itemRow["PIDNAME"]; |
|
1667 |
newRow["NPD"] = itemRow["NPD"]; |
|
1668 |
newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"]; |
|
1669 |
newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"]; |
|
1670 |
newRow["PipeRun_OID"] = itemRow["PipeRun_OID"]; |
|
1671 |
|
|
1672 |
return newRow; |
|
1673 |
} |
|
1596 | 1674 |
|
1597 |
dataRow["Type"] = PSNItem.GetPSNType(); |
|
1598 |
if (change) |
|
1599 |
{ |
|
1600 |
int rowIndex = 0; |
|
1601 |
for (int i = 0; i < PathItems.Rows.Count; i++) |
|
1675 |
DataRow createLineRow(DataRow itemRow) |
|
1602 | 1676 |
{ |
1603 |
DataRow row = PathItems.Rows[i]; |
|
1604 |
if (row["PipeSystemNetwork_OID"].ToString() != dataRow["OID"].ToString()) |
|
1605 |
continue; |
|
1606 |
string sequenceData = row["SequenceData_OID"].ToString(); |
|
1607 |
string[] split = sequenceData.Split(new char[] { '_' }); |
|
1608 |
|
|
1609 |
StringBuilder sb = new StringBuilder(); |
|
1610 |
for (int j = 0; j < split.Length - 1; j++) |
|
1611 |
sb.Append(split[j] + "_"); |
|
1612 |
sb.Append(rowIndex++); |
|
1613 |
row["SequenceData_OID"] = sb.ToString(); |
|
1677 |
DataRow newRow = PathItems.NewRow(); |
|
1678 |
newRow["OID"] = Guid.NewGuid().ToString(); |
|
1679 |
newRow["SequenceData_OID"] = itemRow["SequenceData_OID"]; |
|
1680 |
newRow["TopologySet_OID"] = itemRow["TopologySet_OID"]; |
|
1681 |
newRow["BranchTopologySet_OID"] = itemRow["BranchTopologySet_OID"]; |
|
1682 |
newRow["PipeLine_OID"] = itemRow["PipeLine_OID"]; |
|
1683 |
newRow["ITEMNAME"] = itemRow["ITEMNAME"]; |
|
1684 |
newRow["ITEMTAG"] = itemRow["ITEMTAG"]; |
|
1685 |
newRow["Class"] = itemRow["Class"]; |
|
1686 |
newRow["SubClass"] = itemRow["SubClass"]; |
|
1687 |
newRow["TYPE"] = itemRow["TYPE"]; |
|
1688 |
newRow["PIDNAME"] = itemRow["PIDNAME"]; |
|
1689 |
newRow["NPD"] = itemRow["NPD"]; |
|
1690 |
newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"]; |
|
1691 |
newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"]; |
|
1692 |
newRow["PipeRun_OID"] = itemRow["PipeRun_OID"]; |
|
1693 |
|
|
1694 |
return newRow; |
|
1614 | 1695 |
} |
1615 | 1696 |
} |
1616 |
|
|
1617 |
if (bCheckRule5) |
|
1697 |
catch(Exception ex) |
|
1618 | 1698 |
{ |
1619 |
string PSNAccuracy = "0.6"; |
|
1620 |
dataRow["IncludingVirtualData"] = "Yes"; |
|
1621 |
dataRow["PSNAccuracy"] = PSNAccuracy; |
|
1622 |
} |
|
1623 | 1699 |
|
1624 |
DataRow createTerminatorRow(DataRow itemRow) |
|
1625 |
{ |
|
1626 |
DataRow newRow = PathItems.NewRow(); |
|
1627 |
newRow["OID"] = Guid.NewGuid().ToString(); |
|
1628 |
newRow["SequenceData_OID"] = itemRow["SequenceData_OID"]; |
|
1629 |
newRow["TopologySet_OID"] = itemRow["TopologySet_OID"]; |
|
1630 |
newRow["BranchTopologySet_OID"] = itemRow["BranchTopologySet_OID"]; |
|
1631 |
newRow["PipeLine_OID"] = itemRow["PipeLine_OID"]; |
|
1632 |
newRow["ITEMNAME"] = "End of line terminator"; |
|
1633 |
newRow["ITEMTAG"] = itemRow["ITEMTAG"]; |
|
1634 |
newRow["Class"] = "End of line terminator"; |
|
1635 |
newRow["SubClass"] = "End of line terminator"; |
|
1636 |
newRow["TYPE"] = "End of line terminator"; |
|
1637 |
newRow["PIDNAME"] = itemRow["PIDNAME"]; |
|
1638 |
newRow["NPD"] = itemRow["NPD"]; |
|
1639 |
newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"]; |
|
1640 |
newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"]; |
|
1641 |
newRow["PipeRun_OID"] = itemRow["PipeRun_OID"]; |
|
1642 |
|
|
1643 |
return newRow; |
|
1644 |
} |
|
1645 |
|
|
1646 |
DataRow createLineRow(DataRow itemRow) |
|
1647 |
{ |
|
1648 |
DataRow newRow = PathItems.NewRow(); |
|
1649 |
newRow["OID"] = Guid.NewGuid().ToString(); |
|
1650 |
newRow["SequenceData_OID"] = itemRow["SequenceData_OID"]; |
|
1651 |
newRow["TopologySet_OID"] = itemRow["TopologySet_OID"]; |
|
1652 |
newRow["BranchTopologySet_OID"] = itemRow["BranchTopologySet_OID"]; |
|
1653 |
newRow["PipeLine_OID"] = itemRow["PipeLine_OID"]; |
|
1654 |
newRow["ITEMNAME"] = itemRow["ITEMNAME"]; |
|
1655 |
newRow["ITEMTAG"] = itemRow["ITEMTAG"]; |
|
1656 |
newRow["Class"] = itemRow["Class"]; |
|
1657 |
newRow["SubClass"] = itemRow["SubClass"]; |
|
1658 |
newRow["TYPE"] = itemRow["TYPE"]; |
|
1659 |
newRow["PIDNAME"] = itemRow["PIDNAME"]; |
|
1660 |
newRow["NPD"] = itemRow["NPD"]; |
|
1661 |
newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"]; |
|
1662 |
newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"]; |
|
1663 |
newRow["PipeRun_OID"] = itemRow["PipeRun_OID"]; |
|
1664 |
|
|
1665 |
return newRow; |
|
1666 | 1700 |
} |
1667 |
}
|
|
1701 |
} |
|
1668 | 1702 |
} |
1669 | 1703 |
} |
1670 | 1704 |
|
... | ... | |
1678 | 1712 |
Index = count + 1; |
1679 | 1713 |
this.Revision = Revision; |
1680 | 1714 |
} |
1715 |
|
|
1681 | 1716 |
private int Revision; |
1682 | 1717 |
public string UID { get; set; } |
1683 | 1718 |
public List<Group> Groups { get; set; } |
... | ... | |
1689 | 1724 |
public string Status { get; set; } |
1690 | 1725 |
public string IncludingVirtualData { get; set; } |
1691 | 1726 |
public string PSNAccuracy { get; set; } |
1727 |
public KeywordInfo KeywordInfos = new KeywordInfo(); |
|
1692 | 1728 |
|
1693 | 1729 |
public string PSN_OID() |
1694 | 1730 |
{ |
... | ... | |
1749 | 1785 |
public string GetFromData() |
1750 | 1786 |
{ |
1751 | 1787 |
string result = string.Empty; |
1788 |
if (IsValid == "Keyword") |
|
1789 |
IsValid = string.Empty; |
|
1752 | 1790 |
try |
1753 | 1791 |
{ |
1754 | 1792 |
if (StartType == PSNType.Header) |
... | ... | |
1786 | 1824 |
result = item.ID2DBName; |
1787 | 1825 |
} |
1788 | 1826 |
else |
1827 |
{ |
|
1789 | 1828 |
result = keyword; |
1829 |
IsValid = "Keyword"; |
|
1830 |
} |
|
1790 | 1831 |
|
1791 | 1832 |
} |
1792 | 1833 |
else if (item.ItemType == ItemType.Line) |
... | ... | |
1811 | 1852 |
string result = string.Empty; |
1812 | 1853 |
|
1813 | 1854 |
Item item = Groups.First().Items.First(); |
1814 |
if(!string.IsNullOrEmpty(item.Keyword)) |
|
1855 |
|
|
1856 |
foreach(KeywordItem keyitem in KeywordInfos.KeywordItems) |
|
1815 | 1857 |
{ |
1816 |
result = item.Keyword; |
|
1858 |
if(keyitem.Name.Equals(item.Name)) |
|
1859 |
result = keyitem.Keyword; |
|
1817 | 1860 |
} |
1861 |
|
|
1818 | 1862 |
return result; |
1819 | 1863 |
} |
1820 | 1864 |
|
... | ... | |
1823 | 1867 |
string result = string.Empty; |
1824 | 1868 |
|
1825 | 1869 |
Item item = Groups.Last().Items.Last(); |
1826 |
if (!string.IsNullOrEmpty(item.Keyword))
|
|
1870 |
foreach (KeywordItem keyitem in KeywordInfos.KeywordItems)
|
|
1827 | 1871 |
{ |
1828 |
result = item.Keyword; |
|
1872 |
if (keyitem.Name.Equals(item.Name)) |
|
1873 |
result = keyitem.Keyword; |
|
1829 | 1874 |
} |
1830 | 1875 |
return result; |
1831 | 1876 |
} |
... | ... | |
1833 | 1878 |
public string GetToData() |
1834 | 1879 |
{ |
1835 | 1880 |
string result = string.Empty; |
1881 |
if(IsValid == "Keyword") |
|
1882 |
IsValid = string.Empty; |
|
1883 |
|
|
1836 | 1884 |
if (EndType == PSNType.Header) |
1837 | 1885 |
result = "ENDOFHEADER"; |
1838 | 1886 |
else if (EndType == PSNType.Branch) |
... | ... | |
1867 | 1915 |
result = item.ID2DBName; |
1868 | 1916 |
} |
1869 | 1917 |
else |
1918 |
{ |
|
1870 | 1919 |
result = keyword; |
1920 |
IsValid = "Keyword"; |
|
1921 |
} |
|
1871 | 1922 |
|
1872 | 1923 |
} |
1873 | 1924 |
else if (item.ItemType == ItemType.Line) |
내보내기 Unified diff