Discard first 1028 values

Added file exist check
Configured serializer to not append _0000 to the file name
This commit is contained in:
2014-02-14 13:05:16 +01:00
parent e1fe52473d
commit 32406110b3
2 changed files with 14 additions and 2 deletions
@@ -42,6 +42,11 @@ public class FdaqMain {
File file = new File(args[0]);
if(file.exists()){
System.err.println("File "+file.getName()+ " already exists.");
System.exit(-1);
}
FdaqConfiguration configuration = new FdaqConfiguration();
String config = System.getProperty(FDAQ_CONFIG);
@@ -65,7 +70,7 @@ public class FdaqMain {
}
});
SerializerTXT serializer = new SerializerTXT(file);
SerializerTXT serializer = new SerializerTXT(file, false);
serializer.setShowDimensionHeader(false);
bus.register(serializer);
@@ -84,7 +84,7 @@ public class FdaqService {
bytebuffer.order(ByteOrder.LITTLE_ENDIAN);
bytebuffer.putInt(26); // Function number (index of pointer to function)
bytebuffer.putInt(numberOfElements);
// TODO
if(first){
bytebuffer.putInt(1); // Reset FIFO flag - The first time there need to be a 1 in int to reset the fifo buffer on the box
first=false;
@@ -117,6 +117,13 @@ public class FdaqService {
logger.info("End of Stream");
break;
}
if(t<1028){
// The first 1028 are wrong (not really wrong but there are repeated values/holes)
// It has to do with the fact that we asynchronously reset the FIFO.
// This is independent of the frequency
continue;
}
int a = buffer.getInt();
int b = buffer.getInt();