개정판 baf5afe5
issue #538: add symbol move by using offset
Change-Id: I6f4a3c8564ef302fee3b5ca20bb04d72fc153898
DTI_PID/DTI_PID/RotateSymbolDialog.py | ||
---|---|---|
6 | 6 |
# |
7 | 7 |
# WARNING! All changes made in this file will be lost! |
8 | 8 |
|
9 |
from PyQt5 import QtCore, QtGui, QtWidgets |
|
10 |
from PyQt5.QtWidgets import * |
|
11 | 9 |
import os |
10 |
from PyQt5.QtCore import * |
|
11 |
from PyQt5.QtGui import * |
|
12 |
from PyQt5 import QtWidgets |
|
12 | 13 |
from Project import Project |
13 | 14 |
from AppDocData import AppDocData |
14 | 15 |
import RotateSymbol_UI |
... | ... | |
31 | 32 |
self.ui.doubleSpinBoxY.setValue(self.sy) |
32 | 33 |
self.ui.spinBoxZValue.setValue(self.sz) |
33 | 34 |
|
35 |
self.ui.checkBoxOffset.stateChanged.connect(self.checkBoxChanged) |
|
36 |
self.ui.checkBoxOffset.setChecked(True) |
|
37 |
|
|
38 |
def checkBoxChanged(self, checkState): |
|
39 |
if checkState is int(Qt.Checked): |
|
40 |
self.ui.label_4.setText('Offset_X') |
|
41 |
self.ui.label_2.setText('Offset_Y') |
|
42 |
self.ui.doubleSpinBoxX.setValue(0) |
|
43 |
self.ui.doubleSpinBoxX.setSingleStep(100) |
|
44 |
self.ui.doubleSpinBoxY.setValue(0) |
|
45 |
self.ui.doubleSpinBoxY.setSingleStep(100) |
|
46 |
else: |
|
47 |
self.ui.label_4.setText('Origin_X') |
|
48 |
self.ui.label_2.setText('Origin_Y') |
|
49 |
self.ui.doubleSpinBoxX.setValue(self.sx) |
|
50 |
self.ui.doubleSpinBoxX.setSingleStep(1) |
|
51 |
self.ui.doubleSpinBoxY.setValue(self.sy) |
|
52 |
self.ui.doubleSpinBoxY.setSingleStep(1) |
|
53 |
|
|
34 | 54 |
def showDialog(self): |
35 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint)
|
|
55 |
self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) |
|
36 | 56 |
self.exec_() |
37 | 57 |
return self.isAccepted, self.angle, self.sx, self.sy, self.sz |
38 | 58 |
|
39 | 59 |
def accept(self): |
40 | 60 |
self.degree = self.ui.doubleSpinBox.value() |
41 |
self.sx = self.ui.doubleSpinBoxX.value() |
|
42 |
self.sy = self.ui.doubleSpinBoxY.value() |
|
61 |
self.sx = self.ui.doubleSpinBoxX.value() if not self.ui.checkBoxOffset.isChecked else self.ui.doubleSpinBoxX.value() + self.sx
|
|
62 |
self.sy = self.ui.doubleSpinBoxY.value() if not self.ui.checkBoxOffset.isChecked else self.ui.doubleSpinBoxY.value() + self.sy
|
|
43 | 63 |
self.sz = self.ui.spinBoxZValue.value() |
44 | 64 |
|
45 | 65 |
allowed_error = 0.001 |
DTI_PID/DTI_PID/RotateSymbol_UI.py | ||
---|---|---|
41 | 41 |
self.doubleSpinBox.setObjectName("doubleSpinBox") |
42 | 42 |
self.horizontalLayout.addWidget(self.doubleSpinBox) |
43 | 43 |
self.formLayout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout) |
44 |
self.Origin_X = QtWidgets.QLabel(RotateSymbolDialog)
|
|
45 |
self.Origin_X.setObjectName("Origin_X")
|
|
46 |
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.Origin_X)
|
|
44 |
self.label_4 = QtWidgets.QLabel(RotateSymbolDialog)
|
|
45 |
self.label_4.setObjectName("label_4")
|
|
46 |
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_4)
|
|
47 | 47 |
self.label_2 = QtWidgets.QLabel(RotateSymbolDialog) |
48 | 48 |
self.label_2.setObjectName("label_2") |
49 | 49 |
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_2) |
... | ... | |
73 | 73 |
self.errorLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) |
74 | 74 |
self.errorLabel.setObjectName("errorLabel") |
75 | 75 |
self.verticalLayout.addWidget(self.errorLabel) |
76 |
self.horizontalLayout_2 = QtWidgets.QHBoxLayout() |
|
77 |
self.horizontalLayout_2.setObjectName("horizontalLayout_2") |
|
78 |
self.checkBoxOffset = QtWidgets.QCheckBox(RotateSymbolDialog) |
|
79 |
self.checkBoxOffset.setObjectName("checkBoxOffset") |
|
80 |
self.horizontalLayout_2.addWidget(self.checkBoxOffset) |
|
76 | 81 |
self.buttonBox = QtWidgets.QDialogButtonBox(RotateSymbolDialog) |
77 | 82 |
font = QtGui.QFont() |
78 | 83 |
font.setFamily("맑은 고딕") |
... | ... | |
81 | 86 |
self.buttonBox.setFont(font) |
82 | 87 |
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) |
83 | 88 |
self.buttonBox.setObjectName("buttonBox") |
84 |
self.verticalLayout.addWidget(self.buttonBox) |
|
89 |
self.horizontalLayout_2.addWidget(self.buttonBox) |
|
90 |
self.verticalLayout.addLayout(self.horizontalLayout_2) |
|
85 | 91 |
|
86 | 92 |
self.retranslateUi(RotateSymbolDialog) |
87 | 93 |
self.buttonBox.rejected.connect(RotateSymbolDialog.reject) |
... | ... | |
92 | 98 |
_translate = QtCore.QCoreApplication.translate |
93 | 99 |
RotateSymbolDialog.setWindowTitle(_translate("RotateSymbolDialog", "Symbol Position")) |
94 | 100 |
self.label.setText(_translate("RotateSymbolDialog", "Degree : ")) |
95 |
self.Origin_X.setText(_translate("RotateSymbolDialog", "Origin_X"))
|
|
101 |
self.label_4.setText(_translate("RotateSymbolDialog", "Origin_X"))
|
|
96 | 102 |
self.label_2.setText(_translate("RotateSymbolDialog", "Origin_Y")) |
97 | 103 |
self.label_3.setText(_translate("RotateSymbolDialog", "Z_Value")) |
104 |
self.checkBoxOffset.setText(_translate("RotateSymbolDialog", "Offset")) |
|
98 | 105 |
|
99 | 106 |
|
100 | 107 |
if __name__ == "__main__": |
DTI_PID/DTI_PID/UI/RotateSymbol.ui | ||
---|---|---|
68 | 68 |
</layout> |
69 | 69 |
</item> |
70 | 70 |
<item row="1" column="0"> |
71 |
<widget class="QLabel" name="Origin_X">
|
|
71 |
<widget class="QLabel" name="label_4">
|
|
72 | 72 |
<property name="text"> |
73 | 73 |
<string>Origin_X</string> |
74 | 74 |
</property> |
... | ... | |
140 | 140 |
</widget> |
141 | 141 |
</item> |
142 | 142 |
<item> |
143 |
<widget class="QDialogButtonBox" name="buttonBox"> |
|
144 |
<property name="font"> |
|
145 |
<font> |
|
146 |
<family>맑은 고딕</family> |
|
147 |
<weight>75</weight> |
|
148 |
<bold>true</bold> |
|
149 |
</font> |
|
150 |
</property> |
|
151 |
<property name="standardButtons"> |
|
152 |
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
|
153 |
</property> |
|
154 |
</widget> |
|
143 |
<layout class="QHBoxLayout" name="horizontalLayout_2"> |
|
144 |
<item> |
|
145 |
<widget class="QCheckBox" name="checkBoxOffset"> |
|
146 |
<property name="text"> |
|
147 |
<string>Offset</string> |
|
148 |
</property> |
|
149 |
</widget> |
|
150 |
</item> |
|
151 |
<item> |
|
152 |
<widget class="QDialogButtonBox" name="buttonBox"> |
|
153 |
<property name="font"> |
|
154 |
<font> |
|
155 |
<family>맑은 고딕</family> |
|
156 |
<weight>75</weight> |
|
157 |
<bold>true</bold> |
|
158 |
</font> |
|
159 |
</property> |
|
160 |
<property name="standardButtons"> |
|
161 |
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
|
162 |
</property> |
|
163 |
</widget> |
|
164 |
</item> |
|
165 |
</layout> |
|
155 | 166 |
</item> |
156 | 167 |
</layout> |
157 | 168 |
</widget> |
내보내기 Unified diff