개정판 2dad6e8c
add pdf print
Change-Id: I98c7ff137ebcbc717407ff6ba6da20125cd5b4dd
DTI_PID/DTI_PID/AppRibbon.py | ||
---|---|---|
315 | 315 |
self._panes['Tool'] = pane |
316 | 316 |
pane.ui.toolButtonPDFToImage.clicked.connect(main_wnd.onConvertPDFToImage) |
317 | 317 |
pane.ui.toolButtonImportTextFromCAD.clicked.connect(main_wnd.on_import_text_from_cad) |
318 |
pane.ui.toolButtonExportPDF.clicked.connect(main_wnd.on_export_PDF) |
|
318 | 319 |
pane.ui.toolButtonImportTextFromCADforInstrument.clicked.connect(main_wnd.on_import_text_from_cad_for_instrument) |
319 | 320 |
pane.ui.toolButtonSymbolThicknessReinforcement.clicked.connect(main_wnd.onSymbolThickness) |
320 | 321 |
pane.ui.toolButtonDataTransfer.clicked.connect(main_wnd.on_show_data_transfer) |
DTI_PID/DTI_PID/LineNoTracer.py | ||
---|---|---|
856 | 856 |
for index in dupl: |
857 | 857 |
end_breaks.pop(index) |
858 | 858 |
|
859 |
''' test code for converter |
|
860 |
for end_break in end_breaks: |
|
861 |
if type(end_break.prop('Connected Item')) is not QEngineeringLineItem and type(end_break.owner) is QEngineeringLineItem: |
|
862 |
connLine = end_break.prop('Connected Item') |
|
863 |
end_break.remove_assoc_item(connLine) |
|
864 |
end_break.set_property('Connected Item', end_break.owner) |
|
865 |
end_break.owner = connLine |
|
866 |
''' |
|
867 |
|
|
859 | 868 |
for end_break in end_breaks: |
860 | 869 |
if not end_break.prop('Freeze'): |
861 | 870 |
end_break.transfer.onRemoved.connect(App.mainWnd().itemRemoved) |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
25 | 25 |
from PyQt5.QtGui import * |
26 | 26 |
from PyQt5.QtWidgets import * |
27 | 27 |
from PyQt5.QtSvg import * |
28 |
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter |
|
28 | 29 |
|
29 | 30 |
from PIL import Image |
30 | 31 |
|
... | ... | |
1209 | 1210 |
f"{sys.exc_info()[-1].tb_lineno}" |
1210 | 1211 |
self.addMessage.emit(MessageType.Error, message) |
1211 | 1212 |
|
1213 |
def on_export_PDF(self): |
|
1214 |
if not self.graphicsView.hasImage(): |
|
1215 |
self.showImageSelectionMessageBox() |
|
1216 |
|
|
1217 |
try: |
|
1218 |
printer = QPrinter(QPrinter.HighResolution) |
|
1219 |
#printer.setPageSize(QPrinter.A4) |
|
1220 |
printer.setOrientation(QPrinter.Orientation.Landscape) |
|
1221 |
dialog = QPrintDialog(printer) |
|
1222 |
if (dialog.exec() == QDialog.Accepted): |
|
1223 |
painter = QPainter(printer) |
|
1224 |
isfull_print = False |
|
1225 |
|
|
1226 |
scene = self.graphicsView.scene() |
|
1227 |
|
|
1228 |
for item in scene.items(): |
|
1229 |
if not hasattr(item, 'connectors'): continue |
|
1230 |
for connector in item.connectors: connector.setVisible(False) |
|
1231 |
|
|
1232 |
canvasRect = scene.sceneRect() # or canvasRect = scene.border.boundingRect() |
|
1233 |
source = canvasRect |
|
1234 |
page = printer.pageRect(QPrinter.Unit.DevicePixel) |
|
1235 |
target = QRectF(QPointF(0, 0), QSizeF(page.width(), page.height())) |
|
1236 |
scene.render(painter, target, source) |
|
1237 |
painter.end() |
|
1238 |
|
|
1239 |
for item in scene.items(): |
|
1240 |
if not hasattr(item, 'connectors'): continue |
|
1241 |
for connector in item.connectors: connector.setVisible(True) |
|
1242 |
|
|
1243 |
except Exception as ex: |
|
1244 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
1245 |
sys.exc_info()[-1].tb_lineno) |
|
1246 |
self.addMessage.emit(MessageType.Error, message) |
|
1247 |
|
|
1212 | 1248 |
def onSymbolThickness(self): |
1213 | 1249 |
""" symbol thickness reinforcement by using configuration filter drawing dilate size """ |
1214 | 1250 |
try: |
DTI_PID/DTI_PID/UI/Tool.ui | ||
---|---|---|
6 | 6 |
<rect> |
7 | 7 |
<x>0</x> |
8 | 8 |
<y>0</y> |
9 |
<width>564</width>
|
|
9 |
<width>662</width>
|
|
10 | 10 |
<height>70</height> |
11 | 11 |
</rect> |
12 | 12 |
</property> |
... | ... | |
34 | 34 |
<property name="spacing"> |
35 | 35 |
<number>0</number> |
36 | 36 |
</property> |
37 |
<item row="0" column="1"> |
|
38 |
<widget class="QToolButton" name="toolButtonImportTextFromCAD"> |
|
37 |
<item row="0" column="8"> |
|
38 |
<widget class="Line" name="line_3"> |
|
39 |
<property name="orientation"> |
|
40 |
<enum>Qt::Vertical</enum> |
|
41 |
</property> |
|
42 |
</widget> |
|
43 |
</item> |
|
44 |
<item row="0" column="7"> |
|
45 |
<widget class="QToolButton" name="toolButtonDataExport"> |
|
39 | 46 |
<property name="text"> |
40 |
<string>Import
|
|
41 |
AutoCAD</string>
|
|
47 |
<string>Data
|
|
48 |
Export</string>
|
|
42 | 49 |
</property> |
43 | 50 |
<property name="icon"> |
44 | 51 |
<iconset resource="../res/MainWindow.qrc"> |
45 |
<normaloff>:/newPrefix/AutoCAD.svg</normaloff>:/newPrefix/AutoCAD.svg</iconset>
|
|
52 |
<normaloff>:/newPrefix/Change.svg</normaloff>:/newPrefix/Change.svg</iconset>
|
|
46 | 53 |
</property> |
47 | 54 |
<property name="iconSize"> |
48 | 55 |
<size> |
... | ... | |
58 | 65 |
</property> |
59 | 66 |
</widget> |
60 | 67 |
</item> |
61 |
<item row="0" column="5"> |
|
62 |
<widget class="QToolButton" name="toolButtonDataTransfer"> |
|
68 |
<item row="0" column="3"> |
|
69 |
<widget class="QToolButton" name="toolButtonSymbolThicknessReinforcement"> |
|
70 |
<property name="toolTip"> |
|
71 |
<string>Symbol Thickness Reinforcement</string> |
|
72 |
</property> |
|
63 | 73 |
<property name="text"> |
64 |
<string>Data
|
|
65 |
Transfer</string>
|
|
74 |
<string>Symbol Thick
|
|
75 |
Reinforcement</string>
|
|
66 | 76 |
</property> |
67 | 77 |
<property name="icon"> |
68 | 78 |
<iconset resource="../res/MainWindow.qrc"> |
69 |
<normaloff>:/newPrefix/Change.svg</normaloff>:/newPrefix/Change.svg</iconset>
|
|
79 |
<normaloff>:/newPrefix/Reinforcement.svg</normaloff>:/newPrefix/Reinforcement.svg</iconset>
|
|
70 | 80 |
</property> |
71 | 81 |
<property name="iconSize"> |
72 | 82 |
<size> |
... | ... | |
82 | 92 |
</property> |
83 | 93 |
</widget> |
84 | 94 |
</item> |
85 |
<item row="0" column="4"> |
|
86 |
<widget class="Line" name="line_2"> |
|
87 |
<property name="orientation"> |
|
88 |
<enum>Qt::Vertical</enum> |
|
89 |
</property> |
|
90 |
</widget> |
|
91 |
</item> |
|
92 |
<item row="0" column="3"> |
|
93 |
<widget class="QToolButton" name="toolButtonSymbolThicknessReinforcement"> |
|
94 |
<property name="toolTip"> |
|
95 |
<string>Symbol Thickness Reinforcement</string> |
|
96 |
</property> |
|
95 |
<item row="0" column="10"> |
|
96 |
<widget class="QToolButton" name="toolButtonExtApps"> |
|
97 | 97 |
<property name="text"> |
98 |
<string>Symbol Thick
|
|
99 |
Reinforcement</string>
|
|
98 |
<string> |
|
99 |
Ext Apps</string>
|
|
100 | 100 |
</property> |
101 | 101 |
<property name="icon"> |
102 | 102 |
<iconset resource="../res/MainWindow.qrc"> |
103 |
<normaloff>:/newPrefix/Reinforcement.svg</normaloff>:/newPrefix/Reinforcement.svg</iconset>
|
|
103 |
<normaloff>:/newPrefix/Terminal.svg</normaloff>:/newPrefix/Terminal.svg</iconset>
|
|
104 | 104 |
</property> |
105 | 105 |
<property name="iconSize"> |
106 | 106 |
<size> |
... | ... | |
116 | 116 |
</property> |
117 | 117 |
</widget> |
118 | 118 |
</item> |
119 |
<item row="0" column="7"> |
|
120 |
<widget class="Line" name="line_3"> |
|
121 |
<property name="orientation"> |
|
122 |
<enum>Qt::Vertical</enum> |
|
119 |
<item row="0" column="2"> |
|
120 |
<widget class="QToolButton" name="toolButtonImportTextFromCADforInstrument"> |
|
121 |
<property name="text"> |
|
122 |
<string>Import Text |
|
123 |
</string> |
|
124 |
</property> |
|
125 |
<property name="icon"> |
|
126 |
<iconset resource="../res/MainWindow.qrc"> |
|
127 |
<normaloff>:/newPrefix/import_text_from_pdf_32px.svg</normaloff>:/newPrefix/import_text_from_pdf_32px.svg</iconset> |
|
128 |
</property> |
|
129 |
<property name="iconSize"> |
|
130 |
<size> |
|
131 |
<width>32</width> |
|
132 |
<height>32</height> |
|
133 |
</size> |
|
134 |
</property> |
|
135 |
<property name="toolButtonStyle"> |
|
136 |
<enum>Qt::ToolButtonTextUnderIcon</enum> |
|
137 |
</property> |
|
138 |
<property name="autoRaise"> |
|
139 |
<bool>true</bool> |
|
123 | 140 |
</property> |
124 | 141 |
</widget> |
125 | 142 |
</item> |
126 |
<item row="0" column="0">
|
|
127 |
<widget class="QToolButton" name="toolButtonPDFToImage">
|
|
143 |
<item row="0" column="1">
|
|
144 |
<widget class="QToolButton" name="toolButtonImportTextFromCAD">
|
|
128 | 145 |
<property name="text"> |
129 |
<string>Convert
|
|
130 |
PDF</string>
|
|
146 |
<string>Import
|
|
147 |
AutoCAD</string>
|
|
131 | 148 |
</property> |
132 | 149 |
<property name="icon"> |
133 | 150 |
<iconset resource="../res/MainWindow.qrc"> |
134 |
<normaloff>:/newPrefix/pdf_32px.svg</normaloff>:/newPrefix/pdf_32px.svg</iconset>
|
|
151 |
<normaloff>:/newPrefix/AutoCAD.svg</normaloff>:/newPrefix/AutoCAD.svg</iconset>
|
|
135 | 152 |
</property> |
136 | 153 |
<property name="iconSize"> |
137 | 154 |
<size> |
... | ... | |
147 | 164 |
</property> |
148 | 165 |
</widget> |
149 | 166 |
</item> |
150 |
<item row="0" column="8">
|
|
167 |
<item row="0" column="9">
|
|
151 | 168 |
<widget class="QToolButton" name="toolButtonConnection"> |
152 | 169 |
<property name="text"> |
153 | 170 |
<string>Connection</string> |
... | ... | |
173 | 190 |
</property> |
174 | 191 |
</widget> |
175 | 192 |
</item> |
193 |
<item row="0" column="5"> |
|
194 |
<widget class="Line" name="line_2"> |
|
195 |
<property name="orientation"> |
|
196 |
<enum>Qt::Vertical</enum> |
|
197 |
</property> |
|
198 |
</widget> |
|
199 |
</item> |
|
176 | 200 |
<item row="0" column="6"> |
177 |
<widget class="QToolButton" name="toolButtonDataExport">
|
|
201 |
<widget class="QToolButton" name="toolButtonDataTransfer">
|
|
178 | 202 |
<property name="text"> |
179 | 203 |
<string>Data |
180 |
Export</string>
|
|
204 |
Transfer</string>
|
|
181 | 205 |
</property> |
182 | 206 |
<property name="icon"> |
183 | 207 |
<iconset resource="../res/MainWindow.qrc"> |
... | ... | |
197 | 221 |
</property> |
198 | 222 |
</widget> |
199 | 223 |
</item> |
200 |
<item row="0" column="2">
|
|
201 |
<widget class="QToolButton" name="toolButtonImportTextFromCADforInstrument">
|
|
224 |
<item row="0" column="0">
|
|
225 |
<widget class="QToolButton" name="toolButtonPDFToImage">
|
|
202 | 226 |
<property name="text"> |
203 |
<string>Import Text
|
|
204 |
</string> |
|
227 |
<string>Convert
|
|
228 |
PDF</string>
|
|
205 | 229 |
</property> |
206 | 230 |
<property name="icon"> |
207 | 231 |
<iconset resource="../res/MainWindow.qrc"> |
208 |
<normaloff>:/newPrefix/import_text_from_pdf_32px.svg</normaloff>:/newPrefix/import_text_from_pdf_32px.svg</iconset>
|
|
232 |
<normaloff>:/newPrefix/pdf_32px.svg</normaloff>:/newPrefix/pdf_32px.svg</iconset>
|
|
209 | 233 |
</property> |
210 | 234 |
<property name="iconSize"> |
211 | 235 |
<size> |
... | ... | |
221 | 245 |
</property> |
222 | 246 |
</widget> |
223 | 247 |
</item> |
224 |
<item row="0" column="9"> |
|
225 |
<widget class="QToolButton" name="toolButtonExtApps"> |
|
248 |
<item row="0" column="4"> |
|
249 |
<widget class="QToolButton" name="toolButtonExportPDF"> |
|
250 |
<property name="toolTip"> |
|
251 |
<string>Export PDF</string> |
|
252 |
</property> |
|
226 | 253 |
<property name="text"> |
227 |
<string> |
|
228 |
Ext Apps</string> |
|
254 |
<string>Export PDF</string> |
|
229 | 255 |
</property> |
230 | 256 |
<property name="icon"> |
231 | 257 |
<iconset resource="../res/MainWindow.qrc"> |
232 |
<normaloff>:/newPrefix/Terminal.svg</normaloff>:/newPrefix/Terminal.svg</iconset>
|
|
258 |
<normaloff>:/newPrefix/pdf_32px.svg</normaloff>:/newPrefix/pdf_32px.svg</iconset>
|
|
233 | 259 |
</property> |
234 | 260 |
<property name="iconSize"> |
235 | 261 |
<size> |
ID2.wxs | ||
---|---|---|
293 | 293 |
<Component Id="cmp8F663738728487536D57561ADB27042C" Directory="INSTALLFOLDER" Guid="18C0A903-23EE-418A-AFF1-AE4AA23C8271" Win64="yes"> |
294 | 294 |
<File Id="fil7FEA2FE12F19B403AC4DAB75B7D5B975" KeyPath="yes" Source=".\dist\App\coffee.qss" /> |
295 | 295 |
</Component> |
296 |
<Component Id="cmp9B336C9C2D11E977F4D90C865B4B6000" Directory="INSTALLFOLDER" Guid="E39928AC-7CB3-472A-BC9F-2202FB5D4484" Win64="yes"> |
|
297 |
<File Id="fil56DF0F398893E7C4160149711A709C5D" KeyPath="yes" Source=".\dist\App\Qt5PrintSupport.dll" /> |
|
298 |
</Component> |
|
299 |
<Component Id="cmpAC6C97A21532E3012B09C33BFBEF017B" Directory="dirA9FD36F6352035DCEE931BAECC9C6447" Guid="29E1A044-DFB5-42D3-AD7D-703BE2B98166" Win64="yes"> |
|
300 |
<File Id="fil4F74BACD9316731D6714F23C67AF54A0" KeyPath="yes" Source=".\dist\App\PyQt5\Qt\plugins\printsupport\windowsprintersupport.dll" /> |
|
301 |
</Component> |
|
302 |
<Component Id="cmp6CF99078EDB0EEDDA49199D56DDCB01F" Directory="dir0395578F1B049DC836212B0E8A74915E" Guid="74BCC434-62FC-449C-A02F-856E88A27CEE" Win64="yes"> |
|
303 |
<File Id="fil9A6441AC6E6C6B8AB55C918CD841FC0C" KeyPath="yes" Source=".\dist\App\PyQt5\QtPrintSupport.pyd" /> |
|
304 |
</Component> |
|
296 | 305 |
<Component Id="cmp341C65D9EB2A548DAC0A1D008FD4EC19" Directory="INSTALLFOLDER" Guid="550F96A6-4C7E-4839-B00A-0736090571D1" Win64="yes"> |
297 | 306 |
<File Id="filCA1B8E0A8C516D2B0C413958E5BD8080" KeyPath="yes" Source=".\dist\App\d3dcompiler_47.dll" /> |
298 | 307 |
</Component> |
... | ... | |
6909 | 6918 |
</DirectoryRef> |
6910 | 6919 |
</Fragment> |
6911 | 6920 |
<Fragment> |
6921 |
<DirectoryRef Id="dirC2E3E238A9038D3B90F99E903C25E23D"> |
|
6922 |
<Directory Id="dirA9FD36F6352035DCEE931BAECC9C6447" Name="printsupport" /> |
|
6923 |
</DirectoryRef> |
|
6924 |
</Fragment> |
|
6925 |
<Fragment> |
|
6912 | 6926 |
<DirectoryRef Id="dirFF8A5F6AB2840454DDD12C10ADD1B6E2"> |
6913 | 6927 |
<Directory Id="dir7DD817E37E0489ADE209C53F490CBB16" Name="8.5" /> |
6914 | 6928 |
</DirectoryRef> |
내보내기 Unified diff