개정판 caa1f0dd
issue #000: fix size area
Change-Id: Ief4b8bde7b3e25414853beeadce89ebc04967a64
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
1332 | 1332 |
@history euisung 2018.11.20 (0,0),(0,0) process add |
1333 | 1333 |
''' |
1334 | 1334 |
|
1335 |
def getAreaList(self): |
|
1335 |
def getAreaList(self, size=False):
|
|
1336 | 1336 |
from Area import Area |
1337 | 1337 |
|
1338 | 1338 |
if len(self._areas) == 0: |
... | ... | |
1347 | 1347 |
rows = cursor.fetchall() |
1348 | 1348 |
for row in rows: |
1349 | 1349 |
name = row['Key'] |
1350 |
if not size and name =='Size': |
|
1351 |
continue |
|
1350 | 1352 |
area = Area(name) |
1351 | 1353 |
area.parse(row['Value']) |
1352 | 1354 |
self._areas.append(area) |
... | ... | |
1355 | 1357 |
print('error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
1356 | 1358 |
sys.exc_info()[-1].tb_lineno)) |
1357 | 1359 |
|
1358 |
return self._areas |
|
1360 |
return self._areas if size else [area for area in self._areas if area.name != 'Size']
|
|
1359 | 1361 |
|
1360 | 1362 |
''' |
1361 | 1363 |
@brief get area of given name |
... | ... | |
1364 | 1366 |
''' |
1365 | 1367 |
|
1366 | 1368 |
def getArea(self, name): |
1367 |
areas = self.getAreaList() |
|
1369 |
areas = self.getAreaList(size=True)
|
|
1368 | 1370 |
matches = [area for area in areas if area.name == name] |
1369 | 1371 |
if 1 == len(matches) and matches[0].height is not 0 and matches[0].width is not 0: |
1370 | 1372 |
return matches[0] |
DTI_PID/DTI_PID/ConfigurationAreaDialog.py | ||
---|---|---|
51 | 51 |
self._cmd.onSuccess.connect(self.on_area_created) |
52 | 52 |
|
53 | 53 |
docData = AppDocData.instance() |
54 |
areas = docData.getAreaList() |
|
54 |
areas = docData.getAreaList(size=True)
|
|
55 | 55 |
|
56 | 56 |
# load area of drawing |
57 | 57 |
matches = [x for x in areas if x.name == 'Size'] |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
754 | 754 |
@brief show text recognition dialog |
755 | 755 |
@author humkyung |
756 | 756 |
@date 2018.08.08 |
757 |
'''
|
|
757 |
''' |
|
758 | 758 |
|
759 | 759 |
def on_success_to_recognize_line(self, x, y, width, height): |
760 | 760 |
import io |
DTI_PID/DTI_PID/XmlGenerator.py | ||
---|---|---|
412 | 412 |
xml = Element(ROOT_NODE_NAME) # Root Node |
413 | 413 |
"""write boundingbox""" |
414 | 414 |
app_doc_data = AppDocData.instance() |
415 |
areas = app_doc_data.getAreaList() |
|
415 |
areas = app_doc_data.getAreaList(size=True)
|
|
416 | 416 |
matches = [x for x in areas if x.name == 'Size'] |
417 | 417 |
if matches: |
418 | 418 |
xml.attrib['BoundingBox'] = f"{matches[0].x},{matches[0].y},{matches[0].width},{matches[0].height}" |
내보내기 Unified diff