프로젝트

일반

사용자정보

개정판 7d6d1693

ID7d6d16939d070dd389cec7aff8e4f27157681807
상위 a96d48f8
하위 6805be6e

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

issue #000: ValveGroupingSetting No Selection 삭제, No Selection 로직 제거, EGT 삭제 시 ML 및 연관 데이터 삭제 로직 추가, EGT Naming Rule 변경, Scope Break 로직 수정

Change-Id: I97a2ebb58bc9607c7448d884ba3cd1db16bb0f81

차이점 보기:

DTI_PID/ID2PSN/PSN.cs
240 240
            // PSN의 정보를 저장
241 241
            splashScreenManager1.SetWaitFormDescription(i++ + " / 19  SetPSNData ( 45 % )");
242 242
            SavePSNData();
243
            // Update Keyword
243
            // Update PSN From/To Keyword & EndofHeader
244 244
            splashScreenManager1.SetWaitFormDescription(i++ + " / 19  UpdateKeywordForPSN ( 55 % )");
245
            UpdateKeywordForPSN();
245
            UpdateKeywordForPSN(); 
246 246
          
247 247
            // Topology의 subtype을 update(bypass, Header, 등등) 
248 248
            splashScreenManager1.SetWaitFormDescription(i++ + " / 19  UpdateSubType ( 60 % )");
......
258 258
            UpdateErrorForPSN();
259 259
            // Insert Tee
260 260
            splashScreenManager1.SetWaitFormDescription(i++ + " / 19  InsertTeePSN ( 75 % )");
261
            PathItemSorting();
261 262
            InsertTeePSN();
262 263

  
263
            // ValveGrouping
264
            PathItemSorting(); //test
264
            // ValveGrouping            
265 265
            splashScreenManager1.SetWaitFormDescription(i++ + " / 19  UpdateValveGrouping ( 80 % )");
266
            PathItemSorting(); //test
266 267
            UpdateValveGrouping();
267 268

  
268 269
            splashScreenManager1.SetWaitFormDescription(i++ + " / 19  PathItemSorting ( 85 % )");
......
382 383
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString()));
383 384

  
384 385
                    string EGTAG = "EGTAG";
385
                    string ItemTag = "ItemTag";
386
                   // string ItemTag = "ItemTag";
386 387
                    string EGFlowDirection = string.Empty;
387 388
                    string Prefix = string.Empty;
388
                    
389
                    string SymbolName = string.Empty;
389 390

  
390 391
                    PSNItem PSNItem = PSNItems.Find(x => x.PSN_OID() == dataRow["OID"].ToString());
391 392
                    if (PSNItem.Groups.First().Items.First().Equipment != null)
......
397 398
                                EGTAG = PSNItem.Groups.First().Items.First().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName) == null
398 399
                                   ? string.Empty : PSNItem.Groups.First().Items.First().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName).Value;
399 400

  
400
                            ItemTag = PSNItem.Groups.First().Items.First().Equipment.ItemTag;
401
                            SymbolName = PSNItem.Groups.First().Items.First().Equipment.Name;
401 402
                            Prefix = equipmentAirFinCoolerItem.TagIdentifier;                            
402 403
                            EGFlowDirection = "O";
403 404
                        }                        
404 405
                    } 
405
                    else if(PSNItem.Groups.Last().Items.Last().Equipment != null)
406
                    
407
                    if(string.IsNullOrEmpty(EGFlowDirection) && PSNItem.Groups.Last().Items.Last().Equipment != null)
406 408
                    {
407 409
                        if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type == "Pump" && PSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).Count() > 0)
408 410
                        {
......
411 413
                                EGTAG = PSNItem.Groups.Last().Items.Last().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName) == null
412 414
                                    ? string.Empty : PSNItem.Groups.Last().Items.Last().Equipment.Attributes.Find(x => x.Name == equipmentAirFinCoolerItem.AttributeName).Value;
413 415

  
414
                            ItemTag = PSNItem.Groups.Last().Items.Last().Equipment.ItemTag;
