개정판 68b30d9f
issue #1124: fixing title block
Change-Id: Icd5edb309a99d3b94d39d719e99e837bb77c81bc
DTI_PID/DTI_PID/Drawing.py | ||
---|---|---|
197 | 197 |
else: |
198 | 198 |
self._attrs.append([name, value]) |
199 | 199 |
|
200 |
print('attribute({},{})'.format(name, value)) |
|
200 |
#print('attribute({},{})'.format(name, value))
|
|
201 | 201 |
|
202 | 202 |
def from_database(self): |
203 | 203 |
""" load all components of drawing """ |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
2126 | 2126 |
appDocData = AppDocData.instance() |
2127 | 2127 |
|
2128 | 2128 |
# parse texts |
2129 |
for textInfo in textInfoList: |
|
2130 |
if len(textInfo[1]) is 0: |
|
2129 |
for textInfos in textInfoList:
|
|
2130 |
if len(textInfos[1]) is 0:
|
|
2131 | 2131 |
continue |
2132 |
x = textInfo[1][0].getX() |
|
2133 |
y = textInfo[1][0].getY() |
|
2134 |
width = textInfo[1][0].getW() |
|
2135 |
height = textInfo[1][0].getH() |
|
2136 |
angle = round(math.radians(textInfo[1][0].getAngle()), 2) |
|
2137 |
text = textInfo[1][0].getText() |
|
2138 |
item = TextItemFactory.instance().createTextItem(textInfo) |
|
2139 | 2132 |
|
2140 |
if item is not None: |
|
2141 |
item.loc = [x, y] |
|
2142 |
item.size = (width, height) |
|
2143 |
item.angle = angle |
|
2144 |
item.area = textInfo[0] |
|
2145 |
# self.addTextItemToScene(item) |
|
2146 |
# appDocData.texts.append(item) |
|
2147 |
appDocData.allItems.append(item) |
|
2133 |
for textInfo in textInfos[1]: |
|
2134 |
x = textInfo.getX() |
|
2135 |
y = textInfo.getY() |
|
2136 |
width = textInfo.getW() |
|
2137 |
height = textInfo.getH() |
|
2138 |
angle = round(math.radians(textInfo.getAngle()), 2) |
|
2139 |
text = textInfo.getText() |
|
2140 |
item = TextItemFactory.instance().createTextItem(textInfo) |
|
2141 |
|
|
2142 |
if item is not None: |
|
2143 |
item.loc = [x, y] |
|
2144 |
item.size = (width, height) |
|
2145 |
item.angle = angle |
|
2146 |
item.area = textInfos[0] |
|
2147 |
# self.addTextItemToScene(item) |
|
2148 |
# appDocData.texts.append(item) |
|
2149 |
appDocData.allItems.append(item) |
|
2148 | 2150 |
except Exception as ex: |
2149 | 2151 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
2150 | 2152 |
sys.exc_info()[-1].tb_lineno) |
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py | ||
---|---|---|
726 | 726 |
|
727 | 727 |
titleBlockProps = appDocData.getTitleBlockProperties() |
728 | 728 |
if titleBlockProps: |
729 |
cols = ['UID', 'Drawing_UID', 'TitleBlockProperties_UID', 'VALUE'] |
|
729 |
cols = ['UID', 'Drawings_UID', 'TitleBlockProperties_UID', 'VALUE']
|
|
730 | 730 |
values = ['?', '?', '?', '?'] |
731 | 731 |
params = [] |
732 | 732 |
for titleBlockProp in titleBlockProps: |
733 | 733 |
if self.area == titleBlockProp[0]: |
734 |
params.append((str(self.uid), appDocData.activeDrawing.name, self.area, self.text()))
|
|
734 |
params.append((str(self.uid), appDocData.activeDrawing.UID, self.area, self.text()))
|
|
735 | 735 |
|
736 | 736 |
sql = 'insert into TitleBlockValues({}) values({})'.format(','.join(cols), ','.join(values)) |
737 | 737 |
if params: res.append((sql, tuple(params))) |
내보내기 Unified diff