프로젝트

일반

사용자정보

개정판 41236fa4

ID41236fa45d6a7e78e9f5986e8d01077b239a0e74
상위 872c1e5b
하위 25c7ccf2, 9bdacf41

함의성이(가) 약 6년 전에 추가함

issue #000: add change symbol info on drawing

Change-Id: I023de39495c8215d1c7733464f7d2069e0078688

차이점 보기:

DTI_PID/DTI_PID/SymbolEditorDialog.py
58 58
            self.newSym = None
59 59

  
60 60
            self.setWindowTitle('심볼 편집기')
61
            #self.ui.removeTextButton.setHidden(True)
61
            if self.selectedSymbol is None:
62
                self.ui.checkBoxChange.setEnabled(False)
62 63
        except Exception as ex:
63 64
            from App import App
64 65

  
65 66
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
66 67
            App.mainWnd().addMessage.emit(MessageType.Error, message)
67 68

  
69
    def changeSymbolInfo(self):
70
        ''' 
71
            @brief      change base and additional symbol info for already created on drawing
72
            @author     euisung
73
            @date       2019.04.23
74
        '''
75
        from App import App
76
        from SymbolSvgItem import SymbolSvgItem
77

  
78
        mainScene = App.mainWnd().graphicsView
79
        if not mainScene.hasImage():
80
            return
81
        symbols = [item for item in mainScene.items() if issubclass(type(item), SymbolSvgItem) and item.name == self.selectedSymbol.getName()]
82
        newBase = self.ui.baseSymbolComboBox.currentText()
83
        newAddition = self.makeAdditionalSymbolListString()
84
        newType = self.ui.typeComboBox.currentText()
85
        for symbol in symbols:
86
            symbol.type = newType
87
            symbol.parentSymbol = newBase
88
            symbol.childSymbol = newAddition
