-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* (C) 2011, Andy Georges | ||
* | ||
* Dit programma zal de data die uit de StepCounter wordt | ||
* gehaald (/sdcard/accelDataLog) inlezen en verwerken. | ||
* | ||
*/ | ||
|
||
|
||
import java.io.BufferedReader; | ||
import java.io.FileNotFoundException; | ||
import java.io.FileReader; | ||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
|
||
|
||
class OfflineAnalysis { | ||
|
||
private static double [][] samples = null; | ||
|
||
/* print out the first three lines and the last line of | ||
* the datafile for checking purposes | ||
*/ | ||
public static void checkData() { | ||
|
||
|
||
} | ||
|
||
|
||
|
||
|
||
public static void main(String [] args) { | ||
|
||
if(args.length != 1) { | ||
System.err.println("You must provide a file with the relevant data!"); | ||
System.err.println("Usage: OfflineAnalysis" + " <file>"); | ||
System.exit(-1); | ||
} | ||
|
||
BufferedReader r = null; | ||
try { | ||
r = new BufferedReader(new FileReader(args[0])); | ||
} | ||
catch(FileNotFoundException e) { | ||
System.err.println("Oops!"); | ||
System.err.println(e); | ||
System.exit(-1); | ||
} | ||
ArrayList<double[]> samplesA = new ArrayList(); | ||
|
||
try { | ||
for(String l = r.readLine(); l != null; l = r.readLine()) { | ||
String [] fields = l.split(":"); | ||
double [] s = { Double.parseDouble(fields[0]), Double.parseDouble(fields[2]), Double.parseDouble(fields[3]), Double.parseDouble(fields[4]) }; | ||
samplesA.add(s); | ||
} | ||
r.close(); | ||
} | ||
catch(IOException e) { | ||
System.err.println("Oops"); | ||
System.err.println(e); | ||
System.exit(-1); | ||
|
||
} | ||
samples = samplesA.toArray(new double [samplesA.size()][]); | ||
} | ||
|
||
} |