프로젝트

일반

사용자정보

개정판 64c97ede

ID64c97ede78610e6205a46c21ef274b6980fa5fd8
상위 141c4901
하위 d861bd81, e8c440e4

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

issue #1256 : Control Valve - Opening % Calculation

Change-Id: Ib02aa78bf7ece3ac2cceca270522948e2c81299f

차이점 보기:

HYTOS/HYTOS/UI/Valve_Control.ui
7 7
    <x>0</x>
8 8
    <y>0</y>
9 9
    <width>446</width>
10
    <height>266</height>
10
    <height>270</height>
11 11
   </rect>
12 12
  </property>
13 13
  <property name="font">
......
466 466
    </rect>
467 467
   </property>
468 468
   <property name="text">
469
    <string>Opening% Calculation</string>
469
    <string>Opening % Calculation</string>
470 470
   </property>
471 471
  </widget>
472
  <widget class="QGroupBox" name="groupBox_2">
473
   <property name="enabled">
474
    <bool>true</bool>
475
   </property>
476
   <property name="geometry">
477
    <rect>
478
     <x>8</x>
479
     <y>276</y>
480
     <width>429</width>
481
     <height>197</height>
482
    </rect>
483
   </property>
484
   <property name="title">
485
    <string>Control Valve Opening % Calculation</string>
486
   </property>
487
   <widget class="QLabel" name="label_2">
488
    <property name="geometry">
489
     <rect>
490
      <x>12</x>
491
      <y>32</y>
492
      <width>93</width>
493
      <height>16</height>
494
     </rect>
495
    </property>
496
    <property name="minimumSize">
497
     <size>
498
      <width>93</width>
499
      <height>0</height>
500
     </size>
501
    </property>
502
    <property name="maximumSize">
503
     <size>
504
      <width>93</width>
505
      <height>16777215</height>
506
     </size>
507
    </property>
508
    <property name="text">
509
     <string>Flow Character :</string>
510
    </property>
511
    <property name="alignment">
512
     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
513
    </property>
514
   </widget>
515
   <widget class="QRadioButton" name="radioButton_Linear">
516
    <property name="geometry">
517
     <rect>
518
      <x>112</x>
519
      <y>32</y>
520
      <width>61</width>
521
      <height>16</height>
522
     </rect>
523
    </property>
524
    <property name="text">
525
     <string>Linear</string>
526
    </property>
527
   </widget>
528
   <widget class="QRadioButton" name="radioButton_Equal_Percentage">
529
    <property name="geometry">
530
     <rect>
531
      <x>184</x>
532
      <y>32</y>
533
      <width>129</width>
534
      <height>16</height>
535
     </rect>
536
    </property>
537
    <property name="text">
538
     <string>Equal Percentage</string>
539
    </property>
540
   </widget>
541
   <widget class="QLabel" name="label_4">
542
    <property name="geometry">
543
     <rect>
544
      <x>12</x>
545
      <y>64</y>
546
      <width>93</width>
547
      <height>12</height>
548
     </rect>
549
    </property>
550
    <property name="minimumSize">
551
     <size>
552
      <width>93</width>
553
      <height>0</height>
554
     </size>
555
    </property>
556
    <property name="maximumSize">
557
     <size>
558
      <width>93</width>
559
      <height>16777215</height>
560
     </size>
561
    </property>
562
    <property name="text">
563
     <string>Valve Type :</string>
564
    </property>
565
    <property name="alignment">
566
     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
567
    </property>
568
   </widget>
569
   <widget class="QComboBox" name="comboBox_Valve_Type">
570
    <property name="geometry">
571
     <rect>
572
      <x>112</x>
573
      <y>60</y>
574
      <width>189</width>
575
      <height>22</height>
576
     </rect>
577
    </property>
578
   </widget>
579
   <widget class="QLabel" name="label_6">
580
    <property name="geometry">
581
     <rect>
582
      <x>12</x>
583
      <y>96</y>
584
      <width>93</width>
585
      <height>12</height>
586
     </rect>
587
    </property>
588
    <property name="minimumSize">
589
     <size>
590
      <width>93</width>
591
      <height>0</height>
592
     </size>
593
    </property>
594
    <property name="maximumSize">
595
     <size>
596
      <width>93</width>
597
      <height>16777215</height>
598
     </size>
599
    </property>
600
    <property name="text">
601
     <string>Rangerability :</string>
602
    </property>
603
    <property name="alignment">
604
     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
605
    </property>
606
   </widget>
607
   <widget class="QLineEdit" name="lineEdit_Rangerability">
608
    <property name="enabled">
609
     <bool>true</bool>
610
    </property>
