1
2 """Do analysis for a line with values"""
3
4 from FileLineAnalyzer import FileLineAnalyzer
5 from NameFinderLineAnalyzer import NameFinderLineAnalyzer
6
8 """Parses lines for numeric values
9
10 The line starts with a predefined string"""
11
13 """
14 @param name: name of the expression (needed for output)
15 @param pre: the string that starts the line
16 """
17 FileLineAnalyzer.__init__(self,titles)
18
19 self.name=name
20 self.pre=pre
21
23 """Analyzes line and writes the data"""
24 tm=self.parent.getTime()
25 if tm=="":
26 return
27
28 m=line.find(self.pre)
29 if m>=0:
30 rest=line[m+len(self.pre):]
31 fdata=()
32 for teil in rest.split():
33 try:
34 val=float(teil)
35 fdata+=(val,)
36 except ValueError:
37 pass
38
39 self.files.write(self.name,tm,fdata)
40
42 """Finds the names and notifies it's ValueLineAnalyzer"""
43
44 - def __init__(self,trigger,analyze,val,idNr=1,nr=1):
45 """
46 @param trigger: The regular expression that has to match before data is collected
47 @param nr: The number of lines after the match that data is collected
48 @param analyze: The regular expression that is used for analysis
49 @param idNr: The id of the group that is used for analysis
50 @param val: The ValueLineAnalyzer that needs the names
51 """
52
53 NameFinderLineAnalyzer.__init__(self,trigger,analyze,idNr=idNr,nr=nr)
54
55 self.val=val
56
59