add flag for partial fits; closes #83
This commit is contained in:
@@ -4,6 +4,7 @@ import copy
|
||||
|
||||
from numpy import argsort
|
||||
|
||||
from . import Relations
|
||||
from ..Qt import QtWidgets, QtCore
|
||||
from ..data.container import FitContainer
|
||||
from ..graphs.graphwindow import QGraphWindow
|
||||
@@ -242,10 +243,17 @@ class DeleteCommand(QtWidgets.QUndoCommand):
|
||||
|
||||
if isinstance(val, FitContainer):
|
||||
try:
|
||||
self.__container[sid].fitted_key._fits.remove(sid)
|
||||
self.__container[val.fitted_key]._fits.remove(sid)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
for (flag1, flag2) in ((Relations.isFitPartOf, Relations.hasFitPart), (Relations.hasFitPart, Relations.isFitPartOf)):
|
||||
for related_item in val.get_relation(flag1):
|
||||
try:
|
||||
self.__container[related_item].remove_relation(flag2, sid)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
del self.__container[sid]
|
||||
|
||||
self.__graph_container[self.__graph_key].block(False)
|
||||
@@ -264,6 +272,13 @@ class DeleteCommand(QtWidgets.QUndoCommand):
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
for (flag1, flag2) in (('isFitPartOf', 'hasFitPartOf'), ('hasFitPartOf', 'isFitPartOf')):
|
||||
for related_item in val.get_relation(flag1):
|
||||
try:
|
||||
self.__container[related_item].add_relation(flag2, sid)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
self.__signal_add.emit(list(self.__keys), self.__graph_key)
|
||||
|
||||
self.__graph_container[self.__graph_key].block(False)
|
||||
|
||||
Reference in New Issue
Block a user