416
                            SymbolName = PSNItem.Groups.Last().Items.Last().Equipment.Name;
415 417
                            Prefix = equipmentAirFinCoolerItem.TagIdentifier;                            
416 418
                            EGFlowDirection = "I";
417 419
                        }
......
420 422
                    //Attribute가 세팅되어있지 않다면
421 423
                    if (EGTAG.Equals("EGTAG"))
422 424
                    {
423
                        if (!eqkeyValuePairs.ContainsKey(ItemTag))
425
                        if (!eqkeyValuePairs.ContainsKey(SymbolName))
424 426
                        {
425
                            pumpTagNum++;
426
                            EGTAG = Prefix + string.Format("-{0}", string.Format("{0:D5}", pumpTagNum));
427
                            eqkeyValuePairs.Add(ItemTag, EGTAG);
427
                            if (!string.IsNullOrEmpty(Prefix))
428
                            {
429
                                pumpTagNum++;
430
                                EGTAG = Prefix + string.Format("-{0}", string.Format("{0:D5}", pumpTagNum));
431
                                eqkeyValuePairs.Add(SymbolName, EGTAG);
432
                            }
433
                            else
434
                            {
435
                                eqkeyValuePairs.Add(SymbolName, SymbolName);
436
                            }
428 437
                        }
429 438
                        else
430 439
                        {
431
                            EGTAG = eqkeyValuePairs[ItemTag];
440
                            EGTAG = eqkeyValuePairs[SymbolName];
432 441
                        }
433 442
                    }
434 443
                    else
435 444
                    {
436
                        EGTAG = Prefix + "-" + EGTAG;
445
                        if (!string.IsNullOrEmpty(Prefix))
446
                            EGTAG = Prefix + "-" + EGTAG;
437 447
                    }
438 448

  
449

  
439 450
                    foreach (DataRow dr in pathItemRows)
440 451
                    {
441 452
                        dr["EqpGroupTag"] = EGTAG;
......
458 469
                            EGFlowDirection = "O";
459 470
                        }
460 471
                    }
461
                    else if (PSNItem.Groups.Last().Items.Last().Equipment != null)
472
                    
473
                    if (string.IsNullOrEmpty(EGFlowDirection) && PSNItem.Groups.Last().Items.Last().Equipment != null)
462 474
                    {
463 475
                        if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type == "Pump" && PSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).Count() > 0)
464 476
                        {
......
485 497
                                        viewEGFlowDirection = "O";
486 498
                                    }
487 499
                                }
488
                                else if (viewPSNItem.Groups.Last().Items.Last().Equipment != null)
500
                                
501
                                
502
                                if (string.IsNullOrEmpty(viewEGFlowDirection) && viewPSNItem.Groups.Last().Items.Last().Equipment != null)
489 503
                                {
490 504
                                    if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type == "Pump" && viewPSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).Count() > 0)
491 505
                                    {
......
606 620
                    }
607 621
                    else
608 622
                    {
609
                        foreach (DataRow dr in pathItemRows)
610
                        {
611
                            dr["EqpGroupTag"] = string.Empty;
612
                            dr["EGFlowDirection"] = string.Empty;
613
                        }
623
                        //foreach (DataRow dr in pathItemRows)
624
                        //{
625
                        //    dr["EqpGroupTag"] = string.Empty;
626
                        //    dr["EGFlowDirection"] = string.Empty;
627
                        //    dr["EGTConnectedPoint"] = "0";
628
                        //    dr["MainLineTag"] = string.Empty;
629
                        //}
614 630
                    }
615 631
                }
616 632
                                
......
633 649
                            EGFlowDirection = "O";
634 650
                        }
635 651
                    }
636
                    else if (PSNItem.Groups.Last().Items.Last().Equipment != null)
652
                    
653
                    if (string.IsNullOrEmpty(EGFlowDirection) && PSNItem.Groups.Last().Items.Last().Equipment != null)
637 654
                    {
638 655
                        if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type == "Pump" && PSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).Count() > 0)
