|
|
|
|
@ -198,7 +198,7 @@ func (dc *DerbyClock) readLoop() {
|
|
|
|
|
|
|
|
|
|
// Check for lane result pattern (n=t.ttttc)
|
|
|
|
|
// We need to look for an equals sign followed by digits, a period, more digits, and a finish character
|
|
|
|
|
if b[0] == ' ' || b[0] == '\n' {
|
|
|
|
|
if b[0] == ' ' || b[0] == '\r' {
|
|
|
|
|
// These characters could indicate a complete result or a separator
|
|
|
|
|
// Try to extract a result from the buffer
|
|
|
|
|
result := dc.tryExtractResult(buffer)
|
|
|
|
|
@ -208,6 +208,10 @@ func (dc *DerbyClock) readLoop() {
|
|
|
|
|
Type: EventLaneFinish,
|
|
|
|
|
Result: result,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Clear the buffer after a result is extracted
|
|
|
|
|
buffer = buffer[:0]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If we hit a newline, this might be the end of all results
|
|
|
|
|
if b[0] == '\n' {
|
|
|
|
|
@ -229,8 +233,6 @@ func (dc *DerbyClock) readLoop() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// tryExtractResult attempts to extract a lane result from the buffer
|
|
|
|
|
func (dc *DerbyClock) tryExtractResult(buffer []byte) *Result {
|
|
|
|
|
|