프로젝트

일반

사용자정보

개정판 988a520c

ID988a520c16a6c4557784cbfb7cbde98454b9f61f
상위 4e27cb0e
하위 7f6d085c, be927f40

백흠경이(가) 약 3년 전에 추가함

- 외부 프로그램을 등록하고 실행하는 기능 추가

Change-Id: Ibe8149a42f8ca8d484890aae1529bb543e28767a

차이점 보기:

DTI_PID/DTI_PID/AddExtAppsDialog.py
1
# coding: utf-8
2
""" This is OPC Relation dialog module """
3

  
4
import os
5
from re import match
6
import sys
7
from PyQt5.QtCore import *
8
from PyQt5.QtGui import *
9
from PyQt5.QtWidgets import *
10
from AppDocData import AppDocData, MessageType, Config
11
from EngineeringLineNoTextItem import QEngineeringLineNoTextItem
12

  
13
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\UI')
14
import AddExtApps_UI
15

  
16

  
17
class QAddExtAppsDialog(QDialog):
18
    """ This add external application dialog class """
19

  
20
    def __init__(self, parent):
21
        QDialog.__init__(self, parent)
22

  
23
        self.ui = AddExtApps_UI.Ui_AddExtAppsDialog()
24
        self.ui.setupUi(self)
25

  
26
        self.ui.buttonBox.button(QDialogButtonBox.Ok).setIcon(QIcon(':/newPrefix/OK.svg'))
27
        self.ui.buttonBox.button(QDialogButtonBox.Cancel).setIcon(QIcon(':/newPrefix/Remove.svg'))
28

  
29
        self.ui.toolButtonExecutable.clicked.connect(self.on_select_executable)
30

  
31
        self.Name = ''
32
        self.Executable = ''
33
        self.Args = ''
34

  
35
    def load_data(self):
36
        app_doc_data = AppDocData.instance()
37

  
38
    def on_select_executable(self):
39
        """"""
40
        options = QFileDialog.Options()
41
        options |= QFileDialog.DontUseNativeDialog
42
        fileName, _ = QFileDialog.getOpenFileName(self, "Add Ext Apps", "", "Executable Files (*.exe)",
43
                                                  options=options)
44
        if fileName:
45
            self.ui.lineEditExecutable.setText(fileName)
46

  
47
    def accept(self):
48
        """ save sql information to database """
49

  
50
        if self.ui.lineEditName.text() and self.ui.lineEditExecutable.text():
51
            self.Name = self.ui.lineEditName.text()
52
            self.Executable = self.ui.lineEditExecutable.text()
53
            self.Args = self.ui.lineEditArguments.text()
54

  
55
            QDialog.accept(self)
56
        else:
57
            QMessageBox.warning(self, self.tr('Warning'), 'Please check if Name or Executable is empty.')
DTI_PID/DTI_PID/AppDocData.py
4455 4455

  
4456 4456
        return res
4457 4457

  
4458

  
4459
    def get_ext_apps(self):
4460
        """get external application information from App.db"""
4461

  
4462
        path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID')
4463
        app_database_path = os.path.join(path, 'App.db')
4464
        with sqlite3.connect(app_database_path) as conn:
4465
            try:
4466
                conn.row_factory = sqlite3.Row
4467
                cursor = conn.cursor()
4468
                sql = 'select * from ExtApps'
4469
                cursor.execute(sql)
4470
                rows = cursor.fetchall()
4471
                return rows
4472
            except Exception as ex:
4473
                # Roll back any change if something goes wrong
4474
                conn.rollback()
4475

  
4476
                from App import App
4477
                message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
4478
                          f"{sys.exc_info()[-1].tb_lineno}"
4479
                App.mainWnd().addMessage.emit(MessageType.Error, message)
4480

  
4481
        return None
4482

  
4483
    def set_ext_apps(self, model:QStandardItemModel) -> None:
4484
        """ save ext apps to database """
4485

  
4486
        path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID')
4487
        app_database_path = os.path.join(path, 'App.db')
4488
        with sqlite3.connect(app_database_path) as conn:
4489
            try:
4490
                # Get a cursor object
4491
                cursor = conn.cursor()
4492

  
4493
                names = ','.join([f"'{model.item(row, 0).text()}'" for row in range(model.rowCount())])
4494
                sql = f"delete from ExtApps where [Name] not in (?)"
4495
                cursor.execute(sql, (names, ))
4496

  
4497
                for row in range(model.rowCount()):
