개정판 32632442
issue #1210 Liquid 입력 - Input Flowrate Type 추가 (Mass Or Volume)
추우 입력한 Type 활성화
Change-Id: I164a6bc1d4087a709df6776e2247df72e28ad6f2
HYTOS/HYTOS/HMBTable.py | ||
---|---|---|
67 | 67 |
self._liquid_density = None |
68 | 68 |
self._liquid_viscosity = None |
69 | 69 |
self.isDeleted = False |
70 |
|
|
70 |
self._input_flowrate_type = None |
|
71 | 71 |
''' |
72 | 72 |
@author humkyung |
73 | 73 |
@date 2018.07.12 |
... | ... | |
455 | 455 |
def liquid_viscosity(self, value): |
456 | 456 |
self._liquid_viscosity = value |
457 | 457 |
|
458 |
@property |
|
459 |
def input_flowrate_type(self): |
|
460 |
return self._input_flowrate_type |
|
461 |
|
|
462 |
@input_flowrate_type.setter |
|
463 |
def input_flowrate_type(self, value): |
|
464 |
self._input_flowrate_type = str(value) |
|
465 |
|
|
466 |
|
|
458 | 467 |
def fromRow(row): |
459 | 468 |
hmb = HMBData() |
460 | 469 |
hmb._uid = row[0] |
... | ... | |
500 | 509 |
hmb._liquid_density = row[40] |
501 | 510 |
hmb._liquid_viscosity = row[41] |
502 | 511 |
hmb._stream_no_text = row[42] |
512 |
hmb._input_flowrate_type = row[43] |
|
503 | 513 |
|
504 | 514 |
return hmb |
505 | 515 |
|
... | ... | |
649 | 659 |
hmb.liquid_density = values['Liquid_Density'] |
650 | 660 |
if 'Liquid_Viscosity' in values: |
651 | 661 |
hmb.liquid_viscosity = values['Liquid_Viscosity'] |
652 |
|
|
662 |
if 'Input_Flowrate_Type' in values: |
|
663 |
hmb.input_flowrate_type = values['Input_Flowrate_Type'] |
|
653 | 664 |
break |
654 | 665 |
except Exception as ex: |
655 | 666 |
from App import App |
... | ... | |
720 | 731 |
, h.Liquid_Density |
721 | 732 |
, h.Liquid_Viscosity |
722 | 733 |
, c.Name |
734 |
, h.Input_Flowrate_Type |
|
723 | 735 |
from HMB h |
724 | 736 |
left join Components c |
725 | 737 |
on h.Components_UID = c.UID |
... | ... | |
779 | 791 |
'Pressure_Drop_Static', 'Pressure_Pipe_End_Point', 'Power', 'Vapor_Flowrate_Mass', |
780 | 792 |
'Vapor_Density', 'Vapor_Viscosity', 'Vapor_Pressure', 'Vapor_Temperature', |
781 | 793 |
'Vapor_Molecular_Weight', 'Vapor_Compress_Factor', 'Liquid_Flowrate_Mass', |
782 |
'Liquid_Density', 'Liquid_Viscosity'] |
|
794 |
'Liquid_Density', 'Liquid_Viscosity', 'Input_Flowrate_Type']
|
|
783 | 795 |
values = ['?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', |
784 | 796 |
'?', |
785 | 797 |
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', |
786 |
'?', '?', '?', '?', '?', '?', '?'] |
|
798 |
'?', '?', '?', '?', '?', '?', '?', '?']
|
|
787 | 799 |
param = ( |
788 | 800 |
str(data.uid), str(data.components_uid), data.stream_no, data.phase_type, |
789 | 801 |
data.flowrate_mass, |
... | ... | |
801 | 813 |
data.vapor_density, data.vapor_viscosity, data.vapor_pressure, data.vapor_temperature, |
802 | 814 |
data.vapor_molecular_weight, |
803 | 815 |
data.vapor_compress_factor, data.liquid_flowrate_mass, data.liquid_density, |
804 |
data.liquid_viscosity) |
|
816 |
data.liquid_viscosity, data.input_flowrate_type)
|
|
805 | 817 |
|
806 | 818 |
sql = 'insert or replace into HMB({}) values({})'.format(','.join(cols), ','.join(values)) |
807 | 819 |
cursor.execute(sql, param) |
HYTOS/HYTOS/MainWindow.py | ||
---|---|---|
2340 | 2340 |
if column_name not in column_names: |
2341 | 2341 |
app_doc_data.add_column(column_name, 'REAL', 'PressureVariation') |
2342 | 2342 |
|
2343 |
find_column_names = ['Input_Flowrate_Type'] |
|
2344 |
column_names = app_doc_data.get_column_names('HMB') |
|
2345 |
for column_name in find_column_names: |
|
2346 |
if column_name not in column_names: |
|
2347 |
app_doc_data.add_column(column_name, 'TEXT', 'HMB') |
|
2348 |
|
|
2343 | 2349 |
except Exception as ex: |
2344 | 2350 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
2345 | 2351 |
f"{sys.exc_info()[-1].tb_lineno}" |
HYTOS/HYTOS/StreamDataDialog.py | ||
---|---|---|
416 | 416 |
def flowrate_change_event(self, text): |
417 | 417 |
if self.sender() == self.ui.lineEdit_Flowrate_Mass_Liquid: |
418 | 418 |
if is_not_blank(text): |
419 |
self.ui.lineEdit_Flowrate_Volume.clear() |
|
419 |
# self.ui.lineEdit_Flowrate_Volume.clear()
|
|
420 | 420 |
self.ui.lineEdit_Flowrate_Volume.setStyleSheet('QLineEdit {background-color: rgb(237,237,237);}') |
421 | 421 |
self.ui.lineEdit_Flowrate_Mass_Liquid.setStyleSheet('QLineEdit {background-color: white;}') |
422 | 422 |
else: |
423 | 423 |
if is_not_blank(text): |
424 |
self.ui.lineEdit_Flowrate_Mass_Liquid.clear() |
|
424 |
# self.ui.lineEdit_Flowrate_Mass_Liquid.clear()
|
|
425 | 425 |
self.ui.lineEdit_Flowrate_Mass_Liquid.setStyleSheet('QLineEdit {background-color: rgb(237,237,237);}') |
426 | 426 |
self.ui.lineEdit_Flowrate_Volume.setStyleSheet('QLineEdit {background-color: white;}') |
427 | 427 |
|
... | ... | |
1485 | 1485 |
if matches[0].schedule_no == 'User Sch.': |
1486 | 1486 |
self.ui.lineEdit_Inside_Pipe_Size.setText(str( |
1487 | 1487 |
convert_to_fixed_point(matches[0].inside_pipe_size))) |
1488 |
if matches[0].input_flowrate_type: |
|
1489 |
if matches[0].input_flowrate_type == 'Mass': |
|
1490 |
self.ui.lineEdit_Flowrate_Mass_Liquid.setStyleSheet('QLineEdit {background-color: white;}') |
|
1491 |
self.ui.lineEdit_Flowrate_Volume.setStyleSheet('QLineEdit {background-color: rgb(237,237,237);}') |
|
1492 |
elif matches[0].input_flowrate_type == 'Volume': |
|
1493 |
self.ui.lineEdit_Flowrate_Volume.setStyleSheet('QLineEdit {background-color: white;}') |
|
1494 |
self.ui.lineEdit_Flowrate_Mass_Liquid.setStyleSheet('QLineEdit {background-color: rgb(237,237,237);}') |
|
1495 |
|
|
1496 |
|
|
1488 | 1497 |
except Exception as ex: |
1489 | 1498 |
from App import App |
1490 | 1499 |
from AppDocData import MessageType |
... | ... | |
1617 | 1626 |
values['Temperature'] = None |
1618 | 1627 |
values['Compress_Factor'] = None |
1619 | 1628 |
|
1629 |
if is_not_blank(self.ui.lineEdit_Flowrate_Mass_Liquid.text()): |
|
1630 |
values['Input_Flowrate_Type'] = 'Mass' |
|
1631 |
elif is_not_blank(self.ui.lineEdit_Flowrate_Volume.text()): |
|
1632 |
values['Input_Flowrate_Type'] = 'Volume' |
|
1633 |
|
|
1620 | 1634 |
drawing.hmbTable.updateByUID(self.item.uid, values) |
1621 | 1635 |
|
1622 | 1636 |
if changed_stream_line: |
... | ... | |
1823 | 1837 |
|
1824 | 1838 |
# Mixed Type Check |
1825 | 1839 |
phase_type = self.ui.comboBox_PhaseType.currentData() |
1826 |
if phase_type == 'Mixed': |
|
1840 |
if phase_type == 'Liquid': |
|
1841 |
if is_not_blank(self.ui.lineEdit_Flowrate_Mass_Liquid.text()) and is_not_blank(self.ui.lineEdit_Flowrate_Volume.text()): |
|
1842 |
QMessageBox.information(self, self.tr("Information Data Error"), self.tr("Input only one of Mass Flowrate or Vol. Flowrate")) |
|
1843 |
return |
|
1844 |
elif phase_type == 'Mixed': |
|
1827 | 1845 |
if self.item.mixed_pressure_variation is None: |
1828 | 1846 |
QMessageBox.information(self, self.tr("Information"), self.tr("Calculate this line !")) |
1829 | 1847 |
return |
내보내기 Unified diff