개정판 44cca227
issue #000: fix attr
Change-Id: I675b6fe00bb568142ffa85f2cb07dc1c73d3475a
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
1953 | 1953 |
attr.AttrAt = row[4] |
1954 | 1954 |
attr.Expression = row[5] |
1955 | 1955 |
attr.Target = row[7] |
1956 |
attr.IsProp = bool(row[8])
|
|
1956 |
attr.IsProp = row[8]
|
|
1957 | 1957 |
result.append(attr) |
1958 | 1958 |
# Catch the exception |
1959 | 1959 |
except Exception as ex: |
... | ... | |
2000 | 2000 |
res.AttrAt = rows[0][3] |
2001 | 2001 |
res.Expression = rows[0][4] |
2002 | 2002 |
res.Target = rows[0][5] |
2003 |
res.IsProp = bool(row[0][6])
|
|
2003 |
res.IsProp = row[0][6]
|
|
2004 | 2004 |
# Catch the exception |
2005 | 2005 |
except Exception as ex: |
2006 | 2006 |
from App import App |
DTI_PID/DTI_PID/QtImageViewer.py | ||
---|---|---|
655 | 655 |
svg.addSvgItemToScene(self.scene) |
656 | 656 |
if len(svg.connectors) == 1: |
657 | 657 |
# single connection item assistant |
658 |
items = [item for item in self.scene.items(scenePos) if type(item) is QEngineeringConnectorItem and issubclass(type(item.parentItem()), SymbolSvgItem) and not item.connectedItem] |
|
658 |
items = [item for item in self.scene.items(scenePos) if type(item) is QEngineeringConnectorItem and item.parentItem() is not svg and issubclass(type(item.parentItem()), SymbolSvgItem) and not item.connectedItem]
|
|
659 | 659 |
if items: |
660 | 660 |
svg.connectors[0].connectedItem = items[0].parentItem() |
661 | 661 |
items[0].connectedItem = svg |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
477 | 477 |
except Exception as ex: |
478 | 478 |
from App import App |
479 | 479 |
|
480 |
print(self.uid) |
|
480 | 481 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
481 | 482 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
482 | 483 |
|
DTI_PID/DTI_PID/SymbolAttrEditorDialog.py | ||
---|---|---|
72 | 72 |
self.ui.pushButtonDelAttr.clicked.connect(self.onDelLineNoAttr) |
73 | 73 |
|
74 | 74 |
def cell_double_clicked(self, row, column): |
75 |
if self._symbolType is None or column is not 6 or self.ui.tableWidgetAttr.item(row, 1).tag.IsProp: return |
|
75 |
if self._symbolType is None or column is not 6 :return |
|
76 |
if hasattr(self.ui.tableWidgetAttr.item(row, 0), 'tag') and self.ui.tableWidgetAttr.item(row, 0).tag.IsProp == 2: return |
|
76 | 77 |
|
77 | 78 |
from SymbolAttrTargetDialog import SymbolAttrTargetDialog |
78 | 79 |
|
... | ... | |
142 | 143 |
row = 0 |
143 | 144 |
for attr in attrs: |
144 | 145 |
item = QTableWidgetItem(str(attr.UID)) # UID |
145 |
#item.tag = attr
|
|
146 |
item.tag = attr |
|
146 | 147 |
self.ui.tableWidgetAttr.setItem(row, 0, item) |
147 | 148 |
item = QTableWidgetItem(attr.Attribute) # Name |
148 |
#if attr.IsProp:
|
|
149 |
# item.setFlags(Qt.ItemIsEnabled)
|
|
150 |
# item.setBackground(Qt.lightGray)
|
|
149 |
if attr.IsProp == 2:
|
|
150 |
item.setFlags(Qt.ItemIsEnabled) |
|
151 |
item.setBackground(Qt.lightGray) |
|
151 | 152 |
self.ui.tableWidgetAttr.setItem(row, 1, item) |
152 | 153 |
item = QTableWidgetItem(attr.DisplayAttribute) # Display Name |
153 | 154 |
self.ui.tableWidgetAttr.setItem(row, 2, item) |
... | ... | |
163 | 164 |
attrTypeComboBox.setCurrentIndex(result) |
164 | 165 |
|
165 | 166 |
item = QTableWidgetItem(str(attr.AttrAt)) # Attribute At |
166 |
#if attr.IsProp:
|
|
167 |
# item.setFlags(Qt.ItemIsEnabled)
|
|
167 |
if attr.IsProp == 2:
|
|
168 |
item.setFlags(Qt.ItemIsEnabled) |
|
168 | 169 |
self.ui.tableWidgetAttr.setItem(row, 4, item) |
169 | 170 |
|
170 | 171 |
item = QTableWidgetItem(attr.Expression) # Expression |
171 |
#if attr.IsProp:
|
|
172 |
# item.setFlags(Qt.ItemIsEnabled)
|
|
172 |
if attr.IsProp == 2:
|
|
173 |
item.setFlags(Qt.ItemIsEnabled) |
|
173 | 174 |
self.ui.tableWidgetAttr.setItem(row, 5, item) |
174 | 175 |
|
175 | 176 |
item = QTableWidgetItem('ALL') if attr.Target == 'ALL' or attr.Target is None else QTableWidgetItem('...') |
176 | 177 |
item.tag = attr.Target |
177 | 178 |
item.setTextAlignment(Qt.AlignHCenter) |
178 |
#item.setFlags(Qt.ItemIsEnabled)
|
|
179 |
item.setFlags(Qt.ItemIsEnabled) |
|
179 | 180 |
self.ui.tableWidgetAttr.setItem(row, 6, item) |
180 | 181 |
|
181 | 182 |
row = row + 1 |
... | ... | |
240 | 241 |
model = self.ui.tableWidgetAttr.model() |
241 | 242 |
row = self.ui.tableWidgetAttr.currentRow() |
242 | 243 |
|
243 |
#if row != -1 and not self.ui.tableWidgetAttr.item(row, 1).tag.IsProp:
|
|
244 |
model.removeRow(row) |
|
244 |
if row != -1 and not (hasattr(self.ui.tableWidgetAttr.item(row, 0), 'tag') and self.ui.tableWidgetAttr.item(row, 0).tag.IsProp == 2):
|
|
245 |
model.removeRow(row)
|
|
245 | 246 |
|
246 | 247 |
''' |
247 | 248 |
@brief save attributes |
내보내기 Unified diff