From ce9bd5d2fd8e89a8ca39d6b44b3f27a2af7932e2 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Sun, 17 Dec 2023 16:05:39 +0000 Subject: [PATCH] add merged set to graph of sources if source sets are in same graph (#185) close #164 Co-authored-by: Dominik Demuth Reviewed-on: https://gitea.pkm.physik.tu-darmstadt.de/IPKM/nmreval/pulls/185 --- src/gui_qt/main/management.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui_qt/main/management.py b/src/gui_qt/main/management.py index 5e73427..69cb626 100644 --- a/src/gui_qt/main/management.py +++ b/src/gui_qt/main/management.py @@ -347,6 +347,7 @@ class UpperManagement(QtCore.QObject): group_set = set() name_set = set() value_set = set() + graph_set = set() if src_sets is None: if self.current_graph: @@ -364,6 +365,7 @@ class UpperManagement(QtCore.QObject): name_set.add(data_i.name) group_set.add(data_i.group) value_set.add(data_i.value) + graph_set.add(data_i.graph) if joined is not None: joined.group = '+'.join(group_set) @@ -374,7 +376,9 @@ class UpperManagement(QtCore.QObject): else: joined.value = 0.0 - self.newData.emit([self.add(joined)], self.current_graph) + dest_graph = graph_set.pop() if len(graph_set) == 1 else self.current_graph + + self.newData.emit([self.add(joined)], dest_graph) def get_data(self, sid: str, xy_only: bool = False): """