4498
                    param = (model.item(row, 0).text(), model.item(row, 1).text(), model.item(row, 2).text())
4499

  
4500
                    sql = "insert into ExtApps([Name], Executable, Argument) select ?,?,? where not exists" \
4501
                          "(select [Name] from ExtApps where [Name]=?)"
4502
                    cursor.execute(sql, (param[0], param[1], param[2], param[0]))
4503

  
4504
                    sql = f"update ExtApps set Executable=?, Argument=? where [Name]=?"
4505
                    cursor.execute(sql, (param[1], param[2], param[0]))
4506

  
4507
                conn.commit()
4508
            # Catch the exception
4509
            except Exception as ex:
4510
                conn.rollback()
4511

  
4512
                from App import App
4513
                message = f'error occurred({ex}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:' \
4514
                          f'{sys.exc_info()[-1].tb_lineno}'
4515
                App.mainWnd().addMessage.emit(MessageType.Error, message)
4516

  
4517
        return None
4518

  
4458 4519
    '''
4459 4520
        @brief  getter of OCRData
4460 4521
        @author humkyung
DTI_PID/DTI_PID/AppRibbon.py
248 248
            pane.ui.toolButtonSymbolThicknessReinforcement.clicked.connect(main_wnd.onSymbolThickness)
249 249
            pane.ui.toolButtonDataTransfer.clicked.connect(main_wnd.on_show_data_transfer)
250 250
            pane.ui.toolButtonDataExport.clicked.connect(main_wnd.on_show_data_export)
251
            pane.ui.toolButtonExtApps.clicked.connect(main_wnd.onShowPSN)
251
            pane.ui.toolButtonConnection.clicked.connect(main_wnd.on_ext_app_connection)
252
            pane.ui.toolButtonExtApps.clicked.connect(main_wnd.on_execute_ext_app)
252 253
            cSection.addCustomWidget(pane)
253 254
        except Exception as ex:
254 255
            message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
DTI_PID/DTI_PID/ExtAppsDialog.py
1
# coding: utf-8
2
""" This is OPC Relation dialog module """
3

  
4
import os
5
import sys
6
import subprocess
7
from PyQt5.QtCore import *
8
from PyQt5.QtGui import *
9
from PyQt5.QtWidgets import *
10
from AppDocData import AppDocData, MessageType, Config
11

  
12
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\UI')
13
import ExtApps_UI
14

  
15

  
16
class ExtAppsModel(QStandardItemModel):
17
    def __init__(self, parent=None, *args):
18
        QStandardItemModel.__init__(self, parent, *args)
19

  
20
        self._execute_backcolor = QColor(Qt.green)
21

  
22
    def data(self, index, role):
23
        if not index.isValid():
24
            return None
25

  
26
        if index.column() in [0]:
27
            item = super(ExtAppsModel, self).item(index.row(), index.column())
28

  
29
            if role == Qt.DisplayRole:
30
                return item.text()
31

  
32
            image = QImage(':/newPrefix/Terminal.svg')
33
            pixmap = QPixmap(image)
34
            if role == Qt.DecorationRole:
35
                return pixmap
36
            if role == Qt.SizeHintRole:
37
                return QSize(pixmap.size().width() + len(item.text()) * 16, pixmap.size().height())
38

  
39
            # return self._execute_backcolor
40

  
41
        return super(ExtAppsModel, self).data(index, role)
42

  
43
    '''
44
    def headerData(self, section: int, orientation, role: int):
45
        if orientation == Qt.Horizontal:
46
            if role == Qt.SizeHintRole:
47
                if section == 3:
48
                    size = QSize(100, 50)
49
                    size.setWidth(80)
50
                    return size
51

  
52
        return super(ExtAppsModel, self).headerData(section, orientation, role)
