프로젝트

일반

사용자정보

개정판 139b1e2d

ID139b1e2ddcdd10d7768bbe37a8ce574f1aad4f52
상위 1e0a1a6f
하위 2aaea864, e4360114

김연진이(가) 5년 이상 전에 추가함

issue #1049 옵션 창 및 기능

Change-Id: Ibb6062e114e9a62ad0665a1612203ecff17ff5d1

차이점 보기:

HYTOS/HYTOS/AppDocData.py
355 355

  
356 356
        return res
357 357

  
358
    
358
    def getConfigs(self, section, key=None):
359
        """
360
            @brief  get application configurations
361
            @author humkyung
362
            @date   2018.11.01
363
        """
364

  
365
        res = []
366

  
367
        try:
368
            # Creates or opens a file called mydb with a SQLite3 DB
369
            conn = sqlite3.connect(self.activeDrawing.path)
370
            conn.execute('PRAGMA foreign_keys = ON')
371
            # Get a cursor object
372
            cursor = conn.cursor()
373

  
374
            if key is not None:
375
                sql = "select Section, Key, Value from configuration where section=? and key=?"
376
                param = (section, key)
377
            else:
378
                sql = "select Section, Key, Value from configuration where section=?"
379
                param = (section,)
380

  
381
            cursor.execute(sql, param)
382
            rows = cursor.fetchall()
383
            for row in rows:
384
                res.append(Config(row[0], row[1], row[2]))
385
        # Catch the exception
386
        except Exception as ex:
387
            # Roll back any change if something goes wrong
388
            conn.rollback()
389
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
390
        finally:
391
            # Close the db connection
392
            conn.close()
393

  
394
        return res
395

  
359 396
    def saveAppConfigs(self, configs):
360 397
        """
361 398
        @brief      save application configurations
......
390 427
            # Close the db connection
391 428
            conn.close()
392 429

  
430
    def saveConfigs(self, configs):
431
        """
432
        @brief      save application configurations
433
        @author     humkyung
434
        @date       2018.10.01
