프로젝트

일반

사용자정보

개정판 24ea7edf

ID24ea7edf68aa7567924fd0c4524833b2b04bb965
상위 d21025cf
하위 09a565dd, bee1327f

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

issue #1053: - 기기의 데이타를 입력하고 로딩한다(모든 폼에 적용)

Change-Id: Iae177462cc3b0102ffa48576b688b24bc675c3c6

차이점 보기:

HYTOS/HYTOS/Drum_Vertical.py
20 20

  
21 21
        self.ui = Drum_Vertical_UI.Ui_Drum_VerticalDialog()
22 22
        self.ui.setupUi(self)
23

  
24
        self.ui.lineEdit_N1_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Pressure)) 
25
        self.ui.lineEdit_N2_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Pressure))
26
        self.ui.lineEdit_N3_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N3_Pressure))
27
        self.ui.lineEdit_N4_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Pressure))        
28
        self.ui.lineEdit_N5_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Pressure))        
29
        self.ui.lineEdit_N6_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Pressure))        
30
        self.ui.lineEdit_N7_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Pressure))        
31
        self.ui.lineEdit_N8_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N8_Pressure))
32
        self.ui.lineEdit_N9_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N9_Pressure))        
33
        self.ui.lineEdit_N10_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N10_Pressure))        
34
        self.ui.lineEdit_N11_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N11_Pressure))        
35
        self.ui.lineEdit_N12_Pressure.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N12_Pressure))
36

  
37
        self.ui.lineEdit_N1_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N1_Elevation)) 		
38
        self.ui.lineEdit_N2_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N2_Elevation))		
39
        self.ui.lineEdit_N3_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N3_Elevation))
40
        self.ui.lineEdit_N4_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N4_Elevation)) 
41
        self.ui.lineEdit_N5_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N5_Elevation)) 
42
        self.ui.lineEdit_N6_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N6_Elevation)) 
43
        self.ui.lineEdit_N7_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N7_Elevation)) 
44
        self.ui.lineEdit_N8_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N8_Elevation))
45
        self.ui.lineEdit_N9_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N9_Elevation)) 
46
        self.ui.lineEdit_N10_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N10_Elevation)) 
47
        self.ui.lineEdit_N11_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N11_Elevation)) 
48
        self.ui.lineEdit_N12_Elevation.setValidator(QtGui.QDoubleValidator(self.ui.lineEdit_N12_Elevation))
49

  
23 50
        self.initialize()
24 51

  
25 52
    def showDialog(self, item):
26 53
        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
27
        
54
        self._item = item
55

  
28 56
        self.ui.lineEdit_TagNo.setFocus()
29 57
        self.set_controls(item)
30
        self.load_units()
58
        self.load_data()
31 59

  
32 60
        self.exec_()
33 61

  
......
161 189
                    self.ui.lineEdit_N12_Pressure.setEnabled(True)                
162 190
                    self.ui.lineEdit_N12_Elevation.setEnabled(True)  
163 191

  
164
    def load_units(self):
192
    def load_data(self):
193
        """ load tag no and nozzle data """
165 194
        from Drawing import Drawing
166 195
        
167 196
        appDocData = AppDocData.instance()
......
172 201
                    self.ui.label_PressureUnit.setText(attr[1]['Pressure'])
173 202
                    self.ui.label_ElevationUnit.setText(attr[1]['Length'])
174 203
                
175
                        
204
        for connector in self._item.connectors:
205
            index = connector._conn_index
206
            if connector.nozzle_data:
207
                pressure = connector.nozzle_data.pressure                                
208
                if pressure:
209
                    if index == 1:
210
                        self.ui.lineEdit_N1_Pressure.setText(str(pressure))
211
                    elif index == 2:
212
                        self.ui.lineEdit_N2_Pressure.setText(str(pressure))
213
                    elif index == 3:
214
                        self.ui.lineEdit_N3_Pressure.setText(str(pressure))
215
                    elif index == 4:
216
                        self.ui.lineEdit_N4_Pressure.setText(str(pressure))
217
                    elif index == 5:
218
                        self.ui.lineEdit_N5_Pressure.setText(str(pressure))  
219
                    elif index == 6:
220
                        self.ui.lineEdit_N6_Pressure.setText(str(pressure))
