프로젝트

일반

사용자정보

개정판 6642ad5b

ID6642ad5bde31ff2114281ed526c0892f3ccc6b6f
상위 565ec74a
하위 60ace834

백흠경이(가) 4년 이상 전에 추가함

issue #1445: support text element

Change-Id: If61c57741e84986caa47f60c2a531b2abe87c370

차이점 보기:

DTI_PID/DTI_PID/DEXPI/Shape.py
2 2
""" This is Shape module """
3 3

  
4 4
from xml.etree.ElementTree import Element, SubElement, dump, ElementTree, parse, tostring
5
from PyQt5.QtCore import *
5 6
from .Presentation import Presentation
6 7

  
7 8

  
......
26 27
        self.start = start
27 28
        self.end = end
28 29

  
29
    def to_xml(self):
30
    def to_xml(self, rect: QRectF):
30 31
        node = Element('Line')
31 32
        Presentation.to_xml(node, layer='125', color='0', line_type='1', line_weight=0.35, r=0, g=0, b=0)
32 33
        extent_node = SubElement(node, 'Extent')
......
40 41
        max_node.attrib['Z'] = '0'
41 42
        coordinate_node = SubElement(node, 'Coordinate')
42 43
        coordinate_node.attrib['X'] = str(self.start.real)
43
        coordinate_node.attrib['Y'] = str(self.start.imag)
44
        coordinate_node.attrib['Y'] = str(rect.height() - self.start.imag)
44 45
        coordinate_node.attrib['Z'] = '0'
45 46
        coordinate_node = SubElement(node, 'Coordinate')
46 47
        coordinate_node.attrib['X'] = str(self.end.real)
47
        coordinate_node.attrib['Y'] = str(self.end.imag)
48
        coordinate_node.attrib['Y'] = str(rect.height() - self.end.imag)
48 49
        coordinate_node.attrib['Z'] = '0'
49 50

  
50 51
        return node

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)