개정판 531fb158
issue #000: PipeSystem 추가
Change-Id: I0ac2e32fed334f7206ba2874aab3e33b7376a0e6
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
42 | 42 |
public DataTable Equipment { get; set; } |
43 | 43 |
public DataTable Nozzle { get; set; } |
44 | 44 |
public DataTable PipeLine { get; set; } |
45 |
public DataTable PipeSystem { get; set; } |
|
45 | 46 |
|
46 | 47 |
public string Rule1 = "Missing LineNumber_1"; //Line Disconnected에서 변경 |
47 | 48 |
public string Rule2 = "Missing LineNumber_2"; //Missing LineNumber에서 변경 |
... | ... | |
1139 | 1140 |
pipelineDT.Columns.Add("TO_DATA", typeof(string)); |
1140 | 1141 |
pipelineDT.Columns.Add("Unit", typeof(string)); |
1141 | 1142 |
|
1143 |
DataTable pipesystemDT = new DataTable(); |
|
1144 |
pipesystemDT.Columns.Add("OID", typeof(string)); |
|
1145 |
pipesystemDT.Columns.Add("DESCRIPTION", typeof(string)); |
|
1146 |
pipesystemDT.Columns.Add("FLUID", typeof(string)); |
|
1147 |
pipesystemDT.Columns.Add("PMC", typeof(string)); |
|
1148 |
pipesystemDT.Columns.Add("PipeLineQty", typeof(string)); |
|
1149 |
pipesystemDT.Columns.Add("GroundLevel", typeof(string)); |
|
1150 |
|
|
1142 | 1151 |
// Set Vent/Drain Info |
1143 | 1152 |
List<VentDrainInfo> VentDrainInfos = new List<VentDrainInfo>(); |
1144 | 1153 |
DataTable dt = DB.SelectVentDrainSetting(); |
... | ... | |
1204 | 1213 |
// key = 미입력 branch |
1205 | 1214 |
Dictionary<Item, Item> startBranchDic = new Dictionary<Item, Item>(); |
1206 | 1215 |
Dictionary<Item, Item> endBranchDic = new Dictionary<Item, Item>(); |
1207 |
int vgTagNum = 0; |
|
1216 |
DataTable PSNFluidDT = DB.SelectPSNFluidCode(); |
|
1217 |
DataTable PSNPMCDT = DB.SelectPSNPIPINGMATLCLASS(); |
|
1208 | 1218 |
foreach (PSNItem PSNItem in PSNItems) |
1209 | 1219 |
{ |
1210 | 1220 |
try |
... | ... | |
1217 | 1227 |
|
1218 | 1228 |
List<Group> Groups = PSNItem.Groups; |
1219 | 1229 |
Dictionary<string, List<Item>> keyValuePairs = new Dictionary<string, List<Item>>(); |
1220 |
List<Item> valveGroupingItem = new List<Item>(); |
|
1221 |
int bCnt = 0; |
|
1222 |
|
|
1223 |
int beforeCnt = 0; |
|
1224 |
bool bCheck = false; |
|
1225 |
//foreach (Group group in Groups) |
|
1226 |
//{ |
|
1227 |
// IEnumerable<Item> items = null; |
|
1228 |
// foreach (ValveGroupItem valveitem in ValveGrouping.ValveGroupItems) |
|
1229 |
// { |
|
1230 |
// beforeCnt = bCnt; |
|
1231 |
// items = group.Items.Where(x => x.ItemType == ItemType.Symbol && x.Name == valveitem.SppidSymbolName); |
|
1232 |
|
|
1233 |
// if (items.Count() > 0) |
|
1234 |
// { |
|
1235 |
// List<Item> lstitem = new List<Item>(); |
|
1236 |
// foreach (Item item in group.Items) |
|
1237 |
// { |
|
1238 |
// lstitem.Add(item); |
|
1239 |
// if (item.BranchItems.Count > 0) |
|
1240 |
// { |
|
1241 |
// bCheck = true; |
|
1242 |
// foreach (Item it in lstitem) |
|
1243 |
// { |
|
1244 |
// if(it.Name == valveitem.SppidSymbolName) |
|
1245 |
// { |
|
1246 |
// //List<Item> allitem = ; |
|
1247 |
// keyValuePairs.Add(valveitem.OID, lstitem.ToList()); |
|
1248 |
// bCnt++; |
|
1249 |
// } |
|
1250 |
// } |
|
1251 |
|
|
1252 |
// lstitem.Clear(); |
|
1253 |
// } |
|
1254 |
// } |
|
1255 |
|
|
1256 |
// if(!bCheck) |
|
1257 |
// { |
|
1258 |
// keyValuePairs.Add(valveitem.OID, lstitem); |
|
1259 |
// bCnt++; |
|
1260 |
// } |
|
1261 |
// if (items.Count() == bCnt - beforeCnt) |
|
1262 |
// continue; |
|
1263 |
// } |
|
1264 |
// } |
|
1265 |
//} |
|
1266 |
|
|
1230 |
List<Item> valveGroupingItem = new List<Item>(); |
|
1267 | 1231 |
|
1268 | 1232 |
//VentDrain 검사 |
1269 | 1233 |
if (PSNItem.Groups.Count.Equals(1)) |
... | ... | |
1329 | 1293 |
} |
1330 | 1294 |
|
1331 | 1295 |
try |
1332 |
{ |
|
1333 |
// Prefix + "-" + 선택한 Attribute 값으로 VG Tag 생성 |
|
1334 |
//-> Use ID2 Attribute는 No selection으로 콤보 박스에 포함시키고, 그런 경우 Prefix +"-XXXXX"로 자동 넘버 생성 |
|
1335 |
//PSN, PathItems, SequenceData 관련 |
|
1336 |
|
|
1296 |
{ |
|
1337 | 1297 |
foreach (Group group in PSNItem.Groups) |
1338 |
{ |
|
1339 |
//IEnumerable<Item> bFindBranch = group.Items.Where(x => x.BranchItems.Count() > 0); |
|
1340 |
|
|
1298 |
{ |
|
1341 | 1299 |
foreach (Item item in group.Items) |
1342 |
{ |
|
1343 |
//string VGTag = string.Empty; |
|
1344 |
//if (keyValuePairs.Count > 0) |
|
1345 |
//{ |
|
1346 |
// foreach(KeyValuePair<string, List<Item>> valuePair in keyValuePairs) |
|
1347 |
// { |
|
1348 |
// if(valuePair.Value.Select(x => x.UID == item.UID).Count() > 0) |
|
1349 |
// { |
|
1350 |
|
|
1351 |
// ValveGroupItem valveitem = ValveGrouping.ValveGroupItems.Where(x => x.OID == valuePair.Key).First(); |
|
1352 |
// if(valveitem.AttributeName == "NoSelection") |
|
1353 |
// { |
|
1354 |
// VGTag = valveitem.TagIdentifier + string.Format("-{0}", string.Format("{0:D5}", vgTagNum)); |
|
1355 |
// vgTagNum++; |
|
1356 |
// } |
|
1357 |
// else |
|
1358 |
// { |
|
1359 |
// Item attValue = valuePair.Value.Where(x => x.Name == valveitem.SppidSymbolName).First(); |
|
1360 |
// string value = attValue.Attributes.Find(x => x.Name == valveitem.AttributeName).Value; |
|
1361 |
// VGTag = valveitem.TagIdentifier +"-"+ value; |
|
1362 |
// } |
|
1363 |
// } |
|
1364 |
// } |
|
1365 |
//} |
|
1366 |
|
|
1300 |
{ |
|
1367 | 1301 |
string VgTag = string.Empty; |
1368 | 1302 |
if (ValveGrouping.ValveGroupItems.Where(x => x.SppidSymbolName == item.Name).Count() >0) |
1369 | 1303 |
{ |
... | ... | |
1404 | 1338 |
} |
1405 | 1339 |
|
1406 | 1340 |
if (bPSNStart) |
1407 |
{ |
|
1408 |
|
|
1341 |
{ |
|
1409 | 1342 |
CreatePipeSystemNetworkDataRow(); |
1410 | 1343 |
sPSNData = item.TopologyData; |
1411 | 1344 |
//i |
... | ... | |
1502 | 1435 |
if (!string.IsNullOrEmpty(INSULATION)) oid.Add(INSULATION); |
1503 | 1436 |
|
1504 | 1437 |
string OID = string.Join("-", oid); |
1438 |
string FluidCodeGL = string.Empty; |
|
1439 |
string PMCGL = string.Empty; |
|
1440 |
|
|
1505 | 1441 |
|
1506 | 1442 |
if (pipelineDT.Select(string.Format("OID = '{0}'", OID)).Count() == 0) |
1507 | 1443 |
{ |
... | ... | |
1515 | 1451 |
newPipelineRow["FROM_DATA"] = string.Empty; |
1516 | 1452 |
newPipelineRow["TO_DATA"] = string.Empty; |
1517 | 1453 |
newPipelineRow["Unit"] = PSNItem.GetPBSData(); |
1518 |
pipelineDT.Rows.Add(newPipelineRow); |
|
1454 |
pipelineDT.Rows.Add(newPipelineRow); |
|
1455 |
} |
|
1456 |
|
|
1457 |
if (pipesystemDT.Select(string.Format("OID = '{0}'", PipeSystem_OID)).Count() == 0) |
|
1458 |
{ |
|
1459 |
//DataRow newPipesystemRow = pipesystemDT.NewRow(); |
|
1460 |
//newPipesystemRow["OID"] = PipeSystem_OID; |
|
1461 |
//newPipesystemRow["DESCRIPTION"] = string.Empty; |
|
1462 |
//newPipesystemRow["FLUID"] = FluidCode; |
|
1463 |
//newPipesystemRow["PMC"] = PMC; |
|
1464 |
//newPipesystemRow["PipeLineQty"] = string.Empty; |
|
1465 |
//string GroundLevel = string.Empty; |
|
1466 |
//if (!string.IsNullOrEmpty(FluidCode) && !string.IsNullOrEmpty(PMC)) |
|
1467 |
//{ |
|
1468 |
// FluidCodeGL = PSNFluidDT.Select(string.Format("Code = '{0}'", FluidCode)).FirstOrDefault().Field<string>("GroundLevel"); |
|
1469 |
// PMCGL = PSNPMCDT.Select(string.Format("Code= '{0}'", PMC)).FirstOrDefault().Field<string>("GroundLevel"); |
|
1470 |
// if (FluidCodeGL == "AG" && PMCGL == "AG") |
|
1471 |
// GroundLevel = "AG"; |
|
1472 |
// else if (FluidCodeGL == "UG" && PMCGL == "UG") |
|
1473 |
// GroundLevel = "UG"; |
|
1474 |
// else |
|
1475 |
// GroundLevel = "AG_UG"; |
|
1476 |
//} |
|
1477 |
//newPipesystemRow["GroundLevel"] = GroundLevel; |
|
1478 |
|
|
1479 |
//pipesystemDT.Rows.Add(newPipesystemRow); |
|
1519 | 1480 |
} |
1520 | 1481 |
} |
1521 | 1482 |
} |
... | ... | |
1745 | 1706 |
PipeSystemNetwork = pipeSystemNetworkDT; |
1746 | 1707 |
TopologySet = topologySetDT; |
1747 | 1708 |
PipeLine = pipelineDT; |
1709 |
PipeSystem = pipesystemDT; |
|
1748 | 1710 |
} |
1749 | 1711 |
catch (Exception ex) |
1750 | 1712 |
{ |
내보내기 Unified diff