프로젝트

일반

사용자정보

개정판 ba7a627d

IDba7a627dc79913143ecd6c0ee57a5cb652cc6d39
상위 2ae25ea5
하위 f75bc2f6

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

issue #1263 Unit 변경

Change-Id: I3115d97e652548f2339713e1b26a0804950b1dc6

차이점 보기:

HYTOS/HYTOS/BatteryLimit_UI.py
57 57
        self.label_5.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
58 58
        self.label_5.setObjectName("label_5")
59 59
        self.label_ElevationUnit = QtWidgets.QLabel(self.groupBox)
60
        self.label_ElevationUnit.setGeometry(QtCore.QRect(276, 88, 16, 16))
60
        self.label_ElevationUnit.setGeometry(QtCore.QRect(276, 88, 61, 16))
61 61
        font = QtGui.QFont()
62 62
        font.setBold(False)
63 63
        font.setWeight(50)
HYTOS/HYTOS/Calculation.py
79 79
                        hmb.pressure_pipe_end_point = self.convert_pressure(hmb.pressure_pipe_end_point)
80 80
                    if hmb.power:
81 81
                        hmb.power = self.convert_power(hmb.power)
82
                    # Mixed Data
83
                    if hmb.vapor_flowrate_mass:
84
                        hmb.vapor_flowrate_mass = self.convert_flowrate_mass(hmb.vapor_flowrate_mass)
85
                    if hmb.vapor_density:
86
                        hmb.vapor_density = self.convert_density(hmb.vapor_density)
87
                    if hmb.vapor_viscosity:
88
                        hmb.vapor_viscosity = self.convert_viscosity(hmb.vapor_viscosity)
89
                    if hmb.vapor_pressure:
90
                        hmb.vapor_pressure = self.convert_pressure(hmb.vapor_pressure)
91
                    if hmb.vapor_temperature:
92
                        hmb.vapor_temperature = self.convert_temperature(hmb.vapor_temperature)
93
                    if hmb.liquid_flowrate_mass:
94
                        hmb.liquid_flowrate_mass = self.convert_flowrate_mass(hmb.liquid_flowrate_mass)
95
                    if hmb.liquid_density:
96
                        hmb.liquid_density = self.convert_density(hmb.liquid_density)
97
                    if hmb.liquid_viscosity:
98
                        hmb.liquid_viscosity = self.convert_viscosity(hmb.liquid_viscosity)
82 99

  
83 100
        except Exception as ex:
84 101
            from App import App
......
95 112
        if pre_unit == cur_unit:
96 113
            return value
97 114

  
115
        if is_string(value):
116
            return value
117

  
98 118
        if pre_unit == 'kg/h':
99 119
            if cur_unit == 'g/min':
100 120
                convert_factor = 16.6667
......
133 153
        if pre_unit == cur_unit:
134 154
            return value
135 155

  
156
        if is_string(value):
157
            return value
158

  
136 159
        if pre_unit == 'm3/h':
137 160
            if cur_unit == 'l/min':
138 161
                convert_factor = 16.6667
......
188 211
        if pre_unit == cur_unit:
189 212
            return value
190 213

  
214
        if is_string(value):
215
            return value
216

  
191 217
        if pre_unit == 'kg/m3':
192 218
            if cur_unit == 'lb/ft3': convert_factor = 0.06242797
193 219
        elif pre_unit == 'lb/ft3':
......
202 228
        if pre_unit == cur_unit:
203 229
            return value
204 230

  
231
        if is_string(value):
232
            return value
233

  
205 234
        if pre_unit == 'cP':
206 235
            if cur_unit == 'kg/m.sec':
207 236
                convert_factor = 0.001
......
240 269
        if pre_unit == cur_unit:
241 270
            return value
242 271

  
272
        if is_string(value):
273
            return value
274

  
243 275
        if cur_unit == '℉':
244 276
            return round(1.8 * value + 32, self._decimal)
245 277
        elif cur_unit == '℃':
......
252 284
        if pre_unit == cur_unit:
253 285
            return value
254 286

  
287
        if is_string(value):
288
            return value
289

  
255 290
        if pre_unit == 'in':
256 291
            if cur_unit == 'mm': convert_factor = 25.4
257 292
        elif pre_unit == 'mm':
......
266 301
        if pre_unit == cur_unit:
267 302
            return value
268 303

  
304
        if is_string(value):
305
            return value
306

  
269 307
        if pre_unit == 'in':
270 308
            if cur_unit == 'm':
271 309
                convert_factor = 0.0254
......
342 380
        if pre_unit == cur_unit:
343 381
            return value
