Fix in readout logic
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>ch.psi</groupId>
|
||||
<artifactId>ch.psi.fda.fdaq</artifactId>
|
||||
<version>1.0.9</version>
|
||||
<version>1.0.13</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -20,6 +20,7 @@ package ch.psi.fda.fdaq;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -109,11 +110,13 @@ public class Fdaq {
|
||||
for (int t = 0; t < numberOfElements; t++) {
|
||||
// struct fdaqbloc_out {int trigindex;int adc1reg;int
|
||||
// adc2reg;int encoder;};
|
||||
ByteBuffer buffer = ByteBuffer.allocate(4 * 4); // 4 times
|
||||
// Integers
|
||||
buffer.order(ByteOrder.LITTLE_ENDIAN);
|
||||
int r = in.read(buffer.array());
|
||||
if (r == -1) {
|
||||
|
||||
byte[] cbuffer = new byte[4*4]; // 4 times Integers a 4 bytes
|
||||
|
||||
try{
|
||||
in.readFully(cbuffer);
|
||||
}
|
||||
catch(EOFException e){
|
||||
logger.info("End of Stream");
|
||||
break;
|
||||
}
|
||||
@@ -125,6 +128,8 @@ public class Fdaq {
|
||||
continue;
|
||||
}
|
||||
|
||||
ByteBuffer buffer = ByteBuffer.wrap(cbuffer);
|
||||
buffer.order(ByteOrder.LITTLE_ENDIAN);
|
||||
int a = buffer.getInt();
|
||||
int b = buffer.getInt();
|
||||
int b1 = b & 0xffff;
|
||||
|
||||
Reference in New Issue
Block a user