프로젝트

일반

사용자정보

개정판 2ba8339b

ID2ba8339bdf9539672d907b650491246a27fd431f
상위 e00e891d
하위 3fcf23c8

백흠경이(가) 5년 이상 전에 추가함

issue #663: be recognizing instrument's From/To

Change-Id: Id01d486f1cce3369e89d6874a767b5986cc24b6f

차이점 보기:

DTI_PID/DTI_PID/ConfigurationDialog.py
136 136
            self.ui.lineEditNoteNoSymbolName.setEnabled(False)
137 137
        else:
138 138
            self.ui.checkBoxNoteNoSymbolName.setCheckState(Qt.Checked)
139
        configs = docData.getConfigs('OPC Tag Rule', 'From Prefix')
140
        self.ui.lineEditOPCFromPrefix.setText(configs[0].value if configs else '')
141
        configs = docData.getConfigs('OPC Tag Rule', 'To Prefix')
142
        self.ui.lineEditOPCToPrefix.setText(configs[0].value if configs else '')
139 143
        configs = docData.getConfigs('Supplied by Tag Rule', 'by Vendor')
140 144
        self.ui.lineEditByVendor.setText(configs[0].value if configs else 'by Vendor')
141 145
        self.ui.lineEditDrainSize.setText(docData.drain_size)    # 2019.05.20 added by humkyung
......
616 620
            configs.append(Config('Line Detector', 'Length to connect line', self.ui.spinBoxLengthToConnectLine.value()))
617 621
            configs.append(Config('Note No Tag Rule', 'Note No Expression', self.ui.lineEditNoteNoExpression.text()))
618 622
            configs.append(Config('Note No Tag Rule', 'Note No Symbol Name', self.ui.lineEditNoteNoSymbolName.text()))
623
            configs.append(Config('OPC Tag Rule', 'From Prefix', self.ui.lineEditOPCFromPrefix.text()))
624
            configs.append(Config('OPC Tag Rule', 'To Prefix', self.ui.lineEditOPCToPrefix.text()))
619 625
            configs.append(Config('Supplied by Tag Rule', 'by Vendor', self.ui.lineEditByVendor.text()))
620 626
            docData.drain_size = self.ui.lineEditDrainSize.text()
621 627
            configs.append(Config('Drain Size Rule', 'Size', docData.drain_size))
DTI_PID/DTI_PID/Configuration_UI.py
1 1
# -*- coding: utf-8 -*-
2 2

  
3
# Form implementation generated from reading ui file './UI/Configuration.ui'
3
# Form implementation generated from reading ui file '.\UI\Configuration.ui'
4 4
#
5
# Created by: PyQt5 UI code generator 5.12
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

  
9 9
from PyQt5 import QtCore, QtGui, QtWidgets
10 10

  
11

  
12 11
class Ui_ConfigurationDialog(object):
13 12
    def setupUi(self, ConfigurationDialog):
14 13
        ConfigurationDialog.setObjectName("ConfigurationDialog")
15
        ConfigurationDialog.resize(704, 815)
14
        ConfigurationDialog.resize(704, 814)
16 15
        font = QtGui.QFont()
17 16
        font.setFamily("맑은 고딕")
18 17
        ConfigurationDialog.setFont(font)
......
262 261
        self.lineEdit_2.setObjectName("lineEdit_2")
263 262
        self.horizontalLayout_23.addWidget(self.lineEdit_2)
264 263
        self.gridLayout_17.addLayout(self.horizontalLayout_23, 1, 0, 1, 1)
265
        self.gridLayout_7.addWidget(self.groupBox_8, 3, 0, 1, 1)
264
        self.gridLayout_7.addWidget(self.groupBox_8, 4, 0, 1, 1)
266 265
        self.groupBox_4 = QtWidgets.QGroupBox(self.tabTagNoRule)
267 266
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
268 267
        sizePolicy.setHorizontalStretch(0)
......
274 273
        self.gridLayout_9 = QtWidgets.QGridLayout(self.groupBox_4)
275 274
        self.gridLayout_9.setObjectName("gridLayout_9")
276 275
        self.formLayout = QtWidgets.QFormLayout()
276
        self.formLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
277 277
        self.formLayout.setObjectName("formLayout")
278 278
        self.checkBoxNoteNoSymbolName = QtWidgets.QCheckBox(self.groupBox_4)
279 279
        self.checkBoxNoteNoSymbolName.setObjectName("checkBoxNoteNoSymbolName")
......
289 289
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEditNoteNoExpression)
290 290
        self.gridLayout_9.addLayout(self.formLayout, 0, 0, 1, 1)
291 291
        self.gridLayout_7.addWidget(self.groupBox_4, 0, 0, 1, 1)