344 382

  
383
        if is_string(value):
384
            return value
385

  
345 386
        if pre_unit == 'in':
346 387
            if cur_unit == 'm':
347 388
                convert_factor = 0.0254
......
380 421
        if pre_unit == cur_unit:
381 422
            return value
382 423

  
424
        if is_string(value):
425
            return value
426

  
383 427
        if pre_unit == 'm/s':
384 428
            if cur_unit == 'ft/s': convert_factor = 3.28084
385 429
        elif pre_unit == 'ft/s':
......
394 438
        if pre_unit == cur_unit:
395 439
            return value
396 440

  
441
        if is_string(value):
442
            return value
443

  
397 444
        if pre_unit == 'kg/cm2':
398 445
            if cur_unit == 'psi':
399 446
                convert_factor = 14.22334
......
495 542
        if pre_unit == cur_unit:
496 543
            return value
497 544

  
545
        if is_string(value):
546
            return value
547

  
498 548
        if pre_unit == 'kW':
499 549
            if cur_unit == 'kcal/h':
500 550
                convert_factor = 860.4207
......
579 629
                            connector.data.pressure_drop = self.convert_pressure(connector.data.pressure_drop)
580 630
                        if connector.data.elevation:
581 631
                            connector.data.elevation = self.convert_length(connector.data.elevation)
632
                        if connector.data.over_design_cv:
633
                            connector.data.over_design_cv = self.convert_pressure(connector.data.over_design_cv)
582 634

  
583 635
        except Exception as ex:
584 636
            from App import App
......
621 673
            App.mainWnd().addMessage.emit(MessageType.Error, message)
622 674

  
623 675

  
676
def is_string(s):
677
    return isinstance(s, str)
678

  
679

  
624 680
def is_blank(s):
625 681
    return not (s and s.strip())
626 682

  
HYTOS/HYTOS/MainWindow.py
1077 1077
                                                           sys.exc_info()[-1].tb_lineno)
1078 1078
            self.addMessage.emit(MessageType.Error, message)
1079 1079

  
1080
    def change_output_font_color(self):
1081
        try:
1082
            row_count = self.tableWidgetDeviation.rowCount()
1083
            col_count = self.tableWidgetDeviation.columnCount()
1084
            for row in range(row_count):
1085
                for col in range(col_count):
1086
                    if row == 0:
1087
                        item = self.tableWidgetDeviation.item(row, col)
1088
                        item.setText('RUN CALCULATION')
1089
                        item.setForeground(Qt.red)
1090
                        self.tableWidgetDeviation.setItem(row, col, item)
1091
                    else:
1092
                        self.tableWidgetDeviation.item(row, col).setForeground(QBrush(QColor(169, 169, 169)))
1093

  
1094
            row_count = self.tableWidgetOutput.rowCount()
1095
            col_count = self.tableWidgetOutput.columnCount()
1096
            for row in range(row_count):
1097
                for col in range(col_count):
1098
                    self.tableWidgetOutput.item(row, col).setForeground(QBrush(QColor(169, 169, 169)))
1099
                    col_span = self.tableWidgetOutput.columnSpan(row, col)
1100
                    if col_span > 1:
1101
                        break
1102
        except Exception as ex:
1103
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
1104
                                                           sys.exc_info()[-1].tb_lineno)
1105
            self.addMessage.emit(MessageType.Error, message)
1106

  
1080 1107
    def calculation(self, saving=False):
1081 1108
        """execute hydro calculation"""
1082 1109
        from AppDocData import AppDocData
......
2001 2028

  
2002 2029
    def configuration(self):
2003 2030
        from ConfigurationDialog import QConfigurationDialog
2031
        from Calculation import Conversion
2032

  
2004 2033
        try:
2005 2034
            appDocData = AppDocData.instance()
2006 2035
            if appDocData.activeDrawing is None:
......
2011 2040
            (isAccepted, isDataConversion, decimal) = dlg.show_dialog()
2012 2041
            if isAccepted == True:
2013 2042
                if isDataConversion == True:
2014
                    self.data_conversion(decimal)
2015
                else:
2016
                    self.reload_units()
2017

  
2018
        except Exception as ex:
2019
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
2020
                                                           sys.exc_info()[-1].tb_lineno)
2021
            self.addMessage.emit(MessageType.Error, message)
2022

  
2023
    def data_conversion(self, decimal):
2024
        from Drawing import Drawing
2025
        from Calculation import Conversion
2026

  
2027
        try:
2028
            Conversion(decimal)
2029

  
2030
            self.load_HMB()
2031
            self.reload_units()