221
                    elif index == 7:
222
                        self.ui.lineEdit_N7_Pressure.setText(str(pressure))              
223
                    elif index == 8:
224
                        self.ui.lineEdit_N8_Pressure.setText(str(pressure))
225
                    elif index == 9:
226
                        self.ui.lineEdit_N9_Pressure.setText(str(pressure))  
227
                    elif index == 10:
228
                        self.ui.lineEdit_N10_Pressure.setText(str(pressure))
229
                    elif index == 11:
230
                        self.ui.lineEdit_N11_Pressure.setText(str(pressure))              
231
                    elif index == 12:
232
                        self.ui.lineEdit_N12_Pressure.setText(str(pressure))
233

  
234
                elevation = connector.nozzle_data.elevation
235
                if elevation:
236
                    if index == 1:
237
                        self.ui.lineEdit_N1_Elevation.setText(str(elevation))
238
                    elif index == 2:
239
                        self.ui.lineEdit_N2_Elevation.setText(str(elevation))
240
                    elif index == 3:
241
                        self.ui.lineEdit_N3_Elevation.setText(str(elevation))
242
                    elif index == 4:
243
                        self.ui.lineEdit_N4_Elevation.setText(str(elevation))
244
                    elif index == 5:
245
                        self.ui.lineEdit_N5_Elevation.setText(str(elevation))  
246
                    elif index == 6:
247
                        self.ui.lineEdit_N6_Elevation.setText(str(elevation))
248
                    elif index == 7:
249
                        self.ui.lineEdit_N7_Elevation.setText(str(elevation))              
250
                    elif index == 8:
251
                        self.ui.lineEdit_N8_Elevation.setText(str(elevation))
252
                    elif index == 9:
253
                        self.ui.lineEdit_N9_Elevation.setText(str(elevation))  
254
                    elif index == 10:
255
                        self.ui.lineEdit_N10_Elevation.setText(str(elevation))
256
                    elif index == 11:
257
                        self.ui.lineEdit_N11_Elevation.setText(str(elevation))              
258
                    elif index == 12:
259
                        self.ui.lineEdit_N12_Elevation.setText(str(elevation))
260

  
176 261
    def accept(self):
262
        """ set tag no and nozzle data """
263
        from EngineeringConnectorItem import NozzleData
264

  
265
        for connector in self._item.connectors:
266
            index = connector._conn_index
267
            if not connector.nozzle_data: 
268
                connector.nozzle_data = NozzleData()
269

  
270
            if index == 1:
271
                pressure = self.ui.lineEdit_N1_Pressure.text()
272
                if pressure:
273
                    connector.nozzle_data.pressure = float(pressure)    
274
                else: 
275
                    connector.nozzle_data.pressure = None
276

  
277
                elevation = self.ui.lineEdit_N1_Elevation.text()
278
                if elevation:
279
                    connector.nozzle_data.elevation = float(elevation)  
280
                else:
281
                    connector.nozzle_data.elevation = None
282
            elif index == 2:
283
                pressure = self.ui.lineEdit_N2_Pressure.text()
284
                if pressure:
285
                    connector.nozzle_data.pressure = float(pressure)    
286
                else: 
287
                    connector.nozzle_data.pressure = None
288

  
289
                elevation = self.ui.lineEdit_N2_Elevation.text()
290
                if elevation:
291
                    connector.nozzle_data.elevation = float(elevation)  
292
                else:
293
                    connector.nozzle_data.elevation = None
294
            elif index == 3:
295
                pressure = self.ui.lineEdit_N3_Pressure.text()
296
                if pressure:
297
                    connector.nozzle_data.pressure = float(pressure)    
298
                else: 
299
                    connector.nozzle_data.pressure = None
300

  
301
                elevation = self.ui.lineEdit_N3_Elevation.text()
302
                if elevation:
303
                    connector.nozzle_data.elevation = float(elevation)  
304
                else:
305
                    connector.nozzle_data.elevation = None
306
            elif index == 4:
307
                pressure = self.ui.lineEdit_N4_Pressure.text()
308
                if pressure:
309
                    connector.nozzle_data.pressure = float(pressure)    
310
                else: 
311
                    connector.nozzle_data.pressure = None