611
    <property name="geometry">
612
     <rect>
613
      <x>112</x>
614
      <y>92</y>
615
      <width>45</width>
616
      <height>20</height>
617
     </rect>
618
    </property>
619
    <property name="alignment">
620
     <set>Qt::AlignCenter</set>
621
    </property>
622
    <property name="readOnly">
623
     <bool>true</bool>
624
    </property>
625
   </widget>
626
   <widget class="QLabel" name="label_7">
627
    <property name="geometry">
628
     <rect>
629
      <x>164</x>
630
      <y>94</y>
631
      <width>145</width>
632
      <height>16</height>
633
     </rect>
634
    </property>
635
    <property name="text">
636
     <string>(ex. 50 : 1 then input 50)</string>
637
    </property>
638
   </widget>
639
   <widget class="QLabel" name="label_11">
640
    <property name="geometry">
641
     <rect>
642
      <x>12</x>
643
      <y>128</y>
644
      <width>93</width>
645
      <height>12</height>
646
     </rect>
647
    </property>
648
    <property name="minimumSize">
649
     <size>
650
      <width>93</width>
651
      <height>0</height>
652
     </size>
653
    </property>
654
    <property name="maximumSize">
655
     <size>
656
      <width>93</width>
657
      <height>16777215</height>
658
     </size>
659
    </property>
660
    <property name="text">
661
     <string>Calculated Cv :</string>
662
    </property>
663
    <property name="alignment">
664
     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
665
    </property>
666
   </widget>
667
   <widget class="QLineEdit" name="lineEdit_Calculated_Cv">
668
    <property name="enabled">
669
     <bool>true</bool>
670
    </property>
671
    <property name="geometry">
672
     <rect>
673
      <x>112</x>
674
      <y>124</y>
675
      <width>45</width>
676
      <height>20</height>
677
     </rect>
678
    </property>
679
    <property name="alignment">
680
     <set>Qt::AlignCenter</set>
681
    </property>
682
    <property name="readOnly">
683
     <bool>false</bool>
684
    </property>
685
   </widget>
686
   <widget class="QToolButton" name="toolButton">
687
    <property name="geometry">
688
     <rect>
689
      <x>12</x>
690
      <y>156</y>
691
      <width>93</width>
692
      <height>23</height>
693
     </rect>
694
    </property>
695
    <property name="text">
696
     <string>Opening</string>
697
    </property>
698
   </widget>
699
   <widget class="QLineEdit" name="lineEdit_Opening">
700
    <property name="enabled">
701
     <bool>true</bool>
702
    </property>
703
    <property name="geometry">
704
     <rect>
705
      <x>112</x>
706
      <y>156</y>
707
      <width>45</width>
708
      <height>20</height>
709
     </rect>
710
    </property>
711
    <property name="alignment">
712
     <set>Qt::AlignCenter</set>
713
    </property>
714
    <property name="readOnly">
715
     <bool>true</bool>
716
    </property>
717
   </widget>
718
  </widget>
472 719
 </widget>
473 720
 <tabstops>
474 721
  <tabstop>lineEdit_TagNo</tabstop>
HYTOS/HYTOS/Valve_Control.py
30 30
        self.ui.lineEdit_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Elevation))
31 31
        self.ui.lineEdit_Overdesign.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Overdesign))
32 32

  
33
        self.ui.lineEdit_Rangerability.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Rangerability))
34
        self.ui.lineEdit_Calculated_Cv.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Calculated_Cv))
35

  
36
        self.ui.comboBox_Valve_Type.currentIndexChanged.connect(self.valve_type_change)
37
        self.ui.pushButton.clicked.connect(self.opening_calculation)
33 38
        self.initialize()
34 39

  
40
    def opening_calculation(self):
41
        cur_text = self.ui.pushButton.text()
42
        if cur_text == 'Opening % Calculation':
43
            self.ui.pushButton.setText('Completed')
44
            self.resize(446, 481)
45
        else:
46
            self.ui.pushButton.setText('Opening % Calculation')
47
            self.resize(446, 270)
48

  
49
    def valve_type_change(self, index):
50
        if index == -1:
51
            self.ui.lineEdit_Rangerability.clear()
52
            return
53

  
54
        valve_type = self.ui.comboBox_Valve_Type.itemText(index)
55
        if valve_type == '--User Input--':
56
            self.ui.lineEdit_Rangerability.clear()
57
            self.ui.lineEdit_Rangerability.setReadOnly(False)
58
        else:
59
            rangerability = self.ui.comboBox_Valve_Type.itemData(index)
60
            self.ui.lineEdit_Rangerability.setText(str(rangerability))
