개정판 ba7d75e6
issue #948: 리본 메뉴 적용
Change-Id: I9b0233253f4977b0c3308cf3f6a209ce57508286
DTI_PID/DTI_PID/App.py | ||
---|---|---|
85 | 85 |
file.close() |
86 | 86 |
|
87 | 87 |
def load_language(self, language_file): |
88 |
""" |
|
89 |
load translator with given language file |
|
90 |
""" |
|
88 |
""" load translator with given language file """ |
|
91 | 89 |
try: |
92 | 90 |
if self._translator is not None: |
93 | 91 |
self.removeTranslator(self._translator) |
DTI_PID/DTI_PID/AppRibbon.py | ||
---|---|---|
1 |
# coding: utf-8 |
|
2 |
""" This is license module """ |
|
3 |
|
|
4 |
import sys |
|
5 |
import os |
|
6 |
from functools import partial |
|
7 |
|
|
8 |
from PyQt5.QtCore import * |
|
9 |
from PyQt5.QtGui import * |
|
10 |
from PyQt5.QtWidgets import * |
|
11 |
from PyQt5.QtSvg import * |
|
12 |
from PyQt5.QtCore import QTranslator |
|
13 |
from PyQt5.QtCore import QLocale |
|
14 |
|
|
15 |
# PyQtRibbon: import, and error msg if not installed |
|
16 |
try: |
|
17 |
from PyQtRibbon.FileMenu import QFileMenu, QFileMenuPanel |
|
18 |
from PyQtRibbon.RecentFilesManager import QRecentFilesManager |
|
19 |
from PyQtRibbon.Ribbon import QRibbon, QRibbonTab, QRibbonSection |
|
20 |
except (ImportError, NameError): |
|
21 |
errormsg = 'You haven\'t installed PyQtRibbon, or your installation of it is broken. Please download or fix it.' |
|
22 |
raise Exception(errormsg) |
|
23 |
|
|
24 |
|
|
25 |
class AppRibbon(QRibbon): |
|
26 |
""" Class that represents App ribbon """ |
|
27 |
def __init__(self): |
|
28 |
""" Creates and initializes the App Ribbon """ |
|
29 |
QRibbon.__init__(self) |
|
30 |
|
|
31 |
self._panes = {} |
|
32 |
|
|
33 |
# Set up the file menu |
|
34 |
self.fileMenu = AppRibbonFileMenu() |
|
35 |
self.setFileMenu(self.fileMenu) |
|
36 |
|
|
37 |
# Add tabs |
|
38 |
self.add_home_tab() |
|
39 |
self.add_edit_tab() |
|
40 |
self.add_data_tab() |
|
41 |
self.add_view_tab() |
|
42 |
self.add_tool_tab() |
|
43 |
self.add_help_tab() |
|
44 |
|
|
45 |
def get_pane(self, name: str) -> QWidget: |
|
46 |
return self._panes[name] if name in self._panes else None |
|
47 |
|
|
48 |
def add_home_tab(self) -> None: |
|
49 |
""" Adds the Home Tab """ |
|
50 |
from App import App |
|
51 |
from AppDocData import AppDocData |
|
52 |
from AppRibbonPanes import QHomeFilePane, QHomePane, QHomeVisualizationPane |
|
53 |
from LineTypeConditions import LineTypeConditions |
|
54 |
from DisplayColors import DisplayColors |
|
55 |
from DisplayColors import DisplayOptions |
|
56 |
|
|
57 |
try: |
|
58 |
tab = self.addTab(self.tr('Home')) |
|
59 |
app_doc_data = AppDocData.instance() |
|
60 |
main_wnd = App.mainWnd() |
|
61 |
|
|
62 |
# File Section |
|
63 |
cSection = tab.addSection(self.tr('File')) |
|
64 |
pane = QHomeFilePane() |
|
65 |
self._panes['Home File'] = pane |
|
66 |
pane.ui.toolButtonFileOpen.clicked.connect(partial(main_wnd.open_image_drawing, None)) |
|
67 |
shortcut = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_O), pane.ui.toolButtonFileOpen) |
|
68 |
shortcut.activated.connect(partial(main_wnd.open_image_drawing, None)) |
|
69 |
pane.ui.toolButtonFileSave.clicked.connect(main_wnd.actionSaveCliked) |
|
70 |
shortcut = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_S), pane.ui.toolButtonFileSave) |
|
71 |
shortcut.activated.connect(main_wnd.actionSaveCliked) |
|
72 |
cSection.addCustomWidget(pane) |
|
73 |
|
|
74 |
# Home Section |
|
75 |
cSection = tab.addSection(self.tr('Home')) |
|
76 |
pane = QHomePane() |
|
77 |
self._panes['Home'] = pane |
|
78 |
pane.ui.toolButtonRecognition.clicked.connect(main_wnd.recognize) |
|
79 |
shortcut = QShortcut(QKeySequence(Qt.Key_F5), pane.ui.toolButtonRecognition) |
|
80 |
shortcut.activated.connect(main_wnd.recognize) |
|
81 |
pane.ui.toolButtonStreamline.clicked.connect(main_wnd.on_streamline) |
|
82 |
pane.ui.toolButtonLinkAttribute.clicked.connect(main_wnd.connect_attributes) |
|
83 |
pane.ui.toolButtonInitialize.clicked.connect(main_wnd.on_initialize_scene) |
|
84 |
pane.ui.toolButtonUndo.clicked.connect(main_wnd._scene.undo_stack.undo) |
|
85 |
pane.ui.toolButtonRedo.clicked.connect(main_wnd._scene.undo_stack.redo) |
|
86 |
pane.ui.toolButtonLine.clicked.connect(main_wnd.onPlaceLine) |
|
87 |
|
|
88 |
"""fill line type""" |
|
89 |
for condition in LineTypeConditions.items(): |
|
90 |
pane.ui.comboBoxLineType.addItem(condition.name) |
|
91 |
|
|
92 |
configs = app_doc_data.getConfigs('Line', 'Default Type') |
|
93 |
value = configs[0].value if 1 == len(configs) else '' |
|
94 |
if value: |
|
95 |
at = pane.ui.comboBoxLineType.findText(value) |
|
96 |
pane.ui.comboBoxLineType.setCurrentIndex(at) |
|
97 |
else: |
|
98 |
at = pane.ui.comboBoxLineType.findText('Secondary') |
|
99 |
pane.ui.comboBoxLineType.setCurrentIndex(at) |
|
100 |
"""up to here""" |
|
101 |
|
|
102 |
pane.ui.toolButtonOCR.clicked.connect(main_wnd.onAreaOcr) |
|
103 |
pane.ui.toolButtonVendor.clicked.connect(main_wnd.onVendor) |
|
104 |
pane.ui.comboBoxPackage.addItems(['Equipment Package', 'Vendor Package']) |
|
105 |
pane.ui.toolButtonValidate.clicked.connect(main_wnd.onValidation) |
|
106 |
pane.ui.toolButtonRotateCW.clicked.connect(main_wnd.onRotate) |
|
107 |
cSection.addCustomWidget(pane) |
|
108 |
|
|
109 |
# Visualization Section |
|
110 |
cSection = tab.addSection(self.tr('Visualization')) |
|
111 |
pane = QHomeVisualizationPane() |
|
112 |
self._panes['Home Visualization'] = pane |
|
113 |
pane.ui.radioButtonByGroup.toggled.connect(main_wnd.display_colors) |
|
114 |
pane.ui.radioButtonByType.toggled.connect(main_wnd.display_colors) |
|
115 |
pane.ui.radioButtonByStreamNo.toggled.connect(main_wnd.display_colors) |
|
116 |
if DisplayColors.instance().option == DisplayOptions.DisplayByLineNo: |
|
117 |
pane.ui.radioButtonByGroup.setChecked(True) |
|
118 |
elif DisplayColors.instance().option == DisplayOptions.DisplayByLineType: |
|
119 |
pane.ui.radioButtonByType.setChecked(True) |
|
120 |
elif DisplayColors.instance().option == DisplayOptions.DisplayByStreamNo: |
|
121 |
pane.ui.radioButtonByStreamNo.setChecked(True) |
|
122 |
|
|
123 |
pane.ui.toolButtonZoom.clicked.connect(main_wnd.onAreaZoom) |
|
124 |
pane.ui.toolButtonFitWindow.clicked.connect(main_wnd.fitWindow) |
|
125 |
cSection.addCustomWidget(pane) |
|
126 |
except Exception as ex: |
|
127 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
128 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
129 |
|
|
130 |
def add_edit_tab(self) -> None: |
|
131 |
""" Adds the Edit Tab """ |
|
132 |
from App import App |
|
133 |
from AppRibbonPanes import QEditPane |
|
134 |
|
|
135 |
try: |
|
136 |
tab = self.addTab(self.tr('Edit')) # "Edit" |
|
137 |
main_wnd = App.mainWnd() |
|
138 |
|
|
139 |
# File Section |
|
140 |
cSection = tab.addSection(self.tr('Edit')) |
|
141 |
pane = QEditPane() |
|
142 |
pane.ui.toolButtonFindReplaceText.clicked.connect(main_wnd.findReplaceTextClicked) |
|
143 |
pane.ui.toolButtonTextDataList.clicked.connect(main_wnd.showTextDataList) |
|
144 |
pane.ui.toolButtonSymbolReplaceInsert.clicked.connect(main_wnd.replaceInsertSymbolClicked) |
|
145 |
pane.ui.toolButtonConnectLineToSymbol.clicked.connect(main_wnd.on_connect_line_to_symbol) |
|
146 |
cSection.addCustomWidget(pane) |
|
147 |
except Exception as ex: |
|
148 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
149 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
150 |
|
|
151 |
def add_data_tab(self) -> None: |
|
152 |
"""Adds the Data Tab""" |
|
153 |
from App import App |
|
154 |
from AppRibbonPanes import QDataPane |
|
155 |
|
|
156 |
try: |
|
157 |
tab = self.addTab(self.tr('Data')) # "Data" |
|
158 |
main_wnd = App.mainWnd() |
|
159 |
|
|
160 |
# File Section |
|
161 |
cSection = tab.addSection(self.tr('Data')) |
|
162 |
pane = QDataPane() |
|
163 |
pane.ui.toolButtonHMBData.clicked.connect(main_wnd.onHMBData) |
|
164 |
pane.ui.toolButtonEngInfoList.clicked.connect(main_wnd.showItemDataList) |
|
165 |
pane.ui.toolButtonSpecialItemTypes.clicked.connect(main_wnd.on_show_special_item_types) |
|
166 |
pane.ui.toolButtonOPCRelation.clicked.connect(main_wnd.on_show_opc_relation) |
|
167 |
pane.ui.toolButtonCodeTable.clicked.connect(main_wnd.onShowCodeTable) |
|
168 |
pane.ui.toolButtonCustomCodeTable.clicked.connect(main_wnd.onShowCustomCodeTable) |
|
169 |
pane.ui.toolButtonReplaceCodeTable.clicked.connect(main_wnd.onShowReplaceCodeTable) |
|
170 |
pane.ui.toolButtonGlobalValidation.clicked.connect(main_wnd.on_validation_global_clicked) |
|
171 |
pane.ui.toolButtonOCRTraining.clicked.connect(main_wnd.oCRTrainingClicked) |
|
172 |
pane.ui.toolButtonSymbolTraining.clicked.connect(main_wnd.symbolTrainingClicked) |
|
173 |
pane.ui.toolButtonMakeLabelData.clicked.connect(main_wnd.on_make_label_data) |
|
174 |
cSection.addCustomWidget(pane) |
|
175 |
except Exception as ex: |
|
176 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
177 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
178 |
|
|
179 |
def add_view_tab(self) -> None: |
|
180 |
"""Adds the View Tab""" |
|
181 |
from App import App |
|
182 |
from AppRibbonPanes import QViewPane |
|
183 |
|
|
184 |
try: |
|
185 |
tab = self.addTab(self.tr('View')) |
|
186 |
main_wnd = App.mainWnd() |
|
187 |
|
|
188 |
# View Section |
|
189 |
cSection = tab.addSection(self.tr('View')) |
|
190 |
pane = QViewPane() |
|
191 |
self._panes['View'] = pane |
|
192 |
pane.ui.toolButtonViewImageDrawing.clicked.connect(main_wnd.onViewImageDrawing) |
|
193 |
pane.ui.toolButtonViewText.clicked.connect(main_wnd.onViewText) |
|
194 |
pane.ui.toolButtonViewSymbol.clicked.connect(main_wnd.onViewSymbol) |
|
195 |
pane.ui.toolButtonViewLine.clicked.connect(main_wnd.onViewLine) |
|
196 |
pane.ui.toolButtonViewUnknown.clicked.connect(main_wnd.onViewUnknown) |
|
197 |
pane.ui.toolButtonViewInconsistency.clicked.connect(main_wnd.onViewInconsistency) |
|
198 |
pane.ui.toolButtonViewVendorArea.clicked.connect(main_wnd.onViewVendorArea) |
|
199 |
pane.ui.toolButtonViewDrawingOnly.clicked.connect(main_wnd.onViewDrawingOnly) |
|
200 |
cSection.addCustomWidget(pane) |
|
201 |
except Exception as ex: |
|
202 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
203 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
204 |
|
|
205 |
def add_tool_tab(self) -> None: |
|
206 |
"""Adds the Tool Tab""" |
|
207 |
from App import App |
|
208 |
from AppRibbonPanes import QToolPane |
|
209 |
|
|
210 |
try: |
|
211 |
tab = self.addTab(self.tr('Tool')) |
|
212 |
main_wnd = App.mainWnd() |
|
213 |
|
|
214 |
# Tool Section |
|
215 |
cSection = tab.addSection(self.tr('Tool')) |
|
216 |
pane = QToolPane() |
|
217 |
pane.ui.toolButtonPDFToImage.clicked.connect(main_wnd.onConvertPDFToImage) |
|
218 |
pane.ui.toolButtonImportTextFromCAD.clicked.connect(main_wnd.on_import_text_from_cad) |
|
219 |
pane.ui.toolButtonImportTextFromCADforInstrument.clicked.connect(main_wnd.on_import_text_from_cad_for_instrument) |
|
220 |
pane.ui.toolButtonSymbolThicknessReinforcement.clicked.connect(main_wnd.onSymbolThickness) |
|
221 |
pane.ui.toolButtonDataTransfer.clicked.connect(main_wnd.on_show_data_transfer) |
|
222 |
pane.ui.toolButtonDataExport.clicked.connect(main_wnd.on_show_data_export) |
|
223 |
cSection.addCustomWidget(pane) |
|
224 |
except Exception as ex: |
|
225 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
226 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
227 |
|
|
228 |
def add_help_tab(self) -> None: |
|
229 |
""" Adds the Help Tab """ |
|
230 |
from App import App |
|
231 |
from AppRibbonPanes import QHelpPane |
|
232 |
|
|
233 |
try: |
|
234 |
tab = self.addTab('Help') |
|
235 |
main_wnd = App.mainWnd() |
|
236 |
|
|
237 |
# Help Section |
|
238 |
cSection = tab.addSection('Help') |
|
239 |
pane = QHelpPane() |
|
240 |
pane.ui.toolButtonHelp.clicked.connect(main_wnd.on_help) |
|
241 |
shortcut = QShortcut(QKeySequence(Qt.Key_F1), pane.ui.toolButtonHelp) |
|
242 |
shortcut.activated.connect(main_wnd.on_help) |
|
243 |
pane.ui.toolButtonReadme.clicked.connect(main_wnd.on_readme) |
|
244 |
cSection.addCustomWidget(pane) |
|
245 |
except Exception as ex: |
|
246 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
247 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
248 |
|
|
249 |
|
|
250 |
class AppRibbonFileMenu(QFileMenu): |
|
251 |
""" Widget that represents the file menu for the ribbon """ |
|
252 |
def __init__(self): |
|
253 |
""" Creates and initializes the menu """ |
|
254 |
from App import App |
|
255 |
from AppRibbonPanes import QConfigPane |
|
256 |
|
|
257 |
QFileMenu.__init__(self) |
|
258 |
self._panes = {} |
|
259 |
main_wnd = App.mainWnd() |
|
260 |
|
|
261 |
self.addButton(icon=':/newPrefix/setup_area.png', title=self.tr('Area Setup'), handler=main_wnd.areaConfiguration) |
|
262 |
self.addButton(icon=':/newPrefix/setting.png', title=self.tr('Configuration'), handler=main_wnd.configuration) |
|
263 |
self.addSeparator() |
|
264 |
pane = QConfigPane() |
|
265 |
self._addBtn(pane) |
|
266 |
self._panes['Config'] = pane |
|
267 |
self.addSeparator() |
|
268 |
self.addButton(icon=':/newPrefix/Exit.svg', title=self.tr('Exit'), handler=main_wnd.close) |
|
269 |
|
|
270 |
def get_pane(self, name: str) -> QWidget: |
|
271 |
return self._panes[name] if name in self._panes else None |
|
272 |
|
|
273 |
def handleRecentFileClicked(self, path): |
|
274 |
""" Handles recent files being clicked """ |
|
275 |
pass |
DTI_PID/DTI_PID/AppRibbonPanes.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
import sys, os |
|
3 |
from functools import partial |
|
4 |
|
|
5 |
if 'PyQt5' in sys.modules: |
|
6 |
from PyQt5 import QtCore, QtGui, QtWidgets |
|
7 |
from PyQt5.QtWidgets import * |
|
8 |
else: |
|
9 |
from PySide2 import QtCore, QtGui, QtWidgets |
|
10 |
from PySide2.QtWidgets import * |
|
11 |
|
|
12 |
|
|
13 |
class QHomeFilePane(QWidget): |
|
14 |
def __init__(self): |
|
15 |
from PyQt5 import QtWidgets, uic |
|
16 |
|
|
17 |
QWidget.__init__(self) |
|
18 |
ui_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'Home_File.ui') |
|
19 |
uiClass, qtBaseClass = uic.loadUiType(ui_file_path) |
|
20 |
self.ui = uiClass() |
|
21 |
self.ui.setupUi(self) |
|
22 |
|
|
23 |
|
|
24 |
class QHomePane(QWidget): |
|
25 |
def __init__(self): |
|
26 |
import os |
|
27 |
from PyQt5 import QtWidgets, uic |
|
28 |
|
|
29 |
QWidget.__init__(self) |
|
30 |
config_ui_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'Home.ui') |
|
31 |
uiClass, qtBaseClass = uic.loadUiType(config_ui_path) |
|
32 |
self.ui = uiClass() |
|
33 |
self.ui.setupUi(self) |
|
34 |
|
|
35 |
|
|
36 |
class QHomeVisualizationPane(QWidget): |
|
37 |
def __init__(self): |
|
38 |
import os |
|
39 |
from PyQt5 import QtWidgets, uic |
|
40 |
|
|
41 |
QWidget.__init__(self) |
|
42 |
ui_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'Home_Visualization.ui') |
|
43 |
uiClass, qtBaseClass = uic.loadUiType(ui_file_path) |
|
44 |
self.ui = uiClass() |
|
45 |
self.ui.setupUi(self) |
|
46 |
|
|
47 |
|
|
48 |
class QEditPane(QWidget): |
|
49 |
def __init__(self): |
|
50 |
import os |
|
51 |
from PyQt5 import QtWidgets, uic |
|
52 |
|
|
53 |
QWidget.__init__(self) |
|
54 |
ui_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'Edit.ui') |
|
55 |
uiClass, qtBaseClass = uic.loadUiType(ui_file_path) |
|
56 |
self.ui = uiClass() |
|
57 |
self.ui.setupUi(self) |
|
58 |
|
|
59 |
|
|
60 |
class QDataPane(QWidget): |
|
61 |
def __init__(self): |
|
62 |
import os |
|
63 |
from PyQt5 import QtWidgets, uic |
|
64 |
|
|
65 |
QWidget.__init__(self) |
|
66 |
ui_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'Data.ui') |
|
67 |
uiClass, qtBaseClass = uic.loadUiType(ui_file_path) |
|
68 |
self.ui = uiClass() |
|
69 |
self.ui.setupUi(self) |
|
70 |
|
|
71 |
|
|
72 |
class QViewPane(QWidget): |
|
73 |
def __init__(self): |
|
74 |
import os |
|
75 |
from PyQt5 import QtWidgets, uic |
|
76 |
|
|
77 |
QWidget.__init__(self) |
|
78 |
ui_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'View.ui') |
|
79 |
uiClass, qtBaseClass = uic.loadUiType(ui_file_path) |
|
80 |
self.ui = uiClass() |
|
81 |
self.ui.setupUi(self) |
|
82 |
|
|
83 |
|
|
84 |
class QToolPane(QWidget): |
|
85 |
def __init__(self): |
|
86 |
import os |
|
87 |
from PyQt5 import QtWidgets, uic |
|
88 |
|
|
89 |
QWidget.__init__(self) |
|
90 |
ui_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'Tool.ui') |
|
91 |
uiClass, qtBaseClass = uic.loadUiType(ui_file_path) |
|
92 |
self.ui = uiClass() |
|
93 |
self.ui.setupUi(self) |
|
94 |
|
|
95 |
|
|
96 |
class QHelpPane(QWidget): |
|
97 |
def __init__(self): |
|
98 |
import os |
|
99 |
from PyQt5 import QtWidgets, uic |
|
100 |
|
|
101 |
QWidget.__init__(self) |
|
102 |
config_ui_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'Help.ui') |
|
103 |
uiClass, qtBaseClass = uic.loadUiType(config_ui_path) |
|
104 |
self.ui = uiClass() |
|
105 |
self.ui.setupUi(self) |
|
106 |
|
|
107 |
|
|
108 |
class QConfigPane(QWidget): |
|
109 |
def __init__(self): |
|
110 |
import os |
|
111 |
from PyQt5 import QtWidgets, uic |
|
112 |
from App import App |
|
113 |
from AppDocData import AppDocData |
|
114 |
|
|
115 |
QWidget.__init__(self) |
|
116 |
config_ui_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI', 'Config.ui') |
|
117 |
uiClass, qtBaseClass = uic.loadUiType(config_ui_path) |
|
118 |
self.ui = uiClass() |
|
119 |
self.ui.setupUi(self) |
|
120 |
|
|
121 |
# load stylesheet file list |
|
122 |
stylesheet_name = App.instance().stylesheet_name |
|
123 |
files = [os.path.splitext(file)[0] for file in os.listdir(os.path.dirname(os.path.realpath(__file__))) |
|
124 |
if os.path.splitext(file)[1] == '.qss'] |
|
125 |
self.ui.comboBoxTheme.addItems(files) |
|
126 |
self.ui.comboBoxTheme.currentIndexChanged.connect(self.on_theme_changed) |
|
127 |
|
|
128 |
app_doc_data = AppDocData.instance() |
|
129 |
configs = app_doc_data.getAppConfigs('app', 'stylesheet') |
|
130 |
if configs and len(configs) == 1: |
|
131 |
found = self.ui.comboBoxTheme.findText(configs[0].value) |
|
132 |
if -1 != found: |
|
133 |
self.ui.comboBoxTheme.setCurrentIndex(found) |
|
134 |
# up to here |
|
135 |
|
|
136 |
# load language files |
|
137 |
language_name = App.instance().language_name |
|
138 |
files = ['en_us'] # english is default language |
|
139 |
files.extend([os.path.splitext(file)[0] for file in |
|
140 |
os.listdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'translate')) if |
|
141 |
os.path.splitext(file)[1] == '.qm']) |
|
142 |
self.ui.comboBoxLanguage.addItems(files) |
|
143 |
self.ui.comboBoxLanguage.currentIndexChanged.connect(self.on_language_changed) |
|
144 |
|
|
145 |
configs = app_doc_data.getAppConfigs('app', 'language') |
|
146 |
if configs and len(configs) == 1: |
|
147 |
found = self.ui.comboBoxLanguage.findText(configs[0].value) |
|
148 |
if -1 != found: |
|
149 |
self.ui.comboBoxLanguage.setCurrentIndex(found) |
|
150 |
# up to here |
|
151 |
|
|
152 |
def on_theme_changed(self, index: int): |
|
153 |
from App import App |
|
154 |
|
|
155 |
if index != -1: |
|
156 |
theme = self.ui.comboBoxTheme.currentText() |
|
157 |
App.mainWnd().load_stylesheet(theme) |
|
158 |
|
|
159 |
def on_language_changed(self, index: int): |
|
160 |
from App import App |
|
161 |
|
|
162 |
if index != -1: |
|
163 |
language = self.ui.comboBoxLanguage.currentText() |
|
164 |
App.mainWnd().load_language(language) |
DTI_PID/DTI_PID/DisplayColors.py | ||
---|---|---|
14 | 14 |
""" This is display options class """ |
15 | 15 |
DisplayByLineNo = 1 |
16 | 16 |
DisplayByLineType = 2 |
17 |
DisplayByStreamNo = 3 |
|
17 | 18 |
|
18 | 19 |
|
19 | 20 |
class DisplayColors(SingletonInstance): |
20 |
""" |
|
21 |
This is display colors class |
|
22 |
""" |
|
21 |
""" This is display colors class """ |
|
23 | 22 |
|
24 | 23 |
def __init__(self, option=DisplayOptions.DisplayByLineNo): |
25 | 24 |
self._option = option |
DTI_PID/DTI_PID/License.py | ||
---|---|---|
152 | 152 |
return False |
153 | 153 |
|
154 | 154 |
@staticmethod |
155 |
def count_up(): |
|
156 |
"""count up""" |
|
157 |
from AppDocData import AppDocData |
|
158 |
import requests |
|
159 |
|
|
160 |
try: |
|
161 |
appDocData = AppDocData.instance() |
|
162 |
configs = appDocData.getAppConfigs('app', 'license') |
|
163 |
if configs and 1 == len(configs) and 3 == len(configs[0].value.split('.')): |
|
164 |
key = '795hi#(7qq5&p#f3ysa#n-449h8g_n95olca)b%t23s7!w%v0m' |
|
165 |
"""license type 2""" |
|
166 |
api, headers = 'http://smartfeedwebapi.azurewebsites.net/api/License/Count', \ |
|
167 |
{'Content-Type': 'application/json; charset=utf-8', 'x-auth-token': configs[0].value} |
|
168 |
response = requests.post(api, headers=headers) |
|
169 |
finally: |
|
170 |
pass |
|
171 |
|
|
172 |
@staticmethod |
|
155 | 173 |
def encode(key, clear): |
156 | 174 |
enc = [] |
157 | 175 |
for i in range(len(clear)): |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
86 | 86 |
def __init__(self): |
87 | 87 |
"""initialize""" |
88 | 88 |
from App import App |
89 |
from AppRibbon import AppRibbon |
|
89 | 90 |
from LineTypeConditions import LineTypeConditions |
90 | 91 |
|
91 | 92 |
super(self.__class__, self).__init__() |
92 | 93 |
self.setupUi(self) |
94 |
|
|
93 | 95 |
self.progress_bar = QProgressBar() |
94 | 96 |
self._label_mouse = QLabel(self.statusbar) |
95 | 97 |
self._label_mouse.setText(self.tr('mouse pos : ({},{})'.format(0, 0))) |
... | ... | |
122 | 124 |
# save timer |
123 | 125 |
self.save_timer = None |
124 | 126 |
|
125 |
self.lineComboBox = QComboBox(self.toolBar) |
|
126 |
for condition in LineTypeConditions.items(): |
|
127 |
self.lineComboBox.addItem(condition.name) |
|
128 |
|
|
129 |
configs = app_doc_data.getConfigs('Line', 'Default Type') |
|
130 |
value = configs[0].value if 1 == len(configs) else '' |
|
131 |
if value: |
|
132 |
at = self.lineComboBox.findText(value) |
|
133 |
self.lineComboBox.setCurrentIndex(at) |
|
134 |
else: |
|
135 |
at = self.lineComboBox.findText('Secondary') |
|
136 |
self.lineComboBox.setCurrentIndex(at) |
|
137 |
|
|
138 |
self.toolBar.insertWidget(self.actionOCR, self.lineComboBox) |
|
139 |
self.toolBar.insertSeparator(self.actionOCR) |
|
140 |
|
|
141 |
self.packageComboBox = QComboBox(self.toolBar) |
|
142 |
self.packageComboBox.addItems(['Equipment Package', 'Vendor Package']) |
|
143 |
self.toolBar.insertWidget(self.actionValidate, self.packageComboBox) |
|
144 |
|
|
145 | 127 |
self._scene = QtImageViewerScene(self) |
146 | 128 |
|
147 | 129 |
self.graphicsView = QtImageViewer(self) |
... | ... | |
150 | 132 |
self.graphicsView.setMouseTracking(True) |
151 | 133 |
self.graphicsView.viewport().installEventFilter(self) |
152 | 134 |
self.graphicsView.setScene(self._scene) |
153 |
|
|
154 |
self._display_widget = QDisplayWidget() |
|
155 |
self._display_widget.radioButtonByGroup.toggled.connect(self.display_colors) |
|
156 |
self._display_widget.radioButtonByGroup.toggled.connect(self.display_colors) |
|
157 |
self.EditToolbar.addWidget(self._display_widget) |
|
158 |
self._display_widget.radioButtonByGroup.setChecked(True) \ |
|
159 |
if DisplayColors.instance().option == DisplayOptions.DisplayByLineNo else \ |
|
160 |
self._display_widget.radioButtonByType.setChecked(True) |
|
161 |
|
|
162 | 135 |
self.verticalLayout.addWidget(self.graphicsView) |
163 | 136 |
|
164 | 137 |
# Add Custom TreeWidget |
... | ... | |
299 | 272 |
self.treeWidgetDrawingList.itemDoubleClicked.connect(self.open_selected_drawing) |
300 | 273 |
self.load_drawing_list() |
301 | 274 |
|
302 |
# load stylesheet file list |
|
303 |
stylesheet_name = QtWidgets.qApp.stylesheet_name |
|
304 |
files = [os.path.splitext(file)[0] for file in os.listdir(os.path.dirname(os.path.realpath(__file__))) if |
|
305 |
os.path.splitext(file)[1] == '.qss'] |
|
306 |
for file in files: |
|
307 |
action = self.menuTheme.addAction(file) |
|
308 |
action.setCheckable(True) |
|
309 |
action.setChecked(True) if stylesheet_name == file else action.setChecked(False) |
|
310 |
action.triggered.connect(partial(self.load_stylesheet, file)) |
|
311 |
# up to here |
|
312 |
|
|
313 |
# load language files |
|
314 |
language_name = QtWidgets.qApp.language_name |
|
315 |
files = ['en_us'] # english is default language |
|
316 |
files.extend([os.path.splitext(file)[0] for file in |
|
317 |
os.listdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'translate')) if |
|
318 |
os.path.splitext(file)[1] == '.qm']) |
|
319 |
for file in files: |
|
320 |
action = self.menuLanguage.addAction(file) |
|
321 |
action.setCheckable(True) |
|
322 |
action.setChecked(True) if language_name.lower() == file.lower() else action.setChecked(False) |
|
323 |
action.triggered.connect(partial(self.load_language, file)) |
|
324 |
# up to here |
|
275 |
self.ribbon = AppRibbon() |
|
276 |
self.setMenuWidget(self.ribbon) |
|
277 |
|
|
278 |
view_pane = self.ribbon.get_pane('View') |
|
279 |
shortcut = QShortcut(QKeySequence(Qt.Key_1), view_pane.ui.toolButtonViewImageDrawing) |
|
280 |
shortcut.activated.connect(partial(self.on_view_toggle, Qt.Key_1)) |
|
281 |
shortcut = QShortcut(QKeySequence(Qt.Key_2), view_pane.ui.toolButtonViewText) |
|
282 |
shortcut.activated.connect(partial(self.on_view_toggle, Qt.Key_2)) |
|
283 |
shortcut = QShortcut(QKeySequence(Qt.Key_3), view_pane.ui.toolButtonViewSymbol) |
|
284 |
shortcut.activated.connect(partial(self.on_view_toggle, Qt.Key_3)) |
|
285 |
shortcut = QShortcut(QKeySequence(Qt.Key_4), view_pane.ui.toolButtonViewLine) |
|
286 |
shortcut.activated.connect(partial(self.on_view_toggle, Qt.Key_4)) |
|
287 |
shortcut = QShortcut(QKeySequence(Qt.Key_5), view_pane.ui.toolButtonViewUnknown) |
|
288 |
shortcut.activated.connect(partial(self.on_view_toggle, Qt.Key_5)) |
|
289 |
shortcut = QShortcut(QKeySequence(Qt.Key_6), view_pane.ui.toolButtonViewInconsistency) |
|
290 |
shortcut.activated.connect(partial(self.on_view_toggle, Qt.Key_6)) |
|
291 |
shortcut = QShortcut(QKeySequence(Qt.Key_7), view_pane.ui.toolButtonViewVendorArea) |
|
292 |
shortcut.activated.connect(partial(self.on_view_toggle, Qt.Key_7)) |
|
293 |
shortcut = QShortcut(QKeySequence(96), view_pane.ui.toolButtonViewDrawingOnly) |
|
294 |
shortcut.activated.connect(partial(self.on_view_toggle, 96)) |
|
325 | 295 |
|
326 | 296 |
# inconsistency table |
327 | 297 |
self.tableWidgetInconsistency.setColumnCount(3) |
... | ... | |
499 | 469 |
self.restoreGeometry(self.settings.value("geometry", "")) |
500 | 470 |
self.restoreState(self.settings.value("windowState", "")) |
501 | 471 |
except Exception as ex: |
502 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
503 |
sys.exc_info()[-1].tb_lineno) |
|
504 |
print(message) |
|
472 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
473 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
505 | 474 |
|
506 | 475 |
def load_stylesheet(self, file): |
507 | 476 |
"""load stylesheets""" |
... | ... | |
512 | 481 |
configs = [Config('app', 'stylesheet', file)] |
513 | 482 |
app_doc_data.saveAppConfigs(configs) |
514 | 483 |
|
515 |
for action in self.menuTheme.actions(): |
|
516 |
if action.text() == file: continue |
|
517 |
action.setChecked(False) |
|
518 |
|
|
519 | 484 |
def load_language(self, file): |
520 | 485 |
"""load language file and then apply selected language""" |
521 | 486 |
try: |
... | ... | |
525 | 490 |
app_doc_data = AppDocData.instance() |
526 | 491 |
configs = [Config('app', 'language', file)] |
527 | 492 |
app_doc_data.saveAppConfigs(configs) |
528 |
|
|
529 |
for action in self.menuLanguage.actions(): |
|
530 |
if action.text().lower() == file.lower(): continue |
|
531 |
action.setChecked(False) |
|
532 | 493 |
finally: |
533 | 494 |
self.retranslateUi(self) |
534 |
self.propertyTableWidget.retranslateUi() |
|
535 | 495 |
|
536 | 496 |
def refresh_item_list(self): |
537 | 497 |
"""refresh item tree""" |
... | ... | |
973 | 933 |
"""clear log""" |
974 | 934 |
self.listWidgetLog.clear() |
975 | 935 |
|
976 |
''' |
|
977 |
@brief rotate selected symbol |
|
978 |
@author humkyung |
|
979 |
@date 2018.08.15 |
|
980 |
''' |
|
981 |
|
|
982 | 936 |
def onRotate(self, action): |
937 |
"""rotate a selected symbol""" |
|
983 | 938 |
selected = [item for item in self.graphicsView.scene().selectedItems() if issubclass(type(item), SymbolSvgItem)] |
984 | 939 |
if len(selected) == 1: |
985 | 940 |
from RotateCommand import RotateCommand |
986 | 941 |
self.graphicsView.scene()._undo_stack.push(RotateCommand(self.graphicsView.scene(), selected)) |
987 | 942 |
|
988 |
''' |
|
989 |
@brief Area Zoom |
|
990 |
@author Jeongwoo |
|
991 |
@date 2018.06.27 |
|
992 |
@history connect command's rejected signal |
|
993 |
''' |
|
994 |
|
|
995 | 943 |
def onAreaZoom(self, action): |
996 |
if self.actionZoom.isChecked(): |
|
944 |
"""Area Zoom""" |
|
945 |
visualization_pane = self.ribbon.get_pane('Home Visualization') |
|
946 |
|
|
947 |
if visualization_pane.ui.toolButtonZoom.isChecked(): |
|
997 | 948 |
cmd = AreaZoomCommand.AreaZoomCommand(self.graphicsView) |
998 | 949 |
cmd.onRejected.connect(self.onCommandRejected) |
999 | 950 |
self.graphicsView.command = cmd |
1000 | 951 |
|
1001 | 952 |
def onVendor(self, action): |
1002 |
"""make vendor package area""" |
|
953 |
"""make vendor/equipment package area"""
|
|
1003 | 954 |
|
955 |
pane = self.ribbon.get_pane('Home') |
|
1004 | 956 |
if not self.graphicsView.hasImage(): |
1005 |
self.actionVendor.setChecked(False)
|
|
957 |
pane.ui.toolButtonVendor.setChecked(False)
|
|
1006 | 958 |
self.showImageSelectionMessageBox() |
1007 | 959 |
return |
1008 | 960 |
|
1009 |
self.actionVendor.setChecked(True) |
|
1010 |
if not hasattr(self.actionVendor, 'tag'): |
|
1011 |
self.actionVendor.tag = PlacePolygonCommand.PlacePolygonCommand(self.graphicsView) |
|
1012 |
self.actionVendor.tag.onSuccess.connect(self.onVendorCreated) |
|
1013 |
self.actionVendor.tag.onRejected.connect(self.onCommandRejected) |
|
961 |
pane = self.ribbon.get_pane('Home') |
|
962 |
checked = pane.ui.toolButtonVendor.isChecked() |
|
963 |
if not hasattr(pane.ui.toolButtonVendor, 'tag'): |
|
964 |
pane.ui.toolButtonVendor.tag = PlacePolygonCommand.PlacePolygonCommand(self.graphicsView) |
|
965 |
pane.ui.toolButtonVendor.tag.onSuccess.connect(self.onVendorCreated) |
|
966 |
pane.ui.toolButtonVendor.tag.onRejected.connect(self.onCommandRejected) |
|
1014 | 967 |
|
1015 |
self.graphicsView.command = self.actionVendor.tag
|
|
968 |
self.graphicsView.command = pane.ui.toolButtonVendor.tag
|
|
1016 | 969 |
|
1017 | 970 |
def onVendorCreated(self): |
1018 | 971 |
"""add created vendor polygon area to scene""" |
1019 | 972 |
|
1020 | 973 |
try: |
1021 |
count = len(self.actionVendor.tag._polyline._vertices) |
|
974 |
vendor_tool = self.ribbon.get_pane('Home').ui.toolButtonVendor |
|
975 |
package_combo = self.ribbon.get_pane('Home').ui.comboBoxPackage |
|
976 |
count = len(vendor_tool.tag._polyline._vertices) |
|
1022 | 977 |
if count > 2: |
1023 | 978 |
points = [] |
1024 |
for point in self.actionVendor.tag._polyline._vertices:
|
|
979 |
for point in vendor_tool.tag._polyline._vertices:
|
|
1025 | 980 |
points.append(QPoint(round(point[0]), round(point[1]))) |
1026 | 981 |
polygon = QPolygonF(points) |
1027 |
item = QEngineeringVendorItem(polygon, pack_type=self.packageComboBox.currentText())
|
|
982 |
item = QEngineeringVendorItem(polygon, pack_type=package_combo.currentText())
|
|
1028 | 983 |
item.area = 'Drawing' |
1029 | 984 |
item.transfer.onRemoved.connect(self.itemRemoved) |
1030 | 985 |
self.graphicsView.scene().addItem(item) |
1031 | 986 |
finally: |
1032 |
self.graphicsView.scene().removeItem(self.actionVendor.tag._polyline)
|
|
1033 |
self.actionVendor.tag.reset()
|
|
987 |
self.graphicsView.scene().removeItem(vendor_tool.tag._polyline)
|
|
988 |
vendor_tool.tag.reset()
|
|
1034 | 989 |
|
1035 | 990 |
def fitWindow(self, view_rect: QRectF = QRectF()): |
1036 | 991 |
"""Fit Window""" |
... | ... | |
1238 | 1193 |
else: |
1239 | 1194 |
self.graphicsView.useDefaultCommand() |
1240 | 1195 |
|
1241 |
''' |
|
1242 |
@brief Area OCR |
|
1243 |
@author Jeongwoo |
|
1244 |
@date 18.04.18 |
|
1245 |
@history 2018.05.02 Jeongwoo Change graphicsView.command by actionOCR checked state |
|
1246 |
Show MessageBox when imageviewer doesn't have image |
|
1247 |
''' |
|
1248 |
|
|
1249 | 1196 |
def onAreaOcr(self): |
1197 |
"""Area OCR""" |
|
1250 | 1198 |
if not self.graphicsView.hasImage(): |
1251 | 1199 |
self.actionOCR.setChecked(False) |
1252 | 1200 |
self.showImageSelectionMessageBox() |
1253 | 1201 |
return |
1254 | 1202 |
|
1255 |
if self.actionOCR.isChecked(): |
|
1203 |
pane = self.ribbon.get_pane('Home') |
|
1204 |
checked = pane.ui.toolButtonOCR.isChecked() |
|
1205 |
if checked: |
|
1256 | 1206 |
cmd = AreaOcrCommand.AreaOcrCommand(self.graphicsView) |
1257 | 1207 |
cmd.onSuccess.connect(self.onRecognizeText) |
1258 | 1208 |
cmd.onRejected.connect(self.onCommandRejected) |
... | ... | |
1260 | 1210 |
else: |
1261 | 1211 |
self.graphicsView.useDefaultCommand() |
1262 | 1212 |
|
1263 |
''' |
|
1264 |
@brief show text recognition dialog |
|
1265 |
@author humkyung |
|
1266 |
@date 2018.08.08 |
|
1267 |
''' |
|
1268 |
|
|
1269 | 1213 |
def onRecognizeText(self, x, y, width, height): |
1214 |
"""show text recognition dialog""" |
|
1270 | 1215 |
from OcrResultDialog import QOcrResultDialog |
1271 | 1216 |
from Area import Area |
1272 | 1217 |
|
... | ... | |
1498 | 1443 |
from DisplayColors import DisplayColors |
1499 | 1444 |
from DisplayColors import DisplayOptions |
1500 | 1445 |
|
1501 |
DisplayColors.instance().option = DisplayOptions.DisplayByLineNo if value is True else DisplayOptions.DisplayByLineType |
|
1502 |
if hasattr(self, 'graphicsView'): |
|
1503 |
self.graphicsView.scene().update(self.graphicsView.sceneRect()) |
|
1504 |
DisplayColors.instance().save_data() |
|
1446 |
if hasattr(self, 'ribbon'): |
|
1447 |
visualization_pane = self.ribbon.get_pane('Home Visualization') |
|
1448 |
if self.sender() is visualization_pane.ui.radioButtonByGroup and value is True: |
|
1449 |
DisplayColors.instance().option = DisplayOptions.DisplayByLineNo |
|
1450 |
elif self.sender() is visualization_pane.ui.radioButtonByType and value is True: |
|
1451 |
DisplayColors.instance().option = DisplayOptions.DisplayByLineType |
|
1452 |
elif self.sender() is visualization_pane.ui.radioButtonByStreamNo: |
|
1453 |
DisplayColors.instance().option = DisplayOptions.DisplayByStreamNo |
|
1454 |
|
|
1455 |
if hasattr(self, 'graphicsView') and value is True: |
|
1456 |
self.graphicsView.scene().update(self.graphicsView.sceneRect()) |
|
1457 |
DisplayColors.instance().save_data() |
|
1505 | 1458 |
|
1506 | 1459 |
def open_image_drawing(self, drawing, force=False): |
1507 | 1460 |
"""open and display image drawing file""" |
... | ... | |
1760 | 1713 |
self.progress.show() |
1761 | 1714 |
|
1762 | 1715 |
def changeViewCheckedState(self, checked, clear=True): |
1763 |
''' |
|
1764 |
@brief change view checked state |
|
1765 |
@author euisung |
|
1766 |
@date 2019.03.06 |
|
1767 |
''' |
|
1716 |
"""change view checked state""" |
|
1768 | 1717 |
# self.actionImage_Drawing.setChecked(checked) |
1769 | 1718 |
self.actionViewText.setChecked(checked) |
1770 | 1719 |
self.actionViewSymbol.setChecked(checked) |
... | ... | |
2075 | 2024 |
|
2076 | 2025 |
QMessageBox.about(self, self.tr("Notice"), self.tr('Successfully applied. ')) |
2077 | 2026 |
|
2078 |
''' |
|
2079 |
@brief create a line |
|
2080 |
@author humkyung |
|
2081 |
@history Jeongwoo 2018.05.10 Change method for Checkable action |
|
2082 |
''' |
|
2083 | 2027 |
def onPlaceLine(self): |
2028 |
"""create a line""" |
|
2029 |
home_pane = self.ribbon.get_pane('Home') |
|
2030 |
|
|
2084 | 2031 |
if not self.graphicsView.hasImage(): |
2085 |
self.actionLine.setChecked(False)
|
|
2032 |
home_pane.ui.toolButtonLine.setChecked(False)
|
|
2086 | 2033 |
self.showImageSelectionMessageBox() |
2087 | 2034 |
return |
2088 | 2035 |
|
2089 |
self.actionLine.setChecked(True) |
|
2090 |
if not hasattr(self.actionLine, 'tag'): |
|
2091 |
self.actionLine.tag = PlaceLineCommand.PlaceLineCommand(self.graphicsView) |
|
2092 |
self.actionLine.tag.onSuccess.connect(self.onLineCreated) |
|
2093 |
self.actionLine.tag.onRejected.connect(self.onCommandRejected) |
|
2036 |
if not hasattr(home_pane.ui.toolButtonLine, 'tag'): |
|
2037 |
home_pane.ui.toolButtonLine.tag = PlaceLineCommand.PlaceLineCommand(self.graphicsView) |
|
2038 |
home_pane.ui.toolButtonLine.tag.onSuccess.connect(self.onLineCreated) |
|
2039 |
home_pane.ui.toolButtonLine.tag.onRejected.connect(self.onCommandRejected) |
|
2094 | 2040 |
|
2095 |
self.graphicsView.command = self.actionLine.tag |
|
2096 |
|
|
2097 |
''' |
|
2098 |
@brief add created lines to scene |
|
2099 |
@author humkyung |
|
2100 |
@date 2018.07.23 |
|
2101 |
''' |
|
2041 |
self.graphicsView.command = home_pane.ui.toolButtonLine.tag |
|
2102 | 2042 |
|
2103 | 2043 |
def onLineCreated(self): |
2044 |
"""add created lines to scene""" |
|
2104 | 2045 |
from EngineeringConnectorItem import QEngineeringConnectorItem |
2105 | 2046 |
from LineDetector import LineDetector |
2106 | 2047 |
|
2107 | 2048 |
try: |
2108 | 2049 |
app_doc_data = AppDocData.instance() |
2050 |
home_pane = self.ribbon.get_pane('Home') |
|
2109 | 2051 |
|
2110 |
count = len(self.actionLine.tag._polyline._vertices)
|
|
2052 |
count = len(home_pane.ui.toolButtonLine.tag._polyline._vertices)
|
|
2111 | 2053 |
if count > 1: |
2112 | 2054 |
items = [] |
2113 | 2055 |
|
... | ... | |
2116 | 2058 |
if not self.actionLine.tag.line_type: |
2117 | 2059 |
line_type = self.lineComboBox.currentText() |
2118 | 2060 |
else: |
2119 |
if self.lineComboBox.currentText() == 'Connect To Process': |
|
2120 |
line_type = self.lineComboBox.currentText() |
|
2121 |
elif not (QEngineeringLineItem.check_piping(self.actionLine.tag.line_type) ^ QEngineeringLineItem.check_piping(self.lineComboBox.currentText())): |
|
2122 |
line_type = self.lineComboBox.currentText() |
|
2061 |
pane = self.ribbon.get_pane('Home') |
|
2062 |
selected_line_type = pane.ui.comboBoxLineType.currentText() |
|
2063 |
if selected_line_type == 'Connect To Process': |
|
2064 |
line_type = selected_line_type |
|
2065 |
elif not (QEngineeringLineItem.check_piping(home_pane.ui.toolButtonLine.tag.line_type) ^ |
|
2066 |
QEngineeringLineItem.check_piping(selected_line_type)): |
|
2067 |
line_type = selected_line_type |
|
2123 | 2068 |
else: |
2124 | 2069 |
line_type = self.actionLine.tag.line_type |
2125 | 2070 |
for index in range(count - 1): |
2126 |
start = self.actionLine.tag._polyline._vertices[index]
|
|
2127 |
end = self.actionLine.tag._polyline._vertices[index + 1]
|
|
2071 |
start = home_pane.ui.toolButtonLine.tag._polyline._vertices[index]
|
|
2072 |
end = home_pane.ui.toolButtonLine.tag._polyline._vertices[index + 1]
|
|
2128 | 2073 |
|
2129 | 2074 |
lineItem = QEngineeringLineItem(vertices=[start, end]) |
2130 | 2075 |
lineItem.transfer.onRemoved.connect(self.itemRemoved) |
... | ... | |
2143 | 2088 |
|
2144 | 2089 |
items.append(lineItem) |
2145 | 2090 |
self.graphicsView.scene().addItem(lineItem) |
2146 |
#app_doc_data.lines.append(lineItem) |
|
2147 | 2091 |
|
2148 | 2092 |
pt = items[-1].end_point() |
2149 | 2093 |
selected = [item for item in self.graphicsView.scene().items(QPointF(pt[0], pt[1])) if |
... | ... | |
2157 | 2101 |
|
2158 | 2102 |
self._scene.undo_stack.push(CreateCommand(self._scene, items)) |
2159 | 2103 |
finally: |
2160 |
self.graphicsView.scene().removeItem(self.actionLine.tag._polyline) |
|
2161 |
self.actionLine.tag.reset() |
|
2162 |
|
|
2163 |
''' |
|
2164 |
@brief refresh scene |
|
2165 |
@author humkyung |
|
2166 |
@date 2018.07.23 |
|
2167 |
''' |
|
2104 |
self.graphicsView.scene().removeItem(home_pane.ui.toolButtonLine.tag._polyline) |
|
2105 |
home_pane.ui.toolButtonLine.tag.reset() |
|
2168 | 2106 |
|
2169 | 2107 |
def onCommandRejected(self, cmd=None): |
2108 |
"""command is rejected""" |
|
2170 | 2109 |
try: |
2110 |
home_pane = self.ribbon.get_pane('Home') |
|
2111 |
visualization_pane = self.ribbon.get_pane('Home Visualization') |
|
2171 | 2112 |
if type(cmd) is PlaceLineCommand.PlaceLineCommand: |
2172 |
if self.actionLine.tag._polyline:
|
|
2173 |
self.graphicsView.scene().removeItem(self.actionLine.tag._polyline)
|
|
2113 |
if home_pane.ui.toolButtonLine.tag._polyline:
|
|
2114 |
self.graphicsView.scene().removeItem(home_pane.ui.toolButtonLine.tag._polyline)
|
|
2174 | 2115 |
self.graphicsView.scene().update() |
2175 |
self.actionLine.tag.reset()
|
|
2116 |
home_pane.ui.toolButtonLine.tag.reset()
|
|
2176 | 2117 |
|
2177 |
self.actionLine.setChecked(False)
|
|
2118 |
home_pane.ui.toolButtonLine.setChecked(False)
|
|
2178 | 2119 |
elif type(cmd) is AreaZoomCommand.AreaZoomCommand: |
2179 |
self.actionZoom.setChecked(False)
|
|
2120 |
visualization_pane.ui.toolButtonZoom.setChecked(False)
|
|
2180 | 2121 |
elif type(cmd) is AreaOcrCommand.AreaOcrCommand: |
2181 |
self.actionOCR.setChecked(False)
|
|
2122 |
home_pane.ui.toolButtonOCR.setChecked(False)
|
|
2182 | 2123 |
elif type(cmd) is PlacePolygonCommand.PlacePolygonCommand: |
2183 |
self.actionVendor.setChecked(False)
|
|
2124 |
home_pane.ui.toolButtonVendor.setChecked(False)
|
|
2184 | 2125 |
else: |
2185 |
if hasattr(self.actionLine, 'tag') and self.actionLine.tag._polyline:
|
|
2186 |
self.graphicsView.scene().removeItem(self.actionLine.tag._polyline)
|
|
2126 |
if hasattr(self.actionLine, 'tag') and home_pane.ui.toolButtonLine.tag._polyline:
|
|
2127 |
self.graphicsView.scene().removeItem(home_pane.ui.toolButtonLine.tag._polyline)
|
|
2187 | 2128 |
self.graphicsView.scene().update() |
2188 | 2129 |
self.actionLine.tag.reset() |
2189 |
if hasattr(self.actionVendor, 'tag') and self.actionVendor.tag._polyline:
|
|
2190 |
self.graphicsView.scene().removeItem(self.actionVendor.tag._polyline)
|
|
2130 |
if hasattr(home_pane.ui.toolButtonVendor, 'tag') and home_pane.ui.toolButtonVendor.tag._polyline:
|
|
2131 |
self.graphicsView.scene().removeItem(home_pane.ui.toolButtonVendor.tag._polyline)
|
|
2191 | 2132 |
self.graphicsView.scene().update() |
2192 |
self.actionVendor.tag.reset()
|
|
2193 |
self.actionLine.setChecked(False)
|
|
2194 |
self.actionZoom.setChecked(False)
|
|
2195 |
self.actionOCR.setChecked(False)
|
|
2196 |
self.actionVendor.setChecked(False)
|
|
2133 |
home_pane.ui.toolButtonVendor.tag.reset()
|
|
2134 |
home_pane.ui.toolButtonLine.setChecked(False)
|
|
2135 |
visualization_pane.ui.toolButtonZoom.setChecked(False)
|
|
2136 |
home_pane.ui.toolButtonOCR.setChecked(False)
|
|
2137 |
home_pane.ui.toolButtonVendor.setChecked(False)
|
|
2197 | 2138 |
finally: |
2198 | 2139 |
self.graphicsView.useDefaultCommand() |
2199 | 2140 |
|
2200 |
''' |
|
2201 |
@brief restore to default command when user press Escape key |
|
2202 |
@author humkyung |
|
2203 |
@date 2018.08.09 |
|
2204 |
|
|
2205 |
''' |
|
2141 |
def on_view_toggle(self, key: int) -> None: |
|
2142 |
"""view toggled""" |
|
2143 |
|
|
2144 |
view_pane = self.ribbon.get_pane('View') |
|
2145 |
if key == Qt.Key_1: |
|
2146 |
checked = view_pane.ui.toolButtonViewImageDrawing.isChecked() |
|
2147 |
self.onViewImageDrawing(not checked) |
|
2148 |
view_pane.ui.toolButtonViewImageDrawing.setChecked(not checked) |
|
2149 |
elif key == Qt.Key_2: |
|
2150 |
checked = view_pane.ui.toolButtonViewText.isChecked() |
|
2151 |
self.onViewText(not checked) |
|
2152 |
view_pane.ui.toolButtonViewText.setChecked(not checked) |
|
2153 |
elif key == Qt.Key_3: |
|
2154 |
checked = view_pane.ui.toolButtonViewSymbol.isChecked() |
|
2155 |
self.onViewSymbol(not checked) |
|
2156 |
view_pane.ui.toolButtonViewSymbol.setChecked(not checked) |
|
2157 |
elif key == Qt.Key_4: |
|
2158 |
checked = view_pane.ui.toolButtonViewLine.isChecked() |
|
2159 |
self.onViewLine(not checked) |
|
2160 |
view_pane.ui.toolButtonViewLine.setChecked(not checked) |
|
2161 |
elif key == Qt.Key_5: |
|
2162 |
checked = view_pane.ui.toolButtonViewUnknown.isChecked() |
|
2163 |
self.onViewUnknown(not checked) |
|
2164 |
view_pane.ui.toolButtonViewUnknown.setChecked(not checked) |
|
2165 |
elif key == Qt.Key_6: |
|
2166 |
checked = view_pane.ui.toolButtonViewInconsistency.isChecked() |
|
2167 |
self.onViewInconsistency(not checked) |
|
2168 |
view_pane.ui.toolButtonViewInconsistency.setChecked(not checked) |
|
2169 |
elif key == Qt.Key_7: |
|
2170 |
checked = view_pane.ui.toolButtonViewVendorArea.isChecked() |
|
2171 |
self.onViewVendorArea(not checked) |
|
2172 |
view_pane.ui.toolButtonViewVendorArea.setChecked(not checked) |
|
2173 |
elif key == 96: # '~' key |
|
2174 |
checked = view_pane.ui.toolButtonViewDrawingOnly.isChecked() |
|
2175 |
self.onViewDrawingOnly(not checked) |
|
2176 |
view_pane.ui.toolButtonViewDrawingOnly.setChecked(not checked) |
|
2206 | 2177 |
|
2207 | 2178 |
def keyPressEvent(self, event): |
2179 |
"""restore to default command when user press Escape key""" |
|
2208 | 2180 |
try: |
2209 | 2181 |
if event.key() == Qt.Key_Escape: |
2210 | 2182 |
checked = self.actionGroup.checkedAction() |
2211 | 2183 |
if checked: |
2212 | 2184 |
checked.setChecked(False) |
2213 | 2185 |
self.graphicsView.useDefaultCommand() |
2214 |
elif event.key() == Qt.Key_1: |
|
2215 |
if self.actionImage_Drawing.isChecked(): |
|
2216 |
self.onViewImageDrawing(False) |
|
2217 |
self.actionImage_Drawing.setChecked(False) |
|
2218 |
else: |
|
2219 |
self.onViewImageDrawing(True) |
|
2220 |
self.actionImage_Drawing.setChecked(True) |
|
2221 |
elif event.key() == Qt.Key_2: |
|
2222 |
if self.actionViewText.isChecked(): |
|
2223 |
self.onViewText(False) |
|
2224 |
self.actionViewText.setChecked(False) |
|
2225 |
else: |
|
2226 |
self.onViewText(True) |
|
2227 |
self.actionViewText.setChecked(True) |
|
2228 |
elif event.key() == Qt.Key_3: |
|
2229 |
if self.actionViewSymbol.isChecked(): |
|
2230 |
self.onViewSymbol(False) |
|
2231 |
self.actionViewSymbol.setChecked(False) |
|
2232 |
else: |
|
2233 |
self.onViewSymbol(True) |
|
2234 |
self.actionViewSymbol.setChecked(True) |
|
2235 |
elif event.key() == Qt.Key_4: |
|
2236 |
if self.actionViewLine.isChecked(): |
|
2237 |
self.onViewLine(False) |
|
2238 |
self.actionViewLine.setChecked(False) |
|
2239 |
else: |
|
2240 |
self.onViewLine(True) |
|
2241 |
self.actionViewLine.setChecked(True) |
|
2242 |
elif event.key() == Qt.Key_5: |
|
2243 |
if self.actionViewUnknown.isChecked(): |
|
2244 |
self.onViewUnknown(False) |
|
2245 |
self.actionViewUnknown.setChecked(False) |
|
2246 |
else: |
|
2247 |
self.onViewUnknown(True) |
|
2248 |
self.actionViewUnknown.setChecked(True) |
|
2249 |
elif event.key() == Qt.Key_6: |
|
2250 |
if self.actionViewInconsistency.isChecked(): |
|
2251 |
self.onViewInconsistency(False) |
|
2252 |
self.actionViewInconsistency.setChecked(False) |
|
2253 |
else: |
|
2254 |
self.onViewInconsistency(True) |
|
2255 |
self.actionViewInconsistency.setChecked(True) |
|
2256 |
elif event.key() == Qt.Key_7: |
|
2257 |
if self.actionViewVendor_Area.isChecked(): |
|
2258 |
self.onViewVendorArea(False) |
|
2259 |
self.actionViewVendor_Area.setChecked(False) |
|
2260 |
else: |
|
2261 |
self.onViewVendorArea(True) |
|
2262 |
self.actionViewVendor_Area.setChecked(True) |
|
2263 |
elif event.key() == 96: # '`' key |
|
2264 |
if self.actionDrawing_Only.isChecked(): |
|
2265 |
self.onViewDrawingOnly(False) |
|
2266 |
self.actionDrawing_Only.setChecked(False) |
|
2267 |
else: |
|
2268 |
self.onViewDrawingOnly(True) |
|
2269 |
self.actionDrawing_Only.setChecked(True) |
|
2270 | 2186 |
elif event.key() == Qt.Key_M: # merge text as vertical |
2271 | 2187 |
from TextInfo import TextInfo |
2272 | 2188 |
|
... | ... | |
2422 | 2338 |
def recognize(self): |
2423 | 2339 |
"""recognize symbol, text and line for selected drawings""" |
2424 | 2340 |
from datetime import datetime |
2425 |
#from RecognitionDialog import QRecognitionDialog
|
|
2341 |
from License import QLicenseDialog
|
|
2426 | 2342 |
|
2427 | 2343 |
# save alarm |
2428 | 2344 |
self.save_alarm_enable(False) |
... | ... | |
2470 | 2386 |
tree_item.setText(1, _now) |
2471 | 2387 |
#app_doc_data.saveDrawings(checked_drawings.keys()) |
2472 | 2388 |
self.changeViewCheckedState(True) |
2389 |
# count up for recognition |
|
2390 |
QLicenseDialog.count_up() |
|
2473 | 2391 |
# up to here |
2474 | 2392 |
except Exception as ex: |
2475 |
message = 'error occurred({}) in {}:{}'.format(repr(ex), sys.exc_info()[-1].tb_frame.f_code.co_filename,
|
|
2476 |
sys.exc_info()[-1].tb_lineno)
|
|
2393 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
|
|
2394 |
f"{sys.exc_info()[-1].tb_lineno}"
|
|
2477 | 2395 |
self.addMessage.emit(MessageType.Error, message) |
2478 | 2396 |
|
2479 | 2397 |
# save alarm |
2480 |
self.save_alarm_enable(True)
|
|
2398 |
self.save_alarm_enable(True) |
|
2481 | 2399 |
|
2482 | 2400 |
''' |
2483 | 2401 |
@brief remove item from tree widget and then remove from scene |
DTI_PID/DTI_PID/MainWindow_UI.py | ||
---|---|---|
37 | 37 |
self.verticalLayout.addWidget(self.label_spinner) |
38 | 38 |
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) |
39 | 39 |
MainWindow.setCentralWidget(self.centralwidget) |
40 |
self.menubar = QtWidgets.QMenuBar(MainWindow) |
|
41 |
self.menubar.setGeometry(QtCore.QRect(0, 0, 1089, 21)) |
|
42 |
self.menubar.setObjectName("menubar") |
|
43 |
self.menu = QtWidgets.QMenu(self.menubar) |
|
44 |
self.menu.setObjectName("menu") |
|
45 |
self.menuTheme = QtWidgets.QMenu(self.menu) |
|
46 |
icon1 = QtGui.QIcon() |
|
47 |
icon1.addPixmap(QtGui.QPixmap(":/newPrefix/Theme.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
48 |
self.menuTheme.setIcon(icon1) |
|
49 |
self.menuTheme.setObjectName("menuTheme") |
|
50 |
self.menuLanguage = QtWidgets.QMenu(self.menu) |
|
51 |
icon2 = QtGui.QIcon() |
|
52 |
icon2.addPixmap(QtGui.QPixmap(":/newPrefix/Language.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
53 |
self.menuLanguage.setIcon(icon2) |
|
54 |
self.menuLanguage.setObjectName("menuLanguage") |
|
55 |
self.menuExport = QtWidgets.QMenu(self.menu) |
|
56 |
icon3 = QtGui.QIcon() |
|
57 |
icon3.addPixmap(QtGui.QPixmap(":/newPrefix/Export.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
58 |
self.menuExport.setIcon(icon3) |
|
59 |
self.menuExport.setObjectName("menuExport") |
|
60 |
self.menu_2 = QtWidgets.QMenu(self.menubar) |
|
61 |
self.menu_2.setObjectName("menu_2") |
|
62 |
self.menu_3 = QtWidgets.QMenu(self.menubar) |
|
63 |
self.menu_3.setObjectName("menu_3") |
|
64 |
self.menu_4 = QtWidgets.QMenu(self.menubar) |
|
65 |
self.menu_4.setObjectName("menu_4") |
|
66 |
self.menu_5 = QtWidgets.QMenu(self.menubar) |
|
67 |
self.menu_5.setObjectName("menu_5") |
|
68 |
self.menuHelp = QtWidgets.QMenu(self.menubar) |
|
69 |
self.menuHelp.setObjectName("menuHelp") |
|
70 |
MainWindow.setMenuBar(self.menubar) |
|
71 | 40 |
self.statusbar = QtWidgets.QStatusBar(MainWindow) |
72 | 41 |
self.statusbar.setObjectName("statusbar") |
73 | 42 |
MainWindow.setStatusBar(self.statusbar) |
74 |
self.toolBar = QtWidgets.QToolBar(MainWindow) |
|
75 |
font = QtGui.QFont() |
|
76 |
font.setFamily("맑은 고딕") |
|
77 |
font.setBold(True) |
|
78 |
font.setWeight(75) |
|
79 |
self.toolBar.setFont(font) |
|
80 |
self.toolBar.setIconSize(QtCore.QSize(32, 32)) |
|
81 |
self.toolBar.setObjectName("toolBar") |
|
82 |
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) |
|
83 | 43 |
self.dockWidget = QtWidgets.QDockWidget(MainWindow) |
84 | 44 |
self.dockWidget.setMinimumSize(QtCore.QSize(284, 309)) |
85 | 45 |
self.dockWidget.setObjectName("dockWidget") |
... | ... | |
146 | 106 |
self.scrollArea.setWidgetResizable(True) |
147 | 107 |
self.scrollArea.setObjectName("scrollArea") |
148 | 108 |
self.scrollAreaWidgetContents = QtWidgets.QWidget() |
149 |
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 284, 196))
|
|
109 |
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 284, 232))
|
|
150 | 110 |
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") |
151 | 111 |
self.gridLayout_14 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents) |
152 | 112 |
self.gridLayout_14.setObjectName("gridLayout_14") |
... | ... | |
220 | 180 |
self.gridLayout_4.addWidget(self.tabWidgetItemExplorer, 0, 0, 1, 1) |
221 | 181 |
self.dockWidgetObjectExplorer.setWidget(self.dockWidgetContents_2) |
222 | 182 |
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidgetObjectExplorer) |
223 |
self.EditToolbar = QtWidgets.QToolBar(MainWindow) |
|
224 |
self.EditToolbar.setEnabled(True) |
|
225 |
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) |
|
226 |
sizePolicy.setHorizontalStretch(0) |
|
227 |
sizePolicy.setVerticalStretch(0) |
|
228 |
sizePolicy.setHeightForWidth(self.EditToolbar.sizePolicy().hasHeightForWidth()) |
|
229 |
self.EditToolbar.setSizePolicy(sizePolicy) |
|
230 |
self.EditToolbar.setLayoutDirection(QtCore.Qt.LeftToRight) |
|
231 |
self.EditToolbar.setIconSize(QtCore.QSize(32, 32)) |
|
232 |
self.EditToolbar.setObjectName("EditToolbar") |
|
233 |
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.EditToolbar) |
|
234 | 183 |
self.dockWidgetOutputWnd = QtWidgets.QDockWidget(MainWindow) |
235 | 184 |
self.dockWidgetOutputWnd.setMinimumSize(QtCore.QSize(145, 203)) |
236 | 185 |
self.dockWidgetOutputWnd.setBaseSize(QtCore.QSize(0, 202)) |
... | ... | |
255 | 204 |
self.horizontalLayout_5.addItem(spacerItem2) |
256 | 205 |
self.toolButtonClearLog = QtWidgets.QToolButton(self.tabTerminal) |
257 | 206 |
self.toolButtonClearLog.setText("") |
258 |
icon4 = QtGui.QIcon()
|
|
259 |
icon4.addPixmap(QtGui.QPixmap(":/newPrefix/Remove.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
260 |
self.toolButtonClearLog.setIcon(icon4)
|
|
207 |
icon1 = QtGui.QIcon()
|
|
208 |
icon1.addPixmap(QtGui.QPixmap(":/newPrefix/Remove.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
209 |
self.toolButtonClearLog.setIcon(icon1)
|
|
261 | 210 |
self.toolButtonClearLog.setObjectName("toolButtonClearLog") |
262 | 211 |
self.horizontalLayout_5.addWidget(self.toolButtonClearLog) |
263 | 212 |
self.verticalLayout_3.addLayout(self.horizontalLayout_5) |
... | ... | |
288 | 237 |
self.dockWidgetOutputWnd.setWidget(self.dockWidgetContents_3) |
289 | 238 |
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(8), self.dockWidgetOutputWnd) |
290 | 239 |
self.actionOpen = QtWidgets.QAction(MainWindow) |
291 |
icon5 = QtGui.QIcon()
|
|
292 |
icon5.addPixmap(QtGui.QPixmap(":/newPrefix/File.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
293 |
self.actionOpen.setIcon(icon5)
|
|
240 |
icon2 = QtGui.QIcon()
|
|
241 |
icon2.addPixmap(QtGui.QPixmap(":/newPrefix/File.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
242 |
self.actionOpen.setIcon(icon2)
|
|
294 | 243 |
font = QtGui.QFont() |
295 | 244 |
font.setFamily("맑은 고딕") |
296 | 245 |
self.actionOpen.setFont(font) |
297 | 246 |
self.actionOpen.setObjectName("actionOpen") |
298 | 247 |
self.actionClose = QtWidgets.QAction(MainWindow) |
299 |
icon6 = QtGui.QIcon()
|
|
300 |
icon6.addPixmap(QtGui.QPixmap(":/newPrefix/Exit.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
301 |
self.actionClose.setIcon(icon6)
|
|
248 |
icon3 = QtGui.QIcon()
|
|
249 |
icon3.addPixmap(QtGui.QPixmap(":/newPrefix/Exit.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
250 |
self.actionClose.setIcon(icon3)
|
|
302 | 251 |
font = QtGui.QFont() |
303 | 252 |
font.setFamily("맑은 고딕") |
304 | 253 |
self.actionClose.setFont(font) |
305 | 254 |
self.actionClose.setObjectName("actionClose") |
306 | 255 |
self.actionRecognition = QtWidgets.QAction(MainWindow) |
307 |
icon7 = QtGui.QIcon()
|
|
308 |
icon7.addPixmap(QtGui.QPixmap(":/newPrefix/Recognition.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
309 |
self.actionRecognition.setIcon(icon7)
|
|
256 |
icon4 = QtGui.QIcon()
|
|
257 |
icon4.addPixmap(QtGui.QPixmap(":/newPrefix/Recognition.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
258 |
self.actionRecognition.setIcon(icon4)
|
|
310 | 259 |
font = QtGui.QFont() |
311 | 260 |
font.setFamily("맑은 고딕") |
312 | 261 |
font.setBold(True) |
... | ... | |
315 | 264 |
self.actionRecognition.setObjectName("actionRecognition") |
316 | 265 |
self.actionLine = QtWidgets.QAction(MainWindow) |
317 | 266 |
self.actionLine.setCheckable(True) |
318 |
icon8 = QtGui.QIcon()
|
|
319 |
icon8.addPixmap(QtGui.QPixmap(":/newPrefix/Line.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
320 |
self.actionLine.setIcon(icon8)
|
|
267 |
icon5 = QtGui.QIcon()
|
|
268 |
icon5.addPixmap(QtGui.QPixmap(":/newPrefix/Line.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
269 |
self.actionLine.setIcon(icon5)
|
|
321 | 270 |
font = QtGui.QFont() |
322 | 271 |
font.setFamily("맑은 고딕") |
323 | 272 |
font.setBold(True) |
... | ... | |
325 | 274 |
self.actionLine.setFont(font) |
326 | 275 |
self.actionLine.setObjectName("actionLine") |
327 | 276 |
self.actionValidate = QtWidgets.QAction(MainWindow) |
328 |
icon9 = QtGui.QIcon()
|
|
329 |
icon9.addPixmap(QtGui.QPixmap(":/newPrefix/Validation.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
330 |
self.actionValidate.setIcon(icon9)
|
|
277 |
icon6 = QtGui.QIcon()
|
|
278 |
icon6.addPixmap(QtGui.QPixmap(":/newPrefix/Validation.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
279 |
self.actionValidate.setIcon(icon6)
|
|
331 | 280 |
font = QtGui.QFont() |
332 | 281 |
font.setFamily("맑은 고딕") |
333 | 282 |
font.setBold(True) |
... | ... | |
335 | 284 |
self.actionValidate.setFont(font) |
336 | 285 |
self.actionValidate.setObjectName("actionValidate") |
337 | 286 |
self.actionConfiguration = QtWidgets.QAction(MainWindow) |
338 |
icon10 = QtGui.QIcon()
|
|
339 |
icon10.addPixmap(QtGui.QPixmap(":/newPrefix/setting.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
340 |
self.actionConfiguration.setIcon(icon10)
|
|
287 |
icon7 = QtGui.QIcon()
|
|
288 |
icon7.addPixmap(QtGui.QPixmap(":/newPrefix/setting.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
289 |
self.actionConfiguration.setIcon(icon7)
|
|
341 | 290 |
font = QtGui.QFont() |
342 | 291 |
font.setFamily("맑은 고딕") |
343 | 292 |
font.setBold(False) |
... | ... | |
345 | 294 |
self.actionConfiguration.setFont(font) |
346 | 295 |
self.actionConfiguration.setObjectName("actionConfiguration") |
347 | 296 |
self.actionArea = QtWidgets.QAction(MainWindow) |
348 |
icon11 = QtGui.QIcon()
|
|
349 |
icon11.addPixmap(QtGui.QPixmap(":/newPrefix/setup_area.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
350 |
self.actionArea.setIcon(icon11)
|
|
297 |
icon8 = QtGui.QIcon()
|
|
298 |
icon8.addPixmap(QtGui.QPixmap(":/newPrefix/setup_area.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
299 |
self.actionArea.setIcon(icon8)
|
|
351 | 300 |
font = QtGui.QFont() |
352 | 301 |
font.setFamily("맑은 고딕") |
353 | 302 |
font.setBold(False) |
... | ... | |
356 | 305 |
self.actionArea.setObjectName("actionArea") |
357 | 306 |
self.actionOCR = QtWidgets.QAction(MainWindow) |
358 | 307 |
self.actionOCR.setCheckable(True) |
359 |
icon12 = QtGui.QIcon()
|
|
360 |
icon12.addPixmap(QtGui.QPixmap(":/newPrefix/OCR.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
361 |
self.actionOCR.setIcon(icon12)
|
|
308 |
icon9 = QtGui.QIcon()
|
|
309 |
icon9.addPixmap(QtGui.QPixmap(":/newPrefix/OCR.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
310 |
self.actionOCR.setIcon(icon9)
|
|
362 | 311 |
font = QtGui.QFont() |
363 | 312 |
font.setFamily("맑은 고딕") |
364 | 313 |
font.setBold(True) |
... | ... | |
366 | 315 |
self.actionOCR.setFont(font) |
367 | 316 |
self.actionOCR.setObjectName("actionOCR") |
368 | 317 |
self.actionLineRecognition = QtWidgets.QAction(MainWindow) |
369 |
icon13 = QtGui.QIcon()
|
|
370 |
icon13.addPixmap(QtGui.QPixmap(":/newPrefix/Connection.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
371 |
self.actionLineRecognition.setIcon(icon13)
|
|
318 |
icon10 = QtGui.QIcon()
|
|
319 |
icon10.addPixmap(QtGui.QPixmap(":/newPrefix/Connection.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
320 |
self.actionLineRecognition.setIcon(icon10)
|
|
372 | 321 |
font = QtGui.QFont() |
373 | 322 |
font.setFamily("맑은 고딕") |
374 | 323 |
font.setBold(True) |
... | ... | |
376 | 325 |
self.actionLineRecognition.setFont(font) |
377 | 326 |
self.actionLineRecognition.setObjectName("actionLineRecognition") |
378 | 327 |
self.actionGenerateOutput = QtWidgets.QAction(MainWindow) |
379 |
icon14 = QtGui.QIcon()
|
|
380 |
icon14.addPixmap(QtGui.QPixmap(":/newPrefix/Change.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
381 |
self.actionGenerateOutput.setIcon(icon14)
|
|
328 |
icon11 = QtGui.QIcon()
|
|
329 |
icon11.addPixmap(QtGui.QPixmap(":/newPrefix/Change.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
330 |
self.actionGenerateOutput.setIcon(icon11)
|
|
382 | 331 |
font = QtGui.QFont() |
383 | 332 |
font.setFamily("맑은 고딕") |
384 | 333 |
font.setBold(True) |
... | ... | |
394 | 343 |
self.actionEquipment_Data_List.setFont(font) |
395 | 344 |
self.actionEquipment_Data_List.setObjectName("actionEquipment_Data_List") |
396 | 345 |
self.actionItem_Data_List = QtWidgets.QAction(MainWindow) |
397 |
icon15 = QtGui.QIcon()
|
|
398 |
icon15.addPixmap(QtGui.QPixmap(":/newPrefix/EngineeringInfoList.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
399 |
self.actionItem_Data_List.setIcon(icon15)
|
|
346 |
icon12 = QtGui.QIcon()
|
|
347 |
icon12.addPixmap(QtGui.QPixmap(":/newPrefix/EngineeringInfoList.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
348 |
self.actionItem_Data_List.setIcon(icon12)
|
|
400 | 349 |
font = QtGui.QFont() |
401 | 350 |
font.setFamily("맑은 고딕") |
402 | 351 |
font.setBold(False) |
... | ... | |
411 | 360 |
self.actionInstrument_Data_List.setFont(font) |
412 | 361 |
self.actionInstrument_Data_List.setObjectName("actionInstrument_Data_List") |
413 | 362 |
self.actionInitialize = QtWidgets.QAction(MainWindow) |
414 |
icon16 = QtGui.QIcon()
|
|
415 |
icon16.addPixmap(QtGui.QPixmap(":/newPrefix/Reset.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
416 |
self.actionInitialize.setIcon(icon16)
|
|
363 |
icon13 = QtGui.QIcon()
|
|
364 |
icon13.addPixmap(QtGui.QPixmap(":/newPrefix/Reset.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
365 |
self.actionInitialize.setIcon(icon13)
|
|
417 | 366 |
font = QtGui.QFont() |
418 | 367 |
font.setFamily("맑은 고딕") |
419 | 368 |
self.actionInitialize.setFont(font) |
... | ... | |
421 | 370 |
self.actionImage_Drawing = QtWidgets.QAction(MainWindow) |
422 | 371 |
self.actionImage_Drawing.setCheckable(True) |
423 | 372 |
self.actionImage_Drawing.setChecked(True) |
424 |
icon17 = QtGui.QIcon()
|
|
425 |
icon17.addPixmap(QtGui.QPixmap(":/newPrefix/image.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
426 |
self.actionImage_Drawing.setIcon(icon17)
|
|
373 |
icon14 = QtGui.QIcon()
|
|
374 |
icon14.addPixmap(QtGui.QPixmap(":/newPrefix/image.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
375 |
self.actionImage_Drawing.setIcon(icon14)
|
|
427 | 376 |
font = QtGui.QFont() |
428 | 377 |
font.setFamily("맑은 고딕") |
429 | 378 |
self.actionImage_Drawing.setFont(font) |
430 | 379 |
self.actionImage_Drawing.setObjectName("actionImage_Drawing") |
431 | 380 |
self.actionZoom = QtWidgets.QAction(MainWindow) |
432 | 381 |
self.actionZoom.setCheckable(True) |
433 |
icon18 = QtGui.QIcon()
|
|
434 |
icon18.addPixmap(QtGui.QPixmap(":/newPrefix/ZoomArea.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
435 |
self.actionZoom.setIcon(icon18)
|
|
382 |
icon15 = QtGui.QIcon()
|
|
383 |
icon15.addPixmap(QtGui.QPixmap(":/newPrefix/ZoomArea.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
384 |
self.actionZoom.setIcon(icon15)
|
|
436 | 385 |
font = QtGui.QFont() |
437 | 386 |
font.setFamily("맑은 고딕") |
438 | 387 |
font.setBold(True) |
... | ... | |
440 | 389 |
self.actionZoom.setFont(font) |
441 | 390 |
self.actionZoom.setObjectName("actionZoom") |
442 | 391 |
self.actionFitWindow = QtWidgets.QAction(MainWindow) |
443 |
icon19 = QtGui.QIcon()
|
|
444 |
icon19.addPixmap(QtGui.QPixmap(":/newPrefix/FullExtent.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
445 |
self.actionFitWindow.setIcon(icon19)
|
|
392 |
icon16 = QtGui.QIcon()
|
|
393 |
icon16.addPixmap(QtGui.QPixmap(":/newPrefix/FullExtent.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
394 |
self.actionFitWindow.setIcon(icon16)
|
|
446 | 395 |
font = QtGui.QFont() |
447 | 396 |
font.setFamily("맑은 고딕") |
448 | 397 |
font.setBold(True) |
... | ... | |
478 | 427 |
self.actionViewUnknown.setFont(font) |
479 | 428 |
self.actionViewUnknown.setObjectName("actionViewUnknown") |
480 | 429 |
self.actionCodeTable = QtWidgets.QAction(MainWindow) |
481 |
icon20 = QtGui.QIcon()
|
|
482 |
icon20.addPixmap(QtGui.QPixmap(":/newPrefix/codetable.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
483 |
self.actionCodeTable.setIcon(icon20)
|
|
430 |
icon17 = QtGui.QIcon()
|
|
431 |
icon17.addPixmap(QtGui.QPixmap(":/newPrefix/codetable.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
432 |
self.actionCodeTable.setIcon(icon17)
|
|
484 | 433 |
font = QtGui.QFont() |
485 | 434 |
font.setFamily("맑은 고딕") |
486 | 435 |
self.actionCodeTable.setFont(font) |
... | ... | |
491 | 440 |
self.actionFluid_Code.setFont(font) |
492 | 441 |
self.actionFluid_Code.setObjectName("actionFluid_Code") |
493 | 442 |
self.actionpdf_to_image = QtWidgets.QAction(MainWindow) |
494 |
icon21 = QtGui.QIcon()
|
|
495 |
icon21.addPixmap(QtGui.QPixmap(":/newPrefix/convertPDF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
496 |
self.actionpdf_to_image.setIcon(icon21)
|
|
443 |
icon18 = QtGui.QIcon()
|
|
444 |
icon18.addPixmap(QtGui.QPixmap(":/newPrefix/convertPDF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
445 |
self.actionpdf_to_image.setIcon(icon18)
|
|
497 | 446 |
font = QtGui.QFont() |
498 | 447 |
font.setFamily("맑은 고딕") |
499 | 448 |
self.actionpdf_to_image.setFont(font) |
500 | 449 |
self.actionpdf_to_image.setObjectName("actionpdf_to_image") |
501 | 450 |
self.actionHMB_DATA = QtWidgets.QAction(MainWindow) |
502 |
icon22 = QtGui.QIcon()
|
|
503 |
icon22.addPixmap(QtGui.QPixmap(":/newPrefix/Database.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
504 |
self.actionHMB_DATA.setIcon(icon22)
|
|
451 |
icon19 = QtGui.QIcon()
|
|
452 |
icon19.addPixmap(QtGui.QPixmap(":/newPrefix/Database.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
453 |
self.actionHMB_DATA.setIcon(icon19)
|
|
505 | 454 |
self.actionHMB_DATA.setObjectName("actionHMB_DATA") |
506 | 455 |
self.actionSave = QtWidgets.QAction(MainWindow) |
507 |
icon23 = QtGui.QIcon()
|
|
508 |
icon23.addPixmap(QtGui.QPixmap(":/newPrefix/Save.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
509 |
self.actionSave.setIcon(icon23)
|
|
456 |
icon20 = QtGui.QIcon()
|
|
457 |
icon20.addPixmap(QtGui.QPixmap(":/newPrefix/Save.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
458 |
self.actionSave.setIcon(icon20)
|
|
510 | 459 |
self.actionSave.setObjectName("actionSave") |
511 | 460 |
self.actionRotate = QtWidgets.QAction(MainWindow) |
512 |
icon24 = QtGui.QIcon()
|
|
513 |
icon24.addPixmap(QtGui.QPixmap(":/newPrefix/Rotate_Plus.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
514 |
self.actionRotate.setIcon(icon24)
|
|
461 |
icon21 = QtGui.QIcon()
|
|
462 |
icon21.addPixmap(QtGui.QPixmap(":/newPrefix/Rotate_Plus.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
463 |
self.actionRotate.setIcon(icon21)
|
|
515 | 464 |
self.actionRotate.setObjectName("actionRotate") |
516 | 465 |
self.actionFindReplaceText = QtWidgets.QAction(MainWindow) |
517 |
icon25 = QtGui.QIcon()
|
|
518 |
icon25.addPixmap(QtGui.QPixmap(":/newPrefix/ReplaceText.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
519 |
self.actionFindReplaceText.setIcon(icon25)
|
|
466 |
icon22 = QtGui.QIcon()
|
|
467 |
icon22.addPixmap(QtGui.QPixmap(":/newPrefix/ReplaceText.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
468 |
self.actionFindReplaceText.setIcon(icon22)
|
|
520 | 469 |
self.actionFindReplaceText.setObjectName("actionFindReplaceText") |
521 | 470 |
self.actionReplaceText = QtWidgets.QAction(MainWindow) |
522 | 471 |
font = QtGui.QFont() |
... | ... | |
524 | 473 |
self.actionReplaceText.setFont(font) |
525 | 474 |
self.actionReplaceText.setObjectName("actionReplaceText") |
526 | 475 |
self.actionOCR_Training = QtWidgets.QAction(MainWindow) |
527 |
self.actionOCR_Training.setIcon(icon12)
|
|
476 |
self.actionOCR_Training.setIcon(icon9)
|
|
528 | 477 |
self.actionOCR_Training.setObjectName("actionOCR_Training") |
529 | 478 |
self.actionOCR_Training_Editor = QtWidgets.QAction(MainWindow) |
530 | 479 |
self.actionOCR_Training_Editor.setObjectName("actionOCR_Training_Editor") |
... | ... | |
537 | 486 |
self.actionViewInconsistency.setChecked(True) |
538 | 487 |
self.actionViewInconsistency.setObjectName("actionViewInconsistency") |
539 | 488 |
self.actionText_Data_List = QtWidgets.QAction(MainWindow) |
540 |
icon26 = QtGui.QIcon()
|
|
541 |
icon26.addPixmap(QtGui.QPixmap(":/newPrefix/text_data_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
542 |
self.actionText_Data_List.setIcon(icon26)
|
|
489 |
icon23 = QtGui.QIcon()
|
|
490 |
icon23.addPixmap(QtGui.QPixmap(":/newPrefix/text_data_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
|
491 |
self.actionText_Data_List.setIcon(icon23)
|
|
543 | 492 |
self.actionText_Data_List.setObjectName("actionText_Data_List") |
544 | 493 |
self.actionDrawing_Only = QtWidgets.QAction(MainWindow) |
545 | 494 |
self.actionDrawing_Only.setCheckable(True) |
546 | 495 |
self.actionDrawing_Only.setObjectName("actionDrawing_Only") |
547 | 496 |
self.actionVendor = QtWidgets.QAction(MainWindow) |
548 | 497 |
self.actionVendor.setCheckable(True) |
549 |
icon27 = QtGui.QIcon() |
|
550 |
icon27.addPixmap(QtGui.QPixmap(":/newPrefix/Vendor.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
551 |
icon27.addPixmap(QtGui.QPixmap(":/newPrefix/vendor.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) |
|
552 |
icon27.addPixmap(QtGui.QPixmap(":/newPrefix/vendor.png"), QtGui.QIcon.Active, QtGui.QIcon.On) |
|
553 |
self.actionVendor.setIcon(icon27) |
|
498 |
icon24 = QtGui.QIcon() |
|
499 |
icon24.addPixmap(QtGui.QPixmap(":/newPrefix/Vendor.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
내보내기 Unified diff