moved entry class, ...
This commit is contained in:
@@ -1,10 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
@@ -1,3 +1,5 @@
|
||||
#Wed Oct 12 13:39:19 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
|
||||
@@ -35,4 +35,4 @@ do
|
||||
done
|
||||
|
||||
# Execute java
|
||||
java $VM_ARGUMENTS -Dch.psi.fda.cdump.config=$BASEDIR/../../config/cdump.properties -cp $CLASSPATH ch.psi.fda.cdump.CdumpMain $ARGUMENTS
|
||||
java $VM_ARGUMENTS -Dch.psi.fda.cdump.config.file=$BASEDIR/../../config/cdump.properties -cp $CLASSPATH ch.psi.fda.cdump.ui.CdumpMain $ARGUMENTS
|
||||
@@ -27,18 +27,33 @@ import java.util.Properties;
|
||||
|
||||
public class CdumpConfiguration {
|
||||
|
||||
public final static String CDUMP_CONFIG = "ch.psi.fda.cdump.config.file";
|
||||
|
||||
private String dataChannel;
|
||||
private int nelements = 65536;
|
||||
private String controlChannel;
|
||||
private String samplingRateChannel;
|
||||
|
||||
public CdumpConfiguration(){
|
||||
String config = System.getProperty(CDUMP_CONFIG);
|
||||
|
||||
if(config != null){
|
||||
loadFile(new File(config));
|
||||
}
|
||||
else{
|
||||
throw new RuntimeException("No configuration file specified via -D"+CDUMP_CONFIG+"=...");
|
||||
}
|
||||
}
|
||||
|
||||
public void loadFile(File file) {
|
||||
Properties properties = new Properties();
|
||||
try {
|
||||
properties.load(new FileReader(file));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Cannot read file "+file, e);
|
||||
|
||||
if(file!=null){
|
||||
try {
|
||||
properties.load(new FileReader(file));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Cannot read file "+file, e);
|
||||
}
|
||||
}
|
||||
|
||||
dataChannel = properties.getProperty(CdumpConfiguration.class.getPackage().getName()+".dataChannel", "");
|
||||
|
||||
+5
-23
@@ -17,7 +17,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package ch.psi.fda.cdump;
|
||||
package ch.psi.fda.cdump.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.Executors;
|
||||
@@ -25,19 +25,18 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.google.common.eventbus.AsyncEventBus;
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
|
||||
import ch.psi.fda.messages.DataMessage;
|
||||
import ch.psi.fda.cdump.Cdump;
|
||||
import ch.psi.fda.cdump.CdumpConfiguration;
|
||||
import ch.psi.fda.serializer.SerializerTXT;
|
||||
import ch.psi.jcae.ChannelService;
|
||||
import ch.psi.jcae.impl.DefaultChannelService;
|
||||
import sun.misc.Signal;
|
||||
import sun.misc.SignalHandler;
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public class CdumpMain {
|
||||
|
||||
public final static String CDUMP_CONFIG = "ch.psi.fda.cdump.config";
|
||||
|
||||
public static void main(String[] args){
|
||||
|
||||
final ChannelService cservice = new DefaultChannelService();
|
||||
@@ -57,35 +56,18 @@ public class CdumpMain {
|
||||
|
||||
// Calculate data file location/name
|
||||
String fname = args[1];
|
||||
CdumpConfiguration cc = new CdumpConfiguration();
|
||||
|
||||
String config = System.getProperty(CDUMP_CONFIG);
|
||||
|
||||
if(config != null){
|
||||
cc.loadFile(new File(config));
|
||||
}
|
||||
else{
|
||||
throw new RuntimeException("No configuration file specified via -D"+CDUMP_CONFIG+"=...");
|
||||
}
|
||||
|
||||
File f = new File(fname);
|
||||
f.getParentFile().mkdirs(); // Create data base directory
|
||||
|
||||
|
||||
// Create execution service
|
||||
EventBus eventbus = new AsyncEventBus(Executors.newSingleThreadExecutor());
|
||||
final Cdump service = new Cdump(cservice, eventbus, cc);
|
||||
final Cdump service = new Cdump(cservice, eventbus, new CdumpConfiguration());
|
||||
|
||||
SerializerTXT serializer = new SerializerTXT(f);
|
||||
serializer.setShowDimensionHeader(false);
|
||||
|
||||
eventbus.register(serializer);
|
||||
eventbus.register(new Object(){
|
||||
@Subscribe
|
||||
public void test(DataMessage m){
|
||||
System.out.println(m);
|
||||
}
|
||||
});
|
||||
|
||||
// Stop/abort handling of acquisition
|
||||
Signal.handle(new Signal("INT"), new SignalHandler() {
|
||||
@@ -40,7 +40,6 @@ public class CdumpListenerTest {
|
||||
CdumpListener l = new CdumpListener(bus, 4);
|
||||
l.transform(new int[] {1,2,3,4,11,12,13,14});
|
||||
l.transform(new int[] {5,6,7,8,15,16,17,18});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user