312

  
313
                elevation = self.ui.lineEdit_N4_Elevation.text()
314
                if elevation:
315
                    connector.nozzle_data.elevation = float(elevation)  
316
                else:
317
                    connector.nozzle_data.elevation = None
318
            elif index == 5:
319
                pressure = self.ui.lineEdit_N5_Pressure.text()
320
                if pressure:
321
                    connector.nozzle_data.pressure = float(pressure)    
322
                else: 
323
                    connector.nozzle_data.pressure = None
324

  
325
                elevation = self.ui.lineEdit_N5_Elevation.text()
326
                if elevation:
327
                    connector.nozzle_data.elevation = float(elevation)  
328
                else:
329
                    connector.nozzle_data.elevation = None
330
            elif index == 6:
331
                pressure = self.ui.lineEdit_N6_Pressure.text()
332
                if pressure:
333
                    connector.nozzle_data.pressure = float(pressure)    
334
                else: 
335
                    connector.nozzle_data.pressure = None
336

  
337
                elevation = self.ui.lineEdit_N6_Elevation.text()
338
                if elevation:
339
                    connector.nozzle_data.elevation = float(elevation)  
340
                else:
341
                    connector.nozzle_data.elevation = None
342
            elif index == 7:
343
                pressure = self.ui.lineEdit_N7_Pressure.text()
344
                if pressure:
345
                    connector.nozzle_data.pressure = float(pressure)    
346
                else: 
347
                    connector.nozzle_data.pressure = None
348

  
349
                elevation = self.ui.lineEdit_N7_Elevation.text()
350
                if elevation:
351
                    connector.nozzle_data.elevation = float(elevation)  
352
                else:
353
                    connector.nozzle_data.elevation = None
354
            elif index == 8:
355
                pressure = self.ui.lineEdit_N8_Pressure.text()
356
                if pressure:
357
                    connector.nozzle_data.pressure = float(pressure)    
358
                else: 
359
                    connector.nozzle_data.pressure = None
360

  
361
                elevation = self.ui.lineEdit_N8_Elevation.text()
362
                if elevation:
363
                    connector.nozzle_data.elevation = float(elevation)  
364
                else:
365
                    connector.nozzle_data.elevation = None
366
            elif index == 9:
367
                pressure = self.ui.lineEdit_N9_Pressure.text()
368
                if pressure:
369
                    connector.nozzle_data.pressure = float(pressure)    
370
                else: 
371
                    connector.nozzle_data.pressure = None
372

  
373
                elevation = self.ui.lineEdit_N9_Elevation.text()
374
                if elevation:
375
                    connector.nozzle_data.elevation = float(elevation)  
376
                else:
377
                    connector.nozzle_data.elevation = None
378
            elif index == 10:
379
                pressure = self.ui.lineEdit_N10_Pressure.text()
380
                if pressure:
381
                    connector.nozzle_data.pressure = float(pressure)    
382
                else: 
383
                    connector.nozzle_data.pressure = None
384

  
385
                elevation = self.ui.lineEdit_N10_Elevation.text()
386
                if elevation:
387
                    connector.nozzle_data.elevation = float(elevation)  
388
                else:
389
                    connector.nozzle_data.elevation = None
390
            elif index == 11:
391
                pressure = self.ui.lineEdit_N11_Pressure.text()
392
                if pressure:
393
                    connector.nozzle_data.pressure = float(pressure)    
394
                else: 
395
                    connector.nozzle_data.pressure = None
396

  
397
                elevation = self.ui.lineEdit_N11_Elevation.text()
398
                if elevation:
399
                    connector.nozzle_data.elevation = float(elevation)  
400
                else:
401
                    connector.nozzle_data.elevation = None
402
            elif index == 12:
403
                pressure = self.ui.lineEdit_N12_Pressure.text()
404
                if pressure:
405
                    connector.nozzle_data.pressure = float(pressure)    
406
                else: 
407
                    connector.nozzle_data.pressure = None
408

  
409
                elevation = self.ui.lineEdit_N12_Elevation.text()
410
                if elevation:
411
                    connector.nozzle_data.elevation = float(elevation)  
412
                else:
413
                    connector.nozzle_data.elevation = None
177 414

  
178 415
        QDialog.accept(self)
179 416

  

내보내기 Unified diff

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