LingxinMeng 6 месяцев назад
Родитель
Сommit
da892dbfbb
1 измененных файлов с 20 добавлено и 11 удалено
  1. 20 11
      src/package/util/u_xosc.go

+ 20 - 11
src/package/util/u_xosc.go

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