639 656
                        {
......
709 726
                    string EGFlowDirection = string.Empty;
710 727
                    string EGTAG = "EGTAG";
711 728
                    string Prefix = string.Empty;
729
                    string SymbolName = string.Empty;
730

  
712 731
                    //item.Attributes.Find(x => x.Name == valveitem.AttributeName).Value;
713 732
                    PSNItem PSNItem = PSNItems.Find(x => x.PSN_OID() == dataRow["OID"].ToString());
714 733
                    if (PSNItem.Groups.First().Items.First().Equipment != null)
......
724 743
                            EGFlowDirection = "O";
725 744
                        }
726 745
                    }
727
                    else if (PSNItem.Groups.Last().Items.Last().Equipment != null)
746

  
747
                    if (string.IsNullOrEmpty(EGFlowDirection) && PSNItem.Groups.Last().Items.Last().Equipment != null)
728 748
                    {
729 749
                        if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && PSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).Count() > 0)
730 750
                        {
......
744 764

  
745 765
                        //Attribute가 세팅되어있지 않다면
746 766
                        if (EGTAG.Equals("EGTAG"))
747
                        {
767
                        {                          
748 768
                            if (!keyValuePairs.ContainsKey(afcTag[1]))
749 769
                            {
750
                                afcTagNum++;
751
                                EGTAG = Prefix + string.Format("-{0}", string.Format("{0:D5}", afcTagNum));
752
                                keyValuePairs.Add(afcTag[1], EGTAG);
770
                                if (!string.IsNullOrEmpty(Prefix))
771
                                {
772
                                    afcTagNum++;
773
                                    EGTAG = Prefix + string.Format("-{0}", string.Format("{0:D5}", afcTagNum));
774
                                    keyValuePairs.Add(afcTag[1], EGTAG);
775
                                }
776
                                else
777
                                {
778
                                    keyValuePairs.Add(afcTag[1], afcTag[1]);
779

  
780
                                }
753 781
                            }
754 782
                            else
755 783
                            {
756 784
                                EGTAG = keyValuePairs[afcTag[1]];
757 785
                            }
786
                            
758 787
                        }
759 788
                        else
760 789
                        {
761
                            EGTAG = Prefix + "-" + EGTAG;
790
                            if (!string.IsNullOrEmpty(Prefix))
791
                                EGTAG = Prefix + "-" + EGTAG;                          
762 792
                        }
763 793

  
764 794
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString()));
......
883 913

  
884 914
                                foreach (DataRow dr in pathItemRows)
885 915
                                {
886

  
887 916
                                    dr["EqpGroupTag"] = EqpGroupTag;
888 917

  
889 918
                                    //P1의 AGT와 같은 모든 AGT를 P3의 AGT로 변경하기위해 
......
897 926
                                        }
898 927
                                    }
899 928
                                }
900
                            }
901
                            
929
                            }                            
902 930
                        }
903 931

  
904 932
                        while (lstpsn.Count() != 0)
......
961 989
                                        EGFlowDirection = "O";
962 990
                                }
963 991
                            }
964
                            else if (PSNItem.Groups.Last().Items.Last().Equipment != null)
992
                            
993
                            if (string.IsNullOrEmpty(EGFlowDirection) && PSNItem.Groups.Last().Items.Last().Equipment != null)
