diff --git a/system/project.py b/system/project.py index f83c093..1b879d0 100644 --- a/system/project.py +++ b/system/project.py @@ -21,6 +21,7 @@ class Project: self.datasets = [] self.sel_obj = dataset.Selection('Current Selection') self.selections = [] + self._last_selection = None def add_selection_observer(self, observer): self._selection_observers.append(observer) @@ -42,8 +43,10 @@ class Project: def set_selection(self, dim_name, selection): """Sets a current selection and notify observers""" - self.sel_obj[dim_name] = set(selection) - self.notify_selection_listeners(dim_name) + if self._last_selection != selection: + self.sel_obj[dim_name] = set(selection) + self.notify_selection_listeners(dim_name) + self._last_selection = selection def get_selection(self): """Returns the current selection object"""