1
2 """Common stuff for classes that do something at every timestep"""
3
4 from AnalyzedCommon import AnalyzedCommon
5 from time import time
6
8 """Stuff is performed forevery timestep in the file"""
9
10 - def __init__(self,filename,analyzer,smallestFreq=0):
11 """@param smallestFreq: the smallest intervall of real time (in seconds) that the time change is honored"""
12 AnalyzedCommon.__init__(self,filename,analyzer)
13
14 analyzer.addTimeListener(self)
15 self.freq=smallestFreq
16 self.oldtime=0.
17
19 """React to a change of the simulation time in the log"""
20 now=time()
21 if self.freq>0 and (now-self.oldtime)>self.freq:
22 self.oldtime=now
23 self.timeHandle()
24 if self.doPickling:
25 self.picklePlots()
26
28 """Handler that reacts to the change of time. To be overridden be sub-classes"""
29 pass
30
34