프로젝트

일반

사용자정보

개정판 a89e25a0

IDa89e25a0eac9ad9a39d5f5b89a1f054698a7d1c4
상위 9951fc09
하위 239f4964, cc993b9b

이지연이(가) 약 3년 전에 추가함

issue #000:

Change-Id: I0d28699980ad4cbb90d10707c31f3f5201f99954

차이점 보기:

DTI_PID/ID2PSN/PSN.cs
375 375

  
376 376
                
377 377
                DataRow[] pumpRows = PipeSystemNetwork.Select("PUMP = 'PUMP'");
378
                Dictionary<string, string> eqkeyValuePairs = new Dictionary<string, string>();
378 379
                // 1, 2번
379 380
                foreach (DataRow dataRow in pumpRows) 
380 381
                {                  
......
384 385
                    string ItemTag = "ItemTag";
385 386
                    string EGFlowDirection = string.Empty;
386 387
                    string Prefix = string.Empty;
387
                    Dictionary<string, string> eqkeyValuePairs = new Dictionary<string, string>();
388
                    
388 389

  
389 390
                    PSNItem PSNItem = PSNItems.Find(x => x.PSN_OID() == dataRow["OID"].ToString());
390 391
                    if (PSNItem.Groups.First().Items.First().Equipment != null)
......
949 950
                        }
950 951
                        else if(dr["Type"].ToString() == "E2B" || dr["Type"].ToString() == "B2E" || dr["Type"].ToString() == "E2E")
951 952
                        {
952
                            List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
953
                            string lastP1 = string.Empty;
954
                            foreach (string viewpsn in lstViewPipeSystemNetwork_OID)
953
                            PSNItem PSNItem = PSNItems.Find(x => x.PSN_OID() == dr["OID"].ToString());
954
                            string EGFlowDirection = string.Empty;
955
                            if (PSNItem.Groups.First().Items.First().Equipment != null)
955 956
                            {
956
                                if (viewpsn == dr["OID"].ToString())
957
                                    continue;
958

  
959
                                if (PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC Like 'P1%'", viewpsn)).Length == 0)
960
                                    continue;
961

  
962
                                DataRow rows = PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC Like 'P1%'", viewpsn)).First();
963
                                if(rows != null)
957
                                if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && PSNItem.Groups.First().Items.First().Equipment.Name.Contains(x.Name)).Count() > 0)
958
                                {
959
                                    EquipmentAirFinCoolerItem equipmentAirFinCoolerItem = EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && PSNItem.Groups.First().Items.First().Equipment.Name.Contains(x.Name)).First();
960
                                    if (equipmentAirFinCoolerItem != null)
961
                                        EGFlowDirection = "O";
962
                                }
963
                            }
964
                            else if (PSNItem.Groups.Last().Items.Last().Equipment != null)
965
                            {
966
                                if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && PSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).Count() > 0)
964 967
                                {
965
                                    lastP1 = viewpsn;
968
                                    EquipmentAirFinCoolerItem equipmentAirFinCoolerItem = EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && PSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).First();
969
                                    if(equipmentAirFinCoolerItem != null)
970
                                        EGFlowDirection = "I";
966 971
                                }
967 972
                            }
968 973

  
969
                            if(!string.IsNullOrEmpty(lastP1))
974
                            if (!string.IsNullOrEmpty(EGFlowDirection))
970 975
                            {
971
                                bool bCheck = false;
972
                                foreach (DataRow dataRow in pathItemRows)
976
                                List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
977
                                string lastP1 = string.Empty;
978

  
979
                                foreach (string viewpsn in lstViewPipeSystemNetwork_OID)
973 980
                                {
974
                                    if (bCheck)
975
                                        dataRow["EqpGroupTag"] = string.Empty;
981
                                    if (viewpsn == dr["OID"].ToString())
982
                                        continue;
983

  
984
                                    if (PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC Like 'P1%'", viewpsn)).Length == 0)
985
                                        continue;
986

  
987
                                    DataRow rows = PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC Like 'P1%'", viewpsn)).First();
976 988

  
977
                                    if (dataRow.Field<string>("ViewPipeSystemNetwork_OID").Equals(lastP1))
989
                                    if (rows != null)
978 990
                                    {
979
                                        bCheck = true;
980
                                        dataRow["EGTConnectedPoint"] = 1;
981
                                    }                       
991
                                        lastP1 = viewpsn;
992
                                        if (EGFlowDirection.Equals("I")) // To         
993
                                            break;
994
                                    }
982 995
                                }
983
                            }
