LingxinMeng hai 1 ano
pai
achega
95a689fc14

+ 4 - 1
aarch64/pjisuv/master/service/for_competition.go

@@ -29,7 +29,9 @@ var (
 	bakSecondNumber        = 3600
 	cachePositionX         = -999.00
 	cachePositionY         = -999.00
-	cacheAutoMode          = -1 // 自动驾驶状态 0 人工 1 自动
+	cacheAutoMode          = -1                // 自动驾驶状态 0 人工 1 自动
+	InitialPositionX       = 565266.0482367771 // todo 需要比赛确认起点
+	InitialPositionY       = 4329773.48728322  // todo 需要比赛确认起点
 )
 
 // todo 实车比赛临时使用
@@ -128,6 +130,7 @@ func tick() {
 		Topic: topic,
 		Callback: func(data *std_msgs.String) {
 			if cacheAutoMode == 1 { // 只有在自动驾驶状态才发送心跳
+				//if math.Abs(positionX-InitialPositionX) > 5.00 || math.Abs(positionY-InitialPositionY) > 5.00 { // todo 测试临时使用起点判断
 				teamName := data.Data
 				response, err := util.HttpPostJsonWithHeaders(
 					urlExamTick,

+ 10 - 9
aarch64/pjisuv/master/service/produce_window.go

@@ -20,7 +20,6 @@ import (
 )
 
 // 所有共享变量
-// todo 如果触发器订阅了多个topic,需要定制化缓存指定字段;也可以将所有topic的所有字段值实时缓存,工作量太大,暂时搁置
 var (
 	extendParam commonEntity.PjisuvParam
 	// /cicv_location
@@ -45,16 +44,18 @@ func PrepareTimeWindowProducerQueue() {
 	for i, topic := range commonConfig.SubscribeTopics {
 		// !!!扩展的定时任务监听,牛逼的设计!!!扩展性拉满啦
 		if topic == masterConfig.TopicOfCicvExtend {
-			for {
-				time.Sleep(time.Duration(3500) * time.Millisecond)
-				for _, f := range masterConfig.RuleOfCicvExtend {
-					label := f(extendParam)
-					if label != "" {
-						saveTimeWindow(label, util.GetNowTimeCustom(), commonEntity.GetLastTimeWindow())
-						break
+			go func() {
+				for {
+					time.Sleep(time.Duration(3500) * time.Millisecond)
+					for _, f := range masterConfig.RuleOfCicvExtend {
+						label := f(extendParam)
+						if label != "" {
+							saveTimeWindow(label, util.GetNowTimeCustom(), commonEntity.GetLastTimeWindow())
+							break
+						}
 					}
 				}
-			}
+			}()
 		}
 
 		// 其他常规监听器

+ 5 - 5
amd64/score_server/entity/e_exam.go

@@ -44,11 +44,11 @@ type ExamPagePao struct {
 	Topic       string `json:"topic"`    // 赛题
 }
 type ExamReportPao struct {
-	Id         int    `json:"id"`
-	TeamName   string `json:"teamName"`
-	ScoreFinal int    `json:"scoreFinal"`
-	BeginTime  string `json:"beginTime"`
-	EndTime    string `json:"endTime"`
+	Id          int    `json:"id"`
+	TeamName    string `json:"teamName"`
+	ScoreOnline int    `json:"scoreOnline"`
+	BeginTime   string `json:"beginTime"`
+	EndTime     string `json:"endTime"`
 }
 
 /*

+ 11 - 11
amd64/score_server/handler/h_exam.go

@@ -434,21 +434,21 @@ func Report(c *gin.Context) {
 					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "1. 总体分数情况", alignOptionText)
 					currentLine++
 				}
+				//{
+				//	pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+				//	_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "整体得分:"+util.ToString(param.ScoreFinal), alignOptionText)
+				//	currentLine++
+				//}
 				{
 					pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "整体得分:"+util.ToString(param.ScoreFinal), alignOptionText)
-					currentLine++
-				}
-				{
-					pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "线上得分:"+util.ToString(param.ScoreFinal), alignOptionText)
-					currentLine++
-				}
-				{
-					pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
-					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "线下得分:", alignOptionText)
+					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "线上得分:"+util.ToString(param.ScoreOnline), alignOptionText)
 					currentLine++
 				}
+				//{
+				//	pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+				//	_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "线下得分:", alignOptionText)
+				//	currentLine++
+				//}
 				{
 					pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
 					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "整体耗时:"+endTime.Sub(beginTime).String(), alignOptionText)

+ 8 - 8
amd64/score_server/infra/application.yaml

@@ -1,7 +1,7 @@
 application-name: web_server
 web:
   port: 12341
-  route-prefix: /web_server
+  route-prefix: /web_server # todo 先不改了,不然比赛程序都要重新部署
   token: U9yKpD6kZZDDe4LFKK6myAxBUT1XRrDM
   white-list:
     - "/web_server/swagger"
@@ -9,10 +9,10 @@ log:
   dir: ./log/
   prefix: score_server
 mysql:
-#  ip: 36.110.106.156 # 公网IP
-#  sqlfile-dir: D:\code\cicv-data-closedloop\amd64\score_server\sql
-  ip: 10.14.85.241 # 内网IP
-  sqlfile-dir: /root/cicv-data-closedloop/amd64/score_server/sql
+  ip: 36.110.106.156 # 公网IP
+  sqlfile-dir: D:\code\cicv-data-closedloop\amd64\score_server\sql
+#  ip: 10.14.85.241 # 内网IP
+#  sqlfile-dir: /root/cicv-data-closedloop/amd64/score_server/sql
   port: 3306
   username: root
   password: 1qaz2wsx!
@@ -20,6 +20,6 @@ mysql:
   charset: utf8
 
 pdf:
-  ttf: D:\code\cicv-data-closedloop\amd64\web_server\simfang.ttf
-  background-png: D:\code\cicv-data-closedloop\amd64\web_server\background.png
-  logo-png: D:\code\cicv-data-closedloop\amd64\web_server\logo.png
+  ttf: D:\code\cicv-data-closedloop\amd64\score_server\simfang.ttf
+  background-png: D:\code\cicv-data-closedloop\amd64\score_server\background.png
+  logo-png: D:\code\cicv-data-closedloop\amd64\score_server\logo.png