965 994
                            {
966 995
                                if (EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Where(x => x.Type != "Pump" && PSNItem.Groups.Last().Items.Last().Equipment.Name.Contains(x.Name)).Count() > 0)
967 996
                                {
......
1002 1031
                                        foreach (DataRow dataRow in pathItemRows)
1003 1032
                                        {
1004 1033
                                            if (bCheck)
1034
                                            {
1005 1035
                                                dataRow["EqpGroupTag"] = string.Empty;
1036
                                                dataRow["MainLineTag"] = string.Empty;
1037
                                                dataRow["EGTConnectedPoint"] = 0;
1038
                                                dataRow["EGFlowDirection"] = string.Empty;
1039
                                            }
1006 1040

  
1007 1041
                                            if (dataRow.Field<string>("ViewPipeSystemNetwork_OID").Equals(lastP1))
1008 1042
                                            {
......
1021 1055
                                                break;
1022 1056
                                            }
1023 1057
                                            
1024
                                            dataRow["EqpGroupTag"] = string.Empty;                                           
1058
                                            dataRow["EqpGroupTag"] = string.Empty;
1059
                                            dataRow["MainLineTag"] = string.Empty;
1060
                                            dataRow["EGTConnectedPoint"] = 0;
1061
                                            dataRow["EGFlowDirection"] = string.Empty;
1062

  
1025 1063
                                        }
1026 1064
                                    }
1027 1065
                                }
......
1098 1136
                    List<DataRow> lstitem = new List<DataRow>();
1099 1137
                    foreach (DataRow dr in pathItemRows)
1100 1138
                    {
1139
                        if (dr["GROUPTAG"].ToString() == "Scope Break")
1140
                        {
1141
                            dr["GROUPTAG"] = string.Empty;
1142
                            keyValuePairs.Add(bCnt, lstitem.ToList());
1143
                            bCnt++;
1144
                            lstitem.Clear();
1145
                            continue;
1146
                        }
1147

  
1101 1148
                        if (!string.IsNullOrEmpty(dr["BranchTopologySet_OID"].ToString()))
1102 1149
                        {
1103 1150
                            DataRow[] rows = TopologySet.Select(string.Format("OID = '{0}'", dr["BranchTopologySet_OID"].ToString()));
1104
                            if (dr["GROUPTAG"].ToString() == "Scope Break")
1105
                            {
1106
                                dr["GROUPTAG"] = string.Empty;
1107
                                keyValuePairs.Add(bCnt, lstitem.ToList());
1108
                                bCnt++;
1109
                                lstitem.Clear();
1110
                            }
1111
                            else
1112
                            {
1151
                          
1152
                           
1113 1153
                                if (rows.First()["SubType"].ToString() != "Bypass" && rows.First()["SubType"].ToString() != "Vent_Drain")
1114 1154
                                {
1115 1155
                                    if (lstitem.ToList().Where(x => !string.IsNullOrEmpty(x.Field<string>("GROUPTAG"))).Count() > 0)
......
1129 1169
                                }
1130 1170
                                else
1131 1171
                                    lstitem.Add(dr);
1132
                            }
1172
                            
1133 1173
                        }
1134 1174
                        else
1135 1175
                            lstitem.Add(dr);
......
1194 1234
                            row["Pocket"] = "Yes";
1195 1235
                    }                    
1196 1236
                }
1237

  
1238
                tagpathItemRows = PathItems.Select(string.Format("GROUPTAG = 'Scope Break'"));
1239
                foreach (DataRow drPathitem in tagpathItemRows)
1240
                {
1241
                    drPathitem["GROUPTAG"] = string.Empty;
1242
                }
1197 1243
            }
1198 1244
            catch (Exception ex)
1199 1245
            {
......
1218 1264
                            if (!prevLineNumber.IsCopy)
1219 1265
                            {
1220 1266
                                prevLineNumber = prevLineNumber.Copy();
1267
                                prevLineNumber.MissingLineNumber1 = true;
1221 1268
                                item.Document.LineNumbers.Add(prevLineNumber);
1222
                                item.Document.MissingLineNumber1 = true;
1269
                                //item.LineNumber.MissingLineNumber1 = true;
1223 1270
                            }
1224 1271
                            item.Owner = prevLineNumber.UID;
1225 1272
                        }
......
1240 1287
                            if (!prevLineNumber.IsCopy)
1241 1288
                            {
1242 1289
                                prevLineNumber = prevLineNumber.Copy();
1290
                                prevLineNumber.MissingLineNumber1 = true;
1243 1291
                                item.Document.LineNumbers.Add(prevLineNumber);
1244
                                item.Document.MissingLineNumber1 = true;
1292
                                //item.LineNumber.MissingLineNumber1 = true;                                
1245 1293
                            }