292
        self.groupBox_3 = QtWidgets.QGroupBox(self.tabTagNoRule)
293
        self.groupBox_3.setMaximumSize(QtCore.QSize(16777215, 100))
294
        self.groupBox_3.setObjectName("groupBox_3")
295
        self.gridLayout_12 = QtWidgets.QGridLayout(self.groupBox_3)
296
        self.gridLayout_12.setObjectName("gridLayout_12")
297
        self.formLayout_3 = QtWidgets.QFormLayout()
298
        self.formLayout_3.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
299
        self.formLayout_3.setObjectName("formLayout_3")
300
        self.label_11 = QtWidgets.QLabel(self.groupBox_3)
301
        self.label_11.setObjectName("label_11")
302
        self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_11)
303
        self.lineEditByVendor = QtWidgets.QLineEdit(self.groupBox_3)
304
        self.lineEditByVendor.setObjectName("lineEditByVendor")
305
        self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEditByVendor)
306
        self.gridLayout_12.addLayout(self.formLayout_3, 0, 0, 1, 1)
307
        self.gridLayout_7.addWidget(self.groupBox_3, 1, 0, 1, 1)
308 292
        self.groupBox_9 = QtWidgets.QGroupBox(self.tabTagNoRule)
309 293
        self.groupBox_9.setMaximumSize(QtCore.QSize(16777215, 100))
310 294
        self.groupBox_9.setObjectName("groupBox_9")
......
317 301
        self.label_12.setObjectName("label_12")
318 302
        self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_12)
319 303
        self.lineEditDrainSize = QtWidgets.QLineEdit(self.groupBox_9)
304
        self.lineEditDrainSize.setText("")
320 305
        self.lineEditDrainSize.setObjectName("lineEditDrainSize")
321 306
        self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEditDrainSize)
322 307
        self.gridLayout_13.addLayout(self.formLayout_4, 0, 0, 1, 1)
323
        self.gridLayout_7.addWidget(self.groupBox_9, 2, 0, 1, 1)
308
        self.gridLayout_7.addWidget(self.groupBox_9, 3, 0, 1, 1)
309
        self.groupBox_3 = QtWidgets.QGroupBox(self.tabTagNoRule)
310
        self.groupBox_3.setMaximumSize(QtCore.QSize(16777215, 100))
311
        self.groupBox_3.setObjectName("groupBox_3")
312
        self.gridLayout_12 = QtWidgets.QGridLayout(self.groupBox_3)
313
        self.gridLayout_12.setObjectName("gridLayout_12")
314
        self.formLayout_3 = QtWidgets.QFormLayout()
315
        self.formLayout_3.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
316
        self.formLayout_3.setObjectName("formLayout_3")
317
        self.label_11 = QtWidgets.QLabel(self.groupBox_3)
318
        self.label_11.setObjectName("label_11")
319
        self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_11)
320
        self.lineEditByVendor = QtWidgets.QLineEdit(self.groupBox_3)
321
        self.lineEditByVendor.setObjectName("lineEditByVendor")
322
        self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEditByVendor)
323
        self.gridLayout_12.addLayout(self.formLayout_3, 0, 0, 1, 1)
324
        self.gridLayout_7.addWidget(self.groupBox_3, 2, 0, 1, 1)
325
        self.groupBox_10 = QtWidgets.QGroupBox(self.tabTagNoRule)
326
        self.groupBox_10.setMaximumSize(QtCore.QSize(16777215, 100))
327
        self.groupBox_10.setObjectName("groupBox_10")
328
        self.gridLayout_20 = QtWidgets.QGridLayout(self.groupBox_10)
329
        self.gridLayout_20.setObjectName("gridLayout_20")
330
        self.formLayout_5 = QtWidgets.QFormLayout()
331
        self.formLayout_5.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
332
        self.formLayout_5.setObjectName("formLayout_5")
333
        self.label_13 = QtWidgets.QLabel(self.groupBox_10)
334
        self.label_13.setObjectName("label_13")
335
        self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_13)
336
        self.label_14 = QtWidgets.QLabel(self.groupBox_10)
337
        self.label_14.setObjectName("label_14")
338
        self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_14)
339
        self.lineEditOPCFromPrefix = QtWidgets.QLineEdit(self.groupBox_10)
340
        self.lineEditOPCFromPrefix.setObjectName("lineEditOPCFromPrefix")
341
        self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEditOPCFromPrefix)
342
        self.lineEditOPCToPrefix = QtWidgets.QLineEdit(self.groupBox_10)
343
        self.lineEditOPCToPrefix.setObjectName("lineEditOPCToPrefix")
344
        self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEditOPCToPrefix)
345
        self.gridLayout_20.addLayout(self.formLayout_5, 0, 0, 1, 1)
