Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Fixed dataset placement in navigator

This commit is contained in:
Arnar Flatberg 2006-08-27 14:12:37 +00:00
parent edd7d47cf1
commit 7eb3fa8b46
1 changed files with 7 additions and 4 deletions

View File

@ -48,22 +48,25 @@ class Project:
def get_data_iter(self, obj): def get_data_iter(self, obj):
"""Retuns an iterator to data.""" """Retuns an iterator to data."""
retval = [None] retval = [None]
if obj:
# add data below first function data input
obj=obj[0]
def is_obj(m, p, i, d): def is_obj(m, p, i, d):
if obj == m.get_value(i, 2): if obj == m.get_value(i, 2):
d.append(i) d.append(i)
return True return True
self.data_tree.foreach(is_obj, retval) self.data_tree.foreach(is_obj, retval)
return retval[-1] return retval[-1]
def add_data(self, parent, data, fun='Function'): def add_data(self, parents, data, fun='Function'):
"""Adds a set of data and plots to the navigator. """Adds a set of data and plots to the navigator.
This method is usually called after a Function in a workflow This method is usually called after a Function in a workflow
has finished and returns its output.""" has finished and returns its output."""
parent_iter = self.get_data_iter(parent) parent_iter = self.get_data_iter(parents)
it = self.data_tree_insert(parent_iter, fun, None, "grey","black") it = self.data_tree_insert(parent_iter, fun, None, "grey","black")
for d in data: for d in data: