개정판 3015e48e
bm on going
Change-Id: I0b9e4b17629cc65d03621fc3e6447799cabfc258
DTI_PID/DTI_PID/BMSettingDialog.py | ||
---|---|---|
176 | 176 |
self.ui.tableViewAttributeList.setColumnWidth(1, 50) |
177 | 177 |
|
178 | 178 |
self.ui.tableViewSymbolList.clicked.connect(self.on_symbol_changed) |
179 |
self.ui.pushButtonAdd.clicked.connect(self.on_add_symbol) |
|
180 |
self.ui.pushButtonDelete.clicked.connect(self.on_delete_symbol) |
|
179 | 181 |
self.ui.buttonBox.accepted.connect(self.accept) |
180 | 182 |
self.ui.buttonBox.rejected.connect(self.reject) |
181 | 183 |
|
... | ... | |
248 | 250 |
''' |
249 | 251 |
# up to here |
250 | 252 |
|
253 |
def on_add_symbol(self): |
|
254 |
from BMSymbolAddDialog import QBMSymbolAddDialog |
|
255 |
|
|
256 |
dialog = QBMSymbolAddDialog(self, list(self.symbol_mapping.keys())) |
|
257 |
isAccepted, name = dialog.showDialog() |
|
258 |
if isAccepted: |
|
259 |
items = [QStandardItem(name)] |
|
260 |
items[0].setEditable(False) |
|
261 |
self.symbolListModel.appendRow(items) |
|
262 |
self.symbol_mapping[name] = [] |
|
263 |
|
|
264 |
def on_delete_symbol(self): |
|
265 |
index = self.ui.tableViewSymbolList.currentIndex() |
|
266 |
selected_symbol = self.symbolListModel.itemFromIndex(index) |
|
267 |
if selected_symbol.text() not in self.symbolListModel.SymbolList: |
|
268 |
self.symbol_mapping.pop(selected_symbol.text()) |
|
269 |
self.symbolListModel.removeRow(index.row()) |
|
270 |
|
|
251 | 271 |
def load_BM_setting(self): |
252 | 272 |
app_doc_data = AppDocData.instance() |
253 | 273 |
|
DTI_PID/DTI_PID/BMSetting_UI.py | ||
---|---|---|
2 | 2 |
|
3 | 3 |
# Form implementation generated from reading ui file './UI/BMSetting.ui' |
4 | 4 |
# |
5 |
# Created by: PyQt5 UI code generator 5.9.2
|
|
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 |
|
... | ... | |
28 | 28 |
self.gridLayout_5.setObjectName("gridLayout_5") |
29 | 29 |
self.gridLayout_3 = QtWidgets.QGridLayout() |
30 | 30 |
self.gridLayout_3.setObjectName("gridLayout_3") |
31 |
self.tableViewSymbolList = QtWidgets.QTableView(self.groupBoxSymbol) |
|
32 |
self.tableViewSymbolList.setObjectName("tableViewSymbolList") |
|
33 |
self.gridLayout_3.addWidget(self.tableViewSymbolList, 0, 0, 1, 1) |
|
34 | 31 |
self.treeViewSymbolMapping = QtWidgets.QTreeView(self.groupBoxSymbol) |
35 | 32 |
self.treeViewSymbolMapping.setObjectName("treeViewSymbolMapping") |
36 |
self.gridLayout_3.addWidget(self.treeViewSymbolMapping, 0, 1, 1, 1) |
|
33 |
self.gridLayout_3.addWidget(self.treeViewSymbolMapping, 0, 1, 3, 1) |
|
34 |
self.tableViewSymbolList = QtWidgets.QTableView(self.groupBoxSymbol) |
|
35 |
self.tableViewSymbolList.setObjectName("tableViewSymbolList") |
|
36 |
self.gridLayout_3.addWidget(self.tableViewSymbolList, 2, 0, 1, 1) |
|
37 |
self.horizontalLayout = QtWidgets.QHBoxLayout() |
|
38 |
self.horizontalLayout.setObjectName("horizontalLayout") |
|
39 |
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) |
|
40 |
self.horizontalLayout.addItem(spacerItem) |
|
41 |
self.pushButtonAdd = QtWidgets.QPushButton(self.groupBoxSymbol) |
|
42 |
self.pushButtonAdd.setObjectName("pushButtonAdd") |
|
43 |
self.horizontalLayout.addWidget(self.pushButtonAdd) |
|
44 |
self.pushButtonDelete = QtWidgets.QPushButton(self.groupBoxSymbol) |
|
45 |
self.pushButtonDelete.setObjectName("pushButtonDelete") |
|
46 |
self.horizontalLayout.addWidget(self.pushButtonDelete) |
|
47 |
self.gridLayout_3.addLayout(self.horizontalLayout, 1, 0, 1, 1) |
|
37 | 48 |
self.gridLayout_5.addLayout(self.gridLayout_3, 0, 0, 1, 1) |
38 | 49 |
self.verticalLayout.addWidget(self.groupBoxSymbol) |
39 | 50 |
self.verticalLayoutWidget_6 = QtWidgets.QWidget(self.splitter) |
... | ... | |
66 | 77 |
_translate = QtCore.QCoreApplication.translate |
67 | 78 |
BMSettingDialog.setWindowTitle(_translate("BMSettingDialog", "BM Setting")) |
68 | 79 |
self.groupBoxSymbol.setTitle(_translate("BMSettingDialog", "Symbol Mapping")) |
80 |
self.pushButtonAdd.setText(_translate("BMSettingDialog", "Add")) |
|
81 |
self.pushButtonDelete.setText(_translate("BMSettingDialog", "Delete")) |
|
69 | 82 |
self.groupBoxAttribute.setTitle(_translate("BMSettingDialog", "Attributes")) |
70 | 83 |
|
71 | 84 |
|
DTI_PID/DTI_PID/BMSymbolAddDialog.py | ||
---|---|---|
1 |
from PyQt5 import QtCore, QtGui, QtWidgets |
|
2 |
from PyQt5.QtWidgets import * |
|
3 |
import os |
|
4 |
from Project import Project |
|
5 |
from AppDocData import AppDocData |
|
6 |
import ItemDataAddEdit_UI |
|
7 |
|
|
8 |
class QBMSymbolAddDialog(QDialog): |
|
9 |
def __init__(self, parent, symbol_list): |
|
10 |
QDialog.__init__(self, parent) |
|
11 |
|
|
12 |
self.ui = ItemDataAddEdit_UI.Ui_ItemDataAddEditDialog() |
|
13 |
self.ui.setupUi(self) |
|
14 |
|
|
15 |
self.symbol_list = symbol_list |
|
16 |
self.isAccepted = False |
|
17 |
self.name = '' |
|
18 |
|
|
19 |
def showDialog(self): |
|
20 |
self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) |
|
21 |
self.exec_() |
|
22 |
return self.isAccepted, self.name |
|
23 |
|
|
24 |
def accept(self): |
|
25 |
self.name = self.ui.lineEdit.text() |
|
26 |
|
|
27 |
if not self.validationCheck(): |
|
28 |
QMessageBox.warning(self, self.tr('Notice'), self.tr('Please check symbol name')) |
|
29 |
return |
|
30 |
self.isAccepted = True |
|
31 |
QDialog.accept(self) |
|
32 |
|
|
33 |
def reject(self): |
|
34 |
QDialog.reject(self) |
|
35 |
|
|
36 |
def validationCheck(self): |
|
37 |
if self.name == '' or self.name in self.symbol_list: |
|
38 |
return False |
|
39 |
return True |
DTI_PID/DTI_PID/ItemDataAddEditDialog.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
|
|
3 |
# Form implementation generated from reading ui file 'ProjectDialog.ui' |
|
4 |
# |
|
5 |
# Created by: PyQt5 UI code generator 5.6 |
|
6 |
# |
|
7 |
# WARNING! All changes made in this file will be lost! |
|
8 |
|
|
9 | 1 |
from PyQt5 import QtCore, QtGui, QtWidgets |
10 | 2 |
from PyQt5.QtWidgets import * |
11 | 3 |
import os |
DTI_PID/DTI_PID/ItemDataAddEdit_UI.py | ||
---|---|---|
11 | 11 |
class Ui_ItemDataAddEditDialog(object): |
12 | 12 |
def setupUi(self, ItemDataAddEditDialog): |
13 | 13 |
ItemDataAddEditDialog.setObjectName("ItemDataAddEditDialog") |
14 |
ItemDataAddEditDialog.resize(650, 79)
|
|
15 |
ItemDataAddEditDialog.setMinimumSize(QtCore.QSize(650, 79))
|
|
14 |
ItemDataAddEditDialog.resize(450, 79)
|
|
15 |
ItemDataAddEditDialog.setMinimumSize(QtCore.QSize(450, 79))
|
|
16 | 16 |
ItemDataAddEditDialog.setMaximumSize(QtCore.QSize(650, 79)) |
17 | 17 |
font = QtGui.QFont() |
18 | 18 |
font.setFamily("맑은 고딕") |
... | ... | |
64 | 64 |
def retranslateUi(self, ItemDataAddEditDialog): |
65 | 65 |
_translate = QtCore.QCoreApplication.translate |
66 | 66 |
ItemDataAddEditDialog.setWindowTitle(_translate("ItemDataAddEditDialog", "Add")) |
67 |
self.label.setText(_translate("ItemDataAddEditDialog", "Column Name : "))
|
|
67 |
self.label.setText(_translate("ItemDataAddEditDialog", "Name : ")) |
|
68 | 68 |
|
69 | 69 |
|
70 | 70 |
if __name__ == "__main__": |
DTI_PID/DTI_PID/UI/BMSetting.ui | ||
---|---|---|
29 | 29 |
<layout class="QGridLayout" name="gridLayout_5"> |
30 | 30 |
<item row="0" column="0"> |
31 | 31 |
<layout class="QGridLayout" name="gridLayout_3"> |
32 |
<item row="0" column="0"> |
|
32 |
<item row="0" column="1" rowspan="3"> |
|
33 |
<widget class="QTreeView" name="treeViewSymbolMapping"/> |
|
34 |
</item> |
|
35 |
<item row="2" column="0"> |
|
33 | 36 |
<widget class="QTableView" name="tableViewSymbolList"/> |
34 | 37 |
</item> |
35 |
<item row="0" column="1"> |
|
36 |
<widget class="QTreeView" name="treeViewSymbolMapping"/> |
|
38 |
<item row="1" column="0"> |
|
39 |
<layout class="QHBoxLayout" name="horizontalLayout"> |
|
40 |
<item> |
|
41 |
<spacer name="horizontalSpacer"> |
|
42 |
<property name="orientation"> |
|
43 |
<enum>Qt::Horizontal</enum> |
|
44 |
</property> |
|
45 |
<property name="sizeHint" stdset="0"> |
|
46 |
<size> |
|
47 |
<width>40</width> |
|
48 |
<height>20</height> |
|
49 |
</size> |
|
50 |
</property> |
|
51 |
</spacer> |
|
52 |
</item> |
|
53 |
<item> |
|
54 |
<widget class="QPushButton" name="pushButtonAdd"> |
|
55 |
<property name="text"> |
|
56 |
<string>Add</string> |
|
57 |
</property> |
|
58 |
</widget> |
|
59 |
</item> |
|
60 |
<item> |
|
61 |
<widget class="QPushButton" name="pushButtonDelete"> |
|
62 |
<property name="text"> |
|
63 |
<string>Delete</string> |
|
64 |
</property> |
|
65 |
</widget> |
|
66 |
</item> |
|
67 |
</layout> |
|
37 | 68 |
</item> |
38 | 69 |
</layout> |
39 | 70 |
</item> |
DTI_PID/DTI_PID/UI/ItemDataAddEdit.ui | ||
---|---|---|
6 | 6 |
<rect> |
7 | 7 |
<x>0</x> |
8 | 8 |
<y>0</y> |
9 |
<width>650</width>
|
|
9 |
<width>450</width>
|
|
10 | 10 |
<height>79</height> |
11 | 11 |
</rect> |
12 | 12 |
</property> |
13 | 13 |
<property name="minimumSize"> |
14 | 14 |
<size> |
15 |
<width>650</width>
|
|
15 |
<width>450</width>
|
|
16 | 16 |
<height>79</height> |
17 | 17 |
</size> |
18 | 18 |
</property> |
... | ... | |
46 | 46 |
</font> |
47 | 47 |
</property> |
48 | 48 |
<property name="text"> |
49 |
<string>Column Name : </string>
|
|
49 |
<string>Name : </string> |
|
50 | 50 |
</property> |
51 | 51 |
</widget> |
52 | 52 |
</item> |
내보내기 Unified diff