개정판 16cf1212
fixed issue #587: 장치 이름과 설명을 연계한다
Change-Id: Ic16023de3d732ed208741dd8ad66d1756408f390
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
1 | 1 |
# coding: utf-8 |
2 |
""" |
|
3 |
This is document data(SDI) class |
|
4 |
""" |
|
2 |
""" This is document data(SDI) class """ |
|
3 |
|
|
5 | 4 |
import sys |
6 | 5 |
import os |
7 | 6 |
import sqlite3 |
... | ... | |
339 | 338 |
def lineTypeConfigs(self, value): |
340 | 339 |
self._lineTypeConfigs = value |
341 | 340 |
|
341 |
@property |
|
342 |
def drain_size(self): |
|
343 |
""" getter of drain_size """ |
|
344 |
if not hasattr(self, '_drain_size') or not self._drain_size: |
|
345 |
configs = self.getConfigs('Drain Size Rule', 'Size') |
|
346 |
self._drain_size = configs[0].value if configs else '1"' |
|
347 |
|
|
348 |
return self._drain_size |
|
349 |
|
|
350 |
@drain_size.setter |
|
351 |
def drain_size(self, value): |
|
352 |
""" setter of drain_size """ |
|
353 |
self._drain_size = value |
|
354 |
|
|
342 | 355 |
''' |
343 | 356 |
@brief getter of hmb table |
344 | 357 |
@author humkyung |
DTI_PID/DTI_PID/CodeTableDialog.py | ||
---|---|---|
47 | 47 |
tableName = self.replaceText(tableName) |
48 | 48 |
docData = AppDocData.instance() |
49 | 49 |
table = self.findTableWidget(tableName) |
50 |
if table: table.horizontalHeader().setStretchLastSection(True) |
|
50 | 51 |
if tableName == "NominalDiameter": |
51 | 52 |
tableDatas = docData.getNomialPipeSizeData() |
52 | 53 |
else: |
... | ... | |
71 | 72 |
except Exception as ex: |
72 | 73 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
73 | 74 |
|
74 |
|
|
75 | 75 |
''' |
76 | 76 |
@brief Insert row NominalPipeSzie Tablewidget |
77 | 77 |
@author kyouho |
DTI_PID/DTI_PID/Commands/SaveWorkCommand.py | ||
---|---|---|
60 | 60 |
from AppDocData import MessageType |
61 | 61 |
|
62 | 62 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
63 |
self.disconnect.emit(MessageType.Error, message)
|
|
63 |
self.display_message.emit(MessageType.Error, message)
|
|
64 | 64 |
|
65 | 65 |
@staticmethod |
66 | 66 |
def save_to_xml(): |
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
138 | 138 |
self.ui.checkBoxNoteNoSymbolName.setCheckState(Qt.Checked) |
139 | 139 |
configs = docData.getConfigs('Supplied by Tag Rule', 'by Vendor') |
140 | 140 |
self.ui.lineEditByVendor.setText(configs[0].value if configs else 'by Vendor') |
141 |
self.ui.lineEditDrainSize.setText(docData.drain_size) # 2019.05.20 added by humkyung |
|
141 | 142 |
|
142 | 143 |
configs = docData.getConfigs('LineTypes') |
143 | 144 |
|
... | ... | |
318 | 319 |
self.currentIndex = index |
319 | 320 |
|
320 | 321 |
def editLineNoAttributeClicked(self): |
321 |
""" |
|
322 |
edit line no attributes and then update line no attribute combobox if close attribute editor dialog by accept button |
|
323 |
""" |
|
322 |
""" edit line no attributes and then update line no attribute combobox if close attribute editor dialog by accept button """ |
|
324 | 323 |
from SymbolAttrEditorDialog import QSymbolAttrEditorDialog |
325 | 324 |
try: |
326 | 325 |
dlg = QSymbolAttrEditorDialog(self) |
... | ... | |
618 | 617 |
configs.append(Config('Note No Tag Rule', 'Note No Expression', self.ui.lineEditNoteNoExpression.text())) |
619 | 618 |
configs.append(Config('Note No Tag Rule', 'Note No Symbol Name', self.ui.lineEditNoteNoSymbolName.text())) |
620 | 619 |
configs.append(Config('Supplied by Tag Rule', 'by Vendor', self.ui.lineEditByVendor.text())) |
620 |
docData.drain_size = self.ui.lineEditDrainSize.text() |
|
621 |
configs.append(Config('Drain Size Rule', 'Size', docData.drain_size)) |
|
621 | 622 |
configs.append(Config('Text Recognition', 'White Character List', self.ui.lineEditWhiteCharList.text())) |
622 | 623 |
|
623 | 624 |
# Add Line Color Option - 2018.07.06 by kyouho |
DTI_PID/DTI_PID/Configuration_UI.py | ||
---|---|---|
2 | 2 |
|
3 | 3 |
# Form implementation generated from reading ui file './UI/Configuration.ui' |
4 | 4 |
# |
5 |
# Created by: PyQt5 UI code generator 5.11.3
|
|
5 |
# Created by: PyQt5 UI code generator 5.12
|
|
6 | 6 |
# |
7 | 7 |
# WARNING! All changes made in this file will be lost! |
8 | 8 |
|
9 | 9 |
from PyQt5 import QtCore, QtGui, QtWidgets |
10 | 10 |
|
11 |
|
|
11 | 12 |
class Ui_ConfigurationDialog(object): |
12 | 13 |
def setupUi(self, ConfigurationDialog): |
13 | 14 |
ConfigurationDialog.setObjectName("ConfigurationDialog") |
... | ... | |
248 | 249 |
self.tabTagNoRule.setObjectName("tabTagNoRule") |
249 | 250 |
self.gridLayout_7 = QtWidgets.QGridLayout(self.tabTagNoRule) |
250 | 251 |
self.gridLayout_7.setObjectName("gridLayout_7") |
252 |
self.groupBox_8 = QtWidgets.QGroupBox(self.tabTagNoRule) |
|
253 |
self.groupBox_8.setObjectName("groupBox_8") |
|
254 |
self.gridLayout_17 = QtWidgets.QGridLayout(self.groupBox_8) |
|
255 |
self.gridLayout_17.setObjectName("gridLayout_17") |
|
256 |
self.horizontalLayout_23 = QtWidgets.QHBoxLayout() |
|
257 |
self.horizontalLayout_23.setObjectName("horizontalLayout_23") |
|
258 |
self.label_27 = QtWidgets.QLabel(self.groupBox_8) |
|
259 |
self.label_27.setObjectName("label_27") |
|
260 |
self.horizontalLayout_23.addWidget(self.label_27) |
|
261 |
self.lineEdit_2 = QtWidgets.QLineEdit(self.groupBox_8) |
|
262 |
self.lineEdit_2.setObjectName("lineEdit_2") |
|
263 |
self.horizontalLayout_23.addWidget(self.lineEdit_2) |
|
264 |
self.gridLayout_17.addLayout(self.horizontalLayout_23, 1, 0, 1, 1) |
|
265 |
self.gridLayout_7.addWidget(self.groupBox_8, 3, 0, 1, 1) |
|
251 | 266 |
self.groupBox_4 = QtWidgets.QGroupBox(self.tabTagNoRule) |
252 | 267 |
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) |
253 | 268 |
sizePolicy.setHorizontalStretch(0) |
... | ... | |
274 | 289 |
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEditNoteNoExpression) |
275 | 290 |
self.gridLayout_9.addLayout(self.formLayout, 0, 0, 1, 1) |
276 | 291 |
self.gridLayout_7.addWidget(self.groupBox_4, 0, 0, 1, 1) |
277 |
self.groupBox_8 = QtWidgets.QGroupBox(self.tabTagNoRule) |
|
278 |
self.groupBox_8.setObjectName("groupBox_8") |
|
279 |
self.gridLayout_17 = QtWidgets.QGridLayout(self.groupBox_8) |
|
280 |
self.gridLayout_17.setObjectName("gridLayout_17") |
|
281 |
self.horizontalLayout_23 = QtWidgets.QHBoxLayout() |
|
282 |
self.horizontalLayout_23.setObjectName("horizontalLayout_23") |
|
283 |
self.label_27 = QtWidgets.QLabel(self.groupBox_8) |
|
284 |
self.label_27.setObjectName("label_27") |
|
285 |
self.horizontalLayout_23.addWidget(self.label_27) |
|
286 |
self.lineEdit_2 = QtWidgets.QLineEdit(self.groupBox_8) |
|
287 |
self.lineEdit_2.setObjectName("lineEdit_2") |
|
288 |
self.horizontalLayout_23.addWidget(self.lineEdit_2) |
|
289 |
self.gridLayout_17.addLayout(self.horizontalLayout_23, 1, 0, 1, 1) |
|
290 |
self.gridLayout_7.addWidget(self.groupBox_8, 2, 0, 1, 1) |
|
291 | 292 |
self.groupBox_3 = QtWidgets.QGroupBox(self.tabTagNoRule) |
293 |
self.groupBox_3.setMaximumSize(QtCore.QSize(16777215, 100)) |
|
292 | 294 |
self.groupBox_3.setObjectName("groupBox_3") |
293 | 295 |
self.gridLayout_12 = QtWidgets.QGridLayout(self.groupBox_3) |
294 | 296 |
self.gridLayout_12.setObjectName("gridLayout_12") |
295 | 297 |
self.formLayout_3 = QtWidgets.QFormLayout() |
298 |
self.formLayout_3.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) |
|
296 | 299 |
self.formLayout_3.setObjectName("formLayout_3") |
297 | 300 |
self.label_11 = QtWidgets.QLabel(self.groupBox_3) |
298 | 301 |
self.label_11.setObjectName("label_11") |
... | ... | |
302 | 305 |
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEditByVendor) |
303 | 306 |
self.gridLayout_12.addLayout(self.formLayout_3, 0, 0, 1, 1) |
304 | 307 |
self.gridLayout_7.addWidget(self.groupBox_3, 1, 0, 1, 1) |
308 |
self.groupBox_9 = QtWidgets.QGroupBox(self.tabTagNoRule) |
|
309 |
self.groupBox_9.setMaximumSize(QtCore.QSize(16777215, 100)) |
|
310 |
self.groupBox_9.setObjectName("groupBox_9") |
|
311 |
self.gridLayout_13 = QtWidgets.QGridLayout(self.groupBox_9) |
|
312 |
self.gridLayout_13.setObjectName("gridLayout_13") |
|
313 |
self.formLayout_4 = QtWidgets.QFormLayout() |
|
314 |
self.formLayout_4.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) |
|
315 |
self.formLayout_4.setObjectName("formLayout_4") |
|
316 |
self.label_12 = QtWidgets.QLabel(self.groupBox_9) |
|
317 |
self.label_12.setObjectName("label_12") |
|
318 |
self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_12) |
|
319 |
self.lineEditDrainSize = QtWidgets.QLineEdit(self.groupBox_9) |
|
320 |
self.lineEditDrainSize.setObjectName("lineEditDrainSize") |
|
321 |
self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEditDrainSize) |
|
322 |
self.gridLayout_13.addLayout(self.formLayout_4, 0, 0, 1, 1) |
|
323 |
self.gridLayout_7.addWidget(self.groupBox_9, 2, 0, 1, 1) |
|
305 | 324 |
self.tabWidget.addTab(self.tabTagNoRule, "") |
306 | 325 |
self.tabDisplayOption = QtWidgets.QWidget() |
307 | 326 |
self.tabDisplayOption.setObjectName("tabDisplayOption") |
... | ... | |
471 | 490 |
self.groupBoxFilter.setTitle(_translate("ConfigurationDialog", "Filter")) |
472 | 491 |
self.label_10.setText(_translate("ConfigurationDialog", "Minimum Detection Size : ")) |
473 | 492 |
self.tabWidget.setTabText(self.tabWidget.indexOf(self.Recognition), _translate("ConfigurationDialog", "Recognition")) |
493 |
self.groupBox_8.setTitle(_translate("ConfigurationDialog", "Nozzle Name Rule")) |
|
494 |
self.label_27.setText(_translate("ConfigurationDialog", "Nozzle Name : ")) |
|
474 | 495 |
self.groupBox_4.setTitle(_translate("ConfigurationDialog", "Note No Tag Rule")) |
475 | 496 |
self.checkBoxNoteNoSymbolName.setText(_translate("ConfigurationDialog", "Note No Symbol Name : ")) |
476 | 497 |
self.label_8.setText(_translate("ConfigurationDialog", "Note No Expression : ")) |
477 |
self.groupBox_8.setTitle(_translate("ConfigurationDialog", "Nozzle Name Rule")) |
|
478 |
self.label_27.setText(_translate("ConfigurationDialog", "Nozzle Name : ")) |
|
479 | 498 |
self.groupBox_3.setTitle(_translate("ConfigurationDialog", "Supplied by Tag Rule")) |
480 | 499 |
self.label_11.setText(_translate("ConfigurationDialog", "Supplied by Vendor : ")) |
500 |
self.groupBox_9.setTitle(_translate("ConfigurationDialog", "Drain Size")) |
|
501 |
self.label_12.setText(_translate("ConfigurationDialog", "Drain Size : ")) |
|
481 | 502 |
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabTagNoRule), _translate("ConfigurationDialog", "Tag Rule")) |
482 | 503 |
self.groupBox_6.setTitle(_translate("ConfigurationDialog", "Line Style")) |
483 | 504 |
self.groupBox_2.setTitle(_translate("ConfigurationDialog", "Symbol Style")) |
... | ... | |
495 | 516 |
self.radioButtonProperty.setText(_translate("ConfigurationDialog", "Property")) |
496 | 517 |
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabLineColor), _translate("ConfigurationDialog", "Line No Color")) |
497 | 518 |
|
498 |
import MainWindow_rc |
|
499 |
|
|
500 |
if __name__ == "__main__": |
|
501 |
import sys |
|
502 |
app = QtWidgets.QApplication(sys.argv) |
|
503 |
ConfigurationDialog = QtWidgets.QDialog() |
|
504 |
ui = Ui_ConfigurationDialog() |
|
505 |
ui.setupUi(ConfigurationDialog) |
|
506 |
ConfigurationDialog.show() |
|
507 |
sys.exit(app.exec_()) |
|
508 | 519 |
|
520 |
import MainWindow_rc |
DTI_PID/DTI_PID/ItemPropertyTableWidget.py | ||
---|---|---|
361 | 361 |
self.setRowCount(row + len(item.properties)) |
362 | 362 |
|
363 | 363 |
for prop,value in item.properties.items(): |
364 |
""" show freeze state """ |
|
365 |
checkbox = QCustomCheckBox(self, row, 0) |
|
366 |
checkbox.setChecked(prop.Freeze) |
|
367 |
checkbox.stateChanged.connect(checkbox.state_changed) |
|
368 |
self.setCellWidget(row, 0, checkbox) |
|
369 |
|
|
370 |
""" show property name """ |
|
371 |
key_item = QTableWidgetItem(prop.DisplayAttribute if prop.DisplayAttribute else prop.Attribute) |
|
372 |
key_item.setFlags(Qt.ItemIsEnabled) |
|
373 |
key_item.setBackground(Qt.lightGray) |
|
374 |
key_item.setData(Qt.UserRole, prop) |
|
375 |
self.setItem(row, 1, key_item) |
|
376 |
|
|
377 |
""" show icon item """ |
|
378 |
self.show_icon_item(row, 2, prop) |
|
379 |
|
|
380 |
""" show property value """ |
|
381 |
if prop.is_selectable: |
|
382 |
value_item = QTableWidgetItem(str(value.uid) if hasattr(value, 'uid') else value) |
|
383 |
value_item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsSelectable) |
|
384 |
self.setItem(row, 3, value_item) |
|
385 |
else: |
|
386 |
if prop.AttributeType == 'Boolean': |
|
387 |
self.checkbox_cell = QCustomCheckBox(self, row, 3) |
|
388 |
self.checkbox_cell.setChecked(True if value and str(value) == 'True' else False) |
|
389 |
self.checkbox_cell.stateChanged.connect(self.checkbox_cell.state_changed) |
|
390 |
if prop.Attribute == 'Freeze': self.checkbox_cell.stateChanged.connect(item.freeze_item.update_freeze) |
|
391 |
self.setCellWidget(row, 3, self.checkbox_cell) |
|
392 |
else: |
|
393 |
value_item = QTableWidgetItem(value if value else '') |
|
394 |
value_item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsSelectable|Qt.ItemIsEditable) |
|
364 |
try: |
|
365 |
""" show freeze state """ |
|
366 |
checkbox = QCustomCheckBox(self, row, 0) |
|
367 |
checkbox.setChecked(prop.Freeze) |
|
368 |
checkbox.stateChanged.connect(checkbox.state_changed) |
|
369 |
self.setCellWidget(row, 0, checkbox) |
|
370 |
|
|
371 |
""" show property name """ |
|
372 |
key_item = QTableWidgetItem(prop.DisplayAttribute if prop.DisplayAttribute else prop.Attribute) |
|
373 |
key_item.setFlags(Qt.ItemIsEnabled) |
|
374 |
key_item.setBackground(Qt.lightGray) |
|
375 |
key_item.setData(Qt.UserRole, prop) |
|
376 |
self.setItem(row, 1, key_item) |
|
377 |
|
|
378 |
""" show icon item """ |
|
379 |
self.show_icon_item(row, 2, prop) |
|
380 |
|
|
381 |
""" show property value """ |
|
382 |
if prop.is_selectable: |
|
383 |
value_item = QTableWidgetItem(str(value.uid) if hasattr(value, 'uid') else value) |
|
384 |
value_item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsSelectable) |
|
395 | 385 |
self.setItem(row, 3, value_item) |
386 |
else: |
|
387 |
if prop.AttributeType == 'Boolean': |
|
388 |
self.checkbox_cell = QCustomCheckBox(self, row, 3) |
|
389 |
self.checkbox_cell.setChecked(True if value and str(value) == 'True' else False) |
|
390 |
self.checkbox_cell.stateChanged.connect(self.checkbox_cell.state_changed) |
|
391 |
if prop.Attribute == 'Freeze': self.checkbox_cell.stateChanged.connect(item.freeze_item.update_freeze) |
|
392 |
self.setCellWidget(row, 3, self.checkbox_cell) |
|
393 |
else: |
|
394 |
value_item = QTableWidgetItem(value if value else '') |
|
395 |
value_item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsSelectable|Qt.ItemIsEditable) |
|
396 |
self.setItem(row, 3, value_item) |
|
397 |
|
|
398 |
checkbox.state_changed(checkbox.isChecked()) |
|
399 |
|
|
400 |
row = row + 1 |
|
401 |
except Exception as ex: |
|
402 |
from App import App |
|
403 |
|
|
404 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
405 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
396 | 406 |
|
397 |
checkbox.state_changed(checkbox.isChecked()) |
|
398 |
|
|
399 |
row = row + 1 |
|
400 |
|
|
401 | 407 |
def show_item_attributes(self, item): |
402 | 408 |
""" show item's attributes on grid """ |
403 | 409 |
from PyQt5 import QtGui |
... | ... | |
410 | 416 |
self.setRowCount(row + len(attrs)) |
411 | 417 |
|
412 | 418 |
for key,value in attrs.items(): |
413 |
""" show freeze state """ |
|
414 |
checkbox = QCustomCheckBox(self, row, 0) |
|
415 |
checkbox.setChecked(key.Freeze) |
|
416 |
checkbox.stateChanged.connect(checkbox.state_changed) |
|
417 |
self.setCellWidget(row, 0, checkbox) |
|
418 |
|
|
419 |
""" show property name """ |
|
420 |
key_item = QTableWidgetItem(key.DisplayAttribute if key.DisplayAttribute else key.Attribute) |
|
421 |
key_item.setBackground(Qt.lightGray) |
|
422 |
key_item.setData(Qt.UserRole, key) |
|
423 |
self.setItem(row, 1, key_item) |
|
424 |
|
|
425 |
""" show icon item """ |
|
426 |
self.show_icon_item(row, 2, key) |
|
419 |
try: |
|
420 |
""" show freeze state """ |
|
421 |
checkbox = QCustomCheckBox(self, row, 0) |
|
422 |
checkbox.setChecked(key.Freeze) |
|
423 |
checkbox.stateChanged.connect(checkbox.state_changed) |
|
424 |
self.setCellWidget(row, 0, checkbox) |
|
425 |
|
|
426 |
""" show property name """ |
|
427 |
key_item = QTableWidgetItem(key.DisplayAttribute if key.DisplayAttribute else key.Attribute) |
|
428 |
key_item.setBackground(Qt.lightGray) |
|
429 |
key_item.setData(Qt.UserRole, key) |
|
430 |
self.setItem(row, 1, key_item) |
|
431 |
|
|
432 |
""" show icon item """ |
|
433 |
self.show_icon_item(row, 2, key) |
|
434 |
|
|
435 |
value_item = QTableWidgetItem(str(value)) |
|
436 |
value_item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsSelectable|Qt.ItemIsEditable) |
|
437 |
|
|
438 |
if type(item) is QEngineeringSpecBreakItem: |
|
439 |
if key.Attribute == 'UpStream' or key.Attribute == 'DownStream': |
|
440 |
UpDownItem = QTableWidgetItem('{}'.format('None' if value is None else value)) |
|
441 |
icon = QtGui.QIcon() |
|
442 |
icon.addPixmap(QtGui.QPixmap(":/newPrefix/doubleclick.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
443 |
UpDownItem.setIcon(icon) |
|
444 |
self.setItem(row, 3, UpDownItem) |
|
445 |
elif key.AttributeType == 'Spec': |
|
446 |
self.setItem(row, 3, QTableWidgetItem(key.Attribute)) |
|
447 |
else: |
|
448 |
self.setItem(row, 3, value_item) |
|
427 | 449 |
|
428 |
value_item = QTableWidgetItem(str(value)) |
|
429 |
value_item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsSelectable|Qt.ItemIsEditable) |
|
430 |
|
|
431 |
if type(item) is QEngineeringSpecBreakItem: |
|
432 |
if key.Attribute == 'UpStream' or key.Attribute == 'DownStream': |
|
433 |
UpDownItem = QTableWidgetItem('{}'.format('None' if value is None else value)) |
|
434 |
icon = QtGui.QIcon() |
|
435 |
icon.addPixmap(QtGui.QPixmap(":/newPrefix/doubleclick.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
436 |
UpDownItem.setIcon(icon) |
|
437 |
self.setItem(row, 3, UpDownItem) |
|
438 |
elif key.AttributeType == 'Spec': |
|
439 |
self.setItem(row, 3, QTableWidgetItem(key.Attribute)) |
|
440 |
else: |
|
441 |
self.setItem(row, 3, value_item) |
|
450 |
checkbox.state_changed(checkbox.isChecked()) |
|
442 | 451 |
|
443 |
checkbox.state_changed(checkbox.isChecked()) |
|
452 |
row = row + 1 |
|
453 |
except Exception as ex: |
|
454 |
from App import App |
|
444 | 455 |
|
445 |
row = row + 1 |
|
456 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
457 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
446 | 458 |
|
447 | 459 |
def show_item_connectors(self, item): |
448 | 460 |
""" show items' connectors on grid """ |
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
1 | 1 |
# coding: utf-8 |
2 |
""" |
|
3 |
This is line no tracer module |
|
4 |
""" |
|
2 |
""" This is line no tracer module """ |
|
5 | 3 |
|
6 | 4 |
import sys |
7 | 5 |
import math |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
589 | 589 |
def actionSaveCliked(self): |
590 | 590 |
from datetime import datetime |
591 | 591 |
from AppDocData import AppDocData |
592 |
from EngineeringAbstractItem import QEngineeringAbstractItem |
|
592 | 593 |
from SaveWorkCommand import SaveWorkCommand |
593 | 594 |
|
594 | 595 |
try: |
... | ... | |
601 | 602 |
|
602 | 603 |
items = self.graphicsView.scene.items() |
603 | 604 |
for item in items: |
604 |
if type(item) is not QGraphicsPixmapItem:
|
|
605 |
if issubclass(type(item), QEngineeringAbstractItem):
|
|
605 | 606 |
appDocData.allItems.append(item) |
606 | 607 |
if issubclass(type(item), QEngineeringTextItem): |
607 | 608 |
appDocData.texts.append(item) |
DTI_PID/DTI_PID/Scripts/VALVE_DATA_LIST.sql | ||
---|---|---|
1 | 1 |
CREATE TABLE IF NOT EXISTS VALVE_DATA_LIST ( |
2 | 2 |
UID TEXT, |
3 | 3 |
ITEM_NO TEXT, |
4 |
MainSize TEXT, |
|
5 |
SubSize TEXT, |
|
4 | 6 |
PNID_NO TEXT, |
5 | 7 |
CONSTRAINT VALVE_DATA_LIST_PK PRIMARY KEY (UID) |
6 | 8 |
); |
DTI_PID/DTI_PID/Shapes/EngineeringEquipmentItem.py | ||
---|---|---|
1 | 1 |
# coding: utf-8 |
2 |
""" |
|
3 |
This is engineering equipment item module |
|
4 |
""" |
|
2 |
""" This is engineering equipment item module """ |
|
5 | 3 |
|
6 | 4 |
import sys |
7 | 5 |
import os |
... | ... | |
17 | 15 |
from UserInputAttribute import UserInputAttribute |
18 | 16 |
|
19 | 17 |
class QEngineeringEquipmentItem(SymbolSvgItem): |
20 |
""" |
|
21 |
This is engineering equipment item class |
|
22 |
""" |
|
18 |
""" This is engineering equipment item class """ |
|
23 | 19 |
|
24 | 20 |
clicked = pyqtSignal(QGraphicsSvgItem) |
25 | 21 |
ZVALUE = 10 |
26 | 22 |
EQUIP_COLUMN_LIST = None |
27 | 23 |
|
28 |
''' |
|
29 |
''' |
|
30 | 24 |
def __init__(self, path, uid=None, flip=0): |
31 | 25 |
from SymbolAttr import SymbolProp |
32 | 26 |
|
33 | 27 |
SymbolSvgItem.__init__(self, path, uid, flip=flip) |
34 | 28 |
self.setZValue(QEngineeringEquipmentItem.ZVALUE) |
35 | 29 |
|
36 |
self._properties = {SymbolProp(None, 'Desc', 'Text Item', Expression="item.text() if item else ''"):None} |
|
30 |
self._properties = \ |
|
31 |
{ \ |
|
32 |
SymbolProp(None, 'ITEM_NO', 'Tag No', Expression="self.tag_no"):None, |
|
33 |
SymbolProp(None, 'Desc', 'String', Expression="self.desc"):None |
|
34 |
} |
|
37 | 35 |
|
38 | 36 |
if QEngineeringEquipmentItem.EQUIP_COLUMN_LIST is None: |
39 | 37 |
from AppDocData import AppDocData |
... | ... | |
47 | 45 |
|
48 | 46 |
return sorted([x for x in self.associations() if issubclass(type(x), QEngineeringTextItem)], key=lambda attr: attr.loc[1]) |
49 | 47 |
|
48 |
@property |
|
49 |
def tag_no(self): |
|
50 |
""" getter of tag_no """ |
|
51 |
from QEngineeringTagNoTextItem import QEngineeringTagNoTextItem |
|
52 |
|
|
53 |
matches = [assoc for assoc in self.associations() if type(assoc) is QEngineeringTagNoTextItem] |
|
54 |
return matches[0].text() if matches else None |
|
55 |
|
|
56 |
@property |
|
57 |
def desc(self): |
|
58 |
""" getter of desc """ |
|
59 |
from CodeTables import CodeTable |
|
60 |
|
|
61 |
try: |
|
62 |
if self.tag_no: |
|
63 |
matches = [value for value in CodeTable.instance('EqpTagNames').values if value[1] == self.tag_no] |
|
64 |
if matches: return matches[0][2] |
|
65 |
except Exception as ex: |
|
66 |
from App import App |
|
67 |
from AppDocData import MessageType |
|
68 |
|
|
69 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
70 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
71 |
|
|
72 |
return '' |
|
73 |
|
|
50 | 74 |
''' |
51 | 75 |
@brief connect attribute |
52 | 76 |
@author humkyung |
... | ... | |
165 | 189 |
|
166 | 190 |
try: |
167 | 191 |
node = SymbolSvgItem.toXml(self) |
168 |
self.toXmlAsAttribute(node) |
|
169 | 192 |
except Exception as ex: |
170 | 193 |
from App import App |
171 | 194 |
from AppDocData import MessageType |
... | ... | |
177 | 200 |
|
178 | 201 |
return node |
179 | 202 |
|
180 |
''' |
|
181 |
@brief generate xml code for attribute |
|
182 |
@author humkyung |
|
183 |
@date 2018.05.03 |
|
184 |
''' |
|
185 |
def toXmlAsAttribute(self, parentNode): |
|
186 |
for attr in self.texts(): |
|
187 |
parentNode.append(attr.toXml(self, None)) |
|
188 |
|
|
189 | 203 |
def toSql(self): |
190 |
""" |
|
191 |
convert equipment data to sql query |
|
192 |
""" |
|
204 |
""" convert equipment data to sql query """ |
|
193 | 205 |
from AppDocData import AppDocData |
194 | 206 |
res = [] |
195 | 207 |
|
196 | 208 |
appDocData = AppDocData.instance() |
197 | 209 |
|
198 |
cols = ['UID', 'PNID_NO'] |
|
199 |
values = ['?','?'] |
|
200 |
param = [str(self.uid), appDocData.activeDrawing.name] |
|
210 |
cols = ['UID', 'ITEM_NO', 'PNID_NO']
|
|
211 |
values = ['?','?','?']
|
|
212 |
param = [str(self.uid), self.tag_no, appDocData.activeDrawing.name]
|
|
201 | 213 |
|
214 |
""" save attributes to database """ |
|
202 | 215 |
_attrs = self.getAttributes() |
203 |
|
|
204 |
for key in _attrs.keys(): |
|
216 |
for key,value in _attrs.items(): |
|
205 | 217 |
cols.append(key.Attribute) |
206 | 218 |
values.append('?') |
207 |
param.append(_attrs[key])
|
|
219 |
param.append(value)
|
|
208 | 220 |
|
209 | 221 |
sql = 'insert or replace into EQUIPMENT_DATA_LIST({}) values({})'.format(','.join(cols), ','.join(values)) |
210 | 222 |
|
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
161 | 161 |
if item.Size: return item.Size |
162 | 162 |
prev = item |
163 | 163 |
|
164 |
if 'Drain' == matches[0].Type: return "1'" |
|
164 |
if 'Drain' == matches[0].Type: |
|
165 |
from AppDocData import AppDocData |
|
166 |
return AppDocData.instance().drain_size |
|
165 | 167 |
|
166 | 168 |
return self.owner.Size |
167 | 169 |
|
DTI_PID/DTI_PID/Shapes/EngineeringNoteItem.py | ||
---|---|---|
26 | 26 |
''' |
27 | 27 |
@history 2018.04.30 Jeongwoo Signal Parameter Changed (QEngineeringTextItem → QGraphicsItem) |
28 | 28 |
''' |
29 |
#removed = pyqtSignal(QGraphicsItem) |
|
30 | 29 |
|
31 | 30 |
def __init__(self, symbol=None, parent=None): |
32 | 31 |
QEngineeringTextItem.__init__(self, parent) |
... | ... | |
34 | 33 |
self.title = None |
35 | 34 |
self.conetents = None |
36 | 35 |
self._symbol = symbol |
36 |
self.type = 'NOTE' |
|
37 | 37 |
|
38 | 38 |
@property |
39 | 39 |
def symbol(self): |
DTI_PID/DTI_PID/Shapes/EngineeringReducerItem.py | ||
---|---|---|
12 | 12 |
from EngineeringConnectorItem import QEngineeringConnectorItem |
13 | 13 |
|
14 | 14 |
class QEngineeringReducerItem(SymbolSvgItem): |
15 |
""" |
|
16 |
This is reducer class |
|
17 |
""" |
|
15 |
""" This is reducer class """ |
|
18 | 16 |
|
19 | 17 |
ZVALUE = 20 |
20 | 18 |
clicked = pyqtSignal(QGraphicsSvgItem) |
... | ... | |
69 | 67 |
|
70 | 68 |
def connectAttribute(self, attributes, clear=True): |
71 | 69 |
""" connect attribute of reducer """ |
70 |
import math |
|
71 |
from AppDocData import AppDocData,MessageType |
|
72 |
from EngineeringTextItem import QEngineeringTextItem |
|
73 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
|
74 |
from EngineeringInstrumentItem import QEngineeringInstrumentItem |
|
75 |
from EngineeringValveOperCodeTextItem import QEngineeringValveOperCodeTextItem |
|
76 |
|
|
77 |
if clear: |
|
78 |
self.attrs.clear() |
|
79 |
self._associations.clear() |
|
80 |
|
|
81 |
try: |
|
82 |
configs = AppDocData.instance().getConfigs('Size', 'Delimiter') |
|
83 |
delimiter = configs[0].value if configs else 'X' |
|
84 |
|
|
85 |
dist = max(self.sceneBoundingRect().height(), self.sceneBoundingRect().width()) |
|
86 |
center = self.sceneBoundingRect().center() |
|
87 |
|
|
88 |
minDist = None |
|
89 |
selected = None |
|
90 |
for attr in attributes: |
|
91 |
if type(attr) is QEngineeringSizeTextItem and (delimiter in attr.text().upper()): |
|
92 |
dx = attr.center().x() - center.x() |
|
93 |
dy = attr.center().y() - center.y() |
|
94 |
length = math.sqrt(dx*dx + dy*dy) |
|
95 |
if (length < dist*2) and (minDist is None or length < minDist): |
|
96 |
minDist = length |
|
97 |
selected = attr |
|
98 |
elif type(attr) is QEngineeringInstrumentItem: |
|
99 |
if not attr.is_connected: |
|
100 |
dx = attr.center().x() - center.x() |
|
101 |
dy = attr.center().y() - center.y() |
|
102 |
if math.sqrt(dx*dx + dy*dy) < dist*2: |
|
103 |
self.add_assoc_item(attr) |
|
104 |
|
|
105 |
if selected is not None: |
|
106 |
self.add_assoc_item(selected) |
|
72 | 107 |
|
73 |
super(QEngineeringReducerItem, self).connectAttribute(attributes) |
|
108 |
except Exception as ex: |
|
109 |
from App import App |
|
110 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
111 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
74 | 112 |
|
75 | 113 |
def getAttributes(self): |
76 | 114 |
""" get attributes of reducer """ |
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py | ||
---|---|---|
450 | 450 |
attributeValue = node.find('ATTRIBUTEVALUE') |
451 | 451 |
name = node.find('NAME').text |
452 | 452 |
textInfo = TextInfo(value, x, y, width, height, angle) |
453 |
if name == 'TEXT': |
|
453 |
if name == 'TEXT' or name == 'TAG NO':
|
|
454 | 454 |
item = TextItemFactory.instance().createTextItem(textInfo) |
455 | 455 |
if item is not None: |
456 | 456 |
item.loc = (x, y) |
DTI_PID/DTI_PID/Shapes/EngineeringValveOperCodeTextItem.py | ||
---|---|---|
29 | 29 |
def __init__(self, parent=None): |
30 | 30 |
import uuid |
31 | 31 |
|
32 |
QEngineeringTextItem.__init__(self, parent) |
|
32 |
QEngineeringTextItem.__init__(self, parent) |
|
33 |
self.type = 'VALVE OPER CODE' |
DTI_PID/DTI_PID/Shapes/QEngineeringSizeTextItem.py | ||
---|---|---|
24 | 24 |
def __init__(self, parent=None): |
25 | 25 |
import uuid |
26 | 26 |
|
27 |
QEngineeringTextItem.__init__(self, parent) |
|
27 |
QEngineeringTextItem.__init__(self, parent) |
|
28 |
self.type = 'SIZE' |
DTI_PID/DTI_PID/Shapes/QEngineeringTagNoTextItem.py | ||
---|---|---|
1 | 1 |
# coding: utf-8 |
2 |
""" This is engineering tag no text item module """ |
|
3 |
|
|
2 | 4 |
import os.path |
3 | 5 |
import sys |
4 | 6 |
import copy |
... | ... | |
16 | 18 |
from EngineeringPolylineItem import QEngineeringPolylineItem |
17 | 19 |
from GraphicsBoundingBoxItem import QGraphicsBoundingBoxItem |
18 | 20 |
import OcrResultDialog |
19 |
from AppDocData import AppDocData |
|
21 |
from AppDocData import AppDocData,MessageType
|
|
20 | 22 |
from EngineeringTextItem import QEngineeringTextItem |
21 | 23 |
|
22 | 24 |
class QEngineeringTagNoTextItem(QEngineeringTextItem): |
23 |
#removed = pyqtSignal(QGraphicsItem)
|
|
25 |
""" This is engineering tag no text item class """
|
|
24 | 26 |
|
25 | 27 |
def __init__(self, parent=None): |
26 | 28 |
import uuid |
27 | 29 |
|
28 | 30 |
QEngineeringTextItem.__init__(self, parent) |
29 |
|
|
30 |
''' |
|
31 |
@brief generate xml code |
|
32 |
@author humkyung |
|
33 |
@date 2018.05.02 |
|
34 |
''' |
|
35 |
def toXml(self, owner, name='TAG NO'): |
|
36 |
from xml.etree.ElementTree import Element, SubElement, dump, ElementTree |
|
37 |
from EngineeringLineItem import QEngineeringLineItem |
|
38 |
from SymbolSvgItem import SymbolSvgItem |
|
39 |
|
|
40 |
try: |
|
41 |
node = Element('ATTRIBUTE') |
|
42 |
uidNode = Element('UID') |
|
43 |
uidNode.text = str(owner.uid) |
|
44 |
node.append(uidNode) |
|
45 |
|
|
46 |
textNode = Element('NAME') |
|
47 |
textNode.text = 'TAG NO' |
|
48 |
node.append(textNode) |
|
49 |
|
|
50 |
valueNode = Element('VALUE') |
|
51 |
valueNode.text = self.text() |
|
52 |
node.append(valueNode) |
|
53 |
|
|
54 |
anlgeNode = Element('ANGLE') |
|
55 |
anlgeNode.text = str(self.angle) |
|
56 |
node.append(anlgeNode) |
|
57 |
|
|
58 |
rect = self.sceneBoundingRect() |
|
59 |
widthNode = Element('WIDTH') |
|
60 |
widthNode.text = str(rect.width()) |
|
61 |
node.append(widthNode) |
|
62 |
|
|
63 |
heightNode = Element('HEIGHT') |
|
64 |
heightNode.text = str(rect.height()) |
|
65 |
node.append(heightNode) |
|
66 |
|
|
67 |
areaNode = Element('AREA') |
|
68 |
areaNode.text = self.area |
|
69 |
node.append(areaNode) |
|
70 |
except Exception as ex: |
|
71 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
72 |
|
|
73 |
return node |
|
31 |
self.type = 'TAG NO' |
|
74 | 32 |
|
75 | 33 |
def hoverEnterEvent(self, event): |
76 | 34 |
pass |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
123 | 123 |
import uuid |
124 | 124 |
|
125 | 125 |
for prop,value in self._properties.items(): |
126 |
if prop.is_selectable and type(value) is uuid.UUID and self.scene(): |
|
127 |
matches = [x for x in self.scene().items() if hasattr(x, 'uid') and str(x.uid) == str(value)] |
|
128 |
if matches: self._properties[prop] = matches[0] |
|
129 |
|
|
130 |
if prop.Expression: self._properties[prop] = eval(prop.Expression) |
|
131 |
|
|
126 |
try: |
|
127 |
if prop.is_selectable and type(value) is uuid.UUID and self.scene(): |
|
128 |
matches = [x for x in self.scene().items() if hasattr(x, 'uid') and str(x.uid) == str(value)] |
|
129 |
if matches: self._properties[prop] = matches[0] |
|
130 |
|
|
131 |
if prop.Expression: |
|
132 |
item = self._properties[prop] # assign item |
|
133 |
self._properties[prop] = eval(prop.Expression) |
|
134 |
except Exception as ex: |
|
135 |
from App import App |
|
136 |
|
|
137 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
138 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
139 |
|
|
132 | 140 |
return self._properties |
133 | 141 |
|
134 | 142 |
@properties.setter |
... | ... | |
203 | 211 |
if item.Size: return item.Size |
204 | 212 |
prev = item |
205 | 213 |
|
206 |
if 'Drain' == matches[0].Type: return "1'"
|
|
214 |
if 'Drain' == matches[0].Type: return AppDocData.instance().drain_size
|
|
207 | 215 |
|
208 | 216 |
return self.owner.Size |
209 | 217 |
|
DTI_PID/DTI_PID/UI/Configuration.ui | ||
---|---|---|
545 | 545 |
<string>Tag Rule</string> |
546 | 546 |
</attribute> |
547 | 547 |
<layout class="QGridLayout" name="gridLayout_7"> |
548 |
<item row="3" column="0"> |
|
549 |
<widget class="QGroupBox" name="groupBox_8"> |
|
550 |
<property name="title"> |
|
551 |
<string>Nozzle Name Rule</string> |
|
552 |
</property> |
|
553 |
<layout class="QGridLayout" name="gridLayout_17"> |
|
554 |
<item row="1" column="0"> |
|
555 |
<layout class="QHBoxLayout" name="horizontalLayout_23"> |
|
556 |
<item> |
|
557 |
<widget class="QLabel" name="label_27"> |
|
558 |
<property name="text"> |
|
559 |
<string>Nozzle Name : </string> |
|
560 |
</property> |
|
561 |
</widget> |
|
562 |
</item> |
|
563 |
<item> |
|
564 |
<widget class="QLineEdit" name="lineEdit_2"/> |
|
565 |
</item> |
|
566 |
</layout> |
|
567 |
</item> |
|
568 |
</layout> |
|
569 |
</widget> |
|
570 |
</item> |
|
548 | 571 |
<item row="0" column="0"> |
549 | 572 |
<widget class="QGroupBox" name="groupBox_4"> |
550 | 573 |
<property name="sizePolicy"> |
... | ... | |
590 | 613 |
</layout> |
591 | 614 |
</widget> |
592 | 615 |
</item> |
593 |
<item row="2" column="0"> |
|
594 |
<widget class="QGroupBox" name="groupBox_8"> |
|
616 |
<item row="1" column="0"> |
|
617 |
<widget class="QGroupBox" name="groupBox_3"> |
|
618 |
<property name="maximumSize"> |
|
619 |
<size> |
|
620 |
<width>16777215</width> |
|
621 |
<height>100</height> |
|
622 |
</size> |
|
623 |
</property> |
|
595 | 624 |
<property name="title"> |
596 |
<string>Nozzle Name Rule</string>
|
|
625 |
<string>Supplied by Tag Rule</string>
|
|
597 | 626 |
</property> |
598 |
<layout class="QGridLayout" name="gridLayout_17"> |
|
599 |
<item row="1" column="0"> |
|
600 |
<layout class="QHBoxLayout" name="horizontalLayout_23"> |
|
601 |
<item> |
|
602 |
<widget class="QLabel" name="label_27"> |
|
627 |
<layout class="QGridLayout" name="gridLayout_12"> |
|
628 |
<item row="0" column="0"> |
|
629 |
<layout class="QFormLayout" name="formLayout_3"> |
|
630 |
<property name="formAlignment"> |
|
631 |
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> |
|
632 |
</property> |
|
633 |
<item row="0" column="0"> |
|
634 |
<widget class="QLabel" name="label_11"> |
|
603 | 635 |
<property name="text"> |
604 |
<string>Nozzle Name : </string>
|
|
636 |
<string>Supplied by Vendor : </string>
|
|
605 | 637 |
</property> |
606 | 638 |
</widget> |
607 | 639 |
</item> |
608 |
<item> |
|
609 |
<widget class="QLineEdit" name="lineEdit_2"/>
|
|
640 |
<item row="0" column="1">
|
|
641 |
<widget class="QLineEdit" name="lineEditByVendor"/>
|
|
610 | 642 |
</item> |
611 | 643 |
</layout> |
612 | 644 |
</item> |
613 | 645 |
</layout> |
614 | 646 |
</widget> |
615 | 647 |
</item> |
616 |
<item row="1" column="0"> |
|
617 |
<widget class="QGroupBox" name="groupBox_3"> |
|
648 |
<item row="2" column="0"> |
|
649 |
<widget class="QGroupBox" name="groupBox_9"> |
|
650 |
<property name="maximumSize"> |
|
651 |
<size> |
|
652 |
<width>16777215</width> |
|
653 |
<height>100</height> |
|
654 |
</size> |
|
655 |
</property> |
|
618 | 656 |
<property name="title"> |
619 |
<string>Supplied by Tag Rule</string>
|
|
657 |
<string>Drain Size</string>
|
|
620 | 658 |
</property> |
621 |
<layout class="QGridLayout" name="gridLayout_12">
|
|
659 |
<layout class="QGridLayout" name="gridLayout_13">
|
|
622 | 660 |
<item row="0" column="0"> |
623 |
<layout class="QFormLayout" name="formLayout_3"> |
|
661 |
<layout class="QFormLayout" name="formLayout_4"> |
|
662 |
<property name="formAlignment"> |
|
663 |
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> |
|
664 |
</property> |
|
624 | 665 |
<item row="0" column="0"> |
625 |
<widget class="QLabel" name="label_11">
|
|
666 |
<widget class="QLabel" name="label_12">
|
|
626 | 667 |
<property name="text"> |
627 |
<string>Supplied by Vendor : </string>
|
|
668 |
<string>Drain Size : </string>
|
|
628 | 669 |
</property> |
629 | 670 |
</widget> |
630 | 671 |
</item> |
631 | 672 |
<item row="0" column="1"> |
632 |
<widget class="QLineEdit" name="lineEditByVendor"/> |
|
673 |
<widget class="QLineEdit" name="lineEditDrainSize"> |
|
674 |
<property name="text"> |
|
675 |
<string/> |
|
676 |
</property> |
|
677 |
</widget> |
|
633 | 678 |
</item> |
634 | 679 |
</layout> |
635 | 680 |
</item> |
DTI_PID/DTI_PID/XmlGenerator.py | ||
---|---|---|
372 | 372 |
from EngineeringUnknownItem import QEngineeringUnknownItem |
373 | 373 |
from QEngineeringTrimLineNoTextItem import QEngineeringTrimLineNoTextItem |
374 | 374 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
375 |
from QEngineeringTagNoTextItem import QEngineeringTagNoTextItem |
|
375 | 376 |
from EngineeringValveOperCodeTextItem import QEngineeringValveOperCodeTextItem |
376 | 377 |
from SymbolSvgItem import SymbolSvgItem |
377 | 378 |
from EngineeringVendorItem import QEngineeringVendorItem |
... | ... | |
394 | 395 |
lineNoListNode = Element(LINE_NOS_NODE_NAME) |
395 | 396 |
unknownListNode = Element(UNKNOWNS_NODE_NAME) |
396 | 397 |
vendorListNode = Element(VENDOR_NODE_NAME) |
397 |
#endBreakListNode = Element(END_BREAK) |
|
398 | 398 |
|
399 | 399 |
node_dictionary = {SymbolSvgItem:symbolListNode, QEngineeringTextItem:textInfoListNode, QEngineeringNoteItem:noteTextInfoListNode, |
400 | 400 |
QEngineeringLineItem:lineListNode, QEngineeringLineNoTextItem:lineNoListNode, QEngineeringUnknownItem:unknownListNode, |
401 |
QEngineeringSizeTextItem:textInfoListNode, QEngineeringValveOperCodeTextItem:textInfoListNode, QEngineeringVendorItem:vendorListNode}
|
|
402 |
#QEngineeringEndBreakItem:endBreakListNode}
|
|
401 |
QEngineeringSizeTextItem:textInfoListNode, QEngineeringValveOperCodeTextItem:textInfoListNode, QEngineeringTagNoTextItem:textInfoListNode,
|
|
402 |
QEngineeringVendorItem:vendorListNode}
|
|
403 | 403 |
|
404 | 404 |
# trim line 추가 |
405 | 405 |
trimLineNoListNode = Element(TRIM_LINE_NOS_NODE_NAME) |
... | ... | |
420 | 420 |
node = item.toXml(name='SIZE') |
421 | 421 |
elif type(item) is QEngineeringValveOperCodeTextItem: |
422 | 422 |
node = item.toXml(name='VALVE OPER CODE') |
423 |
elif type(item) is QEngineeringTagNoTextItem: |
|
424 |
node = item.toXml(name='TAG NO') |
|
423 | 425 |
elif issubclass(type(item), QEngineeringAbstractItem) and type(item) is not QGraphicsBoundingBoxItem and type(item) is not QEngineeringErrorItem: |
424 | 426 |
node = item.toXml() |
425 | 427 |
else: |
... | ... | |
458 | 460 |
xml.append(unknownListNode) |
459 | 461 |
xml.append(trimLineNoListNode) |
460 | 462 |
xml.append(vendorListNode) |
461 |
#xml.append(endBreakListNode) |
|
462 | 463 |
ElementTree(xml).write(path) |
463 | 464 |
except Exception as ex: |
464 | 465 |
from App import App |
내보내기 Unified diff