996

  
997
                                if (!string.IsNullOrEmpty(lastP1))
998
                                {
999
                                    bool bCheck = false;
1000
                                    if (EGFlowDirection.Equals("O")) // From
1001
                                    {
1002
                                        foreach (DataRow dataRow in pathItemRows)
1003
                                        {
1004
                                            if (bCheck)
1005
                                                dataRow["EqpGroupTag"] = string.Empty;
1006

  
1007
                                            if (dataRow.Field<string>("ViewPipeSystemNetwork_OID").Equals(lastP1))
1008
                                            {
1009
                                                bCheck = true;
1010
                                                dataRow["EGTConnectedPoint"] = 1;
1011
                                            }
1012
                                        }
1013
                                    }
1014
                                    else
1015
                                    {
1016
                                        foreach (DataRow dataRow in pathItemRows)
1017
                                        {
1018
                                            if (dataRow.Field<string>("ViewPipeSystemNetwork_OID").Equals(lastP1))
1019
                                            {
1020
                                                dataRow["EGTConnectedPoint"] = 1;
1021
                                                break;
1022
                                            }
1023
                                            
1024
                                            dataRow["EqpGroupTag"] = string.Empty;                                           
1025
                                        }
1026
                                    }
1027
                                }
1028
                            }                          
984 1029
                        }
985 1030
                    }
986 1031
                }
......
1210 1255
                {
1211 1256
                    List<LineNumber> lineNumbers = group.Document.LineNumbers.FindAll(x => !x.IsCopy);
1212 1257
                    Random random = new Random();
1213
                    int index = random.Next(lineNumbers.Count - 1);
1214
                   
1215
                    // Copy
1216
                    LineNumber cLineNumber = lineNumbers[index].Copy();
1258

  
1259
                    LineNumber cLineNumber = null;
1260

  
1261
                    if (lineNumbers.Count == 0)
1262
                    {
1263
                        var _groups = groups.Where(w => w != group).ToList();
1264
                        while (cLineNumber == null)
1265
                        {
1266
                            int _index = random.Next(_groups.Count - 1);
1267
                            List<LineNumber> _lineNumbers = groups[_index].Document.LineNumbers.FindAll(x => !x.IsCopy);
1268
                            if (_lineNumbers.Count != 0)
1269
                            {
1270
                                _index = random.Next(_lineNumbers.Count - 1);
1271

  
1272
                                // Copy
1273
                                cLineNumber = _lineNumbers[_index].Copy();
1274
                            }
1275
                        }
1276
                    }
1277
                    else
1278
                    {
1279
                        int index = random.Next(lineNumbers.Count - 1);
1280

  
1281
                        // Copy
1282
                        cLineNumber = lineNumbers[index].Copy();
1283
                    }
1284

  
1217 1285
                    group.Document.LineNumbers.Add(cLineNumber);
1218 1286

  
1219 1287
                    foreach (Item item in group.Items)
1220 1288
                    {
1221 1289
                        item.Owner = cLineNumber.UID;
1222
                        item.Document.MissingLineNumber2 = true;
1290
                        item.MissingLineNumber2 = true;
1223 1291
                    }
1224 1292
                }
1293

  
1294
                //if (prevLineNumber == null)
1295
                //{
1296
                //    List<LineNumber> lineNumbers = group.Document.LineNumbers.FindAll(x => !x.IsCopy);
1297
                //    Random random = new Random();
1298
                //    int index = random.Next(lineNumbers.Count - 1);
1299

  
1300
                //    // Copy
1301
                //    LineNumber cLineNumber = lineNumbers[index].Copy();
1302
                //    group.Document.LineNumbers.Add(cLineNumber);
1303

  
1304
                //    foreach (Item item in group.Items)
1305
                //    {
1306
                //        item.Owner = cLineNumber.UID;
1307
                //        item.Document.MissingLineNumber2 = true;
1308
                //    }
1309
                //}
1225 1310
            }
1226 1311

  
1227 1312
            foreach (Document document in Documents)
......
3115 3200
                                PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last(), TO_DATA), insertIndex);
3116 3201
                                if(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND ItemName = 'PipeRun' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Count() > 0)
3117 3202
                                    PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND ItemName = 'PipeRun' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex);
3203
                               
3118 3204
                            }
3119 3205

  
3120 3206
                            PSNItem.EndType = PSNType.Equipment;

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)