|
|
@ -53,7 +53,6 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
isInferTimeFatalError := false
|
|
|
|
isInferTimeFatalError := false
|
|
|
|
|
|
|
|
|
|
|
|
regexpLineComment := regexp.MustCompile(`^[[:blank:]]*#`)
|
|
|
|
regexpLineComment := regexp.MustCompile(`^[[:blank:]]*#`)
|
|
|
|
regexpInLineComment := regexp.MustCompile(`.*#.*`)
|
|
|
|
|
|
|
|
regexpOnlySpaces := regexp.MustCompile(`^\s+$`)
|
|
|
|
regexpOnlySpaces := regexp.MustCompile(`^\s+$`)
|
|
|
|
regexpSingleMultiLineComment := regexp.MustCompile(`^[[:blank:]]*{.+}$`)
|
|
|
|
regexpSingleMultiLineComment := regexp.MustCompile(`^[[:blank:]]*{.+}$`)
|
|
|
|
regexpStartMultiLineComment := regexp.MustCompile(`^[[:blank:]]*{`)
|
|
|
|
regexpStartMultiLineComment := regexp.MustCompile(`^[[:blank:]]*{`)
|
|
|
@ -65,6 +64,7 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
regexpHeaderMySota := regexp.MustCompile(`(?i)^mysota\s+`)
|
|
|
|
regexpHeaderMySota := regexp.MustCompile(`(?i)^mysota\s+`)
|
|
|
|
regexpHeaderMyPota := regexp.MustCompile(`(?i)^mypota\s+`)
|
|
|
|
regexpHeaderMyPota := regexp.MustCompile(`(?i)^mypota\s+`)
|
|
|
|
regexpHeaderMyGrid := regexp.MustCompile(`(?i)^mygrid\s+`)
|
|
|
|
regexpHeaderMyGrid := regexp.MustCompile(`(?i)^mygrid\s+`)
|
|
|
|
|
|
|
|
regexpHeaderMyCounty := regexp.MustCompile(`(?i)^mycounty\s+`)
|
|
|
|
regexpHeaderQslMsg := regexp.MustCompile(`(?i)^qslmsg\s+`)
|
|
|
|
regexpHeaderQslMsg := regexp.MustCompile(`(?i)^qslmsg\s+`)
|
|
|
|
regexpHeaderNickname := regexp.MustCompile(`(?i)^nickname\s+`)
|
|
|
|
regexpHeaderNickname := regexp.MustCompile(`(?i)^nickname\s+`)
|
|
|
|
|
|
|
|
|
|
|
@ -74,6 +74,7 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
headerMySOTA := ""
|
|
|
|
headerMySOTA := ""
|
|
|
|
headerMyPOTA := ""
|
|
|
|
headerMyPOTA := ""
|
|
|
|
headerMyGrid := ""
|
|
|
|
headerMyGrid := ""
|
|
|
|
|
|
|
|
headerMyCounty := ""
|
|
|
|
headerQslMsg := ""
|
|
|
|
headerQslMsg := ""
|
|
|
|
headerNickname := ""
|
|
|
|
headerNickname := ""
|
|
|
|
headerIsFirstLine := true
|
|
|
|
headerIsFirstLine := true
|
|
|
@ -106,10 +107,6 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
if (len(eachline) == 0) || (regexpOnlySpaces.MatchString(eachline)) {
|
|
|
|
if (len(eachline) == 0) || (regexpOnlySpaces.MatchString(eachline)) {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// a comment starts somewhere on the line, remove the comment
|
|
|
|
|
|
|
|
if regexpInLineComment.MatchString(eachline) {
|
|
|
|
|
|
|
|
eachline = strings.Split(eachline, "#")[0]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Process multi-line comments
|
|
|
|
// Process multi-line comments
|
|
|
|
if regexpStartMultiLineComment.MatchString(eachline) {
|
|
|
|
if regexpStartMultiLineComment.MatchString(eachline) {
|
|
|
@ -252,6 +249,16 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//My County
|
|
|
|
|
|
|
|
if regexpHeaderMyCounty.MatchString(eachline) {
|
|
|
|
|
|
|
|
myMyCountyList := regexpHeaderMyCounty.Split(eachline, -1)
|
|
|
|
|
|
|
|
if len(myMyCountyList[1]) > 0 {
|
|
|
|
|
|
|
|
headerMyCounty = myMyCountyList[1]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//If there is no data after the marker, we just skip the data.
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//QSL Message
|
|
|
|
//QSL Message
|
|
|
|
if regexpHeaderQslMsg.MatchString(eachline) {
|
|
|
|
if regexpHeaderQslMsg.MatchString(eachline) {
|
|
|
|
myQslMsgList := regexpHeaderQslMsg.Split(eachline, -1)
|
|
|
|
myQslMsgList := regexpHeaderQslMsg.Split(eachline, -1)
|
|
|
@ -291,6 +298,7 @@ func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogL
|
|
|
|
previousLogLine.MyPOTA = headerMyPOTA
|
|
|
|
previousLogLine.MyPOTA = headerMyPOTA
|
|
|
|
previousLogLine.MySOTA = headerMySOTA
|
|
|
|
previousLogLine.MySOTA = headerMySOTA
|
|
|
|
previousLogLine.MyGrid = headerMyGrid
|
|
|
|
previousLogLine.MyGrid = headerMyGrid
|
|
|
|
|
|
|
|
previousLogLine.MyCounty = headerMyCounty
|
|
|
|
previousLogLine.QSLmsg = headerQslMsg //previousLogLine.QslMsg is redundant
|
|
|
|
previousLogLine.QSLmsg = headerQslMsg //previousLogLine.QslMsg is redundant
|
|
|
|
previousLogLine.Nickname = headerNickname
|
|
|
|
previousLogLine.Nickname = headerNickname
|
|
|
|
|
|
|
|
|
|
|
|