개정판 a873b8aa
issue #1049 : 옵션 창 및 기능 : DrawingsUnits 변경 기능
Change-Id: Ibe1a084188aa1e19ee13d07fa2a878c6f16f497e
HYTOS/HYTOS/ConfigurationDialog.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
self.ui = Configuration_UI.Ui_ConfigurationDialog() |
22 | 22 |
self.ui.setupUi(self) |
23 |
self.ui.comboBox_Pressure.currentIndexChanged.connect(self.onPpressurechanged) |
|
23 | 24 |
|
24 |
def accept(self): |
|
25 |
|
|
26 |
self.initialize() |
|
27 |
|
|
28 |
def onPpressurechanged(self, index): |
|
29 |
|
|
30 |
unit = self.ui.comboBox_Pressure.itemText(index) |
|
31 |
if unit == 'kg/cm2': |
|
32 |
self.ui.lineEdit_CurrentBarometricPressure.setText('1.033') |
|
33 |
elif unit == 'bar': |
|
34 |
self.ui.lineEdit_CurrentBarometricPressure.setText('1.01325') |
|
35 |
elif unit == 'psi': |
|
36 |
self.ui.lineEdit_CurrentBarometricPressure.setText('14.7') |
|
37 |
elif unit == 'mmHg': |
|
38 |
self.ui.lineEdit_CurrentBarometricPressure.setText('760') |
|
39 |
elif unit == 'kPa': |
|
40 |
self.ui.lineEdit_CurrentBarometricPressure.setText('101.325') |
|
41 |
elif unit == 'MPa': |
|
42 |
self.ui.lineEdit_CurrentBarometricPressure.setText('0.101325') |
|
43 |
|
|
44 |
self.ui.label_PressureUnit.setText(unit) |
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
uid = self.ui.comboBox_Pressure.itemData(index) |
|
52 |
|
|
53 |
|
|
54 |
def initialize(self): |
|
55 |
self.ui.comboBox_Flowrate_Mass.clear() |
|
56 |
self.ui.comboBox_Flowrate_Volume.clear() |
|
57 |
self.ui.comboBox_Density.clear() |
|
58 |
self.ui.comboBox_Viscosity.clear() |
|
59 |
self.ui.comboBox_Temperature.clear() |
|
60 |
self.ui.comboBox_Power.clear() |
|
61 |
self.ui.comboBox_Pressure.clear() |
|
62 |
self.ui.comboBox_Velocity.clear() |
|
63 |
self.ui.comboBox_Pipe_Diameter.clear() |
|
64 |
self.ui.comboBox_Length.clear() |
|
65 |
self.ui.comboBox_Roughness.clear() |
|
66 |
|
|
67 |
unitsList = AppDocData.instance().getUnits() |
|
68 |
for units in unitsList: |
|
69 |
uid = units[0] |
|
70 |
key = units[1] |
|
71 |
val = units[2] |
|
72 |
|
|
73 |
if key == 'Flowrate_Mass': |
|
74 |
self.ui.comboBox_Flowrate_Mass.addItem(val, uid) |
|
75 |
elif key == 'Flowrate_Volume': |
|
76 |
self.ui.comboBox_Flowrate_Volume.addItem(val, uid) |
|
77 |
elif key == 'Density': |
|
78 |
self.ui.comboBox_Density.addItem(val, uid) |
|
79 |
elif key == 'Viscosity': |
|
80 |
self.ui.comboBox_Viscosity.addItem(val, uid) |
|
81 |
elif key == 'Temperature': |
|
82 |
self.ui.comboBox_Temperature.addItem(val, uid) |
|
83 |
elif key == 'Power': |
|
84 |
self.ui.comboBox_Power.addItem(val, uid) |
|
85 |
elif key == 'Pressure': |
|
86 |
self.ui.comboBox_Pressure.addItem(val, uid) |
|
87 |
elif key == 'Velocity': |
|
88 |
self.ui.comboBox_Velocity.addItem(val, uid) |
|
89 |
elif key == 'Pipe_Diameter': |
|
90 |
self.ui.comboBox_Pipe_Diameter.addItem(val, uid) |
|
91 |
elif key == 'Length': |
|
92 |
self.ui.comboBox_Length.addItem(val, uid) |
|
93 |
elif key == 'Roughness': |
|
94 |
self.ui.comboBox_Roughness.addItem(val, uid) |
|
95 |
|
|
96 |
|
|
97 |
def accept(self): |
|
98 |
# To Do List... |
|
99 |
# 1. Update Unit attributes in Drawing |
|
100 |
# 2. Update DrawingsUnits Table |
|
101 |
# 3. Update HMB List |
|
25 | 102 |
|
26 | 103 |
QDialog.accept(self) |
27 | 104 |
|
내보내기 Unified diff