개정판 284fa2c9
issue #000:
Change-Id: I6a600a1d1869b65f32f28368718a9fc357738a86
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
667 | 667 |
} |
668 | 668 |
|
669 | 669 |
int afcTagNum = 0; |
670 |
DataRow[] airFinCoolerRows = PipeSystemNetwork.Select("AFC = 'P1'"); |
|
670 |
DataRow[] airFinCoolerRows = PipeSystemNetwork.Select("AFC Like 'P1%'"); |
|
671 |
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>(); |
|
671 | 672 |
foreach (DataRow dataRow in airFinCoolerRows) |
672 | 673 |
{ |
673 |
afcTagNum++; |
|
674 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
675 |
foreach (DataRow dr in pathItemRows) |
|
676 |
{ |
|
677 |
dr["EqpGroupTag"] = "AFC" + string.Format("-{0}", string.Format("{0:D3}", afcTagNum)); |
|
678 |
} |
|
674 |
string[] afcTag = dataRow.Field<string>("AFC").Split(new string[] { "\\" }, StringSplitOptions.None); |
|
675 |
if (afcTag.Length > 1) |
|
676 |
{ |
|
677 |
string afc = string.Empty; |
|
678 |
if(!keyValuePairs.ContainsKey(afcTag[1])) |
|
679 |
{ |
|
680 |
afcTagNum++; |
|
681 |
afc = "AFC" + string.Format("-{0}", string.Format("{0:D3}", afcTagNum)); |
|
682 |
keyValuePairs.Add(afcTag[1], afc); |
|
683 |
} |
|
684 |
else |
|
685 |
{ |
|
686 |
afc = keyValuePairs[afcTag[1]]; |
|
687 |
} |
|
688 |
|
|
689 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
690 |
foreach (DataRow dr in pathItemRows) |
|
691 |
{ |
|
692 |
dr["EqpGroupTag"] = afc; |
|
693 |
} |
|
694 |
} |
|
679 | 695 |
} |
680 | 696 |
|
681 | 697 |
foreach (DataRow dataRow in airFinCoolerRows) |
... | ... | |
711 | 727 |
} |
712 | 728 |
else if (dataRow["Type"].ToString() == "E2B" || dataRow["Type"].ToString() == "B2E") |
713 | 729 |
{ |
714 |
int bCount = 0; |
|
715 | 730 |
foreach (string viewOID in lstViewPipeSystemNetwork_OID) |
716 | 731 |
{ |
717 | 732 |
if (viewOID == dataRow["OID"].ToString()) |
718 | 733 |
continue; |
719 | 734 |
|
720 | 735 |
DataRow dr = PipeSystemNetwork.Select(string.Format("OID = '{0}'", viewOID)).First(); |
721 |
if (dr.Field<string>("AFC") != "P1")
|
|
736 |
if (!dr.Field<string>("AFC").Contains("P1"))
|
|
722 | 737 |
{ |
723 | 738 |
if (lstViewPipeSystemNetwork_OID.Where(x => x.Equals(viewOID)).Count() == 1) |
724 | 739 |
{ |
... | ... | |
735 | 750 |
|
736 | 751 |
DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", viewOID)); |
737 | 752 |
|
738 |
if(viewpathItemRows.Where(x => !string.IsNullOrEmpty(x.Field<string>("EqpGroupTag"))).Count() > 0) |
|
739 |
AFCTag = viewpathItemRows.Where(x => !string.IsNullOrEmpty(x.Field<string>("EqpGroupTag"))).First().Field<string>("EqpGroupTag"); |
|
740 |
|
|
753 |
//if(viewpathItemRows.Where(x => !string.IsNullOrEmpty(x.Field<string>("EqpGroupTag"))).Count() > 0) |
|
754 |
// AFCTag = viewpathItemRows.Where(x => !string.IsNullOrEmpty(x.Field<string>("EqpGroupTag"))).First().Field<string>("EqpGroupTag"); |
|
755 |
afcTagNum++; |
|
756 |
AFCTag = "AFC" + string.Format("-{0}", string.Format("{0:D3}", afcTagNum)); |
|
741 | 757 |
foreach (DataRow viewdr in viewpathItemRows) |
742 | 758 |
{ |
743 |
// viewdr["EqpGroupTag"] = AFCTag;
|
|
759 |
viewdr["EqpGroupTag"] = AFCTag; |
|
744 | 760 |
viewdr["MainLineTag"] = "M"; |
745 | 761 |
} |
746 | 762 |
} |
... | ... | |
755 | 771 |
dr["EGFlowDirection"] = EGFlowDirection; |
756 | 772 |
} |
757 | 773 |
} |
758 |
|
|
774 |
|
|
775 |
//P3을 제외한 P1 |
|
776 |
airFinCoolerRows = PipeSystemNetwork.Select("AFC Like 'P1%'"); |
|
759 | 777 |
foreach (DataRow dataRow in airFinCoolerRows) |
760 | 778 |
{ |
779 |
//ML이 공란 |
|
761 | 780 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}' AND MainLineTag = ''", dataRow["OID"].ToString())); |
762 |
//ML이 공란인 PSN - P1이 있다면 해당 Pathitem에 P3인 psn이 있는지 확인 : 해당 값은 전부 돌린후 확인 가능하기 때문에 다시 조회 |
|
781 |
|
|
763 | 782 |
if (pathItemRows.Count() > 0) |
764 | 783 |
{ |
765 | 784 |
List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList(); |
... | ... | |
769 | 788 |
foreach (string viewOID in lstViewPipeSystemNetwork_OID) |
770 | 789 |
{ |
771 | 790 |
if (dataRow["OID"].ToString() == viewOID) |
772 |
{ |
|
773 |
//lstViewPipeSystemNetwork_OID.Remove(viewOID); |
|
774 | 791 |
continue; |
775 |
} |
|
792 |
|
|
793 |
//P3이면 |
|
776 | 794 |
DataRow viewPSN = null; |
777 | 795 |
if (PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC = 'P3'", viewOID)).Count() > 0) |
778 | 796 |
viewPSN = PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC = 'P3'", viewOID)).First(); |
779 | 797 |
|
780 | 798 |
if (viewPSN != null) |
781 | 799 |
{ |
800 |
//P3의 AGT를 가져와 P1에 입력 |
|
782 | 801 |
EqpGroupTag = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", viewOID)).First().Field<string>("EqpGroupTag"); |
783 | 802 |
foreach (DataRow dr in pathItemRows) |
784 | 803 |
{ |
785 | 804 |
dr["EqpGroupTag"] = EqpGroupTag; |
786 | 805 |
|
806 |
//P1의 AGT와 같은 모든 AGT를 P3의 AGT로 변경하기위해 |
|
787 | 807 |
if (!string.IsNullOrEmpty(dr.Field<string>("ViewPipeSystemNetwork_OID")) && !lstpsn.Contains(dr.Field<string>("ViewPipeSystemNetwork_OID"))) |
788 | 808 |
{ |
789 | 809 |
lstpsn.Add(dr.Field<string>("ViewPipeSystemNetwork_OID")); |
... | ... | |
799 | 819 |
int lstCount = lstpsn.Count; |
800 | 820 |
for (int i = 0; i < lstpsn.Count(); i++) //string psn in lstpsn |
801 | 821 |
{ |
802 |
|
|
822 |
|
|
803 | 823 |
DataRow[] rule4pathItems = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", lstpsn[i])); |
804 | 824 |
foreach (DataRow dr in rule4pathItems) |
805 | 825 |
{ |
806 | 826 |
if (!string.IsNullOrEmpty(dr.Field<string>("ViewPipeSystemNetwork_OID")) && !lstAll.Contains(dr.Field<string>("ViewPipeSystemNetwork_OID"))) |
807 | 827 |
{ |
808 |
lstpsn.Add(dr.Field<string>("ViewPipeSystemNetwork_OID")); |
|
809 |
lstAll.Add(dr.Field<string>("ViewPipeSystemNetwork_OID")); |
|
828 |
DataRow viewPSN = null; |
|
829 |
//연결된 PathItem-Tee (P3인것만) 의 PathItem-Tee에 또 P3가 있다면 해당 PSN도 Tag변경 만약 P3가 아닌 모든 OID면 해당 로직 삭제 (위에로직도 변경필요) |
|
830 |
if (PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC = 'P3'", dr.Field<string>("ViewPipeSystemNetwork_OID"))).Count() > 0) |
|
831 |
viewPSN = PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC = 'P3'", dr.Field<string>("ViewPipeSystemNetwork_OID"))).First(); |
|
832 |
if(viewPSN != null) |
|
833 |
{ |
|
834 |
lstpsn.Add(dr.Field<string>("ViewPipeSystemNetwork_OID")); |
|
835 |
lstAll.Add(dr.Field<string>("ViewPipeSystemNetwork_OID")); |
|
836 |
} |
|
810 | 837 |
} |
811 | 838 |
|
812 | 839 |
if (dr["EqpGroupTag"].Equals(EqpGroupTag)) |
813 | 840 |
continue; |
814 | 841 |
|
815 |
dr["EqpGroupTag"] = EqpGroupTag;
|
|
842 |
dr["EqpGroupTag"] = EqpGroupTag; |
|
816 | 843 |
} |
817 | 844 |
|
818 | 845 |
lstpsn.Remove(lstpsn[i]); |
819 |
}
|
|
846 |
} |
|
820 | 847 |
|
821 | 848 |
} |
822 | 849 |
} |
823 | 850 |
|
824 | 851 |
} |
825 | 852 |
|
826 |
//DataRow[] = PipeSystemNetwork.Select("AFC = 'P1'"); |
|
827 | 853 |
foreach(DataRow dr in PipeSystemNetwork.Rows) |
828 | 854 |
{ |
829 | 855 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}' AND MainLineTag = 'M'", dr["OID"].ToString())); |
... | ... | |
852 | 878 |
if (viewpsn == dr["OID"].ToString()) |
853 | 879 |
continue; |
854 | 880 |
|
855 |
if (PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC = 'P1'", viewpsn)).Length == 0)
|
|
881 |
if (PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC Like 'P1%'", viewpsn)).Length == 0)
|
|
856 | 882 |
continue; |
857 | 883 |
|
858 |
DataRow rows = PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC = 'P1'", viewpsn)).First();
|
|
884 |
DataRow rows = PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC Like 'P1%'", viewpsn)).First();
|
|
859 | 885 |
if(rows != null) |
860 | 886 |
{ |
861 | 887 |
lastP1 = viewpsn; |
... | ... | |
2454 | 2480 |
if(PSNItem.StartType == PSNType.Equipment && From_item.Equipment != null) |
2455 | 2481 |
{ |
2456 | 2482 |
if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && x.Name.Equals(From_item.Equipment.Name)).Count() > 0) |
2457 |
AFC = "P1";
|
|
2483 |
AFC = "P1\\" + From_item.Equipment.Name;
|
|
2458 | 2484 |
else if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type == "Pump" && x.Name.Equals(From_item.Equipment.Name)).Count() > 0) |
2459 | 2485 |
newRow["PUMP"] = "PUMP"; |
2460 | 2486 |
} |
... | ... | |
2462 | 2488 |
if (PSNItem.EndType == PSNType.Equipment && To_item.Equipment != null) |
2463 | 2489 |
{ |
2464 | 2490 |
if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && x.Name.Equals(To_item.Equipment.Name)).Count() > 0) |
2465 |
AFC = "P1";
|
|
2491 |
AFC = "P1\\" + To_item.Equipment.Name;
|
|
2466 | 2492 |
else if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type == "Pump" && x.Name.Equals(To_item.Equipment.Name)).Count() > 0) |
2467 | 2493 |
newRow["PUMP"] = "PUMP"; |
2468 | 2494 |
} |
내보내기 Unified diff