61
            self.ui.lineEdit_Rangerability.setReadOnly(True)
62

  
35 63
    def show_dialog(self, item):
36 64
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
37 65
        self._item = item
......
45 73
    def initialize(self):
46 74
        self.ui.label_Img.setVisible(False)
47 75

  
76
        self.ui.comboBox_Valve_Type.addItem('Globe, Single Port', 50)
77
        self.ui.comboBox_Valve_Type.addItem('Globe, Double Port', 50)
78
        self.ui.comboBox_Valve_Type.addItem('Globe, Pressure balanced cage', 50)
79
        self.ui.comboBox_Valve_Type.addItem('Rotating Disc', 100)
80
        self.ui.comboBox_Valve_Type.addItem('Spilt Body', 30)
81
        self.ui.comboBox_Valve_Type.addItem('Angle', 30)
82
        self.ui.comboBox_Valve_Type.addItem('Diaphragm', 5)
83
        self.ui.comboBox_Valve_Type.addItem('Butterfly, 60˚', 15)
84
        self.ui.comboBox_Valve_Type.addItem('Butterfly, 60˚(Throttling)', 20)
85
        self.ui.comboBox_Valve_Type.addItem('Butterfly, 60˚(Eccentric Disc)', 25)
86
        self.ui.comboBox_Valve_Type.addItem('Butterfly, 90˚', 100)
87
        self.ui.comboBox_Valve_Type.addItem('Pinch', 5)
88
        self.ui.comboBox_Valve_Type.addItem('Vee-Ball', 30)
89
        self.ui.comboBox_Valve_Type.addItem('Full Ball', 100)
90
        self.ui.comboBox_Valve_Type.addItem('--User Input--', 0)
91

  
92
        self.ui.comboBox_Valve_Type.setCurrentIndex(-1)
93

  
48 94
    def set_controls(self):
49 95
        self.ui.label_Img.setVisible(True)
50 96

  
HYTOS/HYTOS/Valve_Control_UI.py
13 13
class Ui_Valve_ControlDialog(object):
14 14
    def setupUi(self, Valve_ControlDialog):
15 15
        Valve_ControlDialog.setObjectName("Valve_ControlDialog")
16
        Valve_ControlDialog.resize(446, 266)
16
        Valve_ControlDialog.resize(446, 270)
17 17
        font = QtGui.QFont()
18 18
        font.setFamily("맑은 고딕")
19 19
        Valve_ControlDialog.setFont(font)
......
177 177
        self.pushButton = QtWidgets.QPushButton(Valve_ControlDialog)
178 178
        self.pushButton.setGeometry(QtCore.QRect(8, 236, 137, 23))
179 179
        self.pushButton.setObjectName("pushButton")
180
        self.groupBox_2 = QtWidgets.QGroupBox(Valve_ControlDialog)
181
        self.groupBox_2.setEnabled(True)
182
        self.groupBox_2.setGeometry(QtCore.QRect(8, 276, 429, 197))
183
        self.groupBox_2.setObjectName("groupBox_2")
184
        self.label_2 = QtWidgets.QLabel(self.groupBox_2)
185
        self.label_2.setGeometry(QtCore.QRect(12, 32, 93, 16))
186
        self.label_2.setMinimumSize(QtCore.QSize(93, 0))
187
        self.label_2.setMaximumSize(QtCore.QSize(93, 16777215))
188
        self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
189
        self.label_2.setObjectName("label_2")
190
        self.radioButton_Linear = QtWidgets.QRadioButton(self.groupBox_2)
191
        self.radioButton_Linear.setGeometry(QtCore.QRect(112, 32, 61, 16))
192
        self.radioButton_Linear.setObjectName("radioButton_Linear")
193
        self.radioButton_Equal_Percentage = QtWidgets.QRadioButton(self.groupBox_2)
194
        self.radioButton_Equal_Percentage.setGeometry(QtCore.QRect(184, 32, 129, 16))
195
        self.radioButton_Equal_Percentage.setObjectName("radioButton_Equal_Percentage")
196
        self.label_4 = QtWidgets.QLabel(self.groupBox_2)
197
        self.label_4.setGeometry(QtCore.QRect(12, 64, 93, 12))
198
        self.label_4.setMinimumSize(QtCore.QSize(93, 0))
199
        self.label_4.setMaximumSize(QtCore.QSize(93, 16777215))
200
        self.label_4.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
201
        self.label_4.setObjectName("label_4")
202
        self.comboBox_Valve_Type = QtWidgets.QComboBox(self.groupBox_2)
203
        self.comboBox_Valve_Type.setGeometry(QtCore.QRect(112, 60, 189, 22))
