프로젝트

일반

사용자정보

개정판 627fb368

ID627fb368ebc5f1c592116efaac6446b2e9f753db
상위 84e69cc8
하위 f8f3db16

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

issue #1057: 스트림 라인의 배관 피팅 갯수 입력

Change-Id: I57f972fef65e5cfbf6c56651dc148782929b5919

차이점 보기:

HYTOS/HYTOS/FittingsDialog.py
99 99
            self.ui.pushButton_Add_Equivalent_Length_45_Elbow.clicked.connect(self.add_equivalent_length)
100 100
            self.ui.pushButton_Add_Equivalent_Length_Miter.clicked.connect(self.add_equivalent_length)
101 101

  
102
            self.ui.pushButton_Del_Equivalent_Length_90_Elbow.clicked.connect(self.del_equivalent_length)
103
            self.ui.pushButton_Del_Equivalent_Length_45_Elbow.clicked.connect(self.del_equivalent_length)
104
            self.ui.pushButton_Del_Equivalent_Length_Miter.clicked.connect(self.del_equivalent_length)
105

  
102 106
            # Tees
103 107
            self.ui.pushButton_Add_Equivalent_Length_Tee_Branch.clicked.connect(self.add_equivalent_length)
104 108
            self.ui.pushButton_Add_Equivalent_Length_Tee_Through.clicked.connect(self.add_equivalent_length)
105 109

  
110
            self.ui.pushButton_Del_Equivalent_Length_Tee_Through.clicked.connect(self.del_equivalent_length)
111
            self.ui.pushButton_Del_Equivalent_Length_Tee_Branch.clicked.connect(self.del_equivalent_length)
112

  
106 113
            # Valves
107 114
            self.ui.pushButton_Add_Equivalent_Length_Gate_Ball_Plug.clicked.connect(self.add_equivalent_length)
108 115
            self.ui.pushButton_Add_Equivalent_Length_Globe.clicked.connect(self.add_equivalent_length)
109 116
            self.ui.pushButton_Add_Equivalent_Length_Butterfly.clicked.connect(self.add_equivalent_length)
110 117
            self.ui.pushButton_Add_Equivalent_Length_Check.clicked.connect(self.add_equivalent_length)
111 118

  
119
            self.ui.pushButton_Del_Equivalent_Length_Gate_Ball_Plug.clicked.connect(self.del_equivalent_length)
120
            self.ui.pushButton_Del_Equivalent_Length_Globe.clicked.connect(self.del_equivalent_length)
121
            self.ui.pushButton_Del_Equivalent_Length_Butterfly.clicked.connect(self.del_equivalent_length)
122
            self.ui.pushButton_Del_Equivalent_Length_Check.clicked.connect(self.del_equivalent_length)
123

  
112 124
            # Nozzles
113 125
            self.ui.pushButton_Add_Equivalent_Length_Nozzle_In.clicked.connect(self.add_equivalent_length)
114 126
            self.ui.pushButton_Add_Equivalent_Length_Nozzle_Out.clicked.connect(self.add_equivalent_length)
115 127

  
116
            self.ui.tableWidget_Equivalent_Length_SelectedFitting.setContextMenuPolicy(Qt.CustomContextMenu)
117
            self.ui.tableWidget_Equivalent_Length_SelectedFitting.customContextMenuRequested.connect(
118
                self.del_equivalent_length)
128
            self.ui.pushButton_Del_Equivalent_Length_Nozzle_In.clicked.connect(self.del_equivalent_length)
129
            self.ui.pushButton_Del_Equivalent_Length_Nozzle_Out.clicked.connect(self.del_equivalent_length)
119 130

  
131
            self.ui.tableWidget_Equivalent_Length_SelectedFitting.setContextMenuPolicy(Qt.CustomContextMenu)
132
            self.ui.tableWidget_Equivalent_Length_SelectedFitting.customContextMenuRequested.connect(self.context_menu_del_equivalent_length)
120 133
        except Exception as ex:
121 134
            from App import App
122 135
            from AppDocData import MessageType
......
185 198

  
186 199
            # 90 Elbow
187 200
            self.ui.pushButton_Add_CraneK_90_Elbow_Standard.clicked.connect(self.add_crane_k)
201
            self.ui.pushButton_Del_CraneK_90_Elbow_Standard.clicked.connect(self.del_crane_k)
188 202
            self.ui.pushButton_View_CraneK_90_Elbow_Standard.clicked.connect(self.show_crane_k_image)
189 203
            self.ui.pushButton_Add_CraneK_90_Elbow_Bend.clicked.connect(self.add_crane_k)
204
            self.ui.pushButton_Del_CraneK_90_Elbow_Bend.clicked.connect(self.del_crane_k)
190 205
            self.ui.pushButton_View_CraneK_90_Elbow_Bend.clicked.connect(self.show_crane_k_image)
191 206
            self.ui.pushButton_Add_CraneK_90_Elbow_Miter.clicked.connect(self.add_crane_k)
207
            self.ui.pushButton_Del_CraneK_90_Elbow_Miter.clicked.connect(self.del_crane_k)
192 208
            self.ui.pushButton_View_CraneK_90_Elbow_Miter.clicked.connect(self.show_crane_k_image)
209
            self.ui.comboBox_CraneK_90_Elbow_Standard.currentIndexChanged.connect(self.on_crane_k_index_changed)
210
            self.ui.comboBox_CraneK_90_Elbow_Bend.currentIndexChanged.connect(self.on_crane_k_index_changed)
211
            self.ui.comboBox_CraneK_90_Elbow_Miter.currentIndexChanged.connect(self.on_crane_k_index_changed)
193 212
            # 45 Elbow
194 213
            self.ui.pushButton_Add_CraneK_45_Elbow_Standard.clicked.connect(self.add_crane_k)
214
            self.ui.pushButton_Del_CraneK_45_Elbow_Standard.clicked.connect(self.del_crane_k)
195 215
            self.ui.pushButton_View_CraneK_45_Elbow_Standard.clicked.connect(self.show_crane_k_image)
196 216
            self.ui.pushButton_Add_CraneK_45_Elbow_Miter.clicked.connect(self.add_crane_k)
217
            self.ui.pushButton_Del_CraneK_45_Elbow_Miter.clicked.connect(self.del_crane_k)
197 218
            self.ui.pushButton_View_CraneK_45_Elbow_Miter.clicked.connect(self.show_crane_k_image)
219
            self.ui.comboBox_CraneK_45_Elbow_Standard.currentIndexChanged.connect(self.on_crane_k_index_changed)
220
            self.ui.comboBox_CraneK_45_Elbow_Miter.currentIndexChanged.connect(self.on_crane_k_index_changed)
198 221
            # 180 Elbow
199 222
            self.ui.pushButton_Add_CraneK_180_Elbow_Standard.clicked.connect(self.add_crane_k)
223
            self.ui.pushButton_Del_CraneK_180_Elbow_Standard.clicked.connect(self.del_crane_k)
200 224
            self.ui.pushButton_View_CraneK_180_Elbow_Standard.clicked.connect(self.show_crane_k_image)
201 225
            self.ui.pushButton_Add_CraneK_180_Elbow_Bend.clicked.connect(self.add_crane_k)
226
            self.ui.pushButton_Del_CraneK_180_Elbow_Bend.clicked.connect(self.del_crane_k)
202 227
            self.ui.pushButton_View_CraneK_180_Elbow_Bend.clicked.connect(self.show_crane_k_image)
203 228
            self.ui.pushButton_Add_CraneK_180_Elbow_Miter.clicked.connect(self.add_crane_k)
229
            self.ui.pushButton_Del_CraneK_180_Elbow_Miter.clicked.connect(self.del_crane_k)
204 230
            self.ui.pushButton_View_CraneK_180_Elbow_Miter.clicked.connect(self.show_crane_k_image)
231
            self.ui.comboBox_CraneK_180_Elbow_Standard.currentIndexChanged.connect(self.on_crane_k_index_changed)
232
            self.ui.comboBox_CraneK_180_Elbow_Bend.currentIndexChanged.connect(self.on_crane_k_index_changed)
233
            self.ui.comboBox_CraneK_180_Elbow_Miter.currentIndexChanged.connect(self.on_crane_k_index_changed)
205 234
            # Tees
206 235
            self.ui.pushButton_Add_CraneK_Tees.clicked.connect(self.add_crane_k)
236
            self.ui.pushButton_Del_CraneK_Tees.clicked.connect(self.del_crane_k)
207 237
            self.ui.pushButton_View_CraneK_Tees.clicked.connect(self.show_crane_k_image)
238
            self.ui.comboBox_CraneK_Tees.currentIndexChanged.connect(self.on_crane_k_index_changed)
208 239
            # Reducer & Expander
209 240
            self.ui.pushButton_Add_CraneK_Expander.clicked.connect(self.add_crane_k)
241
            self.ui.pushButton_Del_CraneK_Expander.clicked.connect(self.del_crane_k)
210 242
            self.ui.pushButton_View_CraneK_Expander.clicked.connect(self.show_crane_k_image)
211 243
            self.ui.pushButton_Add_CraneK_Reducer.clicked.connect(self.add_crane_k)
244
            self.ui.pushButton_Del_CraneK_Reducer.clicked.connect(self.del_crane_k)
212 245
            self.ui.pushButton_View_CraneK_Reducer.clicked.connect(self.show_crane_k_image)
246
            self.ui.comboBox_CraneK_Expander.currentIndexChanged.connect(self.on_crane_k_index_changed)
247
            self.ui.comboBox_CraneK_Reducer.currentIndexChanged.connect(self.on_crane_k_index_changed)
213 248
            # Valves
214 249
            self.ui.pushButton_Add_CraneK_Valves_Globe.clicked.connect(self.add_crane_k)
250
            self.ui.pushButton_Del_CraneK_Valves_Globe.clicked.connect(self.del_crane_k)
215 251
            self.ui.pushButton_View_CraneK_Valves_Globe.clicked.connect(self.show_crane_k_image)
216 252
            self.ui.pushButton_Add_CraneK_Valves_Plug.clicked.connect(self.add_crane_k)
253
            self.ui.pushButton_Del_CraneK_Valves_Plug.clicked.connect(self.del_crane_k)
217 254
            self.ui.pushButton_View_CraneK_Valves_Plug.clicked.connect(self.show_crane_k_image)
218 255
            self.ui.pushButton_Add_CraneK_Valves_Foot.clicked.connect(self.add_crane_k)
256
            self.ui.pushButton_Del_CraneK_Valves_Foot.clicked.connect(self.del_crane_k)
219 257
            self.ui.pushButton_View_CraneK_Valves_Foot.clicked.connect(self.show_crane_k_image)
220 258
            self.ui.pushButton_Add_CraneK_Valves_Etc.clicked.connect(self.add_crane_k)
259
            self.ui.pushButton_Del_CraneK_Valves_Etc.clicked.connect(self.del_crane_k)
221 260
            self.ui.pushButton_View_CraneK_Valves_Etc.clicked.connect(self.show_crane_k_image)
261
            self.ui.comboBox_CraneK_Valves_Globe.currentIndexChanged.connect(self.on_crane_k_index_changed)
262
            self.ui.comboBox_CraneK_Valves_Plug.currentIndexChanged.connect(self.on_crane_k_index_changed)
263
            self.ui.comboBox_CraneK_Valves_Foot.currentIndexChanged.connect(self.on_crane_k_index_changed)
264
            self.ui.comboBox_CraneK_Valves_Etc.currentIndexChanged.connect(self.on_crane_k_index_changed)
222 265
            # Pipe
223 266
            self.ui.pushButton_Add_CraneK_Pipe_Entrance.clicked.connect(self.add_crane_k)
267
            self.ui.pushButton_Del_CraneK_Pipe_Entrance.clicked.connect(self.del_crane_k)
