add merged set to graph of sources if source sets are in same graph (#185)
All checks were successful
Build AppImage / Explore-Gitea-Actions (push) Successful in 1m52s

close #164

Co-authored-by: Dominik Demuth <dominik.demuth@physik.tu-darmstadt.de>
Reviewed-on: #185
This commit is contained in:
Dominik Demuth 2023-12-17 16:05:39 +00:00
parent 5b74ee1f29
commit ce9bd5d2fd

View File

@ -347,6 +347,7 @@ class UpperManagement(QtCore.QObject):
group_set = set() group_set = set()
name_set = set() name_set = set()
value_set = set() value_set = set()
graph_set = set()
if src_sets is None: if src_sets is None:
if self.current_graph: if self.current_graph:
@ -364,6 +365,7 @@ class UpperManagement(QtCore.QObject):
name_set.add(data_i.name) name_set.add(data_i.name)
group_set.add(data_i.group) group_set.add(data_i.group)
value_set.add(data_i.value) value_set.add(data_i.value)
graph_set.add(data_i.graph)
if joined is not None: if joined is not None:
joined.group = '+'.join(group_set) joined.group = '+'.join(group_set)
@ -374,7 +376,9 @@ class UpperManagement(QtCore.QObject):
else: else:
joined.value = 0.0 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): def get_data(self, sid: str, xy_only: bool = False):
""" """