개정판 5d22bbb6
fix size validation
Change-Id: I0aef7084b2b7937b10b5f4b90edf3533ad64f7d9
DTI_PID/DTI_PID/BMSettingDialog.py | ||
---|---|---|
36 | 36 |
"3WAY", "4WAY", "ANGLE", "BALL", "BUTTERFLY", "CHECK", "DIAPHRAMVALVE", "GATE", "GLOBE", "NEEDLE", "PLUGVALVE", \ |
37 | 37 |
"CONTROL(ANGLE)", "CONTROL(BALL)", "CONTROL(BUTTERFLY)", "CONTROL(CHECK)", "CONTROL(GATE)", "CONTROL(GLOBE)", "CONTROL(NEEDLE)", "CONTROL(PLUG)", \ |
38 | 38 |
"MOV(ANGLE)", "MOV(BALL)", "MOV(BUTTERFLY)", "MOV(CHECK)", "MOV(GATE)", "MOV(GLOBE)", "MOV(NEEDLE)", "MOV(PLUG)", "MAGNETIC FLOW METER", "MASS FLOW METER", "ULTRASONIC FLOW METER", "VORTEX FLOW METER", "OPC", \ |
39 |
"TRAP", "VENT", "GOOSE NECK VENT", "IP", "PG", "PP", "PSV", "RE", "EXPANSION JOINT", "SAMPLE CONNECTION", "SB", "SPACER", "STRAINER", "CONE STRAINER", "TG", "HOSE CONNECTION", "OD" ] |
|
39 |
"TRAP", "VENT", "GOOSE NECK VENT", "IP", "PG", "PP", "PSV", "RE", "EXPANSION JOINT", "SAMPLE CONNECTION", "SB", "SPACER", "STRAINER", "BUCKET STRAINER", "CONE STRAINER", "TG", "HOSE CONNECTION", "OD" ]
|
|
40 | 40 |
|
41 | 41 |
for symbol in self.SymbolList: |
42 | 42 |
items = [QStandardItem(symbol)] |
DTI_PID/DTI_PID/ImportTextFromCADDialog.py | ||
---|---|---|
282 | 282 |
self.ui.pushButtonImport.clicked.connect(self.on_import_autocad) |
283 | 283 |
self.ui.pushButtonClose.clicked.connect(self.close) |
284 | 284 |
self.ui.pushButtonAuto.clicked.connect(self.autoCalOffset) |
285 |
self.ui.checkBoxAuto.stateChanged.connect(self.autoStateChanged) |
|
286 |
|
|
287 |
def autoStateChanged(self, checkState): |
|
288 |
if checkState is int(Qt.Checked): |
|
289 |
pass |
|
290 |
elif checkState is int(Qt.Unchecked): |
|
291 |
pass |
|
285 | 292 |
|
286 | 293 |
def autoCalOffset(self): |
287 | 294 |
""" auto calculate offset """ |
... | ... | |
829 | 836 |
id2_xml = parse(id2_xml_path) |
830 | 837 |
id2_xml_root = id2_xml.getroot() |
831 | 838 |
|
832 |
id2_bbox = [0, 0, 9600, 6781]#get_contents_size_from_image(id2_image_file) |
|
839 |
#id2_bbox = [0, 0, 9600, 6781]#get_contents_size_from_image(id2_image_file) |
|
840 |
id2_bbox = get_contents_size_from_image(id2_image_file) |
|
833 | 841 |
id2_bbox_text = id2_bbox |
834 | 842 |
|
835 | 843 |
if 'Symbol' in will_be_converted_items: |
... | ... | |
1038 | 1046 |
if self.ui.doubleSpinBox.value() < 1 else self.ui.doubleSpinBox.value() |
1039 | 1047 |
scale_y = max([id2_bbox[2] / autocad_bbox[2], id2_bbox[3] / autocad_bbox[3]]) \ |
1040 | 1048 |
if self.ui.doubleSpinBox_2.value() < 1 else self.ui.doubleSpinBox_2.value() |
1041 |
#offsets = [id2_bbox[0] + self.ui.spinBoxTextX.value() - autocad_bbox[0] * scale_x, |
|
1042 |
# (id2_bbox[1] + id2_bbox[3]) + self.ui.spinBoxTextY.value() - autocad_bbox[1] * scale_y] |
|
1049 |
offsets = [id2_bbox[0] - autocad_bbox[0] * scale_x, (id2_bbox[1] + id2_bbox[3]) - autocad_bbox[1] * scale_y] |
|
1043 | 1050 |
|
1044 |
offsets = [self.ui.spinBoxTextX.value(), (id2_bbox[1] + id2_bbox[3]) + self.ui.spinBoxTextY.value()] |
|
1051 |
#offsets = [self.ui.spinBoxTextX.value(), (id2_bbox[1] + id2_bbox[3]) + self.ui.spinBoxTextY.value()]
|
|
1045 | 1052 |
|
1046 | 1053 |
loc = [float(text_node.attrib['X']) * scale_x + offsets[0], |
1047 | 1054 |
-float(text_node.attrib['Y']) * scale_y + offsets[1]] |
... | ... | |
1059 | 1066 |
angle = angle - math.pi*2 if angle > math.pi*2 else angle |
1060 | 1067 |
|
1061 | 1068 |
_height = round(float(text_node.attrib['Height']) * scale_y) |
1062 |
loc[1] -= _height |
|
1069 |
#loc[1] -= _height
|
|
1063 | 1070 |
_width = round(_height * len(text) * self.text_scale) |
1064 | 1071 |
#_width = round(float(text_node.attrib['Width'])) |
1065 | 1072 |
|
DTI_PID/DTI_PID/ImportTextFromCAD_UI.py | ||
---|---|---|
169 | 169 |
self.gridLayout_3.addWidget(self.treeViewSymbolMapping, 0, 0, 1, 1) |
170 | 170 |
self.tabWidgetEntities.addTab(self.tabSymbols, "") |
171 | 171 |
self.gridLayout.addWidget(self.tabWidgetEntities, 2, 0, 1, 4) |
172 |
self.checkBoxAuto = QtWidgets.QCheckBox(ImportTextFromCADDialog) |
|
173 |
self.checkBoxAuto.setObjectName("checkBoxAuto") |
|
174 |
self.gridLayout.addWidget(self.checkBoxAuto, 9, 3, 1, 1) |
|
172 | 175 |
self.verticalLayout.addLayout(self.gridLayout) |
173 | 176 |
self.errorLabel = QtWidgets.QLabel(ImportTextFromCADDialog) |
174 | 177 |
self.errorLabel.setMaximumSize(QtCore.QSize(16777215, 0)) |
... | ... | |
204 | 207 |
self.label_8.setText(_translate("ImportTextFromCADDialog", "Symbol Offset(x, y) : ")) |
205 | 208 |
self.tabWidgetEntities.setTabText(self.tabWidgetEntities.indexOf(self.tabLineTypes), _translate("ImportTextFromCADDialog", "Line Types")) |
206 | 209 |
self.tabWidgetEntities.setTabText(self.tabWidgetEntities.indexOf(self.tabSymbols), _translate("ImportTextFromCADDialog", "Symbols")) |
210 |
self.checkBoxAuto.setText(_translate("ImportTextFromCADDialog", "Auto Offset, Scale")) |
|
207 | 211 |
|
208 | 212 |
import MainWindow_rc |
209 | 213 |
|
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py | ||
---|---|---|
1013 | 1013 |
if len(sizes) > 1: |
1014 | 1014 |
for index in range(len(sizes) - 1): |
1015 | 1015 |
if sizes[index][2] != sizes[index + 1][1]: |
1016 |
if type(sizes[index][0]) is not QEngineeringReducerItem and type(sizes[index + 1][0]) is not QEngineeringReducerItem: |
|
1016 |
if type(sizes[index][0]) is not QEngineeringReducerItem and type(sizes[index + 1][0]) is not QEngineeringReducerItem \ |
|
1017 |
and (hasattr(sizes[index][0], 'iType') and type(sizes[index][0]).iType != 22) and \ |
|
1018 |
(hasattr(sizes[index][0], 'iType') and type(sizes[index + 1][0]) != 22): |
|
1017 | 1019 |
size_errors.append(sizes[index][0]) |
1018 | 1020 |
size_errors.append(sizes[index + 1][0]) |
1019 | 1021 |
|
DTI_PID/DTI_PID/UI/ImportTextFromCAD.ui | ||
---|---|---|
322 | 322 |
</widget> |
323 | 323 |
</widget> |
324 | 324 |
</item> |
325 |
<item row="9" column="3"> |
|
326 |
<widget class="QCheckBox" name="checkBoxAuto"> |
|
327 |
<property name="text"> |
|
328 |
<string>Auto Offset, Scale</string> |
|
329 |
</property> |
|
330 |
</widget> |
|
331 |
</item> |
|
325 | 332 |
</layout> |
326 | 333 |
</item> |
327 | 334 |
<item> |
내보내기 Unified diff