개정판 d4beff71
issue #622: load conn info from db
Change-Id: I2263b989b0d844ec30f16bcd8a43753c232cf217
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
1335 | 1335 |
origin = [float(x) for x in component['SceneOriginPoint'].split(',')] if component['SceneOriginPoint'] is not None else pt |
1336 | 1336 |
connPts = [] |
1337 | 1337 |
if component['ConnectionPoint']: |
1338 |
if dbData: |
|
1339 |
db_conn = dbData.connectionPoint.split('/') |
|
1340 |
db_symbol_num = [conn.split(',')[3] for conn in db_conn] |
|
1341 |
index = 0 |
|
1338 | 1342 |
for conn_pt in component['ConnectionPoint'].split('/'): |
1339 | 1343 |
tokens = conn_pt.split(',') |
1340 | 1344 |
connPts.append(('AUTO', float(tokens[0]), float(tokens[1]), '0') if len(tokens) == 2 else |
1341 | 1345 |
(tokens[0], float(tokens[1]), float(tokens[2]), '0') if len(tokens) == 3 else |
1342 |
(tokens[0], float(tokens[1]), float(tokens[2]), tokens[3])) |
|
1346 |
(tokens[0], float(tokens[1]), float(tokens[2]), tokens[3] if dbData is None else db_symbol_num[index])) |
|
1347 |
index += 1 |
|
1343 | 1348 |
|
1344 | 1349 |
baseSymbol = dbData.baseSymbol |
1345 | 1350 |
|
... | ... | |
1483 | 1488 |
origin = [float(x) for x in node.find('ORIGINALPOINT').text.split(',')] |
1484 | 1489 |
connPts = [] |
1485 | 1490 |
if node.find('CONNECTIONPOINT').text is not None: |
1491 |
if dbData: |
|
1492 |
db_conn = dbData.connectionPoint.split('/') |
|
1493 |
db_symbol_num = [conn.split(',')[3] for conn in db_conn] |
|
1494 |
index = 0 |
|
1486 | 1495 |
for conn_pt in node.find('CONNECTIONPOINT').text.split('/'): |
1487 | 1496 |
tokens = conn_pt.split(',') |
1488 | 1497 |
connPts.append(('AUTO', float(tokens[0]), float(tokens[1]), '0') if len(tokens) == 2 else |
1489 | 1498 |
(tokens[0], float(tokens[1]), float(tokens[2]), '0') if len(tokens) == 3 else |
1490 |
(tokens[0], float(tokens[1]), float(tokens[2]), tokens[3])) |
|
1499 |
(tokens[0], float(tokens[1]), float(tokens[2]), tokens[3] if dbData is None else db_symbol_num[index])) |
|
1500 |
index += 1 |
|
1491 | 1501 |
baseSymbol = node.find('PARENT').text if dbData is None else dbData.baseSymbol |
1492 | 1502 |
childSymbolNode = node.find('CHILD') |
1493 | 1503 |
childSymbol = '' |
내보내기 Unified diff