개정판 c46ad1e0
issue #1053 : 장치의 Tag No. 표기
Change-Id: I36ca926ad7b3e2384f7adf337115693f2a509e79
HYTOS/HYTOS/AirFinCooler.py | ||
---|---|---|
13 | 13 |
import AirFinCooler_UI |
14 | 14 |
import math |
15 | 15 |
|
16 |
|
|
17 |
def is_not_blank(s): |
|
18 |
return bool(s and s.strip()) |
|
19 |
|
|
20 |
|
|
16 | 21 |
class QAirFinCooler(QDialog): |
17 | 22 |
def __init__(self): |
18 | 23 |
QDialog.__init__(self) |
19 | 24 |
|
20 | 25 |
self.ui = AirFinCooler_UI.Ui_AirFinCoolerDialog() |
21 | 26 |
self.ui.setupUi(self) |
27 |
self._item = None |
|
22 | 28 |
self.ui.lineEdit_Pressure_Drop.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Pressure_Drop)) |
23 | 29 |
self.ui.lineEdit_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Elevation)) |
24 | 30 |
self.initialize() |
25 | 31 |
|
26 |
def showDialog(self, item):
|
|
32 |
def show_dialog(self, item):
|
|
27 | 33 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
28 | 34 |
self._item = item |
29 | 35 |
|
30 | 36 |
self.ui.lineEdit_TagNo.setFocus() |
31 |
self.set_controls(item)
|
|
37 |
self.set_controls() |
|
32 | 38 |
self.load_data() |
33 |
|
|
39 |
|
|
34 | 40 |
return self.exec_() |
35 | 41 |
|
36 | 42 |
def initialize(self): |
37 | 43 |
self.ui.label_Img.setVisible(False) |
38 | 44 |
|
39 |
def set_controls(self, item):
|
|
45 |
def set_controls(self):
|
|
40 | 46 |
self.ui.label_Img.setVisible(True) |
41 | 47 |
|
42 | 48 |
def load_data(self): |
43 | 49 |
""" load tag no and nozzle data """ |
44 | 50 |
from Drawing import Drawing |
51 |
self.ui.lineEdit_TagNo.setText(self._item.tag_no) |
|
45 | 52 |
|
46 | 53 |
app_doc_data = AppDocData.instance() |
47 |
drawing = app_doc_data.activeDrawing
|
|
54 |
drawing = app_doc_data.activeDrawing |
|
48 | 55 |
if drawing: |
49 | 56 |
for attr in drawing.attrs: |
50 | 57 |
if attr[0] == 'Units': |
... | ... | |
54 | 61 |
matches = [connector.data for connector in self._item.connectors if connector.data] |
55 | 62 |
if matches: |
56 | 63 |
pressure_drop = matches[0].pressure_drop |
57 |
if pressure_drop:
|
|
64 |
if pressure_drop: |
|
58 | 65 |
self.ui.lineEdit_Pressure_Drop.setText(str(pressure_drop)) |
59 | 66 |
|
60 | 67 |
elevation = matches[0].elevation |
... | ... | |
64 | 71 |
def accept(self): |
65 | 72 |
""" set tag no and nozzle data """ |
66 | 73 |
from EngineeringConnectorItem import NozzleData |
74 |
tag_no = self.ui.lineEdit_TagNo.text() |
|
67 | 75 |
|
68 |
for connector in self._item.connectors: |
|
69 |
if not connector.data: |
|
70 |
connector.data = NozzleData() |
|
76 |
if is_not_blank(tag_no): |
|
77 |
for connector in self._item.connectors: |
|
78 |
if not connector.data: |
|
79 |
connector.data = NozzleData() |
|
71 | 80 |
|
72 |
pressure_drop = self.ui.lineEdit_Pressure_Drop.text() |
|
73 |
if pressure_drop: |
|
74 |
connector.data.pressure_drop = float(pressure_drop)
|
|
75 |
else:
|
|
76 |
connector.data.pressure_drop = None |
|
81 |
pressure_drop = self.ui.lineEdit_Pressure_Drop.text()
|
|
82 |
if pressure_drop:
|
|
83 |
connector.data.pressure_drop = float(pressure_drop)
|
|
84 |
else:
|
|
85 |
connector.data.pressure_drop = None
|
|
77 | 86 |
|
78 |
elevation = self.ui.lineEdit_Elevation.text() |
|
79 |
if elevation: |
|
80 |
connector.data.elevation = float(elevation)
|
|
81 |
else: |
|
82 |
connector.data.elevation = None |
|
87 |
elevation = self.ui.lineEdit_Elevation.text()
|
|
88 |
if elevation:
|
|
89 |
connector.data.elevation = float(elevation)
|
|
90 |
else:
|
|
91 |
connector.data.elevation = None
|
|
83 | 92 |
|
84 |
QDialog.accept(self) |
|
93 |
QDialog.accept(self) |
|
94 |
else: |
|
95 |
QMessageBox.warning(self, self.tr('Notice'), self.tr('Please Input [Tag No.]')) |
|
85 | 96 |
|
86 | 97 |
def reject(self): |
87 |
QDialog.reject(self) |
|
98 |
QDialog.reject(self) |
HYTOS/HYTOS/Ball.py | ||
---|---|---|
13 | 13 |
import Ball_UI |
14 | 14 |
import math |
15 | 15 |
|
16 |
|
|
17 |
def is_not_blank(s): |
|
18 |
return bool(s and s.strip()) |
|
19 |
|
|
20 |
|
|
16 | 21 |
class QBall(QDialog): |
17 | 22 |
def __init__(self): |
18 | 23 |
QDialog.__init__(self) |
19 | 24 |
|
20 | 25 |
self.ui = Ball_UI.Ui_BallDialog() |
21 | 26 |
self.ui.setupUi(self) |
27 |
self._item = None |
|
22 | 28 |
|
23 |
''' |
|
24 |
for index in range(1, 8): |
|
25 |
pressure = self.findChild(QtWidgets.QLineEdit, 'lineEdit_N{}_Pressure'.format(index)) |
|
26 |
pressure.setValidator(QtGui.QDoubleValidator(pressure)) |
|
27 |
|
|
28 |
elevation = self.findChild(QtWidgets.QLineEdit, 'lineEdit_N{}_Elevation'.format(index)) |
|
29 |
elevation.setValidator(QtGui.QDoubleValidator(elevation)) |
|
30 |
''' |
|
31 |
|
|
32 |
self.ui.lineEdit_N1_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Pressure)) |
|
29 |
self.ui.lineEdit_N1_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Pressure)) |
|
33 | 30 |
self.ui.lineEdit_N2_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Pressure)) |
34 | 31 |
self.ui.lineEdit_N3_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N3_Pressure)) |
35 |
self.ui.lineEdit_N4_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Pressure))
|
|
36 |
self.ui.lineEdit_N5_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Pressure))
|
|
37 |
self.ui.lineEdit_N6_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Pressure))
|
|
38 |
self.ui.lineEdit_N7_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Pressure))
|
|
32 |
self.ui.lineEdit_N4_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Pressure)) |
|
33 |
self.ui.lineEdit_N5_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Pressure)) |
|
34 |
self.ui.lineEdit_N6_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Pressure)) |
|
35 |
self.ui.lineEdit_N7_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Pressure)) |
|
39 | 36 |
self.ui.lineEdit_N8_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N8_Pressure)) |
40 | 37 |
|
41 |
self.ui.lineEdit_N1_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Elevation))
|
|
42 |
self.ui.lineEdit_N2_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Elevation))
|
|
38 |
self.ui.lineEdit_N1_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Elevation)) |
|
39 |
self.ui.lineEdit_N2_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Elevation)) |
|
43 | 40 |
self.ui.lineEdit_N3_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N3_Elevation)) |
44 |
self.ui.lineEdit_N4_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Elevation))
|
|
45 |
self.ui.lineEdit_N5_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Elevation))
|
|
46 |
self.ui.lineEdit_N6_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Elevation))
|
|
47 |
self.ui.lineEdit_N7_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Elevation))
|
|
41 |
self.ui.lineEdit_N4_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Elevation)) |
|
42 |
self.ui.lineEdit_N5_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Elevation)) |
|
43 |
self.ui.lineEdit_N6_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Elevation)) |
|
44 |
self.ui.lineEdit_N7_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Elevation)) |
|
48 | 45 |
self.ui.lineEdit_N8_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N8_Elevation)) |
49 | 46 |
|
50 | 47 |
self.initialize() |
51 | 48 |
|
52 |
def showDialog(self, item):
|
|
49 |
def show_dialog(self, item):
|
|
53 | 50 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
54 | 51 |
self._item = item |
55 | 52 |
|
56 | 53 |
self.ui.lineEdit_TagNo.setFocus() |
57 |
self.set_controls(item)
|
|
54 |
self.set_controls() |
|
58 | 55 |
self.load_data() |
59 | 56 |
|
60 | 57 |
return self.exec_() |
61 | 58 |
|
62 |
def initialize(self): |
|
63 |
''' |
|
64 |
for index in range(1, 8): |
|
65 |
image = self.findChild(QtWidgets.QLabel, 'label_Img_N{}'.format(index)) |
|
66 |
image.setVisible(False) |
|
67 |
|
|
68 |
nozzle = self.findChild(QtWidgets.QLabel, 'label_N{}'.format(index)) |
|
69 |
nozzle.setVisible(False) |
|
70 |
|
|
71 |
pressure = self.findChild(QtWidgets.QLineEdit, 'lineEdit_N{}_Pressure'.format(index)) |
|
72 |
pressure.setEnabled(False) |
|
73 |
|
|
74 |
elevation = self.findChild(QtWidgets.QLineEdit, 'lineEdit_N{}_Elevation'.format(index)) |
|
75 |
elevation.setEnabled(False) |
|
76 |
''' |
|
77 |
|
|
59 |
def initialize(self): |
|
78 | 60 |
self.ui.label_Img_N1.setVisible(False) |
79 | 61 |
self.ui.label_Img_N2.setVisible(False) |
80 | 62 |
self.ui.label_Img_N3.setVisible(False) |
... | ... | |
82 | 64 |
self.ui.label_Img_N5.setVisible(False) |
83 | 65 |
self.ui.label_Img_N6.setVisible(False) |
84 | 66 |
self.ui.label_Img_N7.setVisible(False) |
85 |
self.ui.label_Img_N8.setVisible(False)
|
|
67 |
self.ui.label_Img_N8.setVisible(False) |
|
86 | 68 |
|
87 | 69 |
self.ui.label_N1.setVisible(False) |
88 |
self.ui.lineEdit_N1_Pressure.setEnabled(False)
|
|
70 |
self.ui.lineEdit_N1_Pressure.setEnabled(False) |
|
89 | 71 |
self.ui.lineEdit_N1_Elevation.setEnabled(False) |
90 |
|
|
72 |
|
|
91 | 73 |
self.ui.label_N2.setVisible(False) |
92 |
self.ui.lineEdit_N2_Pressure.setEnabled(False)
|
|
74 |
self.ui.lineEdit_N2_Pressure.setEnabled(False) |
|
93 | 75 |
self.ui.lineEdit_N2_Elevation.setEnabled(False) |
94 |
|
|
76 |
|
|
95 | 77 |
self.ui.label_N3.setVisible(False) |
96 |
self.ui.lineEdit_N3_Pressure.setEnabled(False)
|
|
78 |
self.ui.lineEdit_N3_Pressure.setEnabled(False) |
|
97 | 79 |
self.ui.lineEdit_N3_Elevation.setEnabled(False) |
98 | 80 |
|
99 | 81 |
self.ui.label_N4.setVisible(False) |
100 |
self.ui.lineEdit_N4_Pressure.setEnabled(False)
|
|
82 |
self.ui.lineEdit_N4_Pressure.setEnabled(False) |
|
101 | 83 |
self.ui.lineEdit_N4_Elevation.setEnabled(False) |
102 | 84 |
|
103 | 85 |
self.ui.label_N5.setVisible(False) |
104 |
self.ui.lineEdit_N5_Pressure.setEnabled(False)
|
|
86 |
self.ui.lineEdit_N5_Pressure.setEnabled(False) |
|
105 | 87 |
self.ui.lineEdit_N5_Elevation.setEnabled(False) |
106 | 88 |
|
107 | 89 |
self.ui.label_N6.setVisible(False) |
108 |
self.ui.lineEdit_N6_Pressure.setEnabled(False)
|
|
90 |
self.ui.lineEdit_N6_Pressure.setEnabled(False) |
|
109 | 91 |
self.ui.lineEdit_N6_Elevation.setEnabled(False) |
110 | 92 |
|
111 | 93 |
self.ui.label_N7.setVisible(False) |
112 |
self.ui.lineEdit_N7_Pressure.setEnabled(False)
|
|
94 |
self.ui.lineEdit_N7_Pressure.setEnabled(False) |
|
113 | 95 |
self.ui.lineEdit_N7_Elevation.setEnabled(False) |
114 | 96 |
|
115 | 97 |
self.ui.label_N8.setVisible(False) |
116 |
self.ui.lineEdit_N8_Pressure.setEnabled(False) |
|
117 |
self.ui.lineEdit_N8_Elevation.setEnabled(False) |
|
118 |
|
|
119 |
|
|
98 |
self.ui.lineEdit_N8_Pressure.setEnabled(False) |
|
99 |
self.ui.lineEdit_N8_Elevation.setEnabled(False) |
|
120 | 100 |
|
121 |
def set_controls(self, item):
|
|
101 |
def set_controls(self):
|
|
122 | 102 |
# To do : 이름으로 Control 찾아오기 |
123 |
for connector in item.connectors:
|
|
103 |
for connector in self._item.connectors:
|
|
124 | 104 |
index = connector._conn_index |
125 | 105 |
if connector.connectedItem: |
126 | 106 |
if index == 1: |
127 | 107 |
self.ui.label_Img_N1.setVisible(True) |
128 | 108 |
self.ui.label_N1.setVisible(True) |
129 |
self.ui.lineEdit_N1_Pressure.setEnabled(True)
|
|
109 |
self.ui.lineEdit_N1_Pressure.setEnabled(True) |
|
130 | 110 |
self.ui.lineEdit_N1_Elevation.setEnabled(True) |
131 | 111 |
elif index == 2: |
132 | 112 |
self.ui.label_Img_N2.setVisible(True) |
133 | 113 |
self.ui.label_N2.setVisible(True) |
134 |
self.ui.lineEdit_N2_Pressure.setEnabled(True)
|
|
114 |
self.ui.lineEdit_N2_Pressure.setEnabled(True) |
|
135 | 115 |
self.ui.lineEdit_N2_Elevation.setEnabled(True) |
136 | 116 |
elif index == 3: |
137 | 117 |
self.ui.label_Img_N3.setVisible(True) |
138 | 118 |
self.ui.label_N3.setVisible(True) |
139 |
self.ui.lineEdit_N3_Pressure.setEnabled(True)
|
|
119 |
self.ui.lineEdit_N3_Pressure.setEnabled(True) |
|
140 | 120 |
self.ui.lineEdit_N3_Elevation.setEnabled(True) |
141 | 121 |
elif index == 4: |
142 | 122 |
self.ui.label_Img_N4.setVisible(True) |
143 | 123 |
self.ui.label_N4.setVisible(True) |
144 |
self.ui.lineEdit_N4_Pressure.setEnabled(True)
|
|
124 |
self.ui.lineEdit_N4_Pressure.setEnabled(True) |
|
145 | 125 |
self.ui.lineEdit_N4_Elevation.setEnabled(True) |
146 | 126 |
elif index == 5: |
147 | 127 |
self.ui.label_Img_N5.setVisible(True) |
148 | 128 |
self.ui.label_N5.setVisible(True) |
149 |
self.ui.lineEdit_N5_Pressure.setEnabled(True)
|
|
150 |
self.ui.lineEdit_N5_Elevation.setEnabled(True)
|
|
129 |
self.ui.lineEdit_N5_Pressure.setEnabled(True) |
|
130 |
self.ui.lineEdit_N5_Elevation.setEnabled(True) |
|
151 | 131 |
elif index == 6: |
152 | 132 |
self.ui.label_Img_N6.setVisible(True) |
153 | 133 |
self.ui.label_N6.setVisible(True) |
154 |
self.ui.lineEdit_N6_Pressure.setEnabled(True)
|
|
155 |
self.ui.lineEdit_N6_Elevation.setEnabled(True)
|
|
134 |
self.ui.lineEdit_N6_Pressure.setEnabled(True) |
|
135 |
self.ui.lineEdit_N6_Elevation.setEnabled(True) |
|
156 | 136 |
elif index == 7: |
157 | 137 |
self.ui.label_Img_N7.setVisible(True) |
158 | 138 |
self.ui.label_N7.setVisible(True) |
159 |
self.ui.lineEdit_N7_Pressure.setEnabled(True)
|
|
160 |
self.ui.lineEdit_N7_Elevation.setEnabled(True)
|
|
139 |
self.ui.lineEdit_N7_Pressure.setEnabled(True) |
|
140 |
self.ui.lineEdit_N7_Elevation.setEnabled(True) |
|
161 | 141 |
elif index == 8: |
162 | 142 |
self.ui.label_Img_N8.setVisible(True) |
163 | 143 |
self.ui.label_N8.setVisible(True) |
164 |
self.ui.lineEdit_N8_Pressure.setEnabled(True)
|
|
165 |
self.ui.lineEdit_N8_Elevation.setEnabled(True)
|
|
144 |
self.ui.lineEdit_N8_Pressure.setEnabled(True) |
|
145 |
self.ui.lineEdit_N8_Elevation.setEnabled(True) |
|
166 | 146 |
|
167 | 147 |
def load_data(self): |
168 | 148 |
""" load tag no and nozzle data """ |
169 | 149 |
from Drawing import Drawing |
170 |
|
|
150 |
self.ui.lineEdit_TagNo.setText(self._item.tag_no) |
|
151 |
|
|
171 | 152 |
appDocData = AppDocData.instance() |
172 |
drawing = appDocData.activeDrawing
|
|
153 |
drawing = appDocData.activeDrawing |
|
173 | 154 |
if drawing: |
174 | 155 |
for attr in drawing.attrs: |
175 | 156 |
if attr[0] == 'Units': |
... | ... | |
179 | 160 |
for connector in self._item.connectors: |
180 | 161 |
index = connector._conn_index |
181 | 162 |
if connector.data: |
182 |
pressure = connector.data.pressure
|
|
163 |
pressure = connector.data.pressure |
|
183 | 164 |
if pressure: |
184 | 165 |
if index == 1: |
185 | 166 |
self.ui.lineEdit_N1_Pressure.setText(str(pressure)) |
... | ... | |
190 | 171 |
elif index == 4: |
191 | 172 |
self.ui.lineEdit_N4_Pressure.setText(str(pressure)) |
192 | 173 |
elif index == 5: |
193 |
self.ui.lineEdit_N5_Pressure.setText(str(pressure))
|
|
174 |
self.ui.lineEdit_N5_Pressure.setText(str(pressure)) |
|
194 | 175 |
elif index == 6: |
195 | 176 |
self.ui.lineEdit_N6_Pressure.setText(str(pressure)) |
196 | 177 |
elif index == 7: |
197 |
self.ui.lineEdit_N7_Pressure.setText(str(pressure))
|
|
178 |
self.ui.lineEdit_N7_Pressure.setText(str(pressure)) |
|
198 | 179 |
elif index == 8: |
199 | 180 |
self.ui.lineEdit_N8_Pressure.setText(str(pressure)) |
200 | 181 |
|
... | ... | |
209 | 190 |
elif index == 4: |
210 | 191 |
self.ui.lineEdit_N4_Elevation.setText(str(elevation)) |
211 | 192 |
elif index == 5: |
212 |
self.ui.lineEdit_N5_Elevation.setText(str(elevation))
|
|
193 |
self.ui.lineEdit_N5_Elevation.setText(str(elevation)) |
|
213 | 194 |
elif index == 6: |
214 | 195 |
self.ui.lineEdit_N6_Elevation.setText(str(elevation)) |
215 | 196 |
elif index == 7: |
216 |
self.ui.lineEdit_N7_Elevation.setText(str(elevation))
|
|
197 |
self.ui.lineEdit_N7_Elevation.setText(str(elevation)) |
|
217 | 198 |
elif index == 8: |
218 | 199 |
self.ui.lineEdit_N8_Elevation.setText(str(elevation)) |
219 | 200 |
|
220 | 201 |
def accept(self): |
221 | 202 |
""" set tag no and nozzle data """ |
222 | 203 |
from EngineeringConnectorItem import NozzleData |
204 |
tag_no = self.ui.lineEdit_TagNo.text() |
|
223 | 205 |
|
224 |
for connector in self._item.connectors: |
|
225 |
index = connector._conn_index |
|
226 |
if not connector.data: |
|
227 |
connector.data = NozzleData() |
|
228 |
|
|
229 |
if index == 1: |
|
230 |
pressure = self.ui.lineEdit_N1_Pressure.text() |
|
231 |
if pressure: |
|
232 |
connector.data.pressure = float(pressure) |
|
233 |
else: |
|
234 |
connector.data.pressure = None |
|
235 |
|
|
236 |
elevation = self.ui.lineEdit_N1_Elevation.text() |
|
237 |
if elevation: |
|
238 |
connector.data.elevation = float(elevation) |
|
239 |
else: |
|
240 |
connector.data.elevation = None |
|
241 |
elif index == 2: |
|
242 |
pressure = self.ui.lineEdit_N2_Pressure.text() |
|
243 |
if pressure: |
|
244 |
connector.data.pressure = float(pressure) |
|
245 |
else: |
|
246 |
connector.data.pressure = None |
|
247 |
|
|
248 |
elevation = self.ui.lineEdit_N2_Elevation.text() |
|
249 |
if elevation: |
|
250 |
connector.data.elevation = float(elevation) |
|
251 |
else: |
|
252 |
connector.data.elevation = None |
|
253 |
elif index == 3: |
|
254 |
pressure = self.ui.lineEdit_N3_Pressure.text() |
|
255 |
if pressure: |
|
256 |
connector.data.pressure = float(pressure) |
|
257 |
else: |
|
258 |
connector.data.pressure = None |
|
206 |
if is_not_blank(tag_no): |
|
207 |
self._item.tag_no = tag_no |
|
208 |
for connector in self._item.connectors: |
|
209 |
index = connector._conn_index |
|
210 |
if not connector.data: |
|
211 |
connector.data = NozzleData() |
|
259 | 212 |
|
260 |
elevation = self.ui.lineEdit_N3_Elevation.text() |
|
261 |
if elevation: |
|
262 |
connector.data.elevation = float(elevation) |
|
263 |
else: |
|
264 |
connector.data.elevation = None |
|
265 |
elif index == 4: |
|
266 |
pressure = self.ui.lineEdit_N4_Pressure.text() |
|
267 |
if pressure: |
|
268 |
connector.data.pressure = float(pressure) |
|
269 |
else: |
|
270 |
connector.data.pressure = None |
|
271 |
|
|
272 |
elevation = self.ui.lineEdit_N4_Elevation.text() |
|
273 |
if elevation: |
|
274 |
connector.data.elevation = float(elevation) |
|
275 |
else: |
|
276 |
connector.data.elevation = None |
|
277 |
elif index == 5: |
|
278 |
pressure = self.ui.lineEdit_N5_Pressure.text() |
|
279 |
if pressure: |
|
280 |
connector.data.pressure = float(pressure) |
|
281 |
else: |
|
282 |
connector.data.pressure = None |
|
283 |
|
|
284 |
elevation = self.ui.lineEdit_N5_Elevation.text() |
|
285 |
if elevation: |
|
286 |
connector.data.elevation = float(elevation) |
|
287 |
else: |
|
288 |
connector.data.elevation = None |
|
289 |
elif index == 6: |
|
290 |
pressure = self.ui.lineEdit_N6_Pressure.text() |
|
291 |
if pressure: |
|
292 |
connector.data.pressure = float(pressure) |
|
293 |
else: |
|
294 |
connector.data.pressure = None |
|
295 |
|
|
296 |
elevation = self.ui.lineEdit_N6_Elevation.text() |
|
297 |
if elevation: |
|
298 |
connector.data.elevation = float(elevation) |
|
299 |
else: |
|
300 |
connector.data.elevation = None |
|
301 |
elif index == 7: |
|
302 |
pressure = self.ui.lineEdit_N7_Pressure.text() |
|
303 |
if pressure: |
|
304 |
connector.data.pressure = float(pressure) |
|
305 |
else: |
|
306 |
connector.data.pressure = None |
|
307 |
|
|
308 |
elevation = self.ui.lineEdit_N7_Elevation.text() |
|
309 |
if elevation: |
|
310 |
connector.data.elevation = float(elevation) |
|
311 |
else: |
|
312 |
connector.data.elevation = None |
|
313 |
elif index == 8: |
|
314 |
pressure = self.ui.lineEdit_N8_Pressure.text() |
|
315 |
if pressure: |
|
316 |
connector.data.pressure = float(pressure) |
|
317 |
else: |
|
318 |
connector.data.pressure = None |
|
319 |
|
|
320 |
elevation = self.ui.lineEdit_N8_Elevation.text() |
|
321 |
if elevation: |
|
322 |
connector.data.elevation = float(elevation) |
|
323 |
else: |
|
324 |
connector.data.elevation = None |
|
325 |
|
|
326 |
QDialog.accept(self) |
|
213 |
if index == 1: |
|
214 |
pressure = self.ui.lineEdit_N1_Pressure.text() |
|
215 |
if pressure: |
|
216 |
connector.data.pressure = float(pressure) |
|
217 |
else: |
|
218 |
connector.data.pressure = None |
|
219 |
|
|
220 |
elevation = self.ui.lineEdit_N1_Elevation.text() |
|
221 |
if elevation: |
|
222 |
connector.data.elevation = float(elevation) |
|
223 |
else: |
|
224 |
connector.data.elevation = None |
|
225 |
elif index == 2: |
|
226 |
pressure = self.ui.lineEdit_N2_Pressure.text() |
|
227 |
if pressure: |
|
228 |
connector.data.pressure = float(pressure) |
|
229 |
else: |
|
230 |
connector.data.pressure = None |
|
231 |
|
|
232 |
elevation = self.ui.lineEdit_N2_Elevation.text() |
|
233 |
if elevation: |
|
234 |
connector.data.elevation = float(elevation) |
|
235 |
else: |
|
236 |
connector.data.elevation = None |
|
237 |
elif index == 3: |
|
238 |
pressure = self.ui.lineEdit_N3_Pressure.text() |
|
239 |
if pressure: |
|
240 |
connector.data.pressure = float(pressure) |
|
241 |
else: |
|
242 |
connector.data.pressure = None |
|
243 |
|
|
244 |
elevation = self.ui.lineEdit_N3_Elevation.text() |
|
245 |
if elevation: |
|
246 |
connector.data.elevation = float(elevation) |
|
247 |
else: |
|
248 |
connector.data.elevation = None |
|
249 |
elif index == 4: |
|
250 |
pressure = self.ui.lineEdit_N4_Pressure.text() |
|
251 |
if pressure: |
|
252 |
connector.data.pressure = float(pressure) |
|
253 |
else: |
|
254 |
connector.data.pressure = None |
|
255 |
|
|
256 |
elevation = self.ui.lineEdit_N4_Elevation.text() |
|
257 |
if elevation: |
|
258 |
connector.data.elevation = float(elevation) |
|
259 |
else: |
|
260 |
connector.data.elevation = None |
|
261 |
elif index == 5: |
|
262 |
pressure = self.ui.lineEdit_N5_Pressure.text() |
|
263 |
if pressure: |
|
264 |
connector.data.pressure = float(pressure) |
|
265 |
else: |
|
266 |
connector.data.pressure = None |
|
267 |
|
|
268 |
elevation = self.ui.lineEdit_N5_Elevation.text() |
|
269 |
if elevation: |
|
270 |
connector.data.elevation = float(elevation) |
|
271 |
else: |
|
272 |
connector.data.elevation = None |
|
273 |
elif index == 6: |
|
274 |
pressure = self.ui.lineEdit_N6_Pressure.text() |
|
275 |
if pressure: |
|
276 |
connector.data.pressure = float(pressure) |
|
277 |
else: |
|
278 |
connector.data.pressure = None |
|
279 |
|
|
280 |
elevation = self.ui.lineEdit_N6_Elevation.text() |
|
281 |
if elevation: |
|
282 |
connector.data.elevation = float(elevation) |
|
283 |
else: |
|
284 |
connector.data.elevation = None |
|
285 |
elif index == 7: |
|
286 |
pressure = self.ui.lineEdit_N7_Pressure.text() |
|
287 |
if pressure: |
|
288 |
connector.data.pressure = float(pressure) |
|
289 |
else: |
|
290 |
connector.data.pressure = None |
|
291 |
|
|
292 |
elevation = self.ui.lineEdit_N7_Elevation.text() |
|
293 |
if elevation: |
|
294 |
connector.data.elevation = float(elevation) |
|
295 |
else: |
|
296 |
connector.data.elevation = None |
|
297 |
elif index == 8: |
|
298 |
pressure = self.ui.lineEdit_N8_Pressure.text() |
|
299 |
if pressure: |
|
300 |
connector.data.pressure = float(pressure) |
|
301 |
else: |
|
302 |
connector.data.pressure = None |
|
303 |
|
|
304 |
elevation = self.ui.lineEdit_N8_Elevation.text() |
|
305 |
if elevation: |
|
306 |
connector.data.elevation = float(elevation) |
|
307 |
else: |
|
308 |
connector.data.elevation = None |
|
309 |
|
|
310 |
QDialog.accept(self) |
|
311 |
else: |
|
312 |
QMessageBox.warning(self, self.tr('Notice'), self.tr('Please Input [Tag No.]')) |
|
327 | 313 |
|
328 | 314 |
def reject(self): |
329 |
QDialog.reject(self) |
|
315 |
QDialog.reject(self) |
HYTOS/HYTOS/BatteryLimit.py | ||
---|---|---|
13 | 13 |
import BatteryLimit_UI |
14 | 14 |
import math |
15 | 15 |
|
16 |
|
|
17 |
def is_not_blank(s): |
|
18 |
return bool(s and s.strip()) |
|
19 |
|
|
20 |
|
|
16 | 21 |
class QBatteryLimit(QDialog): |
17 | 22 |
def __init__(self): |
18 | 23 |
QDialog.__init__(self) |
19 | 24 |
|
20 | 25 |
self.ui = BatteryLimit_UI.Ui_BatteryLimitDialog() |
21 | 26 |
self.ui.setupUi(self) |
27 |
self._item = None |
|
22 | 28 |
self.ui.lineEdit_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Pressure)) |
23 | 29 |
self.ui.lineEdit_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Elevation)) |
24 |
self._item = None |
|
25 | 30 |
self.initialize() |
26 |
|
|
27 |
def showDialog(self, item):
|
|
31 |
|
|
32 |
def show_dialog(self, item):
|
|
28 | 33 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
29 | 34 |
self._item = item |
30 | 35 |
|
31 | 36 |
self.ui.lineEdit_TagNo.setFocus() |
32 |
self.set_controls(item)
|
|
37 |
self.set_controls() |
|
33 | 38 |
self.load_data() |
34 | 39 |
|
35 | 40 |
return self.exec_() |
36 | 41 |
|
37 | 42 |
def initialize(self): |
38 |
|
|
43 |
|
|
39 | 44 |
self.ui.label_Img_Up.setVisible(False) |
40 | 45 |
self.ui.label_Img_Down.setVisible(False) |
41 | 46 |
self.ui.label_Img_Left.setVisible(False) |
42 | 47 |
self.ui.label_Img_Right.setVisible(False) |
43 |
|
|
44 |
def set_controls(self, item):
|
|
45 |
name = item.name |
|
46 |
|
|
48 |
|
|
49 |
def set_controls(self):
|
|
50 |
name = self._item.name
|
|
51 |
|
|
47 | 52 |
if name == 'B_L_Up': |
48 | 53 |
self.ui.label_Img_Up.setVisible(True) |
49 | 54 |
elif name == 'B_L_Dw': |
... | ... | |
58 | 63 |
from Drawing import Drawing |
59 | 64 |
self.ui.lineEdit_TagNo.setText(self._item.tag_no) |
60 | 65 |
|
61 |
app_doc_data = AppDocData.instance()
|
|
62 |
drawing = app_doc_data.activeDrawing
|
|
66 |
appDocData = AppDocData.instance()
|
|
67 |
drawing = appDocData.activeDrawing
|
|
63 | 68 |
if drawing: |
64 | 69 |
for attr in drawing.attrs: |
65 | 70 |
if attr[0] == 'Units': |
... | ... | |
69 | 74 |
matches = [connector.data for connector in self._item.connectors if connector.data] |
70 | 75 |
if matches: |
71 | 76 |
pressure = matches[0].pressure |
72 |
if pressure:
|
|
77 |
if pressure: |
|
73 | 78 |
self.ui.lineEdit_Pressure.setText(str(pressure)) |
74 | 79 |
|
75 | 80 |
elevation = matches[0].elevation |
76 | 81 |
if elevation: |
77 | 82 |
self.ui.lineEdit_Elevation.setText(str(elevation)) |
78 | 83 |
|
79 |
|
|
80 | 84 |
def accept(self): |
81 | 85 |
""" set tag no and nozzle data """ |
82 | 86 |
from EngineeringConnectorItem import NozzleData |
83 |
|
|
84 |
self._item.tag_no = self.ui.lineEdit_TagNo.text() |
|
85 |
|
|
86 |
for connector in self._item.connectors: |
|
87 |
if not connector.data: |
|
88 |
connector.data = NozzleData() |
|
89 |
|
|
90 |
pressure = self.ui.lineEdit_Pressure.text() |
|
91 |
if pressure: |
|
92 |
connector.data.pressure = float(pressure) |
|
93 |
else: |
|
94 |
connector.data.pressure = None |
|
95 |
|
|
96 |
elevation = self.ui.lineEdit_Elevation.text() |
|
97 |
if elevation: |
|
98 |
connector.data.elevation = float(elevation) |
|
99 |
else: |
|
100 |
connector.data.elevation = None |
|
101 |
|
|
102 |
QDialog.accept(self) |
|
87 |
tag_no = self.ui.lineEdit_TagNo.text() |
|
88 |
|
|
89 |
if is_not_blank(tag_no): |
|
90 |
self._item.tag_no = tag_no |
|
91 |
for connector in self._item.connectors: |
|
92 |
if not connector.data: |
|
93 |
connector.data = NozzleData() |
|
94 |
|
|
95 |
pressure = self.ui.lineEdit_Pressure.text() |
|
96 |
if pressure: |
|
97 |
connector.data.pressure = float(pressure) |
|
98 |
else: |
|
99 |
connector.data.pressure = None |
|
100 |
|
|
101 |
elevation = self.ui.lineEdit_Elevation.text() |
|
102 |
if elevation: |
|
103 |
connector.data.elevation = float(elevation) |
|
104 |
else: |
|
105 |
connector.data.elevation = None |
|
106 |
|
|
107 |
QDialog.accept(self) |
|
108 |
else: |
|
109 |
QMessageBox.warning(self, self.tr('Notice'), self.tr('Please Input [Tag No.]')) |
|
103 | 110 |
|
104 | 111 |
def reject(self): |
105 |
QDialog.reject(self) |
|
112 |
QDialog.reject(self) |
HYTOS/HYTOS/Coil.py | ||
---|---|---|
13 | 13 |
import Coil_UI |
14 | 14 |
import math |
15 | 15 |
|
16 |
|
|
17 |
def is_not_blank(s): |
|
18 |
return bool(s and s.strip()) |
|
19 |
|
|
20 |
|
|
16 | 21 |
class QCoil(QDialog): |
17 | 22 |
def __init__(self): |
18 | 23 |
QDialog.__init__(self) |
19 | 24 |
|
20 | 25 |
self.ui = Coil_UI.Ui_CoilDialog() |
21 | 26 |
self.ui.setupUi(self) |
27 |
self._item = None |
|
28 |
|
|
22 | 29 |
self.ui.lineEdit_Pressure_Drop.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Pressure_Drop)) |
23 | 30 |
self.ui.lineEdit_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Elevation)) |
24 | 31 |
self.initialize() |
25 |
|
|
26 |
|
|
27 |
def showDialog(self, item): |
|
32 |
|
|
33 |
def show_dialog(self, item): |
|
28 | 34 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
29 | 35 |
self._item = item |
30 | 36 |
|
31 | 37 |
self.ui.lineEdit_TagNo.setFocus() |
32 |
self.set_controls(item)
|
|
38 |
self.set_controls() |
|
33 | 39 |
self.load_data() |
34 | 40 |
|
35 | 41 |
return self.exec_() |
... | ... | |
37 | 43 |
def initialize(self): |
38 | 44 |
self.ui.label_Img.setVisible(False) |
39 | 45 |
|
40 |
def set_controls(self, item):
|
|
46 |
def set_controls(self):
|
|
41 | 47 |
self.ui.label_Img.setVisible(True) |
42 | 48 |
|
43 | 49 |
def load_data(self): |
44 | 50 |
""" load tag no and nozzle data """ |
45 | 51 |
from Drawing import Drawing |
46 |
|
|
52 |
self.ui.lineEdit_TagNo.setText(self._item.tag_no) |
|
53 |
|
|
47 | 54 |
appDocData = AppDocData.instance() |
48 |
drawing = appDocData.activeDrawing
|
|
55 |
drawing = appDocData.activeDrawing |
|
49 | 56 |
if drawing: |
50 | 57 |
for attr in drawing.attrs: |
51 | 58 |
if attr[0] == 'Units': |
... | ... | |
55 | 62 |
matches = [connector.data for connector in self._item.connectors if connector.data] |
56 | 63 |
if matches: |
57 | 64 |
pressure_drop = matches[0].pressure_drop |
58 |
if pressure_drop:
|
|
65 |
if pressure_drop: |
|
59 | 66 |
self.ui.lineEdit_Pressure_Drop.setText(str(pressure_drop)) |
60 | 67 |
|
61 | 68 |
elevation = matches[0].elevation |
62 | 69 |
if elevation: |
63 | 70 |
self.ui.lineEdit_Elevation.setText(str(elevation)) |
64 |
|
|
71 |
|
|
65 | 72 |
def accept(self): |
66 | 73 |
""" set tag no and nozzle data """ |
67 | 74 |
from EngineeringConnectorItem import NozzleData |
75 |
tag_no = self.ui.lineEdit_TagNo.text() |
|
68 | 76 |
|
69 |
for connector in self._item.connectors: |
|
70 |
if not connector.data: |
|
71 |
connector.data = NozzleData() |
|
77 |
if is_not_blank(tag_no): |
|
78 |
self._item.tag_no = tag_no |
|
79 |
for connector in self._item.connectors: |
|
80 |
if not connector.data: |
|
81 |
connector.data = NozzleData() |
|
72 | 82 |
|
73 |
pressure_drop = self.ui.lineEdit_Pressure_Drop.text() |
|
74 |
if pressure_drop: |
|
75 |
connector.data.pressure_drop = float(pressure_drop)
|
|
76 |
else:
|
|
77 |
connector.data.pressure_drop = None |
|
83 |
pressure_drop = self.ui.lineEdit_Pressure_Drop.text()
|
|
84 |
if pressure_drop:
|
|
85 |
connector.data.pressure_drop = float(pressure_drop)
|
|
86 |
else:
|
|
87 |
connector.data.pressure_drop = None
|
|
78 | 88 |
|
79 |
elevation = self.ui.lineEdit_Elevation.text() |
|
80 |
if elevation: |
|
81 |
connector.data.elevation = float(elevation) |
|
82 |
else: |
|
83 |
connector.data.elevation = None |
|
84 |
|
|
85 |
QDialog.accept(self) |
|
89 |
elevation = self.ui.lineEdit_Elevation.text() |
|
90 |
if elevation: |
|
91 |
connector.data.elevation = float(elevation) |
|
92 |
else: |
|
93 |
connector.data.elevation = None |
|
94 |
|
|
95 |
QDialog.accept(self) |
|
96 |
else: |
|
97 |
QMessageBox.warning(self, self.tr('Notice'), self.tr('Please Input [Tag No.]')) |
|
86 | 98 |
|
87 | 99 |
def reject(self): |
88 |
QDialog.reject(self) |
|
100 |
QDialog.reject(self) |
HYTOS/HYTOS/Compressor.py | ||
---|---|---|
13 | 13 |
import Compressor_UI |
14 | 14 |
import math |
15 | 15 |
|
16 |
|
|
17 |
def is_not_blank(s): |
|
18 |
return bool(s and s.strip()) |
|
19 |
|
|
20 |
|
|
16 | 21 |
class QCompressor(QDialog): |
17 | 22 |
def __init__(self): |
18 | 23 |
QDialog.__init__(self) |
19 | 24 |
|
20 | 25 |
self.ui = Compressor_UI.Ui_CompressorDialog() |
21 | 26 |
self.ui.setupUi(self) |
27 |
self._item = None |
|
28 |
|
|
29 |
self.ui.lineEdit_Suc_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Suc_Pressure)) |
|
30 |
self.ui.lineEdit_Dis_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Dis_Pressure)) |
|
31 |
self.ui.lineEdit_Suc_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Suc_Elevation)) |
|
32 |
self.ui.lineEdit_Dis_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Dis_Elevation)) |
|
22 | 33 |
|
23 |
self.ui.lineEdit_Suc_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Suc_Pressure)) |
|
24 |
self.ui.lineEdit_Dis_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Dis_Pressure)) |
|
25 |
self.ui.lineEdit_Suc_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Suc_Elevation)) |
|
26 |
self.ui.lineEdit_Dis_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_Dis_Elevation)) |
|
27 |
|
|
28 | 34 |
self.initialize() |
29 |
|
|
30 |
def showDialog(self, item):
|
|
35 |
|
|
36 |
def show_dialog(self, item):
|
|
31 | 37 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
32 | 38 |
self._item = item |
33 | 39 |
|
34 | 40 |
self.ui.lineEdit_TagNo.setFocus() |
35 |
self.set_controls(item)
|
|
41 |
self.set_controls() |
|
36 | 42 |
self.load_data() |
37 | 43 |
|
38 | 44 |
return self.exec_() |
... | ... | |
40 | 46 |
def initialize(self): |
41 | 47 |
self.ui.label_Img_In.setVisible(False) |
42 | 48 |
self.ui.label_Img_Out.setVisible(False) |
43 |
|
|
49 |
|
|
44 | 50 |
self.ui.label_Suc.setVisible(False) |
45 |
self.ui.lineEdit_Suc_Pressure.setEnabled(False)
|
|
51 |
self.ui.lineEdit_Suc_Pressure.setEnabled(False) |
|
46 | 52 |
self.ui.lineEdit_Suc_Elevation.setEnabled(False) |
47 |
|
|
53 |
|
|
48 | 54 |
self.ui.label_Dis.setVisible(False) |
49 | 55 |
self.ui.lineEdit_Dis_Pressure.setEnabled(False) |
50 | 56 |
self.ui.lineEdit_Dis_Elevation.setEnabled(False) |
51 | 57 |
|
52 |
def set_controls(self, item):
|
|
58 |
def set_controls(self): |
|
53 | 59 |
used_index = [] |
54 | 60 |
|
55 |
for connector in item.connectors:
|
|
61 |
for connector in self._item.connectors:
|
|
56 | 62 |
if connector.connectedItem: |
57 | 63 |
used_index.append(connector._conn_index) |
58 | 64 |
|
59 | 65 |
if len(used_index) > 0: |
60 |
if 1 in used_index:
|
|
66 |
if 1 in used_index: |
|
61 | 67 |
self.ui.label_Img_In.setVisible(True) |
62 |
|
|
68 |
|
|
63 | 69 |
self.ui.label_Suc.setVisible(True) |
64 |
self.ui.lineEdit_Suc_Pressure.setEnabled(True)
|
|
70 |
self.ui.lineEdit_Suc_Pressure.setEnabled(True) |
|
65 | 71 |
self.ui.lineEdit_Suc_Elevation.setEnabled(True) |
66 | 72 |
|
67 | 73 |
if 2 in used_index: |
68 | 74 |
self.ui.label_Img_Out.setVisible(True) |
69 |
|
|
75 |
|
|
70 | 76 |
self.ui.label_Dis.setVisible(True) |
71 | 77 |
self.ui.lineEdit_Dis_Pressure.setEnabled(True) |
72 | 78 |
self.ui.lineEdit_Dis_Elevation.setEnabled(True) |
73 |
|
|
79 |
|
|
74 | 80 |
def load_data(self): |
75 | 81 |
""" load tag no and nozzle data """ |
76 | 82 |
from Drawing import Drawing |
77 |
|
|
83 |
self.ui.lineEdit_TagNo.setText(self._item.tag_no) |
|
84 |
|
|
78 | 85 |
appDocData = AppDocData.instance() |
79 |
drawing = appDocData.activeDrawing
|
|
86 |
drawing = appDocData.activeDrawing |
|
80 | 87 |
if drawing: |
81 | 88 |
for attr in drawing.attrs: |
82 | 89 |
if attr[0] == 'Units': |
... | ... | |
86 | 93 |
for connector in self._item.connectors: |
87 | 94 |
index = connector._conn_index |
88 | 95 |
if connector.data: |
89 |
pressure = connector.data.pressure
|
|
96 |
pressure = connector.data.pressure |
|
90 | 97 |
if pressure: |
91 | 98 |
if index == 1: |
92 | 99 |
self.ui.lineEdit_Suc_Pressure.setText(str(pressure)) |
93 | 100 |
elif index == 2: |
94 | 101 |
self.ui.lineEdit_Dis_Pressure.setText(str(pressure)) |
95 |
|
|
102 |
|
|
96 | 103 |
elevation = connector.data.elevation |
97 | 104 |
if elevation: |
98 | 105 |
if index == 1: |
... | ... | |
103 | 110 |
def accept(self): |
104 | 111 |
""" set tag no and nozzle data """ |
105 | 112 |
from EngineeringConnectorItem import NozzleData |
106 |
|
|
107 |
for connector in self._item.connectors: |
|
108 |
index = connector._conn_index |
|
109 |
if not connector.data: |
|
110 |
connector.data = NozzleData() |
|
111 |
|
|
112 |
if index == 1: |
|
113 |
pressure = self.ui.lineEdit_Suc_Pressure.text() |
|
114 |
if pressure: |
|
115 |
connector.data.pressure = float(pressure) |
|
116 |
else: |
|
117 |
connector.data.pressure = None |
|
118 |
|
|
119 |
elevation = self.ui.lineEdit_Suc_Elevation.text() |
|
120 |
if elevation: |
|
121 |
connector.data.elevation = float(elevation) |
|
122 |
else: |
|
123 |
connector.data.elevation = None |
|
124 |
elif index == 2: |
|
125 |
pressure = self.ui.lineEdit_Dis_Pressure.text() |
|
126 |
if pressure: |
|
127 |
connector.data.pressure = float(pressure) |
|
128 |
else: |
|
129 |
connector.data.pressure = None |
|
130 |
|
|
131 |
elevation = self.ui.lineEdit_Dis_Elevation.text() |
|
132 |
if elevation: |
|
133 |
connector.data.elevation = float(elevation) |
|
134 |
else: |
|
135 |
connector.data.elevation = None |
|
136 |
|
|
137 |
QDialog.accept(self) |
|
113 |
tag_no = self.ui.lineEdit_TagNo.text() |
|
114 |
|
|
115 |
if is_not_blank(tag_no): |
|
116 |
self._item.tag_no = tag_no |
|
117 |
for connector in self._item.connectors: |
|
118 |
index = connector._conn_index |
|
119 |
if not connector.data: |
|
120 |
connector.data = NozzleData() |
|
121 |
|
|
122 |
if index == 1: |
|
123 |
pressure = self.ui.lineEdit_Suc_Pressure.text() |
|
124 |
if pressure: |
|
125 |
connector.data.pressure = float(pressure) |
|
126 |
else: |
|
127 |
connector.data.pressure = None |
|
128 |
|
|
129 |
elevation = self.ui.lineEdit_Suc_Elevation.text() |
|
130 |
if elevation: |
|
131 |
connector.data.elevation = float(elevation) |
|
132 |
else: |
|
133 |
connector.data.elevation = None |
|
134 |
elif index == 2: |
|
135 |
pressure = self.ui.lineEdit_Dis_Pressure.text() |
|
136 |
if pressure: |
|
137 |
connector.data.pressure = float(pressure) |
|
138 |
else: |
|
139 |
connector.data.pressure = None |
|
140 |
|
|
141 |
elevation = self.ui.lineEdit_Dis_Elevation.text() |
|
142 |
if elevation: |
|
143 |
connector.data.elevation = float(elevation) |
|
144 |
else: |
|
145 |
connector.data.elevation = None |
|
146 |
|
|
147 |
QDialog.accept(self) |
|
148 |
else: |
|
149 |
QMessageBox.warning(self, self.tr('Notice'), self.tr('Please Input [Tag No.]')) |
|
138 | 150 |
|
139 | 151 |
def reject(self): |
140 |
QDialog.reject(self) |
|
152 |
QDialog.reject(self) |
HYTOS/HYTOS/ConeRoof.py | ||
---|---|---|
13 | 13 |
import ConeRoof_UI |
14 | 14 |
import math |
15 | 15 |
|
16 |
|
|
17 |
def is_not_blank(s): |
|
18 |
return bool(s and s.strip()) |
|
19 |
|
|
20 |
|
|
16 | 21 |
class QConeRoof(QDialog): |
17 | 22 |
def __init__(self): |
18 | 23 |
QDialog.__init__(self) |
19 | 24 |
|
20 | 25 |
self.ui = ConeRoof_UI.Ui_ConeRoofDialog() |
21 | 26 |
self.ui.setupUi(self) |
27 |
self._item = None |
|
22 | 28 |
|
23 |
self.ui.lineEdit_N1_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Pressure))
|
|
29 |
self.ui.lineEdit_N1_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Pressure)) |
|
24 | 30 |
self.ui.lineEdit_N2_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Pressure)) |
25 | 31 |
self.ui.lineEdit_N3_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N3_Pressure)) |
26 |
self.ui.lineEdit_N4_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Pressure))
|
|
27 |
self.ui.lineEdit_N5_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Pressure))
|
|
28 |
self.ui.lineEdit_N6_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Pressure))
|
|
29 |
self.ui.lineEdit_N7_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Pressure))
|
|
32 |
self.ui.lineEdit_N4_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Pressure)) |
|
33 |
self.ui.lineEdit_N5_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Pressure)) |
|
34 |
self.ui.lineEdit_N6_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Pressure)) |
|
35 |
self.ui.lineEdit_N7_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Pressure)) |
|
30 | 36 |
self.ui.lineEdit_N8_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N8_Pressure)) |
31 | 37 |
self.ui.lineEdit_N9_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N9_Pressure)) |
32 | 38 |
|
33 |
self.ui.lineEdit_N1_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Elevation))
|
|
34 |
self.ui.lineEdit_N2_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Elevation))
|
|
39 |
self.ui.lineEdit_N1_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Elevation)) |
|
40 |
self.ui.lineEdit_N2_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Elevation)) |
|
35 | 41 |
self.ui.lineEdit_N3_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N3_Elevation)) |
36 |
self.ui.lineEdit_N4_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Elevation))
|
|
37 |
self.ui.lineEdit_N5_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Elevation))
|
|
38 |
self.ui.lineEdit_N6_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Elevation))
|
|
39 |
self.ui.lineEdit_N7_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Elevation))
|
|
42 |
self.ui.lineEdit_N4_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Elevation)) |
|
43 |
self.ui.lineEdit_N5_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Elevation)) |
|
44 |
self.ui.lineEdit_N6_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Elevation)) |
|
45 |
self.ui.lineEdit_N7_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Elevation)) |
|
40 | 46 |
self.ui.lineEdit_N8_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N8_Elevation)) |
41 | 47 |
self.ui.lineEdit_N9_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N9_Elevation)) |
42 | 48 |
|
43 |
|
|
44 | 49 |
self.initialize() |
45 |
|
|
46 |
def showDialog(self, item):
|
|
50 |
|
|
51 |
def show_dialog(self, item):
|
|
47 | 52 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
48 | 53 |
self._item = item |
49 | 54 |
|
50 | 55 |
self.ui.lineEdit_TagNo.setFocus() |
51 |
self.set_controls(item)
|
|
56 |
self.set_controls() |
|
52 | 57 |
self.load_data() |
53 | 58 |
|
54 | 59 |
return self.exec_() |
... | ... | |
64 | 69 |
self.ui.label_Img_N7.setVisible(False) |
65 | 70 |
self.ui.label_Img_N8.setVisible(False) |
66 | 71 |
self.ui.label_Img_N9.setVisible(False) |
67 |
|
|
72 |
|
|
68 | 73 |
self.ui.label_N1.setVisible(False) |
69 |
self.ui.lineEdit_N1_Pressure.setEnabled(False)
|
|
74 |
self.ui.lineEdit_N1_Pressure.setEnabled(False) |
|
70 | 75 |
self.ui.lineEdit_N1_Elevation.setEnabled(False) |
71 |
|
|
76 |
|
|
72 | 77 |
self.ui.label_N2.setVisible(False) |
73 |
self.ui.lineEdit_N2_Pressure.setEnabled(False)
|
|
78 |
self.ui.lineEdit_N2_Pressure.setEnabled(False) |
|
74 | 79 |
self.ui.lineEdit_N2_Elevation.setEnabled(False) |
75 |
|
|
80 |
|
|
76 | 81 |
self.ui.label_N3.setVisible(False) |
77 |
self.ui.lineEdit_N3_Pressure.setEnabled(False)
|
|
82 |
self.ui.lineEdit_N3_Pressure.setEnabled(False) |
|
78 | 83 |
self.ui.lineEdit_N3_Elevation.setEnabled(False) |
79 | 84 |
|
80 | 85 |
self.ui.label_N4.setVisible(False) |
81 |
self.ui.lineEdit_N4_Pressure.setEnabled(False)
|
|
86 |
self.ui.lineEdit_N4_Pressure.setEnabled(False) |
|
82 | 87 |
self.ui.lineEdit_N4_Elevation.setEnabled(False) |
83 | 88 |
|
84 | 89 |
self.ui.label_N5.setVisible(False) |
85 |
self.ui.lineEdit_N5_Pressure.setEnabled(False)
|
|
90 |
self.ui.lineEdit_N5_Pressure.setEnabled(False) |
|
86 | 91 |
self.ui.lineEdit_N5_Elevation.setEnabled(False) |
87 | 92 |
|
88 | 93 |
self.ui.label_N6.setVisible(False) |
89 |
self.ui.lineEdit_N6_Pressure.setEnabled(False)
|
|
94 |
self.ui.lineEdit_N6_Pressure.setEnabled(False) |
|
90 | 95 |
self.ui.lineEdit_N6_Elevation.setEnabled(False) |
91 | 96 |
|
92 | 97 |
self.ui.label_N7.setVisible(False) |
93 |
self.ui.lineEdit_N7_Pressure.setEnabled(False)
|
|
98 |
self.ui.lineEdit_N7_Pressure.setEnabled(False) |
|
94 | 99 |
self.ui.lineEdit_N7_Elevation.setEnabled(False) |
95 | 100 |
|
96 | 101 |
self.ui.label_N8.setVisible(False) |
97 |
self.ui.lineEdit_N8_Pressure.setEnabled(False)
|
|
102 |
self.ui.lineEdit_N8_Pressure.setEnabled(False) |
|
98 | 103 |
self.ui.lineEdit_N8_Elevation.setEnabled(False) |
99 | 104 |
|
100 | 105 |
self.ui.label_N9.setVisible(False) |
101 |
self.ui.lineEdit_N9_Pressure.setEnabled(False)
|
|
106 |
self.ui.lineEdit_N9_Pressure.setEnabled(False) |
|
102 | 107 |
self.ui.lineEdit_N9_Elevation.setEnabled(False) |
103 | 108 |
|
104 |
def set_controls(self, item):
|
|
109 |
def set_controls(self):
|
|
105 | 110 |
# To do : 이름으로 Control 찾아오기 |
106 |
for connector in item.connectors:
|
|
111 |
for connector in self._item.connectors:
|
|
107 | 112 |
index = connector._conn_index |
108 | 113 |
if connector.connectedItem: |
109 | 114 |
if index == 1: |
110 | 115 |
self.ui.label_Img_N1.setVisible(True) |
111 | 116 |
self.ui.label_N1.setVisible(True) |
112 |
self.ui.lineEdit_N1_Pressure.setEnabled(True)
|
|
117 |
self.ui.lineEdit_N1_Pressure.setEnabled(True) |
|
113 | 118 |
self.ui.lineEdit_N1_Elevation.setEnabled(True) |
114 | 119 |
elif index == 2: |
115 | 120 |
self.ui.label_Img_N2.setVisible(True) |
116 | 121 |
self.ui.label_N2.setVisible(True) |
117 |
self.ui.lineEdit_N2_Pressure.setEnabled(True)
|
|
122 |
self.ui.lineEdit_N2_Pressure.setEnabled(True) |
|
118 | 123 |
self.ui.lineEdit_N2_Elevation.setEnabled(True) |
119 | 124 |
elif index == 3: |
120 | 125 |
self.ui.label_Img_N3.setVisible(True) |
121 | 126 |
self.ui.label_N3.setVisible(True) |
122 |
self.ui.lineEdit_N3_Pressure.setEnabled(True)
|
|
127 |
self.ui.lineEdit_N3_Pressure.setEnabled(True) |
|
123 | 128 |
self.ui.lineEdit_N3_Elevation.setEnabled(True) |
124 | 129 |
elif index == 4: |
125 | 130 |
self.ui.label_Img_N4.setVisible(True) |
126 | 131 |
self.ui.label_N4.setVisible(True) |
127 |
self.ui.lineEdit_N4_Pressure.setEnabled(True)
|
|
132 |
self.ui.lineEdit_N4_Pressure.setEnabled(True) |
|
128 | 133 |
self.ui.lineEdit_N4_Elevation.setEnabled(True) |
129 | 134 |
elif index == 5: |
130 | 135 |
self.ui.label_Img_N5.setVisible(True) |
131 | 136 |
self.ui.label_N5.setVisible(True) |
132 |
self.ui.lineEdit_N5_Pressure.setEnabled(True)
|
|
133 |
self.ui.lineEdit_N5_Elevation.setEnabled(True)
|
|
137 |
self.ui.lineEdit_N5_Pressure.setEnabled(True) |
|
138 |
self.ui.lineEdit_N5_Elevation.setEnabled(True) |
|
134 | 139 |
elif index == 6: |
135 | 140 |
self.ui.label_Img_N6.setVisible(True) |
136 | 141 |
self.ui.label_N6.setVisible(True) |
137 |
self.ui.lineEdit_N6_Pressure.setEnabled(True)
|
|
138 |
self.ui.lineEdit_N6_Elevation.setEnabled(True)
|
|
142 |
self.ui.lineEdit_N6_Pressure.setEnabled(True) |
|
143 |
self.ui.lineEdit_N6_Elevation.setEnabled(True) |
|
139 | 144 |
elif index == 7: |
140 | 145 |
self.ui.label_Img_N7.setVisible(True) |
141 | 146 |
self.ui.label_N7.setVisible(True) |
142 |
self.ui.lineEdit_N7_Pressure.setEnabled(True)
|
|
143 |
self.ui.lineEdit_N7_Elevation.setEnabled(True)
|
|
147 |
self.ui.lineEdit_N7_Pressure.setEnabled(True) |
|
148 |
self.ui.lineEdit_N7_Elevation.setEnabled(True) |
|
144 | 149 |
elif index == 8: |
145 | 150 |
self.ui.label_Img_N8.setVisible(True) |
146 | 151 |
self.ui.label_N8.setVisible(True) |
147 |
self.ui.lineEdit_N8_Pressure.setEnabled(True)
|
|
148 |
self.ui.lineEdit_N8_Elevation.setEnabled(True)
|
|
152 |
self.ui.lineEdit_N8_Pressure.setEnabled(True) |
|
153 |
self.ui.lineEdit_N8_Elevation.setEnabled(True) |
|
149 | 154 |
elif index == 9: |
150 | 155 |
self.ui.label_Img_N9.setVisible(True) |
151 | 156 |
self.ui.label_N9.setVisible(True) |
152 |
self.ui.lineEdit_N9_Pressure.setEnabled(True)
|
|
153 |
self.ui.lineEdit_N9_Elevation.setEnabled(True)
|
|
154 |
|
|
157 |
self.ui.lineEdit_N9_Pressure.setEnabled(True) |
|
158 |
self.ui.lineEdit_N9_Elevation.setEnabled(True) |
|
159 |
|
|
155 | 160 |
def load_data(self): |
156 | 161 |
""" load tag no and nozzle data """ |
157 | 162 |
from Drawing import Drawing |
158 |
|
|
163 |
self.ui.lineEdit_TagNo.setText(self._item.tag_no) |
|
164 |
|
|
159 | 165 |
appDocData = AppDocData.instance() |
160 |
drawing = appDocData.activeDrawing
|
|
166 |
drawing = appDocData.activeDrawing |
|
161 | 167 |
if drawing: |
162 | 168 |
for attr in drawing.attrs: |
163 | 169 |
if attr[0] == 'Units': |
164 | 170 |
self.ui.label_PressureUnit.setText('{}(g)'.format(attr[1]['Pressure'])) |
165 | 171 |
self.ui.label_ElevationUnit.setText(attr[1]['Length']) |
166 |
|
|
172 |
|
|
167 | 173 |
for connector in self._item.connectors: |
168 | 174 |
index = connector._conn_index |
169 | 175 |
if connector.data: |
170 |
pressure = connector.data.pressure
|
|
176 |
pressure = connector.data.pressure |
|
171 | 177 |
if pressure: |
172 | 178 |
if index == 1: |
173 | 179 |
self.ui.lineEdit_N1_Pressure.setText(str(pressure)) |
... | ... | |
178 | 184 |
elif index == 4: |
179 | 185 |
self.ui.lineEdit_N4_Pressure.setText(str(pressure)) |
180 | 186 |
elif index == 5: |
181 |
self.ui.lineEdit_N5_Pressure.setText(str(pressure))
|
|
187 |
self.ui.lineEdit_N5_Pressure.setText(str(pressure)) |
|
182 | 188 |
elif index == 6: |
183 | 189 |
self.ui.lineEdit_N6_Pressure.setText(str(pressure)) |
184 | 190 |
elif index == 7: |
185 |
self.ui.lineEdit_N7_Pressure.setText(str(pressure))
|
|
191 |
self.ui.lineEdit_N7_Pressure.setText(str(pressure)) |
|
186 | 192 |
elif index == 8: |
187 | 193 |
self.ui.lineEdit_N8_Pressure.setText(str(pressure)) |
188 | 194 |
elif index == 9: |
... | ... | |
199 | 205 |
elif index == 4: |
200 | 206 |
self.ui.lineEdit_N4_Elevation.setText(str(elevation)) |
201 | 207 |
elif index == 5: |
202 |
self.ui.lineEdit_N5_Elevation.setText(str(elevation))
|
|
208 |
self.ui.lineEdit_N5_Elevation.setText(str(elevation)) |
|
203 | 209 |
elif index == 6: |
204 | 210 |
self.ui.lineEdit_N6_Elevation.setText(str(elevation)) |
205 | 211 |
elif index == 7: |
206 |
self.ui.lineEdit_N7_Elevation.setText(str(elevation))
|
|
212 |
self.ui.lineEdit_N7_Elevation.setText(str(elevation)) |
|
207 | 213 |
elif index == 8: |
208 | 214 |
self.ui.lineEdit_N8_Elevation.setText(str(elevation)) |
209 | 215 |
elif index == 9: |
210 | 216 |
self.ui.lineEdit_N9_Elevation.setText(str(elevation)) |
211 | 217 |
|
212 |
|
|
213 | 218 |
def accept(self): |
214 | 219 |
""" set tag no and nozzle data """ |
215 | 220 |
from EngineeringConnectorItem import NozzleData |
221 |
tag_no = self.ui.lineEdit_TagNo.text() |
|
216 | 222 |
|
217 |
for connector in self._item.connectors: |
|
218 |
index = connector._conn_index |
|
219 |
if not connector.data: |
|
220 |
connector.data = NozzleData() |
|
221 |
|
|
222 |
if index == 1: |
|
223 |
pressure = self.ui.lineEdit_N1_Pressure.text() |
|
224 |
if pressure: |
|
225 |
connector.data.pressure = float(pressure) |
|
226 |
else: |
|
227 |
connector.data.pressure = None |
|
228 |
|
|
229 |
elevation = self.ui.lineEdit_N1_Elevation.text() |
|
230 |
if elevation: |
|
231 |
connector.data.elevation = float(elevation) |
|
232 |
else: |
|
233 |
connector.data.elevation = None |
|
234 |
elif index == 2: |
|
235 |
pressure = self.ui.lineEdit_N2_Pressure.text() |
|
236 |
if pressure: |
|
237 |
connector.data.pressure = float(pressure) |
|
238 |
else: |
|
239 |
connector.data.pressure = None |
|
240 |
|
|
241 |
elevation = self.ui.lineEdit_N2_Elevation.text() |
|
242 |
if elevation: |
|
243 |
connector.data.elevation = float(elevation) |
|
244 |
else: |
|
245 |
connector.data.elevation = None |
|
246 |
elif index == 3: |
|
247 |
pressure = self.ui.lineEdit_N3_Pressure.text() |
|
248 |
if pressure: |
|
249 |
connector.data.pressure = float(pressure) |
|
250 |
else: |
|
251 |
connector.data.pressure = None |
|
252 |
|
|
253 |
elevation = self.ui.lineEdit_N3_Elevation.text() |
|
254 |
if elevation: |
|
255 |
connector.data.elevation = float(elevation) |
|
256 |
else: |
|
257 |
connector.data.elevation = None |
|
258 |
elif index == 4: |
|
259 |
pressure = self.ui.lineEdit_N4_Pressure.text() |
|
260 |
if pressure: |
|
261 |
connector.data.pressure = float(pressure) |
|
262 |
else: |
|
263 |
connector.data.pressure = None |
|
264 |
|
|
265 |
elevation = self.ui.lineEdit_N4_Elevation.text() |
|
266 |
if elevation: |
|
267 |
connector.data.elevation = float(elevation) |
|
268 |
else: |
|
269 |
connector.data.elevation = None |
|
270 |
elif index == 5: |
|
271 |
pressure = self.ui.lineEdit_N5_Pressure.text() |
|
272 |
if pressure: |
|
273 |
connector.data.pressure = float(pressure) |
|
274 |
else: |
|
275 |
connector.data.pressure = None |
|
276 |
|
|
277 |
elevation = self.ui.lineEdit_N5_Elevation.text() |
|
278 |
if elevation: |
|
279 |
connector.data.elevation = float(elevation) |
|
280 |
else: |
|
281 |
connector.data.elevation = None |
|
282 |
elif index == 6: |
|
283 |
pressure = self.ui.lineEdit_N6_Pressure.text() |
|
284 |
if pressure: |
|
285 |
connector.data.pressure = float(pressure) |
|
286 |
else: |
|
287 |
connector.data.pressure = None |
|
288 |
|
|
289 |
elevation = self.ui.lineEdit_N6_Elevation.text() |
|
290 |
if elevation: |
|
291 |
connector.data.elevation = float(elevation) |
|
292 |
else: |
|
293 |
connector.data.elevation = None |
|
294 |
elif index == 7: |
|
295 |
pressure = self.ui.lineEdit_N7_Pressure.text() |
|
296 |
if pressure: |
|
297 |
connector.data.pressure = float(pressure) |
|
298 |
else: |
|
299 |
connector.data.pressure = None |
|
300 |
|
|
301 |
elevation = self.ui.lineEdit_N7_Elevation.text() |
|
302 |
if elevation: |
|
303 |
connector.data.elevation = float(elevation) |
|
304 |
else: |
|
305 |
connector.data.elevation = None |
|
306 |
elif index == 8: |
|
307 |
pressure = self.ui.lineEdit_N8_Pressure.text() |
|
308 |
if pressure: |
|
309 |
connector.data.pressure = float(pressure) |
|
310 |
else: |
|
311 |
connector.data.pressure = None |
|
312 |
|
|
313 |
elevation = self.ui.lineEdit_N8_Elevation.text() |
|
314 |
if elevation: |
|
315 |
connector.data.elevation = float(elevation) |
|
316 |
else: |
|
317 |
connector.data.elevation = None |
|
318 |
elif index == 9: |
|
319 |
pressure = self.ui.lineEdit_N9_Pressure.text() |
|
320 |
if pressure: |
|
321 |
connector.data.pressure = float(pressure) |
|
322 |
else: |
|
323 |
connector.data.pressure = None |
|
324 |
|
|
325 |
elevation = self.ui.lineEdit_N9_Elevation.text() |
|
326 |
if elevation: |
|
327 |
connector.data.elevation = float(elevation) |
|
328 |
else: |
|
329 |
connector.data.elevation = None |
|
223 |
if is_not_blank(tag_no): |
|
224 |
self._item.tag_no = tag_no |
|
225 |
for connector in self._item.connectors: |
|
226 |
index = connector._conn_index |
|
227 |
if not connector.data: |
|
228 |
connector.data = NozzleData() |
|
330 | 229 |
|
331 |
QDialog.accept(self) |
|
230 |
if index == 1: |
|
231 |
pressure = self.ui.lineEdit_N1_Pressure.text() |
|
232 |
if pressure: |
|
233 |
connector.data.pressure = float(pressure) |
|
234 |
else: |
|
235 |
connector.data.pressure = None |
|
236 |
|
|
237 |
elevation = self.ui.lineEdit_N1_Elevation.text() |
|
238 |
if elevation: |
|
239 |
connector.data.elevation = float(elevation) |
|
240 |
else: |
|
241 |
connector.data.elevation = None |
|
242 |
elif index == 2: |
|
243 |
pressure = self.ui.lineEdit_N2_Pressure.text() |
|
244 |
if pressure: |
|
245 |
connector.data.pressure = float(pressure) |
|
246 |
else: |
|
247 |
connector.data.pressure = None |
|
248 |
|
|
249 |
elevation = self.ui.lineEdit_N2_Elevation.text() |
|
250 |
if elevation: |
|
251 |
connector.data.elevation = float(elevation) |
|
252 |
else: |
|
253 |
connector.data.elevation = None |
|
254 |
elif index == 3: |
|
255 |
pressure = self.ui.lineEdit_N3_Pressure.text() |
|
256 |
if pressure: |
|
257 |
connector.data.pressure = float(pressure) |
|
258 |
else: |
|
259 |
connector.data.pressure = None |
|
260 |
|
|
261 |
elevation = self.ui.lineEdit_N3_Elevation.text() |
|
262 |
if elevation: |
|
263 |
connector.data.elevation = float(elevation) |
|
264 |
else: |
|
265 |
connector.data.elevation = None |
|
266 |
elif index == 4: |
|
267 |
pressure = self.ui.lineEdit_N4_Pressure.text() |
|
268 |
if pressure: |
|
269 |
connector.data.pressure = float(pressure) |
|
270 |
else: |
|
271 |
connector.data.pressure = None |
|
272 |
|
|
273 |
elevation = self.ui.lineEdit_N4_Elevation.text() |
|
274 |
if elevation: |
|
275 |
connector.data.elevation = float(elevation) |
|
276 |
else: |
|
277 |
connector.data.elevation = None |
|
278 |
elif index == 5: |
|
279 |
pressure = self.ui.lineEdit_N5_Pressure.text() |
|
280 |
if pressure: |
|
281 |
connector.data.pressure = float(pressure) |
|
282 |
else: |
|
283 |
connector.data.pressure = None |
|
284 |
|
|
285 |
elevation = self.ui.lineEdit_N5_Elevation.text() |
|
286 |
if elevation: |
|
287 |
connector.data.elevation = float(elevation) |
|
288 |
else: |
|
289 |
connector.data.elevation = None |
|
290 |
elif index == 6: |
|
291 |
pressure = self.ui.lineEdit_N6_Pressure.text() |
|
292 |
if pressure: |
|
293 |
connector.data.pressure = float(pressure) |
|
294 |
else: |
|
295 |
connector.data.pressure = None |
|
296 |
|
|
297 |
elevation = self.ui.lineEdit_N6_Elevation.text() |
|
298 |
if elevation: |
|
299 |
connector.data.elevation = float(elevation) |
|
300 |
else: |
|
301 |
connector.data.elevation = None |
|
302 |
elif index == 7: |
|
303 |
pressure = self.ui.lineEdit_N7_Pressure.text() |
|
304 |
if pressure: |
|
305 |
connector.data.pressure = float(pressure) |
|
306 |
else: |
|
307 |
connector.data.pressure = None |
|
308 |
|
|
309 |
elevation = self.ui.lineEdit_N7_Elevation.text() |
|
310 |
if elevation: |
|
311 |
connector.data.elevation = float(elevation) |
|
312 |
else: |
|
313 |
connector.data.elevation = None |
|
314 |
elif index == 8: |
|
315 |
pressure = self.ui.lineEdit_N8_Pressure.text() |
|
316 |
if pressure: |
|
317 |
connector.data.pressure = float(pressure) |
|
318 |
else: |
|
319 |
connector.data.pressure = None |
|
320 |
|
|
321 |
elevation = self.ui.lineEdit_N8_Elevation.text() |
|
322 |
if elevation: |
|
323 |
connector.data.elevation = float(elevation) |
|
324 |
else: |
|
325 |
connector.data.elevation = None |
|
326 |
elif index == 9: |
|
327 |
pressure = self.ui.lineEdit_N9_Pressure.text() |
내보내기 Unified diff