개정판 bf9e8432
issue #000: Air Fin Cooler DB 추가
Change-Id: I5087c70080087b172c3f2143c10c8e1d0d79f242
DTI_PID/ID2PSN/DB.cs | ||
---|---|---|
322 | 322 |
dicColCheck.Add("PipeRun_OID", "NVARCHAR(255)"); |
323 | 323 |
dicColCheck.Add("ViewPipeSystemNetwork_OID", "NVARCHAR(255)"); |
324 | 324 |
|
325 |
dicColCheck.Add("EqpGroupTag", "NVARCHAR(255)"); |
|
326 |
dicColCheck.Add("MainLineTag", "NVARCHAR(255)"); |
|
327 |
|
|
328 |
dicColCheck.Add("EGTConnectedPoint", "INT"); |
|
329 |
dicColCheck.Add("EGFlowDirection", "NVARCHAR(10)"); |
|
330 |
|
|
325 | 331 |
if (matched == null) |
326 | 332 |
{ |
327 | 333 |
var query = $"CREATE TABLE {PSN_PATHITEMS} (OID NVARCHAR(255), SequenceData_OID NVARCHAR(255), " + |
328 | 334 |
"TopologySet_OID NVARCHAR(255), BranchTopologySet_OID NVARCHAR(255), PipeLine_OID NVARCHAR(255), ItemName NVARCHAR(255), ItemTag NVARCHAR(255), DESCRIPTION NVARCHAR(255), " + |
329 | 335 |
"CLASS NVARCHAR(255), SUBCLASS NVARCHAR(255), TYPE NVARCHAR(255), PIDNAME NVARCHAR(255), Equipment_OID NVARCHAR(255), NPD NVARCHAR(255), GROUPTAG NVARCHAR(255), PipeSystemNetwork_OID NVARCHAR(255), PipeRun_OID NVARCHAR(255), " + |
330 |
"ViewPipeSystemNetwork_OID NVARCHAR(255))"; |
|
336 |
"ViewPipeSystemNetwork_OID NVARCHAR(255), EqpGroupTag NVARCHAR(255), MainLineTag NVARCHAR(255), EGTConnectedPoint INT, EGFlowDirection NVARCHAR(10))";
|
|
331 | 337 |
using (var cmd = connection.GetSqlStringCommand(query)) |
332 | 338 |
{ |
333 | 339 |
cmd.ExecuteNonQuery(); |
... | ... | |
1758 | 1764 |
DataRow row = item.PathItems.Rows[i]; |
1759 | 1765 |
query = $"INSERT INTO {PSN_PATHITEMS} " + |
1760 | 1766 |
$"(OID, SequenceData_OID, TopologySet_OID, BranchTopologySet_OID, PipeLine_OID, ItemName, ItemTag, DESCRIPTION, CLASS, SUBCLASS, TYPE, " + |
1761 |
$"PIDNAME, Equipment_OID, NPD, GROUPTAG, PipeSystemNetwork_OID, PipeRun_OID, ViewPipeSystemNetwork_OID) VALUES " + |
|
1767 |
$"PIDNAME, Equipment_OID, NPD, GROUPTAG, PipeSystemNetwork_OID, PipeRun_OID, ViewPipeSystemNetwork_OID, EqpGroupTag, MainLineTag, EGTConnectedPoint, EGFlowDirection) VALUES " +
|
|
1762 | 1768 |
$"(@OID, @SequenceData_OID, @TopologySet_OID, @BranchTopologySet_OID, @PipeLine_OID, @ITEMNAME, @ITEMTAG, @DESCRIPTION, @Class, @SubClass, @TYPE, @PIDNAME, " + |
1763 |
$"@Equipment_OID, @NPD, @GROUPTAG, @PipeSystemNetwork_OID,@PipeRun_OID, @ViewPipeSystemNetwork_OID)"; |
|
1769 |
$"@Equipment_OID, @NPD, @GROUPTAG, @PipeSystemNetwork_OID,@PipeRun_OID, @ViewPipeSystemNetwork_OID, @EqpGroupTag , @MainLineTag, @EGTConnectedPoint, @EGFlowDirection)";
|
|
1764 | 1770 |
var cmd = connection.GetSqlStringCommand(query); |
1765 | 1771 |
AddWithValue(cmd, "@OID", string.IsNullOrEmpty(row["OID"].ToString()) ? "" : row["OID"].ToString()); |
1766 | 1772 |
AddWithValue(cmd, "@SequenceData_OID", string.IsNullOrEmpty(row["SequenceData_OID"].ToString()) ? "" : row["SequenceData_OID"].ToString()); |
... | ... | |
1780 | 1786 |
AddWithValue(cmd, "@PipeSystemNetwork_OID", string.IsNullOrEmpty(row["PipeSystemNetwork_OID"].ToString()) ? "" : row["PipeSystemNetwork_OID"].ToString()); |
1781 | 1787 |
AddWithValue(cmd, "@ViewPipeSystemNetwork_OID", string.IsNullOrEmpty(row["ViewPipeSystemNetwork_OID"].ToString()) ? "" : row["ViewPipeSystemNetwork_OID"].ToString()); |
1782 | 1788 |
AddWithValue(cmd, "@PipeRun_OID", string.IsNullOrEmpty(row["PipeRun_OID"].ToString()) ? "" : row["PipeRun_OID"].ToString()); |
1789 |
AddWithValue(cmd, "@EqpGroupTag", string.IsNullOrEmpty(row["EqpGroupTag"].ToString()) ? "" : row["EqpGroupTag"].ToString()); |
|
1790 |
AddWithValue(cmd, "@MainLineTag", string.IsNullOrEmpty(row["MainLineTag"].ToString()) ? "" : row["MainLineTag"].ToString()); |
|
1791 |
|
|
1792 |
AddWithValue(cmd, "@EGTConnectedPoint", string.IsNullOrEmpty(row["EGTConnectedPoint"].ToString()) ? "0" : row["EGTConnectedPoint"].ToString()); |
|
1793 |
AddWithValue(cmd, "@EGFlowDirection", string.IsNullOrEmpty(row["EGFlowDirection"].ToString()) ? "" : row["EGFlowDirection"].ToString()); |
|
1783 | 1794 |
connection.ExecuteNonQuery(cmd, txn); |
1784 | 1795 |
} |
1785 | 1796 |
|
... | ... | |
2808 | 2819 |
dicColCheck.Add("PipeSystemNetwork_OID", "NVARCHAR(255)"); |
2809 | 2820 |
dicColCheck.Add("PipeRun_OID", "NVARCHAR(255)"); |
2810 | 2821 |
dicColCheck.Add("ViewPipeSystemNetwork_OID", "NVARCHAR(255)"); |
2822 |
dicColCheck.Add("EqpGroupTag", "NVARCHAR(255)"); |
|
2823 |
dicColCheck.Add("MainLineTag", "NVARCHAR(255)"); |
|
2824 |
dicColCheck.Add("EGTConnectedPoint", "INT"); |
|
2825 |
dicColCheck.Add("EGFlowDirection", "NVARCHAR(10)"); |
|
2811 | 2826 |
if (matched == null) |
2812 | 2827 |
{ |
2813 | 2828 |
var query = $"CREATE TABLE {PSN_PATHITEMS} (OID NVARCHAR(255), SequenceData_OID NVARCHAR(255), " + |
2814 | 2829 |
"TopologySet_OID NVARCHAR(255), BranchTopologySet_OID NVARCHAR(255), PipeLine_OID NVARCHAR(255), ItemName NVARCHAR(255), ItemTag NVARCHAR(255), DESCRIPTION NVARCHAR(255), " + |
2815 | 2830 |
"CLASS NVARCHAR(255), SUBCLASS NVARCHAR(255), TYPE NVARCHAR(255), PIDNAME NVARCHAR(255), Equipment_OID NVARCHAR(255), NPD NVARCHAR(255), GROUPTAG NVARCHAR(255), PipeSystemNetwork_OID NVARCHAR(255), PipeRun_OID NVARCHAR(255), " + |
2816 |
"ViewPipeSystemNetwork_OID NVARCHAR(255))"; |
|
2831 |
"ViewPipeSystemNetwork_OID NVARCHAR(255), EqpGroupTag NVARCHAR(255), MainLineTag NVARCHAR(255), EGTConnectedPoint INT, EGFlowDirection NVARCHAR(10))";
|
|
2817 | 2832 |
using (var cmd = connection.GetSqlStringCommand(query)) |
2818 | 2833 |
{ |
2819 | 2834 |
cmd.ExecuteNonQuery(); |
... | ... | |
3272 | 3287 |
DataRow row = item.PathItems.Rows[i]; |
3273 | 3288 |
query = $"INSERT INTO {PSN_PATHITEMS} " + |
3274 | 3289 |
$"(OID, SequenceData_OID, TopologySet_OID, BranchTopologySet_OID, PipeLine_OID, ItemName, ItemTag, DESCRIPTION, CLASS, SUBCLASS, TYPE, " + |
3275 |
$"PIDNAME, Equipment_OID, NPD, GROUPTAG, PipeSystemNetwork_OID, PipeRun_OID, ViewPipeSystemNetwork_OID) VALUES " + |
|
3290 |
$"PIDNAME, Equipment_OID, NPD, GROUPTAG, PipeSystemNetwork_OID, PipeRun_OID, ViewPipeSystemNetwork_OID, EqpGroupTag , MainLineTag, EGTConnectedPoint, EGFlowDirection ) VALUES " +
|
|
3276 | 3291 |
$"(@OID, @SequenceData_OID, @TopologySet_OID, @BranchTopologySet_OID, @PipeLine_OID, @ITEMNAME, @ITEMTAG, @DESCRIPTION, @Class, @SubClass, @TYPE, @PIDNAME," + |
3277 |
$" @Equipment_OID, @NPD, @GROUPTAG, @PipeSystemNetwork_OID,@PipeRun_OID, @ViewPipeSystemNetwork_OID)"; |
|
3292 |
$" @Equipment_OID, @NPD, @GROUPTAG, @PipeSystemNetwork_OID,@PipeRun_OID, @ViewPipeSystemNetwork_OID, @EqpGroupTag , @MainLineTag, @EGTConnectedPoint, @EGFlowDirection )";
|
|
3278 | 3293 |
var cmd = connection.GetSqlStringCommand(query); |
3279 | 3294 |
AddWithValue(cmd, "@OID", string.IsNullOrEmpty(row["OID"].ToString()) ? "" : row["OID"].ToString()); |
3280 | 3295 |
AddWithValue(cmd, "@SequenceData_OID", string.IsNullOrEmpty(row["SequenceData_OID"].ToString()) ? "" : row["SequenceData_OID"].ToString()); |
... | ... | |
3294 | 3309 |
AddWithValue(cmd, "@PipeSystemNetwork_OID", string.IsNullOrEmpty(row["PipeSystemNetwork_OID"].ToString()) ? "" : row["PipeSystemNetwork_OID"].ToString()); |
3295 | 3310 |
AddWithValue(cmd, "@ViewPipeSystemNetwork_OID", string.IsNullOrEmpty(row["ViewPipeSystemNetwork_OID"].ToString()) ? "" : row["ViewPipeSystemNetwork_OID"].ToString()); |
3296 | 3311 |
AddWithValue(cmd, "@PipeRun_OID", string.IsNullOrEmpty(row["PipeRun_OID"].ToString()) ? "" : row["PipeRun_OID"].ToString()); |
3312 |
AddWithValue(cmd, "@EqpGroupTag", string.IsNullOrEmpty(row["EqpGroupTag"].ToString()) ? "" : row["EqpGroupTag"].ToString()); |
|
3313 |
AddWithValue(cmd, "@MainLineTag", string.IsNullOrEmpty(row["MainLineTag"].ToString()) ? "" : row["MainLineTag"].ToString()); |
|
3314 |
AddWithValue(cmd, "@EGTConnectedPoint", string.IsNullOrEmpty(row["EGTConnectedPoint"].ToString()) ? "0" : row["EGTConnectedPoint"].ToString()); |
|
3315 |
AddWithValue(cmd, "@EGFlowDirection", string.IsNullOrEmpty(row["EGFlowDirection"].ToString()) ? "" : row["EGFlowDirection"].ToString()); |
|
3316 |
|
|
3297 | 3317 |
connection.ExecuteNonQuery(cmd, txn); |
3298 | 3318 |
} |
3299 | 3319 |
|
DTI_PID/ID2PSN/Form/MainForm.cs | ||
---|---|---|
568 | 568 |
pathItemsDT.Columns.Add("Equipment_OID", typeof(string)); |
569 | 569 |
pathItemsDT.Columns.Add("TopologySet_OID", typeof(string)); |
570 | 570 |
pathItemsDT.Columns.Add("GROUPTAG", typeof(string)); |
571 |
|
|
571 |
pathItemsDT.Columns.Add("EqpGroupTag", typeof(string)); |
|
572 |
pathItemsDT.Columns.Add("MainLineTag", typeof(string)); |
|
573 |
pathItemsDT.Columns.Add("EGTConnectedPoint", typeof(string)); |
|
574 |
pathItemsDT.Columns.Add("EGFlowDirection", typeof(string)); |
|
572 | 575 |
gridControlPathItems.DataSource = pathItemsDT; |
573 | 576 |
|
574 | 577 |
gridViewPathItems.Columns["SequenceData_OID"].Caption = "PathItem ID"; |
... | ... | |
584 | 587 |
gridViewPathItems.Columns["TopologySet_OID"].Caption = "Topology ID"; |
585 | 588 |
gridViewPathItems.Columns["SubClass"].Caption = "Sub-Class"; |
586 | 589 |
gridViewPathItems.Columns["GROUPTAG"].Caption = "Valve Group Tag"; |
590 |
gridViewPathItems.Columns["EqpGroupTag"].Caption = "AFC Group Tag"; |
|
591 |
gridViewPathItems.Columns["MainLineTag"].Caption = "Main Line Tag"; |
|
592 |
//AFC Group Tag, Main Line |
|
587 | 593 |
#endregion |
588 | 594 |
|
589 | 595 |
if (gridViewTopologys.Columns["Show"].ColumnEdit == null) |
... | ... | |
687 | 693 |
newRow["PIDNAME"] = row["PIDNAME"].ToString(); |
688 | 694 |
newRow["TopologySet_OID"] = row["TopologySet_OID"].ToString(); |
689 | 695 |
newRow["GROUPTAG"] = row["GROUPTAG"].ToString(); |
696 |
newRow["EqpGroupTag"] = row["EqpGroupTag"].ToString(); |
|
697 |
newRow["MainLineTag"] = row["MainLineTag"].ToString(); |
|
690 | 698 |
pathItemsDT.Rows.Add(newRow); |
691 | 699 |
} |
692 | 700 |
|
... | ... | |
698 | 706 |
{ |
699 | 707 |
SetDataTable(currentPSN.TopologySet, |
700 | 708 |
currentPSN.PipeSystemNetwork); |
709 |
SetPathItem(currentPSN.PathItems); |
|
710 |
// currentPSN = DB.GetDBPSN(); |
|
701 | 711 |
|
702 |
// currentPSN = DB.GetDBPSN(); |
|
703 |
|
|
704 |
// SetPathItem(currentPSN.PathItems); |
|
712 |
// SetPathItem(currentPSN.PathItems); |
|
705 | 713 |
} |
706 | 714 |
|
707 | 715 |
private void gridViewPSN_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e) |
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
228 | 228 |
SaveNozzleAndEquipment(); |
229 | 229 |
// PSN의 정보를 저장 |
230 | 230 |
SavePSNData(); |
231 |
|
|
232 | 231 |
// Update Keyword |
233 | 232 |
UpdateKeywordForPSN(); |
234 | 233 |
// Vent/Drain PSN 데이터 제거 |
... | ... | |
243 | 242 |
UpdateAccuracy(); |
244 | 243 |
// ValveGrouping |
245 | 244 |
UpdateValveGrouping(); |
246 |
|
|
247 |
|
|
245 |
// AirFinCooler |
|
246 |
UpdateAirFinCooler(); |
|
248 | 247 |
// PathItem 정렬 |
249 | 248 |
//PathItemSort(); |
250 | 249 |
} |
251 | 250 |
|
252 |
//private void PathItemSort() |
|
253 |
//{ |
|
254 |
// try |
|
255 |
// { |
|
256 |
// SequenceData. |
|
257 |
// } |
|
258 |
// catch (Exception ex) |
|
259 |
// { |
|
260 |
// MessageBox.Show(ex.Message, "ID2 ", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
261 |
// } |
|
262 |
// //} |
|
263 |
//} |
|
251 |
private void UpdateAirFinCooler() |
|
252 |
{ |
|
253 |
try |
|
254 |
{ |
|
255 |
#region EquipmentAirFinCooler Info |
|
256 |
EquipmentAirFinCoolerInfo EquipmentAirFinCooler = new EquipmentAirFinCoolerInfo(); |
|
257 |
DataTable dtEquipmentAirFinCooler = DB.SelectAirFinCoolerSetting(); |
|
258 |
foreach (DataRow row in dtEquipmentAirFinCooler.Rows) |
|
259 |
{ |
|
260 |
//pump type도 마찬가지? |
|
261 |
EquipmentAirFinCooler.EquipmentAirFinCoolerItem.Add(new EquipmentAirFinCoolerItem() |
|
262 |
{ |
|
263 |
Type = row["Type"].ToString(), |
|
264 |
Name = row["Name"].ToString() |
|
265 |
}); |
|
266 |
} |
|
267 |
#endregion |
|
268 |
|
|
269 |
foreach(EquipmentAirFinCoolerItem item in EquipmentAirFinCooler.EquipmentAirFinCoolerItem) |
|
270 |
{ |
|
271 |
DataRow[] airFinCoolerRows = PipeSystemNetwork.Select(string.Format(" From_Data Like '{0}%' OR To_Data Like '{0}%'", item.Name)); |
|
272 |
foreach (DataRow dataRow in airFinCoolerRows) |
|
273 |
{ |
|
274 |
PSNItem PSNItem = PSNItems.Find(x => x.PSN_OID() == dataRow["OID"].ToString()); |
|
275 |
DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString())); |
|
276 |
foreach(DataRow dr in pathItemRows) |
|
277 |
{ |
|
278 |
dr["EqpGroupTag"] = dataRow["Pipeline_OID"].ToString(); //ATG Sequence No Rule 여쭤봐야함. |
|
279 |
} |
|
280 |
} |
|
281 |
} |
|
282 |
} |
|
283 |
catch (Exception ex) |
|
284 |
{ |
|
285 |
MessageBox.Show(ex.Message, "ID2 ", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
286 |
} |
|
287 |
//} |
|
288 |
} |
|
264 | 289 |
|
265 | 290 |
private void UpdateValveGrouping() |
266 | 291 |
{ |
... | ... | |
365 | 390 |
row["Pocket"] = "Yes"; |
366 | 391 |
} |
367 | 392 |
} |
393 |
|
|
394 |
|
|
368 | 395 |
} |
369 | 396 |
catch (Exception ex) |
370 | 397 |
{ |
... | ... | |
1109 | 1136 |
pathItemsDT.Columns.Add("PipeSystemNetwork_OID", typeof(string)); |
1110 | 1137 |
pathItemsDT.Columns.Add("ViewPipeSystemNetwork_OID", typeof(string)); |
1111 | 1138 |
pathItemsDT.Columns.Add("PipeRun_OID", typeof(string)); |
1139 |
pathItemsDT.Columns.Add("EqpGroupTag", typeof(string)); |
|
1140 |
pathItemsDT.Columns.Add("MainLineTag", typeof(string)); |
|
1141 |
pathItemsDT.Columns.Add("EGTConnectedPoint", typeof(string)); |
|
1142 |
pathItemsDT.Columns.Add("EGFlowDirection", typeof(string)); |
|
1112 | 1143 |
|
1113 | 1144 |
DataTable sequenceDataDT = new DataTable(); |
1114 | 1145 |
sequenceDataDT.Columns.Add("OID", typeof(string)); |
내보내기 Unified diff