204
        self.comboBox_Valve_Type.setObjectName("comboBox_Valve_Type")
205
        self.label_6 = QtWidgets.QLabel(self.groupBox_2)
206
        self.label_6.setGeometry(QtCore.QRect(12, 96, 93, 12))
207
        self.label_6.setMinimumSize(QtCore.QSize(93, 0))
208
        self.label_6.setMaximumSize(QtCore.QSize(93, 16777215))
209
        self.label_6.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
210
        self.label_6.setObjectName("label_6")
211
        self.lineEdit_Rangerability = QtWidgets.QLineEdit(self.groupBox_2)
212
        self.lineEdit_Rangerability.setEnabled(True)
213
        self.lineEdit_Rangerability.setGeometry(QtCore.QRect(112, 92, 45, 20))
214
        self.lineEdit_Rangerability.setAlignment(QtCore.Qt.AlignCenter)
215
        self.lineEdit_Rangerability.setReadOnly(True)
216
        self.lineEdit_Rangerability.setObjectName("lineEdit_Rangerability")
217
        self.label_7 = QtWidgets.QLabel(self.groupBox_2)
218
        self.label_7.setGeometry(QtCore.QRect(164, 94, 145, 16))
219
        self.label_7.setObjectName("label_7")
220
        self.label_11 = QtWidgets.QLabel(self.groupBox_2)
221
        self.label_11.setGeometry(QtCore.QRect(12, 128, 93, 12))
222
        self.label_11.setMinimumSize(QtCore.QSize(93, 0))
223
        self.label_11.setMaximumSize(QtCore.QSize(93, 16777215))
224
        self.label_11.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
225
        self.label_11.setObjectName("label_11")
226
        self.lineEdit_Calculated_Cv = QtWidgets.QLineEdit(self.groupBox_2)
227
        self.lineEdit_Calculated_Cv.setEnabled(True)
228
        self.lineEdit_Calculated_Cv.setGeometry(QtCore.QRect(112, 124, 45, 20))
229
        self.lineEdit_Calculated_Cv.setAlignment(QtCore.Qt.AlignCenter)
230
        self.lineEdit_Calculated_Cv.setReadOnly(False)
231
        self.lineEdit_Calculated_Cv.setObjectName("lineEdit_Calculated_Cv")
232
        self.toolButton = QtWidgets.QToolButton(self.groupBox_2)
233
        self.toolButton.setGeometry(QtCore.QRect(12, 156, 93, 23))
234
        self.toolButton.setObjectName("toolButton")
235
        self.lineEdit_Opening = QtWidgets.QLineEdit(self.groupBox_2)
236
        self.lineEdit_Opening.setEnabled(True)
237
        self.lineEdit_Opening.setGeometry(QtCore.QRect(112, 156, 45, 20))
238
        self.lineEdit_Opening.setAlignment(QtCore.Qt.AlignCenter)
239
        self.lineEdit_Opening.setReadOnly(True)
240
        self.lineEdit_Opening.setObjectName("lineEdit_Opening")
180 241

  
181 242
        self.retranslateUi(Valve_ControlDialog)
182 243
        self.buttonBox.accepted.connect(Valve_ControlDialog.accept)
......
204 265
        self.label.setText(_translate("Valve_ControlDialog", "Tag No."))
205 266
        self.label_9.setText(_translate("Valve_ControlDialog", "Type (for Aramco-BP)"))
206 267
        self.label_10.setText(_translate("Valve_ControlDialog", "Fluid (for Cv calculation)"))
207
        self.pushButton.setText(_translate("Valve_ControlDialog", "Opening% Calculation"))
268
        self.pushButton.setText(_translate("Valve_ControlDialog", "Opening % Calculation"))
269
        self.groupBox_2.setTitle(_translate("Valve_ControlDialog", "Control Valve Opening % Calculation"))
270
        self.label_2.setText(_translate("Valve_ControlDialog", "Flow Character :"))
271
        self.radioButton_Linear.setText(_translate("Valve_ControlDialog", "Linear"))
272
        self.radioButton_Equal_Percentage.setText(_translate("Valve_ControlDialog", "Equal Percentage"))
273
        self.label_4.setText(_translate("Valve_ControlDialog", "Valve Type :"))
274
        self.label_6.setText(_translate("Valve_ControlDialog", "Rangerability :"))
275
        self.label_7.setText(_translate("Valve_ControlDialog", "(ex. 50 : 1 then input 50)"))
276
        self.label_11.setText(_translate("Valve_ControlDialog", "Calculated Cv :"))
277
        self.toolButton.setText(_translate("Valve_ControlDialog", "Opening"))
208 278
import Resource_rc

내보내기 Unified diff

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