개정판 c46ad1e0
issue #1053 : 장치의 Tag No. 표기
Change-Id: I36ca926ad7b3e2384f7adf337115693f2a509e79
HYTOS/HYTOS/Drum_Horizontal.py | ||
---|---|---|
13 | 13 |
import Drum_Horizontal_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 QDrum_Horizontal(QDialog): |
17 | 22 |
def __init__(self): |
18 | 23 |
QDialog.__init__(self) |
19 | 24 |
|
20 | 25 |
self.ui = Drum_Horizontal_UI.Ui_Drum_HorizontalDialog() |
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 |
self.ui.lineEdit_N9_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N9_Pressure))
|
|
37 |
self.ui.lineEdit_N9_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N9_Pressure)) |
|
32 | 38 |
self.ui.lineEdit_N10_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N10_Pressure)) |
33 | 39 |
|
34 |
self.ui.lineEdit_N1_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Elevation))
|
|
35 |
self.ui.lineEdit_N2_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Elevation))
|
|
40 |
self.ui.lineEdit_N1_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Elevation)) |
|
41 |
self.ui.lineEdit_N2_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Elevation)) |
|
36 | 42 |
self.ui.lineEdit_N3_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N3_Elevation)) |
37 |
self.ui.lineEdit_N4_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Elevation))
|
|
38 |
self.ui.lineEdit_N5_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Elevation))
|
|
39 |
self.ui.lineEdit_N6_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Elevation))
|
|
40 |
self.ui.lineEdit_N7_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Elevation))
|
|
43 |
self.ui.lineEdit_N4_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Elevation)) |
|
44 |
self.ui.lineEdit_N5_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Elevation)) |
|
45 |
self.ui.lineEdit_N6_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Elevation)) |
|
46 |
self.ui.lineEdit_N7_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Elevation)) |
|
41 | 47 |
self.ui.lineEdit_N8_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N8_Elevation)) |
42 |
self.ui.lineEdit_N9_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N9_Elevation))
|
|
48 |
self.ui.lineEdit_N9_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N9_Elevation)) |
|
43 | 49 |
self.ui.lineEdit_N10_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N10_Elevation)) |
44 | 50 |
|
45 | 51 |
self.initialize() |
46 | 52 |
|
47 |
def showDialog(self, item):
|
|
53 |
def show_dialog(self, item):
|
|
48 | 54 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
49 | 55 |
self._item = item |
50 | 56 |
|
51 | 57 |
self.ui.lineEdit_TagNo.setFocus() |
52 |
self.set_controls(item)
|
|
58 |
self.set_controls() |
|
53 | 59 |
self.load_data() |
54 |
|
|
60 |
|
|
55 | 61 |
return self.exec_() |
56 | 62 |
|
57 | 63 |
def initialize(self): |
... | ... | |
65 | 71 |
self.ui.label_Img_N7.setVisible(False) |
66 | 72 |
self.ui.label_Img_N8.setVisible(False) |
67 | 73 |
self.ui.label_Img_N9.setVisible(False) |
68 |
self.ui.label_Img_N10.setVisible(False)
|
|
69 |
|
|
74 |
self.ui.label_Img_N10.setVisible(False) |
|
75 |
|
|
70 | 76 |
self.ui.label_N1.setVisible(False) |
71 |
self.ui.lineEdit_N1_Pressure.setEnabled(False)
|
|
77 |
self.ui.lineEdit_N1_Pressure.setEnabled(False) |
|
72 | 78 |
self.ui.lineEdit_N1_Elevation.setEnabled(False) |
73 |
|
|
79 |
|
|
74 | 80 |
self.ui.label_N2.setVisible(False) |
75 |
self.ui.lineEdit_N2_Pressure.setEnabled(False)
|
|
81 |
self.ui.lineEdit_N2_Pressure.setEnabled(False) |
|
76 | 82 |
self.ui.lineEdit_N2_Elevation.setEnabled(False) |
77 |
|
|
83 |
|
|
78 | 84 |
self.ui.label_N3.setVisible(False) |
79 |
self.ui.lineEdit_N3_Pressure.setEnabled(False)
|
|
85 |
self.ui.lineEdit_N3_Pressure.setEnabled(False) |
|
80 | 86 |
self.ui.lineEdit_N3_Elevation.setEnabled(False) |
81 | 87 |
|
82 | 88 |
self.ui.label_N4.setVisible(False) |
83 |
self.ui.lineEdit_N4_Pressure.setEnabled(False)
|
|
89 |
self.ui.lineEdit_N4_Pressure.setEnabled(False) |
|
84 | 90 |
self.ui.lineEdit_N4_Elevation.setEnabled(False) |
85 | 91 |
|
86 | 92 |
self.ui.label_N5.setVisible(False) |
87 |
self.ui.lineEdit_N5_Pressure.setEnabled(False)
|
|
93 |
self.ui.lineEdit_N5_Pressure.setEnabled(False) |
|
88 | 94 |
self.ui.lineEdit_N5_Elevation.setEnabled(False) |
89 | 95 |
|
90 | 96 |
self.ui.label_N6.setVisible(False) |
91 |
self.ui.lineEdit_N6_Pressure.setEnabled(False)
|
|
97 |
self.ui.lineEdit_N6_Pressure.setEnabled(False) |
|
92 | 98 |
self.ui.lineEdit_N6_Elevation.setEnabled(False) |
93 | 99 |
|
94 | 100 |
self.ui.label_N7.setVisible(False) |
95 |
self.ui.lineEdit_N7_Pressure.setEnabled(False)
|
|
101 |
self.ui.lineEdit_N7_Pressure.setEnabled(False) |
|
96 | 102 |
self.ui.lineEdit_N7_Elevation.setEnabled(False) |
97 | 103 |
|
98 | 104 |
self.ui.label_N8.setVisible(False) |
99 |
self.ui.lineEdit_N8_Pressure.setEnabled(False)
|
|
105 |
self.ui.lineEdit_N8_Pressure.setEnabled(False) |
|
100 | 106 |
self.ui.lineEdit_N8_Elevation.setEnabled(False) |
101 | 107 |
|
102 | 108 |
self.ui.label_N9.setVisible(False) |
103 |
self.ui.lineEdit_N9_Pressure.setEnabled(False)
|
|
109 |
self.ui.lineEdit_N9_Pressure.setEnabled(False) |
|
104 | 110 |
self.ui.lineEdit_N9_Elevation.setEnabled(False) |
105 | 111 |
|
106 | 112 |
self.ui.label_N10.setVisible(False) |
107 |
self.ui.lineEdit_N10_Pressure.setEnabled(False)
|
|
113 |
self.ui.lineEdit_N10_Pressure.setEnabled(False) |
|
108 | 114 |
self.ui.lineEdit_N10_Elevation.setEnabled(False) |
109 |
|
|
110 |
def set_controls(self, item):
|
|
115 |
|
|
116 |
def set_controls(self):
|
|
111 | 117 |
# To do : 이름으로 Control 찾아오기 |
112 |
for connector in item.connectors:
|
|
118 |
for connector in self._item.connectors:
|
|
113 | 119 |
index = connector._conn_index |
114 | 120 |
if connector.connectedItem: |
115 | 121 |
if index == 1: |
116 | 122 |
self.ui.label_Img_N1.setVisible(True) |
117 | 123 |
self.ui.label_N1.setVisible(True) |
118 |
self.ui.lineEdit_N1_Pressure.setEnabled(True)
|
|
124 |
self.ui.lineEdit_N1_Pressure.setEnabled(True) |
|
119 | 125 |
self.ui.lineEdit_N1_Elevation.setEnabled(True) |
120 | 126 |
elif index == 2: |
121 | 127 |
self.ui.label_Img_N2.setVisible(True) |
122 | 128 |
self.ui.label_N2.setVisible(True) |
123 |
self.ui.lineEdit_N2_Pressure.setEnabled(True)
|
|
129 |
self.ui.lineEdit_N2_Pressure.setEnabled(True) |
|
124 | 130 |
self.ui.lineEdit_N2_Elevation.setEnabled(True) |
125 | 131 |
elif index == 3: |
126 | 132 |
self.ui.label_Img_N3.setVisible(True) |
127 | 133 |
self.ui.label_N3.setVisible(True) |
128 |
self.ui.lineEdit_N3_Pressure.setEnabled(True)
|
|
134 |
self.ui.lineEdit_N3_Pressure.setEnabled(True) |
|
129 | 135 |
self.ui.lineEdit_N3_Elevation.setEnabled(True) |
130 | 136 |
elif index == 4: |
131 | 137 |
self.ui.label_Img_N4.setVisible(True) |
132 | 138 |
self.ui.label_N4.setVisible(True) |
133 |
self.ui.lineEdit_N4_Pressure.setEnabled(True)
|
|
139 |
self.ui.lineEdit_N4_Pressure.setEnabled(True) |
|
134 | 140 |
self.ui.lineEdit_N4_Elevation.setEnabled(True) |
135 | 141 |
elif index == 5: |
136 | 142 |
self.ui.label_Img_N5.setVisible(True) |
137 | 143 |
self.ui.label_N5.setVisible(True) |
138 |
self.ui.lineEdit_N5_Pressure.setEnabled(True)
|
|
139 |
self.ui.lineEdit_N5_Elevation.setEnabled(True)
|
|
144 |
self.ui.lineEdit_N5_Pressure.setEnabled(True) |
|
145 |
self.ui.lineEdit_N5_Elevation.setEnabled(True) |
|
140 | 146 |
elif index == 6: |
141 | 147 |
self.ui.label_Img_N6.setVisible(True) |
142 | 148 |
self.ui.label_N6.setVisible(True) |
143 |
self.ui.lineEdit_N6_Pressure.setEnabled(True)
|
|
144 |
self.ui.lineEdit_N6_Elevation.setEnabled(True)
|
|
149 |
self.ui.lineEdit_N6_Pressure.setEnabled(True) |
|
150 |
self.ui.lineEdit_N6_Elevation.setEnabled(True) |
|
145 | 151 |
elif index == 7: |
146 | 152 |
self.ui.label_Img_N7.setVisible(True) |
147 | 153 |
self.ui.label_N7.setVisible(True) |
148 |
self.ui.lineEdit_N7_Pressure.setEnabled(True)
|
|
149 |
self.ui.lineEdit_N7_Elevation.setEnabled(True)
|
|
154 |
self.ui.lineEdit_N7_Pressure.setEnabled(True) |
|
155 |
self.ui.lineEdit_N7_Elevation.setEnabled(True) |
|
150 | 156 |
elif index == 8: |
151 | 157 |
self.ui.label_Img_N8.setVisible(True) |
152 | 158 |
self.ui.label_N8.setVisible(True) |
153 |
self.ui.lineEdit_N8_Pressure.setEnabled(True)
|
|
154 |
self.ui.lineEdit_N8_Elevation.setEnabled(True)
|
|
159 |
self.ui.lineEdit_N8_Pressure.setEnabled(True) |
|
160 |
self.ui.lineEdit_N8_Elevation.setEnabled(True) |
|
155 | 161 |
elif index == 9: |
156 | 162 |
self.ui.label_Img_N9.setVisible(True) |
157 | 163 |
self.ui.label_N9.setVisible(True) |
158 |
self.ui.lineEdit_N9_Pressure.setEnabled(True)
|
|
159 |
self.ui.lineEdit_N9_Elevation.setEnabled(True)
|
|
164 |
self.ui.lineEdit_N9_Pressure.setEnabled(True) |
|
165 |
self.ui.lineEdit_N9_Elevation.setEnabled(True) |
|
160 | 166 |
elif index == 10: |
161 | 167 |
self.ui.label_Img_N10.setVisible(True) |
162 | 168 |
self.ui.label_N10.setVisible(True) |
163 |
self.ui.lineEdit_N10_Pressure.setEnabled(True)
|
|
164 |
self.ui.lineEdit_N10_Elevation.setEnabled(True)
|
|
165 |
|
|
169 |
self.ui.lineEdit_N10_Pressure.setEnabled(True) |
|
170 |
self.ui.lineEdit_N10_Elevation.setEnabled(True) |
|
171 |
|
|
166 | 172 |
def load_data(self): |
167 | 173 |
""" load tag no and nozzle data """ |
168 | 174 |
from Drawing import Drawing |
169 |
|
|
175 |
self.ui.lineEdit_TagNo.setText(self._item.tag_no) |
|
176 |
|
|
170 | 177 |
appDocData = AppDocData.instance() |
171 |
drawing = appDocData.activeDrawing
|
|
178 |
drawing = appDocData.activeDrawing |
|
172 | 179 |
if drawing: |
173 | 180 |
for attr in drawing.attrs: |
174 | 181 |
if attr[0] == 'Units': |
... | ... | |
178 | 185 |
for connector in self._item.connectors: |
179 | 186 |
index = connector._conn_index |
180 | 187 |
if connector.data: |
181 |
pressure = connector.data.pressure
|
|
188 |
pressure = connector.data.pressure |
|
182 | 189 |
if pressure: |
183 | 190 |
if index == 1: |
184 | 191 |
self.ui.lineEdit_N1_Pressure.setText(str(pressure)) |
... | ... | |
189 | 196 |
elif index == 4: |
190 | 197 |
self.ui.lineEdit_N4_Pressure.setText(str(pressure)) |
191 | 198 |
elif index == 5: |
192 |
self.ui.lineEdit_N5_Pressure.setText(str(pressure))
|
|
199 |
self.ui.lineEdit_N5_Pressure.setText(str(pressure)) |
|
193 | 200 |
elif index == 6: |
194 | 201 |
self.ui.lineEdit_N6_Pressure.setText(str(pressure)) |
195 | 202 |
elif index == 7: |
196 |
self.ui.lineEdit_N7_Pressure.setText(str(pressure))
|
|
203 |
self.ui.lineEdit_N7_Pressure.setText(str(pressure)) |
|
197 | 204 |
elif index == 8: |
198 | 205 |
self.ui.lineEdit_N8_Pressure.setText(str(pressure)) |
199 | 206 |
elif index == 9: |
200 |
self.ui.lineEdit_N9_Pressure.setText(str(pressure))
|
|
207 |
self.ui.lineEdit_N9_Pressure.setText(str(pressure)) |
|
201 | 208 |
elif index == 10: |
202 | 209 |
self.ui.lineEdit_N10_Pressure.setText(str(pressure)) |
203 | 210 |
|
... | ... | |
212 | 219 |
elif index == 4: |
213 | 220 |
self.ui.lineEdit_N4_Elevation.setText(str(elevation)) |
214 | 221 |
elif index == 5: |
215 |
self.ui.lineEdit_N5_Elevation.setText(str(elevation))
|
|
222 |
self.ui.lineEdit_N5_Elevation.setText(str(elevation)) |
|
216 | 223 |
elif index == 6: |
217 | 224 |
self.ui.lineEdit_N6_Elevation.setText(str(elevation)) |
218 | 225 |
elif index == 7: |
219 |
self.ui.lineEdit_N7_Elevation.setText(str(elevation))
|
|
226 |
self.ui.lineEdit_N7_Elevation.setText(str(elevation)) |
|
220 | 227 |
elif index == 8: |
221 | 228 |
self.ui.lineEdit_N8_Elevation.setText(str(elevation)) |
222 | 229 |
elif index == 9: |
223 |
self.ui.lineEdit_N9_Elevation.setText(str(elevation))
|
|
230 |
self.ui.lineEdit_N9_Elevation.setText(str(elevation)) |
|
224 | 231 |
elif index == 10: |
225 | 232 |
self.ui.lineEdit_N10_Elevation.setText(str(elevation)) |
226 | 233 |
|
227 |
def accept(self): |
|
228 |
|
|
234 |
def accept(self): |
|
229 | 235 |
""" set tag no and nozzle data """ |
230 | 236 |
from EngineeringConnectorItem import NozzleData |
237 |
tag_no = self.ui.lineEdit_TagNo.text() |
|
231 | 238 |
|
232 |
for connector in self._item.connectors: |
|
233 |
index = connector._conn_index |
|
234 |
if not connector.data: |
|
235 |
connector.data = NozzleData() |
|
236 |
|
|
237 |
if index == 1: |
|
238 |
pressure = self.ui.lineEdit_N1_Pressure.text() |
|
239 |
if pressure: |
|
240 |
connector.data.pressure = float(pressure) |
|
241 |
else: |
|
242 |
connector.data.pressure = None |
|
243 |
|
|
244 |
elevation = self.ui.lineEdit_N1_Elevation.text() |
|
245 |
if elevation: |
|
246 |
connector.data.elevation = float(elevation) |
|
247 |
else: |
|
248 |
connector.data.elevation = None |
|
249 |
elif index == 2: |
|
250 |
pressure = self.ui.lineEdit_N2_Pressure.text() |
|
251 |
if pressure: |
|
252 |
connector.data.pressure = float(pressure) |
|
253 |
else: |
|
254 |
connector.data.pressure = None |
|
255 |
|
|
256 |
elevation = self.ui.lineEdit_N2_Elevation.text() |
|
257 |
if elevation: |
|
258 |
connector.data.elevation = float(elevation) |
|
259 |
else: |
|
260 |
connector.data.elevation = None |
|
261 |
elif index == 3: |
|
262 |
pressure = self.ui.lineEdit_N3_Pressure.text() |
|
263 |
if pressure: |
|
264 |
connector.data.pressure = float(pressure) |
|
265 |
else: |
|
266 |
connector.data.pressure = None |
|
267 |
|
|
268 |
elevation = self.ui.lineEdit_N3_Elevation.text() |
|
269 |
if elevation: |
|
270 |
connector.data.elevation = float(elevation) |
|
271 |
else: |
|
272 |
connector.data.elevation = None |
|
273 |
elif index == 4: |
|
274 |
pressure = self.ui.lineEdit_N4_Pressure.text() |
|
275 |
if pressure: |
|
276 |
connector.data.pressure = float(pressure) |
|
277 |
else: |
|
278 |
connector.data.pressure = None |
|
279 |
|
|
280 |
elevation = self.ui.lineEdit_N4_Elevation.text() |
|
281 |
if elevation: |
|
282 |
connector.data.elevation = float(elevation) |
|
283 |
else: |
|
284 |
connector.data.elevation = None |
|
285 |
elif index == 5: |
|
286 |
pressure = self.ui.lineEdit_N5_Pressure.text() |
|
287 |
if pressure: |
|
288 |
connector.data.pressure = float(pressure) |
|
289 |
else: |
|
290 |
connector.data.pressure = None |
|
239 |
if is_not_blank(tag_no): |
|
240 |
self._item.tag_no = tag_no |
|
241 |
for connector in self._item.connectors: |
|
242 |
index = connector._conn_index |
|
243 |
if not connector.data: |
|
244 |
connector.data = NozzleData() |
|
291 | 245 |
|
292 |
elevation = self.ui.lineEdit_N5_Elevation.text() |
|
293 |
if elevation: |
|
294 |
connector.data.elevation = float(elevation) |
|
295 |
else: |
|
296 |
connector.data.elevation = None |
|
297 |
elif index == 6: |
|
298 |
pressure = self.ui.lineEdit_N6_Pressure.text() |
|
299 |
if pressure: |
|
300 |
connector.data.pressure = float(pressure) |
|
301 |
else: |
|
302 |
connector.data.pressure = None |
|
303 |
|
|
304 |
elevation = self.ui.lineEdit_N6_Elevation.text() |
|
305 |
if elevation: |
|
306 |
connector.data.elevation = float(elevation) |
|
307 |
else: |
|
308 |
connector.data.elevation = None |
|
309 |
elif index == 7: |
|
310 |
pressure = self.ui.lineEdit_N7_Pressure.text() |
|
311 |
if pressure: |
|
312 |
connector.data.pressure = float(pressure) |
|
313 |
else: |
|
314 |
connector.data.pressure = None |
|
315 |
|
|
316 |
elevation = self.ui.lineEdit_N7_Elevation.text() |
|
317 |
if elevation: |
|
318 |
connector.data.elevation = float(elevation) |
|
319 |
else: |
|
320 |
connector.data.elevation = None |
|
321 |
elif index == 8: |
|
322 |
pressure = self.ui.lineEdit_N8_Pressure.text() |
|
323 |
if pressure: |
|
324 |
connector.data.pressure = float(pressure) |
|
325 |
else: |
|
326 |
connector.data.pressure = None |
|
327 |
|
|
328 |
elevation = self.ui.lineEdit_N8_Elevation.text() |
|
329 |
if elevation: |
|
330 |
connector.data.elevation = float(elevation) |
|
331 |
else: |
|
332 |
connector.data.elevation = None |
|
333 |
elif index == 9: |
|
334 |
pressure = self.ui.lineEdit_N9_Pressure.text() |
|
335 |
if pressure: |
|
336 |
connector.data.pressure = float(pressure) |
|
337 |
else: |
|
338 |
connector.data.pressure = None |
|
339 |
|
|
340 |
elevation = self.ui.lineEdit_N9_Elevation.text() |
|
341 |
if elevation: |
|
342 |
connector.data.elevation = float(elevation) |
|
343 |
else: |
|
344 |
connector.data.elevation = None |
|
345 |
elif index == 10: |
|
346 |
pressure = self.ui.lineEdit_N10_Pressure.text() |
|
347 |
if pressure: |
|
348 |
connector.data.pressure = float(pressure) |
|
349 |
else: |
|
350 |
connector.data.pressure = None |
|
351 |
|
|
352 |
elevation = self.ui.lineEdit_N10_Elevation.text() |
|
353 |
if elevation: |
|
354 |
connector.data.elevation = float(elevation) |
|
355 |
else: |
|
356 |
connector.data.elevation = None |
|
357 |
|
|
358 |
QDialog.accept(self) |
|
246 |
if index == 1: |
|
247 |
pressure = self.ui.lineEdit_N1_Pressure.text() |
|
248 |
if pressure: |
|
249 |
connector.data.pressure = float(pressure) |
|
250 |
else: |
|
251 |
connector.data.pressure = None |
|
252 |
|
|
253 |
elevation = self.ui.lineEdit_N1_Elevation.text() |
|
254 |
if elevation: |
|
255 |
connector.data.elevation = float(elevation) |
|
256 |
else: |
|
257 |
connector.data.elevation = None |
|
258 |
elif index == 2: |
|
259 |
pressure = self.ui.lineEdit_N2_Pressure.text() |
|
260 |
if pressure: |
|
261 |
connector.data.pressure = float(pressure) |
|
262 |
else: |
|
263 |
connector.data.pressure = None |
|
264 |
|
|
265 |
elevation = self.ui.lineEdit_N2_Elevation.text() |
|
266 |
if elevation: |
|
267 |
connector.data.elevation = float(elevation) |
|
268 |
else: |
|
269 |
connector.data.elevation = None |
|
270 |
elif index == 3: |
|
271 |
pressure = self.ui.lineEdit_N3_Pressure.text() |
|
272 |
if pressure: |
|
273 |
connector.data.pressure = float(pressure) |
|
274 |
else: |
|
275 |
connector.data.pressure = None |
|
276 |
|
|
277 |
elevation = self.ui.lineEdit_N3_Elevation.text() |
|
278 |
if elevation: |
|
279 |
connector.data.elevation = float(elevation) |
|
280 |
else: |
|
281 |
connector.data.elevation = None |
|
282 |
elif index == 4: |
|
283 |
pressure = self.ui.lineEdit_N4_Pressure.text() |
|
284 |
if pressure: |
|
285 |
connector.data.pressure = float(pressure) |
|
286 |
else: |
|
287 |
connector.data.pressure = None |
|
288 |
|
|
289 |
elevation = self.ui.lineEdit_N4_Elevation.text() |
|
290 |
if elevation: |
|
291 |
connector.data.elevation = float(elevation) |
|
292 |
else: |
|
293 |
connector.data.elevation = None |
|
294 |
elif index == 5: |
|
295 |
pressure = self.ui.lineEdit_N5_Pressure.text() |
|
296 |
if pressure: |
|
297 |
connector.data.pressure = float(pressure) |
|
298 |
else: |
|
299 |
connector.data.pressure = None |
|
300 |
|
|
301 |
elevation = self.ui.lineEdit_N5_Elevation.text() |
|
302 |
if elevation: |
|
303 |
connector.data.elevation = float(elevation) |
|
304 |
else: |
|
305 |
connector.data.elevation = None |
|
306 |
elif index == 6: |
|
307 |
pressure = self.ui.lineEdit_N6_Pressure.text() |
|
308 |
if pressure: |
|
309 |
connector.data.pressure = float(pressure) |
|
310 |
else: |
|
311 |
connector.data.pressure = None |
|
312 |
|
|
313 |
elevation = self.ui.lineEdit_N6_Elevation.text() |
|
314 |
if elevation: |
|
315 |
connector.data.elevation = float(elevation) |
|
316 |
else: |
|
317 |
connector.data.elevation = None |
|
318 |
elif index == 7: |
|
319 |
pressure = self.ui.lineEdit_N7_Pressure.text() |
|
320 |
if pressure: |
|
321 |
connector.data.pressure = float(pressure) |
|
322 |
else: |
|
323 |
connector.data.pressure = None |
|
324 |
|
|
325 |
elevation = self.ui.lineEdit_N7_Elevation.text() |
|
326 |
if elevation: |
|
327 |
connector.data.elevation = float(elevation) |
|
328 |
else: |
|
329 |
connector.data.elevation = None |
|
330 |
elif index == 8: |
|
331 |
pressure = self.ui.lineEdit_N8_Pressure.text() |
|
332 |
if pressure: |
|
333 |
connector.data.pressure = float(pressure) |
|
334 |
else: |
|
335 |
connector.data.pressure = None |
|
336 |
|
|
337 |
elevation = self.ui.lineEdit_N8_Elevation.text() |
|
338 |
if elevation: |
|
339 |
connector.data.elevation = float(elevation) |
|
340 |
else: |
|
341 |
connector.data.elevation = None |
|
342 |
elif index == 9: |
|
343 |
pressure = self.ui.lineEdit_N9_Pressure.text() |
|
344 |
if pressure: |
|
345 |
connector.data.pressure = float(pressure) |
|
346 |
else: |
|
347 |
connector.data.pressure = None |
|
348 |
|
|
349 |
elevation = self.ui.lineEdit_N9_Elevation.text() |
|
350 |
if elevation: |
|
351 |
connector.data.elevation = float(elevation) |
|
352 |
else: |
|
353 |
connector.data.elevation = None |
|
354 |
elif index == 10: |
|
355 |
pressure = self.ui.lineEdit_N10_Pressure.text() |
|
356 |
if pressure: |
|
357 |
connector.data.pressure = float(pressure) |
|
358 |
else: |
|
359 |
connector.data.pressure = None |
|
360 |
|
|
361 |
elevation = self.ui.lineEdit_N10_Elevation.text() |
|
362 |
if elevation: |
|
363 |
connector.data.elevation = float(elevation) |
|
364 |
else: |
|
365 |
connector.data.elevation = None |
|
366 |
|
|
367 |
QDialog.accept(self) |
|
368 |
else: |
|
369 |
QMessageBox.warning(self, self.tr('Notice'), self.tr('Please Input [Tag No.]')) |
|
359 | 370 |
|
360 | 371 |
def reject(self): |
361 |
QDialog.reject(self) |
|
372 |
QDialog.reject(self) |
내보내기 Unified diff