224 268
            self.ui.pushButton_View_CraneK_Pipe_Entrance.clicked.connect(self.show_crane_k_image)
225 269
            self.ui.pushButton_Add_CraneK_Pipe_Exit.clicked.connect(self.add_crane_k)
270
            self.ui.pushButton_Del_CraneK_Pipe_Exit.clicked.connect(self.del_crane_k)
226 271
            self.ui.pushButton_View_CraneK_Pipe_Exit.clicked.connect(self.show_crane_k_image)
272
            self.ui.comboBox_CraneK_Pipe_Entrance.currentIndexChanged.connect(self.on_crane_k_index_changed)
273
            self.ui.comboBox_CraneK_Pipe_Exit.currentIndexChanged.connect(self.on_crane_k_index_changed)
227 274
            # Check Values
228 275
            self.ui.pushButton_Add_CraneK_Check_Valves_Swing.clicked.connect(self.add_crane_k)
276
            self.ui.pushButton_Del_CraneK_Check_Valves_Swing.clicked.connect(self.del_crane_k)
229 277
            self.ui.pushButton_View_CraneK_Check_Valves_Swing.clicked.connect(self.show_crane_k_image)
230 278
            self.ui.pushButton_Add_CraneK_Check_Valves_Lift.clicked.connect(self.add_crane_k)
279
            self.ui.pushButton_Del_CraneK_Check_Valves_Lift.clicked.connect(self.del_crane_k)
231 280
            self.ui.pushButton_View_CraneK_Check_Valves_Lift.clicked.connect(self.show_crane_k_image)
232 281
            self.ui.pushButton_Add_CraneK_Check_Valves_Tilting.clicked.connect(self.add_crane_k)
282
            self.ui.pushButton_Del_CraneK_Check_Valves_Tilting.clicked.connect(self.del_crane_k)
233 283
            self.ui.pushButton_View_CraneK_Check_Valves_Tilting.clicked.connect(self.show_crane_k_image)
234 284
            self.ui.pushButton_Add_CraneK_Check_Valves_Globe_Stop.clicked.connect(self.add_crane_k)
285
            self.ui.pushButton_Del_CraneK_Check_Valves_Globe_Stop.clicked.connect(self.del_crane_k)
235 286
            self.ui.pushButton_View_CraneK_Check_Valves_Globe_Stop.clicked.connect(self.show_crane_k_image)
236 287
            self.ui.pushButton_Add_CraneK_Check_Valves_Angle_Stop.clicked.connect(self.add_crane_k)
288
            self.ui.pushButton_Del_CraneK_Check_Valves_Angle_Stop.clicked.connect(self.del_crane_k)
237 289
            self.ui.pushButton_View_CraneK_Check_Valves_Angle_Stop.clicked.connect(self.show_crane_k_image)
290
            self.ui.comboBox_CraneK_Check_Valves_Swing.currentIndexChanged.connect(self.on_crane_k_index_changed)
291
            self.ui.comboBox_CraneK_Check_Valves_Lift.currentIndexChanged.connect(self.on_crane_k_index_changed)
292
            self.ui.comboBox_CraneK_Check_Valves_Tilting.currentIndexChanged.connect(self.on_crane_k_index_changed)
293
            self.ui.comboBox_CraneK_Check_Valves_Globe_Stop.currentIndexChanged.connect(self.on_crane_k_index_changed)
294
            self.ui.comboBox_CraneK_Check_Valves_Angle_Stop.currentIndexChanged.connect(self.on_crane_k_index_changed)
238 295
            # Manual K
239 296
            self.ui.pushButton_Add_CraneK_Manual.clicked.connect(self.add_crane_k)
297
            self.ui.pushButton_Del_CraneK_Manual.clicked.connect(self.del_crane_k)
240 298
            self.ui.pushButton_View_CraneK_Manual.clicked.connect(self.show_crane_k_image)
299
            self.ui.comboBox_CraneK_Manual.currentIndexChanged.connect(self.on_crane_k_index_changed)
241 300

  
242 301
            self.ui.tableWidget_CraneK_SelectedFitting.setContextMenuPolicy(Qt.CustomContextMenu)
243
            self.ui.tableWidget_CraneK_SelectedFitting.customContextMenuRequested.connect(self.del_crane_k)
244

  
302
            self.ui.tableWidget_CraneK_SelectedFitting.customContextMenuRequested.connect(self.context_menu_del_crane_k)
245 303
        except Exception as ex:
246 304
            from App import App
247 305
            from AppDocData import MessageType
......
250 308
                                                           sys.exc_info()[-1].tb_lineno)
251 309
            App.mainWnd().addMessage.emit(MessageType.Error, message)
252 310

  
253
    def del_2_k(self, position):
311
    def on_2k_index_changed(self, index):
312
        data = None
313

  
314
        if self.sender() == self.ui.comboBox_2K_90_Elbow_Bend:
315
            data = self.ui.comboBox_2K_90_Elbow_Bend.itemData(index)
316
        elif self.sender() == self.ui.comboBox_2K_90_Elbow_Miter:
317
            data = self.ui.comboBox_2K_90_Elbow_Miter.itemData(index)
318
        elif self.sender() == self.ui.comboBox_2K_45_Elbow_Bend:
319
            data = self.ui.comboBox_2K_45_Elbow_Bend.itemData(index)
320
        elif self.sender() == self.ui.comboBox_2K_45_Elbow_Miter:
321
            data = self.ui.comboBox_2K_45_Elbow_Miter.itemData(index)
322
        elif self.sender() == self.ui.comboBox_2K_180_Elbow_Bend:
323
            data = self.ui.comboBox_2K_180_Elbow_Bend.itemData(index)
324
        elif self.sender() == self.ui.comboBox_2K_Tees_Elbow:
325
            data = self.ui.comboBox_2K_Tees_Elbow.itemData(index)
326
        elif self.sender() == self.ui.comboBox_2K_Tees_Through:
327
            data = self.ui.comboBox_2K_Tees_Through.itemData(index)
328
        elif self.sender() == self.ui.comboBox_2K_Valves_Gate_Ball_Plug:
329
            data = self.ui.comboBox_2K_Valves_Gate_Ball_Plug.itemData(index)
330
        elif self.sender() == self.ui.comboBox_2K_Valves_Globe:
331
            data = self.ui.comboBox_2K_Valves_Globe.itemData(index)
332
        elif self.sender() == self.ui.comboBox_2K_Valves_Others:
333
            data = self.ui.comboBox_2K_Valves_Others.itemData(index)
334
        elif self.sender() == self.ui.comboBox_2K_Pipe:
335
            data = self.ui.comboBox_2K_Pipe.itemData(index)
336
        elif self.sender() == self.ui.comboBox_2K_Check_Valves:
337
            data = self.ui.comboBox_2K_Check_Valves.itemData(index)
338

  
339
        if data:
340
            image = data[6]
341

  
342
            picture = QtGui.QPixmap(':/images/{}'.format(image))
343
            w = 150
344
            h = 150
345
            self.ui.label_2K_Img.setPixmap(
346
                picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
347

  
348
    def on_crane_k_index_changed(self, index):
349
        data = None
350

  
351
        if self.sender() == self.ui.comboBox_CraneK_90_Elbow_Standard:
352
            data = self.ui.comboBox_CraneK_90_Elbow_Standard.itemData(index)
353
        elif self.sender() == self.ui.comboBox_CraneK_90_Elbow_Bend:
354
            data = self.ui.comboBox_CraneK_90_Elbow_Bend.itemData(index)
355
        elif self.sender() == self.ui.comboBox_CraneK_90_Elbow_Miter:
356
            data = self.ui.comboBox_CraneK_90_Elbow_Miter.itemData(index)
357
        elif self.sender() == self.ui.comboBox_CraneK_45_Elbow_Standard:
358
            data = self.ui.comboBox_CraneK_45_Elbow_Standard.itemData(index)
359
        elif self.sender() == self.ui.comboBox_CraneK_45_Elbow_Miter:
360
            data = self.ui.comboBox_CraneK_45_Elbow_Miter.itemData(index)
361
        elif self.sender() == self.ui.comboBox_CraneK_180_Elbow_Standard:
362
            data = self.ui.comboBox_CraneK_180_Elbow_Standard.itemData(index)
363
        elif self.sender() == self.ui.comboBox_CraneK_180_Elbow_Bend:
364
            data = self.ui.comboBox_CraneK_180_Elbow_Bend.itemData(index)
365
        elif self.sender() == self.ui.comboBox_CraneK_180_Elbow_Miter:
366
            data = self.ui.comboBox_CraneK_180_Elbow_Miter.itemData(index)
367
        elif self.sender() == self.ui.comboBox_CraneK_Tees:
368
            data = self.ui.comboBox_CraneK_Tees.itemData(index)
369
        elif self.sender() == self.ui.comboBox_CraneK_Expander:
370
            data = self.ui.comboBox_CraneK_Expander.itemData(index)
371
        elif self.sender() == self.ui.comboBox_CraneK_Reducer:
372
            data = self.ui.comboBox_CraneK_Reducer.itemData(index)
373
        elif self.sender() == self.ui.comboBox_CraneK_Valves_Globe:
374
            data = self.ui.comboBox_CraneK_Valves_Globe.itemData(index)
375
        elif self.sender() == self.ui.comboBox_CraneK_Valves_Plug:
376
            data = self.ui.comboBox_CraneK_Valves_Plug.itemData(index)
377
        elif self.sender() == self.ui.comboBox_CraneK_Valves_Foot:
378
            data = self.ui.comboBox_CraneK_Valves_Foot.itemData(index)
379
        elif self.sender() == self.ui.comboBox_CraneK_Valves_Etc:
380
            data = self.ui.comboBox_CraneK_Valves_Etc.itemData(index)
381
        elif self.sender() == self.ui.comboBox_CraneK_Pipe_Entrance:
382
            data = self.ui.comboBox_CraneK_Pipe_Entrance.itemData(index)
383
        elif self.sender() == self.ui.comboBox_CraneK_Pipe_Exit:
384
            data = self.ui.comboBox_CraneK_Pipe_Exit.itemData(index)
385
        elif self.sender() == self.ui.comboBox_CraneK_Check_Valves_Swing:
386
            data = self.ui.comboBox_CraneK_Check_Valves_Swing.itemData(index)
387
        elif self.sender() == self.ui.comboBox_CraneK_Check_Valves_Lift:
388
            data = self.ui.comboBox_CraneK_Check_Valves_Lift.itemData(index)
389
        elif self.sender() == self.ui.comboBox_CraneK_Check_Valves_Tilting:
390
            data = self.ui.comboBox_CraneK_Check_Valves_Tilting.itemData(index)
391
        elif self.sender() == self.ui.comboBox_CraneK_Check_Valves_Globe_Stop:
392
            data = self.ui.comboBox_CraneK_Check_Valves_Globe_Stop.itemData(index)
393
        elif self.sender() == self.ui.comboBox_CraneK_Check_Valves_Angle_Stop:
394
            data = self.ui.comboBox_CraneK_Check_Valves_Angle_Stop.itemData(index)
395
        elif self.sender() == self.ui.comboBox_CraneK_Manual:
396
            data = self.ui.comboBox_CraneK_Manual.itemData(index)
397

  
398
        if data:
399
            image = data[6]
400

  
401
            picture = QtGui.QPixmap(':/images/{}'.format(image))
402
            w = 150
403
            h = 150
404
            self.ui.label_CraneK_Img.setPixmap(
405
                picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
406

  
407
    def context_menu_del_2_k(self, position):
254 408
        try:
255 409
            menu = QMenu()
256 410
            delete_2_k = menu.addAction(self.tr("Delete"))
......
266 420
                                                           sys.exc_info()[-1].tb_lineno)
267 421
            App.mainWnd().addMessage.emit(MessageType.Error, message)
268 422

  
269
    def del_equivalent_length(self, position):
423
    def context_menu_del_equivalent_length(self, position):
270 424
        try:
271 425
            menu = QMenu()
272 426
            delete_equivalent_length = menu.addAction(self.tr("Delete"))
......
282 436
                                                           sys.exc_info()[-1].tb_lineno)