89

  
90

  
68 91
    ''' 
69 92
        @brief      hilight pressed connector item
70 93
        @author     humkyung
......
466 489
                        #if self.ui.makeFlipCheckBox.isChecked():
467 490
                        #    potrace.convertImageToSvg(imagePath + '_Flip', os.path.join(svgLocation + "/" + fileName + "_Flip.svg"), normalColor=normal_color, hoverColor=hover_color)
468 491
                        self.isAccepted = True
492
                        if self.ui.checkBoxChange.isChecked():
493
                            self.changeSymbolInfo()
469 494
                        QDialog.accept(self)
470 495
                except:
471 496
                    if self.selectedSymbol is None:
DTI_PID/DTI_PID/SymbolEditor_UI.py
424 424
        self.formLayout.setLayout(7, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_2)
425 425
        self.additionalSymbolListWidget = QtWidgets.QListWidget(self.scrollAreaWidgetContents)
426 426
        self.additionalSymbolListWidget.setObjectName("additionalSymbolListWidget")
427
        self.formLayout.setWidget(8, QtWidgets.QFormLayout.FieldRole, self.additionalSymbolListWidget)
427
        self.formLayout.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.additionalSymbolListWidget)
428 428
        self.originalPointLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
429 429
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
430 430
        sizePolicy.setHorizontalStretch(0)
......
437 437
        self.originalPointLabel.setFont(font)
438 438
        self.originalPointLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
439 439
        self.originalPointLabel.setObjectName("originalPointLabel")
440
        self.formLayout.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.originalPointLabel)
440
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.LabelRole, self.originalPointLabel)
441 441
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
442 442
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
443 443
        self.originalPointLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
......
448 448
        self.addOriginalPointButton.setMaximumSize(QtCore.QSize(40, 16777215))
449 449
        self.addOriginalPointButton.setObjectName("addOriginalPointButton")
450 450
        self.horizontalLayout_4.addWidget(self.addOriginalPointButton)
451
        self.formLayout.setLayout(9, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_4)
451
        self.formLayout.setLayout(10, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_4)
452 452
        self.connectionPointLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
453 453
        font = QtGui.QFont()
454 454
        font.setBold(True)
......
456 456
        self.connectionPointLabel.setFont(font)
457 457
        self.connectionPointLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
458 458
        self.connectionPointLabel.setObjectName("connectionPointLabel")
459
        self.formLayout.setWidget(12, QtWidgets.QFormLayout.LabelRole, self.connectionPointLabel)
459
        self.formLayout.setWidget(13, QtWidgets.QFormLayout.LabelRole, self.connectionPointLabel)
460 460
        self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
461 461
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
462 462
        self.connectionPointLineEdit = QtWidgets.QLineEdit(self.scrollAreaWidgetContents)
......
473 473
        self.pushButtonDelConnPt.setMaximumSize(QtCore.QSize(40, 16777215))
474 474
        self.pushButtonDelConnPt.setObjectName("pushButtonDelConnPt")
475 475
        self.horizontalLayout_6.addWidget(self.pushButtonDelConnPt)
476
        self.formLayout.setLayout(12, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_6)
476
        self.formLayout.setLayout(13, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_6)
477
        self.tableWidgetConnList = QtWidgets.QTableWidget(self.scrollAreaWidgetContents)
478
        self.tableWidgetConnList.setObjectName("tableWidgetConnList")
479
        self.tableWidgetConnList.setColumnCount(0)
480
        self.tableWidgetConnList.setRowCount(0)
481
        self.tableWidgetConnList.verticalHeader().setVisible(False)
482
        self.formLayout.setWidget(14, QtWidgets.QFormLayout.FieldRole, self.tableWidgetConnList)
477 483
        self.hasInstrumentLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
478 484
        font = QtGui.QFont()
479 485
        font.setBold(True)
480 486
        font.setWeight(75)
481 487
        self.hasInstrumentLabel.setFont(font)
482 488
        self.hasInstrumentLabel.setObjectName("hasInstrumentLabel")
483
        self.formLayout.setWidget(14, QtWidgets.QFormLayout.LabelRole, self.hasInstrumentLabel)
489
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.LabelRole, self.hasInstrumentLabel)
484 490
        self.hasInstrumentLabelCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
485 491
        self.hasInstrumentLabelCheckBox.setText("")
486 492
        self.hasInstrumentLabelCheckBox.setObjectName("hasInstrumentLabelCheckBox")
487
        self.formLayout.setWidget(14, QtWidgets.QFormLayout.FieldRole, self.hasInstrumentLabelCheckBox)
493
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.FieldRole, self.hasInstrumentLabelCheckBox)
488 494
        self.isExceptDetectLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
489 495
        font = QtGui.QFont()
490 496
        font.setBold(True)
491 497
        font.setWeight(75)
492 498
        self.isExceptDetectLabel.setFont(font)
493 499
        self.isExceptDetectLabel.setObjectName("isExceptDetectLabel")
494
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.LabelRole, self.isExceptDetectLabel)
500
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.LabelRole, self.isExceptDetectLabel)
495 501
        self.isExceptDetectCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
496 502
        self.isExceptDetectCheckBox.setText("")
497 503
        self.isExceptDetectCheckBox.setObjectName("isExceptDetectCheckBox")
498
        self.formLayout.setWidget(15, QtWidgets.QFormLayout.FieldRole, self.isExceptDetectCheckBox)
504
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.FieldRole, self.isExceptDetectCheckBox)
499 505
        self.immediateInsertLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
500 506
        font = QtGui.QFont()
501 507
        font.setBold(True)
502 508
        font.setWeight(75)
503 509
        self.immediateInsertLabel.setFont(font)
504 510
        self.immediateInsertLabel.setObjectName("immediateInsertLabel")
505
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.LabelRole, self.immediateInsertLabel)
511
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.LabelRole, self.immediateInsertLabel)
506 512
        self.immediateInsertCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
507 513
        self.immediateInsertCheckBox.setText("")
508 514
        self.immediateInsertCheckBox.setObjectName("immediateInsertCheckBox")
509
        self.formLayout.setWidget(16, QtWidgets.QFormLayout.FieldRole, self.immediateInsertCheckBox)
510
        self.tableWidgetConnList = QtWidgets.QTableWidget(self.scrollAreaWidgetContents)
511
        self.tableWidgetConnList.setObjectName("tableWidgetConnList")
512
        self.tableWidgetConnList.setColumnCount(0)
513
        self.tableWidgetConnList.setRowCount(0)
514
        self.tableWidgetConnList.verticalHeader().setVisible(False)
515
        self.formLayout.setWidget(13, QtWidgets.QFormLayout.FieldRole, self.tableWidgetConnList)
515
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.FieldRole, self.immediateInsertCheckBox)
516 516
        self.makeFlipLabel = QtWidgets.QLabel(self.scrollAreaWidgetContents)
517 517
        font = QtGui.QFont()
518 518
        font.setBold(True)
519 519
        font.setWeight(75)
520 520
        self.makeFlipLabel.setFont(font)
521 521
        self.makeFlipLabel.setObjectName("makeFlipLabel")
522
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.LabelRole, self.makeFlipLabel)
522
        self.formLayout.setWidget(18, QtWidgets.QFormLayout.LabelRole, self.makeFlipLabel)
523 523
        self.makeFlipCheckBox = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
524 524
        self.makeFlipCheckBox.setText("")
525 525
        self.makeFlipCheckBox.setObjectName("makeFlipCheckBox")
526
        self.formLayout.setWidget(17, QtWidgets.QFormLayout.FieldRole, self.makeFlipCheckBox)
526
        self.formLayout.setWidget(18, QtWidgets.QFormLayout.FieldRole, self.makeFlipCheckBox)
527
        self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
528
        font = QtGui.QFont()
529
        font.setBold(True)
530
        font.setWeight(75)
531
        self.label_3.setFont(font)
532
        self.label_3.setObjectName("label_3")
533
        self.formLayout.setWidget(19, QtWidgets.QFormLayout.LabelRole, self.label_3)
534
        self.checkBoxChange = QtWidgets.QCheckBox(self.scrollAreaWidgetContents)
535
        self.checkBoxChange.setText("")
536
        self.checkBoxChange.setObjectName("checkBoxChange")
537
        self.formLayout.setWidget(19, QtWidgets.QFormLayout.FieldRole, self.checkBoxChange)
538
        self.label_4 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
539
        font = QtGui.QFont()
540
        font.setBold(True)
541
        font.setWeight(75)
542
        self.label_4.setFont(font)
543
        self.label_4.setObjectName("label_4")
544
        self.formLayout.setWidget(20, QtWidgets.QFormLayout.LabelRole, self.label_4)
527 545
        self.gridLayout_4.addLayout(self.formLayout, 0, 0, 1, 1)
528 546
        self.scrollArea.setWidget(self.scrollAreaWidgetContents)
529 547
        self.verticalLayout.addWidget(self.scrollArea)
......
567 585
        self.isExceptDetectLabel.setText(_translate("Dialog", "Exclude"))
568 586
        self.immediateInsertLabel.setText(_translate("Dialog", "Insert Symbol When Create"))
569 587
        self.makeFlipLabel.setText(_translate("Dialog", "Detect Flip"))
588
        self.label_3.setText(_translate("Dialog", "Change Base, Additional"))
589
        self.label_4.setText(_translate("Dialog", "Symbol Info on Drawing"))
570 590

  
571 591
import MainWindow_rc
572 592

  
DTI_PID/DTI_PID/UI/SymbolEditor.ui
921 921
                 </item>
922 922
                </layout>
923 923
               </item>
924
               <item row="8" column="1">
924
               <item row="9" column="1">
925 925
                <widget class="QListWidget" name="additionalSymbolListWidget"/>
926 926
               </item>
927
               <item row="9" column="0">
927
               <item row="10" column="0">
928 928
                <widget class="QLabel" name="originalPointLabel">
929 929
                 <property name="sizePolicy">
930 930
                  <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
......
946 946
                 </property>
947 947
                </widget>
948 948
               </item>
949
               <item row="9" column="1">
949
               <item row="10" column="1">
950 950
                <layout class="QHBoxLayout" name="horizontalLayout_4">
951 951
                 <item>
952 952
                  <widget class="QLineEdit" name="originalPointLineEdit">
......
970 970
                 </item>
971 971
                </layout>
972 972
               </item>
973
               <item row="12" column="0">
973
               <item row="13" column="0">
974 974
                <widget class="QLabel" name="connectionPointLabel">
975 975
                 <property name="font">
976 976
                  <font>
......
986 986
                 </property>
987 987
                </widget>
988 988
               </item>
989
               <item row="12" column="1">
989
               <item row="13" column="1">
990 990
                <layout class="QHBoxLayout" name="horizontalLayout_6">
991 991
                 <item>
992 992
                  <widget class="QLineEdit" name="connectionPointLineEdit">
......
1035 1035
                 </item>
1036 1036
                </layout>
1037 1037
               </item>
1038
               <item row="14" column="0">
1038
               <item row="14" column="1">
1039
                <widget class="QTableWidget" name="tableWidgetConnList">
1040
                 <attribute name="verticalHeaderVisible">
1041
                  <bool>false</bool>
1042
                 </attribute>
1043
                </widget>
1044
               </item>
1045
               <item row="15" column="0">
1039 1046
                <widget class="QLabel" name="hasInstrumentLabel">
1040 1047
                 <property name="font">
1041 1048
                  <font>
......
1048 1055
                 </property>
1049 1056
                </widget>
1050 1057
               </item>
1051
               <item row="14" column="1">
1058
               <item row="15" column="1">
1052 1059
                <widget class="QCheckBox" name="hasInstrumentLabelCheckBox">
1053 1060
                 <property name="text">
1054 1061
                  <string/>
1055 1062
                 </property>
1056 1063
                </widget>
1057 1064
               </item>
1058
               <item row="15" column="0">
1065
               <item row="16" column="0">
1059 1066
                <widget class="QLabel" name="isExceptDetectLabel">
1060 1067
                 <property name="font">
1061 1068
                  <font>
......
1068 1075
                 </property>
1069 1076
                </widget>
1070 1077
               </item>
1071
               <item row="15" column="1">
1078
               <item row="16" column="1">
1072 1079
                <widget class="QCheckBox" name="isExceptDetectCheckBox">
1073 1080
                 <property name="text">
1074 1081
                  <string/>
1075 1082
                 </property>
1076 1083
                </widget>
1077 1084
               </item>
1078
               <item row="16" column="0">
1085
               <item row="17" column="0">
1079 1086
                <widget class="QLabel" name="immediateInsertLabel">
1080 1087
                 <property name="font">
1081 1088
                  <font>
......
1088 1095
                 </property>
1089 1096
                </widget>
1090 1097
               </item>
1091
               <item row="16" column="1">
1098
               <item row="17" column="1">
1092 1099
                <widget class="QCheckBox" name="immediateInsertCheckBox">
1093 1100
                 <property name="text">
1094 1101
                  <string/>
1095 1102
                 </property>
1096 1103
                </widget>
1097 1104
               </item>
1098
               <item row="13" column="1">
1099
                <widget class="QTableWidget" name="tableWidgetConnList">
1100
                 <attribute name="verticalHeaderVisible">
1101
                  <bool>false</bool>
1102
                 </attribute>
1103
                </widget>
1104
               </item>
1105
               <item row="17" column="0">
1105
               <item row="18" column="0">
1106 1106
                <widget class="QLabel" name="makeFlipLabel">
1107 1107
                 <property name="font">
1108 1108
                  <font>
......
1115 1115
                 </property>
1116 1116
                </widget>
1117 1117
               </item>
1118
               <item row="17" column="1">
1118
               <item row="18" column="1">
1119 1119
                <widget class="QCheckBox" name="makeFlipCheckBox">
1120 1120
                 <property name="text">
1121 1121
                  <string/>
1122 1122
                 </property>
1123 1123
                </widget>
1124 1124
               </item>
1125
               <item row="19" column="0">
1126
                <widget class="QLabel" name="label_3">
1127
                 <property name="font">
1128
                  <font>
1129
                   <weight>75</weight>
1130
                   <bold>true</bold>
1131
                  </font>
1132
                 </property>
1133
                 <property name="text">
1134
                  <string>Change Base, Additional</string>
1135
                 </property>
1136
                </widget>
1137
               </item>
1138
               <item row="19" column="1">
1139
                <widget class="QCheckBox" name="checkBoxChange">
1140
                 <property name="text">
1141
                  <string/>
1142
                 </property>
1143
                </widget>
1144
               </item>
1145
               <item row="20" column="0">
1146
                <widget class="QLabel" name="label_4">
1147
                 <property name="font">
1148
                  <font>
1149
                   <weight>75</weight>
1150
                   <bold>true</bold>
1151
                  </font>
1152
                 </property>
1153
                 <property name="text">
1154
                  <string>Symbol Info on Drawing</string>
1155
                 </property>
1156
                </widget>
1157
               </item>
1125 1158
              </layout>
1126 1159
             </item>
1127 1160
            </layout>

내보내기 Unified diff

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