|
|
|
@ -55,9 +55,10 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg
|
|
|
|
|
//TODO: input null protection?
|
|
|
|
|
|
|
|
|
|
//Flag telling that we are processing data to the right of the callsign
|
|
|
|
|
//isRightOfCall := false
|
|
|
|
|
isRightOfCall := false
|
|
|
|
|
|
|
|
|
|
//TODO: Make something more intelligent
|
|
|
|
|
//TODO: What happens if we have partial lines
|
|
|
|
|
previousLine.Call = ""
|
|
|
|
|
previousLine.RSTsent = ""
|
|
|
|
|
previousLine.RSTrcvd = ""
|
|
|
|
@ -116,11 +117,12 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg
|
|
|
|
|
callErrorMsg := ""
|
|
|
|
|
logLine.Call, callErrorMsg = ValidateCall(element)
|
|
|
|
|
errorMsg = errorMsg + callErrorMsg
|
|
|
|
|
//isRightOfCall = true
|
|
|
|
|
isRightOfCall = true
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Is it a "full" time ?
|
|
|
|
|
if isRightOfCall == false {
|
|
|
|
|
if regexpIsFullTime.MatchString(element) {
|
|
|
|
|
logLine.Time = element
|
|
|
|
|
continue
|
|
|
|
@ -136,6 +138,8 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg
|
|
|
|
|
}
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Is it the OM's name (starting with "@")
|
|
|
|
|
if regexpIsOMname.MatchString(element) {
|
|
|
|
@ -150,6 +154,12 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if isRightOfCall {
|
|
|
|
|
//This is probably a RST
|
|
|
|
|
//TODO: is it a number (or a data report)
|
|
|
|
|
//TODO: it is sent or rcvd
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//If we come here, we could not make sense of what we found
|
|
|
|
|
errorMsg = errorMsg + "Unable to parse " + element + " "
|
|
|
|
|
|
|
|
|
|