개정판 5442f663
issue #000: fix OPCRelationDialog and testing, improve loading drawing
Change-Id: I492dd46014f1d0004f697e8f3b5606e40dbaefd0
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
86 | 86 |
self.needReOpening = None |
87 | 87 |
|
88 | 88 |
self._configs = None |
89 |
self._symbolBase = {} |
|
89 | 90 |
|
90 | 91 |
def clearItemList(self, trim): |
91 | 92 |
''' |
... | ... | |
475 | 476 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
476 | 477 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
477 | 478 |
finally: |
479 |
self._symbolBase = {} |
|
478 | 480 |
return (isUpdated, symbol.getType(), symbol.getName(), symbol.getPath()) |
479 | 481 |
|
480 | 482 |
''' |
... | ... | |
1429 | 1431 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
1430 | 1432 |
ret = False |
1431 | 1433 |
finally: |
1434 |
self._symbolBase = {} |
|
1432 | 1435 |
return (ret, fileName) |
1433 | 1436 |
|
1434 | 1437 |
''' |
... | ... | |
1438 | 1441 |
def getSymbolByQuery(self, fieldName, param): |
1439 | 1442 |
ret = None |
1440 | 1443 |
|
1444 |
if fieldName in self._symbolBase: |
|
1445 |
if param in self._symbolBase[fieldName]: |
|
1446 |
ret = self._symbolBase[fieldName][param] |
|
1447 |
return ret |
|
1448 |
else: |
|
1449 |
self._symbolBase[fieldName] = {} |
|
1450 |
|
|
1441 | 1451 |
conn = self.project.database.connect() |
1442 | 1452 |
with conn: |
1443 | 1453 |
cursor = conn.cursor() |
... | ... | |
1451 | 1461 |
ret = symbol.SymbolBase(symbolTuple[1], symbolTuple[2], symbolTuple[3] |
1452 | 1462 |
, symbolTuple[4], symbolTuple[5], symbolTuple[6], symbolTuple[7], symbolTuple[8] |
1453 | 1463 |
, symbolTuple[9], symbolTuple[10], symbolTuple[11], symbolTuple[12], symbolTuple[13], symbolTuple[14], symbolTuple[0], detectFlip=symbolTuple[15]) ## uid is last item |
1464 |
self._symbolBase[fieldName][param] = ret |
|
1454 | 1465 |
except Exception as ex: |
1455 | 1466 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
1456 | 1467 |
|
DTI_PID/DTI_PID/OPCRelationDialog.py | ||
---|---|---|
120 | 120 |
|
121 | 121 |
def on_target_item_double_clicked(self, item): |
122 | 122 |
""" assign target opc with double clicked item """ |
123 |
current = self.tableWidgetSource.currentItem() |
|
123 |
current = self.ui.tableWidgetSource.currentItem()
|
|
124 | 124 |
if current: |
125 |
self.tableWidgetSource.item(current.row(), 3).setText(self.tableWidgetTarget.item(item.row(), 0).text())
|
|
126 |
self.tableWidgetSource.item(current.row(), 4).setText(self.tableWidgetTarget.item(item.row(), 1).text())
|
|
127 |
self.tableWidgetSource.item(current.row(), 5).setText(self.tableWidgetTarget.item(item.row(), 2).text())
|
|
125 |
self.ui.tableWidgetSource.item(current.row(), 3).setText(self.ui.tableWidgetTarget.item(item.row(), 0).text())
|
|
126 |
self.ui.tableWidgetSource.item(current.row(), 4).setText(self.ui.tableWidgetTarget.item(item.row(), 1).text())
|
|
127 |
self.ui.tableWidgetSource.item(current.row(), 5).setText(self.ui.tableWidgetTarget.item(item.row(), 2).text())
|
|
128 | 128 |
|
129 | 129 |
def eventFilter(self, source, event): |
130 | 130 |
""" display mouse position of graphics view """ |
DTI_PID/DTI_PID/Scripts/MSSQL/ID2.sql | ||
---|---|---|
3461 | 3461 |
Rotation REAL, |
3462 | 3462 |
Area TEXT, |
3463 | 3463 |
Value TEXT, |
3464 |
Owner TEXT,
|
|
3464 |
Owner VARCHAR (37),
|
|
3465 | 3465 |
[From] [varchar](37) NULL, |
3466 | 3466 |
[To] [varchar](37) NULL, |
3467 | 3467 |
Connected TEXT, |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
1414 | 1414 |
(tokens[0], float(tokens[1]), float(tokens[2]), tokens[3])) |
1415 | 1415 |
baseSymbol = node.find('PARENT').text if dbUidNode is None else dbData.baseSymbol |
1416 | 1416 |
childSymbolNode = node.find('CHILD') |
1417 |
childSymbol = '' |
|
1418 |
if childSymbolNode is not None: |
|
1419 |
childSymbol = childSymbolNode.text |
|
1417 |
childSymbol = childSymbolNode.text if (dbUidNode is None and childSymbolNode is not None) else dbData.additionalSymbol if dbUidNode is not None else '' |
|
1420 | 1418 |
|
1421 | 1419 |
ownerNode = node.find('OWNER') |
1422 | 1420 |
owner = ownerNode.text if ownerNode is not None and ownerNode.text != 'None' else None |
... | ... | |
1433 | 1431 |
item = SymbolSvgItem.createItem(_type, svgFilePath, uid, owner=owner, flip=flipLabel) |
1434 | 1432 |
item.setVisible(False) |
1435 | 1433 |
|
1436 |
# if additional symbol was changed, change symbol info |
|
1437 |
symbolInfo = None |
|
1438 |
if dbUid is None: |
|
1439 |
symbolInfo = appDocData.getSymbolByQuery('name', name) |
|
1440 |
else: |
|
1441 |
symbolInfo = appDocData.getSymbolByQuery('UID', dbUid) |
|
1442 |
if symbolInfo: |
|
1443 |
childSymbol = symbolInfo.additionalSymbol |
|
1444 |
|
|
1445 | 1434 |
if item.buildItem(name, _type, angle, pt, size, origin, connPts, baseSymbol, childSymbol, hasInstrumentLabel, dbUid=dbUid): |
1446 | 1435 |
pass |
1447 | 1436 |
else: |
DTI_PID/DTI_PID/SymbolEditorDialog.py | ||
---|---|---|
483 | 483 |
''' |
484 | 484 |
def accept(self): |
485 | 485 |
isValid, exceptionMsg = self.isValidSymbolInfo() |
486 |
appDocData = AppDocData.instance() |
|
486 | 487 |
if isValid: |
487 | 488 |
if self.selectedSymbol is None: |
488 |
isSuccess, fileType, fileName, imagePath = AppDocData.instance().insertSymbol(self.makeSymbolData(self.ui.imageView.image().width(), self.ui.imageView.image().height()))
|
|
489 |
isSuccess, fileType, fileName, imagePath = appDocData.insertSymbol(self.makeSymbolData(self.ui.imageView.image().width(), self.ui.imageView.image().height()))
|
|
489 | 490 |
else: |
490 |
isSuccess, fileType, fileName, imagePath = AppDocData.instance().updateSymbol(self.makeSymbolData(self.ui.imageView.image().width(), self.ui.imageView.image().height()))
|
|
491 |
isSuccess, fileType, fileName, imagePath = appDocData.updateSymbol(self.makeSymbolData(self.ui.imageView.image().width(), self.ui.imageView.image().height()))
|
|
491 | 492 |
|
492 | 493 |
if isSuccess: |
493 | 494 |
try: |
내보내기 Unified diff