2043
                    Conversion(decimal)
2044
                    self.load_HMB()
2032 2045

  
2046
                self.reload_units()
2047
                self.update_label_contents()
2048
                self.change_output_font_color()
2033 2049
        except Exception as ex:
2034 2050
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
2035 2051
                                                           sys.exc_info()[-1].tb_lineno)
HYTOS/HYTOS/Pump_UI.py
52 52
        self.lineEdit_Elevation.setAlignment(QtCore.Qt.AlignCenter)
53 53
        self.lineEdit_Elevation.setObjectName("lineEdit_Elevation")
54 54
        self.label_ElevationUnit = QtWidgets.QLabel(self.groupBox)
55
        self.label_ElevationUnit.setGeometry(QtCore.QRect(338, 88, 16, 16))
55
        self.label_ElevationUnit.setGeometry(QtCore.QRect(338, 88, 65, 16))
56 56
        font = QtGui.QFont()
57 57
        font.setBold(False)
58 58
        font.setWeight(50)
......
98 98
        self.lineEdit_Pressure_Drop.setAlignment(QtCore.Qt.AlignCenter)
99 99
        self.lineEdit_Pressure_Drop.setObjectName("lineEdit_Pressure_Drop")
100 100
        self.label_PressureUnit = QtWidgets.QLabel(self.groupBox)
101
        self.label_PressureUnit.setGeometry(QtCore.QRect(338, 59, 49, 16))
101
        self.label_PressureUnit.setGeometry(QtCore.QRect(338, 59, 65, 16))
102 102
        font = QtGui.QFont()
103 103
        font.setBold(False)
104 104
        font.setWeight(50)
HYTOS/HYTOS/Shapes/SymbolSvgItem.py
691 691

  
692 692
        # clear labels
693 693
        for conn, label in self.desc_labels.items():
694
            """reset all of nozzle descriptions"""
695
            conn.data.desc = None
694 696
            label.setEnabled(False)
695 697

  
696 698
        if self.category == 'Equipment - [ Pressure Drop ]':
......
1412 1414

  
1413 1415
        matches = [func for func in func_map if func[0][0] == self.category and func[0][1] == self.type and
1414 1416
                   (func[0][2] is None or self.name in func[0][2])]
1415
        if matches: matches[0][1]()
1417
        if matches:
1418
            matches[0][1]()
1416 1419

  
1417
    def reset_nozzle_desc(self) -> None:
1418
        """reset all of nozzle descriptions"""
1420
    def change_output_font_color(self):
1419 1421

  
1420
        for conn, label in self.desc_labels.items():
1421
            conn.data.desc = None
1422
        App.mainWnd().change_output_font_color()
1422 1423

  
1423
    def change_output_font_color(self):
1424
        '''
1424 1425
        row_count = App.mainWnd().tableWidgetDeviation.rowCount()
1425 1426
        col_count = App.mainWnd().tableWidgetDeviation.columnCount()
1426 1427
        for row in range(row_count):
......
1441 1442
                col_span = App.mainWnd().tableWidgetOutput.columnSpan(row, col)
1442 1443
                if col_span > 1:
1443 1444
                    break
1445
        '''
1444 1446

  
1445 1447
    def show_AirFinCooler(self):
1446 1448
        from AirFinCooler import QAirFinCooler
......
1448 1450
        dialog = QAirFinCooler()
1449 1451
        modified = dialog.show_dialog(self)
1450 1452
        if modified:
1451
            self.reset_nozzle_desc()
1452 1453
            self.update_label_contents()
1453 1454
            self.validate()
1454 1455
            self.change_output_font_color()
......
1459 1460
        dialog = QFilter()
1460 1461
        modified = dialog.show_dialog(self)
1461 1462
        if modified:
1462
            self.reset_nozzle_desc()
1463 1463
            self.update_label_contents()
1464 1464
            self.validate()
1465 1465
            self.change_output_font_color()
......
1470 1470
        dialog = QCoil()
1471 1471
        modified = dialog.show_dialog(self)
1472 1472
        if modified:
1473
            self.reset_nozzle_desc()
1474 1473
            self.update_label_contents()
1475 1474
            self.validate()
1476 1475
            self.change_output_font_color()
......
1481 1480
        dialog = QDP_Equipment()
1482 1481
        modified = dialog.show_dialog(self)
1483 1482
        if modified:
1484
            self.reset_nozzle_desc()
1485 1483
            self.update_label_contents()
1486 1484
            self.validate()
1487 1485
            self.change_output_font_color()
......
1492 1490
        dialog = QReactor()
1493 1491
        modified = dialog.show_dialog(self)
