프로젝트

일반

사용자정보

개정판 a7e3def6

IDa7e3def6f95c53543f324fd278aaa7fed2135519
상위 60523553
하위 181780cc

백흠경이(가) 4년 이상 전에 추가함

issue #1060: NozzleData가 없을때 에러 메세지가 표시되지 않도록 처리

Change-Id: Ifbb2b74b34c95e0fb50a3309d645a2bc5c5f8f96

차이점 보기:

HYTOS/HYTOS/Shapes/SymbolSvgItem.py
686 686

  
687 687
        rect = self.boundingRect()
688 688

  
689
        app_doc_data = AppDocData.instance()
690
        units = [attr[1] for attr in app_doc_data.activeDrawing.attrs if attr[0] == 'Units'][0]
689
        try:
690
            app_doc_data = AppDocData.instance()
691
            units = [attr[1] for attr in app_doc_data.activeDrawing.attrs if attr[0] == 'Units'][0]
691 692

  
692
        # clear labels
693
        for conn, label in self.desc_labels.items():
694
            """reset all of nozzle descriptions"""
695
            conn.data.desc = None
696
            label.setEnabled(False)
697

  
698
        if self.category == 'Equipment - [ Pressure Drop ]':
699
            if self.type == 'Air Fin Cooler':
700
                conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
701
                if conns:
702
                    if conns[0].data.desc is None:
703
                        self.desc_labels[conns[0]].setHtml(
704
                            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>"
705
                            f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
706
                    else:
707
                        self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
708
                    self.desc_labels[conns[0]].setEnabled(True)
709
            elif self.type == 'Filter':
710
                if self.tag_no:
693
            # clear labels
694
            for conn, label in self.desc_labels.items():
695
                """reset all of nozzle descriptions"""
696
                if conn.data:
697
                    conn.data.desc = None
698
                label.setEnabled(False)
699

  
700
            if self.category == 'Equipment - [ Pressure Drop ]':
701
                if self.type == 'Air Fin Cooler':
711 702
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
712 703
                    if conns:
713 704
                        if conns[0].data.desc is None:
......
716 707
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
717 708
                        else:
718 709
                            self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
719

  
720 710
                        self.desc_labels[conns[0]].setEnabled(True)
721
            elif self.type == 'Heat Exchanger':
722
                if self.tag_no:
723
                    nozzles = []
724
                    for conn in self.connectors:
725
                        if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
726
                            nozzle = str(conn).rsplit('_', 1)[1]
727
                            nozzles.append(nozzle)
728

  
729
                    if len(nozzles) > 0:
730
                        if self.name == 'HEX_DP':
731
                            if 'N1' in nozzles and 'N2' in nozzles:
732
                                if self.connectors[0].data.desc is None:
733
                                    self.desc_labels[self.connectors[0]].setHtml(
734
                                        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>"
735
                                        f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
736
                                else:
737
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
738

  
739
                                self.desc_labels[self.connectors[0]].setEnabled(True)
740
                            elif 'N1' in nozzles:
741
                                if self.connectors[0].data.desc is None:
742
                                    self.desc_labels[self.connectors[0]].setHtml(
743
                                        f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
744
                                        f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
745
                                else:
746
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
747

  
748
                                self.desc_labels[self.connectors[0]].setEnabled(True)
749
                            elif 'N2' in nozzles:
750
                                if self.connectors[1].data.desc is None:
751
                                    self.desc_labels[self.connectors[1]].setHtml(
752
                                        f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
753
                                        f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
754
                                else:
755
                                    self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
756

  
757
                                self.desc_labels[self.connectors[1]].setEnabled(True)
758
                        elif self.name == 'HEX_H':
759
                            if 'N1' in nozzles and 'N2' in nozzles:
760
                                if self.connectors[0].data.desc is None:
761
                                    self.desc_labels[self.connectors[0]].setHtml(
762
                                        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>"
763
                                        f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
764
                                else:
765
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
766

  
767
                                self.desc_labels[self.connectors[0]].setEnabled(True)
768
                            elif 'N1' in nozzles:
769
                                if self.connectors[0].data.desc is None:
770
                                    self.desc_labels[self.connectors[0]].setHtml(
771
                                        f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
772
                                        f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
773
                                else:
774
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
775

  
776
                                self.desc_labels[self.connectors[0]].setEnabled(True)
777
                            elif 'N2' in nozzles:
778
                                if self.connectors[1].data.desc is None:
779
                                    self.desc_labels[self.connectors[1]].setHtml(
780
                                        f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
781
                                        f"[T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
782
                                else:
783
                                    self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
784

  
785
                                self.desc_labels[self.connectors[1]].setEnabled(True)
786
                        elif self.name == 'HEX_K':
787
                            if 'N1' in nozzles and 'N2' in nozzles:
788
                                if self.connectors[0].data.desc is None:
789
                                    self.desc_labels[self.connectors[0]].setHtml(
790
                                        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>"
791
                                        f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
792
                                else:
793
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
794

  
795
                                self.desc_labels[self.connectors[0]].setEnabled(True)
796
                            elif 'N1' in nozzles:
797
                                if self.connectors[0].data.desc is None:
798
                                    self.desc_labels[self.connectors[0]].setHtml(
799
                                        f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
800
                                        f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
801
                                else:
802
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
803

  
804
                                self.desc_labels[self.connectors[0]].setEnabled(True)
805
                            elif 'N2' in nozzles:
806
                                if self.connectors[1].data.desc is None:
807
                                    self.desc_labels[self.connectors[1]].setHtml(
808
                                        f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
809
                                        f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
810
                                else:
811
                                    self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
812

  
813
                                self.desc_labels[self.connectors[1]].setEnabled(True)
814
                        elif self.name == 'HEX_P':
815
                            if 'N1' in nozzles and 'N2' in nozzles:
816
                                if self.connectors[0].data.desc is None:
817
                                    self.desc_labels[self.connectors[0]].setHtml(
818
                                        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>"
819
                                        f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
820
                                else:
821
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
822

  
823
                                self.desc_labels[self.connectors[0]].setEnabled(True)
824
                            elif 'N1' in nozzles:
825
                                if self.connectors[0].data.desc is None:
826
                                    self.desc_labels[self.connectors[0]].setHtml(
827
                                        f"{self.tag_no}<br>[A] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
828
                                        f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
829
                                else:
830
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
831

  
832
                                self.desc_labels[self.connectors[0]].setEnabled(True)
833
                            elif 'N2' in nozzles:
834
                                if self.connectors[1].data.desc is None:
835
                                    self.desc_labels[self.connectors[1]].setHtml(
836
                                        f"{self.tag_no}<br>[B] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
837
                                        f"[B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
838
                                else:
839
                                    self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
840

  
841
                                self.desc_labels[self.connectors[1]].setEnabled(True)
842
                        elif self.name == 'HEX_V':
843
                            if 'N1' in nozzles and 'N2' in nozzles:
844
                                if self.connectors[0].data.desc is None:
845
                                    self.desc_labels[self.connectors[0]].setHtml(
846
                                        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>"
847
                                        f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
848
                                else:
849
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
850

  
851
                                self.desc_labels[self.connectors[0]].setEnabled(True)
852
                            elif 'N1' in nozzles:
853
                                if self.connectors[0].data.desc is None:
854
                                    self.desc_labels[self.connectors[0]].setHtml(
855
                                        f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
856
                                        f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
857
                                else:
858
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
859

  
860
                                self.desc_labels[self.connectors[0]].setEnabled(True)
861
                            elif 'N2' in nozzles:
862
                                if self.connectors[1].data.desc is None:
863
                                    self.desc_labels[self.connectors[1]].setHtml(
864
                                        f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
865
                                        f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
866
                                else:
867
                                    self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
868

  
869
                                self.desc_labels[self.connectors[1]].setEnabled(True)
870
            elif self.type == 'Miscellaneous':
871
                if self.name == 'M_Coil':
711
                elif self.type == 'Filter':
872 712
                    if self.tag_no:
873 713
                        conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
874 714
                        if conns:
......
880 720
                                self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
881 721

  
882 722
                            self.desc_labels[conns[0]].setEnabled(True)
883
                elif self.name == 'M_DP_E':
723
                elif self.type == 'Heat Exchanger':
884 724
                    if self.tag_no:
885 725
                        nozzles = []
886 726
                        for conn in self.connectors:
......
889 729
                                nozzles.append(nozzle)
890 730

  
891 731
                        if len(nozzles) > 0:
892
                            if 'N1' in nozzles and 'N2' in nozzles:
893
                                if self.connectors[0].data.desc is None:
894
                                    self.desc_labels[self.connectors[0]].setHtml(
895
                                        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>"
896
                                        f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
897
                                else:
898
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
899

  
900
                                self.desc_labels[self.connectors[0]].setEnabled(True)
901
                            elif 'N1' in nozzles:
902
                                if self.connectors[0].data.desc is None:
903
                                    self.desc_labels[self.connectors[0]].setHtml(
904
                                        f"{self.tag_no}<br>[V] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
905
                                        f"[V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
906
                                else:
907
                                    self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
908

  
909
                                self.desc_labels[self.connectors[0]].setEnabled(True)
910
                            elif 'N2' in nozzles:
911
                                if self.connectors[1].data.desc is None:
912
                                    self.desc_labels[self.connectors[1]].setHtml(
913
                                        f"{self.tag_no}<br>[H] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
914
                                        f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
732
                            if self.name == 'HEX_DP':
733
                                if 'N1' in nozzles and 'N2' in nozzles:
734
                                    if self.connectors[0].data.desc is None:
735
                                        self.desc_labels[self.connectors[0]].setHtml(
736
                                            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>"
737
                                            f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
738
                                    else:
739
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
740

  
741
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
742
                                elif 'N1' in nozzles:
743
                                    if self.connectors[0].data.desc is None:
744
                                        self.desc_labels[self.connectors[0]].setHtml(
745
                                            f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
746
                                            f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
747
                                    else:
748
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
749

  
750
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
751
                                elif 'N2' in nozzles:
752
                                    if self.connectors[1].data.desc is None:
753
                                        self.desc_labels[self.connectors[1]].setHtml(
754
                                            f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
755
                                            f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
756
                                    else:
757
                                        self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
758

  
759
                                    self.desc_labels[self.connectors[1]].setEnabled(True)
760
                            elif self.name == 'HEX_H':
761
                                if 'N1' in nozzles and 'N2' in nozzles:
762
                                    if self.connectors[0].data.desc is None:
763
                                        self.desc_labels[self.connectors[0]].setHtml(
764
                                            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>"
765
                                            f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
766
                                    else:
767
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
768

  
769
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
770
                                elif 'N1' in nozzles:
771
                                    if self.connectors[0].data.desc is None:
772
                                        self.desc_labels[self.connectors[0]].setHtml(
773
                                            f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
774
                                            f"[S] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
775
                                    else:
776
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
777

  
778
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
779
                                elif 'N2' in nozzles:
780
                                    if self.connectors[1].data.desc is None:
781
                                        self.desc_labels[self.connectors[1]].setHtml(
782
                                            f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
783
                                            f"[T] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
784
                                    else:
785
                                        self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
786

  
787
                                    self.desc_labels[self.connectors[1]].setEnabled(True)
788
                            elif self.name == 'HEX_K':
789
                                if 'N1' in nozzles and 'N2' in nozzles:
790
                                    if self.connectors[0].data.desc is None:
791
                                        self.desc_labels[self.connectors[0]].setHtml(
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>"
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
                                    else:
795
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
796

  
797
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
798
                                elif 'N1' in nozzles:
799
                                    if self.connectors[0].data.desc is None:
800
                                        self.desc_labels[self.connectors[0]].setHtml(
801
                                            f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
802
                                            f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
803
                                    else:
804
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
805

  
806
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
807
                                elif 'N2' in nozzles:
808
                                    if self.connectors[1].data.desc is None:
809
                                        self.desc_labels[self.connectors[1]].setHtml(
810
                                            f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
811
                                            f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
812
                                    else:
813
                                        self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
814

  
815
                                    self.desc_labels[self.connectors[1]].setEnabled(True)
816
                            elif self.name == 'HEX_P':
817
                                if 'N1' in nozzles and 'N2' in nozzles:
818
                                    if self.connectors[0].data.desc is None:
819
                                        self.desc_labels[self.connectors[0]].setHtml(
820
                                            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>"
821
                                            f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} [B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
822
                                    else:
823
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
824

  
825
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
826
                                elif 'N1' in nozzles:
827
                                    if self.connectors[0].data.desc is None:
828
                                        self.desc_labels[self.connectors[0]].setHtml(
829
                                            f"{self.tag_no}<br>[A] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
830
                                            f"[A] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
831
                                    else:
832
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
833

  
834
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
835
                                elif 'N2' in nozzles:
836
                                    if self.connectors[1].data.desc is None:
837
                                        self.desc_labels[self.connectors[1]].setHtml(
838
                                            f"{self.tag_no}<br>[B] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
839
                                            f"[B] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
840
                                    else:
841
                                        self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
842

  
843
                                    self.desc_labels[self.connectors[1]].setEnabled(True)
844
                            elif self.name == 'HEX_V':
845
                                if 'N1' in nozzles and 'N2' in nozzles:
846
                                    if self.connectors[0].data.desc is None:
847
                                        self.desc_labels[self.connectors[0]].setHtml(
848
                                            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>"
849
                                            f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
850
                                    else:
851
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
852

  
853
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
854
                                elif 'N1' in nozzles:
855
                                    if self.connectors[0].data.desc is None:
856
                                        self.desc_labels[self.connectors[0]].setHtml(
857
                                            f"{self.tag_no}<br>[T] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
858
                                            f"[T] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
859
                                    else:
860
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
861

  
862
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
863
                                elif 'N2' in nozzles:
864
                                    if self.connectors[1].data.desc is None:
865
                                        self.desc_labels[self.connectors[1]].setHtml(
866
                                            f"{self.tag_no}<br>[S] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
867
                                            f"[S] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
868
                                    else:
869
                                        self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
870

  
871
                                    self.desc_labels[self.connectors[1]].setEnabled(True)
872
                elif self.type == 'Miscellaneous':
873
                    if self.name == 'M_Coil':
874
                        if self.tag_no:
875
                            conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
876
                            if conns:
877
                                if conns[0].data.desc is None:
878
                                    self.desc_labels[conns[0]].setHtml(
879
                                        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>"
880
                                        f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
915 881
                                else:
916
                                    self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
882
                                    self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
917 883

  
918
                                self.desc_labels[self.connectors[1]].setEnabled(True)
919
                elif self.name == 'M_React':
920
                    if self.tag_no:
921
                        nozzles = []
922
                        for conn in self.connectors:
923
                            if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
924
                                nozzle = str(conn).rsplit('_', 1)[1]
925
                                nozzles.append(nozzle)
884
                                self.desc_labels[conns[0]].setEnabled(True)
885
                    elif self.name == 'M_DP_E':
886
                        if self.tag_no:
887
                            nozzles = []
888
                            for conn in self.connectors:
889
                                if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
890
                                    nozzle = str(conn).rsplit('_', 1)[1]
891
                                    nozzles.append(nozzle)
926 892

  
927
                        if len(nozzles) > 0:
928
                            if ('N1' in nozzles or 'N2' in nozzles or 'N6' in nozzles) and (
929
                                    'N3' in nozzles or 'N4' in nozzles or 'N5' in nozzles):
930
                                if 'N1' in nozzles:
931
                                    top_index = 0
893
                            if len(nozzles) > 0:
894
                                if 'N1' in nozzles and 'N2' in nozzles:
895
                                    if self.connectors[0].data.desc is None:
896
                                        self.desc_labels[self.connectors[0]].setHtml(
897
                                            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>"
898
                                            f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} [V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
899
                                    else:
900
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
901

  
902
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
903
                                elif 'N1' in nozzles:
904
                                    if self.connectors[0].data.desc is None:
905
                                        self.desc_labels[self.connectors[0]].setHtml(
906
                                            f"{self.tag_no}<br>[V] : {convert_to_fixed_point(self.connectors[0].data.pressure_drop)} {units['Pressure']}<br>"
907
                                            f"[V] : {convert_to_fixed_point(self.connectors[0].data.elevation)} {units['Length']}")
908
                                    else:
909
                                        self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
910

  
911
                                    self.desc_labels[self.connectors[0]].setEnabled(True)
932 912
                                elif 'N2' in nozzles:
933
                                    top_index = 1
934
                                elif 'N6' in nozzles:
935
                                    top_index = 5
936

  
937
                                if 'N3' in nozzles:
938
                                    btm_index = 2
939
                                elif 'N4' in nozzles:
940
                                    btm_index = 3
941
                                elif 'N5' in nozzles:
942
                                    btm_index = 4
943

  
944
                                if self.connectors[top_index].data.desc is None:
945
                                    self.desc_labels[self.connectors[top_index]].setHtml(
946
                                        f"[DP] : {convert_to_fixed_point(self.connectors[top_index].data.pressure_drop)} {units['Pressure']}<br>"
947
                                        f"[Top] : {convert_to_fixed_point(self.connectors[top_index].data.elevation)} {units['Length']}<br>"
948
                                        f"[Btm] : {convert_to_fixed_point(self.connectors[btm_index].data.elevation)} {units['Length']}")
949
                                else:
950
                                    self.desc_labels[self.connectors[top_index]].setHtml(self.connectors[top_index].data.desc)
913
                                    if self.connectors[1].data.desc is None:
914
                                        self.desc_labels[self.connectors[1]].setHtml(
915
                                            f"{self.tag_no}<br>[H] : {convert_to_fixed_point(self.connectors[1].data.pressure_drop)} {units['Pressure']}<br>"
916
                                            f"[H] : {convert_to_fixed_point(self.connectors[1].data.elevation)} {units['Length']}")
917
                                    else:
918
                                        self.desc_labels[self.connectors[1]].setHtml(self.connectors[1].data.desc)
919

  
920
                                    self.desc_labels[self.connectors[1]].setEnabled(True)
921
                    elif self.name == 'M_React':
922
                        if self.tag_no:
923
                            nozzles = []
924
                            for conn in self.connectors:
925
                                if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
926
                                    nozzle = str(conn).rsplit('_', 1)[1]
927
                                    nozzles.append(nozzle)
951 928

  
952
                                self.desc_labels[self.connectors[top_index]].setEnabled(True)
953
                            elif 'N1' in nozzles or 'N2' in nozzles or 'N6' in nozzles:
954
                                if 'N1' in nozzles:
955
                                    index = 0
956
                                elif 'N2' in nozzles:
957
                                    index = 1
958
                                elif 'N6' in nozzles:
959
                                    index = 5
960

  
961
                                if self.connectors[index].data.desc is None:
962
                                    self.desc_labels[self.connectors[index]].setHtml(
963
                                        f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
964
                                        f"[Top] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
965
                                else:
966
                                    self.desc_labels[self.connectors[index]].setHtml(self.connectors[index].data.desc)
967

  
968
                                self.desc_labels[self.connectors[index]].setEnabled(True)
969
                            elif 'N3' in nozzles or 'N4' in nozzles or 'N5' in nozzles:
970
                                if 'N3' in nozzles:
971
                                    index = 2
972
                                elif 'N4' in nozzles:
973
                                    index = 3
974
                                elif 'N5' in nozzles:
975
                                    index = 4
976

  
977
                                if self.connectors[index].data.desc is None:
978
                                    self.desc_labels[self.connectors[index]].setHtml(
979
                                        f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
980
                                        f"[Btm] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
981
                                else:
982
                                    self.desc_labels[self.connectors[index]].setHtml(self.connectors[index].data.desc)
929
                            if len(nozzles) > 0:
930
                                if ('N1' in nozzles or 'N2' in nozzles or 'N6' in nozzles) and (
931
                                        'N3' in nozzles or 'N4' in nozzles or 'N5' in nozzles):
932
                                    if 'N1' in nozzles:
933
                                        top_index = 0
934
                                    elif 'N2' in nozzles:
935
                                        top_index = 1
936
                                    elif 'N6' in nozzles:
937
                                        top_index = 5
983 938

  
984
                                self.desc_labels[self.connectors[index]].setEnabled(True)
985
            elif self.type == 'Strainer':
986
                if self.tag_no:
987
                    conns = [conn for conn in self.connectors
988
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
989
                    if conns:
990
                        if conns[0].data.desc is None:
991
                            self.desc_labels[conns[0]].setHtml(
992
                                f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} {units['Pressure']}<br>"
993
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
994
                        else:
995
                            self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
939
                                    if 'N3' in nozzles:
940
                                        btm_index = 2
941
                                    elif 'N4' in nozzles:
942
                                        btm_index = 3
943
                                    elif 'N5' in nozzles:
944
                                        btm_index = 4
996 945

  
997
                        self.desc_labels[conns[0]].setEnabled(True)
998
        elif self.category == 'Equipment - [ Pressurized ]':
999
            if self.type == 'Battery Limit':
1000
                if self.tag_no:
1001
                    conns = [conn for conn in self.connectors
1002
                             if conn.data and conn.data.pressure is not None and conn.data.elevation is not None]
1003
                    if conns:
1004
                        if conns[0].data.desc is None:
1005
                            self.desc_labels[conns[0]].setHtml(
1006
                                f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure)} {units['Pressure']}(g)<br>"
1007
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1008
                        else:
1009
                            self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
946
                                    if self.connectors[top_index].data.desc is None:
947
                                        self.desc_labels[self.connectors[top_index]].setHtml(
948
                                            f"[DP] : {convert_to_fixed_point(self.connectors[top_index].data.pressure_drop)} {units['Pressure']}<br>"
949
                                            f"[Top] : {convert_to_fixed_point(self.connectors[top_index].data.elevation)} {units['Length']}<br>"
950
                                            f"[Btm] : {convert_to_fixed_point(self.connectors[btm_index].data.elevation)} {units['Length']}")
951
                                    else:
952
                                        self.desc_labels[self.connectors[top_index]].setHtml(self.connectors[top_index].data.desc)
1010 953

  
1011
                        self.desc_labels[conns[0]].setEnabled(True)
1012
            elif self.type == 'Column':
1013
                if self.tag_no:
1014
                    for conn in self.connectors:
1015
                        if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1016
                            nozzle = str(conn).rsplit('_', 1)[1]
1017
                            if conn.data.desc is None:
1018
                                self.desc_labels[conn].setHtml(
1019
                                    f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1020
                                    f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
954
                                    self.desc_labels[self.connectors[top_index]].setEnabled(True)
955
                                elif 'N1' in nozzles or 'N2' in nozzles or 'N6' in nozzles:
956
                                    if 'N1' in nozzles:
957
                                        index = 0
958
                                    elif 'N2' in nozzles:
959
                                        index = 1
960
                                    elif 'N6' in nozzles:
961
                                        index = 5
962

  
963
                                    if self.connectors[index].data.desc is None:
964
                                        self.desc_labels[self.connectors[index]].setHtml(
965
                                            f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
966
                                            f"[Top] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
967
                                    else:
968
                                        self.desc_labels[self.connectors[index]].setHtml(self.connectors[index].data.desc)
969

  
970
                                    self.desc_labels[self.connectors[index]].setEnabled(True)
971
                                elif 'N3' in nozzles or 'N4' in nozzles or 'N5' in nozzles:
972
                                    if 'N3' in nozzles:
973
                                        index = 2
974
                                    elif 'N4' in nozzles:
975
                                        index = 3
976
                                    elif 'N5' in nozzles:
977
                                        index = 4
978

  
979
                                    if self.connectors[index].data.desc is None:
980
                                        self.desc_labels[self.connectors[index]].setHtml(
981
                                            f"[DP] : {convert_to_fixed_point(self.connectors[index].data.pressure_drop)} {units['Pressure']}<br>"
982
                                            f"[Btm] : {convert_to_fixed_point(self.connectors[index].data.elevation)} {units['Length']}")
983
                                    else:
984
                                        self.desc_labels[self.connectors[index]].setHtml(self.connectors[index].data.desc)
985

  
986
                                    self.desc_labels[self.connectors[index]].setEnabled(True)
987
                elif self.type == 'Strainer':
988
                    if self.tag_no:
989
                        conns = [conn for conn in self.connectors
990
                                 if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
991
                        if conns:
992
                            if conns[0].data.desc is None:
993
                                self.desc_labels[conns[0]].setHtml(
994
                                    f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} {units['Pressure']}<br>"
995
                                    f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1021 996
                            else:
1022
                                self.desc_labels[conn].setHtml(conn.data.desc)
1023

  
1024
                            self.desc_labels[conn].setEnabled(True)
1025
            elif self.type == 'Drum':
1026
                if self.tag_no:
1027
                    for conn in self.connectors:
1028
                        if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1029
                            nozzle = str(conn).rsplit('_', 1)[1]
1030
                            if conn.data.desc is None:
1031
                                self.desc_labels[conn].setHtml(
1032
                                    f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1033
                                    f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
997
                                self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
998

  
999
                            self.desc_labels[conns[0]].setEnabled(True)
1000
            elif self.category == 'Equipment - [ Pressurized ]':
1001
                if self.type == 'Battery Limit':
1002
                    if self.tag_no:
1003
                        conns = [conn for conn in self.connectors
1004
                                 if conn.data and conn.data.pressure is not None and conn.data.elevation is not None]
1005
                        if conns:
1006
                            if conns[0].data.desc is None:
1007
                                self.desc_labels[conns[0]].setHtml(
1008
                                    f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure)} {units['Pressure']}(g)<br>"
1009
                                    f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1034 1010
                            else:
1035
                                self.desc_labels[conn].setHtml(conn.data.desc)
1036

  
1037
                            self.desc_labels[conn].setEnabled(True)
1038
            elif self.type == 'Miscellaneous':
1039
                if self.tag_no:
1040
                    for conn in self.connectors:
1041
                        if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1042
                            nozzle = str(conn).rsplit('_', 1)[1]
1043
                            if conn.data:
1011
                                self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1012

  
1013
                            self.desc_labels[conns[0]].setEnabled(True)
1014
                elif self.type == 'Column':
1015
                    if self.tag_no:
1016
                        for conn in self.connectors:
1017
                            if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1018
                                nozzle = str(conn).rsplit('_', 1)[1]
1044 1019
                                if conn.data.desc is None:
1045 1020
                                    self.desc_labels[conn].setHtml(
1046 1021
                                        f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
......
1049 1024
                                    self.desc_labels[conn].setHtml(conn.data.desc)
1050 1025

  
1051 1026
                                self.desc_labels[conn].setEnabled(True)
1052
            elif self.type == 'Tank':
1053
                if self.tag_no:
1054
                    for conn in self.connectors:
1055
                        if conn.data and conn.connectedItem and \
1056
                                (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1057
                            nozzle = str(conn).rsplit('_', 1)[1]
1058
                            if conn.data.desc is None:
1059
                                self.desc_labels[conn].setHtml(
1060
                                    f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1061
                                    f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
1062
                            else:
1063
                                self.desc_labels[conn].setHtml(conn.data.desc)
1027
                elif self.type == 'Drum':
1028
                    if self.tag_no:
1029
                        for conn in self.connectors:
1030
                            if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1031
                                nozzle = str(conn).rsplit('_', 1)[1]
1032
                                if conn.data.desc is None:
1033
                                    self.desc_labels[conn].setHtml(
1034
                                        f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1035
                                        f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
1036
                                else:
1037
                                    self.desc_labels[conn].setHtml(conn.data.desc)
1064 1038

  
1065
                            self.desc_labels[conn].setEnabled(True)
1066
        elif self.category == 'Equipment - [ Rotating ]':
1067
            if self.type == 'Compressor':
1068
                if self.name in ('L_Comp', 'R_Comp'):
1039
                                self.desc_labels[conn].setEnabled(True)
1040
                elif self.type == 'Miscellaneous':
1069 1041
                    if self.tag_no:
1070 1042
                        for conn in self.connectors:
1071 1043
                            if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1072 1044
                                nozzle = str(conn).rsplit('_', 1)[1]
1045
                                if conn.data:
1046
                                    if conn.data.desc is None:
1047
                                        self.desc_labels[conn].setHtml(
1048
                                            f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1049
                                            f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
1050
                                    else:
1051
                                        self.desc_labels[conn].setHtml(conn.data.desc)
1052

  
1053
                                    self.desc_labels[conn].setEnabled(True)
1054
                elif self.type == 'Tank':
1055
                    if self.tag_no:
1056
                        for conn in self.connectors:
1057
                            if conn.data and conn.connectedItem and \
1058
                                    (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1059
                                nozzle = str(conn).rsplit('_', 1)[1]
1073 1060
                                if conn.data.desc is None:
1074 1061
                                    self.desc_labels[conn].setHtml(
1075 1062
                                        f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
......
1078 1065
                                    self.desc_labels[conn].setHtml(conn.data.desc)
1079 1066

  
1080 1067
                                self.desc_labels[conn].setEnabled(True)
1081
                elif self.name in ('L_Komp', 'R_Komp'):
1068
            elif self.category == 'Equipment - [ Rotating ]':
1069
                if self.type == 'Compressor':
1070
                    if self.name in ('L_Comp', 'R_Comp'):
1071
                        if self.tag_no:
1072
                            for conn in self.connectors:
1073
                                if conn.data and (conn.data.pressure_drop is not None or conn.data.elevation is not None):
1074
                                    nozzle = str(conn).rsplit('_', 1)[1]
1075
                                    if conn.data.desc is None:
1076
                                        self.desc_labels[conn].setHtml(
1077
                                            f"{self.tag_no}_{nozzle}<br>{convert_to_fixed_point(conn.data.pressure)} "
1078
                                            f"{units['Pressure']}(g)<br>{convert_to_fixed_point(conn.data.elevation)} {units['Length']}")
1079
                                    else:
1080
                                        self.desc_labels[conn].setHtml(conn.data.desc)
1081

  
1082
                                    self.desc_labels[conn].setEnabled(True)
1083
                    elif self.name in ('L_Komp', 'R_Komp'):
1084
                        if self.tag_no:
1085
                            conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
1086
                            if conns:
1087
                                if conns[0].data.desc is None:
1088
                                    self.desc_labels[conns[0]].setHtml(
1089
                                        f"{self.tag_no}<br>"
1090
                                        f"{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
1091
                                        f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1092
                                else:
1093
                                    self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1094

  
1095
                                self.desc_labels[conns[0]].setEnabled(True)
1096
                elif self.type == 'Pump':
1082 1097
                    if self.tag_no:
1083 1098
                        conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
1084 1099
                        if conns:
......
1091 1106
                                self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1092 1107

  
1093 1108
                            self.desc_labels[conns[0]].setEnabled(True)
1094
            elif self.type == 'Pump':
1095
                if self.tag_no:
1096
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
1097
                    if conns:
1098
                        if conns[0].data.desc is None:
1099
                            self.desc_labels[conns[0]].setHtml(
1100
                                f"{self.tag_no}<br>"
1101
                                f"{convert_to_fixed_point(conns[0].data.pressure_drop) if conns[0].data.pressure_drop is not None else 0} {units['Pressure']}<br>"
1102
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1103
                        else:
1104
                            self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1105

  
1106
                        self.desc_labels[conns[0]].setEnabled(True)
1107
        elif self.category == 'Instrument':
1108
            if self.type == 'Flowmeter':
1109
                if self.tag_no:
1110
                    data = self.connectors[0].data
1111
                    if data:
1112
                        if self.connectors[0].data.desc is None:
1113
                            self.desc_labels[self.connectors[0]].setHtml(
1114
                                f"{self.tag_no}<br>{convert_to_fixed_point(data.pressure_drop)} "
1115
                                f"{units['Pressure']}<br>{convert_to_fixed_point(data.elevation)} {units['Length']}")
1116
                        else:
1117
                            self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
1109
            elif self.category == 'Instrument':
1110
                if self.type == 'Flowmeter':
1111
                    if self.tag_no:
1112
                        data = self.connectors[0].data
1113
                        if data:
1114
                            if self.connectors[0].data.desc is None:
1115
                                self.desc_labels[self.connectors[0]].setHtml(
1116
                                    f"{self.tag_no}<br>{convert_to_fixed_point(data.pressure_drop)} "
1117
                                    f"{units['Pressure']}<br>{convert_to_fixed_point(data.elevation)} {units['Length']}")
1118
                            else:
1119
                                self.desc_labels[self.connectors[0]].setHtml(self.connectors[0].data.desc)
1118 1120

  
1119
                        self.desc_labels[self.connectors[0]].setEnabled(True)
1120
            elif self.type == 'Line Splitter':
1121
                if self.tag_no:
1122
                    conns = [conn for conn in self.connectors
1123
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
1124
                    if conns:
1125
                        if conns[0].data.desc is None:
1126
                            self.desc_labels[conns[0]].setHtml(
1127
                                f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1128
                                f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1129
                        else:
1130
                            self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1121
                            self.desc_labels[self.connectors[0]].setEnabled(True)
1122
                elif self.type == 'Line Splitter':
1123
                    if self.tag_no:
1124
                        conns = [conn for conn in self.connectors
1125
                                 if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
1126
                        if conns:
1127
                            if conns[0].data.desc is None:
1128
                                self.desc_labels[conns[0]].setHtml(
1129
                                    f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1130
                                    f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1131
                            else:
1132
                                self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1131 1133

  
1132
                        self.desc_labels[conns[0]].setEnabled(True)
1133
            elif self.type == 'Reducer':
1134
                if self.tag_no:
1135
                    conns = [conn for conn in self.connectors
1136
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
1137
                    if conns:
1138
                        if conns[0].data.desc is None:
1139
                            self.desc_labels[conns[0]].setHtml(
1140
                                f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1141
                                f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1142
                        else:
1143
                            self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1134
                            self.desc_labels[conns[0]].setEnabled(True)
1135
                elif self.type == 'Reducer':
1136
                    if self.tag_no:
1137
                        conns = [conn for conn in self.connectors
1138
                                 if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
1139
                        if conns:
1140
                            if conns[0].data.desc is None:
1141
                                self.desc_labels[conns[0]].setHtml(
1142
                                    f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1143
                                    f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1144
                            else:
1145
                                self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1144 1146

  
1145
                        self.desc_labels[conns[0]].setEnabled(True)
1146
            elif self.type == 'Valve':
1147
                if self.tag_no and self.name in ('CV_H', 'CV_V'):
1148
                    conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
1149
                    if conns:
1150
                        if conns[0].data.desc is None:
1151
                            self.desc_labels[conns[0]].setHtml(
1152
                                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>"
1153
                                f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1154
                        else:
1155
                            self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1147
                            self.desc_labels[conns[0]].setEnabled(True)
1148
                elif self.type == 'Valve':
1149
                    if self.tag_no and self.name in ('CV_H', 'CV_V'):
1150
                        conns = [conn for conn in self.connectors if conn.data and conn.data.elevation is not None]
1151
                        if conns:
1152
                            if conns[0].data.desc is None:
1153
                                self.desc_labels[conns[0]].setHtml(
1154
                                    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>"
1155
                                    f"{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1156
                            else:
1157
                                self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1156 1158

  
1157
                        self.desc_labels[conns[0]].setEnabled(True)
1158
                elif self.tag_no and self.name in ('MV_H', 'MV_V'):
1159
                    conns = [conn for conn in self.connectors
1160
                             if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
1161
                    if conns:
1162
                        if conns[0].data.desc is None:
1163
                            self.desc_labels[conns[0]].setHtml(
1164
                                f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1165
                                f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1166
                        else:
1167
                            self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1159
                            self.desc_labels[conns[0]].setEnabled(True)
1160
                    elif self.tag_no and self.name in ('MV_H', 'MV_V'):
1161
                        conns = [conn for conn in self.connectors
1162
                                 if conn.data and conn.data.pressure_drop is not None and conn.data.elevation is not None]
1163
                        if conns:
1164
                            if conns[0].data.desc is None:
1165
                                self.desc_labels[conns[0]].setHtml(
1166
                                    f"{self.tag_no}<br>{convert_to_fixed_point(conns[0].data.pressure_drop)} "
1167
                                    f"{units['Pressure']}<br>{convert_to_fixed_point(conns[0].data.elevation)} {units['Length']}")
1168
                            else:
1169
                                self.desc_labels[conns[0]].setHtml(conns[0].data.desc)
1168 1170

  
1169
                        self.desc_labels[conns[0]].setEnabled(True)
1171
                            self.desc_labels[conns[0]].setEnabled(True)
1170 1172

  
1171
        configs = app_doc_data.getAppConfigs('option', 'TagFontSize')
1172
        font_size = configs[0].value if configs and len(configs) == 1 else '6'
1173
            configs = app_doc_data.getAppConfigs('option', 'TagFontSize')
1174
            font_size = configs[0].value if configs and len(configs) == 1 else '6'
1173 1175

  
1174
        configs = app_doc_data.getAppConfigs('option', 'TagFontColor')
1175
        font_color = configs[0].value if configs and len(configs) == 1 else '#000000'
1176
            configs = app_doc_data.getAppConfigs('option', 'TagFontColor')
1177
            font_color = configs[0].value if configs and len(configs) == 1 else '#000000'
1176 1178

  
1177
        for conn, label in self.desc_labels.items():
1178
            label.set_font_size(font_size)
1179
            label.set_font_color(font_color)
1180
            label.setHtml(label.toPlainText().replace('\n', '<br>'))
1179
            for conn, label in self.desc_labels.items():
1180
                label.set_font_size(font_size)
1181
                label.set_font_color(font_color)
1182
                label.setHtml(label.toPlainText().replace('\n', '<br>'))
1183
        except Exception as ex:
1184
            from App import App
1185
            message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
1186
                      f"{sys.exc_info()[-1].tb_lineno}"
1187
            App.mainWnd().addMessage.emit(MessageType.Error, message)
1181 1188

  
1182 1189
    def rect(self):
1183 1190
        """return bounding box of symbol"""

내보내기 Unified diff

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