435
        """
436

  
437
        try:
438
            # Creates or opens a file called mydb with a SQLite3 DB
439
            conn = sqlite3.connect(self.activeDrawing.path)
440
            conn.execute('PRAGMA foreign_keys = ON')
441
            # Get a cursor object
442
            cursor = conn.cursor()
443

  
444
            for config in configs:
445
                value = config.value
446
                if type(value) is str and "'" in value:
447
                    value = value.replace("'", "''")
448

  
449
                sql = "insert or replace into configuration values(?,?,?)"
450
                param = (config.section, config.key, value)
451

  
452
                cursor.execute(sql, param)
453
            conn.commit()
454
        # Catch the exception
455
        except Exception as ex:
456
            # Roll back any change if something goes wrong
457
            conn.rollback()
458
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
459
        finally:
460
            # Close the db connection
461
            conn.close()
393 462

  
394 463
    def initializeDataByDrawingUID(self, uid):
395 464
        try:
......
817 886
                    res.over_design_cv = float(rows[0]['Over_Design_CV'])
818 887
        return res
819 888

  
820
    def getDrawingsUnitsByDrawingUID(self, drawing):
821
        """ get units of drawing """
822
        unitsList = []
823

  
824
        conn = sqlite3.connect(drawing.path)
825
        conn.execute('PRAGMA foreign_keys = ON')
826
        with conn:
827
            cursor = conn.cursor()
828

  
829
            sql = 'select du.Units, u.Value from DrawingsUnits du \
830
                                                 left join units u on du.Units_UID = u.uid'
831
            try:
832
                cursor.execute(sql)
833
                rows = cursor.fetchall()
834
                for row in rows:
835
                    unitsList.append((row[0], row[1])) 
836
            except Exception as ex:
837
                from App import App
838

  
839
                message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
840
                App.mainWnd().addMessage.emit(MessageType.Error, message)
841

  
842
        return unitsList
843

  
844

  
889
    
845 890
    '''
846 891
        @brief      Return Components By DrawingUID
847 892
        @author     yeonjin
HYTOS/HYTOS/Calculation.py
7 7
from AppDocData import *
8 8
import math
9 9

  
10
class Conversion:
11
    def __init__(self, hmb, decimal):
12
        self.initUnits()
13
        self._hmb = hmb
14
        self._decimal = decimal
15

  
16
        curUnitsList = AppDocData.instance().getConfigs('Units')
17
        for curUnit in curUnitsList:            
18

  
19
            if curUnit.key == 'Flowrate_Mass':
20
                if curUnit.value != self.old_flowrate_mass_unit:
21
                    self.conversion_flowrate_mass(curUnit.value)
22
            elif curUnit.key == 'Flowrate_Volume':
23
                if curUnit.value != self.old_flowrate_volume_unit:
24
                    self.conversion_flowrate_volume(curUnit.value)
25

  
26

  
27

  
28
    def conversion_flowrate_mass(self, curUnit):
29
        convert_factor = 1
30

  
31
        if self.old_flowrate_mass_unit == 'kg/h':
32
            if curUnit == 'g/min':
33
                convert_factor = 16.6667
34
            elif curUnit == 'lb/h':
35
                convert_factor = 2.2046
36
            elif curUnit == 't/h':
37
                convert_factor = 0.001
38
        elif self.old_flowrate_mass_unit == 'g/min':
39
            if curUnit == 'kg/h':
40
                convert_factor = 1 / 16.6667
41
            elif curUnit == 'lb/h':
42
                convert_factor = 0.132277
43
            elif curUnit == 't/h':
44
                convert_factor = 0.00006
45
        elif self.old_flowrate_mass_unit == 'lb/h':
46
            if curUnit == 'kg/h':
47
                convert_factor = 1 / 2.2046
48
            elif curUnit == 'g/min':
49
                convert_factor = 1 / 0.132277
50
            elif curUnit == 't/h':
51
                convert_factor = 0.0004536
52
        elif self.old_flowrate_mass_unit == 't/h':
53
            if curUnit == 'kg/h':
54
                convert_factor = 1 / 0.001
55
            elif curUnit == 'g/min':
56
                convert_factor = 1 / 0.00006
57
            elif curUnit == 'lb/h':
58
                convert_factor = 1 / 0.0004536
59

  
60
        self._hmb.flowrate_mass = round(self._hmb.flowrate_mass * convert_factor, self._decimal)
61

  
62

  
63
    def conversion_flowrate_volume(self, curUnit):
64
        convert_factor = 1
65

  
66
        if self.old_flowrate_volume_unit == 'm3/h':
67
            if curUnit == 'l/min':
68
                convert_factor = 16.6667
69
            elif curUnit == 'ft3/h':
70
                convert_factor = 35.31466
71
            elif curUnit == 'USgpm':
72
                convert_factor = 4.402867
73
            elif curUnit == 'BPSD':
74
                convert_factor = 150.955464
75
        elif self.old_flowrate_volume_unit == 'l/min':
76
            if curUnit == 'm3/h':
77
                convert_factor = 1 / 16.6667
78
            elif curUnit == 'ft3/h':
79
                convert_factor = 2.1188796
80
            elif curUnit == 'USgpm':
81
                convert_factor = 0.264172
82
            elif curUnit == 'BPSD':
83
                convert_factor = 9.05732784
84
        elif self.old_flowrate_volume_unit == 'ft3/h':
85
            if curUnit == 'm3/h':
86
                convert_factor = 1 / 35.31466
87
            elif curUnit == 'l/min':
88
                convert_factor = 1 / 2.1188796
89
            elif curUnit == 'USgpm':
90
                convert_factor = 0.124675333
91
            elif curUnit == 'BPSD':
92
                convert_factor = 9.05732784
93
        elif self.old_flowrate_volume_unit == 'USgpm':
94
            if curUnit == 'm3/h':
95
                convert_factor = 1 / 4.402867
96
            elif curUnit == 'l/min':
97
                convert_factor = 1 / 0.264172
98
            elif curUnit == 'ft3/h':
99
                convert_factor = 1 / 0.124675333
100
            elif curUnit == 'BPSD':
101
                convert_factor = 34.2857088
102
        elif self.old_flowrate_volume_unit == 'BPSD':
103
            if curUnit == 'm3/h':
104
                convert_factor = 1 / 150.955464
105
            elif curUnit == 'l/min':
106
                convert_factor = 1 / 9.05732784
107
            elif curUnit == 'ft3/h':
108
                convert_factor = 1 / 4.2745824
109
            elif curUnit == 'USgpm':
110
                convert_factor = 1 / 34.2857088
111

  
112

  
113
        self._hmb.flowrate_volume = round(self._hmb.flowrate_volume * convert_factor, self._decimal)
114

  
115

  
116
    def initUnits(self):
117
        activeDrawing = AppDocData.instance().activeDrawing
118

  
119
        for attr in activeDrawing.attrs:
120
            if attr[0] == 'Units':
121
                self.old_flowrate_mass_unit = attr[1]['Flowrate_Mass']                
122
                self.old_flowrate_volume_unit = attr[1]['Flowrate_Volume']
123
                self.old_density_unit = attr[1]['Density']
124
                self.old_viscosity_unit = attr[1]['Viscosity']                
125
                self.old_velocity_unit = attr[1]['Velocity']
126
                self.old_pressure_unit = attr[1]['Pressure']
127
                self.old_length_unit = attr[1]['Length']
128
                self.old_pipe_diameter_unit = attr[1]['Pipe_Diameter']                
129
                self.old_roughness_unit = attr[1]['Roughness']                
130
                self.old_temperature_unit = attr[1]['Temperature']
131

  
132

  
133

  
10 134
class Calculation:
11 135
    def __init__(self, hmb):
12 136
        self.initUnits()
13 137
        self._hmb = hmb
14 138
                    
139
        # To Do : Make a loop 
140

  
15 141
        if self._hmb.phase_type == 'Vapor':
16 142
            self.calculation_Vapor()
17 143
        elif self._hmb.phase_type == 'Liquid':
......
373 499

  
374 500
        return x2
375 501

  
502
    def getLiquid_Drop_Method(self):
503
        appDocData = AppDocData.instance()
504
            
505
        # Calculation
506
        liquid_dp_method = appDocData.getConfigs('Calculation', 'Liquid_Drop_Method')
507

  
508
        if len(liquid_dp_method) == 1:                
509
            return liquid_dp_method[0].value
510
        else:
511
            return 'darcy'
512

  
376 513
    def calculation_Liquid(self):
377 514
        # To Do ...
378 515
        # 옵션 처리 요망
......
380 517
        # Darcy Equation (General Design) : darcy
381 518
        # Hagen-Williams Equation (Water Design) : hagen
382 519
        
383
        liquid_dp_method = 'darcy'  #'hagen' #'darcy' 
520
        liquid_dp_method = self.getLiquid_Drop_Method()
384 521

  
385 522
        if liquid_dp_method == 'darcy':
386 523
            self.liquid_calc_darcy()
HYTOS/HYTOS/ConfigurationDialog.py
3 3

  
4 4
import os
5 5
import sys
6
from PyQt5.QtCore import *
7
from PyQt5.QtGui import *
6
from PyQt5 import QtCore, QtGui, QtWidgets
8 7
from PyQt5.QtWidgets import *
9 8
import sqlite3
10 9
from App import App
......
19 18

  
20 19
        self.ui = Configuration_UI.Ui_ConfigurationDialog()
21 20
        self.ui.setupUi(self)
22
        self.ui.comboBox_Pressure.currentIndexChanged.connect(self.onPressurechanged) 
23

  
21
        self.isAccepted = False
22
        self.ui.comboBox_Pressure.currentIndexChanged.connect(self.onPressureChanged) 
23
        self.ui.comboBox_Decimal.currentIndexChanged.connect(self.onDecimalChanged) 
24 24

  
25 25
        self.initialize()
26
        
27
    def onPressurechanged(self, index):
26
    
27
    def showDialog(self):
28
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
29

  
30
        self.load_data()        
31
        self.exec_()
32

  
33
        return (self.isAccepted, self.ui.checkBox_Data_Convert.isChecked(), self.ui.comboBox_Decimal.currentData())
34

  
35
    def onDecimalChanged(self, index):
36
        decimal = self.ui.comboBox_Decimal.itemData(index)
37

  
38
        if decimal == 0:
39
            self.ui.label_Decimal_Expression.setText('(From current Value to 0)')
40
        elif decimal == 1:
41
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.0)')
42
        elif decimal == 2:
43
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.00)')
44
        elif decimal == 3:
45
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.000)')
46
        elif decimal == 4:
47
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.0000)')
48
        elif decimal == 5:
49
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.00000)')
50
        elif decimal == 6:
51
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.000000)')
52
        elif decimal == 7:
53
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.0000000)')
54
        elif decimal == 8:
55
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.00000000)')
56
        elif decimal == 9:
57
            self.ui.label_Decimal_Expression.setText('(From current Value to 0.000000000)')
58
    def onPressureChanged(self, index):
28 59

  
29 60
        unit = self.ui.comboBox_Pressure.itemText(index)
30 61
        if unit == 'kg/cm2':
......
43 74
        self.ui.label_PressureUnit.setText(unit)
44 75
    
45 76

  
46
    def initialize(self):       
47
        self.ui.comboBox_Flowrate_Mass.clear()
48
        self.ui.comboBox_Flowrate_Volume.clear()
49
        self.ui.comboBox_Density.clear()
50
        self.ui.comboBox_Viscosity.clear()
51
        self.ui.comboBox_Temperature.clear()
52
        self.ui.comboBox_Power.clear()
53
        self.ui.comboBox_Pressure.clear()
54
        self.ui.comboBox_Velocity.clear()
55
        self.ui.comboBox_Pipe_Diameter.clear()
56
        self.ui.comboBox_Length.clear()
57
        self.ui.comboBox_Roughness.clear()
58

  
59
        unitsList = AppDocData.instance().getUnits()
60
        for units in unitsList:
61
            uid = units[0]
62
            key = units[1]
63
            val = units[2]
64

  
65
            if key == 'Flowrate_Mass':
66
                self.ui.comboBox_Flowrate_Mass.addItem(val, uid)
67
            elif key == 'Flowrate_Volume':
68
                self.ui.comboBox_Flowrate_Volume.addItem(val, uid)
69
            elif key == 'Density':
70
                self.ui.comboBox_Density.addItem(val, uid)
71
            elif key == 'Viscosity':
72
                self.ui.comboBox_Viscosity.addItem(val, uid)
73
            elif key == 'Temperature':
74
                self.ui.comboBox_Temperature.addItem(val, uid)
75
            elif key == 'Power':
76
                self.ui.comboBox_Power.addItem(val, uid)
77
            elif key == 'Pressure':
78
                self.ui.comboBox_Pressure.addItem(val, uid)
79
            elif key == 'Velocity':
80
                self.ui.comboBox_Velocity.addItem(val, uid)
81
            elif key == 'Pipe_Diameter':
82
                self.ui.comboBox_Pipe_Diameter.addItem(val, uid)
83
            elif key == 'Length':
84
                self.ui.comboBox_Length.addItem(val, uid)
85
            elif key == 'Roughness':
86
                self.ui.comboBox_Roughness.addItem(val, uid)
77
    def initialize(self):      
78
        try:             
79
            self.ui.comboBox_Flowrate_Mass.clear()
80
            self.ui.comboBox_Flowrate_Volume.clear()
81
            self.ui.comboBox_Density.clear()
82
            self.ui.comboBox_Viscosity.clear()
83
            self.ui.comboBox_Temperature.clear()
84
            self.ui.comboBox_Power.clear()
85
            self.ui.comboBox_Pressure.clear()
86
            self.ui.comboBox_Velocity.clear()
87
            self.ui.comboBox_Pipe_Diameter.clear()
88
            self.ui.comboBox_Length.clear()
89
            self.ui.comboBox_Roughness.clear()
90

  
91
            unitsList = AppDocData.instance().getUnits()
92
            for units in unitsList:
93
                uid = units[0]
94
                key = units[1]
95
                val = units[2]
96

  
97
                if key == 'Flowrate_Mass':
98
                    self.ui.comboBox_Flowrate_Mass.addItem(val, val)
99
                elif key == 'Flowrate_Volume':
100
                    self.ui.comboBox_Flowrate_Volume.addItem(val, val)
101
                elif key == 'Density':
102
                    self.ui.comboBox_Density.addItem(val, val)
103
                elif key == 'Viscosity':
104
                    self.ui.comboBox_Viscosity.addItem(val, val)
105
                elif key == 'Temperature':
106
                    self.ui.comboBox_Temperature.addItem(val, val)
107
                elif key == 'Power':
108
                    self.ui.comboBox_Power.addItem(val, val)
109
                elif key == 'Pressure':
110
                    self.ui.comboBox_Pressure.addItem(val, val)
111
                elif key == 'Velocity':
112
                    self.ui.comboBox_Velocity.addItem(val, val)
113
                elif key == 'Pipe_Diameter':
114
                    self.ui.comboBox_Pipe_Diameter.addItem(val, val)
115
                elif key == 'Length':
116
                    self.ui.comboBox_Length.addItem(val, val)
117
                elif key == 'Roughness':
118
                    self.ui.comboBox_Roughness.addItem(val, val)
119

  
120
            self.ui.comboBox_Decimal.clear()
121

  
122
            for val in range(0, 10):
123
                self.ui.comboBox_Decimal.addItem(str(val), val)
124
            
125
            self.ui.comboBox_Decimal.setCurrentIndex(9)
126

  
127
        except Exception as ex:
128
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
129
            self.addMessage.emit(MessageType.Error, message)
130

  
131

  
132
    def load_data(self):
133
        """ load tag no and nozzle data """
134
        from Drawing import Drawing
135

  
136
        try:
137
            appDocData = AppDocData.instance()
138
            drawing = appDocData.activeDrawing    
139
            if drawing:
140
                # Calculation
141
                liquid_dp_method = appDocData.getConfigs('Calculation', 'Liquid_Drop_Method')
142

  
143
                if len(liquid_dp_method) == 1:                
144
                    if liquid_dp_method[0].value == 'darcy':
145
                        self.ui.radioButton_Darcy.setChecked(True)                
146
                    else:
147
                        self.ui.radioButton_Hagen.setChecked(True)
148
                    
149

  
150
                # Units    
151
                for attr in drawing.attrs:
152
                    if attr[0] == 'Units':
153
                        
154
                        index = self.getIndexByValue(self.ui.comboBox_Flowrate_Mass, attr[1]['Flowrate_Mass'])
155
                        if index > -1:
156
                            self.ui.comboBox_Flowrate_Mass.setCurrentIndex(index)
157
                        
158
                        index = self.getIndexByValue(self.ui.comboBox_Flowrate_Volume, attr[1]['Flowrate_Volume'])
159
                        if index > -1:
160
                            self.ui.comboBox_Flowrate_Volume.setCurrentIndex(index)
161

  
162
                        index = self.getIndexByValue(self.ui.comboBox_Density, attr[1]['Density'])
163
                        if index > -1:
164
                            self.ui.comboBox_Density.setCurrentIndex(index)
87 165

  
166
                        index = self.getIndexByValue(self.ui.comboBox_Viscosity, attr[1]['Viscosity'])
167
                        if index > -1:
168
                            self.ui.comboBox_Viscosity.setCurrentIndex(index)
169

  
170
                        index = self.getIndexByValue(self.ui.comboBox_Temperature, attr[1]['Temperature'])
171
                        if index > -1:
172
                            self.ui.comboBox_Temperature.setCurrentIndex(index)
173

  
174
                        index = self.getIndexByValue(self.ui.comboBox_Power, attr[1]['Power'])
175
                        if index > -1:
176
                            self.ui.comboBox_Power.setCurrentIndex(index)
177

  
178
                        index = self.getIndexByValue(self.ui.comboBox_Pressure, attr[1]['Pressure'])
179
                        if index > -1:
180
                            self.ui.comboBox_Pressure.setCurrentIndex(index)
181
                        
182
                        index = self.getIndexByValue(self.ui.comboBox_Velocity, attr[1]['Velocity'])
183
                        if index > -1:
184
                            self.ui.comboBox_Velocity.setCurrentIndex(index)
185

  
186
                        index = self.getIndexByValue(self.ui.comboBox_Pipe_Diameter, attr[1]['Pipe_Diameter'])
187
                        if index > -1:
188
                            self.ui.comboBox_Pipe_Diameter.setCurrentIndex(index)
189

  
190
                        index = self.getIndexByValue(self.ui.comboBox_Length, attr[1]['Length'])
191
                        if index > -1:
192
                            self.ui.comboBox_Length.setCurrentIndex(index)
193

  
194
                        index = self.getIndexByValue(self.ui.comboBox_Roughness, attr[1]['Roughness'])
195
                        if index > -1:
196
                            self.ui.comboBox_Roughness.setCurrentIndex(index)
197
        except Exception as ex:
198
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
199
            self.addMessage.emit(MessageType.Error, message)
200

  
201

  
202
    def getIndexByValue(self, control, value):
203
        return control.findData(value)   
88 204

  
89 205
    def accept(self):   
90
        # To Do List...
91
        # 1. Update Unit attributes in Drawing
92
        # 2. Update DrawingsUnits Table
93
        # 3. Update HMB List
206
        from Drawing import Drawing
207
        
208
        app_Doc_Data = AppDocData.instance()
94 209
        
210
        configs = []                       
211

  
212
        # Units
213
        configs.append(Config('Units', 'Flowrate_Mass', self.ui.comboBox_Flowrate_Mass.currentText()))
214
        configs.append(Config('Units', 'Flowrate_Volume', self.ui.comboBox_Flowrate_Volume.currentText()))
215
        configs.append(Config('Units', 'Density', self.ui.comboBox_Density.currentText()))
216
        configs.append(Config('Units', 'Viscosity', self.ui.comboBox_Viscosity.currentText()))
217
        configs.append(Config('Units', 'Temperature', self.ui.comboBox_Temperature.currentText()))
218
        configs.append(Config('Units', 'Power', self.ui.comboBox_Power.currentText()))
219
        configs.append(Config('Units', 'Pressure', self.ui.comboBox_Pressure.currentText()))
220
        configs.append(Config('Units', 'Velocity', self.ui.comboBox_Velocity.currentText()))
221
        configs.append(Config('Units', 'Pipe_Diameter', self.ui.comboBox_Pipe_Diameter.currentText()))
222
        configs.append(Config('Units', 'Length', self.ui.comboBox_Length.currentText()))
223
        configs.append(Config('Units', 'Roughness', self.ui.comboBox_Roughness.currentText()))
224
        
225
        # Calculation
226
        if self.ui.radioButton_Darcy.isChecked():
227
            configs.append(Config('Calculation', 'Liquid_Drop_Method', 'darcy'))
228
        else:
229
            configs.append(Config('Calculation', 'Liquid_Drop_Method', 'hagen'))
230

  
231

  
232

  
233

  
234
        app_Doc_Data.saveConfigs(configs)
235

  
236
        #app_Doc_Data.activeDrawing.setAttributes()
237
        self.isAccepted = True
238

  
95 239
        QDialog.accept(self)
96 240

  
97 241
    def reject(self):
242
        self.isAccepted = False
98 243
        QDialog.reject(self)        
HYTOS/HYTOS/Configuration_UI.py
539 539
        self.gridLayout_4.addItem(spacerItem5, 1, 0, 1, 1)
540 540
        self.gridLayout.addWidget(self.groupBoxText_2, 0, 0, 1, 1)
541 541
        spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
542
        self.gridLayout.addItem(spacerItem6, 1, 0, 1, 1)
542
        self.gridLayout.addItem(spacerItem6, 2, 0, 1, 1)
543
        self.groupBox_5 = QtWidgets.QGroupBox(self.Unit)
544
        font = QtGui.QFont()
545
        font.setBold(True)
546
        font.setWeight(75)
547
        self.groupBox_5.setFont(font)
548
        self.groupBox_5.setObjectName("groupBox_5")
549
        self.gridLayout_13 = QtWidgets.QGridLayout(self.groupBox_5)
550
        self.gridLayout_13.setObjectName("gridLayout_13")
551
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
552
        self.verticalLayout_3.setObjectName("verticalLayout_3")
553
        self.checkBox_Data_Convert = QtWidgets.QCheckBox(self.groupBox_5)
554
        font = QtGui.QFont()
555
        font.setBold(False)
556
        font.setWeight(50)
557
        self.checkBox_Data_Convert.setFont(font)
558
        self.checkBox_Data_Convert.setChecked(True)
559
        self.checkBox_Data_Convert.setObjectName("checkBox_Data_Convert")
560
        self.verticalLayout_3.addWidget(self.checkBox_Data_Convert)
561
        self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
562
        self.horizontalLayout_10.setObjectName("horizontalLayout_10")
563
        self.label_17 = QtWidgets.QLabel(self.groupBox_5)
564
        self.label_17.setMinimumSize(QtCore.QSize(190, 0))
565
        self.label_17.setMaximumSize(QtCore.QSize(190, 16777215))
566
        font = QtGui.QFont()
567
        font.setBold(False)
568
        font.setWeight(50)
569
        self.label_17.setFont(font)
570
        self.label_17.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
571
        self.label_17.setObjectName("label_17")
572
        self.horizontalLayout_10.addWidget(self.label_17)
573
        self.comboBox_Decimal = QtWidgets.QComboBox(self.groupBox_5)
574
        self.comboBox_Decimal.setMinimumSize(QtCore.QSize(60, 0))
575
        self.comboBox_Decimal.setMaximumSize(QtCore.QSize(60, 16777215))
576
        font = QtGui.QFont()
577
        font.setBold(False)
578
        font.setWeight(50)
579
        self.comboBox_Decimal.setFont(font)
580
        self.comboBox_Decimal.setObjectName("comboBox_Decimal")
581
        self.horizontalLayout_10.addWidget(self.comboBox_Decimal)
582
        self.label_Decimal_Expression = QtWidgets.QLabel(self.groupBox_5)
583
        font = QtGui.QFont()
584
        font.setBold(False)
585
        font.setWeight(50)
586
        self.label_Decimal_Expression.setFont(font)
587
        self.label_Decimal_Expression.setObjectName("label_Decimal_Expression")
588
        self.horizontalLayout_10.addWidget(self.label_Decimal_Expression)
589
        self.verticalLayout_3.addLayout(self.horizontalLayout_10)
590
        self.gridLayout_13.addLayout(self.verticalLayout_3, 0, 0, 1, 1)
591
        self.gridLayout.addWidget(self.groupBox_5, 1, 0, 1, 1)
543 592
        self.tabWidget.addTab(self.Unit, "")
593
        self.tab = QtWidgets.QWidget()
594
        self.tab.setObjectName("tab")
595
        self.gridLayout_12 = QtWidgets.QGridLayout(self.tab)
596
        self.gridLayout_12.setObjectName("gridLayout_12")
597
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
598
        self.verticalLayout_2.setObjectName("verticalLayout_2")
599
        self.groupBox_4 = QtWidgets.QGroupBox(self.tab)
600
        font = QtGui.QFont()
601
        font.setBold(True)
602
        font.setWeight(75)
603
        self.groupBox_4.setFont(font)
604
        self.groupBox_4.setObjectName("groupBox_4")
605
        self.gridLayout_14 = QtWidgets.QGridLayout(self.groupBox_4)
606
        self.gridLayout_14.setObjectName("gridLayout_14")
607
        self.label_10 = QtWidgets.QLabel(self.groupBox_4)
608
        font = QtGui.QFont()
609
        font.setBold(False)
610
        font.setWeight(50)
611
        self.label_10.setFont(font)
612
        self.label_10.setObjectName("label_10")
613
        self.gridLayout_14.addWidget(self.label_10, 0, 0, 1, 1)
614
        self.radioButton_Darcy = QtWidgets.QRadioButton(self.groupBox_4)
615
        font = QtGui.QFont()
616
        font.setBold(False)
617
        font.setWeight(50)
618
        self.radioButton_Darcy.setFont(font)
619
        self.radioButton_Darcy.setChecked(True)
620
        self.radioButton_Darcy.setObjectName("radioButton_Darcy")
621
        self.gridLayout_14.addWidget(self.radioButton_Darcy, 1, 0, 1, 1)
622
        self.radioButton_Hagen = QtWidgets.QRadioButton(self.groupBox_4)
623
        font = QtGui.QFont()
624
        font.setBold(False)
625
        font.setWeight(50)
626
        self.radioButton_Hagen.setFont(font)
627
        self.radioButton_Hagen.setObjectName("radioButton_Hagen")
628
        self.gridLayout_14.addWidget(self.radioButton_Hagen, 2, 0, 1, 1)
629
        self.verticalLayout_2.addWidget(self.groupBox_4)
630
        spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
631
        self.verticalLayout_2.addItem(spacerItem7)
632
        self.gridLayout_12.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
633
        self.tabWidget.addTab(self.tab, "")
544 634
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.SpanningRole, self.tabWidget)
545 635
        self.buttonBox = QtWidgets.QDialogButtonBox(ConfigurationDialog)
546 636
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
......
608 698
        self.label_12.setText(_translate("ConfigurationDialog", "Flowrate (Mass) :"))
609 699
        self.label_11.setText(_translate("ConfigurationDialog", "Power :"))
610 700
        self.label_13.setText(_translate("ConfigurationDialog", "Flowrate (Volume) :"))
611
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.Unit), _translate("ConfigurationDialog", "Unit"))
701
        self.groupBox_5.setTitle(_translate("ConfigurationDialog", "Data Conversion"))
702
        self.checkBox_Data_Convert.setText(_translate("ConfigurationDialog", "Convert all of the values inputted and calculated"))
703
        self.label_17.setText(_translate("ConfigurationDialog", "Decimal point after conversion :"))
704
        self.label_Decimal_Expression.setText(_translate("ConfigurationDialog", "(From current Value to 0.XXXXXXXXX)"))
705
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.Unit), _translate("ConfigurationDialog", "Units"))
706
        self.groupBox_4.setTitle(_translate("ConfigurationDialog", "Liquid Pressure Drop"))
707
        self.label_10.setText(_translate("ConfigurationDialog", "- Select the friction loss equation."))
708
        self.radioButton_Darcy.setText(_translate("ConfigurationDialog", "Darcy Equation (General Design)"))
709
        self.radioButton_Hagen.setText(_translate("ConfigurationDialog", "Hagen-Williams Equation (Water Design)"))
710
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("ConfigurationDialog", "Calculation"))
612 711
import Resource_rc
HYTOS/HYTOS/Drawing.py
22 22
        self.allItems = []
23 23
        self._hmbTable = None
24 24
       
25
        self.setUnits(self.UID)
26

  
27 25
    def clearItemList(self):
28 26
        self.allItems.clear()
29 27
        
30
    def setUnits(self, uid):
28
    def setAttributes(self):
31 29
        value = {}
32 30

  
33
        unitsList = AppDocData.instance().getDrawingsUnitsByDrawingUID(self)
31
        unitsList = AppDocData.instance().getConfigs('Units')
34 32
        for units in unitsList:            
35
            value[units[0]] = units[1]
33
            value[units.key] = units.value
36 34

  
37 35
        if len(value) > 0:
38 36
            self.setAttr('Units', value)        
HYTOS/HYTOS/MainWindow.py
144 144
        # up to here
145 145

  
146 146
    def setMainWindowTitle(self, drawingName = None):
147
        
148
        #         
149
        _translate = QCoreApplication.translate
150
             
151
        version = QCoreApplication.applicationVersion()
152
        if drawingName is None:
153
            self.setWindowTitle(_translate(App.NAME  + "({})".format(version), App.NAME + "({})".format(version)))
154
        else:
155
            #drawingName = drawingName.encode('utf-8')            
156
            self.setWindowTitle(_translate(App.NAME  + "({}) - {}".format(version, drawingName), App.NAME + "({}) - {}".format(version, drawingName)))
157

  
158

  
147
        try:
148
            _translate = QCoreApplication.translate
149
                
150
            version = QCoreApplication.applicationVersion()
151
            if drawingName is None:
152
                self.setWindowTitle(_translate(App.NAME  + "({})".format(version), App.NAME + "({})".format(version)))
153
            else:     
154
                self.setWindowTitle(_translate(App.NAME  + "({})".format(version), App.NAME + "({})".format(version)) + ' - {}'.format(drawingName))
155
        except Exception as ex:
156
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
157
            self.addMessage.emit(MessageType.Error, message)
159 158

  
160 159
    def openContextMenu(self, position):
161 160
        indexes = self.treeWidgetDrawingList.selectedIndexes()
......
681 680
    '''
682 681
    def configuration(self):
683 682
        from ConfigurationDialog import QConfigurationDialog
683
        try:
684
            appDocData = AppDocData.instance()
685
            if appDocData.activeDrawing is None:
686
                self.showImageSelectionMessageBox()
687
                return
688
                
689
            dlg = QConfigurationDialog(self)        
690
            (isAccepted, isDataConversion, decimal) = dlg.showDialog()
691
            if isAccepted == True:                
692
                if isDataConversion == True:                    
693
                    self.data_conversion(decimal)
694
                else:
695
                    self.reload_units()
696

  
697
        except Exception as ex:
698
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
699
            self.addMessage.emit(MessageType.Error, message)
700

  
701

  
702
    def data_conversion(self, decimal):
703
        from Drawing import Drawing
704
        from Calculation import Conversion
705

  
706
        try:
707
            app_doc_data = AppDocData.instance()
708
            drawing = app_doc_data.activeDrawing
709
                
710
            hmbs = drawing.hmbTable._hmbs
711
            if hmbs is not None:            
712
                for hmb in hmbs:     
713
                    Conversion(hmb, decimal)                
714

  
715
            self.load_HMB()
716
            self.reload_units()
717

  
718

  
719
        except Exception as ex:
720
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
721
            self.addMessage.emit(MessageType.Error, message)
684 722

  
685
        appDocData = AppDocData.instance()
686
        if appDocData.activeDrawing is None:
687
            self.showImageSelectionMessageBox()
688
            return
689
            
690
        self.dlgConfiguration = QConfigurationDialog(self)        
691
        self.dlgConfiguration.exec_()
692
        
693 723

  
694 724
    '''
695 725
        @brief  Show Image Selection Guide MessageBox
......
741 771
        img = Image.new('RGBA', (1189, 841), (255, 255, 255))        
742 772
        img.save(border)
743 773

  
774
    def setAttributes(self, drawing):
775
        drawing.setAttributes()
776

  
777
    '''
778
        @brief      Reload HMB Units 
779
        @author     yeonjin
780
        @date       2019.07.10
781
    '''
782
    def reload_units(self):
783
        from Drawing import Drawing
784

  
785
        try:
786
            app_doc_data = AppDocData.instance()
787
            drawing = app_doc_data.activeDrawing
788
                
789
            self.setAttributes(drawing)
790

  
791
            columnInfos = app_doc_data.getHMBDisplayNameAndUnitsExpression()
792
            
793
            rowIndex = 0
794
            for columnInfo in columnInfos:      
795
                name = columnInfo[0]
796
                unit = self.convertToUnits(columnInfo[1])
797
                
798
                self.tableWidgetHMB.setItem(rowIndex, 0, self.setTableWidgetItemProperties(name, Qt.AlignLeft | Qt.AlignVCenter, QColor(230, 230, 230)))
799
                self.tableWidgetHMB.setItem(rowIndex, 1, self.setTableWidgetItemProperties(unit, Qt.AlignHCenter | Qt.AlignVCenter, QColor(230, 230, 230)))
800

  
801
                rowIndex += 1
802
           
803
            self.tableWidgetHMB.resizeColumnsToContents()
804
            self.tableWidgetHMB.resizeRowsToContents()         
805

  
806
        except Exception as ex:
807
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
808
            self.addMessage.emit(MessageType.Error, message)
809

  
744 810
    def load_data(self, drawing):
745 811
        """ load data from drawing """
746 812
        from Drawing import Drawing
......
750 816
                    
751 817
            ## Set appDocData
752 818
            app_doc_data.clear()
753
            self.onCommandRejected()
819
            self.onCommandRejected()            
754 820

  
755
            app_doc_data.activeDrawing = drawing
821
            app_doc_data.activeDrawing = drawing            
822
            
823
            self.setAttributes(drawing)
756 824
            self.setMainWindowTitle(drawing.path)
757 825
            self.initTableWidgetHMB()
758 826
            ## Load data on database     
759 827

  
760 828
            self.symbolTreeWidget.initSymbolTreeWidget()
761 829

  
762

  
763 830
            components = app_doc_data.getComponentListByDrawingUID(drawing)
764 831
            count = len(components)
765 832

  
......
841 908
            app_doc_data = AppDocData.instance()
842 909
            # copy template.db to name
843 910
            copyfile(app_doc_data.getTemplateDbPath(), name)
844

  
911
            
845 912
            matches = [drawing for drawing in app_doc_data.getDrawings() if os.path.exists(drawing.path) and os.path.samefile(drawing.path, name)]
846 913
            if not matches:
847 914
                drawing = Drawing(str(uuid.uuid4()), name, str(datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
......
998 1065
                self.tableWidgetHMB.setItem(26, columnCount, self.setTableWidgetItemProperties(hmb.pressure_pipe_end_point, Qt.AlignHCenter | Qt.AlignVCenter))
999 1066
                self.tableWidgetHMB.setItem(27, columnCount, self.setTableWidgetItemProperties(hmb.power, Qt.AlignHCenter | Qt.AlignVCenter))
1000 1067

  
1068
            self.tableWidgetHMB.resizeColumnsToContents()
1069
            self.tableWidgetHMB.resizeRowsToContents()
1001 1070
    '''
1002 1071
        @brief      refresh scene
1003 1072
        @author     humkyung
HYTOS/HYTOS/OptionsDialog.py
62 62

  
63 63
        configs = docData.getAppConfigs('option', 'TagFontSize')
64 64
        if configs and len(configs) == 1:
65
            index = self.getIndexByValue(configs[0].value)      
66
            if index: 
65
            index = self.ui.comboBox_TagFontSize.findData(configs[0].value)      
66
            if index > -1: 
67 67
                self.ui.comboBox_TagFontSize.setCurrentIndex(index)    
68 68
        
69 69

  
......
71 71
        if configs and len(configs) == 1:
72 72
            self.ui.lineEdit_WorkSpace.setText(configs[0].value)        
73 73

  
74
    def getIndexByValue(self, value):
75
        index = None
76

  
77
        for index in range(self.ui.comboBox_TagFontSize.count()):
78
            if int(self.ui.comboBox_TagFontSize.itemData(index)) == int(value):
79
                return index
80

  
81
        return index
82

  
83 74
    def accept(self):
84 75
        
85 76
        try:
HYTOS/HYTOS/PhaseTypeDialog.py
55 55
                    elif hmb.phase_type == 'Mixed':
56 56
                        self.ui.lineEdit_CurrentType.setText('Mixed (Vapor + Liquid)')
57 57

  
58
                    index = self.getIndexByValue(hmb.phase_type)                                            
59
                    if index:
58
                    index = self.ui.comboBox_PhaseType.findData(hmb.phase_type)                                            
59
                    if index > -1:
60 60
                        self.ui.comboBox_PhaseType.setCurrentIndex(index)
61
                    break
62
            
63
    def getIndexByValue(self, value):
64
        index = None
65

  
66
        for index in range(self.ui.comboBox_PhaseType.count()):
67
            if self.ui.comboBox_PhaseType.itemData(index) == value:
68
                return index
69

  
70
        return index
61
                    break            
71 62

  
72 63
    def accept(self):
73 64
        index = self.ui.comboBox_PhaseType.currentIndex()
HYTOS/HYTOS/Phase_LiquidDialog.py
231 231
                    if hmb.schedule_no:
232 232
                        self.ui.comboBox_Schedule_No.setCurrentText(str(hmb.schedule_no))
233 233
                    if hmb.roughness:
234
                        index = self.getIndexByValue(hmb.roughness)      
235
                        if index:                             
234
                        index = self.ui.comboBox_Roughness.findData(hmb.roughness)
235
                        if index > -1:                             
236 236
                            self.ui.comboBox_Roughness.setCurrentIndex(index)
237 237

  
238

  
239 238
                    break
240 239

  
241
    def getIndexByValue(self, value):
242
        index = None
243

  
244
        for index in range(self.ui.comboBox_Roughness.count()):
245
            if float(self.ui.comboBox_Roughness.itemData(index)) == float(value):
246
                return index
247

  
248
        return index
249

  
250

  
251 240
    def update_HMB(self):
252 241
        from AppDocData import AppDocData
253 242

  
HYTOS/HYTOS/StreamDataDialog.py
22 22
        self.ui.setupUi(self)
23 23
        self.result = False
24 24

  
25
        self.ui.lineEdit_DisplayNo.setFocus()
26

  
27
        self.ui.lineEdit_Flowrate_Mass_Liquid.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Flowrate_Mass_Liquid))
28
        self.ui.lineEdit_Flowrate_Volume.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Flowrate_Volume))
29
        self.ui.lineEdit_Density.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Density))
30
        self.ui.lineEdit_Viscosity_Liquid.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Viscosity_Liquid))
31
        self.ui.lineEdit_Limitation_Velocity.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Limitation_Velocity))
32
        self.ui.lineEdit_Limitation_Pressure_Drop.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Limitation_Pressure_Drop))
33
        self.ui.lineEdit_Inside_Pipe_Size.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Inside_Pipe_Size))
34
        self.ui.lineEdit_Roughness.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Roughness))
35
        self.ui.lineEdit_Straight_Length.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Straight_Length))
36
        self.ui.lineEdit_Equivalent_Length_Input.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Equivalent_Length_Input))
37
        self.ui.lineEdit_Equivalent_Length_Cal.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Equivalent_Length_Cal))
38
        self.ui.lineEdit_Viscosity_Vapor.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Viscosity_Vapor))
39
        self.ui.lineEdit_Specific_Heat_Ratio.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Specific_Heat_Ratio))
40
        self.ui.lineEdit_Molecular_Weight.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Molecular_Weight))
41
        self.ui.lineEdit_Temperature.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Temperature))
42
        self.ui.lineEdit_Compress_Factor.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Compress_Factor))
43

  
44

  
45

  
46

  
47

  
25 48
        self.ui.radioButton_Flowrate_Mass.clicked.connect(self.clickedEvent)
26 49
        self.ui.radioButton_Flowrate_Volume.clicked.connect(self.clickedEvent)
27 50
        self.ui.radioButton_Equivalent_Length_Input.clicked.connect(self.clickedEvent)
......
201 224

  
202 225
                    if hmb.phase_type:
203 226
                        index = self.getIndexByValue(self.ui.comboBox_PhaseType, hmb.phase_type)      
204
                        if index:                             
227
                        if index > -1:                             
205 228
                            self.ui.comboBox_PhaseType.setCurrentIndex(index)
206 229
                    if hmb.flowrate_mass:
207 230
                        self.ui.radioButton_Flowrate_Mass.setChecked(True)
......
240 263
                        self.ui.comboBox_Schedule_No.setCurrentText(str(hmb.schedule_no))
241 264
                    if hmb.roughness:
242 265
                        index = self.getIndexByValue(self.ui.comboBox_Roughness, hmb.roughness)      
243
                        if index:                             
266
                        if index > -1:                             
244 267
                            self.ui.comboBox_Roughness.setCurrentIndex(index)
245 268
                    if hmb.straight_length:
246 269
                        self.ui.lineEdit_Straight_Length.setText(str(hmb.straight_length))                    
......
261 284

  
262 285

  
263 286
    def getIndexByValue(self, control, value):
264
        index = None
287
        return control.findData(value)   
265 288

  
266
        for index in range(control.count()):
267
            if type(value) == float:
268
                if float(control.itemData(index)) == float(value):
269
                    return index
270
            else:
271
                if str(control.itemData(index)) == str(value):
272
                    return index
273
        return index
274 289

  
275 290

  
276 291
    def update_HMB(self):
HYTOS/HYTOS/StreamData_UI.py
13 13
class Ui_Dialog(object):
14 14
    def setupUi(self, Dialog):
15 15
        Dialog.setObjectName("Dialog")
16
        Dialog.resize(688, 419)
16
        Dialog.resize(685, 419)
17
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
18
        sizePolicy.setHorizontalStretch(0)
19
        sizePolicy.setVerticalStretch(0)
20
        sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
21
        Dialog.setSizePolicy(sizePolicy)
17 22
        font = QtGui.QFont()
18 23
        font.setFamily("맑은 고딕")
19 24
        Dialog.setFont(font)
......
763 768
        self.buttonBox.accepted.connect(Dialog.accept)
764 769
        self.buttonBox.rejected.connect(Dialog.reject)
765 770
        QtCore.QMetaObject.connectSlotsByName(Dialog)
771
        Dialog.setTabOrder(self.lineEdit_DisplayNo, self.comboBox_PhaseType)
772
        Dialog.setTabOrder(self.comboBox_PhaseType, self.radioButton_Flowrate_Mass)
773
        Dialog.setTabOrder(self.radioButton_Flowrate_Mass, self.lineEdit_Flowrate_Mass_Liquid)
774
        Dialog.setTabOrder(self.lineEdit_Flowrate_Mass_Liquid, self.radioButton_Flowrate_Volume)
775
        Dialog.setTabOrder(self.radioButton_Flowrate_Volume, self.lineEdit_Flowrate_Volume)
776
        Dialog.setTabOrder(self.lineEdit_Flowrate_Volume, self.lineEdit_Density)
777
        Dialog.setTabOrder(self.lineEdit_Density, self.lineEdit_Viscosity_Liquid)
778
        Dialog.setTabOrder(self.lineEdit_Viscosity_Liquid, self.lineEdit_Flowrate_Mass_Vapor)
779
        Dialog.setTabOrder(self.lineEdit_Flowrate_Mass_Vapor, self.lineEdit_Viscosity_Vapor)
780
        Dialog.setTabOrder(self.lineEdit_Viscosity_Vapor, self.lineEdit_Specific_Heat_Ratio)
781
        Dialog.setTabOrder(self.lineEdit_Specific_Heat_Ratio, self.lineEdit_Molecular_Weight)
782
        Dialog.setTabOrder(self.lineEdit_Molecular_Weight, self.lineEdit_Temperature)
783
        Dialog.setTabOrder(self.lineEdit_Temperature, self.lineEdit_Compress_Factor)
784
        Dialog.setTabOrder(self.lineEdit_Compress_Factor, self.lineEdit_Limitation_Velocity)
785
        Dialog.setTabOrder(self.lineEdit_Limitation_Velocity, self.lineEdit_Limitation_Pressure_Drop)
786
        Dialog.setTabOrder(self.lineEdit_Limitation_Pressure_Drop, self.radioButton_Equivalent_Length_Input)
787
        Dialog.setTabOrder(self.radioButton_Equivalent_Length_Input, self.radioButton_Equivalent_Length_Cal)
788
        Dialog.setTabOrder(self.radioButton_Equivalent_Length_Cal, self.comboBox_Nominal_Pipe_Size)
789
        Dialog.setTabOrder(self.comboBox_Nominal_Pipe_Size, self.comboBox_Schedule_No)
790
        Dialog.setTabOrder(self.comboBox_Schedule_No, self.lineEdit_Inside_Pipe_Size)
791
        Dialog.setTabOrder(self.lineEdit_Inside_Pipe_Size, self.comboBox_Roughness)
792
        Dialog.setTabOrder(self.comboBox_Roughness, self.lineEdit_Roughness)
793
        Dialog.setTabOrder(self.lineEdit_Roughness, self.pushButton_Roughness)
794
        Dialog.setTabOrder(self.pushButton_Roughness, self.lineEdit_Straight_Length)
795
        Dialog.setTabOrder(self.lineEdit_Straight_Length, self.lineEdit_Equivalent_Length_Input)
796
        Dialog.setTabOrder(self.lineEdit_Equivalent_Length_Input, self.pushButton_Fitting)
797
        Dialog.setTabOrder(self.pushButton_Fitting, self.lineEdit_Fitting)
798
        Dialog.setTabOrder(self.lineEdit_Fitting, self.lineEdit_Equivalent_Length_Cal)
799
        Dialog.setTabOrder(self.lineEdit_Equivalent_Length_Cal, self.pushButton)
766 800

  
767 801
    def retranslateUi(self, Dialog):
768 802
        _translate = QtCore.QCoreApplication.translate
HYTOS/HYTOS/UI/Configuration.ui
500 500
     </widget>
501 501
     <widget class="QWidget" name="Unit">
502 502
      <attribute name="title">
503
       <string>Unit</string>
503
       <string>Units</string>
504 504
      </attribute>
505 505
      <layout class="QGridLayout" name="gridLayout">
506 506
       <item row="0" column="0">
......
975 975
         </layout>
976 976
        </widget>
977 977
       </item>
978
       <item row="1" column="0">
978
       <item row="2" column="0">
979 979
        <spacer name="verticalSpacer_3">
980 980
         <property name="orientation">
981 981
          <enum>Qt::Vertical</enum>
......
988 988
         </property>
989 989
        </spacer>
990 990
       </item>
991
       <item row="1" column="0">
992
        <widget class="QGroupBox" name="groupBox_5">
993
         <property name="font">
994
          <font>
995
           <weight>75</weight>
996
           <bold>true</bold>
997
          </font>
998
         </property>
999
         <property name="title">
1000
          <string>Data Conversion</string>
1001
         </property>
1002
         <layout class="QGridLayout" name="gridLayout_13">
1003
          <item row="0" column="0">
1004
           <layout class="QVBoxLayout" name="verticalLayout_3">
1005
            <item>
1006
             <widget class="QCheckBox" name="checkBox_Data_Convert">
1007
              <property name="font">
1008
               <font>
1009
                <weight>50</weight>
1010
                <bold>false</bold>
1011
               </font>
1012
              </property>
1013
              <property name="text">
1014
               <string>Convert all of the values inputted and calculated</string>
1015
              </property>
1016
              <property name="checked">
1017
               <bool>true</bool>
1018
              </property>
1019
             </widget>
1020
            </item>
1021
            <item>
1022
             <layout class="QHBoxLayout" name="horizontalLayout_10">
1023
              <item>
1024
               <widget class="QLabel" name="label_17">
1025
                <property name="minimumSize">
1026
                 <size>
1027
                  <width>190</width>
1028
                  <height>0</height>
1029
                 </size>
1030
                </property>
1031
                <property name="maximumSize">
1032
                 <size>
1033
                  <width>190</width>
1034
                  <height>16777215</height>
1035
                 </size>
1036
                </property>
1037
                <property name="font">
1038
                 <font>
1039
                  <weight>50</weight>
1040
                  <bold>false</bold>
1041
                 </font>
1042
                </property>
1043
                <property name="text">
1044
                 <string>Decimal point after conversion :</string>
1045
                </property>
1046
                <property name="alignment">
1047
                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
1048
                </property>
1049
               </widget>
1050
              </item>
1051
              <item>
1052
               <widget class="QComboBox" name="comboBox_Decimal">
1053
                <property name="minimumSize">
1054
                 <size>
1055
                  <width>60</width>
1056
                  <height>0</height>
1057
                 </size>
1058
                </property>
1059
                <property name="maximumSize">
1060
                 <size>
1061
                  <width>60</width>
1062
                  <height>16777215</height>
1063
                 </size>
1064
                </property>
1065
                <property name="font">
1066
                 <font>
1067
                  <weight>50</weight>
1068
                  <bold>false</bold>
1069
                 </font>
1070
                </property>
1071
               </widget>
1072
              </item>
1073
              <item>
1074
               <widget class="QLabel" name="label_Decimal_Expression">
1075
                <property name="font">
1076
                 <font>
1077
                  <weight>50</weight>
1078
                  <bold>false</bold>
1079
                 </font>
1080
                </property>
1081
                <property name="text">
1082
                 <string>(From current Value to 0.XXXXXXXXX)</string>
1083
                </property>
1084
               </widget>
1085
              </item>
1086
             </layout>
1087
            </item>
1088
           </layout>
1089
          </item>
1090
         </layout>
1091
        </widget>
1092
       </item>
1093
      </layout>
1094
     </widget>
1095
     <widget class="QWidget" name="tab">
1096
      <attribute name="title">
1097
       <string>Calculation</string>
1098
      </attribute>
1099
      <layout class="QGridLayout" name="gridLayout_12">
1100
       <item row="0" column="0">
1101
        <layout class="QVBoxLayout" name="verticalLayout_2">
1102
         <item>
1103
          <widget class="QGroupBox" name="groupBox_4">
1104
           <property name="font">
1105
            <font>
1106
             <weight>75</weight>
1107
             <bold>true</bold>
1108
            </font>
1109
           </property>
1110
           <property name="title">
1111
            <string>Liquid Pressure Drop</string>
1112
           </property>
1113
           <layout class="QGridLayout" name="gridLayout_14">
1114
            <item row="0" column="0">
1115
             <widget class="QLabel" name="label_10">
1116
              <property name="font">
1117
               <font>
1118
                <weight>50</weight>
1119
                <bold>false</bold>
1120
               </font>
1121
              </property>
1122
              <property name="text">
1123
               <string>- Select the friction loss equation.</string>
1124
              </property>
1125
             </widget>
1126
            </item>
1127
            <item row="1" column="0">
1128
             <widget class="QRadioButton" name="radioButton_Darcy">
1129
              <property name="font">
1130
               <font>
1131
                <weight>50</weight>
1132
                <bold>false</bold>
1133
               </font>
1134
              </property>
1135
              <property name="text">
1136
               <string>Darcy Equation (General Design)</string>
1137
              </property>
1138
              <property name="checked">
1139
               <bool>true</bool>
1140
              </property>
1141
             </widget>
1142
            </item>
1143
            <item row="2" column="0">
1144
             <widget class="QRadioButton" name="radioButton_Hagen">
1145
              <property name="font">
1146
               <font>
1147
                <weight>50</weight>
1148
                <bold>false</bold>
1149
               </font>
1150
              </property>
1151
              <property name="text">
1152
               <string>Hagen-Williams Equation (Water Design)</string>
1153
              </property>
1154
             </widget>
1155
            </item>
1156
           </layout>
1157
          </widget>
1158
         </item>
1159
         <item>
1160
          <spacer name="verticalSpacer_8">
1161
           <property name="orientation">
1162
            <enum>Qt::Vertical</enum>
1163
           </property>
1164
           <property name="sizeHint" stdset="0">
1165
            <size>
1166
             <width>20</width>
1167
             <height>40</height>
1168
            </size>
1169
           </property>
1170
          </spacer>
1171
         </item>
1172
        </layout>
1173
       </item>
991 1174
      </layout>
992 1175
     </widget>
993 1176
    </widget>
HYTOS/HYTOS/UI/StreamData.ui
6 6
   <rect>
7 7
    <x>0</x>
8 8
    <y>0</y>
9
    <width>688</width>
9
    <width>685</width>
10 10
    <height>419</height>
11 11
   </rect>
12 12
  </property>
......
1843 1843
   </layout>
1844 1844
  </widget>
1845 1845
 </widget>
1846
 <tabstops>
1847
  <tabstop>lineEdit_DisplayNo</tabstop>
1848
  <tabstop>comboBox_PhaseType</tabstop>
1849
  <tabstop>radioButton_Flowrate_Mass</tabstop>
1850
  <tabstop>lineEdit_Flowrate_Mass_Liquid</tabstop>
1851
  <tabstop>radioButton_Flowrate_Volume</tabstop>
1852
  <tabstop>lineEdit_Flowrate_Volume</tabstop>
1853
  <tabstop>lineEdit_Density</tabstop>
1854
  <tabstop>lineEdit_Viscosity_Liquid</tabstop>
1855
  <tabstop>lineEdit_Flowrate_Mass_Vapor</tabstop>
1856
  <tabstop>lineEdit_Viscosity_Vapor</tabstop>
1857
  <tabstop>lineEdit_Specific_Heat_Ratio</tabstop>
1858
  <tabstop>lineEdit_Molecular_Weight</tabstop>
1859
  <tabstop>lineEdit_Temperature</tabstop>
1860
  <tabstop>lineEdit_Compress_Factor</tabstop>
1861
  <tabstop>lineEdit_Limitation_Velocity</tabstop>
1862
  <tabstop>lineEdit_Limitation_Pressure_Drop</tabstop>
1863
  <tabstop>radioButton_Equivalent_Length_Input</tabstop>
1864
  <tabstop>radioButton_Equivalent_Length_Cal</tabstop>
1865
  <tabstop>comboBox_Nominal_Pipe_Size</tabstop>
1866
  <tabstop>comboBox_Schedule_No</tabstop>
1867
  <tabstop>lineEdit_Inside_Pipe_Size</tabstop>
1868
  <tabstop>comboBox_Roughness</tabstop>
1869
  <tabstop>lineEdit_Roughness</tabstop>
1870
  <tabstop>pushButton_Roughness</tabstop>
1871
  <tabstop>lineEdit_Straight_Length</tabstop>
1872
  <tabstop>lineEdit_Equivalent_Length_Input</tabstop>
1873
  <tabstop>pushButton_Fitting</tabstop>
1874
  <tabstop>lineEdit_Fitting</tabstop>
1875
  <tabstop>lineEdit_Equivalent_Length_Cal</tabstop>
1876
  <tabstop>pushButton</tabstop>
1877
 </tabstops>
1846 1878
 <resources>
1847 1879
  <include location="../res/Resource.qrc"/>
1848 1880
 </resources>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)