346
        self.gridLayout_7.addWidget(self.groupBox_10, 1, 0, 1, 1)
324 347
        self.tabWidget.addTab(self.tabTagNoRule, "")
325 348
        self.tabDisplayOption = QtWidgets.QWidget()
326 349
        self.tabDisplayOption.setObjectName("tabDisplayOption")
......
495 518
        self.groupBox_4.setTitle(_translate("ConfigurationDialog", "Note No Tag Rule"))
496 519
        self.checkBoxNoteNoSymbolName.setText(_translate("ConfigurationDialog", "Note No Symbol Name : "))
497 520
        self.label_8.setText(_translate("ConfigurationDialog", "Note No Expression : "))
498
        self.groupBox_3.setTitle(_translate("ConfigurationDialog", "Supplied by Tag Rule"))
499
        self.label_11.setText(_translate("ConfigurationDialog", "Supplied by Vendor : "))
500 521
        self.groupBox_9.setTitle(_translate("ConfigurationDialog", "Drain Size"))
501 522
        self.label_12.setText(_translate("ConfigurationDialog", "Drain Size : "))
523
        self.groupBox_3.setTitle(_translate("ConfigurationDialog", "Supplied by Tag Rule"))
524
        self.label_11.setText(_translate("ConfigurationDialog", "Supplied by Vendor : "))
525
        self.groupBox_10.setTitle(_translate("ConfigurationDialog", "OPC Tag Rule"))
526
        self.label_13.setText(_translate("ConfigurationDialog", "From Prefix : "))
527
        self.label_14.setText(_translate("ConfigurationDialog", "To Prefix : "))
528
        self.lineEditOPCFromPrefix.setText(_translate("ConfigurationDialog", "FROM"))
529
        self.lineEditOPCToPrefix.setText(_translate("ConfigurationDialog", "TO"))
502 530
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabTagNoRule), _translate("ConfigurationDialog", "Tag Rule"))
503 531
        self.groupBox_6.setTitle(_translate("ConfigurationDialog", "Line Style"))
504 532
        self.groupBox_2.setTitle(_translate("ConfigurationDialog", "Symbol Style"))
......
516 544
        self.radioButtonProperty.setText(_translate("ConfigurationDialog", "Property"))
517 545
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabLineColor), _translate("ConfigurationDialog", "Line No Color"))
518 546

  
519

  
520 547
import MainWindow_rc
DTI_PID/DTI_PID/Shapes/QEngineeringOPCItem.py
17 17

  
18 18
    clicked = pyqtSignal(QGraphicsSvgItem)
19 19

  
20
    '''
21
    '''
22 20
    def __init__(self, path, uid=None, flip=0):
21
        from SymbolAttr import SymbolProp
22

  
23 23
        SymbolSvgItem.__init__(self, path, uid, flip=flip)
24 24

  
25
        self._properties = \
26
            {\
27
                SymbolProp(None, 'From', 'Text Item', Expression='self.From'):None, 
28
                SymbolProp(None, 'To', 'Text Item', Expression='self.To'):None 
29
            }
30

  
25 31
    '''
26 32
        @brief  getter of description
27 33
        @author humkyung
......
40 46
    def description(self, value):
41 47
        self._description = value
42 48

  
43
    '''
44
        @brief  getter of tag no
45
        @author humkyung
46
        @date   2018.05.08
47
    '''
48 49
    @property
49
    def tagNo(self):
50
        return self._tagNo
50
    def From(self):
51
        """ return From value """
52
        return ''
51 53

  
52
    '''
53
        @brief  setter of tag no
54
        @author humkyung
55
        @date   2018.05.08
56
    '''
57
    @tagNo.setter
58
    def tagNo(self, value):
59
        self._tagNo = value
54
    @property
55
    def To(self):
56
        """ return To value """
57
        return ''
60 58

  
61 59
    '''
62 60
        @brief  connect attribute
