개정판 514aa518
issue #000: fix auto freeze
Change-Id: I5445961ecad12a18326ec60060e9fd5b0e33124d
DTI_PID/DTI_PID/Commands/SelectAttributeCommand.py | ||
---|---|---|
102 | 102 |
|
103 | 103 |
while len(self._item._associations[self._attr.AttributeType]) <= self._attr.AttrAt: |
104 | 104 |
self._item._associations[self._attr.AttributeType].append(None) |
105 |
self._item.add_assoc_item(item, self._attr.AttrAt) |
|
105 |
self._item.add_assoc_item(item, self._attr.AttrAt, force=True)
|
|
106 | 106 |
for key in self._item.attrs.keys(): |
107 | 107 |
if key.Attribute == self._attr.Attribute: |
108 | 108 |
key.AssocItem = item |
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
229 | 229 |
items = _texts |
230 | 230 |
else: |
231 | 231 |
items = [text for text in _texts if QEngineeringAbstractItem.assoc_type(text) == attr.AttributeType] |
232 |
|
|
232 |
|
|
233 | 233 |
if not attr.AssocItem and len(items) > at: |
234 | 234 |
attr.AssocItem = items[at] |
235 | 235 |
item = attr.AssocItem |
... | ... | |
335 | 335 |
self.attrs.clear() |
336 | 336 |
self._associations.clear() |
337 | 337 |
|
338 |
def add_assoc_item(self, item, at=None): |
|
338 |
def add_assoc_item(self, item, at=None, force=False):
|
|
339 | 339 |
""" add given item to association """ |
340 | 340 |
|
341 | 341 |
from EngineeringTextItem import QEngineeringTextItem |
... | ... | |
343 | 343 |
from EngineeringValveOperCodeTextItem import QEngineeringValveOperCodeTextItem |
344 | 344 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
345 | 345 |
|
346 |
for key in self.attrs.keys(): |
|
347 |
if key.Freeze: |
|
348 |
return False |
|
346 |
if not force: |
|
347 |
for key in self.attrs.keys(): |
|
348 |
if key.Freeze: |
|
349 |
return False |
|
349 | 350 |
|
350 | 351 |
_type = QEngineeringAbstractItem.assoc_type(item) |
351 | 352 |
if _type is not None: |
내보내기 Unified diff