refactoring
This commit is contained in:
parent
2fd1a1d0f6
commit
ed91493c72
Binary file not shown.
|
@ -25,7 +25,7 @@ public class TriggerSignalReader {
|
||||||
int signalIndex = Integer.parseInt(tokens[2]);
|
int signalIndex = Integer.parseInt(tokens[2]);
|
||||||
int signalState = Integer.parseInt(tokens[3]);
|
int signalState = Integer.parseInt(tokens[3]);
|
||||||
double angle = Double.parseDouble(tokens[4]);
|
double angle = Double.parseDouble(tokens[4]);
|
||||||
double gap = Double.parseDouble(tokens[5]);
|
double gap = parseDoubleMaybeNaN(tokens[5]);
|
||||||
|
|
||||||
TriggerSignal s = new TriggerSignal(signalIndex, signalState, angle, gap);
|
TriggerSignal s = new TriggerSignal(signalIndex, signalState, angle, gap);
|
||||||
// System.out.println(s);
|
// System.out.println(s);
|
||||||
|
@ -34,4 +34,10 @@ public class TriggerSignalReader {
|
||||||
}
|
}
|
||||||
return signals;
|
return signals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static double parseDoubleMaybeNaN(String doubleString) {
|
||||||
|
if ("nan".equalsIgnoreCase(doubleString))
|
||||||
|
return Double.NaN;
|
||||||
|
return Double.parseDouble(doubleString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue