개정판 85eeb2be
issue #000:
Change-Id: I8c6a7304d9bc0ddaec6391b8e439a6fc313706d3
DTI_PID/ID2PSN/Document.cs | ||
---|---|---|
17 | 17 |
public string FilePath { get; set; } |
18 | 18 |
public List<Item> Items { get; set; } |
19 | 19 |
public List<LineNumber> LineNumbers { get; set; } |
20 |
public bool MissingLineNumber1 { get; set; } |
|
21 |
public bool MissingLineNumber2 { get; set; } |
|
22 |
|
|
20 | 23 |
public List<Group> Groups { get; set; } |
21 | 24 |
public List<RunInfo> RunInfos { get; set; } |
22 | 25 |
public List<Item> SegmentBreaks { get; set; } |
DTI_PID/ID2PSN/Object/Item.cs | ||
---|---|---|
49 | 49 |
public Group Group { get; set; } |
50 | 50 |
public PSNItem PSNItem { get; set; } |
51 | 51 |
public LineNumber LineNumber { get; set; } |
52 |
public bool MissingLineNumber1 { get; set; } |
|
53 |
public bool MissingLineNumber2 { get; set; } |
|
52 |
|
|
54 | 53 |
public Equipment Equipment { get; set; } |
55 | 54 |
public Document Document { get; set; } |
56 | 55 |
public string Keyword { get; set; } |
56 |
public bool MissingLineNumber1 { get; set; } |
|
57 |
public bool MissingLineNumber2 { get; set; } |
|
57 | 58 |
} |
58 | 59 |
|
59 | 60 |
public class Relation |
... | ... | |
98 | 99 |
public List<Attribute> Attributes { get; set; } |
99 | 100 |
public bool IsCopy { get; set; } |
100 | 101 |
|
102 |
|
|
101 | 103 |
public LineNumber Copy() |
102 | 104 |
{ |
103 | 105 |
LineNumber copy = new LineNumber(); |
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
395 | 395 |
? string.Empty : PSNItem.Groups.First().Items.First().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName).Value; |
396 | 396 |
|
397 | 397 |
ItemTag = PSNItem.Groups.First().Items.First().Equipment.ItemTag; |
398 |
Prefix = equipmentAirFinCoolerItem.TagIdentifier; |
|
399 |
EGTAG = Prefix + "-" + EGTAG; |
|
398 |
Prefix = equipmentAirFinCoolerItem.TagIdentifier; |
|
400 | 399 |
EGFlowDirection = "O"; |
401 | 400 |
} |
402 | 401 |
} |
... | ... | |
406 | 405 |
{ |
407 | 406 |
EquipmentAirFinCoolerItem equipmentAirFinCoolerItem = EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type == "Pump" && PSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).First(); |
408 | 407 |
if (!string.IsNullOrEmpty(equipmentAirFinCoolerItem.AttributeName)) |
409 |
EGTAG = EGTAG = PSNItem.Groups.Last().Items.Last().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName) == null
|
|
408 |
EGTAG = PSNItem.Groups.Last().Items.Last().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName) == null |
|
410 | 409 |
? string.Empty : PSNItem.Groups.Last().Items.Last().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName).Value; |
411 | 410 |
|
412 | 411 |
ItemTag = PSNItem.Groups.Last().Items.Last().Equipment.ItemTag; |
413 |
Prefix = equipmentAirFinCoolerItem.TagIdentifier; |
|
414 |
EGTAG = Prefix + "-" + EGTAG; |
|
412 |
Prefix = equipmentAirFinCoolerItem.TagIdentifier; |
|
415 | 413 |
EGFlowDirection = "I"; |
416 | 414 |
} |
417 | 415 |
} |
... | ... | |
430 | 428 |
EGTAG = eqkeyValuePairs[ItemTag]; |
431 | 429 |
} |
432 | 430 |
} |
431 |
else |
|
432 |
{ |
|
433 |
EGTAG = Prefix + "-" + EGTAG; |
|
434 |
} |
|
433 | 435 |
|
434 | 436 |
foreach (DataRow dr in pathItemRows) |
435 | 437 |
{ |
... | ... | |
716 | 718 |
? string.Empty : PSNItem.Groups.First().Items.First().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName).Value; |
717 | 719 |
|
718 | 720 |
Prefix = equipmentAirFinCoolerItem.TagIdentifier; |
719 |
EGTAG = Prefix + "-" + EGTAG; |
|
720 | 721 |
EGFlowDirection = "O"; |
721 | 722 |
} |
722 | 723 |
} |
... | ... | |
730 | 731 |
? string.Empty : PSNItem.Groups.Last().Items.Last().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName).Value; |
731 | 732 |
|
732 | 733 |
Prefix = equipmentAirFinCoolerItem.TagIdentifier; |
733 |
EGTAG = Prefix + "-" + EGTAG; |
|
734 | 734 |
EGFlowDirection = "I"; |
735 | 735 |
} |
736 | 736 |
} |
... | ... | |
753 | 753 |
EGTAG = keyValuePairs[afcTag[1]]; |
754 | 754 |
} |
755 | 755 |
} |
756 |
else |
|
757 |
{ |
|
758 |
EGTAG = Prefix + "-" + EGTAG; |
|
759 |
} |
|
756 | 760 |
|
757 | 761 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
758 | 762 |
foreach (DataRow dr in pathItemRows) |
... | ... | |
1178 | 1182 |
{ |
1179 | 1183 |
prevLineNumber = prevLineNumber.Copy(); |
1180 | 1184 |
item.Document.LineNumbers.Add(prevLineNumber); |
1181 |
item.MissingLineNumber1 = true; |
|
1185 |
item.Document.MissingLineNumber1 = true;
|
|
1182 | 1186 |
} |
1183 | 1187 |
item.Owner = prevLineNumber.UID; |
1184 | 1188 |
} |
... | ... | |
1200 | 1204 |
{ |
1201 | 1205 |
prevLineNumber = prevLineNumber.Copy(); |
1202 | 1206 |
item.Document.LineNumbers.Add(prevLineNumber); |
1203 |
item.MissingLineNumber1 = true; |
|
1207 |
item.Document.MissingLineNumber1 = true;
|
|
1204 | 1208 |
} |
1205 | 1209 |
|
1206 | 1210 |
item.Owner = prevLineNumber.UID; |
... | ... | |
1223 | 1227 |
foreach (Item item in group.Items) |
1224 | 1228 |
{ |
1225 | 1229 |
item.Owner = cLineNumber.UID; |
1226 |
item.MissingLineNumber2 = true; |
|
1230 |
item.Document.MissingLineNumber2 = true;
|
|
1227 | 1231 |
} |
1228 | 1232 |
} |
1229 | 1233 |
} |
... | ... | |
1236 | 1240 |
item.PSNPipeLineID = string.Empty; |
1237 | 1241 |
List<string> pipeLineID = new List<string>(); |
1238 | 1242 |
LineNumber lineNumber = document.LineNumbers.Find(x => x.UID == item.Owner); |
1243 |
|
|
1239 | 1244 |
if (lineNumber != null) |
1240 | 1245 |
{ |
1241 | 1246 |
item.LineNumber = lineNumber; |
... | ... | |
1251 | 1256 |
|
1252 | 1257 |
Attribute attribute = lineNumber.Attributes.Find(x => x.DisplayName == uid); |
1253 | 1258 |
if (attribute != null && !string.IsNullOrEmpty(attribute.Value)) |
1259 |
{ |
|
1254 | 1260 |
pipeLineID.Add(attribute.Value);//item.TopologyData += attribute.Value; |
1261 |
if (uid.Equals("Tag Seq No") && attribute.Value.ToString().Substring(attribute.Value.ToString().Length - 1, 1).Equals("V")) |
|
1262 |
{ |
|
1263 |
if (item.Document.MissingLineNumber1) |
|
1264 |
item.MissingLineNumber1 = true; |
|
1265 |
else if (item.Document.MissingLineNumber2) |
|
1266 |
item.MissingLineNumber2 = true; |
|
1267 |
} |
|
1268 |
} |
|
1255 | 1269 |
} |
1256 | 1270 |
} |
1257 |
|
|
1271 |
|
|
1258 | 1272 |
if (topologyRuleDT.Select(string.Format("UID = '{0}'", "InsulationPurpose")) == null) |
1259 | 1273 |
{ |
1260 | 1274 |
Attribute insulAttr = item.LineNumber.Attributes.Find(x => x.Name == "InsulationPurpose"); |
... | ... | |
1266 | 1280 |
|
1267 | 1281 |
item.PSNPipeLineID = string.Join("-", pipeLineID); |
1268 | 1282 |
item.TopologyData = string.Join("-", pipeLineID); |
1269 |
|
|
1283 |
|
|
1270 | 1284 |
} |
1271 | 1285 |
else |
1272 | 1286 |
{ |
... | ... | |
3459 | 3473 |
result = "ENDOFHEADER"; |
3460 | 3474 |
else if (StartType == PSNType.Branch) |
3461 | 3475 |
{ |
3462 |
//if (!item.MissingLineNumber && item.Relations.First().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.First().Item.LineNumber.Name)) |
|
3463 | 3476 |
if (item.Relations.First().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.First().Item.LineNumber.Name)) |
3477 |
{ |
|
3464 | 3478 |
result = item.Relations.First().Item.LineNumber.Name; |
3479 |
if (item.MissingLineNumber2) |
|
3480 |
{ |
|
3481 |
Status += ", Missing LineNumber_2"; |
|
3482 |
IsValid = "Error"; |
|
3483 |
} |
|
3484 |
if (item.MissingLineNumber1) |
|
3485 |
{ |
|
3486 |
Status += ", Missing LineNumber_1"; |
|
3487 |
IsValid = "Error"; |
|
3488 |
} |
|
3489 |
} |
|
3465 | 3490 |
else |
3466 | 3491 |
{ |
3467 | 3492 |
IsValid = "Error"; |
3468 | 3493 |
result = "Empty LineNumber"; |
3469 | 3494 |
} |
3470 |
|
|
3471 |
if (item.MissingLineNumber2) |
|
3472 |
Status += ", Missing LineNumber_2"; |
|
3473 |
|
|
3474 |
|
|
3475 |
//if (item.MissingLineNumber1) |
|
3476 |
//{ |
|
3477 |
// Status += ", Missing LineNumber_1"; |
|
3478 |
// result = item.MissingLineNumber1 && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
3479 |
|
|
3480 |
//} |
|
3481 | 3495 |
} |
3482 | 3496 |
else if (StartType == PSNType.Equipment) |
3483 | 3497 |
{ |
... | ... | |
3518 | 3532 |
else if (item.ItemType == ItemType.Line) |
3519 | 3533 |
{ |
3520 | 3534 |
|
3521 |
if (item.MissingLineNumber1)
|
|
3535 |
if (item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name))
|
|
3522 | 3536 |
{ |
3523 |
IsValid = "Error"; |
|
3524 |
Status += ", Missing LineNumber_1"; |
|
3525 |
result = item.MissingLineNumber1 && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
3537 |
result = item.LineNumber.Name; |
|
3538 |
if (item.MissingLineNumber2) |
|
3539 |
{ |
|
3540 |
Status += ", Missing LineNumber_2"; |
|
3541 |
IsValid = "Error"; |
|
3542 |
} |
|
3543 |
if (item.MissingLineNumber1) |
|
3544 |
{ |
|
3545 |
Status += ", Missing LineNumber_1"; |
|
3546 |
IsValid = "Error"; |
|
3547 |
} |
|
3526 | 3548 |
} |
3527 | 3549 |
else |
3528 |
result = !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
3550 |
{ |
|
3551 |
IsValid = "Error"; |
|
3552 |
result = "Empty LineNumber"; |
|
3553 |
} |
|
3529 | 3554 |
} |
3530 | 3555 |
else |
3531 | 3556 |
result = "Unknown"; |
3532 |
|
|
3533 | 3557 |
} |
3534 | 3558 |
} |
3535 | 3559 |
catch (Exception ex) |
... | ... | |
3587 | 3611 |
result = "ENDOFHEADER"; |
3588 | 3612 |
else if (EndType == PSNType.Branch) |
3589 | 3613 |
{ |
3590 |
//if (!item.MissingLineNumber && item.Relations.Last().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.Last().Item.LineNumber.Name)) |
|
3591 | 3614 |
if (item.Relations.Last().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.Last().Item.LineNumber.Name)) |
3615 |
{ |
|
3592 | 3616 |
result = item.Relations.Last().Item.LineNumber.Name; |
3617 |
if (item.MissingLineNumber2) |
|
3618 |
{ |
|
3619 |
Status += ", Missing LineNumber_2"; |
|
3620 |
IsValid = "Error"; |
|
3621 |
} |
|
3622 |
if (item.MissingLineNumber1) |
|
3623 |
{ |
|
3624 |
Status += ", Missing LineNumber_1"; |
|
3625 |
IsValid = "Error"; |
|
3626 |
} |
|
3627 |
} |
|
3593 | 3628 |
else |
3594 | 3629 |
{ |
3595 |
IsValid = "Error";
|
|
3630 |
IsValid = "Error"; |
|
3596 | 3631 |
result = "Empty LineNumber"; |
3597 |
} |
|
3598 |
|
|
3599 |
if(item.MissingLineNumber2) |
|
3600 |
Status += ", Missing LineNumber_2"; |
|
3601 |
//if (item.MissingLineNumber1) |
|
3602 |
//{ |
|
3603 |
// Status += ", Missing LineNumber_1"; |
|
3604 |
// result = item.MissingLineNumber1 && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
3605 |
|
|
3606 |
//} |
|
3632 |
} |
|
3607 | 3633 |
} |
3608 | 3634 |
else if (EndType == PSNType.Equipment) |
3609 | 3635 |
{ |
... | ... | |
3643 | 3669 |
} |
3644 | 3670 |
else if (item.ItemType == ItemType.Line) |
3645 | 3671 |
{ |
3646 |
if (item.MissingLineNumber1)
|
|
3672 |
if (item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name))
|
|
3647 | 3673 |
{ |
3648 |
IsValid = "Error"; |
|
3649 |
Status += ", Missing LineNumber_1"; |
|
3650 |
result = item.MissingLineNumber1 && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
3674 |
result = item.LineNumber.Name; |
|
3675 |
if (item.MissingLineNumber2) |
|
3676 |
{ |
|
3677 |
Status += ", Missing LineNumber_2"; |
|
3678 |
IsValid = "Error"; |
|
3679 |
} |
|
3680 |
if (item.MissingLineNumber1) |
|
3681 |
{ |
|
3682 |
Status += ", Missing LineNumber_1"; |
|
3683 |
IsValid = "Error"; |
|
3684 |
} |
|
3651 | 3685 |
} |
3652 | 3686 |
else |
3653 |
result = !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
3687 |
{ |
|
3688 |
IsValid = "Error"; |
|
3689 |
result = "Empty LineNumber"; |
|
3690 |
} |
|
3654 | 3691 |
} |
3655 | 3692 |
else |
3656 | 3693 |
result = "Unknown"; |
3657 |
|
|
3658 |
|
|
3659 | 3694 |
} |
3660 |
|
|
3661 |
|
|
3662 |
|
|
3663 | 3695 |
return result; |
3664 | 3696 |
} |
3665 | 3697 |
|
내보내기 Unified diff