-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathECGFileTest.java
28 lines (26 loc) · 1.24 KB
/
ECGFileTest.java
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
import java.util.AbstractMap;
import java.util.ArrayList;
import java.io.IOException;
public class ECGFileTest {
public static void main(String args[]) throws IOException {
ECGFileManager e = new ECGFileManager();
e.load();
System.out.println(e.getClassNames());
ArrayList<AbstractMap.SimpleEntry<Double, ArrayList<Double>>> points
= new ArrayList<AbstractMap.SimpleEntry<Double, ArrayList<Double>>>();
String filename = "data/CF091714/4917c43b.dat";
ECGFile file = e.getECGFile(filename);
file.read(filename, 0, Double.POSITIVE_INFINITY, points);
int lead = 64;
int leads[][] = file.getLayout();
System.out.println("Lead: " + lead + " (" + leads[lead+1][0] + "," + leads[lead+1][1] + ")");
int north = file.getNorth(lead+1);
int south = file.getSouth(lead+1);
int east = file.getEast(lead+1);
int west = file.getWest(lead+1);
System.out.println("North: "+(north-1)+(north==-1?"":" ("+leads[north][0]+","+leads[north][1]+")"));
System.out.println("South: "+(south-1)+(south==-1?"":" ("+leads[south][0]+","+leads[south][1]+")"));
System.out.println("East: "+(east-1)+(east==-1?"":" ("+leads[east][0]+","+leads[east][1]+")"));
System.out.println("West: "+(west-1)+(west==-1?"":" ("+leads[west][0]+","+leads[west][1]+")"));
}
}