.logicdata files are a bit broken #1482
This commit is contained in:
parent
d89f9b5165
commit
9fb76630c4
|
@ -81,7 +81,7 @@ public class LogicdataStreamFile extends StreamFile {
|
|||
|
||||
// we need to split the combined events into separate channels
|
||||
for (int ch = 0; ch < numChannels; ch++) {
|
||||
List<Integer> chDeltas = new ArrayList<Integer>();
|
||||
List<Integer> chDeltas = new ArrayList<>();
|
||||
int chPrevState = -1;
|
||||
int prevTs = 0;
|
||||
for (CompositeEvent event : events) {
|
||||
|
@ -342,6 +342,7 @@ public class LogicdataStreamFile extends StreamFile {
|
|||
write(numChannels);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeFooter() throws IOException {
|
||||
write(BLOCK);
|
||||
for (int i = 0; i < numChannels; i++) {
|
||||
|
@ -386,6 +387,7 @@ public class LogicdataStreamFile extends StreamFile {
|
|||
writeTimingMarker();
|
||||
|
||||
stream.flush();
|
||||
System.out.println("writeFooter " + fileName);
|
||||
}
|
||||
|
||||
private void writeTimingMarker() throws IOException {
|
||||
|
@ -414,8 +416,8 @@ public class LogicdataStreamFile extends StreamFile {
|
|||
}
|
||||
|
||||
private void write(int[] values) throws IOException {
|
||||
for (int i = 0; i < values.length; i++)
|
||||
write(values[i]);
|
||||
for (int value : values)
|
||||
write(value);
|
||||
}
|
||||
|
||||
private void writeAs(long value, int numBytes) throws IOException {
|
||||
|
|
|
@ -21,9 +21,13 @@ public abstract class StreamFile {
|
|||
public abstract void append(List<CompositeEvent> events);
|
||||
|
||||
public synchronized void close() {
|
||||
try {
|
||||
writeFooter();
|
||||
} catch (IOException e) {
|
||||
return;
|
||||
}
|
||||
if (writer != null) {
|
||||
try {
|
||||
writeFooter(writer);
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
// ignoring this one
|
||||
|
@ -44,6 +48,6 @@ public abstract class StreamFile {
|
|||
writer = new OutputStreamWriter(stream);
|
||||
}
|
||||
|
||||
protected void writeFooter(Writer writer) throws IOException {
|
||||
protected void writeFooter() throws IOException {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class TSHighSpeedLog extends StreamFile {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void writeFooter(Writer writer) throws IOException {
|
||||
protected void writeFooter() throws IOException {
|
||||
writer.write("MARK 028\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue