1
2 """Line analyzer with output and the capability to store lines"""
3
4 from LogLineAnalyzer import LogLineAnalyzer
5 from PyFoam.Basics.OutFileCollection import OutFileCollection
6 from PyFoam.Basics.TimeLineCollection import TimeLineCollection
7
9 """Base class for analyzers that write data to files and store time-lines
10
11 Combines the capabilities of TimeLineLineAnalyzer and FileLineAnalyzer"""
12
13 - def __init__(self,doTimelines=False,doFiles=False,titles=[]):
14 """
15 @param titles: The titles of the data elements
16 """
17 LogLineAnalyzer.__init__(self)
18
19 self.doTimelines=doTimelines
20 self.doFiles=doFiles
21
22 self.files=None
23 self.titles=titles
24
25 self.setTitles(titles)
26 if self.doTimelines:
27 self.lines=TimeLineCollection()
28 else:
29 self.lines=None
30
32 """
33 Sets the titles anew
34 @param titles: the new titles
35 """
36 if self.doFiles:
37 self.titles=titles
38 if self.files!=None:
39 self.files.setTitles(titles)
40
42 """Creates the OutFileCollection-object"""
43 if self.doFiles:
44 self.files=OutFileCollection(oDir,titles=self.titles)
45 else:
46 self.files=None
47
49 """Sets the current time in the timelines"""
50 if self.doTimelines:
51 self.lines.setTime(self.getTime())
52
54 """@param name: Name of the timeline to return
55 @return: the timeline as two list: the times and the values"""
56 if self.doTimelines:
57 return self.lines.getTimes(),self.lines.getValues(name)
58 else:
59 return [],[]
60
74
76 """Method at the start of a successfull match"""
77 pass
78
80 """Method at the end of a successfull match"""
81 pass
82
84 """Method that adds matched data to timelines
85
86 @param match: data matched by a regular expression"""
87
88 pass
89
91 """Method that adds matched data to files
92
93 @param match: data matched by a regular expression"""
94
95 pass
96
103