1494 1492
        if modified:
1495
            self.reset_nozzle_desc()
1496 1493
            self.update_label_contents()
1497 1494
            self.validate()
1498 1495
            self.change_output_font_color()
......
1503 1500
        dialog = QStrainer_T()
1504 1501
        modified = dialog.show_dialog(self)
1505 1502
        if modified:
1506
            self.reset_nozzle_desc()
1507 1503
            self.update_label_contents()
1508 1504
            self.validate()
1509 1505
            self.change_output_font_color()
......
1514 1510
        dialog = QStrainer_Y()
1515 1511
        modified = dialog.show_dialog(self)
1516 1512
        if modified:
1517
            self.reset_nozzle_desc()
1518 1513
            self.update_label_contents()
1519 1514
            self.validate()
1520 1515
            self.change_output_font_color()
......
1525 1520
        dialog = QBatteryLimit()
1526 1521
        modified = dialog.show_dialog(self)
1527 1522
        if modified:
1528
            self.reset_nozzle_desc()
1529 1523
            self.update_label_contents()
1530 1524
            self.validate()
1531 1525
            self.change_output_font_color()
......
1536 1530
        dialog = QTray()
1537 1531
        modified = dialog.show_dialog(self)
1538 1532
        if modified:
1539
            self.reset_nozzle_desc()
1540 1533
            self.update_label_contents()
1541 1534
            self.validate()
1542 1535
            self.change_output_font_color()
......
1547 1540
        dialog = QSinglePacked()
1548 1541
        modified = dialog.show_dialog(self)
1549 1542
        if modified:
1550
            self.reset_nozzle_desc()
1551 1543
            self.update_label_contents()
1552 1544
            self.validate()
1553 1545
            self.change_output_font_color()
......
1558 1550
        dialog = QDualPacked()
1559 1551
        modified = dialog.show_dialog(self)
1560 1552
        if modified:
1561
            self.reset_nozzle_desc()
1562 1553
            self.update_label_contents()
1563 1554
            self.validate()
1564 1555
            self.change_output_font_color()
......
1569 1560
        dialog = QDrum_Horizontal()
1570 1561
        modified = dialog.show_dialog(self)
1571 1562
        if modified:
1572
            self.reset_nozzle_desc()
1573 1563
            self.update_label_contents()
1574 1564
            self.validate()
1575 1565
            self.change_output_font_color()
......
1580 1570
        dialog = QDrum_Vertical()
1581 1571
        modified = dialog.show_dialog(self)
1582 1572
        if modified:
1583
            self.reset_nozzle_desc()
1584 1573
            self.update_label_contents()
1585 1574
            self.validate()
1586 1575
            self.change_output_font_color()
......
1591 1580
        dialog = QPlateHeatExchanger()
1592 1581
        modified = dialog.show_dialog(self)
1593 1582
        if modified:
1594
            self.reset_nozzle_desc()
1595 1583
            self.update_label_contents()
1596 1584
            self.validate()
1597 1585
            self.change_output_font_color()
......
1602 1590
        dialog = QEquipment()
1603 1591
        modified = dialog.show_dialog(self)
1604 1592
        if modified:
1605
            self.reset_nozzle_desc()
1606 1593
            self.update_label_contents()
1607 1594
            self.validate()
1608 1595
            self.change_output_font_color()
......
1613 1600
        dialog = QBall()
1614 1601
        modified = dialog.show_dialog(self)
1615 1602
        if modified:
1616
            self.reset_nozzle_desc()
1617 1603
            self.update_label_contents()
1618 1604
            self.validate()
1619 1605
            self.change_output_font_color()
......
1624 1610
        dialog = QShlTubHeatExchanger()
1625 1611
        modified = dialog.show_dialog(self)
1626 1612
        if modified:
1627
            self.reset_nozzle_desc()
1628 1613
            self.update_label_contents()
1629 1614
            self.validate()
1630 1615
            self.change_output_font_color()
......
1635 1620
        dialog = QConeRoof()
1636 1621
        modified = dialog.show_dialog(self)
1637 1622
        if modified:
1638
            self.reset_nozzle_desc()
1639 1623
            self.update_label_contents()
1640 1624
            self.validate()
1641 1625
            self.change_output_font_color()
......
1646 1630
        dialog = QDomeRoof()
1647 1631
        modified = dialog.show_dialog(self)
1648 1632
        if modified:
1649
            self.reset_nozzle_desc()
1650 1633
            self.update_label_contents()
1651 1634
            self.validate()
1652 1635
            self.change_output_font_color()
......
1657 1640
        dialog = QCompressor()
