개정판 12eceae6
SVG 파일 생성 위치 수정
Change-Id: I10573529d55c8b530287893d33b8a22d22ac032c
HYTOS/HYTOS/MainWindow.py | ||
---|---|---|
161 | 161 |
""" This is MainWindow class """ |
162 | 162 |
DEFAULT_SIZE = QSizeF(1188, 841) |
163 | 163 |
PAPER_SIZE = QSizeF(1500, 950) # 엑셀에서 이미지 영역의 크기(픽셀 단위) |
164 |
USE_IMAGE = 'Use Image' |
|
164 | 165 |
addMessage = pyqtSignal(Enum, str) |
165 | 166 |
|
166 | 167 |
def __init__(self): |
... | ... | |
1554 | 1555 |
self.showImageSelectionMessageBox() |
1555 | 1556 |
return |
1556 | 1557 |
|
1557 |
report_drawing = 'Use Image'
|
|
1558 |
report_drawing = MainWindow.USE_IMAGE
|
|
1558 | 1559 |
configs = app_doc_data.getAppConfigs('option', 'ReportDrawing') |
1559 | 1560 |
if configs and configs[0].value: |
1560 | 1561 |
report_drawing = configs[0].value |
1561 | 1562 |
|
1562 | 1563 |
report_drawing_path = None |
1563 | 1564 |
with NamedTemporaryFile() as f: |
1564 |
report_drawing_path = f.name + '.png' if report_drawing == 'Use Image' else '.svg'
|
|
1565 |
report_drawing_path = f.name + '.png' if report_drawing == MainWindow.USE_IMAGE else f.name + '.svg'
|
|
1565 | 1566 |
|
1566 | 1567 |
if report_drawing_path: |
1567 | 1568 |
self.on_view_connector(False) # hide connector |
1568 |
if report_drawing == 'Use Image':
|
|
1569 |
if report_drawing == MainWindow.USE_IMAGE:
|
|
1569 | 1570 |
self.graphicsView.save_as_image(report_drawing_path) |
1570 | 1571 |
else: |
1571 | 1572 |
self.graphicsView.save_as_svg(report_drawing_path) # try to use save_as_svg when will generate svg file |
... | ... | |
1598 | 1599 |
ws = wb.copy_worksheet(wb.get_sheet_by_name('Page')) |
1599 | 1600 |
ws.title = f"Page ({page_no})" |
1600 | 1601 |
|
1601 |
if report_drawing == 'Use Image':
|
|
1602 |
if report_drawing == MainWindow.USE_IMAGE:
|
|
1602 | 1603 |
cal_image = openpyxl.drawing.image.Image(report_drawing_path) |
1603 | 1604 |
x_scale = MainWindow.PAPER_SIZE.width() / cal_image.width |
1604 | 1605 |
y_scale = MainWindow.PAPER_SIZE.height() / cal_image.height |
내보내기 Unified diff