-
Notifications
You must be signed in to change notification settings - Fork 1
/
logviewer.data.realdash.js
51 lines (41 loc) · 1.22 KB
/
logviewer.data.realdash.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function processRealDashLog(series,data) {
var minValues={}
var maxValues={}
// var CaptureDateLine=data[1].substr(15,28)
// CaptureDateLine=CaptureDateLine.replace("BST","GMT-1");
// var startDate=new Date(CaptureDateLine)
var startDate=new Date()
var headers=data[0].split('\t')
for(var i = 0;i<headers.length;i++) {
headers[i]=headers[i].trim()
series[headers[i]]=[];
}
for (var i = 2 ; i < data.length;i++) {
var values=data[i].split('\t')
if(values.length <headers.length) {
console.log(data[i]);
continue
}
for (var j=0;j<values.length;j++) {
var seriesName=headers[j]
var dataPoint=Number(values[j]);
if(seriesName==="Time") {
var components=values[j].split('.')
//dataPoint=getDate(values[j])
dataPoint=new Date(startDate)
dataPoint.setSeconds(components[0]);
dataPoint.setMilliseconds(components[1]);
}
manageMaxMin(dataPoint,seriesName,maxValues,minValues)
series[seriesName].push(dataPoint)
}
}
series.XAxis="Time"
series.defaultSelections=["RPM","Coolant Temperature","Intake Air Temperature"]
series.headers=headers
series.maxValues=maxValues
series.minValues=minValues
series.latKey='GPS Latitude'
series.lonKey='GPS Longitude'
return series
}