프로젝트

일반

사용자정보

개정판 792d21d9

ID792d21d9755385ba2ca0980143c847ad24c32501
상위 419fcc77
하위 20f78f16

백흠경이(가) 약 5년 전에 추가함

issue #1047: resize drawing if items are over drawing when click 'fitWindow' button

Change-Id: I78b003a0edf4ef3156cbf18ff51d1b712bed007b

차이점 보기:

HYTOS/HYTOS/MainWindow.py
778 778
    '''
779 779

  
780 780
    def fitWindow(self, action):
781
        self.graphicsView.useDefaultCommand()
782
        self.graphicsView.zoomImageInit()
781
        app_doc_data = AppDocData.instance()
782
        if app_doc_data.activeDrawing:
783
            self.graphicsView.useDefaultCommand()
784
            scene_rect = self.graphicsView.scene.itemsBoundingRect()
785
            if scene_rect.left() > 0:
786
                scene_rect.setLeft(0)
787
            if scene_rect.top() > 0:
788
                scene_rect.setTop(0)
789
            if scene_rect.right() < 1189:
790
                scene_rect.setRight(1189)
791
            if scene_rect.bottom() < 841:
792
                scene_rect.setBottom(841)
793

  
794
            self.graphicsView.setSceneRect(scene_rect)
795
            self.graphicsView.zoomImageInit()
796
            self.graphicsView.scene.invalidate()
783 797

  
784 798
    def on_view_connector(self, checked):
785 799
        """turn on/off connector"""
......
1911 1925
    '''
1912 1926

  
1913 1927
    def open_border_file(self):
1914
        app_doc_data = AppDocData.instance()
1915
        borderFile = app_doc_data.border_file_path
1916
        if not os.path.exists(borderFile):
1917
            self.create_border_file(borderFile)
1918

  
1919
        self.graphicsView.loadImageFromFile(fileName=borderFile)
1920

  
1921
    '''
1922
        @brief      Create Border file 
1923
        @author     yeonjin
1924
        @date       2019.07.10
1925
    '''
1926

  
1927
    def create_border_file(self, border):
1928

  
1929
        from PIL import Image, ImageDraw
1930
        # A4 size : 210, 297
1931
        # A3 size : 297, 420
1932
        # A2 size : 420, 594
1933
        # A1 size : 594, 841
1934
        # A0 size : 841, 1189
1935
        # color : 0, 128, 128 진한 청록
1936
        # color : 255, 255, 255 White
1937
        img = Image.new('RGBA', (1189, 841), (255, 255, 255))
1938

  
1939
        draw = ImageDraw.Draw(img)
1940
        for x in range(100):
1941
            for y in range(100):
1942
                draw.point([(x*10, y*10)], fill='gray')
1943
        del draw
1944

  
1945
        img.save(border)
1928
        self.fitWindow(None)
1946 1929

  
1947 1930
    def setAttributes(self, drawing):
1948 1931
        drawing.setAttributes()
......
1999 1982
        try:
2000 1983
            app_doc_data = AppDocData.instance()
2001 1984

  
1985
            self.graphicsView.scene.clear()
2002 1986
            # Set appDocData
2003 1987
            app_doc_data.clear()
2004 1988
            self.onCommandRejected()
......
2085 2069
                app_doc_data.updateDrawing(drawing)
2086 2070

  
2087 2071
            self.load_drawing_list()
2088
            self.open_border_file()
2089 2072
            self.load_data(drawing)
2073
            self.open_border_file()
2090 2074

  
2091 2075
    '''
2092 2076
        @brief      create new drawing
......
2160 2144
        if self.graphicsView.scene.receivers(self.graphicsView.scene.contents_changed) > 0:
2161 2145
            self.graphicsView.scene.contents_changed.disconnect()
2162 2146

  
2163
        self.open_border_file()
2164 2147
        self.load_data(drawing)
2148
        self.open_border_file()
2165 2149

  
2166 2150
        # connect scene changed signal
2167 2151
        self.graphicsView.scene.contents_changed.connect(self.scene_changed)
HYTOS/HYTOS/QtImageViewer.py
214 214

  
215 215
        return fileName
216 216

  
217
    '''
218
        @history    2018.06.27  Jeongwoo    Change zoom rule (Qt.KeepAspectRatioByExpanding → Qt.KeepAspectRatio)
219
    '''
220 217
    def updateViewer(self, zoomNewRect=None):
221
        """ Show current zoom (if showing entire image, apply current aspect ratio mode).
222
        """
223
        if not self.hasImage():
224
            return
218
        """Show current zoom (if showing entire image, apply current aspect ratio mode)."""
225 219
        if len(self.zoomStack):# and self.sceneRect().contains(self.zoomStack[-1]):
226 220
            if zoomNewRect is None:
227 221
                self.fitInView(self.zoomStack[-1], Qt.KeepAspectRatio)  # Show zoomed rect (ignore aspect ratio).
......
232 226
            self.fitInView(self.sceneRect(), self.aspectRatioMode)  # Show entire image (use current aspect ratio mode).
233 227

  
234 228
    def zoomImageInit(self):
235
        if self.hasImage():
236
            self.zoomStack = []
237
            self.updateViewer()
238
            self.setCursor(QCursor(Qt.ArrowCursor))
229
        self.zoomStack = []
230
        self.updateViewer()
231
        self.setCursor(QCursor(Qt.ArrowCursor))
239 232

  
240 233
    '''