1246 1294

  
1247 1295
                            item.Owner = prevLineNumber.UID;
......
1282 1330
                        cLineNumber = lineNumbers[index].Copy();
1283 1331
                    }
1284 1332

  
1333
                    cLineNumber.MissingLineNumber2 = true;
1285 1334
                    group.Document.LineNumbers.Add(cLineNumber);
1286 1335

  
1287 1336
                    foreach (Item item in group.Items)
1288 1337
                    {
1289
                        item.Owner = cLineNumber.UID;
1290
                        item.MissingLineNumber2 = true;
1338
                        item.Owner = cLineNumber.UID;                        
1291 1339
                    }
1292 1340
                }
1293 1341

  
......
1335 1383
                                if (attribute != null && !string.IsNullOrEmpty(attribute.Value))
1336 1384
                                {
1337 1385
                                    pipeLineID.Add(attribute.Value);//item.TopologyData += attribute.Value;
1338
                                    if (uid.Equals("Tag Seq No") && attribute.Value.ToString().Substring(attribute.Value.ToString().Length - 1, 1).Equals("V"))
1386
                                                                    //if (uid.Equals("Tag Seq No") && attribute.Value.ToString().Substring(attribute.Value.ToString().Length - 1, 1).Equals("V"))
1387
                                                                    //{
1388
                                    if (item.LineNumber.MissingLineNumber1 && item.LineNumber.MissingLineNumber2)
1339 1389
                                    {
1340
                                        if (item.Document.MissingLineNumber1)
1341
                                            item.MissingLineNumber1 = true;
1342
                                        else if (item.Document.MissingLineNumber2)
1343
                                            item.MissingLineNumber2 = true;
1390

  
1344 1391
                                    }
1392

  
1393
                                 
1394
                                    //    //if (item.Document.MissingLineNumber1)
1395
                                    //    //    item.MissingLineNumber1 = true;
1396
                                    //    //else if (item.Document.MissingLineNumber2)
1397
                                    //    //    item.MissingLineNumber2 = true;
1398
                                    //}
1345 1399
                                }
1346 1400
                            }
1347 1401
                        }
......
2152 2206
                        string sPSNData = string.Empty;
2153 2207
                        bool bVentDrain = false;
2154 2208

  
2155
                        List<Group> Groups = PSNItem.Groups;
2209
                      List<Group> Groups = PSNItem.Groups;
2156 2210
                        Dictionary<string, List<Item>> keyValuePairs = new Dictionary<string, List<Item>>();
2157 2211
                        List<Item> valveGroupingItem = new List<Item>();
2158 2212

  
......
2163 2217
                            for (int g = 0; g < Groups.Count; g++)
2164 2218
                            {
2165 2219
                                Group group = Groups[g];
2166
                                for (int i = 0; i < group.Items.Count; i++)
2220

  
2221
                                foreach (VentDrainInfo ventDrainInfo in VentDrainInfos)
2167 2222
                                {
2168
                                    Item item = group.Items[i];
2169
                                    foreach (VentDrainInfo ventDrainInfo in VentDrainInfos)
2223
                                    if(!bVentDrain)
2170 2224
                                    {
2171
                                        if (endInfos.Contains(ventDrainInfo))
2172
                                            continue;
2173

  
2174
                                        if (!ventDrainInfo.VentDrainItems[i].Name.Equals(item.Name))
2225
                                        for (int i = 0; i < group.Items.Count; i++)
2175 2226
                                        {
2176
                                            endInfos.Add(ventDrainInfo);
2177
                                            continue;
2178
                                        }
2227
                                            Item item = group.Items[i];
2228
                                            if (ventDrainInfo.VentDrainItems[endInfos.Count()].Name.Equals(item.Name))
2229
                                                endInfos.Add(ventDrainInfo);
2230
                                            else
2231
                                            {
2232
                                                endInfos.Clear();
2233
                                                if (ventDrainInfo.VentDrainItems[endInfos.Count()].Name.Equals(item.Name))
2234
                                                    endInfos.Add(ventDrainInfo);
2235
                                            }
2179 2236

  
2180
                                        if (ventDrainInfo.VentDrainItems.Count.Equals(i + 1))
2181
                                        {
2182
                                            bVentDrain = true;
2183
                                            break;
2237
                                            if (ventDrainInfo.VentDrainItems.Count().Equals(endInfos.Count()))
2238
                                            {
2239
                                                bVentDrain = true;
2240
                                                break;
2241
                                            }
2184 2242
                                        }
2185
                                    }
2186

  
2187
                                    if (bVentDrain || endInfos.Count.Equals(VentDrainInfos.Count))
2188
                                        break;
2189
                                }
2243
                                    }                                   
