|
@@ -3,6 +3,7 @@ package util
|
|
import (
|
|
import (
|
|
"fmt"
|
|
"fmt"
|
|
"github.com/beevik/etree"
|
|
"github.com/beevik/etree"
|
|
|
|
+ "strings"
|
|
)
|
|
)
|
|
|
|
|
|
var (
|
|
var (
|
|
@@ -99,26 +100,34 @@ func ParseXosc(filepath string) (string, string, string, string, string, string)
|
|
}
|
|
}
|
|
|
|
|
|
func getValueByKey(key string) string {
|
|
func getValueByKey(key string) string {
|
|
- switch key {
|
|
|
|
- case xodr1Key:
|
|
|
|
|
|
+ if strings.Contains(key, xodr1Key) {
|
|
return xodr1Value
|
|
return xodr1Value
|
|
- case xodr2Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, xodr2Key) {
|
|
return xodr2Value
|
|
return xodr2Value
|
|
- case xodr3Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, xodr3Key) {
|
|
return xodr3Value
|
|
return xodr3Value
|
|
- case xodr4Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, xodr4Key) {
|
|
return xodr4Value
|
|
return xodr4Value
|
|
- case xodr5Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, xodr5Key) {
|
|
return xodr5Value
|
|
return xodr5Value
|
|
- case osgb1Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, osgb1Key) {
|
|
return osgb1Value
|
|
return osgb1Value
|
|
- case osgb2Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, osgb2Key) {
|
|
return osgb2Value
|
|
return osgb2Value
|
|
- case osgb3Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, osgb3Key) {
|
|
return osgb3Value
|
|
return osgb3Value
|
|
- case osgb4Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, osgb4Key) {
|
|
return osgb4Value
|
|
return osgb4Value
|
|
- case osgb5Key:
|
|
|
|
|
|
+ }
|
|
|
|
+ if strings.Contains(key, osgb5Key) {
|
|
return osgb5Value
|
|
return osgb5Value
|
|
}
|
|
}
|
|
fmt.Printf("错误的xosc【%v】", key)
|
|
fmt.Printf("错误的xosc【%v】", key)
|