개정판 23204ef6
issue #000:
Change-Id: I97ea5bd57e2807f45d68726016d04bc991ec366d
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
2317 | 2317 |
string sPSNData = string.Empty; |
2318 | 2318 |
bool bVentDrain = false; |
2319 | 2319 |
|
2320 |
List<Group> Groups = PSNItem.Groups; |
|
2320 |
List<Group> Groups = PSNItem.Groups;
|
|
2321 | 2321 |
Dictionary<string, List<Item>> keyValuePairs = new Dictionary<string, List<Item>>(); |
2322 | 2322 |
List<Item> valveGroupingItem = new List<Item>(); |
2323 | 2323 |
|
... | ... | |
2552 | 2552 |
string FluidCodeGL = string.Empty; |
2553 | 2553 |
string PMCGL = string.Empty; |
2554 | 2554 |
|
2555 |
|
|
2556 | 2555 |
if (pipelineDT.Select(string.Format("OID = '{0}'", OID)).Count() == 0) |
2557 | 2556 |
{ |
2558 | 2557 |
DataRow newPipelineRow = pipelineDT.NewRow(); |
... | ... | |
2589 | 2588 |
GroundLevel = "AG_UG"; |
2590 | 2589 |
} |
2591 | 2590 |
newPipesystemRow["GroundLevel"] = GroundLevel; |
2592 |
|
|
2593 | 2591 |
pipesystemDT.Rows.Add(newPipesystemRow); |
2594 | 2592 |
} |
2595 | 2593 |
} |
... | ... | |
2606 | 2604 |
string FromType = string.Empty; |
2607 | 2605 |
Item From_item = new Item(); |
2608 | 2606 |
|
2609 |
string FROM_DATA = PSNItem.GetFromData(ref FromType, ref From_item); |
|
2607 |
string oStatus = string.Empty; |
|
2608 |
string FROM_DATA = PSNItem.GetFromData(ref FromType, ref From_item, item, ref oStatus); |
|
2610 | 2609 |
string status = string.Empty; |
2611 |
status = PSNItem.Status; |
|
2610 |
if (psnOrder == 0) |
|
2611 |
status = PSNItem.Status; |
|
2612 | 2612 |
|
2613 | 2613 |
if (PSNItem.IsKeyword) |
2614 | 2614 |
{ |
... | ... | |
2616 | 2616 |
} |
2617 | 2617 |
string ToType = string.Empty; |
2618 | 2618 |
Item To_item = new Item(); |
2619 |
string TO_DATA = PSNItem.GetToData(ref ToType, ref To_item); |
|
2619 |
string TO_DATA = PSNItem.GetToData(ref ToType, ref To_item, item);
|
|
2620 | 2620 |
if (PSNItem.IsKeyword) |
2621 | 2621 |
{ |
2622 | 2622 |
PSNItem.EndType = PSNType.Equipment; |
... | ... | |
2627 | 2627 |
|
2628 | 2628 |
newRow["Type"] = PSNItem.GetPSNType(); |
2629 | 2629 |
|
2630 |
|
|
2631 |
if(psnOrder == 0) //order 0일땐 그냥 붙여줌 |
|
2630 |
if (psnOrder == 0) //order 0일땐 그냥 붙여줌 |
|
2632 | 2631 |
{ |
2633 | 2632 |
if (!string.IsNullOrEmpty(PSNItem.Status)) //to에 status가 있다면 |
2634 | 2633 |
{ |
2635 |
status += PSNItem.Status; |
|
2634 |
status += oStatus + PSNItem.Status;
|
|
2636 | 2635 |
} |
2637 | 2636 |
} |
2638 | 2637 |
else if (psnOrder > 0) //0보다 크면 |
2639 | 2638 |
{ |
2640 | 2639 |
DataRow dr = pipeSystemNetworkDT.Select(string.Format("OID = '{0}' AND OrderNumber = {1}", PSNItem.PSN_OID(), psnOrder - 1)).FirstOrDefault(); |
2641 |
if (psnOrder == 1) //1이면 0번 Order에 From Status 값만 남김 |
|
2642 |
{ |
|
2643 |
dr["Status"] = !string.IsNullOrEmpty(status) ? status.Remove(0, 2) : string.Empty; //status; |
|
2644 |
} |
|
2645 |
if (psnOrder > 1) // 2 -> 1 3->2 엔 status 값 삭제 |
|
2640 |
|
|
2641 |
if (psnOrder >= 1) |
|
2646 | 2642 |
{ |
2647 |
dr["Status"] = string.Empty; |
|
2648 |
} |
|
2649 |
|
|
2650 |
status = PSNItem.Status; |
|
2643 |
if(!string.IsNullOrEmpty(PSNItem.Status)) |
|
2644 |
{ |
|
2645 |
dr["Status"] = dr["Status"].ToString().Replace(PSNItem.Status, string.Empty); |
|
2646 |
} |
|
2647 |
} |
|
2648 |
|
|
2649 |
status = oStatus + PSNItem.Status; |
|
2651 | 2650 |
if (dr != null) |
2652 | 2651 |
{ |
2653 | 2652 |
newRow["FROM_DATA"] = dr.Field<string>("FROM_DATA"); |
2654 | 2653 |
newRow["TO_DATA"] = dr.Field<string>("TO_DATA"); |
2655 | 2654 |
newRow["Type"] = dr.Field<string>("Type"); |
2656 | 2655 |
} |
2657 |
} |
|
2658 |
|
|
2659 |
|
|
2656 |
} |
|
2660 | 2657 |
|
2661 | 2658 |
status = !string.IsNullOrEmpty(status) ? status.Remove(0, 2) : string.Empty; |
2662 | 2659 |
string[] st = status.Split(new string[] { ", " }, StringSplitOptions.None); |
... | ... | |
2664 | 2661 |
{ |
2665 | 2662 |
status = string.Join(", ", st.Distinct()); |
2666 | 2663 |
} |
2667 |
newRow["TopologySet_OID_Key"] = item.Topology.FullName; |
|
2668 |
newRow["PSNRevisionNumber"] = string.Format("V{0:D4}", Revision); |
|
2669 |
|
|
2670 |
|
|
2671 |
newRow["IsValid"] = PSNItem.IsValid; |
|
2672 | 2664 |
newRow["Status"] = status; |
2665 |
newRow["IsValid"] = PSNItem.IsValid; |
|
2666 |
|
|
2667 |
newRow["TopologySet_OID_Key"] = item.Topology.FullName; |
|
2668 |
newRow["PSNRevisionNumber"] = string.Format("V{0:D4}", Revision); |
|
2673 | 2669 |
newRow["PBS"] = PSNItem.GetPBSData(); |
2674 | 2670 |
|
2675 | 2671 |
List<string> drawingNames = new List<string>(); |
... | ... | |
2690 | 2686 |
newRow["IncludingVirtualData"] = "Vent_Drain"; |
2691 | 2687 |
else |
2692 | 2688 |
newRow["IncludingVirtualData"] = "No"; |
2693 |
// return; |
|
2694 |
//newRow["IncludingVirtualData"] = "No"; |
|
2689 |
|
|
2695 | 2690 |
newRow["PSNAccuracy"] = "100"; |
2696 | 2691 |
|
2697 | 2692 |
string Pocket = "No"; |
... | ... | |
2701 | 2696 |
|
2702 | 2697 |
if (item.ID2DBType == "Nozzles" && PSNItem.StartType == PSNType.Equipment && From_item.Equipment != null) |
2703 | 2698 |
{ |
2704 |
// string itemName = From_item.Name; |
|
2705 |
Equipment Equipment = From_item.Equipment; |
|
2706 |
|
|
2699 |
Equipment Equipment = From_item.Equipment; |
|
2707 | 2700 |
EquipmentNoPocketItem nopocket = EquipmentNoPocket.EquipmentNoPocketItem.Where(x => x.Name == Equipment.Name && x.Type != "Pump").FirstOrDefault(); |
2708 | 2701 |
|
2709 |
|
|
2710 | 2702 |
if (nopocket != null) |
2711 | 2703 |
{ |
2712 | 2704 |
DataRow bNozzle = null; |
... | ... | |
2749 | 2741 |
|
2750 | 2742 |
if (item.ID2DBType == "Nozzles" && PSNItem.EndType == PSNType.Equipment && To_item.Equipment != null) //To는 전체 |
2751 | 2743 |
{ |
2752 |
// string itemName = To_item.Name; |
|
2753 | 2744 |
Equipment Equipment = To_item.Equipment; |
2754 | 2745 |
EquipmentNoPocketItem nopocket = EquipmentNoPocket.EquipmentNoPocketItem.Where(x => x.Name == Equipment.Name).FirstOrDefault(); |
2755 | 2746 |
if (nopocket != null) |
... | ... | |
2794 | 2785 |
|
2795 | 2786 |
newRow["Pocket"] = Pocket; |
2796 | 2787 |
string AFC = "P2"; |
2797 |
if(PSNItem.StartType == PSNType.Equipment && From_item.Equipment != null) |
|
2788 |
if (PSNItem.StartType == PSNType.Equipment && From_item.Equipment != null)
|
|
2798 | 2789 |
{ |
2799 | 2790 |
if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && x.Name.Equals(From_item.Equipment.Name)).Count() > 0) |
2800 | 2791 |
AFC = "P1\\" + From_item.Equipment.Name; |
... | ... | |
2817 | 2808 |
pipeSystemNetworkDT.Rows.Add(newRow); |
2818 | 2809 |
} |
2819 | 2810 |
} |
2820 |
|
|
2821 |
} |
|
2822 |
|
|
2823 |
|
|
2811 |
} |
|
2824 | 2812 |
} |
2825 | 2813 |
catch (Exception ex) |
2826 | 2814 |
{ |
... | ... | |
3704 | 3692 |
|
3705 | 3693 |
public bool IsBypass { get; set; } |
3706 | 3694 |
|
3707 |
public string GetFromData(ref string Type, ref Item item) |
|
3695 |
public string GetFromData(ref string Type, ref Item item, Item oItem, ref string OStatus)
|
|
3708 | 3696 |
{ |
3709 | 3697 |
Status = string.Empty; |
3710 | 3698 |
string result = string.Empty; |
... | ... | |
3719 | 3707 |
else if (StartType == PSNType.Branch) |
3720 | 3708 |
{ |
3721 | 3709 |
if (item.Relations.First().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.First().Item.LineNumber.Name)) |
3722 |
{ |
|
3723 | 3710 |
result = item.Relations.First().Item.LineNumber.Name; |
3724 |
if (item.Relations.First().Item.LineNumber.MissingLineNumber2) |
|
3725 |
{ |
|
3726 |
Status += ", Missing LineNumber_2"; |
|
3727 |
IsValid = "Error"; |
|
3728 |
} |
|
3729 |
if (item.Relations.First().Item.LineNumber.MissingLineNumber1) |
|
3730 |
{ |
|
3731 |
Status += ", Missing LineNumber_1"; |
|
3732 |
IsValid = "Error"; |
|
3733 |
} |
|
3734 |
} |
|
3735 | 3711 |
else |
3736 | 3712 |
{ |
3737 | 3713 |
IsValid = "Error"; |
3738 | 3714 |
result = "Empty LineNumber"; |
3739 | 3715 |
} |
3716 |
|
|
3717 |
|
|
3718 |
|
|
3719 |
//if (item.Relations.First().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.First().Item.LineNumber.Name)) |
|
3720 |
//{ |
|
3721 |
// result = item.Relations.First().Item.LineNumber.Name; |
|
3722 |
// if (item.Relations.First().Item.LineNumber.MissingLineNumber2) |
|
3723 |
// { |
|
3724 |
// Status += ", Missing LineNumber_2"; |
|
3725 |
// IsValid = "Error"; |
|
3726 |
// } |
|
3727 |
// if (item.Relations.First().Item.LineNumber.MissingLineNumber1) |
|
3728 |
// { |
|
3729 |
// Status += ", Missing LineNumber_1"; |
|
3730 |
// IsValid = "Error"; |
|
3731 |
// } |
|
3732 |
//} |
|
3733 |
//else |
|
3734 |
//{ |
|
3735 |
// IsValid = "Error"; |
|
3736 |
// result = "Empty LineNumber"; |
|
3737 |
//} |
|
3740 | 3738 |
} |
3741 | 3739 |
else if (StartType == PSNType.Equipment) |
3742 | 3740 |
{ |
... | ... | |
3778 | 3776 |
if (item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name)) |
3779 | 3777 |
{ |
3780 | 3778 |
result = item.LineNumber.Name; |
3781 |
if (item.LineNumber.MissingLineNumber2) |
|
3782 |
{ |
|
3783 |
Status += ", Missing LineNumber_2"; |
|
3784 |
IsValid = "Error"; |
|
3785 |
} |
|
3786 |
if (item.LineNumber.MissingLineNumber1) |
|
3787 |
{ |
|
3788 |
Status += ", Missing LineNumber_1"; |
|
3789 |
IsValid = "Error"; |
|
3790 |
} |
|
3791 | 3779 |
} |
3792 | 3780 |
else |
3793 | 3781 |
{ |
3794 | 3782 |
IsValid = "Error"; |
3795 | 3783 |
result = "Empty LineNumber"; |
3796 | 3784 |
} |
3785 |
|
|
3786 |
|
|
3787 |
|
|
3797 | 3788 |
} |
3798 | 3789 |
else |
3799 | 3790 |
result = "Unknown"; |
3800 | 3791 |
} |
3792 |
|
|
3793 |
if (oItem.LineNumber != null && !string.IsNullOrEmpty(oItem.LineNumber.Name)) |
|
3794 |
{ |
|
3795 |
if (oItem.LineNumber.MissingLineNumber2) |
|
3796 |
{ |
|
3797 |
OStatus += ", Missing LineNumber_2"; |
|
3798 |
IsValid = "Error"; |
|
3799 |
} |
|
3800 |
if (oItem.LineNumber.MissingLineNumber1) |
|
3801 |
{ |
|
3802 |
OStatus += ", Missing LineNumber_1"; |
|
3803 |
IsValid = "Error"; |
|
3804 |
} |
|
3805 |
} |
|
3801 | 3806 |
} |
3802 | 3807 |
catch (Exception ex) |
3803 | 3808 |
{ |
... | ... | |
3840 | 3845 |
return result; |
3841 | 3846 |
} |
3842 | 3847 |
|
3843 |
public string GetToData(ref string ToType, ref Item item) |
|
3848 |
public string GetToData(ref string ToType, ref Item item, Item oItem)
|
|
3844 | 3849 |
{ |
3845 | 3850 |
string result = string.Empty; |
3846 | 3851 |
Status = string.Empty; |
... | ... | |
3855 | 3860 |
else if (EndType == PSNType.Branch) |
3856 | 3861 |
{ |
3857 | 3862 |
if (item.Relations.Last().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.Last().Item.LineNumber.Name)) |
3858 |
{ |
|
3859 | 3863 |
result = item.Relations.Last().Item.LineNumber.Name; |
3860 |
if (item.Relations.Last().Item.LineNumber.MissingLineNumber2) |
|
3861 |
{ |
|
3862 |
Status += ", Missing LineNumber_2"; |
|
3863 |
IsValid = "Error"; |
|
3864 |
} |
|
3865 |
if (item.Relations.Last().Item.LineNumber.MissingLineNumber1) |
|
3866 |
{ |
|
3867 |
Status += ", Missing LineNumber_1"; |
|
3868 |
IsValid = "Error"; |
|
3869 |
} |
|
3870 |
} |
|
3871 | 3864 |
else |
3872 | 3865 |
{ |
3873 | 3866 |
IsValid = "Error"; |
3874 | 3867 |
result = "Empty LineNumber"; |
3875 |
} |
|
3868 |
} |
|
3869 |
|
|
3870 |
|
|
3871 |
|
|
3872 |
//if (item.Relations.Last().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.Last().Item.LineNumber.Name)) |
|
3873 |
//{ |
|
3874 |
// result = item.Relations.Last().Item.LineNumber.Name; |
|
3875 |
// if (item.Relations.Last().Item.LineNumber.MissingLineNumber2) |
|
3876 |
// { |
|
3877 |
// Status += ", Missing LineNumber_2"; |
|
3878 |
// IsValid = "Error"; |
|
3879 |
// } |
|
3880 |
// if (item.Relations.Last().Item.LineNumber.MissingLineNumber1) |
|
3881 |
// { |
|
3882 |
// Status += ", Missing LineNumber_1"; |
|
3883 |
// IsValid = "Error"; |
|
3884 |
// } |
|
3885 |
//} |
|
3886 |
//else |
|
3887 |
//{ |
|
3888 |
// IsValid = "Error"; |
|
3889 |
// result = "Empty LineNumber"; |
|
3890 |
//} |
|
3876 | 3891 |
} |
3877 | 3892 |
else if (EndType == PSNType.Equipment) |
3878 | 3893 |
{ |
... | ... | |
3915 | 3930 |
if (item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name)) |
3916 | 3931 |
{ |
3917 | 3932 |
result = item.LineNumber.Name; |
3918 |
if (item.LineNumber.MissingLineNumber2) |
|
3919 |
{ |
|
3920 |
Status += ", Missing LineNumber_2"; |
|
3921 |
IsValid = "Error"; |
|
3922 |
} |
|
3923 |
if (item.LineNumber.MissingLineNumber1) |
|
3924 |
{ |
|
3925 |
Status += ", Missing LineNumber_1"; |
|
3926 |
IsValid = "Error"; |
|
3927 |
} |
|
3928 | 3933 |
} |
3929 | 3934 |
else |
3930 | 3935 |
{ |
3931 | 3936 |
IsValid = "Error"; |
3932 | 3937 |
result = "Empty LineNumber"; |
3933 | 3938 |
} |
3939 |
|
|
3940 |
|
|
3941 |
|
|
3934 | 3942 |
} |
3935 | 3943 |
else |
3936 | 3944 |
result = "Unknown"; |
3937 | 3945 |
} |
3946 |
|
|
3938 | 3947 |
return result; |
3939 | 3948 |
} |
3940 | 3949 |
|
내보내기 Unified diff