2244
                                }                               
2190 2245

  
2191 2246
                                if (!bVentDrain)
2192 2247
                                {
2193 2248
                                    endInfos = new List<VentDrainInfo>();
2194
                                    for (int i = 0; i < group.Items.Count; i++)
2249

  
2250
                                    foreach (VentDrainInfo ventDrainInfo in VentDrainInfos)
2195 2251
                                    {
2196
                                        Item item = group.Items[group.Items.Count - i - 1];
2197
                                        foreach (VentDrainInfo ventDrainInfo in VentDrainInfos)
2252
                                        if (!bVentDrain)
2198 2253
                                        {
2199
                                            if (endInfos.Contains(ventDrainInfo))
2200
                                                continue;
2201

  
2202
                                            if (!ventDrainInfo.VentDrainItems[i].Name.Equals(item.Name))
2254
                                            for (int i = 0; i < group.Items.Count; i++)
2203 2255
                                            {
2204
                                                endInfos.Add(ventDrainInfo);
2205
                                                continue;
2206
                                            }
2256
                                                Item item = group.Items[group.Items.Count - i - 1];
2207 2257

  
2208
                                            if (ventDrainInfo.VentDrainItems.Count.Equals(i + 1))
2209
                                            {
2210
                                                bVentDrain = true;
2211
                                                break;
2258
                                                if (ventDrainInfo.VentDrainItems[endInfos.Count()].Name.Equals(item.Name))
2259
                                                    endInfos.Add(ventDrainInfo);
2260
                                                else
2261
                                                {
2262
                                                    endInfos.Clear();
2263
                                                    if (ventDrainInfo.VentDrainItems[endInfos.Count()].Name.Equals(item.Name))
2264
                                                        endInfos.Add(ventDrainInfo);
2265
                                                }
2266

  
2267
                                                if (ventDrainInfo.VentDrainItems.Count().Equals(endInfos.Count()))
2268
                                                {
2269
                                                    bVentDrain = true;
2270
                                                    break;
2271
                                                }
2212 2272
                                            }
2213 2273
                                        }
2214

  
2215
                                        if (bVentDrain || endInfos.Count.Equals(VentDrainInfos.Count))
2216
                                            break;
2217 2274
                                    }
2218 2275
                                }
2219 2276
                            }
......
2440 2497

  
2441 2498
                                        string FROM_DATA = PSNItem.GetFromData(ref FromType, ref From_item);
2442 2499
                                        string status = string.Empty;
2443
                                        if (psnOrder == 0)
2444
                                        {
2445
                                            status = PSNItem.Status;
2446
                                        }
2500
                                        status = PSNItem.Status;                                      
2447 2501

  
2448 2502
                                        if (PSNItem.IsKeyword)
