selected increments by simulation time
This commit is contained in:
parent
86fb0a7942
commit
980c02b0c3
|
@ -86,6 +86,26 @@ class DADF5():
|
|||
self.visible[what] = list(existing.difference_update(valid))
|
||||
|
||||
|
||||
def __time_to_inc(self,start,end):
|
||||
selected = []
|
||||
for i,time in enumerate(self.times):
|
||||
if start <= time < end:
|
||||
selected.append(self.increments[i])
|
||||
return selected
|
||||
|
||||
|
||||
def set_by_time(self,start,end):
|
||||
self.__manage_visible(self.__time_to_inc(start,end),'increments','set')
|
||||
|
||||
|
||||
def add_by_time(self,start,end):
|
||||
self.__manage_visible(self.__time_to_inc(start,end),'increments','add')
|
||||
|
||||
|
||||
def del_by_time(self,start,end):
|
||||
self.__manage_visible(self.__time_to_inc(start,end),'increments','del')
|
||||
|
||||
|
||||
def iter_visible(self,what):
|
||||
"""Iterates over visible items by setting each one visible."""
|
||||
datasets = self.visible[what]
|
||||
|
|
Loading…
Reference in New Issue