개정판 48870200
issue #000: status
Change-Id: I78e59d697baf8f4f2987e44da7c223ac2e9ccdf3
DTI_PID/ID2PSN/Object/Item.cs | ||
---|---|---|
49 | 49 |
public Group Group { get; set; } |
50 | 50 |
public PSNItem PSNItem { get; set; } |
51 | 51 |
public LineNumber LineNumber { get; set; } |
52 |
public bool MissingLineNumber { get; set; } |
|
52 |
public bool MissingLineNumber1 { get; set; } |
|
53 |
public bool MissingLineNumber2 { get; set; } |
|
53 | 54 |
public Equipment Equipment { get; set; } |
54 | 55 |
public Document Document { get; set; } |
55 | 56 |
public string Keyword { get; set; } |
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
260 | 260 |
if (!prevLineNumber.IsCopy) |
261 | 261 |
{ |
262 | 262 |
prevLineNumber = prevLineNumber.Copy(); |
263 |
item.Document.LineNumbers.Add(prevLineNumber); |
|
263 |
item.Document.LineNumbers.Add(prevLineNumber); |
|
264 |
item.MissingLineNumber1 = true; |
|
264 | 265 |
} |
265 | 266 |
item.Owner = prevLineNumber.UID; |
266 | 267 |
} |
... | ... | |
282 | 283 |
{ |
283 | 284 |
prevLineNumber = prevLineNumber.Copy(); |
284 | 285 |
item.Document.LineNumbers.Add(prevLineNumber); |
286 |
item.MissingLineNumber1 = true; |
|
285 | 287 |
} |
286 | 288 |
|
287 | 289 |
item.Owner = prevLineNumber.UID; |
... | ... | |
304 | 306 |
foreach (Item item in group.Items) |
305 | 307 |
{ |
306 | 308 |
item.Owner = cLineNumber.UID; |
307 |
item.MissingLineNumber = true; |
|
308 |
} |
|
309 |
|
|
310 |
|
|
309 |
item.MissingLineNumber2 = true; |
|
310 |
} |
|
311 | 311 |
} |
312 | 312 |
} |
313 | 313 |
|
... | ... | |
349 | 349 |
|
350 | 350 |
item.PSNPipeLineID = string.Join("-", pipeLineID); |
351 | 351 |
item.TopologyData = string.Join("-", pipeLineID); |
352 |
item.MissingLineNumber = false; |
|
352 |
|
|
353 | 353 |
} |
354 | 354 |
else |
355 | 355 |
{ |
... | ... | |
1349 | 1349 |
} |
1350 | 1350 |
} |
1351 | 1351 |
|
1352 |
status = !string.IsNullOrEmpty(status) ? status.Remove(0, 2) : string.Empty; |
|
1353 |
if (group.Items.Count == 1 && !string.IsNullOrEmpty(status)) |
|
1354 |
{ |
|
1355 |
MatchCollection matches = Regex.Matches(status, "Missing LineNumber_1"); |
|
1356 |
int cnt = matches.Count; |
|
1357 |
if (cnt > 1) |
|
1358 |
status.Replace(", Missing LineNumber_1", string.Empty); |
|
1359 |
} |
|
1352 | 1360 |
newRow["TopologySet_OID_Key"] = item.Topology.FullName; |
1353 | 1361 |
newRow["PSNRevisionNumber"] = string.Format("V{0:D4}", Revision); |
1354 | 1362 |
|
1363 |
|
|
1355 | 1364 |
newRow["IsValid"] = PSNItem.IsValid; |
1356 |
newRow["Status"] = !string.IsNullOrEmpty(status) ? status.Remove(0, 2) : string.Empty;
|
|
1365 |
newRow["Status"] = status;
|
|
1357 | 1366 |
newRow["PBS"] = PSNItem.GetPBSData(); |
1358 | 1367 |
|
1359 | 1368 |
List<string> drawingNames = new List<string>(); |
... | ... | |
1850 | 1859 |
try |
1851 | 1860 |
{ |
1852 | 1861 |
string FROM_DATA = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex); |
1853 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
1854 |
{ |
|
1855 |
loopRow["FROM_DATA"] = FROM_DATA; |
|
1856 |
if(loopRow.Field<string>("OrderNumber") == "0") |
|
1857 |
{ |
|
1858 |
string status = loopRow.Field<string>("Status"); |
|
1859 |
if (string.IsNullOrEmpty(status)) |
|
1860 |
status = "Line Disconnected"; |
|
1861 |
else if (!status.Contains("Line Disconnected")) |
|
1862 |
status += ", Line Disconnected"; |
|
1863 |
loopRow["Status"] = status; |
|
1864 |
} |
|
1865 |
} |
|
1862 |
|
|
1866 | 1863 |
tieInPointIndex++; |
1867 | 1864 |
|
1868 | 1865 |
|
... | ... | |
1870 | 1867 |
{ |
1871 | 1868 |
PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First(), FROM_DATA), insertIndex); |
1872 | 1869 |
bCount = 2; |
1870 |
|
|
1871 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
1872 |
{ |
|
1873 |
loopRow["FROM_DATA"] = FROM_DATA; |
|
1874 |
if (loopRow.Field<string>("OrderNumber") == "0") |
|
1875 |
{ |
|
1876 |
string status = loopRow.Field<string>("Status"); |
|
1877 |
if (string.IsNullOrEmpty(status)) |
|
1878 |
status = "Line Disconnected"; |
|
1879 |
else if (!status.Contains("Line Disconnected")) |
|
1880 |
status += ", Line Disconnected"; |
|
1881 |
loopRow["Status"] = status; |
|
1882 |
} |
|
1883 |
} |
|
1873 | 1884 |
} |
1874 | 1885 |
else |
1875 | 1886 |
{ |
... | ... | |
1899 | 1910 |
{ |
1900 | 1911 |
string TO_DATA = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex); |
1901 | 1912 |
|
1902 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID())))
|
|
1913 |
if (item.ItemType == ItemType.Line)
|
|
1903 | 1914 |
{ |
1904 |
loopRow["TO_DATA"] = TO_DATA; |
|
1905 |
if (loopRow.Field<string>("OrderNumber") == Convert.ToString(PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID())).Count() - 1)) |
|
1915 |
foreach (DataRow loopRow in PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()))) |
|
1906 | 1916 |
{ |
1907 |
string status = loopRow.Field<string>("Status"); |
|
1908 |
if (string.IsNullOrEmpty(status)) |
|
1909 |
status = "Line Disconnected"; |
|
1910 |
else if (!status.Contains("Line Disconnected")) |
|
1911 |
status += ", Line Disconnected"; |
|
1912 |
loopRow["Status"] = status; |
|
1917 |
loopRow["TO_DATA"] = TO_DATA; |
|
1918 |
if (loopRow.Field<string>("OrderNumber") == Convert.ToString(PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID())).Count() - 1)) |
|
1919 |
{ |
|
1920 |
string status = loopRow.Field<string>("Status"); |
|
1921 |
if (string.IsNullOrEmpty(status)) |
|
1922 |
status = "Line Disconnected"; |
|
1923 |
else if (!status.Contains("Line Disconnected")) |
|
1924 |
status += ", Line Disconnected"; |
|
1925 |
loopRow["Status"] = status; |
|
1926 |
} |
|
1913 | 1927 |
} |
1914 | 1928 |
} |
1915 |
|
|
1929 |
|
|
1916 | 1930 |
tieInPointIndex++; |
1917 | 1931 |
|
1918 | 1932 |
if(!bCheck) |
... | ... | |
2284 | 2298 |
else if (StartType == PSNType.Branch) |
2285 | 2299 |
{ |
2286 | 2300 |
item = Groups.First().Items.First(); |
2287 |
if (!item.MissingLineNumber && item.Relations.First().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.First().Item.LineNumber.Name)) |
|
2301 |
//if (!item.MissingLineNumber && item.Relations.First().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.First().Item.LineNumber.Name)) |
|
2302 |
if(!item.MissingLineNumber2) |
|
2288 | 2303 |
result = item.Relations.First().Item.LineNumber.Name; |
2289 | 2304 |
else |
2290 | 2305 |
{ |
2291 | 2306 |
Status += ", Missing LineNumber_2"; |
2292 | 2307 |
result = "Empty LineNumber"; |
2293 | 2308 |
} |
2309 |
|
|
2310 |
//if (item.MissingLineNumber1) |
|
2311 |
//{ |
|
2312 |
// Status += ", Missing LineNumber_1"; |
|
2313 |
// result = item.MissingLineNumber1 && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
2314 |
|
|
2315 |
//} |
|
2294 | 2316 |
} |
2295 | 2317 |
else if (StartType == PSNType.Equipment) |
2296 | 2318 |
{ |
... | ... | |
2300 | 2322 |
|
2301 | 2323 |
if (drNozzle != null) |
2302 | 2324 |
result += " ["+ drNozzle.Field<string>("ITEMTAG") + "]"; |
2303 |
} |
|
2304 |
|
|
2325 |
} |
|
2305 | 2326 |
else |
2306 | 2327 |
{ |
2307 | 2328 |
IsValid = "Error"; |
... | ... | |
2331 | 2352 |
} |
2332 | 2353 |
else if (item.ItemType == ItemType.Line) |
2333 | 2354 |
{ |
2334 |
Status += ", Missing LineNumber_1"; |
|
2335 |
result = !item.MissingLineNumber && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
2355 |
if (item.MissingLineNumber1) |
|
2356 |
{ |
|
2357 |
Status += ", Missing LineNumber_1"; |
|
2358 |
result = item.MissingLineNumber1 && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
2359 |
} |
|
2336 | 2360 |
} |
2337 | 2361 |
else |
2338 | 2362 |
result = "Unknown"; |
2363 |
|
|
2339 | 2364 |
} |
2340 | 2365 |
} |
2341 | 2366 |
catch(Exception ex) |
... | ... | |
2392 | 2417 |
else if (EndType == PSNType.Branch) |
2393 | 2418 |
{ |
2394 | 2419 |
item = Groups.Last().Items.Last(); |
2395 |
if (!item.MissingLineNumber && item.Relations.Last().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.Last().Item.LineNumber.Name)) |
|
2420 |
//if (!item.MissingLineNumber && item.Relations.Last().Item.LineNumber != null && !string.IsNullOrEmpty(item.Relations.Last().Item.LineNumber.Name)) |
|
2421 |
if (!item.MissingLineNumber2) |
|
2396 | 2422 |
result = item.Relations.Last().Item.LineNumber.Name; |
2397 | 2423 |
else |
2398 | 2424 |
{ |
2399 | 2425 |
Status += ", Missing LineNumber_2"; |
2400 | 2426 |
result = "Empty LineNumber"; |
2401 | 2427 |
} |
2428 |
|
|
2429 |
//if (item.MissingLineNumber1) |
|
2430 |
//{ |
|
2431 |
// Status += ", Missing LineNumber_1"; |
|
2432 |
// result = item.MissingLineNumber1 && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
2433 |
|
|
2434 |
//} |
|
2402 | 2435 |
} |
2403 | 2436 |
else if (EndType == PSNType.Equipment) |
2404 | 2437 |
{ |
... | ... | |
2438 | 2471 |
} |
2439 | 2472 |
else if (item.ItemType == ItemType.Line) |
2440 | 2473 |
{ |
2441 |
Status += ", Missing LineNumber_1"; |
|
2442 |
result = !item.MissingLineNumber && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
2474 |
if (item.MissingLineNumber1) |
|
2475 |
{ |
|
2476 |
Status += ", Missing LineNumber_1"; |
|
2477 |
result = item.MissingLineNumber1 && item.LineNumber != null && !string.IsNullOrEmpty(item.LineNumber.Name) ? item.LineNumber.Name : "Empty LineNumber"; |
|
2478 |
} |
|
2443 | 2479 |
} |
2444 | 2480 |
else |
2445 | 2481 |
result = "Unknown"; |
2482 |
|
|
2483 |
|
|
2446 | 2484 |
} |
2485 |
|
|
2447 | 2486 |
|
2448 | 2487 |
|
2449 | 2488 |
return result; |
내보내기 Unified diff