개정판 13fa00dc
issue #000 Export_To_PAP.py 수정 Flowmeter 추가.
HYTOS/HYTOS/AppDocData.py | ||
---|---|---|
44 | 44 |
def __init__(self, itemNo, type, dataSource): |
45 | 45 |
self.itemNo = itemNo |
46 | 46 |
self.type = type |
47 |
self.dataType = "" |
|
48 |
self.section = "" |
|
47 | 49 |
self.dataSource = dataSource |
48 | 50 |
self.attributes = [] |
49 | 51 |
|
... | ... | |
58 | 60 |
dics = { |
59 | 61 |
'itemNo': self.itemNo, |
60 | 62 |
'type': self.type, |
63 |
'section':self.section, |
|
64 |
'dataType': self.dataType, |
|
61 | 65 |
'dataSource': self.dataSource, |
62 | 66 |
'values': values |
63 | 67 |
} |
... | ... | |
150 | 154 |
#self.API_HOST = "https://papwebapi.azurewebsites.net/" |
151 | 155 |
#self.API_HOST = "http://localhost:53443" |
152 | 156 |
#self.API_HOST = "http://localhost:8080" |
153 |
#self.API_HOST = "http://66.11.11.147:3001" |
|
154 |
self.API_HOST = "http://66.3.85.187:3001" |
|
157 |
#self.API_HOST = "http://66.11.11.147:3001"#삼엔
|
|
158 |
self.API_HOST = "http://66.3.85.187:3001"#인도
|
|
155 | 159 |
|
156 | 160 |
|
157 | 161 |
def clearItemList(self, trim): |
HYTOS/HYTOS/Export_To_PAP.py | ||
---|---|---|
223 | 223 |
pumpDatacase = "" |
224 | 224 |
compressorDatacase = "" |
225 | 225 |
controlValveDatacase = "" |
226 |
ftDatacase ="" |
|
226 | 227 |
if self.ui.comboBox_Calculation_Case.currentText() == "Maximum Flowrate Case": |
227 | 228 |
pumpDatacase = "Rated Flow Case" |
228 | 229 |
compressorDatacase = "Design Case" |
229 | 230 |
controlValveDatacase = "Maximum Flowrate Case" |
231 |
ftDatacase = "Maximum Flowrate Case" |
|
230 | 232 |
elif self.ui.comboBox_Calculation_Case.currentText() == "Normal Flowrate Case": |
231 | 233 |
pumpDatacase = "N/A" |
232 | 234 |
compressorDatacase = "N/A" |
233 | 235 |
controlValveDatacase = "Normal Flowrate Case" |
236 |
ftDatacase = "Normal Flowrate Case" |
|
234 | 237 |
elif self.ui.comboBox_Calculation_Case.currentText() == "Minimum Flowrate Case": |
235 | 238 |
pumpDatacase = "N/A" |
236 | 239 |
compressorDatacase = "N/A" |
237 | 240 |
controlValveDatacase = "Minimum Flowrate Case" |
241 |
ftDatacase = "Minimum Flowrate Case" |
|
238 | 242 |
|
239 | 243 |
if self.ui.tableView_upload_item_list.model().rowCount() > 0: |
240 | 244 |
for row in range(self.ui.tableView_upload_item_list.model().rowCount()): |
... | ... | |
247 | 251 |
self.ui.tableView_upload_item_list.model().setData(datacase_index, str(compressorDatacase), Qt.DisplayRole) |
248 | 252 |
elif type_data.upper() == 'Pump'.upper(): |
249 | 253 |
self.ui.tableView_upload_item_list.model().setData(datacase_index, str(pumpDatacase), Qt.DisplayRole) |
254 |
elif type_data.upper() == 'Flowmeter'.upper(): |
|
255 |
self.ui.tableView_upload_item_list.model().setData(datacase_index, str(ftDatacase), Qt.DisplayRole) |
|
250 | 256 |
|
251 | 257 |
def data_load(self): |
252 | 258 |
self.ui.comboBox_Calculation_Case.clear() |
... | ... | |
254 | 260 |
self.graphicsView = App.mainWnd().graphicsView |
255 | 261 |
items = [item for item in self.graphicsView.scene.items() if type(item) is SymbolSvgItem] |
256 | 262 |
if items: |
257 |
items = [item for item in items if item.type in ["Valve", "Compressor", "Pump" ]]
|
|
263 |
items = [item for item in items if item.type in ["Valve", "Compressor", "Pump", "Flowmeter"]]
|
|
258 | 264 |
self.data_frame_to_ui_configuration(items) |
259 | 265 |
|
260 | 266 |
def data_frame_to_ui_configuration(self, items): |
... | ... | |
417 | 423 |
if item: |
418 | 424 |
if datacase_data == "N/A" or datacase_data=='': |
419 | 425 |
continue |
420 |
if item[0].type not in ["Valve", "Compressor", "Pump"]: |
|
426 |
if item[0].type not in ["Valve", "Compressor", "Pump","Flowmeter"]:
|
|
421 | 427 |
continue |
422 | 428 |
symbolItem = item[0] |
423 | 429 |
inst_Item = Inst_Item(itemNo =symbolItem.tag_no, type = symbolItem.type, dataSource = "HYTOS") |
... | ... | |
431 | 437 |
inlet_streamLine = in_connectors[0].parent |
432 | 438 |
|
433 | 439 |
if symbolItem.type.upper() == "Valve".upper(): |
434 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="RevNo", value=revStatus)) |
|
440 |
inst_Item.section = "INSTRUMENT" |
|
441 |
inst_Item.dataType = "Inst_CV" |
|
435 | 442 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="CreateDate", value=createDate)) |
436 | 443 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="UpdateDate", value=createDate)) |
437 | 444 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_Common", column="CreateDate", value=createDate)) |
438 | 445 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_Common", column="UpdateDate", value=createDate)) |
446 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_Common", column="RevNo", value=revStatus)) |
|
439 | 447 |
if inlet_streamLine: |
440 | 448 |
suctp = "" |
441 | 449 |
discp = "" |
... | ... | |
536 | 544 |
inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "DensityMin2", value = liquid_density)) |
537 | 545 |
inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "ViscosityMin2", value = liquid_viscosity)) |
538 | 546 |
elif symbolItem.type == "Compressor": |
547 |
inst_Item.section = "EQUIPMENT" |
|
548 |
inst_Item.dataType = "eq_compressor" |
|
539 | 549 |
inst_Item.attributes.append(Inst_Attribute(table="eq_common", column="RevNo", value=revStatus)) |
540 | 550 |
inst_Item.attributes.append(Inst_Attribute(table="eq_common", column="CreateDate", value=createDate)) |
541 | 551 |
inst_Item.attributes.append(Inst_Attribute(table="eq_common", column="UpdateDate", value=createDate)) |
... | ... | |
572 | 582 |
inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "InletCompressibility", value = compress_factor)) |
573 | 583 |
inst_Item.attributes.append(Inst_Attribute( table = "eq_compressor", column = "OperatingCase", value = datacase_data)) |
574 | 584 |
elif symbolItem.type == "Pump": |
585 |
inst_Item.section = "EQUIPMENT" |
|
586 |
inst_Item.dataType = "eq_pump" |
|
575 | 587 |
inst_Item.attributes.append(Inst_Attribute(table="eq_common", column="RevNo", value=revStatus)) |
576 | 588 |
inst_Item.attributes.append(Inst_Attribute(table="eq_common", column="CreateDate", value=createDate)) |
577 | 589 |
inst_Item.attributes.append(Inst_Attribute(table="eq_common", column="UpdateDate", value=createDate)) |
... | ... | |
630 | 642 |
inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "RelativeDensityMax", value = density)) |
631 | 643 |
inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "ViscosityMax", value = viscosity)) |
632 | 644 |
inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "PumpingTempMax", value = temperature)) |
645 |
elif symbolItem.type == "Flowmeter": |
|
646 |
inst_Item.section = "INSTRUMENT" |
|
647 |
inst_Item.dataType = "Inst_FT" |
|
648 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_Common", column="CreateDate", value=createDate)) |
|
649 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_Common", column="UpdateDate", value=createDate)) |
|
650 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_Common", column="RevNo", value=revStatus)) |
|
651 |
if inlet_streamLine: |
|
652 |
inlet = "" |
|
653 |
diffp = "" |
|
654 |
dpRatio = "" |
|
655 |
|
|
656 |
if symbolItem.attribute: |
|
657 |
if 'Suct.P' in symbolItem.attribute.keys(): |
|
658 |
inlet = round(symbolItem.attribute['Suct.P'], 3) |
|
659 |
if 'Diff.P' in symbolItem.attribute.keys(): |
|
660 |
diffp = round(symbolItem.attribute['Diff.P'], 3) |
|
661 |
if 'dP Ratio' in symbolItem.attribute.keys(): |
|
662 |
dpRatio = round(symbolItem.attribute['dP Ratio'], 3) |
|
663 |
|
|
664 |
if datacase_data.upper() == Valve_Datacase.Maximum_Flowrate_Case.upper(): |
|
665 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="OperatingPressrueMax", value=inlet)) |
|
666 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="DifferentialPress", value=diffp)) |
|
667 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="FluidStatus1", value=dpRatio)) |
|
668 |
elif datacase_data.upper() == Valve_Datacase.Normal_Flowrate_Case.upper(): |
|
669 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="OperatingPressrueNor", value=inlet)) |
|
670 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="DifferentialPress", value=diffp)) |
|
671 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="FluidStatus1", value="")) |
|
672 |
elif datacase_data.upper() == Valve_Datacase.Minimum_Flowrate_Case.upper(): |
|
673 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="OperatingPressrueMin", value=inlet)) |
|
674 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="DifferentialPress", value=diffp)) |
|
675 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="FluidStatus1", value="")) |
|
676 |
|
|
677 |
flowrate_mass = inlet_streamLine.data.flowrate_mass |
|
678 |
#flowrate_volume = inlet_streamLine.data.flowrate_volume |
|
679 |
density = inlet_streamLine.data.density |
|
680 |
viscosity = inlet_streamLine.data.viscosity |
|
681 |
temperature = inlet_streamLine.data.temperature |
|
682 |
molecular_weight = inlet_streamLine.data.molecular_weight |
|
683 |
specific_heat_ratio = inlet_streamLine.data.specific_heat_ratio |
|
684 |
compress_factor = inlet_streamLine.data.compress_factor |
|
685 |
|
|
686 |
if datacase_data == Valve_Datacase.Maximum_Flowrate_Case: |
|
687 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="FlowrateMax", value=flowrate_mass)) |
|
688 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="DensityMax1", value=density)) |
|
689 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="ViscosityMax", value=viscosity)) |
|
690 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="OperatingTemperatureMax",value=temperature)) |
|
691 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="MolecularWeightNor",value=molecular_weight)) |
|
692 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="SpecificHeatRatio",value=specific_heat_ratio)) |
|
693 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="Compressibility",value=compress_factor)) |
|
694 |
elif datacase_data == Valve_Datacase.Normal_Flowrate_Case: |
|
695 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="FlowrateNor", value=flowrate_mass)) |
|
696 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="DensityNor1", value=density)) |
|
697 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="ViscosityNor", value=viscosity)) |
|
698 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="OperatingTemperatureNor",value=temperature)) |
|
699 |
elif datacase_data == Valve_Datacase.Minimum_Flowrate_Case: |
|
700 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="FlowrateMin", value=flowrate_mass)) |
|
701 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="DensityMin1", value=density)) |
|
702 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="ViscosityMin", value=viscosity)) |
|
703 |
inst_Item.attributes.append(Inst_Attribute(table="Inst_FT", column="OperatingTemperatureMin",value=temperature)) |
|
633 | 704 |
inst_Item.printf() |
634 | 705 |
inst_Items.append(inst_Item) |
635 |
|
|
636 | 706 |
if len(inst_Items) > 0: |
637 | 707 |
projectInfomation =[con for con in self.project_list |
638 | 708 |
if con.Name == self.ui.comboBox_select_PAP_Project.currentText()] |
내보내기 Unified diff