1658 1641
        modified = dialog.show_dialog(self)
1659 1642
        if modified:
1660
            self.reset_nozzle_desc()
1661 1643
            self.update_label_contents()
1662 1644
            self.validate()
1663 1645
            self.change_output_font_color()
......
1668 1650
        dialog = QKompressor()
1669 1651
        modified = dialog.show_dialog(self)
1670 1652
        if modified:
1671
            self.reset_nozzle_desc()
1672 1653
            self.update_label_contents()
1673 1654
            self.validate()
1674 1655
            self.change_output_font_color()
......
1679 1660
        dialog = QPump()
1680 1661
        modified = dialog.show_dialog(self)
1681 1662
        if modified:
1682
            self.reset_nozzle_desc()
1683 1663
            self.update_label_contents()
1684 1664
            self.validate()
1685 1665
            self.change_output_font_color()
......
1690 1670
        dialog = QValve_Control()
1691 1671
        modified = dialog.show_dialog(self)
1692 1672
        if modified:
1693
            self.reset_nozzle_desc()
1694 1673
            self.update_label_contents()
1695 1674
            self.validate()
1696 1675
            self.change_output_font_color()
......
1701 1680
        dialog = QValve_Manual()
1702 1681
        modified = dialog.show_dialog(self)
1703 1682
        if modified:
1704
            self.reset_nozzle_desc()
1705 1683
            self.update_label_contents()
1706 1684
            self.validate()
1707 1685
            self.change_output_font_color()
......
1712 1690
        dialog = QLineSplitter()
1713 1691
        modified = dialog.show_dialog(self)
1714 1692
        if modified:
1715
            self.reset_nozzle_desc()
1716 1693
            self.update_label_contents()
1717 1694
            self.validate()
1718 1695
            self.change_output_font_color()
......
1723 1700
        dialog = QFlowmeter()
1724 1701
        modified = dialog.show_dialog(self)
1725 1702
        if modified:
1726
            self.reset_nozzle_desc()
1727 1703
            self.update_label_contents()
1728 1704
            self.validate()
1729 1705
            self.change_output_font_color()
......
1734 1710
        dialog = QReducer()
1735 1711
        modified = dialog.show_dialog(self)
1736 1712
        if modified:
1737
            self.reset_nozzle_desc()
1738 1713
            self.update_label_contents()
1739 1714
            self.validate()
1740 1715
            self.change_output_font_color()
HYTOS/HYTOS/UI/BatteryLimit.ui
154 154
     <rect>
155 155
      <x>276</x>
156 156
      <y>88</y>
157
      <width>16</width>
157
      <width>61</width>
158 158
      <height>16</height>
159 159
     </rect>
160 160
    </property>
HYTOS/HYTOS/UI/Pump.ui
124 124
     <rect>
125 125
      <x>338</x>
126 126
      <y>88</y>
127
      <width>16</width>
127
      <width>65</width>
128 128
      <height>16</height>
129 129
     </rect>
130 130
    </property>
......
262 262
     <rect>
263 263
      <x>338</x>
264 264
      <y>59</y>
265
      <width>49</width>
265
      <width>65</width>
266 266
      <height>16</height>
267 267
     </rect>
268 268
    </property>
version.rc
7 7
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
8 8
# Set not needed items to zero 0.
9 9
# Local Build $BUILD_NUMBER=0
10
filevers=(3,0,0,0),
11
prodvers=(3,0,0,0),
10
filevers=(3,0,1,0),
11
prodvers=(3,0,1,0),
12 12
# Contains a bitmask that specifies the valid bits 'flags'r
13 13
mask=0x3f,
14 14
# Contains a bitmask that specifies the Boolean attributes of the file.
......
32 32
    u'040904B0',
33 33
    [StringStruct(u'CompanyName', u'SECL'),
34 34
    StringStruct(u'FileDescription', u'Hydraulic Calculator'),
35
    StringStruct(u'FileVersion', u'3.0.0.0'),
35
    StringStruct(u'FileVersion', u'3.0.1.0'),
36 36
    StringStruct(u'InternalName', u'HYTOS'),
37 37
    StringStruct(u'LegalCopyright', u'Copyright(c) SECL'),
38 38
    StringStruct(u'OriginalFilename', u'HYTOS.exe'),
39 39
    StringStruct(u'ProductName', u'HYTOS'),
40
    StringStruct(u'ProductVersion', u'3.0.0.0')])
40
    StringStruct(u'ProductVersion', u'3.0.1.0')])
41 41
  ]), 
42 42
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
43 43
  ]

내보내기 Unified diff

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