개정판 ecdd26cc
issue #000: tieinpoint
Change-Id: I1917577c897c279811f606715242ae9c0adfbed4
DTI_PID/ID2PSN/DB.cs | ||
---|---|---|
905 | 905 |
// var query = "SELECT DISTINCT Attribute, DisplayAttribute FROM SymbolAttribute;"; |
906 | 906 |
var query = string.Empty; |
907 | 907 |
if (id2Info.ID2DBType == ID2DB_Type.MSSQL) |
908 |
query = "SELECT DISTINCT Attribute FROM SymbolAttribute WHERE SymbolType_UID IN(SELECT SymbolType_UID FROM Symbol WHERE CONVERT(varchar(Max), isnull([Name], '')) = 'TIEINPOINT');"; |
|
908 |
query = "SELECT DISTINCT Attribute FROM SymbolAttribute WHERE SymbolType_UID IN(SELECT SymbolType_UID FROM Symbol WHERE CONVERT(varchar(Max), isnull([Name], '')) = 'TIEINPOINT');"; //얘는 UPPER안해줘도 나옴
|
|
909 | 909 |
else |
910 |
query = "SELECT DISTINCT Attribute FROM SymbolAttribute WHERE SymbolType_UID IN(SELECT SymbolType_UID FROM Symbol WHERE ifnull([Name], '') = 'TIEINPOINT');";
|
|
910 |
query = "SELECT DISTINCT Attribute FROM SymbolAttribute WHERE SymbolType_UID IN(SELECT SymbolType_UID FROM Symbol WHERE ifnull(UPPER([Name]), '') = 'TIEINPOINT');";
|
|
911 | 911 |
|
912 | 912 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
913 | 913 |
{ |
DTI_PID/ID2PSN/Form/MainForm.Designer.cs | ||
---|---|---|
85 | 85 |
this.toolStripMenuItemPathItems = new System.Windows.Forms.ToolStripMenuItem(); |
86 | 86 |
this.splashScreenManager1 = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::ID2PSN.WaitForm), true, true); |
87 | 87 |
this.sqLiteCommandBuilder1 = new System.Data.SQLite.SQLiteCommandBuilder(); |
88 |
this.TieInSetting = new DevExpress.XtraEditors.SimpleButton(); |
|
89 |
this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
88 | 90 |
((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).BeginInit(); |
89 | 91 |
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); |
90 | 92 |
this.layoutControl1.SuspendLayout(); |
... | ... | |
123 | 125 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit(); |
124 | 126 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem17)).BeginInit(); |
125 | 127 |
this.contextMenuPSN.SuspendLayout(); |
128 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit(); |
|
126 | 129 |
this.SuspendLayout(); |
127 | 130 |
// |
128 | 131 |
// ribbonControl |
... | ... | |
163 | 166 |
this.layoutControl1.Controls.Add(this.btnValveGroupItemsSetting); |
164 | 167 |
this.layoutControl1.Controls.Add(this.btnEquipment); |
165 | 168 |
this.layoutControl1.Controls.Add(this.btnHistory); |
169 |
this.layoutControl1.Controls.Add(this.TieInSetting); |
|
166 | 170 |
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; |
167 | 171 |
this.layoutControl1.Location = new System.Drawing.Point(0, 32); |
168 | 172 |
this.layoutControl1.Name = "layoutControl1"; |
... | ... | |
378 | 382 |
// |
379 | 383 |
// PBSSetting |
380 | 384 |
// |
381 |
this.PBSSetting.Location = new System.Drawing.Point(24, 251);
|
|
385 |
this.PBSSetting.Location = new System.Drawing.Point(24, 277);
|
|
382 | 386 |
this.PBSSetting.Name = "PBSSetting"; |
383 | 387 |
this.PBSSetting.Size = new System.Drawing.Size(233, 22); |
384 | 388 |
this.PBSSetting.StyleController = this.layoutControl1; |
... | ... | |
443 | 447 |
this.layoutControlItem15, |
444 | 448 |
this.layoutControlItem16, |
445 | 449 |
this.layoutControlItem7, |
446 |
this.layoutControlItem8}); |
|
450 |
this.layoutControlItem8, |
|
451 |
this.layoutControlItem10}); |
|
447 | 452 |
this.layoutControlGroupMain.Location = new System.Drawing.Point(0, 0); |
448 | 453 |
this.layoutControlGroupMain.Name = "layoutControlGroupMain"; |
449 | 454 |
this.layoutControlGroupMain.Size = new System.Drawing.Size(261, 631); |
... | ... | |
470 | 475 |
// emptySpaceItem1 |
471 | 476 |
// |
472 | 477 |
this.emptySpaceItem1.AllowHotTrack = false; |
473 |
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 234);
|
|
478 |
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 260);
|
|
474 | 479 |
this.emptySpaceItem1.Name = "emptySpaceItem1"; |
475 |
this.emptySpaceItem1.Size = new System.Drawing.Size(237, 354);
|
|
480 |
this.emptySpaceItem1.Size = new System.Drawing.Size(237, 328);
|
|
476 | 481 |
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); |
477 | 482 |
// |
478 | 483 |
// layoutControlItem5 |
... | ... | |
514 | 519 |
// layoutControlItem16 |
515 | 520 |
// |
516 | 521 |
this.layoutControlItem16.Control = this.PBSSetting; |
517 |
this.layoutControlItem16.Location = new System.Drawing.Point(0, 208);
|
|
522 |
this.layoutControlItem16.Location = new System.Drawing.Point(0, 234);
|
|
518 | 523 |
this.layoutControlItem16.Name = "layoutControlItem16"; |
519 | 524 |
this.layoutControlItem16.Size = new System.Drawing.Size(237, 26); |
520 | 525 |
this.layoutControlItem16.TextSize = new System.Drawing.Size(0, 0); |
... | ... | |
668 | 673 |
this.sqLiteCommandBuilder1.DataAdapter = null; |
669 | 674 |
this.sqLiteCommandBuilder1.QuoteSuffix = "]"; |
670 | 675 |
// |
676 |
// TieInSetting |
|
677 |
// |
|
678 |
this.TieInSetting.Location = new System.Drawing.Point(24, 251); |
|
679 |
this.TieInSetting.Name = "TieInSetting"; |
|
680 |
this.TieInSetting.Size = new System.Drawing.Size(233, 22); |
|
681 |
this.TieInSetting.StyleController = this.layoutControl1; |
|
682 |
this.TieInSetting.TabIndex = 27; |
|
683 |
this.TieInSetting.Text = "Tie-In Setting"; |
|
684 |
this.TieInSetting.Click += new System.EventHandler(this.TieInSetting_Click); |
|
685 |
// |
|
686 |
// layoutControlItem10 |
|
687 |
// |
|
688 |
this.layoutControlItem10.Control = this.TieInSetting; |
|
689 |
this.layoutControlItem10.Location = new System.Drawing.Point(0, 208); |
|
690 |
this.layoutControlItem10.Name = "layoutControlItem10"; |
|
691 |
this.layoutControlItem10.Size = new System.Drawing.Size(237, 26); |
|
692 |
this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0); |
|
693 |
this.layoutControlItem10.TextVisible = false; |
|
694 |
// |
|
671 | 695 |
// MainForm |
672 | 696 |
// |
673 | 697 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); |
... | ... | |
718 | 742 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit(); |
719 | 743 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem17)).EndInit(); |
720 | 744 |
this.contextMenuPSN.ResumeLayout(false); |
745 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit(); |
|
721 | 746 |
this.ResumeLayout(false); |
722 | 747 |
this.PerformLayout(); |
723 | 748 |
|
... | ... | |
780 | 805 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8; |
781 | 806 |
private DevExpress.XtraEditors.SimpleButton btnHistory; |
782 | 807 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem17; |
808 |
private DevExpress.XtraEditors.SimpleButton TieInSetting; |
|
809 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10; |
|
783 | 810 |
} |
784 | 811 |
} |
785 | 812 |
|
DTI_PID/ID2PSN/Form/MainForm.cs | ||
---|---|---|
1069 | 1069 |
form.ShowDialog(); |
1070 | 1070 |
} |
1071 | 1071 |
|
1072 |
private void TieInSetting_Click(object sender, EventArgs e) |
|
1073 |
{ |
|
1074 |
TieInSetting form = new TieInSetting(); |
|
1075 |
form.ShowDialog(); |
|
1076 |
|
|
1077 |
} |
|
1078 |
|
|
1072 | 1079 |
//private void AirFinCoolerSetting_Click(object sender, EventArgs e) |
1073 | 1080 |
//{ |
1074 | 1081 |
// AirFinCoolerSetting form = new AirFinCoolerSetting(); |
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
2553 | 2553 |
newRow["BranchTopologySet_OID"] = branchTopologyName; |
2554 | 2554 |
newRow["PipeLine_OID"] = item.PSNPipeLineID; |
2555 | 2555 |
|
2556 |
if (item.ItemType != ID2PSN.ItemType.Line && item.ID2DBName.ToUpper().Equals("TIEINPOINT")) |
|
2557 |
{ |
|
2558 |
|
|
2556 |
if (item.Name.ToUpper().Equals("TIEINPOINT")) |
|
2557 |
{ |
|
2559 | 2558 |
newRow["ITEMNAME"] = "PipingComp"; |
2560 |
if (!string.IsNullOrEmpty(TieInPointAttributeName)) |
|
2561 |
newRow["ITEMTAG"] = string.Format("TIEINPOINT_{0:D3}V", tieInPointSymbolIndex); |
|
2559 |
|
|
2560 |
string value = string.Empty; |
|
2561 |
if (string.IsNullOrEmpty(TieInPointAttributeName)) |
|
2562 |
value = string.Format("TIEINPOINT_{0:D3}", tieInPointSymbolIndex); |
|
2562 | 2563 |
else |
2563 |
newRow["ITEMTAG"] = item.Attributes.Find(x => x.Name == TieInPointAttributeName).Value; |
|
2564 |
|
|
2564 |
value = item.Attributes.Find(x => x.Name == TieInPointAttributeName).Value; |
|
2565 |
|
|
2566 |
|
|
2567 |
newRow["ITEMTAG"] = value; |
|
2568 |
newRow["DESCRIPTION"] = value; |
|
2565 | 2569 |
newRow["Class"] = "In-Line Fitting"; |
2566 | 2570 |
newRow["SubClass"] = ""; |
2567 | 2571 |
newRow["TYPE"] = "End"; |
... | ... | |
3352 | 3356 |
bool bCheck = false; |
3353 | 3357 |
if (!PSNItem.EnableType(PSNItem.StartType)) |
3354 | 3358 |
{ |
3355 |
//if(!PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])).First().Field<string>("ItemTag").Contains("TIEINPOINT")) |
|
3356 |
//{ |
|
3357 |
change = true; |
|
3358 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3359 |
int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()); |
|
3359 |
|
|
3360 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3361 |
int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()); |
|
3360 | 3362 |
|
3361 |
Item item = PSNItem.Groups.First().Items.First(); |
|
3362 |
try |
|
3363 |
Item item = PSNItem.Groups.First().Items.First(); |
|
3364 |
try |
|
3365 |
{ |
|
3366 |
if (!item.Name.ToUpper().Equals("TIEINPOINT")) |
|
3363 | 3367 |
{ |
3368 |
change = true; |
|
3369 |
|
|
3364 | 3370 |
string FROM_DATA = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex); |
3365 | 3371 |
|
3366 | 3372 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
... | ... | |
3396 | 3402 |
|
3397 | 3403 |
bCheck = true; |
3398 | 3404 |
} |
3399 |
|
|
3400 |
PSNItem.StartType = PSNType.Equipment; |
|
3401 | 3405 |
} |
3402 |
catch (Exception ex)
|
|
3406 |
else
|
|
3403 | 3407 |
{ |
3404 |
MessageBox.Show("Please check the item.\r\nDrawingName : " + item.Document.DrawingName + "\r\nUID : " + item.UID, "ID2 " + id2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
3405 |
return; |
|
3408 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
3409 |
{ |
|
3410 |
loopRow["FROM_DATA"] = pathItemRows.First().Field<string>("ITEMTAG"); |
|
3411 |
|
|
3412 |
if (loopRow.Field<string>("OrderNumber") == "0") |
|
3413 |
{ |
|
3414 |
if(loopRow["Status"].ToString().Contains(", Missing ItemTag or Description")) |
|
3415 |
loopRow["Status"] = loopRow["Status"].ToString().Replace(", Missing ItemTag or Description", ""); |
|
3416 |
else if (loopRow["Status"].ToString().Contains("Missing ItemTag or Description")) |
|
3417 |
loopRow["Status"] = loopRow["Status"].ToString().Replace("Missing ItemTag or Description", ""); |
|
3418 |
|
|
3419 |
if (!string.IsNullOrEmpty(loopRow["Status"].ToString()) && loopRow["Status"].ToString().Substring(0, 2).Equals(", ")) |
|
3420 |
loopRow["Status"] = loopRow["Status"].ToString().Remove(0, 2); |
|
3421 |
} |
|
3422 |
} |
|
3423 |
|
|
3424 |
bool bStatus = false; |
|
3425 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
3426 |
{ |
|
3427 |
if (!string.IsNullOrEmpty(loopRow["Status"].ToString())) |
|
3428 |
bStatus = true; |
|
3429 |
} |
|
3430 |
|
|
3431 |
if (!bStatus) |
|
3432 |
{ |
|
3433 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
3434 |
{ |
|
3435 |
loopRow["IsValid"] = string.Empty; |
|
3436 |
} |
|
3437 |
} |
|
3406 | 3438 |
} |
3407 |
//} |
|
3439 |
|
|
3440 |
|
|
3441 |
|
|
3442 |
PSNItem.StartType = PSNType.Equipment; |
|
3443 |
} |
|
3444 |
catch (Exception ex) |
|
3445 |
{ |
|
3446 |
MessageBox.Show("Please check the item.\r\nDrawingName : " + item.Document.DrawingName + "\r\nUID : " + item.UID, "ID2 " + id2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
3447 |
return; |
|
3448 |
} |
|
3408 | 3449 |
} |
3409 | 3450 |
|
3410 | 3451 |
if (!PSNItem.EnableType(PSNItem.EndType)) |
3411 | 3452 |
{ |
3412 |
//if (!PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])).Last().Field<string>("ItemTag").Contains("TIEINPOINT")) |
|
3413 |
//{ |
|
3414 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3415 |
//int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()) + pathItemRows.Count() - 1; |
|
3416 |
DataRow dr = pathItemRows.Last(); |
|
3417 |
if (change) |
|
3453 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"])); |
|
3454 |
//int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()) + pathItemRows.Count() - 1; |
|
3455 |
DataRow dr = pathItemRows.Last(); |
|
3456 |
if (change) |
|
3457 |
{ |
|
3458 |
if (bCheck) |
|
3459 |
dr = pathItemRows[pathItemRows.Count() - 3]; |
|
3460 |
else |
|
3418 | 3461 |
{ |
3419 |
if (bCheck) |
|
3420 |
dr = pathItemRows[pathItemRows.Count() - 3]; |
|
3421 |
else |
|
3422 |
{ |
|
3423 |
dr = pathItemRows[pathItemRows.Count() - 2]; |
|
3424 |
} |
|
3462 |
dr = pathItemRows[pathItemRows.Count() - 2]; |
|
3425 | 3463 |
} |
3464 |
} |
|
3426 | 3465 |
|
3427 |
change = true;
|
|
3428 |
int insertIndex = PathItems.Rows.IndexOf(dr) + 1;
|
|
3466 |
change = true; |
|
3467 |
int insertIndex = PathItems.Rows.IndexOf(dr) + 1; |
|
3429 | 3468 |
|
3430 |
Item item = PSNItem.Groups.Last().Items.Last(); |
|
3431 |
try |
|
3469 |
Item item = PSNItem.Groups.Last().Items.Last(); |
|
3470 |
|
|
3471 |
try |
|
3472 |
{ |
|
3473 |
if (!item.Name.ToUpper().Equals("TIEINPOINT")) |
|
3432 | 3474 |
{ |
3433 | 3475 |
string TO_DATA = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex); |
3434 | 3476 |
|
3435 |
|
|
3436 | 3477 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
3437 | 3478 |
{ |
3438 | 3479 |
loopRow["TO_DATA"] = TO_DATA; |
... | ... | |
3450 | 3491 |
loopRow["IsValid"] = "Error"; |
3451 | 3492 |
} |
3452 | 3493 |
} |
3453 |
|
|
3454 | 3494 |
} |
3455 | 3495 |
|
3456 | 3496 |
tieInPointIndex++; |
... | ... | |
3463 | 3503 |
{ |
3464 | 3504 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last(), TO_DATA), insertIndex); |
3465 | 3505 |
PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex); |
3466 |
|
|
3467 | 3506 |
} |
3468 |
|
|
3469 |
PSNItem.EndType = PSNType.Equipment; |
|
3470 | 3507 |
} |
3471 |
catch (Exception ex)
|
|
3508 |
else
|
|
3472 | 3509 |
{ |
3473 |
MessageBox.Show("Please check the item.\r\nDrawingName : " + item.Document.DrawingName + "\r\nUID : " + item.UID, "ID2 " + id2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
3474 |
return; |
|
3510 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
3511 |
{ |
|
3512 |
loopRow["TO_DATA"] = dr.Field<string>("ITEMTAG"); |
|
3513 |
|
|
3514 |
if (loopRow.Field<string>("OrderNumber") == Convert.ToString(PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID())).Count() - 1)) |
|
3515 |
{ |
|
3516 |
if (loopRow["Status"].ToString().Contains(", Missing ItemTag or Description")) |
|
3517 |
loopRow["Status"] = loopRow["Status"].ToString().Replace(", Missing ItemTag or Description", ""); |
|
3518 |
else if (loopRow["Status"].ToString().Contains("Missing ItemTag or Description")) |
|
3519 |
loopRow["Status"] = loopRow["Status"].ToString().Replace("Missing ItemTag or Description", ""); |
|
3520 |
|
|
3521 |
if (!string.IsNullOrEmpty(loopRow["Status"].ToString()) && loopRow["Status"].ToString().Substring(0, 2).Equals(", ")) |
|
3522 |
loopRow["Status"] = loopRow["Status"].ToString().Remove(0, 2); |
|
3523 |
} |
|
3524 |
} |
|
3525 |
|
|
3526 |
bool bStatus = false; |
|
3527 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
3528 |
{ |
|
3529 |
if (!string.IsNullOrEmpty(loopRow["Status"].ToString())) |
|
3530 |
bStatus = true; |
|
3531 |
} |
|
3532 |
|
|
3533 |
if (!bStatus) |
|
3534 |
{ |
|
3535 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
3536 |
{ |
|
3537 |
loopRow["IsValid"] = string.Empty; |
|
3538 |
} |
|
3539 |
} |
|
3475 | 3540 |
} |
3476 |
//} |
|
3541 |
PSNItem.EndType = PSNType.Equipment; |
|
3542 |
} |
|
3543 |
catch (Exception ex) |
|
3544 |
{ |
|
3545 |
MessageBox.Show("Please check the item.\r\nDrawingName : " + item.Document.DrawingName + "\r\nUID : " + item.UID, "ID2 " + id2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
3546 |
return; |
|
3547 |
} |
|
3548 |
|
|
3477 | 3549 |
} |
3478 | 3550 |
|
3479 | 3551 |
dataRow["Type"] = PSNItem.GetPSNType(); |
내보내기 Unified diff