개정판 e883edfd
issue #000:
- add prefix and suffix of Note No
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
1 | 1 |
# coding: utf-8 |
2 |
""" |
|
3 |
This is Configuratio dialog module |
|
4 |
""" |
|
5 |
|
|
2 | 6 |
import os |
3 | 7 |
import sys |
4 | 8 |
from PyQt5.QtCore import * |
... | ... | |
15 | 19 |
super(ListView, self).__init__(*args, **kwargs) |
16 | 20 |
|
17 | 21 |
class QConfigurationDialog(QDialog): |
18 |
'''
|
|
22 |
"""
|
|
19 | 23 |
@history humkyung 2018.05.05 read configuration for instrument and opc tag no rule |
20 | 24 |
humkyung 2018.05.09 read line no tag rule configuration |
21 | 25 |
Jeongwoo 2018.05.18 read Small Line Minimum Length |
... | ... | |
24 | 28 |
humkyung 2018.06.20 add expand,shrink and merge size for recognizing text |
25 | 29 |
humkyung 2018.06.29 add line type table |
26 | 30 |
kyouho 2018.07.04 add self.delimiter = '"' |
27 |
'''
|
|
31 |
"""
|
|
28 | 32 |
def __init__(self, parent): |
29 | 33 |
QDialog.__init__(self, parent) |
30 | 34 |
|
... | ... | |
109 | 113 |
self.tempLineNoAttributeUID.append(value) |
110 | 114 |
self.ui.listViewProperties.setModel(self.itemModel) |
111 | 115 |
|
112 |
configs = docData.getConfigs('Line No Tag Rule', 'Tag Seq No') |
|
113 |
self.ui.lineEditLineNoTagSeqNo.setText(configs[0].value if configs else '') |
|
116 |
configs = docData.getConfigs('Note No Tag Rule', 'Note No Prefix') |
|
117 |
self.ui.lineEditNoteNoPrefix.setText(configs[0].value if configs else '') |
|
118 |
configs = docData.getConfigs('Note No Tag Rule', 'Note No Suffix') |
|
119 |
self.ui.lineEditNoteNoSuffix.setText(configs[0].value if configs else '') |
|
114 | 120 |
|
115 | 121 |
configs = docData.getConfigs('Instrument Tag No Rule', 'Measured Variable Code') |
116 | 122 |
self.ui.lineEditMeasuredVariableCode.setText(configs[0].value if configs else '') |
... | ... | |
467 | 473 |
configs.append(Config('Small Line Minimum Length', 'Min Length', self.ui.smallLineMinLengthSpinBox.value())) |
468 | 474 |
configs.append(Config('Line No', 'Size Unit', 'Metric' if self.ui.radioButtonMetric.isChecked() else 'Inch')) |
469 | 475 |
configs.append(Config('Line No', 'Delimiter', self.ui.lineEdit.text())) |
470 |
configs.append(Config('Line No Tag Rule', 'Tag Seq No', self.ui.lineEditLineNoTagSeqNo.text())) |
|
476 |
configs.append(Config('Note No Tag Rule', 'Note No Prefix', self.ui.lineEditNoteNoPrefix.text())) |
|
477 |
configs.append(Config('Note No Tag Rule', 'Note No Suffix', self.ui.lineEditNoteNoSuffix.text())) |
|
471 | 478 |
configs.append(Config('Instrument Tag No Rule', 'Measured Variable Code', self.ui.lineEditMeasuredVariableCode.text())) |
472 | 479 |
configs.append(Config('Instrument Tag No Rule', 'Type Modifier', self.ui.lineEditTypeModifier.text())) |
473 | 480 |
configs.append(Config('Instrument Tag No Rule', 'Tag Seq No', self.ui.lineEditTagSeqNo.text())) |
... | ... | |
524 | 531 |
|
525 | 532 |
QDialog.accept(self) |
526 | 533 |
|
527 |
|
|
528 | 534 |
''' |
529 | 535 |
@brief deleted selected item |
530 | 536 |
@author humkyung |
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.10.1
|
|
5 |
# Created by: PyQt5 UI code generator 5.11.3
|
|
6 | 6 |
# |
7 | 7 |
# WARNING! All changes made in this file will be lost! |
8 | 8 |
|
... | ... | |
11 | 11 |
class Ui_ConfigurationDialog(object): |
12 | 12 |
def setupUi(self, ConfigurationDialog): |
13 | 13 |
ConfigurationDialog.setObjectName("ConfigurationDialog") |
14 |
ConfigurationDialog.resize(553, 572)
|
|
14 |
ConfigurationDialog.resize(553, 573)
|
|
15 | 15 |
font = QtGui.QFont() |
16 | 16 |
font.setFamily("맑은 고딕") |
17 | 17 |
ConfigurationDialog.setFont(font) |
... | ... | |
292 | 292 |
self.groupBox_4.setObjectName("groupBox_4") |
293 | 293 |
self.gridLayout_12 = QtWidgets.QGridLayout(self.groupBox_4) |
294 | 294 |
self.gridLayout_12.setObjectName("gridLayout_12") |
295 |
self.horizontalLayout_11 = QtWidgets.QHBoxLayout() |
|
296 |
self.horizontalLayout_11.setObjectName("horizontalLayout_11") |
|
295 |
self.gridLayout_20 = QtWidgets.QGridLayout() |
|
296 |
self.gridLayout_20.setObjectName("gridLayout_20") |
|
297 |
self.lineEditNoteNoSuffix = QtWidgets.QLineEdit(self.groupBox_4) |
|
298 |
self.lineEditNoteNoSuffix.setObjectName("lineEditNoteNoSuffix") |
|
299 |
self.gridLayout_20.addWidget(self.lineEditNoteNoSuffix, 1, 1, 1, 1) |
|
300 |
self.label_23 = QtWidgets.QLabel(self.groupBox_4) |
|
301 |
self.label_23.setObjectName("label_23") |
|
302 |
self.gridLayout_20.addWidget(self.label_23, 1, 0, 1, 1) |
|
297 | 303 |
self.label_15 = QtWidgets.QLabel(self.groupBox_4) |
298 | 304 |
self.label_15.setObjectName("label_15") |
299 |
self.horizontalLayout_11.addWidget(self.label_15) |
|
300 |
self.gridLayout_13 = QtWidgets.QGridLayout() |
|
301 |
self.gridLayout_13.setObjectName("gridLayout_13") |
|
302 |
self.lineEditLineNoTagSeqNo = QtWidgets.QLineEdit(self.groupBox_4) |
|
303 |
self.lineEditLineNoTagSeqNo.setObjectName("lineEditLineNoTagSeqNo") |
|
304 |
self.gridLayout_13.addWidget(self.lineEditLineNoTagSeqNo, 0, 0, 1, 1) |
|
305 |
self.horizontalLayout_11.addLayout(self.gridLayout_13) |
|
306 |
self.gridLayout_12.addLayout(self.horizontalLayout_11, 0, 0, 1, 1) |
|
305 |
self.gridLayout_20.addWidget(self.label_15, 0, 0, 1, 1) |
|
306 |
self.lineEditNoteNoPrefix = QtWidgets.QLineEdit(self.groupBox_4) |
|
307 |
self.lineEditNoteNoPrefix.setObjectName("lineEditNoteNoPrefix") |
|
308 |
self.gridLayout_20.addWidget(self.lineEditNoteNoPrefix, 0, 1, 1, 1) |
|
309 |
self.gridLayout_12.addLayout(self.gridLayout_20, 1, 0, 1, 1) |
|
307 | 310 |
self.gridLayout_7.addWidget(self.groupBox_4, 0, 0, 1, 1) |
308 | 311 |
self.groupBox_2 = QtWidgets.QGroupBox(self.tabTagNoRule) |
309 | 312 |
self.groupBox_2.setObjectName("groupBox_2") |
... | ... | |
468 | 471 |
self.buttonBox.accepted.connect(ConfigurationDialog.accept) |
469 | 472 |
self.buttonBox.rejected.connect(ConfigurationDialog.reject) |
470 | 473 |
QtCore.QMetaObject.connectSlotsByName(ConfigurationDialog) |
474 |
ConfigurationDialog.setTabOrder(self.textAreaTypeARadioButton, self.textAreaTypeBRadioButton) |
|
475 |
ConfigurationDialog.setTabOrder(self.textAreaTypeBRadioButton, self.spinBoxExpandSize) |
|
476 |
ConfigurationDialog.setTabOrder(self.spinBoxExpandSize, self.spinBoxShrinkSize) |
|
477 |
ConfigurationDialog.setTabOrder(self.spinBoxShrinkSize, self.minTextSizeSpinBox) |
|
478 |
ConfigurationDialog.setTabOrder(self.minTextSizeSpinBox, self.maxTextSizeSpinBox) |
|
479 |
ConfigurationDialog.setTabOrder(self.maxTextSizeSpinBox, self.spinBoxMergeSize) |
|
480 |
ConfigurationDialog.setTabOrder(self.spinBoxMergeSize, self.lineEditSizeDelimiter) |
|
471 | 481 |
ConfigurationDialog.setTabOrder(self.lineEditSizeDelimiter, self.spinBoxMinArea) |
472 | 482 |
ConfigurationDialog.setTabOrder(self.spinBoxMinArea, self.spinBoxMaxArea) |
473 | 483 |
ConfigurationDialog.setTabOrder(self.spinBoxMaxArea, self.spinBoxWidth) |
474 | 484 |
ConfigurationDialog.setTabOrder(self.spinBoxWidth, self.spinBoxHeight) |
475 |
ConfigurationDialog.setTabOrder(self.spinBoxHeight, self.radioButtonMetric) |
|
485 |
ConfigurationDialog.setTabOrder(self.spinBoxHeight, self.smallLineMinLengthSpinBox) |
|
486 |
ConfigurationDialog.setTabOrder(self.smallLineMinLengthSpinBox, self.radioButtonMetric) |
|
476 | 487 |
ConfigurationDialog.setTabOrder(self.radioButtonMetric, self.radioButtonInch) |
477 |
ConfigurationDialog.setTabOrder(self.radioButtonInch, self.comboBoxProperties) |
|
488 |
ConfigurationDialog.setTabOrder(self.radioButtonInch, self.lineEdit) |
|
489 |
ConfigurationDialog.setTabOrder(self.lineEdit, self.pushButtonAddDelimiter) |
|
490 |
ConfigurationDialog.setTabOrder(self.pushButtonAddDelimiter, self.pushButtonLineNoAttribute) |
|
491 |
ConfigurationDialog.setTabOrder(self.pushButtonLineNoAttribute, self.comboBoxProperties) |
|
478 | 492 |
ConfigurationDialog.setTabOrder(self.comboBoxProperties, self.pushButtonAddProperty) |
479 |
ConfigurationDialog.setTabOrder(self.pushButtonAddProperty, self.lineEditMeasuredVariableCode) |
|
493 |
ConfigurationDialog.setTabOrder(self.pushButtonAddProperty, self.lineEditNoteNoPrefix) |
|
494 |
ConfigurationDialog.setTabOrder(self.lineEditNoteNoPrefix, self.lineEditNoteNoSuffix) |
|
495 |
ConfigurationDialog.setTabOrder(self.lineEditNoteNoSuffix, self.lineEdit_2) |
|
496 |
ConfigurationDialog.setTabOrder(self.lineEdit_2, self.lineEditMeasuredVariableCode) |
|
480 | 497 |
ConfigurationDialog.setTabOrder(self.lineEditMeasuredVariableCode, self.lineEditTypeModifier) |
481 | 498 |
ConfigurationDialog.setTabOrder(self.lineEditTypeModifier, self.lineEditTagSeqNo) |
482 | 499 |
ConfigurationDialog.setTabOrder(self.lineEditTagSeqNo, self.lineEditTagSuffix) |
483 | 500 |
ConfigurationDialog.setTabOrder(self.lineEditTagSuffix, self.lineEditDescription) |
484 | 501 |
ConfigurationDialog.setTabOrder(self.lineEditDescription, self.lineEditOPCTag) |
485 |
ConfigurationDialog.setTabOrder(self.lineEditOPCTag, self.tabWidget) |
|
502 |
ConfigurationDialog.setTabOrder(self.lineEditOPCTag, self.tableWidgetLineTypes) |
|
503 |
ConfigurationDialog.setTabOrder(self.tableWidgetLineTypes, self.fontComboBox) |
|
504 |
ConfigurationDialog.setTabOrder(self.fontComboBox, self.radioButtonAutoSize) |
|
505 |
ConfigurationDialog.setTabOrder(self.radioButtonAutoSize, self.radioButtonFixedSize) |
|
506 |
ConfigurationDialog.setTabOrder(self.radioButtonFixedSize, self.spinBoxFontSize) |
|
507 |
ConfigurationDialog.setTabOrder(self.spinBoxFontSize, self.radioButtonRandom) |
|
508 |
ConfigurationDialog.setTabOrder(self.radioButtonRandom, self.radioButtonProperty) |
|
509 |
ConfigurationDialog.setTabOrder(self.radioButtonProperty, self.comboBoxColorOption) |
|
510 |
ConfigurationDialog.setTabOrder(self.comboBoxColorOption, self.tableWidgetColorProperty) |
|
511 |
ConfigurationDialog.setTabOrder(self.tableWidgetColorProperty, self.tabWidget) |
|
486 | 512 |
|
487 | 513 |
def retranslateUi(self, ConfigurationDialog): |
488 | 514 |
_translate = QtCore.QCoreApplication.translate |
... | ... | |
516 | 542 |
self.groupBox_3.setTitle(_translate("ConfigurationDialog", "OPC Tag No Rule")) |
517 | 543 |
self.label_13.setText(_translate("ConfigurationDialog", "Description")) |
518 | 544 |
self.label_14.setText(_translate("ConfigurationDialog", "OPC Tag")) |
519 |
self.groupBox_4.setTitle(_translate("ConfigurationDialog", "Line No Tag Rule")) |
|
520 |
self.label_15.setText(_translate("ConfigurationDialog", "Tag Seq No")) |
|
545 |
self.groupBox_4.setTitle(_translate("ConfigurationDialog", "Note No Tag Rule")) |
|
546 |
self.label_23.setText(_translate("ConfigurationDialog", "Note No Suffix")) |
|
547 |
self.label_15.setText(_translate("ConfigurationDialog", "Note No Prefix")) |
|
521 | 548 |
self.groupBox_2.setTitle(_translate("ConfigurationDialog", "Instrument Tag No Rule")) |
522 | 549 |
self.label_8.setText(_translate("ConfigurationDialog", "Measured Variable Code")) |
523 | 550 |
self.label_9.setText(_translate("ConfigurationDialog", "Type Modifier")) |
DTI_PID/DTI_PID/TextItemFactory.py | ||
---|---|---|
1 |
""" |
|
2 |
This is TextItemFactor module |
|
3 |
""" |
|
4 |
|
|
1 | 5 |
from SingletonInstance import SingletonInstane |
2 | 6 |
import re |
3 | 7 |
try: |
... | ... | |
20 | 24 |
from QEngineeringTagNoTextItem import QEngineeringTagNoTextItem |
21 | 25 |
|
22 | 26 |
class TextItemFactory(SingletonInstane): |
27 |
""" |
|
28 |
This is TextItemFactor class |
|
29 |
""" |
|
23 | 30 |
def __init__(self): |
24 | 31 |
self.delimiter = '"' |
25 | 32 |
|
... | ... | |
88 | 95 |
data = configs[0].value |
89 | 96 |
rgb = data.split(',') |
90 | 97 |
item.setColor(QColor(int(rgb[0]), int(rgb[1]), int(rgb[2])).name()) |
91 |
|
|
92 |
|
|
93 | 98 |
# up to here |
94 | 99 |
elif self.isSizeText(text, sizeDelimiter): |
95 | 100 |
item = QEngineeringSizeTextItem() |
... | ... | |
299 | 304 |
@history 2018.05.16 Jeongwoo Modify Validator flag |
300 | 305 |
''' |
301 | 306 |
def isNoteNoText(self, text): |
302 |
if QRegExpValidator(QRegExp("NOTE\s\d+")).validate(text, 0)[0] == QValidator.Acceptable : |
|
307 |
appDocData = AppDocData.instance() |
|
308 |
configs = appDocData.getConfigs('Note No Tag Rule', 'Note No Prefix') |
|
309 |
prefix = configs[0].value if 1 == len(configs) else '' |
|
310 |
configs = appDocData.getConfigs('Note No Tag Rule', 'Note No Suffix') |
|
311 |
suffix = configs[0].value if 1 == len(configs) else '' |
|
312 |
|
|
313 |
if QRegExpValidator(QRegExp('^{}NOTE\s\d+{}$'.format(prefix, suffix))).validate(text, 0)[0] == QValidator.Acceptable : |
|
303 | 314 |
return True |
304 | 315 |
else: |
305 | 316 |
return False |
DTI_PID/DTI_PID/UI/Configuration.ui | ||
---|---|---|
7 | 7 |
<x>0</x> |
8 | 8 |
<y>0</y> |
9 | 9 |
<width>553</width> |
10 |
<height>572</height>
|
|
10 |
<height>573</height>
|
|
11 | 11 |
</rect> |
12 | 12 |
</property> |
13 | 13 |
<property name="font"> |
... | ... | |
533 | 533 |
<item row="0" column="0"> |
534 | 534 |
<widget class="QGroupBox" name="groupBox_4"> |
535 | 535 |
<property name="title"> |
536 |
<string>Line No Tag Rule</string>
|
|
536 |
<string>Note No Tag Rule</string>
|
|
537 | 537 |
</property> |
538 | 538 |
<layout class="QGridLayout" name="gridLayout_12"> |
539 |
<item row="0" column="0"> |
|
540 |
<layout class="QHBoxLayout" name="horizontalLayout_11"> |
|
541 |
<item> |
|
539 |
<item row="1" column="0"> |
|
540 |
<layout class="QGridLayout" name="gridLayout_20"> |
|
541 |
<item row="1" column="1"> |
|
542 |
<widget class="QLineEdit" name="lineEditNoteNoSuffix"/> |
|
543 |
</item> |
|
544 |
<item row="1" column="0"> |
|
545 |
<widget class="QLabel" name="label_23"> |
|
546 |
<property name="text"> |
|
547 |
<string>Note No Suffix</string> |
|
548 |
</property> |
|
549 |
</widget> |
|
550 |
</item> |
|
551 |
<item row="0" column="0"> |
|
542 | 552 |
<widget class="QLabel" name="label_15"> |
543 | 553 |
<property name="text"> |
544 |
<string>Tag Seq No</string>
|
|
554 |
<string>Note No Prefix</string>
|
|
545 | 555 |
</property> |
546 | 556 |
</widget> |
547 | 557 |
</item> |
548 |
<item> |
|
549 |
<layout class="QGridLayout" name="gridLayout_13"> |
|
550 |
<item row="0" column="0"> |
|
551 |
<widget class="QLineEdit" name="lineEditLineNoTagSeqNo"/> |
|
552 |
</item> |
|
553 |
</layout> |
|
558 |
<item row="0" column="1"> |
|
559 |
<widget class="QLineEdit" name="lineEditNoteNoPrefix"/> |
|
554 | 560 |
</item> |
555 | 561 |
</layout> |
556 | 562 |
</item> |
... | ... | |
843 | 849 |
</layout> |
844 | 850 |
</widget> |
845 | 851 |
<tabstops> |
852 |
<tabstop>textAreaTypeARadioButton</tabstop> |
|
853 |
<tabstop>textAreaTypeBRadioButton</tabstop> |
|
854 |
<tabstop>spinBoxExpandSize</tabstop> |
|
855 |
<tabstop>spinBoxShrinkSize</tabstop> |
|
856 |
<tabstop>minTextSizeSpinBox</tabstop> |
|
857 |
<tabstop>maxTextSizeSpinBox</tabstop> |
|
858 |
<tabstop>spinBoxMergeSize</tabstop> |
|
846 | 859 |
<tabstop>lineEditSizeDelimiter</tabstop> |
847 | 860 |
<tabstop>spinBoxMinArea</tabstop> |
848 | 861 |
<tabstop>spinBoxMaxArea</tabstop> |
849 | 862 |
<tabstop>spinBoxWidth</tabstop> |
850 | 863 |
<tabstop>spinBoxHeight</tabstop> |
864 |
<tabstop>smallLineMinLengthSpinBox</tabstop> |
|
851 | 865 |
<tabstop>radioButtonMetric</tabstop> |
852 | 866 |
<tabstop>radioButtonInch</tabstop> |
867 |
<tabstop>lineEdit</tabstop> |
|
868 |
<tabstop>pushButtonAddDelimiter</tabstop> |
|
869 |
<tabstop>pushButtonLineNoAttribute</tabstop> |
|
853 | 870 |
<tabstop>comboBoxProperties</tabstop> |
854 | 871 |
<tabstop>pushButtonAddProperty</tabstop> |
872 |
<tabstop>lineEditNoteNoPrefix</tabstop> |
|
873 |
<tabstop>lineEditNoteNoSuffix</tabstop> |
|
874 |
<tabstop>lineEdit_2</tabstop> |
|
855 | 875 |
<tabstop>lineEditMeasuredVariableCode</tabstop> |
856 | 876 |
<tabstop>lineEditTypeModifier</tabstop> |
857 | 877 |
<tabstop>lineEditTagSeqNo</tabstop> |
858 | 878 |
<tabstop>lineEditTagSuffix</tabstop> |
859 | 879 |
<tabstop>lineEditDescription</tabstop> |
860 | 880 |
<tabstop>lineEditOPCTag</tabstop> |
881 |
<tabstop>tableWidgetLineTypes</tabstop> |
|
882 |
<tabstop>fontComboBox</tabstop> |
|
883 |
<tabstop>radioButtonAutoSize</tabstop> |
|
884 |
<tabstop>radioButtonFixedSize</tabstop> |
|
885 |
<tabstop>spinBoxFontSize</tabstop> |
|
886 |
<tabstop>radioButtonRandom</tabstop> |
|
887 |
<tabstop>radioButtonProperty</tabstop> |
|
888 |
<tabstop>comboBoxColorOption</tabstop> |
|
889 |
<tabstop>tableWidgetColorProperty</tabstop> |
|
861 | 890 |
<tabstop>tabWidget</tabstop> |
862 | 891 |
</tabstops> |
863 | 892 |
<resources/> |
내보내기 Unified diff