53
    '''
54

  
55

  
56
class QExtAppsDialog(QDialog):
57
    """ This external application dialog class """
58

  
59
    def __init__(self, parent):
60
        QDialog.__init__(self, parent)
61

  
62
        self.ui = ExtApps_UI.Ui_ExtAppsDialog()
63
        self.ui.setupUi(self)
64

  
65
        self.ui.tableViewExtApps.setAlternatingRowColors(True)
66
        self.ui.tableViewExtApps.horizontalHeader().setStretchLastSection(True)
67
        self.ui.tableViewExtApps.setSelectionBehavior(QAbstractItemView.SelectRows)
68
        self.ui.tableViewExtApps.setSelectionMode(QAbstractItemView.SingleSelection)
69
        self.ui.tableViewExtApps.horizontalHeader().setStretchLastSection(True)
70
        self.ui.tableViewExtApps.setEditTriggers(QAbstractItemView.NoEditTriggers)
71
        self.ui.tableViewExtApps.doubleClicked.connect(self.on_clicked_tableViewExtApps)
72

  
73
        self.ui.buttonBox.button(QDialogButtonBox.Ok).setIcon(QIcon(':/newPrefix/OK.svg'))
74
        self.ui.buttonBox.button(QDialogButtonBox.Cancel).setIcon(QIcon(':/newPrefix/Remove.svg'))
75

  
76
        self._model = ExtAppsModel()
77
        self.load_data()
78

  
79
        self.ui.toolButtonAdd.clicked.connect(self.on_add_ext_apps)
80
        self.ui.toolButtonDelete.clicked.connect(self.on_del_ext_apps)
81

  
82
    def load_data(self):
83
        app_doc_data = AppDocData.instance()
84

  
85
        ext_apps = app_doc_data.get_ext_apps()
86
        for ext_app in ext_apps:
87
            items = [QStandardItem(ext_app['Name']), QStandardItem(ext_app['Executable']),
88
                     QStandardItem(ext_app['Argument'])]
89
            self._model.appendRow(items)
90

  
91
        self._model.setHorizontalHeaderLabels(['Name', 'Executable', 'Args'])
92
        self.ui.tableViewExtApps.setModel(self._model)
93

  
94
        self.ui.tableViewExtApps.resizeColumnsToContents()
95
        self.ui.tableViewExtApps.resizeRowsToContents()
96

  
97
    def on_clicked_tableViewExtApps(self, item):
98
        """execute external app"""
99

  
100
        if item.column() == 0:
101
            executable = self.ui.tableViewExtApps.model().item(item.row(), 1).text()
102
            args = [executable, self.ui.tableViewExtApps.model().item(item.row(), 2).text()]
103
            CREATE_NO_WINDOW = 0x08000000
104
            p = subprocess.Popen(
105
                args,
106
                stdin=subprocess.PIPE,
107
                stdout=subprocess.PIPE,
108
                stderr=subprocess.PIPE,
109
                creationflags=CREATE_NO_WINDOW
110
            )
111

  
112
            QDialog.accept(self)
113

  
114
    def on_add_ext_apps(self):
115
        """"""
116
        from AddExtAppsDialog import QAddExtAppsDialog
117

  
118
        try:
119
            dlg = QAddExtAppsDialog(self)
120
            if QDialog.Accepted == dlg.exec_():
121
                items = [QStandardItem(dlg.Name), QStandardItem(dlg.Executable), QStandardItem(dlg.Args)]
122
                self._model.appendRow(items)
123

  
124
                self.ui.tableViewExtApps.resizeColumnsToContents()
125
                self.ui.tableViewExtApps.resizeRowsToContents()
126
        except Exception as ex:
127
            from App import App
128

  
129
            message = f'error occurred({ex}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:' \
130
                      f'{sys.exc_info()[-1].tb_lineno}'
131
            App.mainWnd().addMessage.emit(MessageType.Error, message)
132

  
133
    def on_del_ext_apps(self):
134
        """delete selected ext app"""
135

  
136
        indices = self.ui.tableViewExtApps.selectionModel().selectedRows()
137
        for index in sorted(indices):
138
            self.ui.tableViewExtApps.model().removeRow(index.row(), index.parent())
139

  
140
    def accept(self):
141
        """ save sql information to database """
142
        from AppDocData import AppDocData
143

  
144
        app_doc_data = AppDocData.instance()
145
        app_doc_data.set_ext_apps(self._model)
146

  
147
        QDialog.accept(self)
DTI_PID/DTI_PID/MainWindow.py
1438 1438
                self.graphicsView.scene().removeItem(dlg.desc_area)
1439 1439
        self.graphicsView.useDefaultCommand()
1440 1440

  
1441
    def onShowPSN(self):
1441
    def on_ext_app_connection(self):
1442 1442
        from TcpServer import TcpServer
1443 1443

  
1444
        data_pane = self.ribbon.get_pane('Tool')
1445
        if data_pane.ui.toolButtonExtApps.isChecked():
1444
        tool_pane = self.ribbon.get_pane('Tool')
1445
        if tool_pane.ui.toolButtonConnection.isChecked():
1446 1446
            if not hasattr(self, '_tcpserver'):
1447 1447
                self._tcpserver = TcpServer()
1448 1448
                self._tcpserver.sessionOpened()
......
1450 1450
            self._tcpserver.sessionClosed()
1451 1451
            del self._tcpserver
1452 1452

  
1453
    def on_execute_ext_app(self):
1454
        """execute external application"""
1455
        from ExtAppsDialog import QExtAppsDialog
1456

  
1457
        dlg = QExtAppsDialog(self)
1458
        dlg.exec_()
1459

  
1453 1460
    def onShowCustomCodeTable(self):
1454 1461
        from CustomCodeTablesDialog import CustomCodeTablesDialog
1455 1462

  
DTI_PID/DTI_PID/Scripts/App.Configuration.sql
4 4
	Value TEXT,
5 5
	CONSTRAINT Configuration_PK PRIMARY KEY ("Section","Key")
6 6
);
7

  
8
CREATE TABLE IF NOT EXISTS ExtApps (
9
	"Name" TEXT NOT NULL,
10
	"Executable" TEXT NOT NULL,
11
	Argument TEXT,
12
	CONSTRAINT Configuration_PK PRIMARY KEY ("Name")
13
);
DTI_PID/DTI_PID/UI/AddExtApps.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>AddExtAppsDialog</class>
4
 <widget class="QDialog" name="AddExtAppsDialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>528</width>
10
    <height>121</height>
11
   </rect>
12
  </property>
13
  <property name="windowTitle">
14
   <string>Add Ext Apps</string>
15
  </property>
16
  <layout class="QGridLayout" name="gridLayout_2">
17
   <item row="0" column="0">
18
    <layout class="QGridLayout" name="gridLayout">
19
     <item row="1" column="0">
20
      <widget class="QLabel" name="label_2">
21
       <property name="text">
22
        <string>Executable : </string>
23
       </property>
24
      </widget>
25
     </item>
26
     <item row="2" column="0">
27
      <widget class="QLabel" name="label_3">
28
       <property name="text">
29
        <string>Arguments</string>
30
       </property>
31
      </widget>
32
     </item>
33
     <item row="0" column="0">
34
      <widget class="QLabel" name="label">
35
       <property name="text">
36
        <string>Name : </string>
37
       </property>
38
      </widget>
39
     </item>
40
     <item row="1" column="1">
41
      <widget class="QLineEdit" name="lineEditExecutable">
42
       <property name="readOnly">
43
        <bool>true</bool>
44
       </property>
45
      </widget>
46
     </item>
47
     <item row="1" column="2">
48
      <widget class="QToolButton" name="toolButtonExecutable">
49
       <property name="text">
50
        <string>...</string>
51
       </property>
52
      </widget>
53
     </item>
54
     <item row="0" column="1" colspan="2">
55
      <widget class="QLineEdit" name="lineEditName"/>
56
     </item>
57
     <item row="2" column="1" colspan="2">
58
      <widget class="QLineEdit" name="lineEditArguments"/>
59
     </item>
60
    </layout>
61
   </item>
62
   <item row="1" column="0">
63
    <widget class="QDialogButtonBox" name="buttonBox">
64
     <property name="orientation">
65
      <enum>Qt::Horizontal</enum>
66
     </property>
67
     <property name="standardButtons">
68
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
69
     </property>
70
    </widget>
71
   </item>
72
  </layout>
73
 </widget>
74
 <tabstops>
75
  <tabstop>lineEditName</tabstop>
76
  <tabstop>toolButtonExecutable</tabstop>
77
  <tabstop>lineEditArguments</tabstop>
78
  <tabstop>lineEditExecutable</tabstop>
79
 </tabstops>
80
 <resources/>
81
 <connections>
82
  <connection>
83
   <sender>buttonBox</sender>
84
   <signal>accepted()</signal>
85
   <receiver>AddExtAppsDialog</receiver>
86
   <slot>accept()</slot>
87
   <hints>
88
    <hint type="sourcelabel">
89
     <x>248</x>
90
     <y>254</y>
91
    </hint>
92
    <hint type="destinationlabel">
93
     <x>157</x>
94
     <y>274</y>
95
    </hint>
96
   </hints>
97
  </connection>
98
  <connection>
99
   <sender>buttonBox</sender>
100
   <signal>rejected()</signal>
101
   <receiver>AddExtAppsDialog</receiver>
102
   <slot>reject()</slot>
103
   <hints>
104
    <hint type="sourcelabel">
105
     <x>316</x>
106
     <y>260</y>
107
    </hint>
108
    <hint type="destinationlabel">
109
     <x>286</x>
110
     <y>274</y>
111
    </hint>
112
   </hints>
113
  </connection>
114
 </connections>
115
</ui>
DTI_PID/DTI_PID/UI/AddExtApps_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file '.\UI\AddExtApps.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.15.4
6
#
7
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8
# run again.  Do not edit this file unless you know what you are doing.
9

  
10

  
11
from PyQt5 import QtCore, QtGui, QtWidgets
12

  
13

  
14
class Ui_AddExtAppsDialog(object):
15
    def setupUi(self, AddExtAppsDialog):
16
        AddExtAppsDialog.setObjectName("AddExtAppsDialog")
17
        AddExtAppsDialog.resize(528, 121)
18
        self.gridLayout_2 = QtWidgets.QGridLayout(AddExtAppsDialog)
19
        self.gridLayout_2.setObjectName("gridLayout_2")
20
        self.gridLayout = QtWidgets.QGridLayout()
21
        self.gridLayout.setObjectName("gridLayout")
22
        self.label_2 = QtWidgets.QLabel(AddExtAppsDialog)
23
        self.label_2.setObjectName("label_2")
24
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
25
        self.label_3 = QtWidgets.QLabel(AddExtAppsDialog)
26
        self.label_3.setObjectName("label_3")
27
        self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
28
        self.label = QtWidgets.QLabel(AddExtAppsDialog)
29
        self.label.setObjectName("label")
30
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
31
        self.lineEditExecutable = QtWidgets.QLineEdit(AddExtAppsDialog)
32
        self.lineEditExecutable.setReadOnly(True)
33
        self.lineEditExecutable.setObjectName("lineEditExecutable")
34
        self.gridLayout.addWidget(self.lineEditExecutable, 1, 1, 1, 1)
35
        self.toolButtonExecutable = QtWidgets.QToolButton(AddExtAppsDialog)
36
        self.toolButtonExecutable.setObjectName("toolButtonExecutable")
37
        self.gridLayout.addWidget(self.toolButtonExecutable, 1, 2, 1, 1)
38
        self.lineEditName = QtWidgets.QLineEdit(AddExtAppsDialog)
39
        self.lineEditName.setObjectName("lineEditName")
40
        self.gridLayout.addWidget(self.lineEditName, 0, 1, 1, 2)
41
        self.lineEditArguments = QtWidgets.QLineEdit(AddExtAppsDialog)
42
        self.lineEditArguments.setObjectName("lineEditArguments")
43
        self.gridLayout.addWidget(self.lineEditArguments, 2, 1, 1, 2)
44
        self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
45
        self.buttonBox = QtWidgets.QDialogButtonBox(AddExtAppsDialog)
46
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
47
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
48
        self.buttonBox.setObjectName("buttonBox")
49
        self.gridLayout_2.addWidget(self.buttonBox, 1, 0, 1, 1)
50

  
51
        self.retranslateUi(AddExtAppsDialog)
52
        self.buttonBox.accepted.connect(AddExtAppsDialog.accept)
53
        self.buttonBox.rejected.connect(AddExtAppsDialog.reject)
54
        QtCore.QMetaObject.connectSlotsByName(AddExtAppsDialog)
55
        AddExtAppsDialog.setTabOrder(self.lineEditName, self.toolButtonExecutable)
56
        AddExtAppsDialog.setTabOrder(self.toolButtonExecutable, self.lineEditArguments)
57
        AddExtAppsDialog.setTabOrder(self.lineEditArguments, self.lineEditExecutable)
58

  
59
    def retranslateUi(self, AddExtAppsDialog):
60
        _translate = QtCore.QCoreApplication.translate
61
        AddExtAppsDialog.setWindowTitle(_translate("AddExtAppsDialog", "Add Ext Apps"))
62
        self.label_2.setText(_translate("AddExtAppsDialog", "Executable : "))
63
        self.label_3.setText(_translate("AddExtAppsDialog", "Arguments"))
64
        self.label.setText(_translate("AddExtAppsDialog", "Name : "))
65
        self.toolButtonExecutable.setText(_translate("AddExtAppsDialog", "..."))
DTI_PID/DTI_PID/UI/ExtApps.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>ExtAppsDialog</class>
4
 <widget class="QDialog" name="ExtAppsDialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>551</width>
10
    <height>270</height>
11
   </rect>
12
  </property>
13
  <property name="windowTitle">
14
   <string>Ext Apps</string>
15
  </property>
16
  <layout class="QGridLayout" name="gridLayout">
17
   <item row="0" column="0">
18
    <layout class="QGridLayout" name="gridLayout_2">
19
     <item row="0" column="1">
20
      <widget class="QToolButton" name="toolButtonAdd">
21
       <property name="text">
22
        <string>+</string>
23
       </property>
24
      </widget>
25
     </item>
26
     <item row="0" column="2">
27
      <widget class="QToolButton" name="toolButtonDelete">
28
       <property name="text">
29
        <string>-</string>
30
       </property>
31
      </widget>
32
     </item>
33
     <item row="1" column="0" colspan="3">
34
      <widget class="QTableView" name="tableViewExtApps"/>
35
     </item>
36
    </layout>
37
   </item>
38
   <item row="1" column="0">
39
    <widget class="QDialogButtonBox" name="buttonBox">
40
     <property name="orientation">
41
      <enum>Qt::Horizontal</enum>
42
     </property>
43
     <property name="standardButtons">
44
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
45
     </property>
46
    </widget>
47
   </item>
48
  </layout>
49
 </widget>
50
 <resources/>
51
 <connections>
52
  <connection>
53
   <sender>buttonBox</sender>
54
   <signal>accepted()</signal>
55
   <receiver>ExtAppsDialog</receiver>
56
   <slot>accept()</slot>
57
   <hints>
58
    <hint type="sourcelabel">
59
     <x>248</x>
60
     <y>254</y>
61
    </hint>
62
    <hint type="destinationlabel">
63
     <x>157</x>
64
     <y>274</y>
65
    </hint>
66
   </hints>
67
  </connection>
68
  <connection>
69
   <sender>buttonBox</sender>
70
   <signal>rejected()</signal>
71
   <receiver>ExtAppsDialog</receiver>
72
   <slot>reject()</slot>
73
   <hints>
74
    <hint type="sourcelabel">
75
     <x>316</x>
76
     <y>260</y>
77
    </hint>
78
    <hint type="destinationlabel">
79
     <x>286</x>
80
     <y>274</y>
81
    </hint>
82
   </hints>
83
  </connection>
84
 </connections>
85
</ui>
DTI_PID/DTI_PID/UI/ExtApps_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file '.\UI\ExtApps.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.15.4
6
#
7
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8
# run again.  Do not edit this file unless you know what you are doing.
9

  
10

  
11
from PyQt5 import QtCore, QtGui, QtWidgets
12

  
13

  
14
class Ui_ExtAppsDialog(object):
15
    def setupUi(self, ExtAppsDialog):
16
        ExtAppsDialog.setObjectName("ExtAppsDialog")
17
        ExtAppsDialog.resize(551, 270)
18
        self.gridLayout = QtWidgets.QGridLayout(ExtAppsDialog)
19
        self.gridLayout.setObjectName("gridLayout")
20
        self.gridLayout_2 = QtWidgets.QGridLayout()
21
        self.gridLayout_2.setObjectName("gridLayout_2")
22
        self.toolButtonAdd = QtWidgets.QToolButton(ExtAppsDialog)
23
        self.toolButtonAdd.setObjectName("toolButtonAdd")
24
        self.gridLayout_2.addWidget(self.toolButtonAdd, 0, 1, 1, 1)
25
        self.toolButtonDelete = QtWidgets.QToolButton(ExtAppsDialog)
26
        self.toolButtonDelete.setObjectName("toolButtonDelete")
27
        self.gridLayout_2.addWidget(self.toolButtonDelete, 0, 2, 1, 1)
28
        self.tableViewExtApps = QtWidgets.QTableView(ExtAppsDialog)
29
        self.tableViewExtApps.setObjectName("tableViewExtApps")
30
        self.gridLayout_2.addWidget(self.tableViewExtApps, 1, 0, 1, 3)
31
        self.gridLayout.addLayout(self.gridLayout_2, 0, 0, 1, 1)
32
        self.buttonBox = QtWidgets.QDialogButtonBox(ExtAppsDialog)
33
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
34
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
35
        self.buttonBox.setObjectName("buttonBox")
36
        self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)
37

  
38
        self.retranslateUi(ExtAppsDialog)
39
        self.buttonBox.accepted.connect(ExtAppsDialog.accept)
40
        self.buttonBox.rejected.connect(ExtAppsDialog.reject)
41
        QtCore.QMetaObject.connectSlotsByName(ExtAppsDialog)
42

  
43
    def retranslateUi(self, ExtAppsDialog):
44
        _translate = QtCore.QCoreApplication.translate
45
        ExtAppsDialog.setWindowTitle(_translate("ExtAppsDialog", "Ext Apps"))
46
        self.toolButtonAdd.setText(_translate("ExtAppsDialog", "+"))
47
        self.toolButtonDelete.setText(_translate("ExtAppsDialog", "-"))
DTI_PID/DTI_PID/UI/Tool.ui
6 6
   <rect>
7 7
    <x>0</x>
8 8
    <y>0</y>
9
    <width>499</width>
9
    <width>564</width>
10 10
    <height>70</height>
11 11
   </rect>
12 12
  </property>
......
34 34
     <property name="spacing">
35 35
      <number>0</number>
36 36
     </property>
37
     <item row="0" column="6">
38
      <widget class="QToolButton" name="toolButtonDataExport">
37
     <item row="0" column="1">
38
      <widget class="QToolButton" name="toolButtonImportTextFromCAD">
39 39
       <property name="text">
40
        <string>Data
41
Export</string>
40
        <string>Import
41
AutoCAD</string>
42 42
       </property>
43 43
       <property name="icon">
44 44
        <iconset resource="../res/MainWindow.qrc">
45
         <normaloff>:/newPrefix/Change.svg</normaloff>:/newPrefix/Change.svg</iconset>
45
         <normaloff>:/newPrefix/AutoCAD.svg</normaloff>:/newPrefix/AutoCAD.svg</iconset>
46 46
       </property>
47 47
       <property name="iconSize">
48 48
        <size>
......
58 58
       </property>
59 59
      </widget>
60 60
     </item>
61
     <item row="0" column="2">
62
      <widget class="QToolButton" name="toolButtonImportTextFromCADforInstrument">
61
     <item row="0" column="5">
62
      <widget class="QToolButton" name="toolButtonDataTransfer">
63 63
       <property name="text">
64
        <string>Import Text
65
</string>
64
        <string>Data
65
Transfer</string>
66 66
       </property>
67 67
       <property name="icon">
68 68
        <iconset resource="../res/MainWindow.qrc">
69
         <normaloff>:/newPrefix/import_text_from_pdf_32px.svg</normaloff>:/newPrefix/import_text_from_pdf_32px.svg</iconset>
69
         <normaloff>:/newPrefix/Change.svg</normaloff>:/newPrefix/Change.svg</iconset>
70 70
       </property>
71 71
       <property name="iconSize">
72 72
        <size>
......
82 82
       </property>
83 83
      </widget>
84 84
     </item>
85
     <item row="0" column="4">
86
      <widget class="Line" name="line_2">
87
       <property name="orientation">
88
        <enum>Qt::Vertical</enum>
89
       </property>
90
      </widget>
91
     </item>
85 92
     <item row="0" column="3">
86 93
      <widget class="QToolButton" name="toolButtonSymbolThicknessReinforcement">
87 94
       <property name="toolTip">
......
109 116
       </property>
110 117
      </widget>
111 118
     </item>
112
     <item row="0" column="5">
113
      <widget class="QToolButton" name="toolButtonDataTransfer">
119
     <item row="0" column="7">
120
      <widget class="Line" name="line_3">
121
       <property name="orientation">
122
        <enum>Qt::Vertical</enum>
123
       </property>
124
      </widget>
125
     </item>
126
     <item row="0" column="0">
127
      <widget class="QToolButton" name="toolButtonPDFToImage">
114 128
       <property name="text">
115
        <string>Data
116
Transfer</string>
129
        <string>Convert
130
PDF</string>
117 131
       </property>
118 132
       <property name="icon">
119 133
        <iconset resource="../res/MainWindow.qrc">
120
         <normaloff>:/newPrefix/Change.svg</normaloff>:/newPrefix/Change.svg</iconset>
134
         <normaloff>:/newPrefix/pdf_32px.svg</normaloff>:/newPrefix/pdf_32px.svg</iconset>
121 135
       </property>
122 136
       <property name="iconSize">
123 137
        <size>
......
133 147
       </property>
134 148
      </widget>
135 149
     </item>
136
     <item row="0" column="1">
137
      <widget class="QToolButton" name="toolButtonImportTextFromCAD">
150
     <item row="0" column="8">
151
      <widget class="QToolButton" name="toolButtonConnection">
138 152
       <property name="text">
139
        <string>Import
140
AutoCAD</string>
153
        <string>Connection</string>
141 154
       </property>
142 155
       <property name="icon">
143 156
        <iconset resource="../res/MainWindow.qrc">
144
         <normaloff>:/newPrefix/AutoCAD.svg</normaloff>:/newPrefix/AutoCAD.svg</iconset>
157
         <normaloff>:/newPrefix/network.svg</normaloff>:/newPrefix/network.svg</iconset>
145 158
       </property>
146 159
       <property name="iconSize">
147 160
        <size>
......
149 162
         <height>32</height>
150 163
        </size>
151 164
       </property>
165
       <property name="checkable">
166
        <bool>true</bool>
167
       </property>
152 168
       <property name="toolButtonStyle">
153 169
        <enum>Qt::ToolButtonTextUnderIcon</enum>
154 170
       </property>
......
157 173
       </property>
158 174
      </widget>
159 175
     </item>
160
     <item row="0" column="4">
161
      <widget class="Line" name="line_2">
162
       <property name="orientation">
163
        <enum>Qt::Vertical</enum>
176
     <item row="0" column="6">
177
      <widget class="QToolButton" name="toolButtonDataExport">
178
       <property name="text">
179
        <string>Data
180
Export</string>
181
       </property>
182
       <property name="icon">
183
        <iconset resource="../res/MainWindow.qrc">
184
         <normaloff>:/newPrefix/Change.svg</normaloff>:/newPrefix/Change.svg</iconset>
185
       </property>
186
       <property name="iconSize">
187
        <size>
188
         <width>32</width>
189
         <height>32</height>
190
        </size>
191
       </property>
192
       <property name="toolButtonStyle">
193
        <enum>Qt::ToolButtonTextUnderIcon</enum>
194
       </property>
195
       <property name="autoRaise">
196
        <bool>true</bool>
164 197
       </property>
165 198
      </widget>
166 199
     </item>
167
     <item row="0" column="0">
168
      <widget class="QToolButton" name="toolButtonPDFToImage">
200
     <item row="0" column="2">
201
      <widget class="QToolButton" name="toolButtonImportTextFromCADforInstrument">
169 202
       <property name="text">
170
        <string>Convert
171
PDF</string>
203
        <string>Import Text
204
</string>
172 205
       </property>
173 206
       <property name="icon">
174 207
        <iconset resource="../res/MainWindow.qrc">
175
         <normaloff>:/newPrefix/pdf_32px.svg</normaloff>:/newPrefix/pdf_32px.svg</iconset>
208
         <normaloff>:/newPrefix/import_text_from_pdf_32px.svg</normaloff>:/newPrefix/import_text_from_pdf_32px.svg</iconset>
176 209
       </property>
177 210
       <property name="iconSize">
178 211
        <size>
......
188 221
       </property>
189 222
      </widget>
190 223
     </item>
191
     <item row="0" column="8">
224
     <item row="0" column="9">
192 225
      <widget class="QToolButton" name="toolButtonExtApps">
193 226
       <property name="text">
194
        <string>Ext.
195
Apps</string>
227
        <string>
228
Ext Apps</string>
196 229
       </property>
197 230
       <property name="icon">
198 231
        <iconset resource="../res/MainWindow.qrc">
199
         <normaloff>:/newPrefix/network.svg</normaloff>:/newPrefix/network.svg</iconset>
232
         <normaloff>:/newPrefix/Terminal.svg</normaloff>:/newPrefix/Terminal.svg</iconset>
200 233
       </property>
201 234
       <property name="iconSize">
202 235
        <size>
......
204 237
         <height>32</height>
205 238
        </size>
206 239
       </property>
207
       <property name="checkable">
208
        <bool>true</bool>
209
       </property>
210 240
       <property name="toolButtonStyle">
211 241
        <enum>Qt::ToolButtonTextUnderIcon</enum>
212 242
       </property>
......
215 245
       </property>
216 246
      </widget>
217 247
     </item>
218
     <item row="0" column="7">
219
      <widget class="Line" name="line_3">
220
       <property name="orientation">
221
        <enum>Qt::Vertical</enum>
222
       </property>
223
      </widget>
224
     </item>
225 248
    </layout>
226 249
   </item>
227 250
  </layout>

내보내기 Unified diff

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