......
65 63
    '''
66 64
    def connectAttribute(self, attributes, clear=True):
67 65
        from AppDocData import AppDocData, MessageType
66
        from EngineeringLineItem import QEngineeringLineItem
68 67

  
69 68
        if clear:
70 69
            self.attrs.clear()
71 70
            self._associations.clear()
72 71

  
73 72
        try:
73
            app_doc_data = AppDocData.instance()
74

  
75
            matches = [connector for connector in self.connectors if connector is not None and type(connector.connectedItem) is QEngineeringLineItem]
76
            if matches:
77
                if matches[0].connectors[0].connectedItem is self:      # FROM
78
                    configs = app_doc_data.getConfigs('OPC Tag Rule', 'From Prefix')
79
                elif matches[0].connectors[1].connectedItem is self:    # TO
80
                    configs = app_doc_data.getConfigs('OPC Tag Rule', 'To Prefix')
81

  
74 82
            rect = self.sceneBoundingRect()
75 83
            for attr in attributes:
76 84
                if rect.contains(attr.center()):
DTI_PID/DTI_PID/UI/Configuration.ui
7 7
    <x>0</x>
8 8
    <y>0</y>
9 9
    <width>704</width>
10
    <height>815</height>
10
    <height>814</height>
11 11
   </rect>
12 12
  </property>
13 13
  <property name="font">
......
545 545
       <string>Tag Rule</string>
546 546
      </attribute>
547 547
      <layout class="QGridLayout" name="gridLayout_7">
548
       <item row="3" column="0">
548
       <item row="4" column="0">
549 549
        <widget class="QGroupBox" name="groupBox_8">
550 550
         <property name="title">
551 551
          <string>Nozzle Name Rule</string>
......
588 588
         <layout class="QGridLayout" name="gridLayout_9">
589 589
          <item row="0" column="0">
590 590
           <layout class="QFormLayout" name="formLayout">
591
            <property name="formAlignment">
592
             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
593
            </property>
591 594
            <item row="0" column="0">
592 595
             <widget class="QCheckBox" name="checkBoxNoteNoSymbolName">
593 596
              <property name="text">
......
613 616
         </layout>
614 617
        </widget>
615 618
       </item>
616
       <item row="1" column="0">
619
       <item row="3" column="0">
620
        <widget class="QGroupBox" name="groupBox_9">
621
         <property name="maximumSize">
622
          <size>
623
           <width>16777215</width>
624
           <height>100</height>
625
          </size>
626
         </property>
627
         <property name="title">
628
          <string>Drain Size</string>
629
         </property>
630
         <layout class="QGridLayout" name="gridLayout_13">
631
          <item row="0" column="0">
632
           <layout class="QFormLayout" name="formLayout_4">
633
            <property name="formAlignment">
634
             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
635
            </property>
636
            <item row="0" column="0">
637
             <widget class="QLabel" name="label_12">
638
              <property name="text">
639
               <string>Drain Size : </string>
640
              </property>
641
             </widget>
642
            </item>
643
            <item row="0" column="1">
644
             <widget class="QLineEdit" name="lineEditDrainSize">
645
              <property name="text">
646
               <string/>
647
              </property>
648
             </widget>
649
            </item>
650
           </layout>
651
          </item>
652
         </layout>
653
        </widget>
654
       </item>
655
       <item row="2" column="0">
617 656
        <widget class="QGroupBox" name="groupBox_3">
618 657
         <property name="maximumSize">
619 658
          <size>
......
645 684
         </layout>
646 685
        </widget>
647 686
       </item>
648
       <item row="2" column="0">
649
        <widget class="QGroupBox" name="groupBox_9">
687
       <item row="1" column="0">
688
        <widget class="QGroupBox" name="groupBox_10">
650 689
         <property name="maximumSize">
651 690
          <size>
652 691
           <width>16777215</width>
......
654 693
          </size>
655 694
         </property>
656 695
         <property name="title">
657
          <string>Drain Size</string>
696
          <string>OPC Tag Rule</string>
658 697
         </property>
659
         <layout class="QGridLayout" name="gridLayout_13">
698
         <layout class="QGridLayout" name="gridLayout_20">
660 699
          <item row="0" column="0">
661
           <layout class="QFormLayout" name="formLayout_4">
700
           <layout class="QFormLayout" name="formLayout_5">
662 701
            <property name="formAlignment">
663 702
             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
664 703
            </property>
665 704
            <item row="0" column="0">
666
             <widget class="QLabel" name="label_12">
705
             <widget class="QLabel" name="label_13">
667 706
              <property name="text">
668
               <string>Drain Size : </string>
707
               <string>From Prefix : </string>
708
              </property>
709
             </widget>
710
            </item>
711
            <item row="1" column="0">
712
             <widget class="QLabel" name="label_14">
713
              <property name="text">
714
               <string>To Prefix : </string>
669 715
              </property>
670 716
             </widget>
671 717
            </item>
672 718
            <item row="0" column="1">
673
             <widget class="QLineEdit" name="lineEditDrainSize">
719
             <widget class="QLineEdit" name="lineEditOPCFromPrefix">
674 720
              <property name="text">
675
               <string/>
721
               <string>FROM</string>
722
              </property>
723
             </widget>
724
            </item>
725
            <item row="1" column="1">
726
             <widget class="QLineEdit" name="lineEditOPCToPrefix">
727
              <property name="text">
728
               <string>TO</string>
676 729
              </property>
677 730
             </widget>
678 731
            </item>

내보내기 Unified diff

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