241 234
        @brief      Zoom in & out image
......
434 427
        @date       2018.07.23
435 428
    '''        
436 429
    def drawBackground(self, painter, rect):
437
        QGraphicsView.drawBackground(self, painter, rect) 
430
        QGraphicsView.drawBackground(self, painter, rect)
431

  
432
        painter.setPen(Qt.gray)
433
        painter.setBrush(Qt.gray)
434
        rect = self.sceneRect()
435
        rect.setLeft(rect.left() + 5)
436
        rect.setTop(rect.top() + 5)
437
        painter.fillRect(rect, Qt.gray)
438

  
439
        painter.setPen(Qt.white)
440
        painter.setBrush(Qt.white)
441
        rect.setLeft(rect.left() - 5)
442
        rect.setTop(rect.top() - 5)
443
        rect.setRight(rect.right() - 5)
444
        rect.setBottom(rect.bottom() - 5)
445
        painter.fillRect(rect, QBrush(Qt.white))
438 446

  
439 447
    '''
440 448
        @history    2018.06.11  Jeongwoo    Change method to manage guideline items
......
516 524
            from AppDocData import AppDocData
517 525
            import symbol
518 526

  
519
            if len(self.scene.items()) is 0:
520
                return
521

  
522 527
            scenePos = self.mapToScene(event.pos())
523 528
            uid = event.mimeData().text()
524 529
            svg = self.createSymbolObject(uid)
HYTOS/HYTOS/QtImageViewerScene.py
34 34
    def removeItem(self, item):
35 35
        """ remove given item from scene """
36 36
        QGraphicsScene.removeItem(self, item)
37
        self.contents_changed.emit()
37
        self.contents_changed.emit()
38

  
39
    """
40
    def rectForTile(self, x, y):
41
        # Return the rectangle for the tile at position (x, y).
42
        return QRectF(x * self.tileWidth, y * self.tileHeight, self.tileWidth, self.tileHeight)
43

  
44

  
45
    def setTile(self, x, y, pixmap):
46
        # Sets or replaces the tile at position (x, y) with pixmap.
47
        if 0 <= x < self.numTilesH and 0 <= y < self.numTilesV:
48
            self.tiles[y][x] = pixmap
49
            self.invalidate(self.rectForTile(x, y), Qt.BackgroundLayer)
50
    """
51

  
52
    """
53
    def drawBackground(self, painter, exposed):
54
        QGraphicsScene.drawBackground(self, painter, exposed)
55

  
56
        painter.setPen(Qt.gray)
57
        painter.setBrush(Qt.gray)
58
        rect = self.sceneRect()
59
        rect.setLeft(rect.left() + 5)
60
        rect.setTop(rect.top() + 5)
61
        painter.fillRect(rect, Qt.gray)
62

  
63
        painter.setPen(Qt.white)
64
        painter.setBrush(Qt.white)
65
        rect.setLeft(rect.left() - 5)
66
        rect.setTop(rect.top() - 5)
67
        rect.setRight(rect.right() - 5)
68
        rect.setBottom(rect.bottom() - 5)
69
        painter.fillRect(rect, QBrush(Qt.white))
70
    """
HYTOS/HYTOS/Shapes/SymbolSvgItem.py
383 383
        app_doc_data = AppDocData.instance()
384 384
        units = [attr[1] for attr in app_doc_data.activeDrawing.attrs if attr[0] == 'Units'][0]
385 385

  
386
        """
386 387
        # clear labels
387 388
        for conn, label in self.desc_labels.items():
388 389
            label.setHtml('')
390
        """
391

  
392
        self.update_label_contents()
389 393

  
390 394
        if self.category == 'Equipment - [ Pressure Drop ]':
391 395
            if self.type == 'Air Fin Cooler':
392 396
                conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
393 397
                if conns:
394
                    self.desc_labels[conns[0]].setHtml(
395
                        f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
396
                        f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
397

  
398 398
                    pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
399 399
                    self.desc_labels[conns[0]].setPos(pos)
400 400
            elif self.type == 'Filter':
401 401
                if self.tag_no:
402 402
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
403 403
                    if conns:
404
                        self.desc_labels[conns[0]].setHtml(
405
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
406
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
407

  
408 404
                        pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
409 405
                        self.desc_labels[conns[0]].setPos(pos)
410 406
            elif self.type == 'Heat Exchanger':
......
418 414
                    if len(nozzles) > 0:
419 415
                        if self.name == 'HEX_DP':
420 416
                            if 'N1' in nozzles and 'N2' in nozzles:
421
                                self.desc_labels[self.connectors[0]].setHtml(
422
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
423
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
424

  
425 417
                                label_rect = self.desc_labels[self.connectors[0]].boundingRect()
426
                                self.desc_labels[self.connectors[0]].setPos(
427
                                    QPointF((rect.width() - label_rect.width()) * 0.5, rect.height()))
428

  
429
                                pos = self.get_label_pos_of_connector(self.connectors[3],
430
                                                                       self.desc_labels[self.connectors[3]])
418
                                pos = self.get_label_pos_of_connector(self.connectors[0],
419
                                                                       self.desc_labels[self.connectors[0]])
431 420
                                self.desc_labels[self.connectors[0]].setPos(pos)
432 421
                            elif 'N1' in nozzles:
433
                                self.desc_labels[self.connectors[0]].setHtml(
434
                                    f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
435
                                    f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
436

  
437
                                pos = self.get_label_pos_of_connector(self.connectors[3],
438
                                                                      self.desc_labels[self.connectors[3]])
422
                                pos = self.get_label_pos_of_connector(self.connectors[0],
423
                                                                      self.desc_labels[self.connectors[0]])
439 424
                                self.desc_labels[self.connectors[0]].setPos(pos)
440 425
                            elif 'N2' in nozzles:
441
                                self.desc_labels[self.connectors[1]].setHtml(
442
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
443
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
444

  
445
                                pos = self.get_label_pos_of_connector(self.connectors[3],
446
                                                                      self.desc_labels[self.connectors[3]])
426
                                pos = self.get_label_pos_of_connector(self.connectors[1],
427
                                                                      self.desc_labels[self.connectors[1]])
447 428
                                self.desc_labels[self.connectors[1]].setPos(pos)
448 429
                        elif self.name == 'HEX_H':
449 430
                            if 'N1' in nozzles and 'N2' in nozzles:
450
                                self.desc_labels[self.connectors[0]].setHtml(
451
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
452
                                    f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
453

  
454 431
                                pos = self.get_label_pos_of_connector(self.connectors[2],
455 432
                                                                      self.desc_labels[self.connectors[2]])
456 433
                                self.desc_labels[self.connectors[0]].setPos(pos)
457 434
                            elif 'N1' in nozzles:
458
                                self.desc_labels[self.connectors[0]].setHtml(
459
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
460
                                    f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
461

  
462 435
                                pos = self.get_label_pos_of_connector(self.connectors[2],
463 436
                                                                      self.desc_labels[self.connectors[2]])
464 437
                                self.desc_labels[self.connectors[0]].setPos(pos)
465 438
                            elif 'N2' in nozzles:
466
                                self.desc_labels[self.connectors[1]].setHtml(
467
                                    f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
468
                                    f"[T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
469

  
470 439
                                pos = self.get_label_pos_of_connector(self.connectors[2],
471 440
                                                                      self.desc_labels[self.connectors[2]])
472 441
                                self.desc_labels[self.connectors[1]].setPos(pos)
473 442
                        elif self.name == 'HEX_K':
474 443
                            if 'N1' in nozzles and 'N2' in nozzles:
475
                                self.desc_labels[self.connectors[0]].setHtml(
476
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
477
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
478

  
479 444
                                pos = self.get_label_pos_of_connector(self.connectors[2],
480 445
                                                                      self.desc_labels[self.connectors[2]])
481 446
                                self.desc_labels[self.connectors[0]].setPos(pos)
482 447
                            elif 'N1' in nozzles:
483
                                self.desc_labels[self.connectors[0]].setHtml(
484
                                    f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
485
                                    f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
486

  
487 448
                                pos = self.get_label_pos_of_connector(self.connectors[2],
488 449
                                                                      self.desc_labels[self.connectors[2]])
489 450
                                self.desc_labels[self.connectors[0]].setPos(pos)
490 451
                            elif 'N2' in nozzles:
491
                                self.desc_labels[self.connectors[1]].setHtml(
492
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
493
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
494

  
495 452
                                pos = self.get_label_pos_of_connector(self.connectors[2],
496 453
                                                                      self.desc_labels[self.connectors[2]])
497 454
                                self.desc_labels[self.connectors[1]].setPos(pos)
498 455
                        elif self.name == 'HEX_P':
499 456
                            if 'N1' in nozzles and 'N2' in nozzles:
500
                                self.desc_labels[self.connectors[0]].setHtml(
501
                                    f"{self.tag_no}<br>[A] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} [B] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
502
                                    f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
503

  
504 457
                                pos = self.get_label_pos_of_connector(self.connectors[1],
505 458
                                                                      self.desc_labels[self.connectors[1]])
506 459
                                self.desc_labels[self.connectors[0]].setPos(pos)
507 460
                            elif 'N1' in nozzles:
508
                                self.desc_labels[self.connectors[0]].setHtml(
509
                                    f"{self.tag_no}<br>[A] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
510
                                    f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
511

  
512 461
                                pos = self.get_label_pos_of_connector(self.connectors[1],
513 462
                                                                      self.desc_labels[self.connectors[1]])
514 463
                                self.desc_labels[self.connectors[0]].setPos(pos)
515 464
                            elif 'N2' in nozzles:
516
                                self.desc_labels[self.connectors[1]].setHtml(
517
                                    f"{self.tag_no}<br>[B] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
518
                                    f"[B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
519

  
520 465
                                pos = self.get_label_pos_of_connector(self.connectors[1],
521 466
                                                                      self.desc_labels[self.connectors[1]])
522 467
                                self.desc_labels[self.connectors[1]].setPos(pos)
523 468
                        elif self.name == 'HEX_V':
524 469
                            if 'N1' in nozzles and 'N2' in nozzles:
525
                                self.desc_labels[self.connectors[0]].setHtml(
526
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
527
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
528

  
529 470
                                pos = self.get_label_pos_of_connector(self.connectors[2],
530 471
                                                                      self.desc_labels[self.connectors[2]])
531
                                self.desc_labels[self.connectors[0]].setPos(pos)
472
                                self.desc_labels[self.connectors[2]].setPos(pos)
532 473
                            elif 'N1' in nozzles:
533
                                self.desc_labels[self.connectors[0]].setHtml(
534
                                    f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
535
                                    f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
536

  
537
                                pos = self.get_label_pos_of_connector(self.connectors[2],
538
                                                                      self.desc_labels[self.connectors[2]])
474
                                pos = self.get_label_pos_of_connector(self.connectors[0],
475
                                                                      self.desc_labels[self.connectors[0]])
539 476
                                self.desc_labels[self.connectors[0]].setPos(pos)
540 477
                            elif 'N2' in nozzles:
541
                                self.desc_labels[self.connectors[1]].setHtml(
542
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
543
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
544

  
545
                                pos = self.get_label_pos_of_connector(self.connectors[2],
546
                                                                      self.desc_labels[self.connectors[2]])
478
                                pos = self.get_label_pos_of_connector(self.connectors[1],
479
                                                                      self.desc_labels[self.connectors[1]])
547 480
                                self.desc_labels[self.connectors[1]].setPos(pos)
548

  
549
                        # label_rect = self.desc_labels[self.connectors[0]].boundingRect()
550
                        # self.desc_labels[self.connectors[0]].setPos(QPointF((rect.width() - label_rect.width()) * 0.5, rect.height()))
551 481
            elif self.type == 'Miscellaneous':
552 482
                if self.name == 'M_Coil':
553 483
                    if self.tag_no:
554 484
                        conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
555 485
                        if conns:
556
                            self.desc_labels[conns[0]].setHtml(
557
                                f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
558
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
559

  
560 486
                            pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
561 487
                            self.desc_labels[conns[0]].setPos(pos)
562 488
                elif self.name == 'M_DP_E':
......
569 495

  
570 496
                        if len(nozzles) > 0:
571 497
                            if 'N1' in nozzles and 'N2' in nozzles:
572
                                self.desc_labels[self.connectors[0]].setHtml(
573
                                    f"{self.tag_no}<br>[H] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [V] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
574
                                    f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
575

  
576 498
                                label_rect = self.desc_labels[self.connectors[0]].boundingRect()
577
                                self.desc_labels[self.connectors[0]].setPos(
578
                                    QPointF((rect.width() - label_rect.width()) * 0.5, rect.height()))
579

  
580 499
                                pos = self.get_label_pos_of_connector(self.connectors[0],
581 500
                                                                      self.desc_labels[self.connectors[0]])
582 501
                                self.desc_labels[self.connectors[0]].setPos(pos)
583 502
                            elif 'N1' in nozzles:
584
                                self.desc_labels[self.connectors[0]].setHtml(
585
                                    f"{self.tag_no}<br>[V] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
586
                                    f"[V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
587

  
588 503
                                pos = self.get_label_pos_of_connector(self.connectors[0],
589 504
                                                                      self.desc_labels[self.connectors[0]])
590 505
                                self.desc_labels[self.connectors[0]].setPos(pos)
591 506
                            elif 'N2' in nozzles:
592
                                self.desc_labels[self.connectors[1]].setHtml(
593
                                    f"{self.tag_no}<br>[H] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
594
                                    f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
595

  
596
                                pos = self.get_label_pos_of_connector(self.connectors[2],
597
                                                                      self.desc_labels[self.connectors[2]])
507
                                pos = self.get_label_pos_of_connector(self.connectors[1],
508
                                                                      self.desc_labels[self.connectors[1]])
598 509
                                self.desc_labels[self.connectors[1]].setPos(pos)
599 510
                elif self.name == 'M_React':
600 511
                    if self.tag_no:
......
620 531
                                elif 'N5' in nozzles:
621 532
                                    btm_index = 4
622 533

  
623
                                self.desc_labels[self.connectors[top_index]].setHtml(
624
                                    f"[DP] : {convert_to_fixed_point(self.connectors[top_index].data.pressure_drop)} {units['Pressure']}<br>"
625
                                    f"[Top] : {convert_to_fixed_point(self.connectors[top_index].data.elevation)} {units['Length']}<br>"
626
                                    f"[Btm] : {convert_to_fixed_point(self.connectors[btm_index].data.elevation)} {units['Length']}")
627

  
628 534
                                pos = self.get_label_pos_of_connector(self.connectors[top_index],
629 535
                                                                      self.desc_labels[self.connectors[top_index]])
630 536
                                self.desc_labels[self.connectors[top_index]].setPos(pos)
......
637 543
                                elif 'N6' in nozzles:
638 544
                                    index = 5
639 545

  
640
                                self.desc_labels[self.connectors[index]].setHtml(
641
                                    f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
642
                                    f"[Top] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
643

  
644 546
                                pos = self.get_label_pos_of_connector(self.connectors[index],
645 547
                                                                      self.desc_labels[self.connectors[index]])
646 548
                                self.desc_labels[self.connectors[index]].setPos(pos)
......
653 555
                                elif 'N5' in nozzles:
654 556
                                    index = 4
655 557

  
656
                                self.desc_labels[self.connectors[index]].setHtml(
657
                                    f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
658
                                    f"[Btm] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
659

  
660 558
                                pos = self.get_label_pos_of_connector(self.connectors[index],
661 559
                                                                      self.desc_labels[self.connectors[index]])
662 560
                                self.desc_labels[self.connectors[index]].setPos(pos)
......
665 563
                    conns = [conn for conn in self.connectors
666 564
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
667 565
                    if conns:
668
                        self.desc_labels[conns[0]].setHtml(
669
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} {units['Pressure']}<br>"
670
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
671

  
672 566
                        pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
673 567
                        self.desc_labels[conns[0]].setPos(pos)
674 568
        elif self.category == 'Equipment - [ Pressurized ]':
......
677 571
                    conns = [conn for conn in self.connectors
678 572
                             if conn.data and conn.data.pressure is not None and conn.data.elevation is not None]
679 573
                    if conns:
680
                        self.desc_labels[conns[0]].setHtml(
681
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure)} {units['Pressure']}(g)<br>"
682
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
683

  
684 574
                        pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
685 575
                        self.desc_labels[conns[0]].setPos(pos)
686 576
            elif self.type == 'Column':
......
688 578
                    for conn in self.connectors:
689 579
                        if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
690 580
                            nozzle = str(conn).rsplit('_', 1)[1]
691
                            self.desc_labels[conn].setHtml(
692
                                f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
693
                                f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
694 581
                            pos = self.get_label_pos_of_connector(conn, self.desc_labels[conn])
695 582
                            self.desc_labels[conn].setPos(pos)
696 583
            elif self.type == 'Drum':
......
698 585
                    for conn in self.connectors:
699 586
                        if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
700 587
                            nozzle = str(conn).rsplit('_', 1)[1]
701
                            self.desc_labels[conn].setHtml(
702
                                f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
703
                                f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
704

  
705 588
                            pos = self.get_label_pos_of_connector(conn, self.desc_labels[conn])
706 589
                            self.desc_labels[conn].setPos(pos)
707 590
            elif self.type == 'Miscellaneous':
......
710 593
                        if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
711 594
                            nozzle = str(conn).rsplit('_', 1)[1]
712 595
                            if conn.data:
713
                                self.desc_labels[conn].setHtml(
714
                                    f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
715
                                    f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
716

  
717 596
                                pos = self.get_label_pos_of_connector(conn, self.desc_labels[conn])
718 597
                                self.desc_labels[conn].setPos(pos)
719 598
            elif self.type == 'Tank':
......
722 601
                        if conn.data and conn.connectedItem and \
723 602
                                (conn.data.pressure_drop is not None or conn.data.elevation is not None):
724 603
                            nozzle = str(conn).rsplit('_', 1)[1]
725
                            self.desc_labels[conn].setHtml(
726
                                f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
727
                                f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
728

  
729 604
                            pos = self.get_label_pos_of_connector(conn, self.desc_labels[conn])
730 605
                            self.desc_labels[conn].setPos(pos)
731 606
        elif self.category == 'Equipment - [ Rotating ]':
......
735 610
                        for conn in self.connectors:
736 611
                            if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
737 612
                                nozzle = str(conn).rsplit('_', 1)[1]
738
                                self.desc_labels[conn].setHtml(
739
                                    f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
740
                                    f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
741

  
742 613
                                pos = self.get_label_pos_of_connector(conn, self.desc_labels[conn])
743 614
                                self.desc_labels[conn].setPos(pos)
744 615
                elif self.name in ('L_Komp', 'R_Komp'):
745 616
                    if self.tag_no:
746 617
                        conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
747 618
                        if conns:
748
                            self.desc_labels[conns[0]].setHtml(
749
                                f"{self.tag_no}<br>"
750
                                f"{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
751
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
752

  
753
                            pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
754 619
                            self.desc_labels[conns[0]].setPos(pos)
755 620
            elif self.type == 'Pump':
756 621
                if self.tag_no:
757 622
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
758 623
                    if conns:
759
                        self.desc_labels[conns[0]].setHtml(
760
                            f"{self.tag_no}<br>"
761
                            f"{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
762
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
763

  
764 624
                        pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
765 625
                        self.desc_labels[conns[0]].setPos(pos)
766 626
        elif self.category == 'Instrument':
......
768 628
                if self.tag_no:
769 629
                    data = self.connectors[0].data
770 630
                    if data:
771
                        self.desc_labels[self.connectors[0]].setHtml(
772
                            f"{self.tag_no}<br>{convert_to_fixed_point(data.pressure_drop)} "
773
                            f"{units['Pressure']}<br>{convert_to_fixed_point(data.elevation)} {units['Length']}")
774

  
775 631
                        pos = self.get_label_pos_of_connector(self.connectors[0], self.desc_labels[self.connectors[0]])
776 632
                        self.desc_labels[self.connectors[0]].setPos(pos)
777 633
            elif self.type == 'Line Splitter':
......
779 635
                    conns = [conn for conn in self.connectors
780 636
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
781 637
                    if conns:
782
                        self.desc_labels[conns[0]].setHtml(
783
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
784
                            f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
785

  
786 638
                        pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
787 639
                        self.desc_labels[conns[0]].setPos(pos)
788 640
            elif self.type == 'Reducer':
......
790 642
                    conns = [conn for conn in self.connectors
791 643
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
792 644
                    if conns:
793
                        self.desc_labels[conns[0]].setHtml(
794
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
795
                            f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
796

  
797 645
                        pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
798 646
                        self.desc_labels[conns[0]].setPos(pos)
799 647
            elif self.type == 'Valve':
800 648
                if self.tag_no and self.name in ('CV_H', 'CV_V'):
801 649
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
802 650
                    if conns:
803
                        self.desc_labels[conns[0]].setHtml(
804
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
805
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
806

  
807 651
                        pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
808 652
                        self.desc_labels[conns[0]].setPos(pos)
809 653
                elif self.tag_no and self.name in ('MV_H', 'MV_V'):
810 654
                    conns = [conn for conn in self.connectors
811 655
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
812 656
                    if conns:
813
                        self.desc_labels[conns[0]].setHtml(
814
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
815
                            f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
816

  
817 657
                        pos = self.get_label_pos_of_connector(conns[0], self.desc_labels[conns[0]])
818 658
                        self.desc_labels[conns[0]].setPos(pos)
819 659

  
......
886 726

  
887 727
        # clear labels
888 728
        for conn, label in self.desc_labels.items():
729
            label.setEnabled(False)
889 730
            label.setHtml('')
890 731

  
891 732
        if self.category == 'Equipment - [ Pressure Drop ]':
......
895 736
                    self.desc_labels[conns[0]].setHtml(
896 737
                        f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
897 738
                        f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
739
                    self.desc_labels[conns[0]].setEnabled(True)
898 740
            elif self.type == 'Filter':
899 741
                if self.tag_no:
900 742
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
......
902 744
                        self.desc_labels[conns[0]].setHtml(
903 745
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
904 746
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
747
                        self.desc_labels[conns[0]].setEnabled(True)
905 748
            elif self.type == 'Heat Exchanger':
906 749
                if self.tag_no:
907 750
                    nozzles = []
......
916 759
                                self.desc_labels[self.connectors[0]].setHtml(
917 760
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
918 761
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
762
                                self.desc_labels[self.connectors[0]].setEnabled(True)
919 763
                            elif 'N1' in nozzles:
920 764
                                self.desc_labels[self.connectors[0]].setHtml(
921 765
                                    f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
922 766
                                    f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
767
                                self.desc_labels[self.connectors[0]].setEnabled(True)
923 768
                            elif 'N2' in nozzles:
924 769
                                self.desc_labels[self.connectors[1]].setHtml(
925 770
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
926 771
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
772
                                self.desc_labels[self.connectors[1]].setEnabled(True)
927 773
                        elif self.name == 'HEX_H':
928 774
                            if 'N1' in nozzles and 'N2' in nozzles:
929 775
                                self.desc_labels[self.connectors[0]].setHtml(
930 776
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
931 777
                                    f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
778
                                self.desc_labels[self.connectors[0]].setEnabled(True)
932 779
                            elif 'N1' in nozzles:
933 780
                                self.desc_labels[self.connectors[0]].setHtml(
934 781
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
935 782
                                    f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
783
                                self.desc_labels[self.connectors[0]].setEnabled(True)
936 784
                            elif 'N2' in nozzles:
937 785
                                self.desc_labels[self.connectors[1]].setHtml(
938 786
                                    f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
939 787
                                    f"[T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
788
                                self.desc_labels[self.connectors[1]].setEnabled(True)
940 789
                        elif self.name == 'HEX_K':
941 790
                            if 'N1' in nozzles and 'N2' in nozzles:
942 791
                                self.desc_labels[self.connectors[0]].setHtml(
943 792
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
944 793
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
794
                                self.desc_labels[self.connectors[0]].setEnabled(True)
945 795
                            elif 'N1' in nozzles:
946 796
                                self.desc_labels[self.connectors[0]].setHtml(
947 797
                                    f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
948 798
                                    f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
799
                                self.desc_labels[self.connectors[0]].setEnabled(True)
949 800
                            elif 'N2' in nozzles:
950 801
                                self.desc_labels[self.connectors[1]].setHtml(
951 802
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
952 803
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
804
                                self.desc_labels[self.connectors[1]].setEnabled(True)
953 805
                        elif self.name == 'HEX_P':
954 806
                            if 'N1' in nozzles and 'N2' in nozzles:
955 807
                                self.desc_labels[self.connectors[0]].setHtml(
956 808
                                    f"{self.tag_no}<br>[A] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} [B] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
957 809
                                    f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
810
                                self.desc_labels[self.connectors[0]].setEnabled(True)
958 811
                            elif 'N1' in nozzles:
959 812
                                self.desc_labels[self.connectors[0]].setHtml(
960 813
                                    f"{self.tag_no}<br>[A] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
961 814
                                    f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
815
                                self.desc_labels[self.connectors[0]].setEnabled(True)
962 816
                            elif 'N2' in nozzles:
963 817
                                self.desc_labels[self.connectors[1]].setHtml(
964 818
                                    f"{self.tag_no}<br>[B] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
965 819
                                    f"[B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
820
                                self.desc_labels[self.connectors[1]].setEnabled(True)
966 821
                        elif self.name == 'HEX_V':
967 822
                            if 'N1' in nozzles and 'N2' in nozzles:
968 823
                                self.desc_labels[self.connectors[0]].setHtml(
969 824
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
970 825
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
826
                                self.desc_labels[self.connectors[0]].setEnabled(True)
971 827
                            elif 'N1' in nozzles:
972 828
                                self.desc_labels[self.connectors[0]].setHtml(
973 829
                                    f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
974 830
                                    f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
831
                                self.desc_labels[self.connectors[0]].setEnabled(True)
975 832
                            elif 'N2' in nozzles:
976 833
                                self.desc_labels[self.connectors[1]].setHtml(
977 834
                                    f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
978 835
                                    f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
836
                                self.desc_labels[self.connectors[1]].setEnabled(True)
979 837
            elif self.type == 'Miscellaneous':
980 838
                if self.name == 'M_Coil':
981 839
                    if self.tag_no:
......
984 842
                            self.desc_labels[conns[0]].setHtml(
985 843
                                f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
986 844
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
845
                            self.desc_labels[conns[0]].setEnabled(True)
987 846
                elif self.name == 'M_DP_E':
988 847
                    if self.tag_no:
989 848
                        nozzles = []
......
997 856
                                self.desc_labels[self.connectors[0]].setHtml(
998 857
                                    f"{self.tag_no}<br>[H] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} [V] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
999 858
                                    f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
859
                                self.desc_labels[self.connectors[0]].setEnabled(True)
1000 860
                            elif 'N1' in nozzles:
1001 861
                                self.desc_labels[self.connectors[0]].setHtml(
1002 862
                                    f"{self.tag_no}<br>[V] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
1003 863
                                    f"[V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
864
                                self.desc_labels[self.connectors[0]].setEnabled(True)
1004 865
                            elif 'N2' in nozzles:
1005 866
                                self.desc_labels[self.connectors[1]].setHtml(
1006 867
                                    f"{self.tag_no}<br>[H] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
1007 868
                                    f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
869
                                self.desc_labels[self.connectors[1]].setEnabled(True)
1008 870
                elif self.name == 'M_React':
1009 871
                    if self.tag_no:
1010 872
                        nozzles = []
......
1034 896
                                    f"[DP] : {convert_to_fixed_point(self.connectors[top_index].data.pressure_drop)} {units['Pressure']}<br>"
1035 897
                                    f"[Top] : {convert_to_fixed_point(self.connectors[top_index].data.elevation)} {units['Length']}<br>"
1036 898
                                    f"[Btm] : {convert_to_fixed_point(self.connectors[btm_index].data.elevation)} {units['Length']}")
899
                                self.desc_labels[self.connectors[top_index]].setEnabled(True)
1037 900
                            elif 'N1' in nozzles or 'N2' in nozzles or 'N6' in nozzles:
1038 901
                                if 'N1' in nozzles:
1039 902
                                    index = 0
......
1045 908
                                self.desc_labels[self.connectors[index]].setHtml(
1046 909
                                    f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
1047 910
                                    f"[Top] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
911
                                self.desc_labels[self.connectors[index]].setEnabled(True)
1048 912
                            elif 'N3' in nozzles or 'N4' in nozzles or 'N5' in nozzles:
1049 913
                                if 'N3' in nozzles:
1050 914
                                    index = 2
......
1056 920
                                self.desc_labels[self.connectors[index]].setHtml(
1057 921
                                    f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
1058 922
                                    f"[Btm] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
923
                                self.desc_labels[self.connectors[index]].setEnabled(True)
1059 924
            elif self.type == 'Strainer':
1060 925
                if self.tag_no:
1061 926
                    conns = [conn for conn in self.connectors
......
1064 929
                        self.desc_labels[conns[0]].setHtml(
1065 930
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} {units['Pressure']}<br>"
1066 931
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
932
                        self.desc_labels[conns[0]].setEnabled(True)
1067 933
        elif self.category == 'Equipment - [ Pressurized ]':
1068 934
            if self.type == 'Battery Limit':
1069 935
                if self.tag_no:
......
1073 939
                        self.desc_labels[conns[0]].setHtml(
1074 940
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure)} {units['Pressure']}(g)<br>"
1075 941
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
942
                        self.desc_labels[conns[0]].setEnabled(True)
1076 943
            elif self.type == 'Column':
1077 944
                if self.tag_no:
1078 945
                    for conn in self.connectors:
......
1081 948
                            self.desc_labels[conn].setHtml(
1082 949
                                f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1083 950
                                f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
951
                            self.desc_labels[conn].setEnabled(True)
1084 952
            elif self.type == 'Drum':
1085 953
                if self.tag_no:
1086 954
                    for conn in self.connectors:
......
1089 957
                            self.desc_labels[conn].setHtml(
1090 958
                                f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1091 959
                                f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
960
                            self.desc_labels[conn].setEnabled(True)
1092 961
            elif self.type == 'Miscellaneous':
1093 962
                if self.tag_no:
1094 963
                    for conn in self.connectors:
......
1098 967
                                self.desc_labels[conn].setHtml(
1099 968
                                    f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1100 969
                                    f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
970
                                self.desc_labels[conn].setEnabled(True)
1101 971
            elif self.type == 'Tank':
1102 972
                if self.tag_no:
1103 973
                    for conn in self.connectors:
......
1107 977
                            self.desc_labels[conn].setHtml(
1108 978
                                f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1109 979
                                f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
980
                            self.desc_labels[conn].setEnabled(True)
1110 981
        elif self.category == 'Equipment - [ Rotating ]':
1111 982
            if self.type == 'Compressor':
1112 983
                if self.name in ('L_Comp', 'R_Comp'):
......
1117 988
                                self.desc_labels[conn].setHtml(
1118 989
                                    f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1119 990
                                    f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
991
                                self.desc_labels[conn].setEnabled(True)
1120 992
                elif self.name in ('L_Komp', 'R_Komp'):
1121 993
                    if self.tag_no:
1122 994
                        conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
......
1125 997
                                f"{self.tag_no}<br>"
1126 998
                                f"{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
1127 999
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1000
                            self.desc_labels[conns[0]].setEnabled(True)
1128 1001
            elif self.type == 'Pump':
1129 1002
                if self.tag_no:
1130 1003
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
......
1133 1006
                            f"{self.tag_no}<br>"
1134 1007
                            f"{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
1135 1008
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1009
                        self.desc_labels[conns[0]].setEnabled(True)
1136 1010
        elif self.category == 'Instrument':
1137 1011
            if self.type == 'Flowmeter':
1138 1012
                if self.tag_no:
......
1141 1015
                        self.desc_labels[self.connectors[0]].setHtml(
1142 1016
                            f"{self.tag_no}<br>{convert_to_fixed_point(data.pressure_drop)} "
1143 1017
                            f"{units['Pressure']}<br>{convert_to_fixed_point(data.elevation)} {units['Length']}")
1018
                        self.desc_labels[self.connectors[0]].setEnabled(True)
1144 1019
            elif self.type == 'Line Splitter':
1145 1020
                if self.tag_no:
1146 1021
                    conns = [conn for conn in self.connectors
......
1149 1024
                        self.desc_labels[conns[0]].setHtml(
1150 1025
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1151 1026
                            f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1027
                        self.desc_labels[conns[0]].setEnabled(True)
1152 1028
            elif self.type == 'Reducer':
1153 1029
                if self.tag_no:
1154 1030
                    conns = [conn for conn in self.connectors
......
1157 1033
                        self.desc_labels[conns[0]].setHtml(
1158 1034
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1159 1035
                            f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1036
                        self.desc_labels[conns[0]].setEnabled(True)
1160 1037
            elif self.type == 'Valve':
1161 1038
                if self.tag_no and self.name in ('CV_H', 'CV_V'):
1162 1039
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
......
1164 1041
                        self.desc_labels[conns[0]].setHtml(
1165 1042
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
1166 1043
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1044
                        self.desc_labels[conns[0]].setEnabled(True)
1167 1045
                elif self.tag_no and self.name in ('MV_H', 'MV_V'):
1168 1046
                    conns = [conn for conn in self.connectors
1169 1047
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
......
1171 1049
                        self.desc_labels[conns[0]].setHtml(
1172 1050
                            f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1173 1051
                            f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1052
                        self.desc_labels[conns[0]].setEnabled(True)
1174 1053

  
1175 1054
        font_size = None
1176 1055
        configs = app_doc_data.getAppConfigs('option', 'TagFontSize')
......
1972 1851

  
1973 1852
        # set label
1974 1853
        label = QEngineeringEqpDescTextItem('', self)
1854
        #label.setVisible(False)
1975 1855
        self.desc_labels[connector] = label
1976 1856

  
1977
    def refreshConnector(self):
1978
        for connector in self.connectors:
1979
            connector.buildItem()
1980

  
1981 1857
    def deleteSvgItemFromScene(self):
1982 1858
        """ remove self from scene """
1983 1859
        try:

내보내기 Unified diff

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