2449 2503
                                        {
......
2456 2510
                                        {
2457 2511
                                            PSNItem.EndType = PSNType.Equipment;
2458 2512
                                        }
2459

  
2460
                                        //if (Groups.Count == psnOrder + 1 && !string.IsNullOrEmpty(PSNItem.Status))
2461
                                        //{
2462
                                        if (!string.IsNullOrEmpty(PSNItem.Status))
2463
                                            status += PSNItem.Status;
2464
                                        //}
2465

  
2513
                                                   
2466 2514
                                        newRow["FROM_DATA"] = FROM_DATA;
2467 2515
                                        newRow["TO_DATA"] = TO_DATA;
2468
                                        //if(TO_DATA.Contains("Free Vent W-Screen") || TO_DATA.Contains("Empty LineNumber") || FROM_DATA.Contains("Empty LineNumber"))
2469
                                        //{
2470

  
2471
                                        //}
2516
                                       
2472 2517
                                        newRow["Type"] = PSNItem.GetPSNType();
2473 2518

  
2474
                                        if (psnOrder > 0)
2519
                                       
2520
                                        if(psnOrder == 0) //order 0일땐 그냥 붙여줌
2521
                                        {
2522
                                            if (!string.IsNullOrEmpty(PSNItem.Status)) //to에 status가 있다면
2523
                                            {
2524
                                                status += PSNItem.Status;
2525
                                            }                                            
2526
                                        }
2527
                                        else if (psnOrder > 0) //0보다 크면 
2475 2528
                                        {
2476 2529
                                            DataRow dr = pipeSystemNetworkDT.Select(string.Format("OID = '{0}' AND OrderNumber = {1}", PSNItem.PSN_OID(), psnOrder - 1)).FirstOrDefault();
2477
                                            if (!string.IsNullOrEmpty(PSNItem.Status))
2478
                                            {//status = !string.IsNullOrEmpty(status) ? status.Remove(0, 2) : string.Empty;
2479
                                                if (dr["Status"].ToString().Contains(PSNItem.Status))
2480
                                                    dr["Status"] = dr["Status"].ToString().Replace(PSNItem.Status, string.Empty);
2481
                                                else if (dr["Status"].ToString().Contains(PSNItem.Status.Remove(0, 2)))
2482
                                                    dr["Status"] = dr["Status"].ToString().Replace(PSNItem.Status.Remove(0, 2), string.Empty);
2483

  
2530
                                            if (psnOrder == 1) //1이면 0번 Order에 From Status 값만 남김 
2531
                                            {
2532
                                                dr["Status"] = !string.IsNullOrEmpty(status) ? status.Remove(0, 2) : string.Empty; //status;
2484 2533
                                            }
2485

  
2486
                                            if (dr != null)
2534
                                            if (psnOrder > 1) // 2 -> 1 3->2 엔 status 값 삭제
2487 2535
                                            {
2488
                                                newRow["FROM_DATA"] = dr.Field<string>("FROM_DATA");
2489
                                                newRow["TO_DATA"] = dr.Field<string>("TO_DATA");
2490
                                                newRow["Type"] = dr.Field<string>("Type");
2536
                                                dr["Status"] = string.Empty;
2491 2537
                                            }
2538

  
2539
                                            status = PSNItem.Status;
2540
                                            //if (dr != null)
2541
                                            //{
2542
                                            //    newRow["FROM_DATA"] = dr.Field<string>("FROM_DATA");
2543
                                            //    newRow["TO_DATA"] = dr.Field<string>("TO_DATA");
2544
                                            //    newRow["Type"] = dr.Field<string>("Type");
2545
                                            //}
2492 2546
                                        }
2493 2547

  
2548
                                        
2549
                                    
2494 2550
                                        status = !string.IsNullOrEmpty(status) ? status.Remove(0, 2) : string.Empty;
2495
                                        if (group.Items.Count == 1 && !string.IsNullOrEmpty(status))
2551
                                        string[] st = status.Split(new string[] { ", " }, StringSplitOptions.None);
2552
                                        if (st.Count() > 1)
2496 2553
                                        {
2497
                                            MatchCollection matches = Regex.Matches(status, "Missing LineNumber_1");
2498
                                            int cnt = matches.Count;
2499
                                            if (cnt > 1)
2500
                                                status.Replace(", Missing LineNumber_1", string.Empty);
2554
                                            status = string.Join(", ", st.Distinct());                                                                                     
2501 2555
                                        }
2502 2556
                                        newRow["TopologySet_OID_Key"] = item.Topology.FullName;
2503 2557
                                        newRow["PSNRevisionNumber"] = string.Format("V{0:D4}", Revision);
......
2977 3031
                    {
2978 3032
                        ddr["IncludingVirtualData"] = "Yes";
2979 3033
                        ddr["PSNAccuracy"] = String.Format("{0:0.00}", Math.Round(totalDdr, 2));
3034
                        ddr["IsValid"] = "Error";
2980 3035
                    }
2981 3036
                }
2982 3037
                else
......
3169 3224
                        {
3170 3225
                            string TO_DATA = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex);
3171 3226

  
3172
                           
3227
                            
3173 3228
                            foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID())))
