|
|
@ -75,6 +75,7 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
headerMyGrid := ""
|
|
|
|
headerMyGrid := ""
|
|
|
|
headerQslMsg := ""
|
|
|
|
headerQslMsg := ""
|
|
|
|
headerNickname := ""
|
|
|
|
headerNickname := ""
|
|
|
|
|
|
|
|
headerIsFirstLine := true
|
|
|
|
//headerDate := ""
|
|
|
|
//headerDate := ""
|
|
|
|
lineCount := 0
|
|
|
|
lineCount := 0
|
|
|
|
|
|
|
|
|
|
|
@ -207,11 +208,12 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
|
|
|
|
|
|
|
|
//My Sota
|
|
|
|
//My Sota
|
|
|
|
if regexpHeaderMySota.MatchString(eachline) {
|
|
|
|
if regexpHeaderMySota.MatchString(eachline) {
|
|
|
|
//Attempt to redefine value
|
|
|
|
oldHeaderMySOTA := headerMySOTA
|
|
|
|
if headerMySOTA != "" {
|
|
|
|
// //FIXME: enhancement for issue #101
|
|
|
|
errorLog = append(errorLog, fmt.Sprintf("Attempt to redefine MySOTA at line %d", lineCount))
|
|
|
|
// if headerMySOTA != "" {
|
|
|
|
continue
|
|
|
|
// errorLog = append(errorLog, fmt.Sprintf("Warning: redefining MySOTA at line %d", lineCount))
|
|
|
|
}
|
|
|
|
// continue
|
|
|
|
|
|
|
|
// }
|
|
|
|
errorMsg := ""
|
|
|
|
errorMsg := ""
|
|
|
|
mySotaList := regexpHeaderMySota.Split(eachline, -1)
|
|
|
|
mySotaList := regexpHeaderMySota.Split(eachline, -1)
|
|
|
|
if len(strings.TrimSpace(mySotaList[1])) > 0 {
|
|
|
|
if len(strings.TrimSpace(mySotaList[1])) > 0 {
|
|
|
@ -221,6 +223,10 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
errorLog = append(errorLog, fmt.Sprintf("Invalid \"My SOTA\" at line %d: %s (%s)", lineCount, mySotaList[1], errorMsg))
|
|
|
|
errorLog = append(errorLog, fmt.Sprintf("Invalid \"My SOTA\" at line %d: %s (%s)", lineCount, mySotaList[1], errorMsg))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if oldHeaderMySOTA != headerMySOTA {
|
|
|
|
|
|
|
|
// New SOTA reference defined
|
|
|
|
|
|
|
|
headerIsFirstLine = true
|
|
|
|
|
|
|
|
}
|
|
|
|
//If there is no data after the marker, we just skip the data.
|
|
|
|
//If there is no data after the marker, we just skip the data.
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -279,6 +285,7 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
// Load the header values in the previousLogLine
|
|
|
|
// Load the header values in the previousLogLine
|
|
|
|
previousLogLine.MyCall = headerMyCall
|
|
|
|
previousLogLine.MyCall = headerMyCall
|
|
|
|
previousLogLine.Operator = headerOperator
|
|
|
|
previousLogLine.Operator = headerOperator
|
|
|
|
|
|
|
|
previousLogLine.isFirstLine = headerIsFirstLine
|
|
|
|
previousLogLine.MyWWFF = headerMyWWFF
|
|
|
|
previousLogLine.MyWWFF = headerMyWWFF
|
|
|
|
previousLogLine.MyPOTA = headerMyPOTA
|
|
|
|
previousLogLine.MyPOTA = headerMyPOTA
|
|
|
|
previousLogLine.MySOTA = headerMySOTA
|
|
|
|
previousLogLine.MySOTA = headerMySOTA
|
|
|
@ -336,6 +343,7 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
|
|
|
|
|
|
|
|
//store the current logline so that it can be used as a model when parsing the next line
|
|
|
|
//store the current logline so that it can be used as a model when parsing the next line
|
|
|
|
previousLogLine = logline
|
|
|
|
previousLogLine = logline
|
|
|
|
|
|
|
|
//FIXME: we need to reset the first line
|
|
|
|
|
|
|
|
|
|
|
|
//We go back to the top to process the next loaded log line (Continue not necessary here)
|
|
|
|
//We go back to the top to process the next loaded log line (Continue not necessary here)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -388,12 +396,10 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
|
|
|
|
|
|
|
|
// displayLogSimple will print to stdout a simplified dump of a full log
|
|
|
|
// displayLogSimple will print to stdout a simplified dump of a full log
|
|
|
|
func displayLogSimple(fullLog []LogLine) {
|
|
|
|
func displayLogSimple(fullLog []LogLine) {
|
|
|
|
firstLine := true
|
|
|
|
|
|
|
|
for _, filledLogLine := range fullLog {
|
|
|
|
for _, filledLogLine := range fullLog {
|
|
|
|
if firstLine {
|
|
|
|
if filledLogLine.isFirstLine {
|
|
|
|
fmt.Println(SprintHeaderValues(filledLogLine))
|
|
|
|
fmt.Println(SprintHeaderValues(filledLogLine))
|
|
|
|
fmt.Print(SprintColumnTitles())
|
|
|
|
fmt.Print(SprintColumnTitles())
|
|
|
|
firstLine = false
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fmt.Print(SprintLogInColumn(filledLogLine))
|
|
|
|
fmt.Print(SprintLogInColumn(filledLogLine))
|
|
|
|
}
|
|
|
|
}
|
|
|
|