283 437
            App.mainWnd().addMessage.emit(MessageType.Error, message)
284 438

  
285
    def del_crane_k(self, position):
439
    def context_menu_del_crane_k(self, position):
286 440
        try:
287 441
            menu = QMenu()
288 442
            delete_crane_k = menu.addAction(self.tr("Delete"))
......
345 499

  
346 500
    def show_2_k_image(self):
347 501
        try:
348
            category = None
502
            data = None
349 503
            # 90 Elbow
350 504
            if self.sender() == self.ui.pushButton_View_2K_90_Elbow_Bend:
351
                category = '90 Elbow'
352
                image = self.ui.comboBox_2K_90_Elbow_Bend.currentData()[6]
505
                data = self.ui.comboBox_2K_90_Elbow_Bend.currentData()
353 506
            elif self.sender() == self.ui.pushButton_View_2K_90_Elbow_Miter:
354
                category = '90 Elbow'
355
                image = self.ui.comboBox_2K_90_Elbow_Miter.currentData()[6]
507
                data = self.ui.comboBox_2K_90_Elbow_Miter.currentData()
356 508
            # 45 Elbow
357 509
            elif self.sender() == self.ui.pushButton_View_2K_45_Elbow_Bend:
358
                category = '45 Elbow'
359
                image = self.ui.comboBox_2K_45_Elbow_Bend.currentData()[6]
510
                data = self.ui.comboBox_2K_45_Elbow_Bend.currentData()
360 511
            elif self.sender() == self.ui.pushButton_View_2K_45_Elbow_Miter:
361
                category = '45 Elbow'
362
                image = self.ui.comboBox_2K_45_Elbow_Miter.currentData()[6]
512
                data = self.ui.comboBox_2K_45_Elbow_Miter.currentData()
363 513
            # 180 Elbow
364 514
            elif self.sender() == self.ui.pushButton_View_2K_180_Elbow_Bend:
365
                category = '180 Elbow'
366
                image = self.ui.comboBox_2K_180_Elbow_Bend.currentData()[6]
515
                data = self.ui.comboBox_2K_180_Elbow_Bend.currentData()
367 516
            # Tees
368 517
            elif self.sender() == self.ui.pushButton_View_2K_Tees_Elbow:
369
                category = 'Tees'
370
                image = self.ui.comboBox_2K_Tees_Elbow.currentData()[6]
518
                data = self.ui.comboBox_2K_Tees_Elbow.currentData()
371 519
            elif self.sender() == self.ui.pushButton_View_2K_Tees_Through:
372
                category = 'Tees'
373
                image = self.ui.comboBox_2K_Tees_Through.currentData()[6]
520
                data = self.ui.comboBox_2K_Tees_Through.currentData()
374 521
            # Valves
375 522
            elif self.sender() == self.ui.pushButton_View_2K_Valves_Gate_Ball_Plug:
376
                category = 'Valves'
377
                image = self.ui.comboBox_2K_Valves_Gate_Ball_Plug.currentData()[6]
523
                data = self.ui.comboBox_2K_Valves_Gate_Ball_Plug.currentData()
378 524
            elif self.sender() == self.ui.pushButton_View_2K_Valves_Globe:
379
                category = 'Valves'
380
                image = self.ui.comboBox_2K_Valves_Globe.currentData()[6]
525
                data = self.ui.comboBox_2K_Valves_Globe.currentData()
381 526
            elif self.sender() == self.ui.pushButton_View_2K_Valves_Others:
382
                category = 'Valves'
383
                image = self.ui.comboBox_2K_Valves_Others.currentData()[6]
527
                data = self.ui.comboBox_2K_Valves_Others.currentData()
384 528
            # Pipe
385 529
            elif self.sender() == self.ui.pushButton_View_2K_Pipe:
386
                category = 'Pipe'
387
                image = self.ui.comboBox_2K_Pipe.currentData()[6]
530
                data = self.ui.comboBox_2K_Pipe.currentData()
388 531
            # Check Valves
389 532
            elif self.sender() == self.ui.pushButton_View_2K_Check_Valves:
390
                category = 'Check Valves'
391
                image = self.ui.comboBox_2K_Check_Valves.currentData()[6]
533
                data = self.ui.comboBox_2K_Check_Valves.currentData()
534

  
535
            if data:
536
                image = data[6]
392 537

  
393
            if category == '90 Elbow':
394
                picture = QtGui.QPixmap(':/images/{}'.format(image))
395
                w = self.ui.label_2K_90_Elbow_Img.height()
396
                h = self.ui.label_2K_90_Elbow_Img.width()
397
                self.ui.label_2K_90_Elbow_Img.setPixmap(
398
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
399
            elif category == '45 Elbow':
400
                picture = QtGui.QPixmap(':/images/{}'.format(image))
401
                w = self.ui.label_2K_45_Elbow_Img.height()
402
                h = self.ui.label_2K_45_Elbow_Img.width()
403
                self.ui.label_2K_45_Elbow_Img.setPixmap(
404
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
405
            elif category == '180 Elbow':
406
                picture = QtGui.QPixmap(':/images/{}'.format(image))
407
                w = self.ui.label_2K_180_Elbow_Img.height()
408
                h = self.ui.label_2K_180_Elbow_Img.width()
409
                self.ui.label_2K_180_Elbow_Img.setPixmap(
410
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
411
            elif category == 'Tees':
412
                picture = QtGui.QPixmap(':/images/{}'.format(image))
413
                w = self.ui.label_2K_Tees_Img.height()
414
                h = self.ui.label_2K_Tees_Img.width()
415
                self.ui.label_2K_Tees_Img.setPixmap(
416
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
417
            elif category == 'Valves':
418
                picture = QtGui.QPixmap(':/images/{}'.format(image))
419
                w = self.ui.label_2K_Valves_Img.height()
420
                h = self.ui.label_2K_Valves_Img.width()
421
                self.ui.label_2K_Valves_Img.setPixmap(
422
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
423
            elif category == 'Pipe':
424
                picture = QtGui.QPixmap(':/images/{}'.format(image))
425
                w = self.ui.label_2K_Pipe_Img.height()
426
                h = self.ui.label_2K_Pipe_Img.width()
427
                self.ui.label_2K_Pipe_Img.setPixmap(
428
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
429
            elif category == 'Check Valves':
430 538
                picture = QtGui.QPixmap(':/images/{}'.format(image))
431
                w = self.ui.label_2K_Check_Valves_Img.height()
432
                h = self.ui.label_2K_Check_Valves_Img.width()
433
                self.ui.label_2K_Check_Valves_Img.setPixmap(
539
                w = 150  # self.ui.label_2K_Img.height()
540
                h = 150  # self.ui.label_2K_Img.width()
541
                self.ui.label_2K_Img.setPixmap(
434 542
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
435

  
436 543
        except Exception as ex:
437 544
            from App import App
438 545
            from AppDocData import MessageType
......
443 550

  
444 551
    def show_crane_k_image(self):
445 552
        try:
446
            category = None
553
            data = None
447 554
            # 90 Elbow
448 555
            if self.sender() == self.ui.pushButton_View_CraneK_90_Elbow_Standard:
449
                category = '90 Elbow'
450
                image = self.ui.comboBox_CraneK_90_Elbow_Standard.currentData()[6]
556
                data = self.ui.comboBox_CraneK_90_Elbow_Standard.currentData()
451 557
            elif self.sender() == self.ui.pushButton_View_CraneK_90_Elbow_Bend:
452
                category = '90 Elbow'
453
                image = self.ui.comboBox_CraneK_90_Elbow_Bend.currentData()[6]
558
                data = self.ui.comboBox_CraneK_90_Elbow_Bend.currentData()
454 559
            elif self.sender() == self.ui.pushButton_View_CraneK_90_Elbow_Miter:
455
                category = '90 Elbow'
456
                image = self.ui.comboBox_CraneK_90_Elbow_Miter.currentData()[6]
560
                data = self.ui.comboBox_CraneK_90_Elbow_Miter.currentData()
457 561
            # 45 Elbow
458 562
            elif self.sender() == self.ui.pushButton_View_CraneK_45_Elbow_Standard:
459
                category = '45 Elbow'
460
                image = self.ui.comboBox_CraneK_45_Elbow_Standard.currentData()[6]
563
                data = self.ui.comboBox_CraneK_45_Elbow_Standard.currentData()
461 564
            elif self.sender() == self.ui.pushButton_View_CraneK_45_Elbow_Miter:
462
                category = '45 Elbow'
463
                image = self.ui.comboBox_CraneK_45_Elbow_Miter.currentData()[6]
565
                data = self.ui.comboBox_CraneK_45_Elbow_Miter.currentData()
464 566
            # 180 Elbow
465 567
            elif self.sender() == self.ui.pushButton_View_CraneK_180_Elbow_Standard:
466
                category = '180 Elbow'
467
                image = self.ui.comboBox_CraneK_180_Elbow_Standard.currentData()[6]
568
                data = self.ui.comboBox_CraneK_180_Elbow_Standard.currentData()
468 569
            elif self.sender() == self.ui.pushButton_View_CraneK_180_Elbow_Bend:
469
                category = '180 Elbow'
470
                image = self.ui.comboBox_CraneK_180_Elbow_Bend.currentData()[6]
570
                data = self.ui.comboBox_CraneK_180_Elbow_Bend.currentData()
471 571
            elif self.sender() == self.ui.pushButton_View_CraneK_180_Elbow_Miter:
472
                category = '180 Elbow'
473
                image = self.ui.comboBox_CraneK_180_Elbow_Miter.currentData()[6]
572
                data = self.ui.comboBox_CraneK_180_Elbow_Miter.currentData()
474 573
            # Tees
475 574
            elif self.sender() == self.ui.pushButton_View_CraneK_Tees:
476
                category = 'Tees'
477
                image = self.ui.comboBox_CraneK_Tees.currentData()[6]
575
                data = self.ui.comboBox_CraneK_Tees.currentData()
478 576
            # Reducer & Expander
479 577
            elif self.sender() == self.ui.pushButton_View_CraneK_Expander:
480
                category = 'RE'
481
                image = self.ui.comboBox_CraneK_Expander.currentData()[6]
578
                data = self.ui.comboBox_CraneK_Expander.currentData()
482 579
            elif self.sender() == self.ui.pushButton_View_CraneK_Reducer:
483
                category = 'RE'
484
                image = self.ui.comboBox_CraneK_Reducer.currentData()[6]
580
                data = self.ui.comboBox_CraneK_Reducer.currentData()
485 581
            # Valves
486 582
            elif self.sender() == self.ui.pushButton_View_CraneK_Valves_Globe:
487
                category = 'Valves'
488
                image = self.ui.comboBox_CraneK_Valves_Globe.currentData()[6]
583
                data = self.ui.comboBox_CraneK_Valves_Globe.currentData()
489 584
            elif self.sender() == self.ui.pushButton_View_CraneK_Valves_Plug:
490
                category = 'Valves'
491
                image = self.ui.comboBox_CraneK_Valves_Plug.currentData()[6]
585
                data = self.ui.comboBox_CraneK_Valves_Plug.currentData()
492 586
            elif self.sender() == self.ui.pushButton_View_CraneK_Valves_Foot:
493
                category = 'Valves'
494
                image = self.ui.comboBox_CraneK_Valves_Foot.currentData()[6]
587
                data = self.ui.comboBox_CraneK_Valves_Foot.currentData()
495 588
            elif self.sender() == self.ui.pushButton_View_CraneK_Valves_Etc:
496
                category = 'Valves'
497
                image = self.ui.comboBox_CraneK_Valves_Etc.currentData()[6]
589
                data = self.ui.comboBox_CraneK_Valves_Etc.currentData()
498 590
            # Pipe
499 591
            elif self.sender() == self.ui.pushButton_View_CraneK_Pipe_Entrance:
500
                category = 'Pipe'
501
                image = self.ui.comboBox_CraneK_Pipe_Entrance.currentData()[6]
592
                data = self.ui.comboBox_CraneK_Pipe_Entrance.currentData()
502 593
            elif self.sender() == self.ui.pushButton_View_CraneK_Pipe_Exit:
503
                category = 'Pipe'
504
                image = self.ui.comboBox_CraneK_Pipe_Exit.currentData()[6]
594
                data = self.ui.comboBox_CraneK_Pipe_Exit.currentData()
505 595
            # Check Valves
506 596
            elif self.sender() == self.ui.pushButton_View_CraneK_Check_Valves_Swing:
507
                category = 'Check Valves'
508
                image = self.ui.comboBox_CraneK_Check_Valves_Swing.currentData()[6]
597
                data = self.ui.comboBox_CraneK_Check_Valves_Swing.currentData()
509 598
            elif self.sender() == self.ui.pushButton_View_CraneK_Check_Valves_Lift:
510
                category = 'Check Valves'
511
                image = self.ui.comboBox_CraneK_Check_Valves_Lift.currentData()[6]
599
                data = self.ui.comboBox_CraneK_Check_Valves_Lift.currentData()
512 600
            elif self.sender() == self.ui.pushButton_View_CraneK_Check_Valves_Tilting:
513
                category = 'Check Valves'
514
                image = self.ui.comboBox_CraneK_Check_Valves_Tilting.currentData()[6]
601
                data = self.ui.comboBox_CraneK_Check_Valves_Tilting.currentData()
515 602
            elif self.sender() == self.ui.pushButton_View_CraneK_Check_Valves_Globe_Stop:
516
                category = 'Check Valves'
517
                image = self.ui.comboBox_CraneK_Check_Valves_Globe_Stop.currentData()[6]
603
                data = self.ui.comboBox_CraneK_Check_Valves_Globe_Stop.currentData()
518 604
            elif self.sender() == self.ui.pushButton_View_CraneK_Check_Valves_Angle_Stop:
519
                category = 'Check Valves'
520
                image = self.ui.comboBox_CraneK_Check_Valves_Angle_Stop.currentData()[6]
605
                data = self.ui.comboBox_CraneK_Check_Valves_Angle_Stop.currentData()
521 606
            # Manual K
522 607
            elif self.sender() == self.ui.pushButton_View_CraneK_Manual:
523
                category = 'Manual K'
524
                image = self.ui.comboBox_CraneK_Manual.currentData()[6]
608
                data = self.ui.comboBox_CraneK_Manual.currentData()
609

  
610
            if data:
611
                image = data[6]
525 612

  
526
            if category == '90 Elbow':
527
                picture = QtGui.QPixmap(':/images/{}'.format(image))
528
                w = self.ui.label_CraneK_90_Elbow_Img.height()
529
                h = self.ui.label_CraneK_90_Elbow_Img.width()
530
                self.ui.label_CraneK_90_Elbow_Img.setPixmap(
531
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
532
            elif category == '45 Elbow':
533
                picture = QtGui.QPixmap(':/images/{}'.format(image))
534
                w = self.ui.label_CraneK_45_Elbow_Img.height()
535
                h = self.ui.label_CraneK_45_Elbow_Img.width()
536
                self.ui.label_CraneK_45_Elbow_Img.setPixmap(
537
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
538
            elif category == '180 Elbow':
539
                picture = QtGui.QPixmap(':/images/{}'.format(image))
540
                w = self.ui.label_CraneK_180_Elbow_Img.height()
541
                h = self.ui.label_CraneK_180_Elbow_Img.width()
542
                self.ui.label_CraneK_180_Elbow_Img.setPixmap(
543
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
544
            elif category == 'Tees':
545
                picture = QtGui.QPixmap(':/images/{}'.format(image))
546
                w = self.ui.label_CraneK_Tees_Img.height()
547
                h = self.ui.label_CraneK_Tees_Img.width()
548
                self.ui.label_CraneK_Tees_Img.setPixmap(
549
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
550
            elif category == 'RE':
551
                picture = QtGui.QPixmap(':/images/{}'.format(image))
552
                w = self.ui.label_CraneK_RE_Img.height()
553
                h = self.ui.label_CraneK_RE_Img.width()
554
                self.ui.label_CraneK_RE_Img.setPixmap(
555
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
556
            elif category == 'Valves':
557
                picture = QtGui.QPixmap(':/images/{}'.format(image))
558
                w = self.ui.label_CraneK_Valves_Img.height()
559
                h = self.ui.label_CraneK_Valves_Img.width()
560
                self.ui.label_CraneK_Valves_Img.setPixmap(
561
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
562
            elif category == 'Pipe':
563
                picture = QtGui.QPixmap(':/images/{}'.format(image))
564
                w = self.ui.label_CraneK_Pipe_Img.height()
565
                h = self.ui.label_CraneK_Pipe_Img.width()
566
                self.ui.label_CraneK_Pipe_Img.setPixmap(
567
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
568
            elif category == 'Check Valves':
569
                picture = QtGui.QPixmap(':/images/{}'.format(image))
570
                w = self.ui.label_CraneK_Check_Valves_Img.height()
571
                h = self.ui.label_CraneK_Check_Valves_Img.width()
572
                self.ui.label_CraneK_Check_Valves_Img.setPixmap(
573
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
574
            elif category == 'Manual K':
575 613
                picture = QtGui.QPixmap(':/images/{}'.format(image))
576
                w = self.ui.label_CraneK_Manual_K_Img.height()
577
                h = self.ui.label_CraneK_Manual_K_Img.width()
578
                self.ui.label_CraneK_Manual_K_Img.setPixmap(
614
                w = 150  # self.ui.label_CraneK_Img.height()
615
                h = 150  # self.ui.label_CraneK_Img.width()
616
                self.ui.label_CraneK_Img.setPixmap(
579 617
                    picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
580 618

  
581 619
        except Exception as ex:
......
599 637
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
600 638
                        self.add_2_k_data(row, data, count)
601 639
                    else:
602
                        self.update_2_k_data(find_row, count)
640
                        self.update_2_k_data(find_row, data, count)
603 641
            elif self.sender() == self.ui.pushButton_Add_2K_90_Elbow_Miter:
604 642
                count = self.ui.lineEdit_2K_90_Elbow_Miter_Count.text()
605 643
                if count.isdigit():
......
610 648
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
611 649
                        self.add_2_k_data(row, data, count)
612 650
                    else:
613
                        self.update_2_k_data(find_row, count)
651
                        self.update_2_k_data(find_row, data, count)
614 652
            # 45 Elbow
615 653
            elif self.sender() == self.ui.pushButton_Add_2K_45_Elbow_Bend:
616 654
                count = self.ui.lineEdit_2K_45_Elbow_Bend_Count.text()
......
622 660
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
623 661
                        self.add_2_k_data(row, data, count)
624 662
                    else:
625
                        self.update_2_k_data(find_row, count)
663
                        self.update_2_k_data(find_row, data, count)
626 664
            elif self.sender() == self.ui.pushButton_Add_2K_45_Elbow_Miter:
627 665
                count = self.ui.lineEdit_2K_45_Elbow_Miter_Count.text()
628 666
                if count.isdigit():
......
633 671
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
634 672
                        self.add_2_k_data(row, data, count)
635 673
                    else:
636
                        self.update_2_k_data(find_row, count)
674
                        self.update_2_k_data(find_row, data, count)
637 675
            # 180 Elbow
638 676
            elif self.sender() == self.ui.pushButton_Add_2K_180_Elbow_Bend:
639 677
                count = self.ui.lineEdit_2K_180_Elbow_Bend_Count.text()
......
645 683
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
646 684
                        self.add_2_k_data(row, data, count)
647 685
                    else:
648
                        self.update_2_k_data(find_row, count)
686
                        self.update_2_k_data(find_row, data, count)
649 687
            # Tees
650 688
            elif self.sender() == self.ui.pushButton_Add_2K_Tees_Elbow:
651 689
                count = self.ui.lineEdit_2K_Tees_Elbow_Count.text()
......
657 695
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
658 696
                        self.add_2_k_data(row, data, count)
659 697
                    else:
660
                        self.update_2_k_data(find_row, count)
698
                        self.update_2_k_data(find_row, data, count)
661 699
            elif self.sender() == self.ui.pushButton_Add_2K_Tees_Through:
662 700
                count = self.ui.lineEdit_2K_Tees_Through_Count.text()
663 701
                if count.isdigit():
......
668 706
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
669 707
                        self.add_2_k_data(row, data, count)
670 708
                    else:
671
                        self.update_2_k_data(find_row, count)
709
                        self.update_2_k_data(find_row, data, count)
672 710
            # Valves
673 711
            elif self.sender() == self.ui.pushButton_Add_2K_Valves_Gate_Ball_Plug:
674 712
                count = self.ui.lineEdit_2K_Valves_Gate_Ball_Plug_Count.text()
......
680 718
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
681 719
                        self.add_2_k_data(row, data, count)
682 720
                    else:
683
                        self.update_2_k_data(find_row, count)
721
                        self.update_2_k_data(find_row, data, count)
684 722
            elif self.sender() == self.ui.pushButton_Add_2K_Valves_Globe:
685 723
                count = self.ui.lineEdit_2K_Valves_Globe_Count.text()
686 724
                if count.isdigit():
......
691 729
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
692 730
                        self.add_2_k_data(row, data, count)
693 731
                    else:
694
                        self.update_2_k_data(find_row, count)
732
                        self.update_2_k_data(find_row, data, count)
695 733
            elif self.sender() == self.ui.pushButton_Add_2K_Valves_Others:
696 734
                count = self.ui.lineEdit_2K_Valves_Others_Count.text()
697 735
                if count.isdigit():
......
702 740
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
703 741
                        self.add_2_k_data(row, data, count)
704 742
                    else:
705
                        self.update_2_k_data(find_row, count)
743
                        self.update_2_k_data(find_row, data, count)
706 744
            # Pipe
707 745
            elif self.sender() == self.ui.pushButton_Add_2K_Pipe:
708 746
                count = self.ui.lineEdit_2K_Pipe_Count.text()
......
714 752
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
715 753
                        self.add_2_k_data(row, data, count)
716 754
                    else:
717
                        self.update_2_k_data(find_row, count)
755
                        self.update_2_k_data(find_row, data, count)
718 756
            # Check Valves
719 757
            elif self.sender() == self.ui.pushButton_Add_2K_Check_Valves:
720 758
                count = self.ui.lineEdit_2K_Check_Valves_Count.text()
......
726 764
                        self.ui.tableWidget_2K_SelectedFitting.setRowCount(row + 1)
727 765
                        self.add_2_k_data(row, data, count)
728 766
                    else:
729
                        self.update_2_k_data(find_row, count)
767
                        self.update_2_k_data(find_row, data, count)
768
        except Exception as ex:
769
            from App import App
770
            from AppDocData import MessageType
771

  
772
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
773
                                                           sys.exc_info()[-1].tb_lineno)
774
            App.mainWnd().addMessage.emit(MessageType.Error, message)
775

  
776
    def del_equivalent_length(self):
777
        try:
778
            # Elbow
779
            if self.sender() == self.ui.pushButton_Del_Equivalent_Length_90_Elbow:
780
                data = self.ui.comboBox_Equivalent_Length_90_Elbow.currentData()
781
                find_row = self.find_equivalent_length_data(data[0])
782
                if find_row is not None:
783
                    self.del_equivalent_length_data(find_row)
784
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_45_Elbow:
785
                data = self.ui.comboBox_Equivalent_Length_45_Elbow.currentData()
786
                find_row = self.find_equivalent_length_data(data[0])
787
                if find_row is not None:
788
                    self.del_equivalent_length_data(find_row)
789
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Miter:
790
                data = self.ui.comboBox_Equivalent_Length_Miter.currentData()
791
                find_row = self.find_equivalent_length_data(data[0])
792
                if find_row is not None:
793
                    self.del_equivalent_length_data(find_row)
794
            # Tees
795
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Tee_Branch:
796
                data = self.ui.comboBox_Equivalent_Length_Tee_Branch.currentData()
797
                find_row = self.find_equivalent_length_data(data[0])
798
                if find_row is not None:
799
                    self.del_equivalent_length_data(find_row)
800
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Tee_Through:
801
                data = self.ui.comboBox_Equivalent_Length_Tee_Through.currentData()
802
                find_row = self.find_equivalent_length_data(data[0])
803
                if find_row is not None:
804
                    self.del_equivalent_length_data(find_row)
805
            # Valves
806
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Gate_Ball_Plug:
807
                data = self.ui.comboBox_Equivalent_Length_Gate_Ball_Plug.currentData()
808
                find_row = self.find_equivalent_length_data(data[0])
809
                if find_row is not None:
810
                    self.del_equivalent_length_data(find_row)
811
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Globe:
812
                data = self.ui.comboBox_Equivalent_Length_Globe.currentData()
813
                find_row = self.find_equivalent_length_data(data[0])
814
                if find_row is not None:
815
                    self.del_equivalent_length_data(find_row)
816
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Butterfly:
817
                data = self.ui.comboBox_Equivalent_Length_Butterfly.currentData()
818
                find_row = self.find_equivalent_length_data(data[0])
819
                if find_row is not None:
820
                    self.del_equivalent_length_data(find_row)
821
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Check:
822
                data = self.ui.comboBox_Equivalent_Length_Check.currentData()
823
                find_row = self.find_equivalent_length_data(data[0])
824
                if find_row is not None:
825
                    self.del_equivalent_length_data(find_row)
826
            # Nozzles
827
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Nozzle_In:
828
                data = self.ui.comboBox_Equivalent_Length_Nozzle_In.currentData()
829
                find_row = self.find_equivalent_length_data(data[0])
830
                if find_row is not None:
831
                    self.del_equivalent_length_data(find_row)
832
            elif self.sender() == self.ui.pushButton_Del_Equivalent_Length_Nozzle_Out:
833
                data = self.ui.comboBox_Equivalent_Length_Nozzle_Out.currentData()
834
                find_row = self.find_equivalent_length_data(data[0])
835
                if find_row is not None:
836
                    self.del_equivalent_length_data(find_row)
730 837
        except Exception as ex:
731 838
            from App import App
732 839
            from AppDocData import MessageType
......
871 978
                                                           sys.exc_info()[-1].tb_lineno)
872 979
            App.mainWnd().addMessage.emit(MessageType.Error, message)
873 980

  
981
    def del_2_k(self):
982
        try:
983
            # 90 Elbow
984
            if self.sender() == self.ui.pushButton_Del_2K_90_Elbow_Bend:
985
                data = self.ui.comboBox_2K_90_Elbow_Bend.currentData()
986
                find_row = self.find_2_k_data(data[0])
987
                if find_row is not None:
988
                    self.del_2_k_data(find_row)
989
            elif self.sender() == self.ui.pushButton_Del_2K_90_Elbow_Miter:
990
                data = self.ui.comboBox_2K_90_Elbow_Miter.currentData()
991
                find_row = self.find_2_k_data(data[0])
992
                if find_row is not None:
993
                    self.del_2_k_data(find_row)
994
            # 45 Elbow
995
            elif self.sender() == self.ui.pushButton_Del_2K_45_Elbow_Bend:
996
                data = self.ui.comboBox_2K_45_Elbow_Bend.currentData()
997
                find_row = self.find_2_k_data(data[0])
998
                if find_row is not None:
999
                    self.del_2_k_data(find_row)
1000
            elif self.sender() == self.ui.pushButton_Del_2K_45_Elbow_Miter:
1001
                data = self.ui.comboBox_2K_45_Elbow_Miter.currentData()
1002
                find_row = self.find_2_k_data(data[0])
1003
                if find_row is not None:
1004
                    self.del_2_k_data(find_row)
1005
            # 180 Elbow
1006
            elif self.sender() == self.ui.pushButton_Del_2K_180_Elbow_Bend:
1007
                data = self.ui.comboBox_2K_180_Elbow_Bend.currentData()
1008
                find_row = self.find_2_k_data(data[0])
1009
                if find_row is not None:
1010
                    self.del_2_k_data(find_row)
1011
            # Tees
1012
            elif self.sender() == self.ui.pushButton_Del_2K_Tees_Elbow:
1013
                data = self.ui.comboBox_2K_Tees_Elbow.currentData()
1014
                find_row = self.find_2_k_data(data[0])
1015
                if find_row is not None:
1016
                    self.del_2_k_data(find_row)
1017
            elif self.sender() == self.ui.pushButton_Del_2K_Tees_Through:
1018
                data = self.ui.comboBox_2K_Tees_Through.currentData()
1019
                find_row = self.find_2_k_data(data[0])
1020
                if find_row is not None:
1021
                    self.del_2_k_data(find_row)
1022
            # Valves
1023
            elif self.sender() == self.ui.pushButton_Del_2K_Valves_Gate_Ball_Plug:
1024
                data = self.ui.comboBox_2K_Valves_Gate_Ball_Plug.currentData()
1025
                find_row = self.find_2_k_data(data[0])
1026
                if find_row is not None:
1027
                    self.del_2_k_data(find_row)
1028
            elif self.sender() == self.ui.pushButton_Del_2K_Valves_Globe:
1029
                data = self.ui.comboBox_2K_Valves_Globe.currentData()
1030
                find_row = self.find_2_k_data(data[0])
1031
                if find_row is not None:
1032
                    self.del_2_k_data(find_row)
1033
            elif self.sender() == self.ui.pushButton_Del_2K_Valves_Others:
1034
                data = self.ui.comboBox_2K_Valves_Others.currentData()
1035
                find_row = self.find_2_k_data(data[0])
1036
                if find_row is not None:
1037
                    self.del_2_k_data(find_row)
1038
            # Pipe
1039
            elif self.sender() == self.ui.pushButton_Del_2K_Pipe:
1040
                data = self.ui.comboBox_2K_Pipe.currentData()
1041
                find_row = self.find_2_k_data(data[0])
1042
                if find_row is not None:
1043
                    self.del_2_k_data(find_row)
1044
            # Check Values
1045
            elif self.sender() == self.ui.pushButton_Del_2K_Check_Valves:
1046
                data = self.ui.comboBox_2K_Check_Valves.currentData()
1047
                find_row = self.find_2_k_data(data[0])
1048
                if find_row is not None:
1049
                    self.del_2_k_data(find_row)
1050

  
1051
            # self.ui.tableWidget_CraneK_SelectedFitting.resizeColumnsToContents()
1052
            # self.ui.tableWidget_CraneK_SelectedFitting.resizeRowsToContents()
1053
            # self.ui.tableWidget_CraneK_SelectedFitting.horizontalHeader().setStretchLastSection(True)
1054
        except Exception as ex:
1055
            from App import App
1056
            from AppDocData import MessageType
1057

  
1058
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
1059
                                                           sys.exc_info()[-1].tb_lineno)
1060
            App.mainWnd().addMessage.emit(MessageType.Error, message)
1061

  
1062
    def del_crane_k(self):
1063
        try:
1064
            # 90 Elbow
1065
            if self.sender() == self.ui.pushButton_Del_CraneK_90_Elbow_Standard:
1066
                data = self.ui.comboBox_CraneK_90_Elbow_Standard.currentData()
1067
                find_row = self.find_crane_k_data(data[0])
1068
                if find_row is not None:
1069
                    self.del_crane_k_data(find_row)
1070
            elif self.sender() == self.ui.pushButton_Del_CraneK_90_Elbow_Bend:
1071
                data = self.ui.comboBox_CraneK_90_Elbow_Bend.currentData()
1072
                find_row = self.find_crane_k_data(data[0])
1073
                if find_row is not None:
1074
                    self.del_crane_k_data(find_row)
1075
            elif self.sender() == self.ui.pushButton_Del_CraneK_90_Elbow_Miter:
1076
                data = self.ui.comboBox_CraneK_90_Elbow_Miter.currentData()
1077
                find_row = self.find_crane_k_data(data[0])
1078
                if find_row is not None:
1079
                    self.del_crane_k_data(find_row)
1080
            # 45 Elbow
1081
            elif self.sender() == self.ui.pushButton_Del_CraneK_45_Elbow_Standard:
1082
                data = self.ui.comboBox_CraneK_45_Elbow_Standard.currentData()
1083
                find_row = self.find_crane_k_data(data[0])
1084
                if find_row is not None:
1085
                    self.del_crane_k_data(find_row)
1086
            elif self.sender() == self.ui.pushButton_Del_CraneK_45_Elbow_Miter:
1087
                data = self.ui.comboBox_CraneK_45_Elbow_Miter.currentData()
1088
                find_row = self.find_crane_k_data(data[0])
1089
                if find_row is not None:
1090
                    self.del_crane_k_data(find_row)
1091
            # 180 Elbow
1092
            elif self.sender() == self.ui.pushButton_Del_CraneK_180_Elbow_Standard:
1093
                data = self.ui.comboBox_CraneK_180_Elbow_Standard.currentData()
1094
                find_row = self.find_crane_k_data(data[0])
1095
                if find_row is not None:
1096
                    self.del_crane_k_data(find_row)
1097
            elif self.sender() == self.ui.pushButton_Del_CraneK_180_Elbow_Bend:
1098
                data = self.ui.comboBox_CraneK_180_Elbow_Bend.currentData()
1099
                find_row = self.find_crane_k_data(data[0])
1100
                if find_row is not None:
1101
                    self.del_crane_k_data(find_row)
1102
            elif self.sender() == self.ui.pushButton_Del_CraneK_180_Elbow_Miter:
1103
                data = self.ui.comboBox_CraneK_180_Elbow_Miter.currentData()
1104
                find_row = self.find_crane_k_data(data[0])
1105
                if find_row is not None:
1106
                    self.del_crane_k_data(find_row)
1107
            # Tees
1108
            elif self.sender() == self.ui.pushButton_Del_CraneK_Tees:
1109
                data = self.ui.comboBox_CraneK_Tees.currentData()
1110
                find_row = self.find_crane_k_data(data[0])
1111
                if find_row is not None:
1112
                    self.del_crane_k_data(find_row)
1113
            # Reducer & Expander
1114
            elif self.sender() == self.ui.pushButton_Del_CraneK_Expander:
1115
                data = self.ui.comboBox_CraneK_Expander.currentData()
1116
                find_row = self.find_crane_k_data(data[0])
1117
                if find_row is not None:
1118
                    self.del_crane_k_data(find_row)
1119
            elif self.sender() == self.ui.pushButton_Del_CraneK_Reducer:
1120
                data = self.ui.comboBox_CraneK_Reducer.currentData()
1121
                find_row = self.find_crane_k_data(data[0])
1122
                if find_row is not None:
1123
                    self.del_crane_k_data(find_row)
1124
            # Valves
1125
            elif self.sender() == self.ui.pushButton_Del_CraneK_Valves_Globe:
1126
                data = self.ui.comboBox_CraneK_Valves_Globe.currentData()
1127
                find_row = self.find_crane_k_data(data[0])
1128
                if find_row is not None:
1129
                    self.del_crane_k_data(find_row)
1130
            elif self.sender() == self.ui.pushButton_Del_CraneK_Valves_Plug:
1131
                data = self.ui.comboBox_CraneK_Valves_Plug.currentData()
1132
                find_row = self.find_crane_k_data(data[0])
1133
                if find_row is not None:
1134
                    self.del_crane_k_data(find_row)
1135
            elif self.sender() == self.ui.pushButton_Del_CraneK_Valves_Foot:
1136
                data = self.ui.comboBox_CraneK_Valves_Foot.currentData()
1137
                find_row = self.find_crane_k_data(data[0])
1138
                if find_row is not None:
1139
                    self.del_crane_k_data(find_row)
1140
            elif self.sender() == self.ui.pushButton_Del_CraneK_Valves_Etc:
1141
                data = self.ui.comboBox_CraneK_Valves_Etc.currentData()
1142
                find_row = self.find_crane_k_data(data[0])
1143
                if find_row is not None:
1144
                    self.del_crane_k_data(find_row)
1145
            # Pipe
1146
            elif self.sender() == self.ui.pushButton_Del_CraneK_Pipe_Entrance:
1147
                data = self.ui.comboBox_CraneK_Pipe_Entrance.currentData()
1148
                find_row = self.find_crane_k_data(data[0])
1149
                if find_row is not None:
1150
                    self.del_crane_k_data(find_row)
1151
            elif self.sender() == self.ui.pushButton_Del_CraneK_Pipe_Exit:
1152
                data = self.ui.comboBox_CraneK_Pipe_Exit.currentData()
1153
                find_row = self.find_crane_k_data(data[0])
1154
                if find_row is not None:
1155
                    self.del_crane_k_data(find_row)
1156
            # Check Values
1157
            elif self.sender() == self.ui.pushButton_Del_CraneK_Check_Valves_Swing:
1158
                data = self.ui.comboBox_CraneK_Check_Valves_Swing.currentData()
1159
                find_row = self.find_crane_k_data(data[0])
1160
                if find_row is not None:
1161
                    self.del_crane_k_data(find_row)
1162
            elif self.sender() == self.ui.pushButton_Del_CraneK_Check_Valves_Lift:
1163
                data = self.ui.comboBox_CraneK_Check_Valves_Lift.currentData()
1164
                find_row = self.find_crane_k_data(data[0])
1165
                if find_row is not None:
1166
                    self.del_crane_k_data(find_row)
1167
            elif self.sender() == self.ui.pushButton_Del_CraneK_Check_Valves_Tilting:
1168
                data = self.ui.comboBox_CraneK_Check_Valves_Tilting.currentData()
1169
                find_row = self.find_crane_k_data(data[0])
1170
                if find_row is not None:
1171
                    self.del_crane_k_data(find_row)
1172
            elif self.sender() == self.ui.pushButton_Del_CraneK_Check_Valves_Globe_Stop:
1173
                data = self.ui.comboBox_CraneK_Check_Valves_Globe_Stop.currentData()
1174
                find_row = self.find_crane_k_data(data[0])
1175
                if find_row is not None:
1176
                    self.del_crane_k_data(find_row)
1177
            elif self.sender() == self.ui.pushButton_Del_CraneK_Check_Valves_Angle_Stop:
1178
                data = self.ui.comboBox_CraneK_Check_Valves_Angle_Stop.currentData()
1179
                find_row = self.find_crane_k_data(data[0])
1180
                if find_row is not None:
1181
                    self.del_crane_k_data(find_row)
1182
            # Manual K
1183
            elif self.sender() == self.ui.pushButton_Del_CraneK_Manual:
1184
                data = self.ui.comboBox_CraneK_Manual.currentData()
1185
                find_row = self.find_crane_k_data(data[0])
1186
                if find_row is not None:
1187
                    self.del_crane_k_data(find_row)
1188

  
1189
            # self.ui.tableWidget_CraneK_SelectedFitting.resizeColumnsToContents()
1190
            # self.ui.tableWidget_CraneK_SelectedFitting.resizeRowsToContents()
1191
            # self.ui.tableWidget_CraneK_SelectedFitting.horizontalHeader().setStretchLastSection(True)
1192
        except Exception as ex:
1193
            from App import App
1194
            from AppDocData import MessageType
1195

  
1196
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
1197
                                                           sys.exc_info()[-1].tb_lineno)
1198
            App.mainWnd().addMessage.emit(MessageType.Error, message)
1199

  
874 1200
    def add_crane_k(self):
875 1201
        try:
876 1202
            # 90 Elbow
......
884 1210
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
885 1211
                        self.add_crane_k_data(row, data, count)
886 1212
                    else:
887
                        self.update_crane_k_data(find_row, count)
1213
                        self.update_crane_k_data(find_row, data, count)
888 1214
            elif self.sender() == self.ui.pushButton_Add_CraneK_90_Elbow_Bend:
889 1215
                count = self.ui.lineEdit_CraneK_90_Elbow_Bend_Count.text()
890 1216
                if count.isdigit():
......
895 1221
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
896 1222
                        self.add_crane_k_data(row, data, count)
897 1223
                    else:
898
                        self.update_crane_k_data(find_row, count)
1224
                        self.update_crane_k_data(find_row, data, count)
899 1225
            elif self.sender() == self.ui.pushButton_Add_CraneK_90_Elbow_Miter:
900 1226
                count = self.ui.lineEdit_CraneK_90_Elbow_Miter_Count.text()
901 1227
                if count.isdigit():
......
906 1232
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
907 1233
                        self.add_crane_k_data(row, data, count)
908 1234
                    else:
909
                        self.update_crane_k_data(find_row, count)
1235
                        self.update_crane_k_data(find_row, data, count)
910 1236
            # 45 Elbow
911 1237
            elif self.sender() == self.ui.pushButton_Add_CraneK_45_Elbow_Standard:
912 1238
                count = self.ui.lineEdit_CraneK_45_Elbow_Standard_Count.text()
......
918 1244
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
919 1245
                        self.add_crane_k_data(row, data, count)
920 1246
                    else:
921
                        self.update_crane_k_data(find_row, count)
1247
                        self.update_crane_k_data(find_row, data, count)
922 1248
            elif self.sender() == self.ui.pushButton_Add_CraneK_45_Elbow_Miter:
923 1249
                count = self.ui.lineEdit_CraneK_45_Elbow_Miter_Count.text()
924 1250
                if count.isdigit():
......
929 1255
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
930 1256
                        self.add_crane_k_data(row, data, count)
931 1257
                    else:
932
                        self.update_crane_k_data(find_row, count)
1258
                        self.update_crane_k_data(find_row, data, count)
933 1259
            # 180 Elbow
934 1260
            elif self.sender() == self.ui.pushButton_Add_CraneK_180_Elbow_Standard:
935 1261
                count = self.ui.lineEdit_CraneK_180_Elbow_Standard_Count.text()
......
941 1267
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
942 1268
                        self.add_crane_k_data(row, data, count)
943 1269
                    else:
944
                        self.update_crane_k_data(find_row, count)
1270
                        self.update_crane_k_data(find_row, data, count)
945 1271
            elif self.sender() == self.ui.pushButton_Add_CraneK_180_Elbow_Bend:
946 1272
                count = self.ui.lineEdit_CraneK_180_Elbow_Bend_Count.text()
947 1273
                if count.isdigit():
......
952 1278
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
953 1279
                        self.add_crane_k_data(row, data, count)
954 1280
                    else:
955
                        self.update_crane_k_data(find_row, count)
1281
                        self.update_crane_k_data(find_row, data, count)
956 1282
            elif self.sender() == self.ui.pushButton_Add_CraneK_180_Elbow_Miter:
957 1283
                count = self.ui.lineEdit_CraneK_180_Elbow_Miter_Count.text()
958 1284
                if count.isdigit():
......
963 1289
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
964 1290
                        self.add_crane_k_data(row, data, count)
965 1291
                    else:
966
                        self.update_crane_k_data(find_row, count)
1292
                        self.update_crane_k_data(find_row, data, count)
967 1293
            # Tees
968 1294
            elif self.sender() == self.ui.pushButton_Add_CraneK_Tees:
969 1295
                count = self.ui.lineEdit_CraneK_Tees_Count.text()
......
975 1301
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
976 1302
                        self.add_crane_k_data(row, data, count)
977 1303
                    else:
978
                        self.update_crane_k_data(find_row, count)
1304
                        self.update_crane_k_data(find_row, data, count)
979 1305
            # Reducer & Expander
980 1306
            elif self.sender() == self.ui.pushButton_Add_CraneK_Expander:
981 1307
                count = self.ui.lineEdit_CraneK_Expander_Count.text()
982 1308
                if count.isdigit():
983
                    data = self.ui.comboBox_CraneK_Expander.currentData()
984
                    find_row = self.find_crane_k_data(data[0])
1309
                    main_size = self.ui.lineEdit_CraneK_Main_Size.text()
985 1310
                    sub_size = self.ui.lineEdit_CraneK_Sub_Size.text()
986 1311
                    angle = self.ui.lineEdit_CraneK_Angle.text()
987
                    if find_row is None:
988
                        row = self.ui.tableWidget_CraneK_SelectedFitting.rowCount()
989
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
990
                        self.add_crane_k_data(row, data, count, sub_size, angle)
991
                    else:
992
                        self.update_crane_k_data(find_row, count, sub_size, angle)
1312
                    if sub_size and angle:
1313
                        if float(main_size) < float(sub_size):
1314
                            data = self.ui.comboBox_CraneK_Expander.currentData()
1315
                            find_row = self.find_crane_k_data(data[0])
1316
                            if find_row is None:
1317
                                row = self.ui.tableWidget_CraneK_SelectedFitting.rowCount()
1318
                                self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1319
                                self.add_crane_k_data(row, data, count, sub_size, angle)
1320
                            else:
1321
                                self.update_crane_k_data(find_row, data, count, sub_size, angle)
993 1322
            elif self.sender() == self.ui.pushButton_Add_CraneK_Reducer:
994 1323
                count = self.ui.lineEdit_CraneK_Reducer_Count.text()
995 1324
                if count.isdigit():
996
                    data = self.ui.comboBox_CraneK_Reducer.currentData()
997
                    find_row = self.find_crane_k_data(data[0])
1325
                    main_size = self.ui.lineEdit_CraneK_Main_Size.text()
998 1326
                    sub_size = self.ui.lineEdit_CraneK_Sub_Size.text()
999 1327
                    angle = self.ui.lineEdit_CraneK_Angle.text()
1000
                    if find_row is None:
1001
                        row = self.ui.tableWidget_CraneK_SelectedFitting.rowCount()
1002
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1003
                        self.add_crane_k_data(row, data, count, sub_size, angle)
1004
                    else:
1005
                        self.update_crane_k_data(find_row, count, sub_size, angle)
1328
                    if sub_size and angle:
1329
                        if float(main_size) > float(sub_size):
1330
                            data = self.ui.comboBox_CraneK_Reducer.currentData()
1331
                            find_row = self.find_crane_k_data(data[0])
1332
                            if find_row is None:
1333
                                row = self.ui.tableWidget_CraneK_SelectedFitting.rowCount()
1334
                                self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1335
                                self.add_crane_k_data(row, data, count, sub_size, angle)
1336
                            else:
1337
                                self.update_crane_k_data(find_row, data, count, sub_size, angle)
1006 1338
            # Valves
1007 1339
            elif self.sender() == self.ui.pushButton_Add_CraneK_Valves_Globe:
1008 1340
                count = self.ui.lineEdit_CraneK_Valves_Globe_Count.text()
......
1014 1346
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1015 1347
                        self.add_crane_k_data(row, data, count)
1016 1348
                    else:
1017
                        self.update_crane_k_data(find_row, count)
1349
                        self.update_crane_k_data(find_row, data, count)
1018 1350
            elif self.sender() == self.ui.pushButton_Add_CraneK_Valves_Plug:
1019 1351
                count = self.ui.lineEdit_CraneK_Valves_Plug_Count.text()
1020 1352
                if count.isdigit():
......
1025 1357
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1026 1358
                        self.add_crane_k_data(row, data, count)
1027 1359
                    else:
1028
                        self.update_crane_k_data(find_row, count)
1360
                        self.update_crane_k_data(find_row, data, count)
1029 1361
            elif self.sender() == self.ui.pushButton_Add_CraneK_Valves_Foot:
1030 1362
                count = self.ui.lineEdit_CraneK_Valves_Foot_Count.text()
1031 1363
                if count.isdigit():
......
1036 1368
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1037 1369
                        self.add_crane_k_data(row, data, count)
1038 1370
                    else:
1039
                        self.update_crane_k_data(find_row, count)
1371
                        self.update_crane_k_data(find_row, data, count)
1040 1372
            elif self.sender() == self.ui.pushButton_Add_CraneK_Valves_Etc:
1041 1373
                count = self.ui.lineEdit_CraneK_Valves_Etc_Count.text()
1042 1374
                if count.isdigit():
......
1047 1379
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1048 1380
                        self.add_crane_k_data(row, data, count)
1049 1381
                    else:
1050
                        self.update_crane_k_data(find_row, count)
1382
                        self.update_crane_k_data(find_row, data, count)
1051 1383
            # Pipe
1052 1384
            elif self.sender() == self.ui.pushButton_Add_CraneK_Pipe_Entrance:
1053 1385
                count = self.ui.lineEdit_CraneK_Pipe_Entrance_Count.text()
......
1059 1391
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1060 1392
                        self.add_crane_k_data(row, data, count)
1061 1393
                    else:
1062
                        self.update_crane_k_data(find_row, count)
1394
                        self.update_crane_k_data(find_row, data, count)
1063 1395
            elif self.sender() == self.ui.pushButton_Add_CraneK_Pipe_Exit:
1064 1396
                count = self.ui.lineEdit_CraneK_Pipe_Exit_Count.text()
1065 1397
                if count.isdigit():
......
1070 1402
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1071 1403
                        self.add_crane_k_data(row, data, count)
1072 1404
                    else:
1073
                        self.update_crane_k_data(find_row, count)
1405
                        self.update_crane_k_data(find_row, data, count)
1074 1406
            # Check Values
1075 1407
            elif self.sender() == self.ui.pushButton_Add_CraneK_Check_Valves_Swing:
1076 1408
                count = self.ui.lineEdit_CraneK_Check_Valves_Swing_Count.text()
......
1082 1414
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1083 1415
                        self.add_crane_k_data(row, data, count)
1084 1416
                    else:
1085
                        self.update_crane_k_data(find_row, count)
1417
                        self.update_crane_k_data(find_row, data, count)
1086 1418
            elif self.sender() == self.ui.pushButton_Add_CraneK_Check_Valves_Lift:
1087 1419
                count = self.ui.lineEdit_CraneK_Check_Valves_Lift_Count.text()
1088 1420
                if count.isdigit():
......
1093 1425
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1094 1426
                        self.add_crane_k_data(row, data, count)
1095 1427
                    else:
1096
                        self.update_crane_k_data(find_row, count)
1428
                        self.update_crane_k_data(find_row, data, count)
1097 1429
            elif self.sender() == self.ui.pushButton_Add_CraneK_Check_Valves_Tilting:
1098 1430
                count = self.ui.lineEdit_CraneK_Check_Valves_Tilting_Count.text()
1099 1431
                if count.isdigit():
......
1104 1436
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1105 1437
                        self.add_crane_k_data(row, data, count)
1106 1438
                    else:
1107
                        self.update_crane_k_data(find_row, count)
1439
                        self.update_crane_k_data(find_row, data, count)
1108 1440
            elif self.sender() == self.ui.pushButton_Add_CraneK_Check_Valves_Globe_Stop:
1109 1441
                count = self.ui.lineEdit_CraneK_Check_Valves_Globe_Stop_Count.text()
1110 1442
                if count.isdigit():
......
1115 1447
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1116 1448
                        self.add_crane_k_data(row, data, count)
1117 1449
                    else:
1118
                        self.update_crane_k_data(find_row, count)
1450
                        self.update_crane_k_data(find_row, data, count)
1119 1451
            elif self.sender() == self.ui.pushButton_Add_CraneK_Check_Valves_Angle_Stop:
1120 1452
                count = self.ui.lineEdit_CraneK_Check_Valves_Angle_Stop_Count.text()
1121 1453
                if count.isdigit():
......
1126 1458
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1127 1459
                        self.add_crane_k_data(row, data, count)
1128 1460
                    else:
1129
                        self.update_crane_k_data(find_row, count)
1461
                        self.update_crane_k_data(find_row, data, count)
1130 1462
            # Manual K
1131 1463
            elif self.sender() == self.ui.pushButton_Add_CraneK_Manual:
1132 1464
                count = self.ui.lineEdit_CraneK_Manual_Count.text()
......
1138 1470
                        self.ui.tableWidget_CraneK_SelectedFitting.setRowCount(row + 1)
1139 1471
                        self.add_crane_k_data(row, data, count)
1140 1472
                    else:
1141
                        self.update_crane_k_data(find_row, count)
1473
                        self.update_crane_k_data(find_row, data, count)
1142 1474

  
1143 1475
            # self.ui.tableWidget_CraneK_SelectedFitting.resizeColumnsToContents()
1144 1476
            # self.ui.tableWidget_CraneK_SelectedFitting.resizeRowsToContents()
......
1181 1513

  
1182 1514
        return find_row
1183 1515

  
1184
    def update_2_k_data(self, row, count):
1516
    def update_2_k_data(self, row, data, count):
1185 1517
        try:
1186
            name = self.ui.tableWidget_2K_SelectedFitting.item(row, 4).text()
1187 1518
            self.ui.tableWidget_2K_SelectedFitting.setItem(row, 5, set_table_widget_item_properties(count,
1188 1519
                                                                                                    Qt.AlignHCenter | Qt.AlignVCenter))
1189 1520

  
1190
            k = self.ui.tableWidget_2K_SelectedFitting.item(row, 6).text()
1521
            k = data[5]
1191 1522

  
1192
            selected_fitting = '{} x {} = {}'.format(name, count, int(count) * float(k))
1193
            self.ui.tableWidget_2K_SelectedFitting.setItem(row, 7, set_table_widget_item_properties(selected_fitting,
1523
            selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k)
1524
            self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(selected_fitting,
1194 1525
                                                                                                    Qt.AlignLeft | Qt.AlignVCenter))
1195 1526

  
1527
            #total_k = int(count) * float(k)
1528
            #self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(total_k,
1529
            #                                                                                        Qt.AlignRight | Qt.AlignVCenter))
1530

  
1196 1531
            self.ui.tableWidget_2K_SelectedFitting.resizeRowsToContents()
1197 1532
        except Exception as ex:
1198 1533
            from App import App
......
1213 1548
                                                                              set_table_widget_item_properties(angle,
1214 1549
                                                                                                               Qt.AlignHCenter | Qt.AlignVCenter))
1215 1550
            selected_fitting = '{} x {}'.format(name, count)
1551

  
1216 1552
            self.ui.tableWidget_Equivalent_Length_SelectedFitting.setItem(row, 7,
1217 1553
                                                                          set_table_widget_item_properties(
1218 1554
                                                                              selected_fitting,
......
1227 1563
                                                           sys.exc_info()[-1].tb_lineno)
1228 1564
            App.mainWnd().addMessage.emit(MessageType.Error, message)
1229 1565

  
1230
    def update_crane_k_data(self, row, count, sub_size=None, angle=None):
1566
    def update_crane_k_data(self, row, data, count, sub_size=None, angle=None):
1231 1567
        try:
1232
            name = self.ui.tableWidget_CraneK_SelectedFitting.item(row, 4).text()
1233 1568
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 5, set_table_widget_item_properties(count,
1234 1569
                                                                                                        Qt.AlignHCenter | Qt.AlignVCenter))
1235

  
1236 1570
            if sub_size:
1237 1571
                self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 7,
1238 1572
                                                                   set_table_widget_item_properties(sub_size,
......
1241 1575
                self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(angle,
1242 1576
                                                                                                            Qt.AlignHCenter | Qt.AlignVCenter))
1243 1577

  
1244
            k = self.ui.tableWidget_CraneK_SelectedFitting.item(row, 9).text()
1578
            k = self.get_crane_k_resistance_coefficient(data[4], data[5], sub_size, angle)
1579
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 9, set_table_widget_item_properties(k,
1580
                                                                                                        Qt.AlignRight | Qt.AlignVCenter))
1245 1581

  
1246
            selected_fitting = '{} x {} = {}'.format(name, count, int(count) * float(k))
1247
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 10,
1582
            selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k)
1583
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11,
1248 1584
                                                               set_table_widget_item_properties(selected_fitting,
1249 1585
                                                                                                Qt.AlignLeft | Qt.AlignVCenter))
1250 1586

  
1587
            #total_k = int(count) * float(k)
1588
            #self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11,
1589
            #                                                   set_table_widget_item_properties(total_k,
1590
            #                                                                                    Qt.AlignRight | Qt.AlignVCenter))
1591

  
1251 1592
            self.ui.tableWidget_CraneK_SelectedFitting.resizeRowsToContents()
1252 1593
        except Exception as ex:
1253 1594
            from App import App
......
1297 1638
        # data[3] = type
1298 1639
        # data[4] = name
1299 1640
        # data[5] = k
1641
        # data[6] = image
1642

  
1300 1643
        try:
1301 1644
            self.ui.tableWidget_2K_SelectedFitting.setItem(row, 0, set_table_widget_item_properties(data[0],
1302 1645
                                                                                                    Qt.AlignLeft | Qt.AlignVCenter))
......
1314 1657

  
1315 1658
            self.ui.tableWidget_2K_SelectedFitting.setItem(row, 6, set_table_widget_item_properties(k,
1316 1659
                                                                                                    Qt.AlignRight | Qt.AlignVCenter))
1317
            selected_fitting = '{} x {} = {}'.format(data[4], count,
1318
                                                     int(count) * k)
1319
            self.ui.tableWidget_2K_SelectedFitting.setItem(row, 7, set_table_widget_item_properties(selected_fitting,
1660

  
1661
            self.ui.tableWidget_2K_SelectedFitting.setItem(row, 7, set_table_widget_item_properties(data[6],
1662
                                                                                                    Qt.AlignLeft | Qt.AlignVCenter))
1663

  
1664
            selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k)
1665
            self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(selected_fitting,
1320 1666
                                                                                                    Qt.AlignLeft | Qt.AlignVCenter))
1321 1667

  
1668
            #total_k = int(count) * k
1669
            #self.ui.tableWidget_2K_SelectedFitting.setItem(row, 8, set_table_widget_item_properties(total_k,
1670
            #                                                                                        Qt.AlignRight | Qt.AlignVCenter))
1671

  
1322 1672
            self.ui.tableWidget_2K_SelectedFitting.resizeRowsToContents()
1323 1673

  
1324 1674
        except Exception as ex:
......
1381 1731
        # data[3] = type
1382 1732
        # data[4] = name
1383 1733
        # data[5] = k
1384

  
1734
        # data[6] = image
1385 1735
        try:
1386 1736
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 0, set_table_widget_item_properties(data[0],
1387 1737
                                                                                                        Qt.AlignLeft | Qt.AlignVCenter))
......
1408 1758

  
1409 1759
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 9, set_table_widget_item_properties(k,
1410 1760
                                                                                                        Qt.AlignRight | Qt.AlignVCenter))
1411
            selected_fitting = '{} x {} = {}'.format(data[4], count,
1412
                                                     int(count) * k)
1413
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 10,
1761

  
1762
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 10, set_table_widget_item_properties(data[6],
1763
                                                                                                         Qt.AlignLeft | Qt.AlignVCenter))
1764

  
1765
            selected_fitting = '{} x {} = {}'.format(data[4], count, int(count) * k)
1766
            self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11,
1414 1767
                                                               set_table_widget_item_properties(selected_fitting,
1415 1768
                                                                                                Qt.AlignLeft | Qt.AlignVCenter))
1416 1769

  
1770
            #total_k = int(count) * k
1771
            #self.ui.tableWidget_CraneK_SelectedFitting.setItem(row, 11,
1772
            #                                                   set_table_widget_item_properties(total_k,
1773
            #                                                                                    Qt.AlignRight | Qt.AlignVCenter))
1774

  
1417 1775
            self.ui.tableWidget_CraneK_SelectedFitting.resizeRowsToContents()
1418 1776
        except Exception as ex:
1419 1777
            from App import App
......
1446 1804
            elif 16 <= self.selected_dia_in:
1447 1805
                return self.friction_factor * 60
1448 1806
        elif name == 'Reducer':
1807
            if float(angle) > 90:
1808
                angle = 90
1449 1809
            # I128 = self.selected_dia_in
1450 1810
            # J128 = self.friction_factor
1451 1811
            # J203 = sub_size
1452 1812
            # K203 = angle
1453 1813
            # =IF(K203 <= 45, 0.8 * SIN(RADIANS(K203 / 2)) * (1 - (J203 / I128) ^ 2) / (J203 / I128) ^ 4,
1454 1814
            #    0.5 * (1 - (J203 / I128) ^ 2) * POWER(SIN(RADIANS(K203 / 2)), 0.5) / (J203 / I128) ^ 4)
1455
            return 1
1815

  
1816
            if float(angle) <= 45:
1817
                return 0.8 * math.sin(math.radians(float(angle) / 2)) * (
1818
                        1 - (float(sub_size) / self.selected_dia_in) ** 2) / (
1819
                               float(sub_size) / self.selected_dia_in) ** 4
1820
            else:
1821
                return 0.5 * (1 - (float(sub_size) / self.selected_dia_in) ** 2) * math.pow(
1822
                    math.sin(math.radians(float(angle) / 2)), 0.5) / (float(sub_size) / self.selected_dia_in) ** 4
1456 1823
        elif name == 'Expander':
1824
            if float(angle) > 90:
1825
                angle = 90
1826

  
1457 1827
            # I128 = self.selected_dia_in
1458 1828
            # J128 = self.friction_factor
1459 1829
            # J204 = sub_size
1460 1830
            # K204 = angle
1461 1831
            # =IF(K204 <= 45, 2.6 * SIN(RADIANS(K204 / 2)) * (1 - (I128 / J204) ^ 2) ^ 2 / (I128 / J204) ^ 4,
1462 1832
            #    (1 - (I128 / J204) ^ 2) ^ 2 / (I128 / J204) ^ 4)
1463
            return 1
1833
            if float(angle) <= 45:
1834
                return 2.6 * math.sin(math.radians(float(angle) / 2)) * (
1835
                            1 - (self.selected_dia_in / float(sub_size)) ** 2) ** 2 / (
1836
                                   self.selected_dia_in / float(sub_size)) ** 4
1837
            else:
1838
                return (1 - (self.selected_dia_in / float(sub_size)) ** 2) ** 2 / (
1839
                            self.selected_dia_in / float(sub_size)) ** 4
1464 1840
        else:
1465 1841
            return k * self.friction_factor
1466 1842

  
1467 1843
    def initialize_2_k_selected_fitting(self):
1468
        self.ui.tableWidget_2K_SelectedFitting.setColumnCount(8)
1844
        self.ui.tableWidget_2K_SelectedFitting.setColumnCount(9)
1469 1845
        self.ui.tableWidget_2K_SelectedFitting.hideColumn(0)  # uid
1470 1846
        self.ui.tableWidget_2K_SelectedFitting.hideColumn(1)  # method
1471
        self.ui.tableWidget_2K_SelectedFitting.hideColumn(2)  # category
1847
        # self.ui.tableWidget_2K_SelectedFitting.hideColumn(2)  # category
1472 1848
        self.ui.tableWidget_2K_SelectedFitting.hideColumn(3)  # type
1473
        self.ui.tableWidget_2K_SelectedFitting.hideColumn(4)  # Name
1474
        self.ui.tableWidget_2K_SelectedFitting.hideColumn(5)  # Count
1475
        self.ui.tableWidget_2K_SelectedFitting.hideColumn(6)  # K
1476
        # self.ui.tableWidget_2K_SelectedFitting.hideColumn(7)  # Selected Fitting
1849
        # self.ui.tableWidget_2K_SelectedFitting.hideColumn(4)  # Name
1850
        # self.ui.tableWidget_2K_SelectedFitting.hideColumn(5)  # Count
1851
        # self.ui.tableWidget_2K_SelectedFitting.hideColumn(6)  # K
1852
        self.ui.tableWidget_2K_SelectedFitting.hideColumn(7)  # Image
1853
        # self.ui.tableWidget_2K_SelectedFitting.hideColumn(8)  # Selected Fitting
1477 1854

  
1478 1855
        self.ui.tableWidget_2K_SelectedFitting.setEditTriggers(QAbstractItemView.NoEditTriggers)
1479 1856

  
1480
        col_names = ['UID', 'Method', 'Category', 'Type', 'Name', 'Count', 'K', 'Selected Fitting']
1857
        col_names = ['UID', 'Method', 'Category', 'Type', 'Name', 'Count', 'K', 'Image', 'Selected Fitting']
1481 1858
        self.ui.tableWidget_2K_SelectedFitting.setHorizontalHeaderLabels(col_names)
1482
        self.ui.tableWidget_2K_SelectedFitting.verticalHeader().setVisible(False)
1859
        self.ui.tableWidget_2K_SelectedFitting.verticalHeader().setVisible(True)
1483 1860

  
1484 1861
        self.ui.tableWidget_2K_SelectedFitting.horizontalHeader().setStretchLastSection(True)
1485 1862
        self.ui.tableWidget_2K_SelectedFitting.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeToContents)
......
1490 1867
        self.ui.tableWidget_2K_SelectedFitting.horizontalHeader().setSectionResizeMode(5, QHeaderView.ResizeToContents)
1491 1868
        self.ui.tableWidget_2K_SelectedFitting.horizontalHeader().setSectionResizeMode(6, QHeaderView.ResizeToContents)
1492 1869
        self.ui.tableWidget_2K_SelectedFitting.horizontalHeader().setSectionResizeMode(7, QHeaderView.ResizeToContents)
1870
        self.ui.tableWidget_2K_SelectedFitting.horizontalHeader().setSectionResizeMode(8, QHeaderView.ResizeToContents)
1493 1871

  
1494 1872
    def initialize_equivalent_length_selected_fitting(self):
1495 1873

  
......
1507 1885

  
1508 1886
        col_names = ['UID', 'Method', 'Category', 'Type', 'Name', 'Count', 'Angle', 'Selected Fitting']
1509 1887
        self.ui.tableWidget_Equivalent_Length_SelectedFitting.setHorizontalHeaderLabels(col_names)
1510
        self.ui.tableWidget_Equivalent_Length_SelectedFitting.verticalHeader().setVisible(False)
1888
        self.ui.tableWidget_Equivalent_Length_SelectedFitting.verticalHeader().setVisible(True)
1511 1889

  
1512 1890
        self.ui.tableWidget_Equivalent_Length_SelectedFitting.horizontalHeader().setStretchLastSection(True)
1891

  
1513 1892
        self.ui.tableWidget_Equivalent_Length_SelectedFitting.horizontalHeader().setSectionResizeMode(0,
1514 1893
                                                                                                      QHeaderView.ResizeToContents)
1515 1894
        self.ui.tableWidget_Equivalent_Length_SelectedFitting.horizontalHeader().setSectionResizeMode(1,
......
1528 1907
                                                                                                      QHeaderView.ResizeToContents)
1529 1908

  
1530 1909
    def initialize_crane_k_selected_fitting(self):
1531
        self.ui.tableWidget_CraneK_SelectedFitting.setColumnCount(11)
1910
        self.ui.tableWidget_CraneK_SelectedFitting.setColumnCount(12)
1532 1911
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(0)  # uid
1533 1912
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(1)  # method
1534
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(2)  # category
1913
        # self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(2)  # category
1535 1914
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(3)  # type
1536
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(4)  # Name
1537
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(5)  # Count
1915
        # self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(4)  # Name
1916
        # self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(5)  # Count
1538 1917
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(6)  # Size(M)
1539 1918
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(7)  # Size(S)
1540 1919
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(8)  # Angle
1541
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(9)  # K
1542
        # self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(10)  # Selected Fitting
1920
        # self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(9)  # K
1921
        self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(10)  # Image
1922
        # self.ui.tableWidget_CraneK_SelectedFitting.hideColumn(11)  # Selected Fitting
1543 1923

  
1544 1924
        self.ui.tableWidget_CraneK_SelectedFitting.setEditTriggers(QAbstractItemView.NoEditTriggers)
1545 1925

  
1546
        col_names = ['UID', 'Method', 'Category', 'Type', 'Name', 'Count', 'Size(M)', 'Size(S)', 'Angle', 'K',
1926
        col_names = ['UID', 'Method', 'Category', 'Type', 'Name', 'Count', 'Size(M)', 'Size(S)', 'Angle', 'K', 'Image',
1547 1927
                     'Selected Fitting']
1548 1928
        self.ui.tableWidget_CraneK_SelectedFitting.setHorizontalHeaderLabels(col_names)
1549
        self.ui.tableWidget_CraneK_SelectedFitting.verticalHeader().setVisible(False)
1929
        self.ui.tableWidget_CraneK_SelectedFitting.verticalHeader().setVisible(True)
1550 1930

  
1551 1931
        self.ui.tableWidget_CraneK_SelectedFitting.horizontalHeader().setStretchLastSection(True)
1552 1932
        self.ui.tableWidget_CraneK_SelectedFitting.horizontalHeader().setSectionResizeMode(0,
......
1571 1951
                                                                                           QHeaderView.ResizeToContents)
1572 1952
        self.ui.tableWidget_CraneK_SelectedFitting.horizontalHeader().setSectionResizeMode(10,
1573 1953
                                                                                           QHeaderView.ResizeToContents)
1954
        self.ui.tableWidget_CraneK_SelectedFitting.horizontalHeader().setSectionResizeMode(11,
1955
                                                                                           QHeaderView.ResizeToContents)
1956

  
1957
        self.ui.tableWidget_CraneK_SelectedFitting.currentItemChanged.connect(self.crane_k_item_selection_changed)
1958

  
1959
    def crane_k_item_selection_changed(self, item):
1960
        row = self.ui.tableWidget_CraneK_SelectedFitting.row(item)
1961
        image = self.ui.tableWidget_CraneK_SelectedFitting.item(row, 10).text()
1962
        picture = QtGui.QPixmap(':/images/{}'.format(image))
1963
        w = 150  # self.ui.label_CraneK_Img.height()
1964
        h = 150  # self.ui.label_CraneK_Img.width()
1965
        self.ui.label_CraneK_Img.setPixmap(
1966
            picture.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.FastTransformation))
1574 1967

  
1575 1968
    def controls_equivalent_length_set_names(self):
1576 1969
        from AppDocData import AppDocData
......
1709 2102

  
1710 2103
            # 90 Elbow
1711 2104
            self.ui.pushButton_Add_2K_90_Elbow_Bend.clicked.connect(self.add_2_k)
2105
            self.ui.pushButton_Del_2K_90_Elbow_Bend.clicked.connect(self.del_2_k)
1712 2106
            self.ui.pushButton_View_2K_90_Elbow_Bend.clicked.connect(self.show_2_k_image)
1713 2107
            self.ui.pushButton_Add_2K_90_Elbow_Miter.clicked.connect(self.add_2_k)
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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