개정판 e8f8936a
PDF의 텍스트를 적용한다
Change-Id: I1529b6e9c8fff88cc6f7f2d73b152634761bb7e3
DTI_PID/DTI_PID/ImportTextFromPDFDialog.py | ||
---|---|---|
1 |
# coding: utf-8 |
|
2 |
"""This is text importing module from AutoCAD""" |
|
3 |
import os |
|
4 |
import sys |
|
5 |
from PyQt5.QtCore import * |
|
6 |
from PyQt5.QtGui import * |
|
7 |
from PyQt5.QtWidgets import * |
|
8 |
from AppDocData import AppDocData |
|
9 |
import subprocess |
|
10 |
from xml.etree.ElementTree import Element, SubElement, dump, ElementTree, parse |
|
11 |
|
|
12 |
import ImportTextFromPDF_UI |
|
13 |
|
|
14 |
|
|
15 |
class QImportTextFromPDFDialog(QDialog): |
|
16 |
def __init__(self, parent): |
|
17 |
QDialog.__init__(self, parent) |
|
18 |
|
|
19 |
self.ui = ImportTextFromPDF_UI.Ui_ImportTextFromPDFDialog() |
|
20 |
self.ui.setupUi(self) |
|
21 |
|
|
22 |
self._dwgs = [] |
|
23 |
|
|
24 |
app_doc_data = AppDocData.instance() |
|
25 |
|
|
26 |
configs = app_doc_data.getConfigs('PDF Size', 'Width') |
|
27 |
self.ui.spinBoxWidth.setValue(int(configs[0].value)) if 1 == len(configs) else \ |
|
28 |
self.ui.spinBoxWidth.setValue(0) |
|
29 |
configs = app_doc_data.getConfigs('PDF Size', 'Height') |
|
30 |
self.ui.spinBoxHeight.setValue(int(configs[0].value)) if 1 == len(configs) else \ |
|
31 |
self.ui.spinBoxHeight.setValue(0) |
|
32 |
configs = app_doc_data.getConfigs('PDF Offset', 'X') |
|
33 |
self.ui.spinBoxTextX.setValue(int(configs[0].value)) if 1 == len(configs) else \ |
|
34 |
self.ui.spinBoxTextX.setValue(0) |
|
35 |
configs = app_doc_data.getConfigs('PDF Offset', 'Y') |
|
36 |
self.ui.spinBoxTextY.setValue(int(configs[0].value)) if 1 == len(configs) else \ |
|
37 |
self.ui.spinBoxTextY.setValue(0) |
|
38 |
configs = app_doc_data.getConfigs('PDF Offset', 'Scale') |
|
39 |
self.ui.doubleSpinBoxScale.setValue(float(configs[0].value)) if 1 == len(configs) else \ |
|
40 |
self.ui.doubleSpinBoxScale.setValue(0.5) |
|
41 |
self.text_scale = None |
|
42 |
|
|
43 |
self.isAccepted = False |
|
44 |
|
|
45 |
self.ui.toolButtonPDF.clicked.connect(self.on_add_PDF_click) |
|
46 |
self.ui.pushButtonSave.clicked.connect(self.on_save_setting) |
|
47 |
self.ui.pushButtonImport.clicked.connect(self.on_import_pdf) |
|
48 |
self.ui.pushButtonClose.clicked.connect(self.close) |
|
49 |
|
|
50 |
|
|
51 |
def on_add_PDF_click(self): |
|
52 |
"""select drawing files""" |
|
53 |
project = AppDocData.instance().getCurrentProject() |
|
54 |
|
|
55 |
options = QFileDialog.Options() |
|
56 |
options |= QFileDialog.DontUseNativeDialog |
|
57 |
files, _ = QFileDialog.getOpenFileNames(self, self.tr('Import', "Select Drawing File"), |
|
58 |
project.getDrawingFilePath(), "png files (*.png)", options=options) |
|
59 |
if files: |
|
60 |
self.ui.lineEditDrawing.setText(files[0]) if len(files) == 1 else \ |
|
61 |
self.ui.lineEditDrawing.setText(str(len(files)) + ' files') |
|
62 |
|
|
63 |
self._dwgs.clear() |
|
64 |
for file in files: |
|
65 |
if os.path.exists(file): |
|
66 |
self._dwgs.append(file) |
|
67 |
|
|
68 |
def on_save_setting(self): |
|
69 |
"""save setting""" |
|
70 |
from AppDocData import Config |
|
71 |
|
|
72 |
configs = [] |
|
73 |
configs.append(Config('PDF Size', 'Width', self.ui.spinBoxWidth.value())) |
|
74 |
configs.append(Config('PDF Size', 'Height', self.ui.spinBoxHeight.value())) |
|
75 |
configs.append(Config('PDF Offset', 'X', self.ui.spinBoxTextX.value())) |
|
76 |
configs.append(Config('PDF Offset', 'Y', self.ui.spinBoxTextY.value())) |
|
77 |
configs.append(Config('PDF Offset', 'Scale', self.ui.doubleSpinBoxScale.value())) |
|
78 |
|
|
79 |
app_doc_data = AppDocData.instance() |
|
80 |
app_doc_data.saveConfigs(configs) |
|
81 |
|
|
82 |
QMessageBox.information(self, self.tr('Information'), self.tr('Save Success!'), QMessageBox.Close) |
|
83 |
|
|
84 |
def on_import_pdf(self): |
|
85 |
"""import line and text from autocad""" |
|
86 |
import XmlGenerator as xg |
|
87 |
|
|
88 |
project = AppDocData.instance().getCurrentProject() |
|
89 |
|
|
90 |
temp_path = project.getTempPath() |
|
91 |
id2_xml_files = [f for f in os.listdir(temp_path) if os.path.isfile(os.path.join(temp_path, f)) and |
|
92 |
(os.path.splitext(f)[1].upper() == '.XML')] |
|
93 |
|
|
94 |
self.text_scale = [self.ui.spinBoxWidth.value(), self.ui.spinBoxHeight.value(), self.ui.spinBoxTextX.value(), self.ui.spinBoxTextY.value(), self.ui.doubleSpinBoxScale.value()] |
|
95 |
|
|
96 |
for _file in self._dwgs: |
|
97 |
file_name = os.path.splitext(os.path.basename(_file))[0] |
|
98 |
matches = [id2_xml_file for id2_xml_file in id2_xml_files if id2_xml_file.replace(file_name, '').upper() == '.XML'] |
|
99 |
if matches: |
|
100 |
try: |
|
101 |
pdf_xml_path = os.path.join(os.path.dirname(_file), os.path.splitext(os.path.basename(_file))[0] + '.xml') |
|
102 |
pdf_xml = parse(pdf_xml_path) |
|
103 |
|
|
104 |
id2_xml_path = os.path.join(temp_path, matches[0]) |
|
105 |
id2_xml = parse(id2_xml_path) |
|
106 |
|
|
107 |
pdf_xml_root = pdf_xml.getroot() |
|
108 |
id2_xml_root = id2_xml.getroot() |
|
109 |
|
|
110 |
"""remove texts from id2 xml file""" |
|
111 |
textInfo = id2_xml_root.find(xg.TEXT_INFO_LIST_NODE_NAME) |
|
112 |
textInfo.clear() |
|
113 |
|
|
114 |
noteInfo = id2_xml_root.find(xg.NOTE_TEXT_INFO_LIST_NOTE_NAME) |
|
115 |
noteInfo.clear() |
|
116 |
|
|
117 |
lineNoInfo = id2_xml_root.find(xg.LINE_NOS_NODE_NAME) |
|
118 |
lineNoInfo.clear() |
|
119 |
"""up to here""" |
|
120 |
|
|
121 |
"""remove unknowns from id2 xml file""" |
|
122 |
unknowns = id2_xml_root.find(xg.UNKNOWNS_NODE_NAME) |
|
123 |
unknowns.clear() |
|
124 |
"""up to here""" |
|
125 |
|
|
126 |
"""add text from autocad file to id xml file""" |
|
127 |
for blk_tbl_record in pdf_xml_root.iter('Text'): |
|
128 |
position = [float(token) for token in blk_tbl_record.attrib['Position'].split(',')] |
|
129 |
|
|
130 |
node = self.text_to_xml(blk_tbl_record, position) |
|
131 |
if node: |
|
132 |
textInfo.append(node) |
|
133 |
|
|
134 |
id2_xml.write(id2_xml_path, encoding="utf-8", xml_declaration=True) |
|
135 |
"""up to here""" |
|
136 |
|
|
137 |
QMessageBox.information(self, self.tr('Information'), self.tr('Importing Success!'), |
|
138 |
QMessageBox.Close) |
|
139 |
except Exception as ex: |
|
140 |
from App import App |
|
141 |
from AppDocData import MessageType |
|
142 |
|
|
143 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
144 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
145 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
146 |
|
|
147 |
def text_to_xml(self, text_node, position): |
|
148 |
"""try to convert text element to id2 xml""" |
|
149 |
import uuid |
|
150 |
from EngineeringTextItem import QEngineeringTextItem |
|
151 |
|
|
152 |
try: |
|
153 |
loc = [self.text_scale[2] + position[0], self.text_scale[3] + position[1]] |
|
154 |
|
|
155 |
text = text_node.text |
|
156 |
angle = 0#round(float(text_node.attrib['Angle']), 2) |
|
157 |
|
|
158 |
_height = self.text_scale[1] |
|
159 |
#loc[1] -= _height |
|
160 |
_width = round(_height * len(text) * self.text_scale[4]) |
|
161 |
|
|
162 |
allowed_error = 0.01 |
|
163 |
if abs(angle - 1.57) < allowed_error: |
|
164 |
_height, _width = _width, _height |
|
165 |
loc[0], loc[1] = loc[0] - _width, loc[1] - _height + _width |
|
166 |
elif abs(angle - 4.71) < allowed_error: |
|
167 |
_height, _width = _width, _height |
|
168 |
loc[0], loc[1] = loc[0] - _width, loc[1] + _height - _width |
|
169 |
|
|
170 |
item = QEngineeringTextItem() |
|
171 |
item.setPlainText(text) |
|
172 |
item.loc = loc |
|
173 |
item.size = (_width, _height) |
|
174 |
item.angle = angle |
|
175 |
|
|
176 |
node = item.toXml() |
|
177 |
|
|
178 |
return node |
|
179 |
except Exception as ex: |
|
180 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
181 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
182 |
|
|
183 |
print(message) |
|
184 |
|
|
185 |
def close(self): |
|
186 |
QDialog.reject(self) |
DTI_PID/DTI_PID/ImportTextFromPDF_UI.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
|
|
3 |
# Form implementation generated from reading ui file './UI/ImportTextFromPDF.ui' |
|
4 |
# |
|
5 |
# Created by: PyQt5 UI code generator 5.11.3 |
|
6 |
# |
|
7 |
# WARNING! All changes made in this file will be lost! |
|
8 |
|
|
9 |
from PyQt5 import QtCore, QtGui, QtWidgets |
|
10 |
|
|
11 |
class Ui_ImportTextFromPDFDialog(object): |
|
12 |
def setupUi(self, ImportTextFromPDFDialog): |
|
13 |
ImportTextFromPDFDialog.setObjectName("ImportTextFromPDFDialog") |
|
14 |
ImportTextFromPDFDialog.resize(650, 183) |
|
15 |
ImportTextFromPDFDialog.setMinimumSize(QtCore.QSize(650, 79)) |
|
16 |
ImportTextFromPDFDialog.setMaximumSize(QtCore.QSize(16777215, 650)) |
|
17 |
font = QtGui.QFont() |
|
18 |
font.setFamily("맑은 고딕") |
|
19 |
font.setBold(True) |
|
20 |
font.setWeight(75) |
|
21 |
ImportTextFromPDFDialog.setFont(font) |
|
22 |
self.verticalLayout = QtWidgets.QVBoxLayout(ImportTextFromPDFDialog) |
|
23 |
self.verticalLayout.setObjectName("verticalLayout") |
|
24 |
self.gridLayout = QtWidgets.QGridLayout() |
|
25 |
self.gridLayout.setObjectName("gridLayout") |
|
26 |
self.spinBoxWidth = QtWidgets.QSpinBox(ImportTextFromPDFDialog) |
|
27 |
self.spinBoxWidth.setEnabled(False) |
|
28 |
self.spinBoxWidth.setMinimumSize(QtCore.QSize(0, 0)) |
|
29 |
self.spinBoxWidth.setMinimum(-50000) |
|
30 |
self.spinBoxWidth.setMaximum(50000) |
|
31 |
self.spinBoxWidth.setObjectName("spinBoxWidth") |
|
32 |
self.gridLayout.addWidget(self.spinBoxWidth, 1, 1, 1, 1) |
|
33 |
self.label = QtWidgets.QLabel(ImportTextFromPDFDialog) |
|
34 |
self.label.setObjectName("label") |
|
35 |
self.gridLayout.addWidget(self.label, 1, 0, 1, 1) |
|
36 |
self.spinBoxHeight = QtWidgets.QSpinBox(ImportTextFromPDFDialog) |
|
37 |
self.spinBoxHeight.setMinimum(-50000) |
|
38 |
self.spinBoxHeight.setMaximum(50000) |
|
39 |
self.spinBoxHeight.setObjectName("spinBoxHeight") |
|
40 |
self.gridLayout.addWidget(self.spinBoxHeight, 1, 2, 1, 1) |
|
41 |
self.lineEditDrawing = QtWidgets.QLineEdit(ImportTextFromPDFDialog) |
|
42 |
self.lineEditDrawing.setObjectName("lineEditDrawing") |
|
43 |
self.gridLayout.addWidget(self.lineEditDrawing, 0, 1, 1, 3) |
|
44 |
self.horizontalLayout = QtWidgets.QHBoxLayout() |
|
45 |
self.horizontalLayout.setObjectName("horizontalLayout") |
|
46 |
self.spinBoxTextX = QtWidgets.QSpinBox(ImportTextFromPDFDialog) |
|
47 |
self.spinBoxTextX.setMinimum(-50000) |
|
48 |
self.spinBoxTextX.setMaximum(50000) |
|
49 |
self.spinBoxTextX.setObjectName("spinBoxTextX") |
|
50 |
self.horizontalLayout.addWidget(self.spinBoxTextX) |
|
51 |
self.spinBoxTextY = QtWidgets.QSpinBox(ImportTextFromPDFDialog) |
|
52 |
self.spinBoxTextY.setMinimum(-50000) |
|
53 |
self.spinBoxTextY.setMaximum(50000) |
|
54 |
self.spinBoxTextY.setObjectName("spinBoxTextY") |
|
55 |
self.horizontalLayout.addWidget(self.spinBoxTextY) |
|
56 |
self.doubleSpinBoxScale = QtWidgets.QDoubleSpinBox(ImportTextFromPDFDialog) |
|
57 |
self.doubleSpinBoxScale.setSingleStep(0.1) |
|
58 |
self.doubleSpinBoxScale.setObjectName("doubleSpinBoxScale") |
|
59 |
self.horizontalLayout.addWidget(self.doubleSpinBoxScale) |
|
60 |
self.gridLayout.addLayout(self.horizontalLayout, 2, 1, 1, 3) |
|
61 |
self.toolButtonPDF = QtWidgets.QToolButton(ImportTextFromPDFDialog) |
|
62 |
self.toolButtonPDF.setText("") |
|
63 |
icon = QtGui.QIcon() |
|
64 |
icon.addPixmap(QtGui.QPixmap(":/newPrefix/File.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
65 |
self.toolButtonPDF.setIcon(icon) |
|
66 |
self.toolButtonPDF.setObjectName("toolButtonPDF") |
|
67 |
self.gridLayout.addWidget(self.toolButtonPDF, 0, 4, 1, 1) |
|
68 |
self.pushButtonClose = QtWidgets.QPushButton(ImportTextFromPDFDialog) |
|
69 |
icon1 = QtGui.QIcon() |
|
70 |
icon1.addPixmap(QtGui.QPixmap(":/newPrefix/Remove.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
71 |
self.pushButtonClose.setIcon(icon1) |
|
72 |
self.pushButtonClose.setObjectName("pushButtonClose") |
|
73 |
self.gridLayout.addWidget(self.pushButtonClose, 5, 3, 1, 1) |
|
74 |
self.label_3 = QtWidgets.QLabel(ImportTextFromPDFDialog) |
|
75 |
self.label_3.setObjectName("label_3") |
|
76 |
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1) |
|
77 |
self.label_2 = QtWidgets.QLabel(ImportTextFromPDFDialog) |
|
78 |
self.label_2.setMinimumSize(QtCore.QSize(50, 0)) |
|
79 |
self.label_2.setObjectName("label_2") |
|
80 |
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1) |
|
81 |
self.pushButtonImport = QtWidgets.QPushButton(ImportTextFromPDFDialog) |
|
82 |
icon2 = QtGui.QIcon() |
|
83 |
icon2.addPixmap(QtGui.QPixmap(":/newPrefix/OK.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
84 |
self.pushButtonImport.setIcon(icon2) |
|
85 |
self.pushButtonImport.setObjectName("pushButtonImport") |
|
86 |
self.gridLayout.addWidget(self.pushButtonImport, 5, 2, 1, 1) |
|
87 |
self.pushButtonSave = QtWidgets.QPushButton(ImportTextFromPDFDialog) |
|
88 |
icon3 = QtGui.QIcon() |
|
89 |
icon3.addPixmap(QtGui.QPixmap(":/newPrefix/Save.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
90 |
self.pushButtonSave.setIcon(icon3) |
|
91 |
self.pushButtonSave.setObjectName("pushButtonSave") |
|
92 |
self.gridLayout.addWidget(self.pushButtonSave, 4, 1, 1, 3) |
|
93 |
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) |
|
94 |
self.gridLayout.addItem(spacerItem, 3, 1, 1, 1) |
|
95 |
self.verticalLayout.addLayout(self.gridLayout) |
|
96 |
self.errorLabel = QtWidgets.QLabel(ImportTextFromPDFDialog) |
|
97 |
self.errorLabel.setMaximumSize(QtCore.QSize(16777215, 0)) |
|
98 |
self.errorLabel.setStyleSheet("") |
|
99 |
self.errorLabel.setText("") |
|
100 |
self.errorLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) |
|
101 |
self.errorLabel.setObjectName("errorLabel") |
|
102 |
self.verticalLayout.addWidget(self.errorLabel) |
|
103 |
|
|
104 |
self.retranslateUi(ImportTextFromPDFDialog) |
|
105 |
QtCore.QMetaObject.connectSlotsByName(ImportTextFromPDFDialog) |
|
106 |
|
|
107 |
def retranslateUi(self, ImportTextFromPDFDialog): |
|
108 |
_translate = QtCore.QCoreApplication.translate |
|
109 |
ImportTextFromPDFDialog.setWindowTitle(_translate("ImportTextFromPDFDialog", "Import PDF")) |
|
110 |
self.label.setText(_translate("ImportTextFromPDFDialog", "Size(width, height) : ")) |
|
111 |
self.lineEditDrawing.setPlaceholderText(_translate("ImportTextFromPDFDialog", "Select Drawing File(s)")) |
|
112 |
self.pushButtonClose.setText(_translate("ImportTextFromPDFDialog", "Close")) |
|
113 |
self.label_3.setText(_translate("ImportTextFromPDFDialog", "Offset(x, y, scale) : ")) |
|
114 |
self.label_2.setText(_translate("ImportTextFromPDFDialog", "Drawing Files : ")) |
|
115 |
self.pushButtonImport.setText(_translate("ImportTextFromPDFDialog", "Import")) |
|
116 |
self.pushButtonSave.setText(_translate("ImportTextFromPDFDialog", "Save Setting")) |
|
117 |
|
|
118 |
import MainWindow_rc |
|
119 |
|
|
120 |
if __name__ == "__main__": |
|
121 |
import sys |
|
122 |
app = QtWidgets.QApplication(sys.argv) |
|
123 |
ImportTextFromPDFDialog = QtWidgets.QDialog() |
|
124 |
ui = Ui_ImportTextFromPDFDialog() |
|
125 |
ui.setupUi(ImportTextFromPDFDialog) |
|
126 |
ImportTextFromPDFDialog.show() |
|
127 |
sys.exit(app.exec_()) |
|
128 |
|
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
63 | 63 |
from TrainingSymbolImageListDialog import QTrainingSymbolImageListDialog |
64 | 64 |
from TextDataListDialog import QTextDataListDialog |
65 | 65 |
from ImportTextFromCADDialog import QImportTextFromCADDialog |
66 |
from ImportTextFromPDFDialog import QImportTextFromPDFDialog |
|
66 | 67 |
from SymbolThicknessDialog import QSymbolThicknessDialog |
67 | 68 |
from DisplayColors import DisplayColors |
68 | 69 |
from DisplayColors import DisplayOptions |
... | ... | |
252 | 253 |
self.actionFitWindow.triggered.connect(self.fitWindow) |
253 | 254 |
self.actionpdf_to_image.triggered.connect(self.onConvertPDFToImage) |
254 | 255 |
self.actionImport_Text_From_CAD.triggered.connect(self.on_import_text_from_cad) |
256 |
self.actionImport_Text_from_CAD_for_Instrument.triggered.connect(self.on_import_text_from_cad_for_instrument) |
|
255 | 257 |
self.actionSymbol_Thickness_Reinforcement.triggered.connect(self.onSymbolThickness) |
256 | 258 |
self.actionHelp.triggered.connect(self.on_help) |
257 | 259 |
self.actionReadme.triggered.connect(self.on_readme) |
... | ... | |
1059 | 1061 |
sys.exc_info()[-1].tb_lineno) |
1060 | 1062 |
self.addMessage.emit(MessageType.Error, message) |
1061 | 1063 |
|
1064 |
def on_import_text_from_cad_for_instrument(self): |
|
1065 |
""" import text from cad for instrument """ |
|
1066 |
try: |
|
1067 |
self.onCommandRejected() |
|
1068 |
dialog = QImportTextFromPDFDialog(self) |
|
1069 |
dialog.show() |
|
1070 |
dialog.exec_() |
|
1071 |
except Exception as ex: |
|
1072 |
message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \ |
|
1073 |
f"{sys.exc_info()[-1].tb_lineno}" |
|
1074 |
self.addMessage.emit(MessageType.Error, message) |
|
1075 |
|
|
1062 | 1076 |
def on_import_text_from_cad(self): |
1063 | 1077 |
""" import text from cad """ |
1064 | 1078 |
try: |
DTI_PID/DTI_PID/MainWindow_UI.py | ||
---|---|---|
659 | 659 |
icon44.addPixmap(QtGui.QPixmap(":/newPrefix/Readme.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
660 | 660 |
self.actionReadme.setIcon(icon44) |
661 | 661 |
self.actionReadme.setObjectName("actionReadme") |
662 |
self.actionImport_Text_from_CAD_for_Instrument = QtWidgets.QAction(MainWindow) |
|
663 |
self.actionImport_Text_from_CAD_for_Instrument.setObjectName("actionImport_Text_from_CAD_for_Instrument") |
|
662 | 664 |
self.menuExport.addAction(self.actionExportAsSVG) |
663 | 665 |
self.menuExport.addAction(self.actionExportAsXML) |
664 | 666 |
self.menuExport.addAction(self.actionExportAsImage) |
... | ... | |
699 | 701 |
self.menu_3.addAction(self.actionDrawing_Only) |
700 | 702 |
self.menu_4.addAction(self.actionpdf_to_image) |
701 | 703 |
self.menu_4.addAction(self.actionImport_Text_From_CAD) |
704 |
self.menu_4.addAction(self.actionImport_Text_from_CAD_for_Instrument) |
|
702 | 705 |
self.menu_4.addAction(self.actionSymbol_Thickness_Reinforcement) |
703 | 706 |
self.menu_4.addSeparator() |
704 | 707 |
self.menu_4.addAction(self.actionDataTransfer) |
... | ... | |
871 | 874 |
self.actionGlobal_Validation.setText(_translate("MainWindow", "Global Validation")) |
872 | 875 |
self.actionConnectLineToSymbol.setText(_translate("MainWindow", "Connect between symbols and lines")) |
873 | 876 |
self.actionReadme.setText(_translate("MainWindow", "Readme")) |
877 |
self.actionImport_Text_from_CAD_for_Instrument.setText(_translate("MainWindow", "Import Text from CAD for Instrument")) |
|
874 | 878 |
|
875 | 879 |
import MainWindow_rc |
876 | 880 |
|
DTI_PID/DTI_PID/UI/ImportTextFromPDF.ui | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<ui version="4.0"> |
|
3 |
<class>ImportTextFromPDFDialog</class> |
|
4 |
<widget class="QDialog" name="ImportTextFromPDFDialog"> |
|
5 |
<property name="geometry"> |
|
6 |
<rect> |
|
7 |
<x>0</x> |
|
8 |
<y>0</y> |
|
9 |
<width>650</width> |
|
10 |
<height>183</height> |
|
11 |
</rect> |
|
12 |
</property> |
|
13 |
<property name="minimumSize"> |
|
14 |
<size> |
|
15 |
<width>650</width> |
|
16 |
<height>79</height> |
|
17 |
</size> |
|
18 |
</property> |
|
19 |
<property name="maximumSize"> |
|
20 |
<size> |
|
21 |
<width>16777215</width> |
|
22 |
<height>650</height> |
|
23 |
</size> |
|
24 |
</property> |
|
25 |
<property name="font"> |
|
26 |
<font> |
|
27 |
<family>맑은 고딕</family> |
|
28 |
<weight>75</weight> |
|
29 |
<bold>true</bold> |
|
30 |
</font> |
|
31 |
</property> |
|
32 |
<property name="windowTitle"> |
|
33 |
<string>Import PDF</string> |
|
34 |
</property> |
|
35 |
<layout class="QVBoxLayout" name="verticalLayout"> |
|
36 |
<item> |
|
37 |
<layout class="QGridLayout" name="gridLayout"> |
|
38 |
<item row="1" column="1"> |
|
39 |
<widget class="QSpinBox" name="spinBoxWidth"> |
|
40 |
<property name="enabled"> |
|
41 |
<bool>false</bool> |
|
42 |
</property> |
|
43 |
<property name="minimumSize"> |
|
44 |
<size> |
|
45 |
<width>0</width> |
|
46 |
<height>0</height> |
|
47 |
</size> |
|
48 |
</property> |
|
49 |
<property name="minimum"> |
|
50 |
<number>-50000</number> |
|
51 |
</property> |
|
52 |
<property name="maximum"> |
|
53 |
<number>50000</number> |
|
54 |
</property> |
|
55 |
</widget> |
|
56 |
</item> |
|
57 |
<item row="1" column="0"> |
|
58 |
<widget class="QLabel" name="label"> |
|
59 |
<property name="text"> |
|
60 |
<string>Size(width, height) : </string> |
|
61 |
</property> |
|
62 |
</widget> |
|
63 |
</item> |
|
64 |
<item row="1" column="2"> |
|
65 |
<widget class="QSpinBox" name="spinBoxHeight"> |
|
66 |
<property name="minimum"> |
|
67 |
<number>-50000</number> |
|
68 |
</property> |
|
69 |
<property name="maximum"> |
|
70 |
<number>50000</number> |
|
71 |
</property> |
|
72 |
</widget> |
|
73 |
</item> |
|
74 |
<item row="0" column="1" colspan="3"> |
|
75 |
<widget class="QLineEdit" name="lineEditDrawing"> |
|
76 |
<property name="placeholderText"> |
|
77 |
<string>Select Drawing File(s)</string> |
|
78 |
</property> |
|
79 |
</widget> |
|
80 |
</item> |
|
81 |
<item row="2" column="1" colspan="3"> |
|
82 |
<layout class="QHBoxLayout" name="horizontalLayout"> |
|
83 |
<item> |
|
84 |
<widget class="QSpinBox" name="spinBoxTextX"> |
|
85 |
<property name="minimum"> |
|
86 |
<number>-50000</number> |
|
87 |
</property> |
|
88 |
<property name="maximum"> |
|
89 |
<number>50000</number> |
|
90 |
</property> |
|
91 |
</widget> |
|
92 |
</item> |
|
93 |
<item> |
|
94 |
<widget class="QSpinBox" name="spinBoxTextY"> |
|
95 |
<property name="minimum"> |
|
96 |
<number>-50000</number> |
|
97 |
</property> |
|
98 |
<property name="maximum"> |
|
99 |
<number>50000</number> |
|
100 |
</property> |
|
101 |
</widget> |
|
102 |
</item> |
|
103 |
<item> |
|
104 |
<widget class="QDoubleSpinBox" name="doubleSpinBoxScale"> |
|
105 |
<property name="singleStep"> |
|
106 |
<double>0.100000000000000</double> |
|
107 |
</property> |
|
108 |
</widget> |
|
109 |
</item> |
|
110 |
</layout> |
|
111 |
</item> |
|
112 |
<item row="0" column="4"> |
|
113 |
<widget class="QToolButton" name="toolButtonPDF"> |
|
114 |
<property name="text"> |
|
115 |
<string/> |
|
116 |
</property> |
|
117 |
<property name="icon"> |
|
118 |
<iconset resource="../res/MainWindow.qrc"> |
|
119 |
<normaloff>:/newPrefix/File.svg</normaloff>:/newPrefix/File.svg</iconset> |
|
120 |
</property> |
|
121 |
</widget> |
|
122 |
</item> |
|
123 |
<item row="5" column="3"> |
|
124 |
<widget class="QPushButton" name="pushButtonClose"> |
|
125 |
<property name="text"> |
|
126 |
<string>Close</string> |
|
127 |
</property> |
|
128 |
<property name="icon"> |
|
129 |
<iconset resource="../res/MainWindow.qrc"> |
|
130 |
<normaloff>:/newPrefix/Remove.svg</normaloff>:/newPrefix/Remove.svg</iconset> |
|
131 |
</property> |
|
132 |
</widget> |
|
133 |
</item> |
|
134 |
<item row="2" column="0"> |
|
135 |
<widget class="QLabel" name="label_3"> |
|
136 |
<property name="text"> |
|
137 |
<string>Offset(x, y, scale) : </string> |
|
138 |
</property> |
|
139 |
</widget> |
|
140 |
</item> |
|
141 |
<item row="0" column="0"> |
|
142 |
<widget class="QLabel" name="label_2"> |
|
143 |
<property name="minimumSize"> |
|
144 |
<size> |
|
145 |
<width>50</width> |
|
146 |
<height>0</height> |
|
147 |
</size> |
|
148 |
</property> |
|
149 |
<property name="text"> |
|
150 |
<string>Drawing Files : </string> |
|
151 |
</property> |
|
152 |
</widget> |
|
153 |
</item> |
|
154 |
<item row="5" column="2"> |
|
155 |
<widget class="QPushButton" name="pushButtonImport"> |
|
156 |
<property name="text"> |
|
157 |
<string>Import</string> |
|
158 |
</property> |
|
159 |
<property name="icon"> |
|
160 |
<iconset resource="../res/MainWindow.qrc"> |
|
161 |
<normaloff>:/newPrefix/OK.svg</normaloff>:/newPrefix/OK.svg</iconset> |
|
162 |
</property> |
|
163 |
</widget> |
|
164 |
</item> |
|
165 |
<item row="4" column="1" colspan="3"> |
|
166 |
<widget class="QPushButton" name="pushButtonSave"> |
|
167 |
<property name="text"> |
|
168 |
<string>Save Setting</string> |
|
169 |
</property> |
|
170 |
<property name="icon"> |
|
171 |
<iconset resource="../res/MainWindow.qrc"> |
|
172 |
<normaloff>:/newPrefix/Save.svg</normaloff>:/newPrefix/Save.svg</iconset> |
|
173 |
</property> |
|
174 |
</widget> |
|
175 |
</item> |
|
176 |
<item row="3" column="1"> |
|
177 |
<spacer name="verticalSpacer"> |
|
178 |
<property name="orientation"> |
|
179 |
<enum>Qt::Vertical</enum> |
|
180 |
</property> |
|
181 |
<property name="sizeHint" stdset="0"> |
|
182 |
<size> |
|
183 |
<width>20</width> |
|
184 |
<height>40</height> |
|
185 |
</size> |
|
186 |
</property> |
|
187 |
</spacer> |
|
188 |
</item> |
|
189 |
</layout> |
|
190 |
</item> |
|
191 |
<item> |
|
192 |
<widget class="QLabel" name="errorLabel"> |
|
193 |
<property name="maximumSize"> |
|
194 |
<size> |
|
195 |
<width>16777215</width> |
|
196 |
<height>0</height> |
|
197 |
</size> |
|
198 |
</property> |
|
199 |
<property name="styleSheet"> |
|
200 |
<string notr="true"/> |
|
201 |
</property> |
|
202 |
<property name="text"> |
|
203 |
<string/> |
|
204 |
</property> |
|
205 |
<property name="alignment"> |
|
206 |
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
|
207 |
</property> |
|
208 |
</widget> |
|
209 |
</item> |
|
210 |
</layout> |
|
211 |
</widget> |
|
212 |
<resources> |
|
213 |
<include location="../res/MainWindow.qrc"/> |
|
214 |
</resources> |
|
215 |
<connections/> |
|
216 |
</ui> |
DTI_PID/DTI_PID/UI/MainWindow.ui | ||
---|---|---|
146 | 146 |
</property> |
147 | 147 |
<addaction name="actionpdf_to_image"/> |
148 | 148 |
<addaction name="actionImport_Text_From_CAD"/> |
149 |
<addaction name="actionImport_Text_from_CAD_for_Instrument"/> |
|
149 | 150 |
<addaction name="actionSymbol_Thickness_Reinforcement"/> |
150 | 151 |
<addaction name="separator"/> |
151 | 152 |
<addaction name="actionDataTransfer"/> |
... | ... | |
1455 | 1456 |
<string>Readme</string> |
1456 | 1457 |
</property> |
1457 | 1458 |
</action> |
1459 |
<action name="actionImport_Text_from_CAD_for_Instrument"> |
|
1460 |
<property name="text"> |
|
1461 |
<string>Import Text from CAD for Instrument</string> |
|
1462 |
</property> |
|
1463 |
</action> |
|
1458 | 1464 |
</widget> |
1459 | 1465 |
<resources> |
1460 | 1466 |
<include location="../res/MainWindow.qrc"/> |
내보내기 Unified diff