3174 3229
                            {
3175 3230
                                loopRow["TO_DATA"] = TO_DATA;
......
3187 3242
                                            loopRow["IsValid"] = "Error";
3188 3243
                                    }
3189 3244
                                }
3245

  
3190 3246
                            }                            
3191 3247

  
3192 3248
                            tieInPointIndex++;
......
3554 3610
                    if (item.Relations.First().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.First().Item.LineNumber.Name))
3555 3611
                    {
3556 3612
                        result = item.Relations.First().Item.LineNumber.Name;
3557
                        if (item.MissingLineNumber2)
3613
                        if (item.Relations.First().Item.LineNumber.MissingLineNumber2)
3558 3614
                        {
3559 3615
                            Status += ", Missing LineNumber_2";
3560 3616
                            IsValid = "Error";
3561 3617
                        }
3562
                        if (item.MissingLineNumber1)
3618
                        if (item.Relations.First().Item.LineNumber.MissingLineNumber1)
3563 3619
                        {
3564 3620
                            Status += ", Missing LineNumber_1";
3565 3621
                            IsValid = "Error";
......
3608 3664
                    }
3609 3665
                    else if (item.ItemType == ItemType.Line)
3610 3666
                    {
3611

  
3612 3667
                        if (item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name))
3613 3668
                        {
3614 3669
                            result = item.LineNumber.Name;
3615
                            if (item.MissingLineNumber2)
3670
                            if (item.LineNumber.MissingLineNumber2)
3616 3671
                            {
3617 3672
                                Status += ", Missing LineNumber_2";
3618 3673
                                IsValid = "Error";
3619 3674
                            }
3620
                            if (item.MissingLineNumber1)
3675
                            if (item.LineNumber.MissingLineNumber1)
3621 3676
                            {
3622 3677
                                Status += ", Missing LineNumber_1";
3623 3678
                                IsValid = "Error";
......
3691 3746
                if (item.Relations.Last().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.Last().Item.LineNumber.Name))
3692 3747
                {
3693 3748
                    result = item.Relations.Last().Item.LineNumber.Name;
3694
                    if (item.MissingLineNumber2)
3749
                    if (item.Relations.Last().Item.LineNumber.MissingLineNumber2)
3695 3750
                    {
3696 3751
                        Status += ", Missing LineNumber_2";
3697 3752
                        IsValid = "Error";
3698 3753
                    }
3699
                    if (item.MissingLineNumber1)
3754
                    if (item.Relations.Last().Item.LineNumber.MissingLineNumber1)
3700 3755
                    {
3701 3756
                        Status += ", Missing LineNumber_1";
3702 3757
                        IsValid = "Error";
......
3749 3804
                    if (item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name))
3750 3805
                    {
3751 3806
                        result = item.LineNumber.Name;
3752
                        if (item.MissingLineNumber2)
3807
                        if (item.LineNumber.MissingLineNumber2)
3753 3808
                        {
3754 3809
                            Status += ", Missing LineNumber_2";
3755 3810
                            IsValid = "Error";
3756 3811
                        }
3757
                        if (item.MissingLineNumber1)
3812
                        if (item.LineNumber.MissingLineNumber1)
3758 3813
                        {
3759 3814
                            Status += ", Missing LineNumber_1";
3760 3815
                            IsValid = "Error";

내보내기 Unified diff

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