This commit is contained in:
walker 2024-01-17 09:32:20 +08:00
commit cc2b2e6715
41 changed files with 1598 additions and 770 deletions

View File

@ -11,13 +11,13 @@ import (
"github.com/gin-gonic/gin"
"github.com/golang/protobuf/proto"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/dto/state_proto"
"joylink.club/bj-rtsts-server/middleware"
"joylink.club/bj-rtsts-server/service"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
@ -28,6 +28,7 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
authed.GET("/list", findAllSimulations)
authed.POST("/check/data", checkSimMapData)
authed.POST("/train/add", addTrain)
authed.POST("/train/config", configTrain)
authed.POST("/train/remove", removeTrain)
authed.POST("/train/update", updateTrain)
authed.POST("/switch/operation", turnoutOperation)
@ -85,7 +86,7 @@ func createByProjectId(c *gin.Context) {
}
var mapIds []int32
for _, mapInfo := range mapInfos {
if mapInfo.Type == graphicData.PictureType_value[graphicData.PictureType_TrainData.String()] {
if mapInfo.Type == data_proto.PictureType_value[data_proto.PictureType_TrainData.String()] {
continue
}
mapIds = append(mapIds, mapInfo.ID)
@ -167,13 +168,39 @@ func checkSimMapData(c *gin.Context) {
if err := c.ShouldBind(&rt); nil != err {
panic(sys_error.New("请求参数异常", err))
}
err := proto.Unmarshal(rt.Data, &graphicData.RtssGraphicStorage{})
err := proto.Unmarshal(rt.Data, &data_proto.RtssGraphicStorage{})
if err != nil {
panic(sys_error.New("非平面布置图数据"))
}
c.JSON(http.StatusOK, &dto.CheckMapDataRspDto{Success: true})
}
// 列车动力学参数配置修改
//
// @Summary 列车动力学参数配置修改
//
// @Security JwtAuth
//
// @Description 地图数据校验
// @Tags ATS测试仿真Api
// @Accept json
// @Produce json
// @Param Authorization header string true "JWT Token"
// @Param RemoveTrainDto body dto.ConfigTrainReqDto true "动力学参数配置"
//
// @Success 200 {object} string
// @Failure 500 {object} dto.ErrorDto
// @Router /api/v1/simulation/train/config [post]
func configTrain(c *gin.Context) {
req := &dto.ConfigTrainReqDto{}
if err := c.ShouldBind(&req); err != nil {
panic(sys_error.New("修改列车配置失败,请求参数异常", err))
}
simulation := checkDeviceDataAndReturn(req.SimulationId)
memory.UpdateConfigTrain(simulation, req)
c.JSON(http.StatusOK, "ok")
}
// ATS测试仿真-添加列车
//
// @Summary ATS测试仿真-添加列车
@ -199,7 +226,7 @@ func addTrain(c *gin.Context) {
if id == -1 {
panic(sys_error.New("添加列车失败,已有列车在运行"))
}
rsp := &state.TrainState{
rsp := &state_proto.TrainState{
Id: strconv.Itoa(id),
HeadDeviceId: req.Id,
HeadOffset: req.HeadOffset,
@ -233,7 +260,7 @@ func updateTrain(c *gin.Context) {
panic(sys_error.New("添加列车失败,请求参数异常", err))
}
simulation := checkDeviceDataAndReturn(req.SimulationId)
rsp := &state.TrainState{
rsp := &state_proto.TrainState{
Id: req.Id,
TrainLength: req.TrainLength,
WheelDiameter: req.WheelDiameter,
@ -683,19 +710,19 @@ func baliseTelegramReset(c *gin.Context) {
// @Tags ATS测试仿真Api
// @Accept json
// @Param Authorization header string true "JWT Token"
// @Param BaliseReqDto body dto.BaliseReqDto true "重置应答器状态"
// @Param simulationId query string true "重置应答器状态"
//
// @Success 200 {object} string
// @Failure 500 {object} dto.ErrorDto
// @Router /api/v1/simulation/balise/reset [put]
func baliseReset(c *gin.Context) {
req := &dto.BaliseReqDto{}
if err := c.ShouldBind(&req); err != nil {
panic(sys_error.New("应答器状态重置操作失败,请求参数异常", err))
}
simulation := checkDeviceDataAndReturn(req.SimulationId)
slog.Info("传入状态参数", req)
err := memory.BaliseReset(simulation, req)
//req := &dto.BaliseReqDto{}
//if err := c.ShouldBind(&req); err != nil {
// panic(sys_error.New("应答器状态重置操作失败,请求参数异常", err))
//}
simulationId := c.Query("simulationId")
simulation := checkDeviceDataAndReturn(simulationId)
err := memory.BaliseReset(simulation)
if err != nil {
panic(sys_error.New(fmt.Sprintf("应答器状态重置操作失败,%s", err.Error()), err))
}

@ -1 +1 @@
Subproject commit 19d48ccabcf1aa93ba5c65e61f7b623fe584bb77
Subproject commit 411729dc6a357f8bab7df24d66ea93cb5ba77c0a

View File

@ -1,5 +1,4 @@
// Code generated by swaggo/swag. DO NOT EDIT.
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
@ -3397,13 +3396,11 @@ const docTemplate = `{
"required": true
},
{
"type": "string",
"description": "重置应答器状态",
"name": "BaliseReqDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.BaliseReqDto"
}
"name": "simulationId",
"in": "query",
"required": true
}
],
"responses": {
@ -4188,6 +4185,58 @@ const docTemplate = `{
}
}
},
"/api/v1/simulation/train/config": {
"post": {
"security": [
{
"JwtAuth": []
}
],
"description": "地图数据校验",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ATS测试仿真Api"
],
"summary": "列车动力学参数配置修改",
"parameters": [
{
"type": "string",
"description": "JWT Token",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "动力学参数配置",
"name": "RemoveTrainDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ConfigTrainReqDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/dto.ErrorDto"
}
}
}
}
},
"/api/v1/simulation/train/remove": {
"post": {
"security": [
@ -4905,6 +4954,55 @@ const docTemplate = `{
}
},
"definitions": {
"data_proto.KilometerSystem": {
"type": "object",
"properties": {
"coordinateSystem": {
"description": "坐标系",
"type": "string"
},
"direction": {
"description": "左右行",
"allOf": [
{
"$ref": "#/definitions/data_proto.KilometerSystem_Direction"
}
]
},
"kilometer": {
"description": "公里标mm",
"type": "integer"
}
}
},
"data_proto.KilometerSystem_Direction": {
"type": "integer",
"enum": [
0,
1
],
"x-enum-varnames": [
"KilometerSystem_LEFT",
"KilometerSystem_RIGHT"
]
},
"data_proto.PictureType": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4
],
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout",
"PictureType_IBP",
"PictureType_TrainData"
]
},
"dto.AddTrainReqDto": {
"type": "object",
"properties": {
@ -5039,10 +5137,8 @@ const docTemplate = `{
"type": "string"
},
"telegram": {
"type": "array",
"items": {
"type": "integer"
}
"description": "报文16进制字符串",
"type": "string"
}
}
},
@ -5057,7 +5153,7 @@ const docTemplate = `{
"description": "公里标",
"allOf": [
{
"$ref": "#/definitions/graphicData.KilometerSystem"
"$ref": "#/definitions/data_proto.KilometerSystem"
}
]
},
@ -5116,6 +5212,98 @@ const docTemplate = `{
}
}
},
"dto.ConfigTrainData": {
"type": "object",
"properties": {
"baseResistanceParamA": {
"description": "基本阻力参数A",
"type": "number"
},
"baseResistanceParamB": {
"description": "基本阻力参数B",
"type": "number"
},
"baseResistanceParamC": {
"description": "基本阻力参数C",
"type": "number"
},
"curveResistanceParamR1": {
"description": "曲线阻力参数R1",
"type": "number"
},
"curveResistanceParamR2": {
"description": "曲线阻力参数R2",
"type": "number"
},
"curveResistanceParamR3": {
"description": "曲线阻力参数R3",
"type": "number"
},
"curveResistanceParamR4": {
"description": "曲线阻力参数R4",
"type": "number"
},
"jump": {
"description": "是否跳跃",
"type": "boolean"
},
"length": {
"description": "列车的长度cm",
"type": "integer"
},
"mass": {
"description": "列车的质量100=1ton",
"type": "integer"
},
"radarCheckSpeed": {
"description": "雷达测速数值",
"type": "number"
},
"radarCheckTime": {
"description": "雷达检测时间(秒)",
"type": "integer"
},
"radarEnable": {
"description": "雷达是否有效",
"type": "boolean"
},
"revolvingMassParam": {
"description": "旋转质量参数",
"type": "number"
},
"slide": {
"description": "前溜/后溜mm正数前溜负数后溜",
"type": "integer"
},
"slip": {
"description": "打滑(%",
"type": "number"
},
"stopSign": {
"description": "过标/欠标mm正数过标负数欠标",
"type": "integer"
},
"wheelDiameter": {
"description": "轮径mm",
"type": "integer"
}
}
},
"dto.ConfigTrainReqDto": {
"type": "object",
"properties": {
"TrainId": {
"description": "列车Id",
"type": "integer"
},
"configData": {
"$ref": "#/definitions/dto.ConfigTrainData"
},
"simulationId": {
"type": "string"
}
}
},
"dto.ErrorDto": {
"type": "object",
"properties": {
@ -5489,7 +5677,7 @@ const docTemplate = `{
"description": "当操作为Operation.Display时有效表示显示的信号",
"allOf": [
{
"$ref": "#/definitions/state.Signal_Aspect"
"$ref": "#/definitions/state_proto.Signal_Aspect"
}
]
},
@ -5682,55 +5870,6 @@ const docTemplate = `{
}
}
},
"graphicData.KilometerSystem": {
"type": "object",
"properties": {
"coordinateSystem": {
"description": "坐标系",
"type": "string"
},
"direction": {
"description": "左右行",
"allOf": [
{
"$ref": "#/definitions/graphicData.KilometerSystem_Direction"
}
]
},
"kilometer": {
"description": "公里标mm",
"type": "integer"
}
}
},
"graphicData.KilometerSystem_Direction": {
"type": "integer",
"enum": [
0,
1
],
"x-enum-varnames": [
"KilometerSystem_LEFT",
"KilometerSystem_RIGHT"
]
},
"graphicData.PictureType": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4
],
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout",
"PictureType_IBP",
"PictureType_TrainData"
]
},
"model.AuthAPIPath": {
"type": "object",
"properties": {
@ -6109,7 +6248,7 @@ const docTemplate = `{
"Turnout_CancelForce"
]
},
"state.Signal_Aspect": {
"state_proto.Signal_Aspect": {
"type": "integer",
"enum": [
0,

View File

@ -3390,13 +3390,11 @@
"required": true
},
{
"type": "string",
"description": "重置应答器状态",
"name": "BaliseReqDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.BaliseReqDto"
}
"name": "simulationId",
"in": "query",
"required": true
}
],
"responses": {
@ -4181,6 +4179,58 @@
}
}
},
"/api/v1/simulation/train/config": {
"post": {
"security": [
{
"JwtAuth": []
}
],
"description": "地图数据校验",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ATS测试仿真Api"
],
"summary": "列车动力学参数配置修改",
"parameters": [
{
"type": "string",
"description": "JWT Token",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "动力学参数配置",
"name": "RemoveTrainDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ConfigTrainReqDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/dto.ErrorDto"
}
}
}
}
},
"/api/v1/simulation/train/remove": {
"post": {
"security": [
@ -4898,6 +4948,55 @@
}
},
"definitions": {
"data_proto.KilometerSystem": {
"type": "object",
"properties": {
"coordinateSystem": {
"description": "坐标系",
"type": "string"
},
"direction": {
"description": "左右行",
"allOf": [
{
"$ref": "#/definitions/data_proto.KilometerSystem_Direction"
}
]
},
"kilometer": {
"description": "公里标mm",
"type": "integer"
}
}
},
"data_proto.KilometerSystem_Direction": {
"type": "integer",
"enum": [
0,
1
],
"x-enum-varnames": [
"KilometerSystem_LEFT",
"KilometerSystem_RIGHT"
]
},
"data_proto.PictureType": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4
],
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout",
"PictureType_IBP",
"PictureType_TrainData"
]
},
"dto.AddTrainReqDto": {
"type": "object",
"properties": {
@ -5032,10 +5131,8 @@
"type": "string"
},
"telegram": {
"type": "array",
"items": {
"type": "integer"
}
"description": "报文16进制字符串",
"type": "string"
}
}
},
@ -5050,7 +5147,7 @@
"description": "公里标",
"allOf": [
{
"$ref": "#/definitions/graphicData.KilometerSystem"
"$ref": "#/definitions/data_proto.KilometerSystem"
}
]
},
@ -5109,6 +5206,98 @@
}
}
},
"dto.ConfigTrainData": {
"type": "object",
"properties": {
"baseResistanceParamA": {
"description": "基本阻力参数A",
"type": "number"
},
"baseResistanceParamB": {
"description": "基本阻力参数B",
"type": "number"
},
"baseResistanceParamC": {
"description": "基本阻力参数C",
"type": "number"
},
"curveResistanceParamR1": {
"description": "曲线阻力参数R1",
"type": "number"
},
"curveResistanceParamR2": {
"description": "曲线阻力参数R2",
"type": "number"
},
"curveResistanceParamR3": {
"description": "曲线阻力参数R3",
"type": "number"
},
"curveResistanceParamR4": {
"description": "曲线阻力参数R4",
"type": "number"
},
"jump": {
"description": "是否跳跃",
"type": "boolean"
},
"length": {
"description": "列车的长度cm",
"type": "integer"
},
"mass": {
"description": "列车的质量100=1ton",
"type": "integer"
},
"radarCheckSpeed": {
"description": "雷达测速数值",
"type": "number"
},
"radarCheckTime": {
"description": "雷达检测时间(秒)",
"type": "integer"
},
"radarEnable": {
"description": "雷达是否有效",
"type": "boolean"
},
"revolvingMassParam": {
"description": "旋转质量参数",
"type": "number"
},
"slide": {
"description": "前溜/后溜mm正数前溜负数后溜",
"type": "integer"
},
"slip": {
"description": "打滑(%",
"type": "number"
},
"stopSign": {
"description": "过标/欠标mm正数过标负数欠标",
"type": "integer"
},
"wheelDiameter": {
"description": "轮径mm",
"type": "integer"
}
}
},
"dto.ConfigTrainReqDto": {
"type": "object",
"properties": {
"TrainId": {
"description": "列车Id",
"type": "integer"
},
"configData": {
"$ref": "#/definitions/dto.ConfigTrainData"
},
"simulationId": {
"type": "string"
}
}
},
"dto.ErrorDto": {
"type": "object",
"properties": {
@ -5482,7 +5671,7 @@
"description": "当操作为Operation.Display时有效表示显示的信号",
"allOf": [
{
"$ref": "#/definitions/state.Signal_Aspect"
"$ref": "#/definitions/state_proto.Signal_Aspect"
}
]
},
@ -5675,55 +5864,6 @@
}
}
},
"graphicData.KilometerSystem": {
"type": "object",
"properties": {
"coordinateSystem": {
"description": "坐标系",
"type": "string"
},
"direction": {
"description": "左右行",
"allOf": [
{
"$ref": "#/definitions/graphicData.KilometerSystem_Direction"
}
]
},
"kilometer": {
"description": "公里标mm",
"type": "integer"
}
}
},
"graphicData.KilometerSystem_Direction": {
"type": "integer",
"enum": [
0,
1
],
"x-enum-varnames": [
"KilometerSystem_LEFT",
"KilometerSystem_RIGHT"
]
},
"graphicData.PictureType": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4
],
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout",
"PictureType_IBP",
"PictureType_TrainData"
]
},
"model.AuthAPIPath": {
"type": "object",
"properties": {
@ -6102,7 +6242,7 @@
"Turnout_CancelForce"
]
},
"state.Signal_Aspect": {
"state_proto.Signal_Aspect": {
"type": "integer",
"enum": [
0,

View File

@ -1,5 +1,40 @@
basePath: /
definitions:
data_proto.KilometerSystem:
properties:
coordinateSystem:
description: 坐标系
type: string
direction:
allOf:
- $ref: '#/definitions/data_proto.KilometerSystem_Direction'
description: 左右行
kilometer:
description: 公里标mm
type: integer
type: object
data_proto.KilometerSystem_Direction:
enum:
- 0
- 1
type: integer
x-enum-varnames:
- KilometerSystem_LEFT
- KilometerSystem_RIGHT
data_proto.PictureType:
enum:
- 0
- 1
- 2
- 3
- 4
type: integer
x-enum-varnames:
- PictureType_StationLayout
- PictureType_Psl
- PictureType_RelayCabinetLayout
- PictureType_IBP
- PictureType_TrainData
dto.AddTrainReqDto:
properties:
devicePort:
@ -94,9 +129,8 @@ definitions:
description: 仿真ID
type: string
telegram:
items:
type: integer
type: array
description: 报文16进制字符串
type: string
type: object
dto.BaliseMoveReqDto:
properties:
@ -105,7 +139,7 @@ definitions:
type: integer
km:
allOf:
- $ref: '#/definitions/graphicData.KilometerSystem'
- $ref: '#/definitions/data_proto.KilometerSystem'
description: 公里标
mapId:
description: 地图ID
@ -144,6 +178,73 @@ definitions:
success:
type: boolean
type: object
dto.ConfigTrainData:
properties:
baseResistanceParamA:
description: 基本阻力参数A
type: number
baseResistanceParamB:
description: 基本阻力参数B
type: number
baseResistanceParamC:
description: 基本阻力参数C
type: number
curveResistanceParamR1:
description: 曲线阻力参数R1
type: number
curveResistanceParamR2:
description: 曲线阻力参数R2
type: number
curveResistanceParamR3:
description: 曲线阻力参数R3
type: number
curveResistanceParamR4:
description: 曲线阻力参数R4
type: number
jump:
description: 是否跳跃
type: boolean
length:
description: 列车的长度cm
type: integer
mass:
description: 列车的质量100=1ton
type: integer
radarCheckSpeed:
description: 雷达测速数值
type: number
radarCheckTime:
description: 雷达检测时间(秒)
type: integer
radarEnable:
description: 雷达是否有效
type: boolean
revolvingMassParam:
description: 旋转质量参数
type: number
slide:
description: 前溜/后溜mm正数前溜负数后溜
type: integer
slip:
description: 打滑(%
type: number
stopSign:
description: 过标/欠标mm正数过标负数欠标
type: integer
wheelDiameter:
description: 轮径mm
type: integer
type: object
dto.ConfigTrainReqDto:
properties:
TrainId:
description: 列车Id
type: integer
configData:
$ref: '#/definitions/dto.ConfigTrainData'
simulationId:
type: string
type: object
dto.ErrorDto:
properties:
code:
@ -392,7 +493,7 @@ definitions:
properties:
aspect:
allOf:
- $ref: '#/definitions/state.Signal_Aspect'
- $ref: '#/definitions/state_proto.Signal_Aspect'
description: 当操作为Operation.Display时有效表示显示的信号
id:
type: integer
@ -528,41 +629,6 @@ definitions:
$ref: '#/definitions/dto.AuthRoleRspDto'
type: array
type: object
graphicData.KilometerSystem:
properties:
coordinateSystem:
description: 坐标系
type: string
direction:
allOf:
- $ref: '#/definitions/graphicData.KilometerSystem_Direction'
description: 左右行
kilometer:
description: 公里标mm
type: integer
type: object
graphicData.KilometerSystem_Direction:
enum:
- 0
- 1
type: integer
x-enum-varnames:
- KilometerSystem_LEFT
- KilometerSystem_RIGHT
graphicData.PictureType:
enum:
- 0
- 1
- 2
- 3
- 4
type: integer
x-enum-varnames:
- PictureType_StationLayout
- PictureType_Psl
- PictureType_RelayCabinetLayout
- PictureType_IBP
- PictureType_TrainData
model.AuthAPIPath:
properties:
id:
@ -864,7 +930,7 @@ definitions:
description: 仿真id
type: string
type: object
state.Signal_Aspect:
state_proto.Signal_Aspect:
enum:
- 0
- 1
@ -3038,11 +3104,10 @@ paths:
required: true
type: string
- description: 重置应答器状态
in: body
name: BaliseReqDto
in: query
name: simulationId
required: true
schema:
$ref: '#/definitions/dto.BaliseReqDto'
type: string
responses:
"200":
description: OK
@ -3543,6 +3608,39 @@ paths:
summary: ATS测试仿真-添加列车
tags:
- ATS测试仿真Api
/api/v1/simulation/train/config:
post:
consumes:
- application/json
description: 地图数据校验
parameters:
- description: JWT Token
in: header
name: Authorization
required: true
type: string
- description: 动力学参数配置
in: body
name: RemoveTrainDto
required: true
schema:
$ref: '#/definitions/dto.ConfigTrainReqDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/dto.ErrorDto'
security:
- JwtAuth: []
summary: 列车动力学参数配置修改
tags:
- ATS测试仿真Api
/api/v1/simulation/train/remove:
post:
consumes:

View File

@ -1,10 +1,10 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc-gen-go v1.32.0
// protoc v4.23.1
// source: ibpGraphics.proto
package graphicData
package data_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -986,9 +986,11 @@ var file_ibpGraphics_proto_rawDesc = []byte{
0x10, 0x02, 0x22, 0x36, 0x0a, 0x13, 0x49, 0x62, 0x70, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x54, 0x65, 0x78, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x46,
0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x49, 0x47, 0x48, 0x54, 0x10, 0x01, 0x12, 0x0a,
0x0a, 0x06, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x02, 0x42, 0x19, 0x5a, 0x17, 0x2e, 0x2f,
0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69,
0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x0a, 0x06, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x02, 0x42, 0x2d, 0x5a, 0x2b, 0x6a, 0x6f,
0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74,
0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x64,
0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

View File

@ -1,10 +1,10 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc-gen-go v1.32.0
// protoc v4.23.1
// source: picture.proto
package graphicData
package data_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -89,9 +89,11 @@ var file_picture_proto_rawDesc = []byte{
0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x73, 0x6c, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x65,
0x6c, 0x61, 0x79, 0x43, 0x61, 0x62, 0x69, 0x6e, 0x65, 0x74, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74,
0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x42, 0x50, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x54,
0x72, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x10, 0x04, 0x42, 0x19, 0x5a, 0x17, 0x2e, 0x2f,
0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69,
0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x10, 0x04, 0x42, 0x2d, 0x5a, 0x2b, 0x6a, 0x6f,
0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74,
0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x64,
0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

View File

@ -1,10 +1,10 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc-gen-go v1.32.0
// protoc v4.23.1
// source: pslGraphics.proto
package graphicData
package data_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -499,9 +499,10 @@ var file_pslGraphics_proto_rawDesc = []byte{
0x0a, 0x0f, 0x50, 0x73, 0x6c, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6c, 0x6f,
0x72, 0x12, 0x07, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x67, 0x72,
0x65, 0x65, 0x6e, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x10, 0x02, 0x42,
0x19, 0x5a, 0x17, 0x2e, 0x2f, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x67,
0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
0x2d, 0x5a, 0x2b, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f,
0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f,
0x64, 0x74, 0x6f, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1,10 +1,10 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc-gen-go v1.32.0
// protoc v4.23.1
// source: relayCabinetLayoutGraphics.proto
package graphicData
package data_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -1215,9 +1215,10 @@ var file_relayCabinetLayoutGraphics_proto_rawDesc = []byte{
0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x6c, 0x64,
0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66,
0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65,
0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x42, 0x19, 0x5a, 0x17, 0x2e, 0x2f, 0x74, 0x73, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61,
0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x42, 0x2d, 0x5a, 0x2b, 0x6a, 0x6f, 0x79, 0x6c, 0x69,
0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73,
0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x64, 0x61, 0x74, 0x61,
0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1,10 +1,10 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc-gen-go v1.32.0
// protoc v4.23.1
// source: stationLayoutGraphics.proto
package graphicData
package data_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -2116,12 +2116,12 @@ type Station struct {
// string kilometerCode = 5; //公里标
KilometerSystem *KilometerSystem `protobuf:"bytes,6,opt,name=kilometerSystem,proto3" json:"kilometerSystem,omitempty"` //公里标
// int32 index = 7;
RefIbpMapCode string `protobuf:"bytes,8,opt,name=refIbpMapCode,proto3" json:"refIbpMapCode,omitempty"` // 关联IBP地图Code
StationName string `protobuf:"bytes,9,opt,name=stationName,proto3" json:"stationName,omitempty"` //车站名
// string stationNameAcronym = 10; // 车站名缩
Depots bool `protobuf:"varint,11,opt,name=depots,proto3" json:"depots,omitempty"` //是否车辆段
OldmanageStations []string `protobuf:"bytes,12,rep,name=oldmanageStations,proto3" json:"oldmanageStations,omitempty"` // 如果是集中站——管理的车站-id
ManageStations []uint32 `protobuf:"varint,13,rep,packed,name=manageStations,proto3" json:"manageStations,omitempty"` // 如果是集中站——管理的车站-id
RefIbpMapCode string `protobuf:"bytes,8,opt,name=refIbpMapCode,proto3" json:"refIbpMapCode,omitempty"` // 关联IBP地图Code
StationName string `protobuf:"bytes,9,opt,name=stationName,proto3" json:"stationName,omitempty"` //车站名
StationNameAcronym string `protobuf:"bytes,10,opt,name=stationNameAcronym,proto3" json:"stationNameAcronym,omitempty"` // 车站名拼音简
Depots bool `protobuf:"varint,11,opt,name=depots,proto3" json:"depots,omitempty"` //是否车辆段
OldmanageStations []string `protobuf:"bytes,12,rep,name=oldmanageStations,proto3" json:"oldmanageStations,omitempty"` // 如果是集中站——管理的车站-id
ManageStations []uint32 `protobuf:"varint,13,rep,packed,name=manageStations,proto3" json:"manageStations,omitempty"` // 如果是集中站——管理的车站-id
}
func (x *Station) Reset() {
@ -2198,6 +2198,13 @@ func (x *Station) GetStationName() string {
return ""
}
func (x *Station) GetStationNameAcronym() string {
if x != nil {
return x.StationNameAcronym
}
return ""
}
func (x *Station) GetDepots() bool {
if x != nil {
return x.Depots
@ -5490,7 +5497,7 @@ var file_stationLayoutGraphics_proto_rawDesc = []byte{
0x74, 0x61, 0x72, 0x74, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x44, 0x6f, 0x6f, 0x72, 0x12, 0x22, 0x0a,
0x0c, 0x65, 0x6e, 0x64, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x44, 0x6f, 0x6f, 0x72, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x44, 0x6f, 0x6f,
0x72, 0x22, 0x82, 0x03, 0x0a, 0x07, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a,
0x72, 0x22, 0xb2, 0x03, 0x0a, 0x07, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a,
0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12,
@ -5507,7 +5514,10 @@ var file_stationLayoutGraphics_proto_rawDesc = []byte{
0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x49, 0x62, 0x70, 0x4d,
0x61, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x70, 0x6f,
0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x63, 0x72, 0x6f, 0x6e, 0x79, 0x6d, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d,
0x65, 0x41, 0x63, 0x72, 0x6f, 0x6e, 0x79, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x70, 0x6f,
0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x64, 0x65, 0x70, 0x6f, 0x74, 0x73,
0x12, 0x2c, 0x0a, 0x11, 0x6f, 0x6c, 0x64, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x6f, 0x6c, 0x64,
@ -6115,12 +6125,14 @@ var file_stationLayoutGraphics_proto_rawDesc = []byte{
0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x03, 0x69, 0x64,
0x73, 0x2a, 0x1d, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x06,
0x0a, 0x02, 0x55, 0x50, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x01,
0x42, 0x55, 0x0a, 0x25, 0x63, 0x6c, 0x75, 0x62, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b,
0x42, 0x69, 0x0a, 0x25, 0x63, 0x6c, 0x75, 0x62, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b,
0x2e, 0x62, 0x6a, 0x72, 0x74, 0x73, 0x73, 0x2e, 0x61, 0x74, 0x73, 0x2e, 0x76, 0x65, 0x72, 0x69,
0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x42, 0x13, 0x4c, 0x61, 0x79, 0x6f, 0x75,
0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x17,
0x2e, 0x2f, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x61, 0x70,
0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x2b,
0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d,
0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f,
0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (

View File

@ -3,7 +3,7 @@ package dto
import (
"time"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/dto/data_proto"
)
type PageDraftingReqDto struct {
@ -16,11 +16,11 @@ type ListDraftingReqDto struct {
}
type DraftingDto struct {
Id int `json:"id" form:"id"`
Name string `json:"name" form:"name"`
Category string `json:"category" form:"category"`
Type graphicData.PictureType `json:"type" form:"type"`
Proto []byte `json:"proto" from:"proto"`
Id int `json:"id" form:"id"`
Name string `json:"name" form:"name"`
Category string `json:"category" form:"category"`
Type data_proto.PictureType `json:"type" form:"type"`
Proto []byte `json:"proto" from:"proto"`
}
type DraftingMapDataDto struct {

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc-gen-go v1.32.0
// protoc v4.23.1
// source: request.proto
@ -908,9 +908,10 @@ var file_request_proto_rawDesc = []byte{
0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x05, 0x20,
0x03, 0x28, 0x05, 0x52, 0x08, 0x61, 0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x14, 0x0a,
0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72,
0x6f, 0x75, 0x70, 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
0x6f, 0x75, 0x70, 0x42, 0x30, 0x5a, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63,
0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1,9 +1,9 @@
package dto
import (
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/dto/state_proto"
)
// 创建仿真请求
@ -56,6 +56,36 @@ type AddTrainReqDto struct {
WheelDiameter int32 `json:"wheelDiameter" from:"wheelDiameter"`
}
// 为反正列车修改对应的测试配置
type ConfigTrainReqDto struct {
SimulationId string `json:"simulationId" form:"simulationId"`
// 列车Id
TrainId int `json:"TrainId" form:"TrainId"`
ConfigData ConfigTrainData
}
type ConfigTrainData struct {
//
Mass int32 `json:"mass" form:"mass"` // 列车的质量100=1ton
Length int64 `json:"length"` // 列车的长度cm
BaseResistanceParamA float32 `json:"baseResistanceParamA"` // 基本阻力参数A
BaseResistanceParamB float32 `json:"baseResistanceParamB"` // 基本阻力参数B
BaseResistanceParamC float32 `json:"baseResistanceParamC"` // 基本阻力参数C
CurveResistanceParamR1 float32 `json:"curveResistanceParamR1"` // 曲线阻力参数R1
CurveResistanceParamR2 float32 `json:"curveResistanceParamR2"` // 曲线阻力参数R2
CurveResistanceParamR3 float32 `json:"curveResistanceParamR3"` // 曲线阻力参数R3
CurveResistanceParamR4 float32 `json:"curveResistanceParamR4"` // 曲线阻力参数R4
RevolvingMassParam float32 `json:"revolvingMassParam"` // 旋转质量参数
Jump bool `json:"jump"` // 是否跳跃
Slip float32 `json:"slip"` // 打滑(%
Slide int32 `json:"slide"` // 前溜/后溜mm正数前溜负数后溜
StopSign int32 `json:"stopSign"` // 过标/欠标mm正数过标负数欠标
WheelDiameter int32 `json:"wheelDiameter"` // 轮径mm
RadarEnable bool `json:"radarEnable"` // 雷达是否有效
RadarCheckSpeed float32 `json:"radarCheckSpeed"` // 雷达测速数值
RadarCheckTime int32 `json:"radarCheckTime"` // 雷达检测时间(秒)
}
// 为仿真添加测试车请求
type UpdateTrainReqDto struct {
// 仿真id
@ -97,7 +127,7 @@ type SignalOperationReqDto struct {
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
DeviceId uint32 `form:"id" json:"id" binding:"required"`
Operation request_proto.Signal_Operation `form:"operation" json:"operation" binding:"required"` //信号机操作类型
Aspect state.Signal_Aspect `form:"aspect" json:"aspect" binding:"required"` // 当操作为Operation.Display时有效表示显示的信号
Aspect state_proto.Signal_Aspect `form:"aspect" json:"aspect" binding:"required"` // 当操作为Operation.Display时有效表示显示的信号
}
// AxleSectionOperationReqDto 计轴区段操作
@ -172,10 +202,10 @@ type RelayOperationReqDto struct {
// BaliseMoveReqDto 应答器移位请求
type BaliseMoveReqDto struct {
SimulationId string `json:"simulationId" form:"simulationId"` //仿真ID
MapId int32 `json:"mapId" form:"mapId"` //地图ID
BaliseId uint32 `json:"baliseId" form:"baliseId"` //应答器ID
Km graphicData.KilometerSystem `json:"km" form:"km"` //公里标
SimulationId string `json:"simulationId" form:"simulationId"` //仿真ID
MapId int32 `json:"mapId" form:"mapId"` //地图ID
BaliseId uint32 `json:"baliseId" form:"baliseId"` //应答器ID
Km data_proto.KilometerSystem `json:"km" form:"km"` //公里标
}
// BaliseModifyTelegramReqDto 修改应答器报文
@ -183,7 +213,7 @@ type BaliseModifyTelegramReqDto struct {
SimulationId string `json:"simulationId" form:"simulationId"` //仿真ID
MapId int32 `json:"mapId" form:"mapId"` //地图ID
BaliseId uint32 `json:"baliseId" form:"baliseId"` //应答器ID
Telegram []byte
Telegram string `json:"telegram" from:"telegram"` //报文16进制字符串
}
// BaliseReqDto 应答器请求

View File

@ -1,15 +1,15 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc-gen-go v1.32.0
// protoc v4.23.1
// source: device_state.proto
package state
package state_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
graphicData "joylink.club/bj-rtsts-server/ts/protos/graphicData"
data_proto "joylink.club/bj-rtsts-server/dto/data_proto"
reflect "reflect"
sync "sync"
)
@ -199,7 +199,7 @@ func (x SimulationStatus_SimulationState) Number() protoreflect.EnumNumber {
// Deprecated: Use SimulationStatus_SimulationState.Descriptor instead.
func (SimulationStatus_SimulationState) EnumDescriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{23, 0}
return file_device_state_proto_rawDescGZIP(), []int{24, 0}
}
// 相邻端点定义的link的状态
@ -977,7 +977,8 @@ type TrainDynamicState struct {
// 通讯中断
UdpInterruption bool `protobuf:"varint,21,opt,name=udpInterruption,proto3" json:"udpInterruption,omitempty"`
// 加速
Acceleration float32 `protobuf:"fixed32,22,opt,name=acceleration,proto3" json:"acceleration,omitempty"`
Acceleration float32 `protobuf:"fixed32,22,opt,name=acceleration,proto3" json:"acceleration,omitempty"`
TrainDynamicConfig *TrainDynamicConfig `protobuf:"bytes,23,opt,name=trainDynamicConfig,proto3" json:"trainDynamicConfig,omitempty"`
}
func (x *TrainDynamicState) Reset() {
@ -1166,6 +1167,197 @@ func (x *TrainDynamicState) GetAcceleration() float32 {
return 0
}
func (x *TrainDynamicState) GetTrainDynamicConfig() *TrainDynamicConfig {
if x != nil {
return x.TrainDynamicConfig
}
return nil
}
// 动力学列车配置
type TrainDynamicConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// 列车的质量100=1ton
Mass int32 `protobuf:"varint,1,opt,name=mass,proto3" json:"mass,omitempty"`
// 基本阻力参数A
BaseResistanceParamA float32 `protobuf:"fixed32,2,opt,name=baseResistanceParamA,proto3" json:"baseResistanceParamA,omitempty"`
// 基本阻力参数B
BaseResistanceParamB float32 `protobuf:"fixed32,3,opt,name=baseResistanceParamB,proto3" json:"baseResistanceParamB,omitempty"`
// 基本阻力参数C
BaseResistanceParamC float32 `protobuf:"fixed32,4,opt,name=baseResistanceParamC,proto3" json:"baseResistanceParamC,omitempty"`
// 曲线阻力参数R1
CurveResistanceParamR1 float32 `protobuf:"fixed32,5,opt,name=curveResistanceParamR1,proto3" json:"curveResistanceParamR1,omitempty"`
// 曲线阻力参数R2
CurveResistanceParamR2 float32 `protobuf:"fixed32,6,opt,name=curveResistanceParamR2,proto3" json:"curveResistanceParamR2,omitempty"`
// 曲线阻力参数R3
CurveResistanceParamR3 float32 `protobuf:"fixed32,7,opt,name=curveResistanceParamR3,proto3" json:"curveResistanceParamR3,omitempty"`
// 曲线阻力参数R4
CurveResistanceParamR4 float32 `protobuf:"fixed32,8,opt,name=curveResistanceParamR4,proto3" json:"curveResistanceParamR4,omitempty"`
// 旋转质量参数
RevolvingMassParam float32 `protobuf:"fixed32,9,opt,name=revolvingMassParam,proto3" json:"revolvingMassParam,omitempty"`
// 是否跳跃
Jump bool `protobuf:"varint,10,opt,name=jump,proto3" json:"jump,omitempty"`
// 打滑(%
Slip float32 `protobuf:"fixed32,11,opt,name=slip,proto3" json:"slip,omitempty"`
// 前溜/后溜mm正数前溜负数后溜
Slide int32 `protobuf:"varint,12,opt,name=slide,proto3" json:"slide,omitempty"`
// 过标/欠标mm正数过标负数欠标
StopSign int32 `protobuf:"varint,13,opt,name=stopSign,proto3" json:"stopSign,omitempty"`
// 雷达是否有效
RadarEnable bool `protobuf:"varint,14,opt,name=radarEnable,proto3" json:"radarEnable,omitempty"`
// 雷达测速数值
RadarCheckSpeed float32 `protobuf:"fixed32,15,opt,name=radarCheckSpeed,proto3" json:"radarCheckSpeed,omitempty"`
// 雷达检测时间(秒)
RadarCheckTime int32 `protobuf:"varint,16,opt,name=radarCheckTime,proto3" json:"radarCheckTime,omitempty"`
}
func (x *TrainDynamicConfig) Reset() {
*x = TrainDynamicConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TrainDynamicConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TrainDynamicConfig) ProtoMessage() {}
func (x *TrainDynamicConfig) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TrainDynamicConfig.ProtoReflect.Descriptor instead.
func (*TrainDynamicConfig) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{9}
}
func (x *TrainDynamicConfig) GetMass() int32 {
if x != nil {
return x.Mass
}
return 0
}
func (x *TrainDynamicConfig) GetBaseResistanceParamA() float32 {
if x != nil {
return x.BaseResistanceParamA
}
return 0
}
func (x *TrainDynamicConfig) GetBaseResistanceParamB() float32 {
if x != nil {
return x.BaseResistanceParamB
}
return 0
}
func (x *TrainDynamicConfig) GetBaseResistanceParamC() float32 {
if x != nil {
return x.BaseResistanceParamC
}
return 0
}
func (x *TrainDynamicConfig) GetCurveResistanceParamR1() float32 {
if x != nil {
return x.CurveResistanceParamR1
}
return 0
}
func (x *TrainDynamicConfig) GetCurveResistanceParamR2() float32 {
if x != nil {
return x.CurveResistanceParamR2
}
return 0
}
func (x *TrainDynamicConfig) GetCurveResistanceParamR3() float32 {
if x != nil {
return x.CurveResistanceParamR3
}
return 0
}
func (x *TrainDynamicConfig) GetCurveResistanceParamR4() float32 {
if x != nil {
return x.CurveResistanceParamR4
}
return 0
}
func (x *TrainDynamicConfig) GetRevolvingMassParam() float32 {
if x != nil {
return x.RevolvingMassParam
}
return 0
}
func (x *TrainDynamicConfig) GetJump() bool {
if x != nil {
return x.Jump
}
return false
}
func (x *TrainDynamicConfig) GetSlip() float32 {
if x != nil {
return x.Slip
}
return 0
}
func (x *TrainDynamicConfig) GetSlide() int32 {
if x != nil {
return x.Slide
}
return 0
}
func (x *TrainDynamicConfig) GetStopSign() int32 {
if x != nil {
return x.StopSign
}
return 0
}
func (x *TrainDynamicConfig) GetRadarEnable() bool {
if x != nil {
return x.RadarEnable
}
return false
}
func (x *TrainDynamicConfig) GetRadarCheckSpeed() float32 {
if x != nil {
return x.RadarCheckSpeed
}
return 0
}
func (x *TrainDynamicConfig) GetRadarCheckTime() int32 {
if x != nil {
return x.RadarCheckTime
}
return 0
}
// vobc发过来的列车信息
type TrainVobcState struct {
state protoimpl.MessageState
@ -1229,7 +1421,7 @@ type TrainVobcState struct {
func (x *TrainVobcState) Reset() {
*x = TrainVobcState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[9]
mi := &file_device_state_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1242,7 +1434,7 @@ func (x *TrainVobcState) String() string {
func (*TrainVobcState) ProtoMessage() {}
func (x *TrainVobcState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[9]
mi := &file_device_state_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1255,7 +1447,7 @@ func (x *TrainVobcState) ProtoReflect() protoreflect.Message {
// Deprecated: Use TrainVobcState.ProtoReflect.Descriptor instead.
func (*TrainVobcState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{9}
return file_device_state_proto_rawDescGZIP(), []int{10}
}
func (x *TrainVobcState) GetLifeSignal() int32 {
@ -1576,7 +1768,7 @@ type TrainMapState struct {
func (x *TrainMapState) Reset() {
*x = TrainMapState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[10]
mi := &file_device_state_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1589,7 +1781,7 @@ func (x *TrainMapState) String() string {
func (*TrainMapState) ProtoMessage() {}
func (x *TrainMapState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[10]
mi := &file_device_state_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1602,7 +1794,7 @@ func (x *TrainMapState) ProtoReflect() protoreflect.Message {
// Deprecated: Use TrainMapState.ProtoReflect.Descriptor instead.
func (*TrainMapState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{10}
return file_device_state_proto_rawDescGZIP(), []int{11}
}
func (x *TrainMapState) GetId() string {
@ -2049,7 +2241,7 @@ type ReplyState struct {
func (x *ReplyState) Reset() {
*x = ReplyState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[11]
mi := &file_device_state_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2062,7 +2254,7 @@ func (x *ReplyState) String() string {
func (*ReplyState) ProtoMessage() {}
func (x *ReplyState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[11]
mi := &file_device_state_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2075,7 +2267,7 @@ func (x *ReplyState) ProtoReflect() protoreflect.Message {
// Deprecated: Use ReplyState.ProtoReflect.Descriptor instead.
func (*ReplyState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{11}
return file_device_state_proto_rawDescGZIP(), []int{12}
}
func (x *ReplyState) GetId() uint32 {
@ -2113,7 +2305,7 @@ type ButtonState struct {
func (x *ButtonState) Reset() {
*x = ButtonState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[12]
mi := &file_device_state_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2126,7 +2318,7 @@ func (x *ButtonState) String() string {
func (*ButtonState) ProtoMessage() {}
func (x *ButtonState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[12]
mi := &file_device_state_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2139,7 +2331,7 @@ func (x *ButtonState) ProtoReflect() protoreflect.Message {
// Deprecated: Use ButtonState.ProtoReflect.Descriptor instead.
func (*ButtonState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{12}
return file_device_state_proto_rawDescGZIP(), []int{13}
}
func (x *ButtonState) GetId() uint32 {
@ -2176,7 +2368,7 @@ type AlarmState struct {
func (x *AlarmState) Reset() {
*x = AlarmState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[13]
mi := &file_device_state_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2189,7 +2381,7 @@ func (x *AlarmState) String() string {
func (*AlarmState) ProtoMessage() {}
func (x *AlarmState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[13]
mi := &file_device_state_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2202,7 +2394,7 @@ func (x *AlarmState) ProtoReflect() protoreflect.Message {
// Deprecated: Use AlarmState.ProtoReflect.Descriptor instead.
func (*AlarmState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{13}
return file_device_state_proto_rawDescGZIP(), []int{14}
}
func (x *AlarmState) GetId() uint32 {
@ -2232,7 +2424,7 @@ type LightState struct {
func (x *LightState) Reset() {
*x = LightState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[14]
mi := &file_device_state_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2245,7 +2437,7 @@ func (x *LightState) String() string {
func (*LightState) ProtoMessage() {}
func (x *LightState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[14]
mi := &file_device_state_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2258,7 +2450,7 @@ func (x *LightState) ProtoReflect() protoreflect.Message {
// Deprecated: Use LightState.ProtoReflect.Descriptor instead.
func (*LightState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{14}
return file_device_state_proto_rawDescGZIP(), []int{15}
}
func (x *LightState) GetId() uint32 {
@ -2289,7 +2481,7 @@ type PsdState struct {
func (x *PsdState) Reset() {
*x = PsdState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[15]
mi := &file_device_state_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2302,7 +2494,7 @@ func (x *PsdState) String() string {
func (*PsdState) ProtoMessage() {}
func (x *PsdState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[15]
mi := &file_device_state_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2315,7 +2507,7 @@ func (x *PsdState) ProtoReflect() protoreflect.Message {
// Deprecated: Use PsdState.ProtoReflect.Descriptor instead.
func (*PsdState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{15}
return file_device_state_proto_rawDescGZIP(), []int{16}
}
func (x *PsdState) GetId() uint32 {
@ -2354,7 +2546,7 @@ type AsdState struct {
func (x *AsdState) Reset() {
*x = AsdState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[16]
mi := &file_device_state_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2367,7 +2559,7 @@ func (x *AsdState) String() string {
func (*AsdState) ProtoMessage() {}
func (x *AsdState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[16]
mi := &file_device_state_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2380,7 +2572,7 @@ func (x *AsdState) ProtoReflect() protoreflect.Message {
// Deprecated: Use AsdState.ProtoReflect.Descriptor instead.
func (*AsdState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{16}
return file_device_state_proto_rawDescGZIP(), []int{17}
}
func (x *AsdState) GetCode() int32 {
@ -2424,7 +2616,7 @@ type KeyState struct {
func (x *KeyState) Reset() {
*x = KeyState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[17]
mi := &file_device_state_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2437,7 +2629,7 @@ func (x *KeyState) String() string {
func (*KeyState) ProtoMessage() {}
func (x *KeyState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[17]
mi := &file_device_state_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2450,7 +2642,7 @@ func (x *KeyState) ProtoReflect() protoreflect.Message {
// Deprecated: Use KeyState.ProtoReflect.Descriptor instead.
func (*KeyState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{17}
return file_device_state_proto_rawDescGZIP(), []int{18}
}
func (x *KeyState) GetId() uint32 {
@ -2480,7 +2672,7 @@ type MkxJState struct {
func (x *MkxJState) Reset() {
*x = MkxJState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[18]
mi := &file_device_state_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2493,7 +2685,7 @@ func (x *MkxJState) String() string {
func (*MkxJState) ProtoMessage() {}
func (x *MkxJState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[18]
mi := &file_device_state_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2506,7 +2698,7 @@ func (x *MkxJState) ProtoReflect() protoreflect.Message {
// Deprecated: Use MkxJState.ProtoReflect.Descriptor instead.
func (*MkxJState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{18}
return file_device_state_proto_rawDescGZIP(), []int{19}
}
func (x *MkxJState) GetCode() string {
@ -2529,15 +2721,15 @@ type BaliseState struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Km *graphicData.KilometerSystem `protobuf:"bytes,2,opt,name=km,proto3" json:"km,omitempty"` //当前公里标
Telegram []byte `protobuf:"bytes,3,opt,name=telegram,proto3" json:"telegram,omitempty"` //当前报文
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Km *data_proto.KilometerSystem `protobuf:"bytes,2,opt,name=km,proto3" json:"km,omitempty"` //当前公里标
Telegram string `protobuf:"bytes,3,opt,name=telegram,proto3" json:"telegram,omitempty"` //当前报文16进制字符串
}
func (x *BaliseState) Reset() {
*x = BaliseState{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[19]
mi := &file_device_state_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2550,7 +2742,7 @@ func (x *BaliseState) String() string {
func (*BaliseState) ProtoMessage() {}
func (x *BaliseState) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[19]
mi := &file_device_state_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2563,7 +2755,7 @@ func (x *BaliseState) ProtoReflect() protoreflect.Message {
// Deprecated: Use BaliseState.ProtoReflect.Descriptor instead.
func (*BaliseState) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{19}
return file_device_state_proto_rawDescGZIP(), []int{20}
}
func (x *BaliseState) GetId() uint32 {
@ -2573,18 +2765,18 @@ func (x *BaliseState) GetId() uint32 {
return 0
}
func (x *BaliseState) GetKm() *graphicData.KilometerSystem {
func (x *BaliseState) GetKm() *data_proto.KilometerSystem {
if x != nil {
return x.Km
}
return nil
}
func (x *BaliseState) GetTelegram() []byte {
func (x *BaliseState) GetTelegram() string {
if x != nil {
return x.Telegram
}
return nil
return ""
}
// 仿真运行时状态变化量,当前时刻与上一时刻比较得到
@ -2608,7 +2800,7 @@ type VariationStatus struct {
func (x *VariationStatus) Reset() {
*x = VariationStatus{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[20]
mi := &file_device_state_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2621,7 +2813,7 @@ func (x *VariationStatus) String() string {
func (*VariationStatus) ProtoMessage() {}
func (x *VariationStatus) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[20]
mi := &file_device_state_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2634,7 +2826,7 @@ func (x *VariationStatus) ProtoReflect() protoreflect.Message {
// Deprecated: Use VariationStatus.ProtoReflect.Descriptor instead.
func (*VariationStatus) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{20}
return file_device_state_proto_rawDescGZIP(), []int{21}
}
func (x *VariationStatus) GetUpdatedTrain() []*TrainMapState {
@ -2707,7 +2899,7 @@ type AllDevicesStatus struct {
func (x *AllDevicesStatus) Reset() {
*x = AllDevicesStatus{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[21]
mi := &file_device_state_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2720,7 +2912,7 @@ func (x *AllDevicesStatus) String() string {
func (*AllDevicesStatus) ProtoMessage() {}
func (x *AllDevicesStatus) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[21]
mi := &file_device_state_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2733,7 +2925,7 @@ func (x *AllDevicesStatus) ProtoReflect() protoreflect.Message {
// Deprecated: Use AllDevicesStatus.ProtoReflect.Descriptor instead.
func (*AllDevicesStatus) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{21}
return file_device_state_proto_rawDescGZIP(), []int{22}
}
func (x *AllDevicesStatus) GetTrainState() []*TrainMapState {
@ -2838,7 +3030,7 @@ type PushedDevicesStatus struct {
func (x *PushedDevicesStatus) Reset() {
*x = PushedDevicesStatus{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[22]
mi := &file_device_state_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2851,7 +3043,7 @@ func (x *PushedDevicesStatus) String() string {
func (*PushedDevicesStatus) ProtoMessage() {}
func (x *PushedDevicesStatus) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[22]
mi := &file_device_state_proto_msgTypes[23]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2864,7 +3056,7 @@ func (x *PushedDevicesStatus) ProtoReflect() protoreflect.Message {
// Deprecated: Use PushedDevicesStatus.ProtoReflect.Descriptor instead.
func (*PushedDevicesStatus) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{22}
return file_device_state_proto_rawDescGZIP(), []int{23}
}
func (x *PushedDevicesStatus) GetAll() bool {
@ -2902,7 +3094,7 @@ type SimulationStatus struct {
func (x *SimulationStatus) Reset() {
*x = SimulationStatus{}
if protoimpl.UnsafeEnabled {
mi := &file_device_state_proto_msgTypes[23]
mi := &file_device_state_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -2915,7 +3107,7 @@ func (x *SimulationStatus) String() string {
func (*SimulationStatus) ProtoMessage() {}
func (x *SimulationStatus) ProtoReflect() protoreflect.Message {
mi := &file_device_state_proto_msgTypes[23]
mi := &file_device_state_proto_msgTypes[24]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -2928,7 +3120,7 @@ func (x *SimulationStatus) ProtoReflect() protoreflect.Message {
// Deprecated: Use SimulationStatus.ProtoReflect.Descriptor instead.
func (*SimulationStatus) Descriptor() ([]byte, []int) {
return file_device_state_proto_rawDescGZIP(), []int{23}
return file_device_state_proto_rawDescGZIP(), []int{24}
}
func (x *SimulationStatus) GetSimulationId() string {
@ -3045,7 +3237,7 @@ var file_device_state_proto_rawDesc = []byte{
0x6c, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x77, 0x68,
0x65, 0x65, 0x6c, 0x44, 0x69, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0d, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x44, 0x69, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72,
0x22, 0xcd, 0x06, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69,
0x22, 0x98, 0x07, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69,
0x63, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62,
0x65, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x65, 0x61, 0x72, 0x74,
0x62, 0x65, 0x61, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x4c, 0x69, 0x6e, 0x6b,
@ -3098,6 +3290,53 @@ var file_device_state_proto_rawDesc = []byte{
0x49, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x75, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c,
0x61, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x01,
0x28, 0x02, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x49, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73,
0x74, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69,
0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x12, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79,
0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xa2, 0x05, 0x0a, 0x12,
0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x04, 0x6d, 0x61, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65,
0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x41, 0x18, 0x02,
0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74,
0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x41, 0x12, 0x32, 0x0a, 0x14, 0x62, 0x61,
0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61,
0x6d, 0x42, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65,
0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x42, 0x12, 0x32,
0x0a, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x43, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x62, 0x61,
0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61,
0x6d, 0x43, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73,
0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x31, 0x18, 0x05, 0x20, 0x01,
0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61,
0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x31, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75,
0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72,
0x61, 0x6d, 0x52, 0x32, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76,
0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x52, 0x32, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73,
0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x33, 0x18, 0x07, 0x20, 0x01,
0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61,
0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x33, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75,
0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72,
0x61, 0x6d, 0x52, 0x34, 0x18, 0x08, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76,
0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x52, 0x34, 0x12, 0x2e, 0x0a, 0x12, 0x72, 0x65, 0x76, 0x6f, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x4d,
0x61, 0x73, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x12,
0x72, 0x65, 0x76, 0x6f, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x73, 0x73, 0x50, 0x61, 0x72,
0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6a, 0x75, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08,
0x52, 0x04, 0x6a, 0x75, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x69, 0x70, 0x18, 0x0b,
0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x73, 0x6c, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6c,
0x69, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x6c, 0x69, 0x64, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01,
0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x0b,
0x72, 0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28,
0x08, 0x52, 0x0b, 0x72, 0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x28,
0x0a, 0x0f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x70, 0x65, 0x65,
0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68,
0x65, 0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x61, 0x64, 0x61,
0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0e, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65,
0x22, 0x84, 0x08, 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x56, 0x6f, 0x62, 0x63, 0x53, 0x74,
0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x66, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61,
0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6c, 0x69, 0x66, 0x65, 0x53, 0x69, 0x67,
@ -3347,7 +3586,7 @@ var file_device_state_proto_rawDesc = []byte{
0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61,
0x2e, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
0x52, 0x02, 0x6b, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d,
0x22, 0xa1, 0x02, 0x0a, 0x0f, 0x56, 0x61, 0x72, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74,
0x61, 0x74, 0x75, 0x73, 0x12, 0x38, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54,
0x72, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x74, 0x61,
@ -3433,13 +3672,14 @@ var file_device_state_proto_rawDesc = []byte{
0x03, 0x2a, 0x37, 0x0a, 0x0b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65,
0x12, 0x07, 0x0a, 0x03, 0x41, 0x6e, 0x79, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x78, 0x6c,
0x65, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x10, 0x02, 0x12, 0x0a,
0x0a, 0x06, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x10, 0x03, 0x42, 0x51, 0x0a, 0x25, 0x63, 0x6c,
0x0a, 0x06, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x10, 0x03, 0x42, 0x67, 0x0a, 0x25, 0x63, 0x6c,
0x75, 0x62, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6a, 0x72, 0x74, 0x73,
0x73, 0x2e, 0x61, 0x74, 0x73, 0x2e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x73, 0x42, 0x10, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x16, 0x2e, 0x2f, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3b, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x2c, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63,
0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -3455,7 +3695,7 @@ func file_device_state_proto_rawDescGZIP() []byte {
}
var file_device_state_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_device_state_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
var file_device_state_proto_msgTypes = make([]protoimpl.MessageInfo, 25)
var file_device_state_proto_goTypes = []interface{}{
(SectionType)(0), // 0: state.SectionType
(Signal_Aspect)(0), // 1: state.Signal.Aspect
@ -3469,56 +3709,58 @@ var file_device_state_proto_goTypes = []interface{}{
(*StationState)(nil), // 9: state.StationState
(*TrainState)(nil), // 10: state.TrainState
(*TrainDynamicState)(nil), // 11: state.TrainDynamicState
(*TrainVobcState)(nil), // 12: state.TrainVobcState
(*TrainMapState)(nil), // 13: state.TrainMapState
(*ReplyState)(nil), // 14: state.ReplyState
(*ButtonState)(nil), // 15: state.ButtonState
(*AlarmState)(nil), // 16: state.AlarmState
(*LightState)(nil), // 17: state.LightState
(*PsdState)(nil), // 18: state.PsdState
(*AsdState)(nil), // 19: state.AsdState
(*KeyState)(nil), // 20: state.KeyState
(*MkxJState)(nil), // 21: state.MkxJState
(*BaliseState)(nil), // 22: state.BaliseState
(*VariationStatus)(nil), // 23: state.VariationStatus
(*AllDevicesStatus)(nil), // 24: state.AllDevicesStatus
(*PushedDevicesStatus)(nil), // 25: state.PushedDevicesStatus
(*SimulationStatus)(nil), // 26: state.SimulationStatus
(*graphicData.KilometerSystem)(nil), // 27: graphicData.KilometerSystem
(*TrainDynamicConfig)(nil), // 12: state.TrainDynamicConfig
(*TrainVobcState)(nil), // 13: state.TrainVobcState
(*TrainMapState)(nil), // 14: state.TrainMapState
(*ReplyState)(nil), // 15: state.ReplyState
(*ButtonState)(nil), // 16: state.ButtonState
(*AlarmState)(nil), // 17: state.AlarmState
(*LightState)(nil), // 18: state.LightState
(*PsdState)(nil), // 19: state.PsdState
(*AsdState)(nil), // 20: state.AsdState
(*KeyState)(nil), // 21: state.KeyState
(*MkxJState)(nil), // 22: state.MkxJState
(*BaliseState)(nil), // 23: state.BaliseState
(*VariationStatus)(nil), // 24: state.VariationStatus
(*AllDevicesStatus)(nil), // 25: state.AllDevicesStatus
(*PushedDevicesStatus)(nil), // 26: state.PushedDevicesStatus
(*SimulationStatus)(nil), // 27: state.SimulationStatus
(*data_proto.KilometerSystem)(nil), // 28: graphicData.KilometerSystem
}
var file_device_state_proto_depIdxs = []int32{
1, // 0: state.SignalState.aspect:type_name -> state.Signal.Aspect
14, // 1: state.PlatformState.spksState:type_name -> state.ReplyState
21, // 2: state.PlatformState.mkxJState:type_name -> state.MkxJState
15, // 1: state.PlatformState.spksState:type_name -> state.ReplyState
22, // 2: state.PlatformState.mkxJState:type_name -> state.MkxJState
11, // 3: state.TrainState.dynamicState:type_name -> state.TrainDynamicState
12, // 4: state.TrainState.vobcState:type_name -> state.TrainVobcState
19, // 5: state.PsdState.asdStates:type_name -> state.AsdState
14, // 6: state.MkxJState.replyState:type_name -> state.ReplyState
27, // 7: state.BaliseState.km:type_name -> graphicData.KilometerSystem
13, // 8: state.VariationStatus.updatedTrain:type_name -> state.TrainMapState
5, // 9: state.VariationStatus.updatedSwitch:type_name -> state.SwitchState
4, // 10: state.VariationStatus.updatedSection:type_name -> state.SectionState
14, // 11: state.VariationStatus.updatedReply:type_name -> state.ReplyState
13, // 12: state.AllDevicesStatus.trainState:type_name -> state.TrainMapState
5, // 13: state.AllDevicesStatus.switchState:type_name -> state.SwitchState
4, // 14: state.AllDevicesStatus.sectionState:type_name -> state.SectionState
14, // 15: state.AllDevicesStatus.replyState:type_name -> state.ReplyState
6, // 16: state.AllDevicesStatus.signalState:type_name -> state.SignalState
15, // 17: state.AllDevicesStatus.buttonState:type_name -> state.ButtonState
16, // 18: state.AllDevicesStatus.AlarmState:type_name -> state.AlarmState
17, // 19: state.AllDevicesStatus.LightState:type_name -> state.LightState
18, // 20: state.AllDevicesStatus.psdState:type_name -> state.PsdState
20, // 21: state.AllDevicesStatus.KeyState:type_name -> state.KeyState
8, // 22: state.AllDevicesStatus.platformState:type_name -> state.PlatformState
22, // 23: state.AllDevicesStatus.baliseState:type_name -> state.BaliseState
23, // 24: state.PushedDevicesStatus.varStatus:type_name -> state.VariationStatus
24, // 25: state.PushedDevicesStatus.allStatus:type_name -> state.AllDevicesStatus
2, // 26: state.SimulationStatus.state:type_name -> state.SimulationStatus.SimulationState
27, // [27:27] is the sub-list for method output_type
27, // [27:27] is the sub-list for method input_type
27, // [27:27] is the sub-list for extension type_name
27, // [27:27] is the sub-list for extension extendee
0, // [0:27] is the sub-list for field type_name
13, // 4: state.TrainState.vobcState:type_name -> state.TrainVobcState
12, // 5: state.TrainDynamicState.trainDynamicConfig:type_name -> state.TrainDynamicConfig
20, // 6: state.PsdState.asdStates:type_name -> state.AsdState
15, // 7: state.MkxJState.replyState:type_name -> state.ReplyState
28, // 8: state.BaliseState.km:type_name -> graphicData.KilometerSystem
14, // 9: state.VariationStatus.updatedTrain:type_name -> state.TrainMapState
5, // 10: state.VariationStatus.updatedSwitch:type_name -> state.SwitchState
4, // 11: state.VariationStatus.updatedSection:type_name -> state.SectionState
15, // 12: state.VariationStatus.updatedReply:type_name -> state.ReplyState
14, // 13: state.AllDevicesStatus.trainState:type_name -> state.TrainMapState
5, // 14: state.AllDevicesStatus.switchState:type_name -> state.SwitchState
4, // 15: state.AllDevicesStatus.sectionState:type_name -> state.SectionState
15, // 16: state.AllDevicesStatus.replyState:type_name -> state.ReplyState
6, // 17: state.AllDevicesStatus.signalState:type_name -> state.SignalState
16, // 18: state.AllDevicesStatus.buttonState:type_name -> state.ButtonState
17, // 19: state.AllDevicesStatus.AlarmState:type_name -> state.AlarmState
18, // 20: state.AllDevicesStatus.LightState:type_name -> state.LightState
19, // 21: state.AllDevicesStatus.psdState:type_name -> state.PsdState
21, // 22: state.AllDevicesStatus.KeyState:type_name -> state.KeyState
8, // 23: state.AllDevicesStatus.platformState:type_name -> state.PlatformState
23, // 24: state.AllDevicesStatus.baliseState:type_name -> state.BaliseState
24, // 25: state.PushedDevicesStatus.varStatus:type_name -> state.VariationStatus
25, // 26: state.PushedDevicesStatus.allStatus:type_name -> state.AllDevicesStatus
2, // 27: state.SimulationStatus.state:type_name -> state.SimulationStatus.SimulationState
28, // [28:28] is the sub-list for method output_type
28, // [28:28] is the sub-list for method input_type
28, // [28:28] is the sub-list for extension type_name
28, // [28:28] is the sub-list for extension extendee
0, // [0:28] is the sub-list for field type_name
}
func init() { file_device_state_proto_init() }
@ -3636,7 +3878,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainVobcState); i {
switch v := v.(*TrainDynamicConfig); i {
case 0:
return &v.state
case 1:
@ -3648,7 +3890,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainMapState); i {
switch v := v.(*TrainVobcState); i {
case 0:
return &v.state
case 1:
@ -3660,7 +3902,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ReplyState); i {
switch v := v.(*TrainMapState); i {
case 0:
return &v.state
case 1:
@ -3672,7 +3914,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ButtonState); i {
switch v := v.(*ReplyState); i {
case 0:
return &v.state
case 1:
@ -3684,7 +3926,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AlarmState); i {
switch v := v.(*ButtonState); i {
case 0:
return &v.state
case 1:
@ -3696,7 +3938,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LightState); i {
switch v := v.(*AlarmState); i {
case 0:
return &v.state
case 1:
@ -3708,7 +3950,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PsdState); i {
switch v := v.(*LightState); i {
case 0:
return &v.state
case 1:
@ -3720,7 +3962,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AsdState); i {
switch v := v.(*PsdState); i {
case 0:
return &v.state
case 1:
@ -3732,7 +3974,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KeyState); i {
switch v := v.(*AsdState); i {
case 0:
return &v.state
case 1:
@ -3744,7 +3986,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MkxJState); i {
switch v := v.(*KeyState); i {
case 0:
return &v.state
case 1:
@ -3756,7 +3998,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BaliseState); i {
switch v := v.(*MkxJState); i {
case 0:
return &v.state
case 1:
@ -3768,7 +4010,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VariationStatus); i {
switch v := v.(*BaliseState); i {
case 0:
return &v.state
case 1:
@ -3780,7 +4022,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AllDevicesStatus); i {
switch v := v.(*VariationStatus); i {
case 0:
return &v.state
case 1:
@ -3792,7 +4034,7 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushedDevicesStatus); i {
switch v := v.(*AllDevicesStatus); i {
case 0:
return &v.state
case 1:
@ -3804,6 +4046,18 @@ func file_device_state_proto_init() {
}
}
file_device_state_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushedDevicesStatus); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_device_state_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SimulationStatus); i {
case 0:
return &v.state
@ -3822,7 +4076,7 @@ func file_device_state_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_device_state_proto_rawDesc,
NumEnums: 3,
NumMessages: 24,
NumMessages: 25,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -2,7 +2,7 @@ package dto
import (
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/dto/data_proto"
)
type PageTrainInfoReqDto struct {
@ -36,7 +36,7 @@ func ConvertToTrainDto(trailInfos []*PublishedDto) []*TrainInfoDto {
}
func ConvertDtoFromTrain(t *PublishedDto) *TrainInfoDto {
message := &graphicData.Train{}
message := &data_proto.Train{}
proto.Unmarshal(t.Proto, message)
return &TrainInfoDto{
Id: t.ID,

View File

@ -61,6 +61,7 @@ cloud.google.com/go/gkebackup v1.3.4/go.mod h1:gLVlbM8h/nHIs09ns1qx3q3eaXcGSELgN
cloud.google.com/go/gkeconnect v0.8.4/go.mod h1:84hZz4UMlDCKl8ifVW8layK4WHlMAFeq8vbzjU0yJkw=
cloud.google.com/go/gkehub v0.14.4/go.mod h1:Xispfu2MqnnFt8rV/2/3o73SK1snL8s9dYJ9G2oQMfc=
cloud.google.com/go/gkemulticloud v1.0.3/go.mod h1:7NpJBN94U6DY1xHIbsDqB2+TFZUfjLUKLjUX8NGLor0=
cloud.google.com/go/grafeas v0.3.0/go.mod h1:P7hgN24EyONOTMyeJH6DxG4zD7fwiYa5Q6GUgyFSOU8=
cloud.google.com/go/gsuiteaddons v1.6.4/go.mod h1:rxtstw7Fx22uLOXBpsvb9DUbC+fiXs7rF4U29KHM/pE=
cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU=
cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE=
@ -127,6 +128,8 @@ cloud.google.com/go/vpcaccess v1.7.4/go.mod h1:lA0KTvhtEOb/VOdnH/gwPuOzGgM+CWsmG
cloud.google.com/go/webrisk v1.9.4/go.mod h1:w7m4Ib4C+OseSr2GL66m0zMBywdrVNTDKsdEsfMl7X0=
cloud.google.com/go/websecurityscanner v1.6.4/go.mod h1:mUiyMQ+dGpPPRkHgknIZeCzSHJ45+fY4F52nZFDHm2o=
cloud.google.com/go/workflows v1.12.3/go.mod h1:fmOUeeqEwPzIU81foMjTRQIdwQHADi/vEr1cx9R1m5g=
github.com/ClickHouse/ch-go v0.48.0/go.mod h1:KBY72ltlOlHelc4Jn4hlReP8Caek8d6RG4ZkoPsWxzc=
github.com/ClickHouse/clickhouse-go/v2 v2.3.0/go.mod h1:f2kb1LPopJdIyt0Y0vxNk9aiQCyhCmeVcyvOOaPCT4Q=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
@ -136,7 +139,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
@ -160,10 +162,6 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/ebitengine/purego v0.1.0/go.mod h1:Eh8I3yvknDYZeCuXH9kRNaPuHEwvXDCk378o9xszmHg=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g=
@ -173,7 +171,6 @@ github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
@ -187,8 +184,6 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4er
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY=
@ -202,11 +197,7 @@ github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
github.com/hajimehoshi/ebiten/v2 v2.4.13/go.mod h1:BZcqCU4XHmScUi+lsKexocWcf4offMFwfp8dVGIB/G4=
github.com/hajimehoshi/file2byteslice v1.0.0/go.mod h1:CqqAHp7Dk/AqQiwuhV1yT2334qbA/tFWQW0MD2dGqUE=
github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
@ -220,7 +211,6 @@ github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
@ -229,13 +219,10 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc=
github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0=
github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/jezek/xgb v1.0.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
@ -253,8 +240,6 @@ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY=
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
@ -274,24 +259,18 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sagikazarmark/crypt v0.17.0/go.mod h1:SMtHTvdmsZMuY/bpZoqokSoChIrcJ/epOxZN58PbZDg=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@ -299,18 +278,13 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI=
go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U=
go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA=
go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ=
go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
@ -325,9 +299,6 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/image v0.1.0/go.mod h1:iyPr49SD/G/TBxYVB/9RRtGUT5eNbo2u4NamWeQcD5c=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20221012134814-c746ac228303/go.mod h1:M32cGdzp91A8Ex9qQtyZinr19EYxzkFqDjW2oyHzTDQ=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -418,4 +389,3 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=

View File

@ -2,12 +2,12 @@ package message_server
import (
"fmt"
"joylink.club/bj-rtsts-server/dto/data_proto"
"time"
"joylink.club/bj-rtsts-server/dto/state_proto"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/mqtt"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
@ -16,7 +16,7 @@ import (
// 综合后备盘IBP消息服务
func NewIBPMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
mapData := memory.QueryGiData[*graphicData.RtssGraphicStorage](mapId)
mapData := memory.QueryGiData[*data_proto.RtssGraphicStorage](mapId)
return ms_api.NewScheduleTask(fmt.Sprintf("地图[%d]综合后备盘IBP", mapId), func() error {
for _, station := range mapData.Stations {
sid := memory.GetMapElementId(station.Common)
@ -30,13 +30,13 @@ func NewIBPMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
}, 200*time.Millisecond)
}
func collectStationIbpState(mapId int32, world ecs.World, station *graphicData.Station) (*state.PushedDevicesStatus, error) {
func collectStationIbpState(mapId int32, world ecs.World, station *data_proto.Station) (*state_proto.PushedDevicesStatus, error) {
if station.RefIbpMapCode == "" {
return nil, nil
}
sid := memory.GetMapElementId(station.Common)
stationUid := memory.QueryUidByMidAndComId(mapId, sid, &graphicData.Station{})
ibpMapId, ibpStorage := memory.QueryGiDataByName[*graphicData.IBPGraphicStorage](station.RefIbpMapCode)
stationUid := memory.QueryUidByMidAndComId(mapId, sid, &data_proto.Station{})
ibpMapId, ibpStorage := memory.QueryGiDataByName[*data_proto.IBPGraphicStorage](station.RefIbpMapCode)
ibpUidsMap := memory.QueryUidStructure[*memory.IBPUidStructure](ibpMapId)
buttonStates, err := collectIBPButtonState(world, stationUid, ibpUidsMap, ibpStorage.IbpButtons)
if err != nil {
@ -54,9 +54,9 @@ func collectStationIbpState(mapId int32, world ecs.World, station *graphicData.S
if err != nil {
return nil, err
}
return &state.PushedDevicesStatus{
return &state_proto.PushedDevicesStatus{
All: true,
AllStatus: &state.AllDevicesStatus{
AllStatus: &state_proto.AllDevicesStatus{
ButtonState: buttonStates,
AlarmState: alarmStates,
LightState: lightStates,
@ -66,8 +66,8 @@ func collectStationIbpState(mapId int32, world ecs.World, station *graphicData.S
}
// 收集IBP按钮状态
func collectIBPButtonState(world ecs.World, stationUid string, uidsMap *memory.IBPUidStructure, ibpButtons []*graphicData.IBPButton) ([]*state.ButtonState, error) {
var states []*state.ButtonState
func collectIBPButtonState(world ecs.World, stationUid string, uidsMap *memory.IBPUidStructure, ibpButtons []*data_proto.IBPButton) ([]*state_proto.ButtonState, error) {
var states []*state_proto.ButtonState
for _, data := range ibpButtons { // 按钮
did := memory.GetMapElementId(data.Common)
uid := stationUid + "_" + uidsMap.IbpButtonIds[did].Uid
@ -83,8 +83,8 @@ func collectIBPButtonState(world ecs.World, stationUid string, uidsMap *memory.I
}
// 获取IBP盘按钮状态
func getIBPButtonState(id uint32, entry *ecs.Entry) *state.ButtonState {
status := &state.ButtonState{Id: id}
func getIBPButtonState(id uint32, entry *ecs.Entry) *state_proto.ButtonState {
status := &state_proto.ButtonState{Id: id}
bit := component.BitStateType.Get(entry)
status.Down = bit.Val
// 如果按钮包含灯
@ -96,8 +96,8 @@ func getIBPButtonState(id uint32, entry *ecs.Entry) *state.ButtonState {
}
// 收集报警器状态
func collectIBPAlarmState(world ecs.World, stationUid string, uidsMap *memory.IBPUidStructure, ibpAlarms []*graphicData.IbpAlarm) ([]*state.AlarmState, error) {
var states []*state.AlarmState
func collectIBPAlarmState(world ecs.World, stationUid string, uidsMap *memory.IBPUidStructure, ibpAlarms []*data_proto.IbpAlarm) ([]*state_proto.AlarmState, error) {
var states []*state_proto.AlarmState
for _, data := range ibpAlarms { // 报警器
did := memory.GetMapElementId(data.Common)
uid := stationUid + "_" + uidsMap.IbpAlarmIds[did].Uid
@ -106,15 +106,15 @@ func collectIBPAlarmState(world ecs.World, stationUid string, uidsMap *memory.IB
continue
}
if entry.HasComponent(component.AlarmTag) {
states = append(states, &state.AlarmState{Id: did, Active: component.BitStateType.Get(entry).Val})
states = append(states, &state_proto.AlarmState{Id: did, Active: component.BitStateType.Get(entry).Val})
}
}
return states, nil
}
// 收集灯状态信息
func collectIBPLightState(world ecs.World, stationUid string, uidsMap *memory.IBPUidStructure, ibpLights []*graphicData.IbpLight) ([]*state.LightState, error) {
var states []*state.LightState
func collectIBPLightState(world ecs.World, stationUid string, uidsMap *memory.IBPUidStructure, ibpLights []*data_proto.IbpLight) ([]*state_proto.LightState, error) {
var states []*state_proto.LightState
for _, data := range ibpLights { // 指示灯
did := memory.GetMapElementId(data.Common)
uid := stationUid + "_" + uidsMap.IbpLightIds[did].Uid
@ -123,15 +123,15 @@ func collectIBPLightState(world ecs.World, stationUid string, uidsMap *memory.IB
continue
}
if entry.HasComponent(component.LightTag) {
states = append(states, &state.LightState{Id: did, Active: component.BitStateType.Get(entry).Val})
states = append(states, &state_proto.LightState{Id: did, Active: component.BitStateType.Get(entry).Val})
}
}
return states, nil
}
// 收集钥匙状态
func collectIBPKeyState(world ecs.World, stationUid string, uidsMap *memory.IBPUidStructure, ibpKeys []*graphicData.IbpKey) ([]*state.KeyState, error) {
var states []*state.KeyState
func collectIBPKeyState(world ecs.World, stationUid string, uidsMap *memory.IBPUidStructure, ibpKeys []*data_proto.IbpKey) ([]*state_proto.KeyState, error) {
var states []*state_proto.KeyState
for _, data := range ibpKeys { // 钥匙
did := memory.GetMapElementId(data.Common)
uid := stationUid + "_" + uidsMap.IbpKeyIds[did].Uid
@ -140,7 +140,7 @@ func collectIBPKeyState(world ecs.World, stationUid string, uidsMap *memory.IBPU
continue
}
if entry.HasComponent(component.KeyTag) {
states = append(states, &state.KeyState{Id: did, Gear: component.GearStateType.Get(entry).Val})
states = append(states, &state_proto.KeyState{Id: did, Gear: component.GearStateType.Get(entry).Val})
}
}
return states, nil

View File

@ -2,12 +2,12 @@ package message_server
import (
"fmt"
"joylink.club/bj-rtsts-server/dto/state_proto"
"time"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/mqtt"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
@ -15,21 +15,21 @@ import (
)
func NewPSLMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
mapData := memory.QueryGiData[*graphicData.RtssGraphicStorage](mapId)
mapData := memory.QueryGiData[*data_proto.RtssGraphicStorage](mapId)
return ms_api.NewScheduleTask(fmt.Sprintf("地图[%d]综合门控箱按钮状态", mapId), func() error {
for _, box := range mapData.GateBoxs {
did := memory.GetMapElementId(box.Common)
state, err := collectGateBoxPSLState(vs.World, mapId, box)
data_proto, err := collectGateBoxPSLState(vs.World, mapId, box)
if err != nil {
return err
}
mqtt.GetMsgClient().PubPSLState(vs.SimulationId, mapId, did, state)
mqtt.GetMsgClient().PubPSLState(vs.SimulationId, mapId, did, data_proto)
}
return nil
}, 200*time.Millisecond)
}
func collectGateBoxPSLState(world ecs.World, mapId int32, box *graphicData.GatedBox) (*state.PushedDevicesStatus, error) {
func collectGateBoxPSLState(world ecs.World, mapId int32, box *data_proto.GatedBox) (*state_proto.PushedDevicesStatus, error) {
did := memory.GetMapElementId(box.Common)
uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
boxUid := uidStructure.GateBoxIds[did].Uid
@ -38,9 +38,9 @@ func collectGateBoxPSLState(world ecs.World, mapId int32, box *graphicData.Gated
return nil, fmt.Errorf("[id:%s]的门控箱实体找不到", boxUid)
}
mkx := component.MkxType.Get(mkxEntry)
var buttonStateArr []*state.ButtonState
var buttonStateArr []*state_proto.ButtonState
if ok {
_, pslStorage := memory.QueryGiDataByName[*graphicData.PslGraphicStorage](box.RefGatedBoxMapCode)
_, pslStorage := memory.QueryGiDataByName[*data_proto.PslGraphicStorage](box.RefGatedBoxMapCode)
btnUidMap := make(map[string]uint32, len(pslStorage.PslButtons))
for _, button := range pslStorage.PslButtons {
btnUidMap[boxUid+"_"+button.Code] = memory.GetMapElementId(button.Common)
@ -50,16 +50,16 @@ func collectGateBoxPSLState(world ecs.World, mapId int32, box *graphicData.Gated
if btn == nil {
continue
}
buttonStateArr = append(buttonStateArr, &state.ButtonState{
buttonStateArr = append(buttonStateArr, &state_proto.ButtonState{
Id: btnUidMap[component.UidType.Get(btn).Id],
Down: component.BitStateType.Get(btn).Val,
Active: component.BitStateType.Get(btn).Val,
})
}
}
return &state.PushedDevicesStatus{
return &state_proto.PushedDevicesStatus{
All: true,
AllStatus: &state.AllDevicesStatus{
AllStatus: &state_proto.AllDevicesStatus{
ButtonState: buttonStateArr,
},
}, nil

View File

@ -2,12 +2,12 @@ package message_server
import (
"fmt"
"joylink.club/bj-rtsts-server/dto/state_proto"
"time"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/mqtt"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
@ -20,9 +20,9 @@ func NewRccMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
if err != nil {
return err
}
ststes := &state.PushedDevicesStatus{
ststes := &state_proto.PushedDevicesStatus{
All: true,
AllStatus: &state.AllDevicesStatus{
AllStatus: &state_proto.AllDevicesStatus{
ReplyState: relayStates,
},
}
@ -32,10 +32,10 @@ func NewRccMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
}
// 获取仿真地图的继电器状态,前端推送
func collectRelayState(world ecs.World, mapId int32) ([]*state.ReplyState, error) {
func collectRelayState(world ecs.World, mapId int32) ([]*state_proto.ReplyState, error) {
// 获取本地图下的继电器信息
uidMap := memory.QueryMapUidMapByType(mapId, &graphicData.Relay{})
var replyStateArr []*state.ReplyState
uidMap := memory.QueryMapUidMapByType(mapId, &data_proto.Relay{})
var replyStateArr []*state_proto.ReplyState
for _, u := range uidMap {
entry, ok := entity.GetEntityByUid(world, u.Uid)
if !ok {
@ -45,7 +45,7 @@ func collectRelayState(world ecs.World, mapId int32) ([]*state.ReplyState, error
}
if entry.HasComponent(component.RelayTag) {
bit := component.BitStateType.Get(entry)
replyStateArr = append(replyStateArr, &state.ReplyState{Id: u.CommonId, Xh: bit.Val})
replyStateArr = append(replyStateArr, &state_proto.ReplyState{Id: u.CommonId, Xh: bit.Val})
}
}
return replyStateArr, nil

View File

@ -1,15 +1,16 @@
package message_server
import (
"encoding/hex"
"fmt"
"joylink.club/bj-rtsts-server/dto/state_proto"
"joylink.club/rtsssimulation/repository/model/proto"
"strings"
"time"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/mqtt"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
@ -52,9 +53,9 @@ func NewSfpMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
if err != nil {
return err
}
ststes := &state.PushedDevicesStatus{
ststes := &state_proto.PushedDevicesStatus{
All: true,
AllStatus: &state.AllDevicesStatus{
AllStatus: &state_proto.AllDevicesStatus{
TrainState: trainState,
SwitchState: turnoutStates,
SignalState: signalStates,
@ -71,26 +72,26 @@ func NewSfpMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
}
// 收集应答器状态
func collectBaliseStates(world ecs.World, mapId int32) ([]*state.BaliseState, error) {
func collectBaliseStates(world ecs.World, mapId int32) ([]*state_proto.BaliseState, error) {
uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
var transponderStates []*state.BaliseState
var transponderStates []*state_proto.BaliseState
for id, structure := range uidStructure.TransponderIds {
entry, ok := entity.GetEntityByUid(world, structure.Uid)
if ok {
baliseState := &state.BaliseState{
baliseState := &state_proto.BaliseState{
Id: id,
Telegram: component.BaliseStateType.Get(entry).ValidTelegram,
Telegram: hex.EncodeToString(component.BaliseStateType.Get(entry).ValidTelegram),
}
transponderStates = append(transponderStates, baliseState)
km := component.KmType.Get(entry)
baliseState.Km = &graphicData.KilometerSystem{
baliseState.Km = &data_proto.KilometerSystem{
Kilometer: km.Value,
CoordinateSystem: km.CoordinateSystem,
}
if km.Direction == proto.Direction_LEFT {
baliseState.Km.Direction = graphicData.KilometerSystem_LEFT
baliseState.Km.Direction = data_proto.KilometerSystem_LEFT
} else if km.Direction == proto.Direction_RIGHT {
baliseState.Km.Direction = graphicData.KilometerSystem_RIGHT
baliseState.Km.Direction = data_proto.KilometerSystem_RIGHT
}
}
}
@ -98,27 +99,27 @@ func collectBaliseStates(world ecs.World, mapId int32) ([]*state.BaliseState, er
}
// 收集屏蔽门状态
func collectPsdStates(world ecs.World, mapId int32) ([]*state.PsdState, error) {
func collectPsdStates(world ecs.World, mapId int32) ([]*state_proto.PsdState, error) {
uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
data := memory.QueryGiData[*graphicData.RtssGraphicStorage](mapId)
var psdStateArr []*state.PsdState
data := memory.QueryGiData[*data_proto.RtssGraphicStorage](mapId)
var psdStateArr []*state_proto.PsdState
for _, door := range data.ScreenDoors {
did := memory.GetMapElementId(door.Common)
uid := uidStructure.PsdIds[did].Uid
psdEntry, ok := entity.GetEntityByUid(world, uid)
if ok {
list := component.AsdListType.Get(psdEntry).List
asdStates := make([]*state.AsdState, len(list))
asdStates := make([]*state_proto.AsdState, len(list))
for i, asdEntry := range list {
asdState := component.AsdStateType.Get(asdEntry)
asdStates[i] = &state.AsdState{
asdStates[i] = &state_proto.AsdState{
Code: int32(i + 1),
Kmdw: asdState.Kmdw,
Gmdw: asdState.Gmdw,
Mgj: asdState.Mgj,
}
}
psdStateArr = append(psdStateArr, &state.PsdState{
psdStateArr = append(psdStateArr, &state_proto.PsdState{
Id: did,
AsdStates: asdStates,
Mgj: component.PsdStateType.Get(psdEntry).Close,
@ -129,9 +130,9 @@ func collectPsdStates(world ecs.World, mapId int32) ([]*state.PsdState, error) {
}
// 收集区段状态
func collectSectionStates(world ecs.World, mapId int32) ([]*state.SectionState, error) {
uidMap := memory.QueryMapUidMapByType(mapId, &graphicData.Section{})
var sectionArr []*state.SectionState
func collectSectionStates(world ecs.World, mapId int32) ([]*state_proto.SectionState, error) {
uidMap := memory.QueryMapUidMapByType(mapId, &data_proto.Section{})
var sectionArr []*state_proto.SectionState
for _, u := range uidMap {
s := handlerSectionState(world, u.Uid)
if s == nil {
@ -143,14 +144,14 @@ func collectSectionStates(world ecs.World, mapId int32) ([]*state.SectionState,
return sectionArr, nil
}
func handlerSectionState(w ecs.World, uid string) *state.SectionState {
func handlerSectionState(w ecs.World, uid string) *state_proto.SectionState {
entry, ok := entity.GetEntityByUid(w, uid)
if !ok {
//fmt.Printf("id=%s的信号机不存在", uid)
return nil
}
if entry.HasComponent(component.PhysicalSectionStateType) { //计轴区段
sectionState := &state.SectionState{}
sectionState := &state_proto.SectionState{}
axleState := component.PhysicalSectionStateType.Get(entry)
sectionState.Occupied = axleState.Occ
sectionState.AxleFault = entry.HasComponent(component.AxleSectionFaultTag)
@ -160,10 +161,10 @@ func handlerSectionState(w ecs.World, uid string) *state.SectionState {
}
// 收集车站按钮状态
func collectStationButtonStates(world ecs.World, mapId int32) ([]*state.ButtonState, error) {
func collectStationButtonStates(world ecs.World, mapId int32) ([]*state_proto.ButtonState, error) {
// 获取地图上的按钮状态
uidMap := memory.QueryMapUidMapByType(mapId, &graphicData.EsbButton{})
var btnStateArr []*state.ButtonState
uidMap := memory.QueryMapUidMapByType(mapId, &data_proto.EsbButton{})
var btnStateArr []*state_proto.ButtonState
for _, u := range uidMap {
entry, ok := entity.GetEntityByUid(world, u.Uid)
if !ok {
@ -171,16 +172,16 @@ func collectStationButtonStates(world ecs.World, mapId int32) ([]*state.ButtonSt
}
if entry.HasComponent(component.ButtonTag) { // 按钮
bit := component.BitStateType.Get(entry)
btnStateArr = append(btnStateArr, &state.ButtonState{Id: u.CommonId, Down: bit.Val})
btnStateArr = append(btnStateArr, &state_proto.ButtonState{Id: u.CommonId, Down: bit.Val})
}
}
return btnStateArr, nil
}
// 收集信号机状态
func collectSignalStates(world ecs.World, mapId int32) ([]*state.SignalState, error) {
uidMap := memory.QueryMapUidMapByType(mapId, &graphicData.Signal{})
var signalArr []*state.SignalState
func collectSignalStates(world ecs.World, mapId int32) ([]*state_proto.SignalState, error) {
uidMap := memory.QueryMapUidMapByType(mapId, &data_proto.Signal{})
var signalArr []*state_proto.SignalState
for _, u := range uidMap {
s, err := handlerSignalState(world, u.Uid)
if err != nil {
@ -192,7 +193,7 @@ func collectSignalStates(world ecs.World, mapId int32) ([]*state.SignalState, er
return signalArr, nil
}
func handlerSignalState(w ecs.World, uid string) (*state.SignalState, error) {
func handlerSignalState(w ecs.World, uid string) (*state_proto.SignalState, error) {
entry, ok := entity.GetEntityByUid(w, uid)
if !ok {
return nil, fmt.Errorf("信号机不存在: World id=%d, 信号机id=%s", w.Id(), uid)
@ -200,7 +201,7 @@ func handlerSignalState(w ecs.World, uid string) (*state.SignalState, error) {
if !entry.HasComponent(component.SignalLightsType) { //信号机灯列表
return nil, fmt.Errorf("信号机没有SignalLights组件: World id=%d, 信号机id=%s", w.Id(), uid)
}
signalState := &state.SignalState{}
signalState := &state_proto.SignalState{}
lights := component.SignalLightsType.Get(entry)
isL := false
isH := false
@ -222,37 +223,37 @@ func handlerSignalState(w ecs.World, uid string) (*state.SignalState, error) {
}
}
if isH && isU {
signalState.Aspect = state.Signal_HU
signalState.Aspect = state_proto.Signal_HU
} else {
switch {
case isL:
signalState.Aspect = state.Signal_L
signalState.Aspect = state_proto.Signal_L
case isH:
signalState.Aspect = state.Signal_H
signalState.Aspect = state_proto.Signal_H
case isU:
signalState.Aspect = state.Signal_U
signalState.Aspect = state_proto.Signal_U
case isB:
signalState.Aspect = state.Signal_B
signalState.Aspect = state_proto.Signal_B
case isA:
signalState.Aspect = state.Signal_A
signalState.Aspect = state_proto.Signal_A
}
}
return signalState, nil
}
// 收集列车状态
func collectTrainStates(vs *memory.VerifySimulation) ([]*state.TrainMapState, error) {
func collectTrainStates(vs *memory.VerifySimulation) ([]*state_proto.TrainMapState, error) {
allTrainMap := &vs.Memory.Status.TrainStateMap
var trainArr []*state.TrainMapState
var trainArr []*state_proto.TrainMapState
allTrainMap.Range(func(_, v any) bool {
trainArr = append(trainArr, convertTrainState(v.(*state.TrainState)))
trainArr = append(trainArr, convertTrainState(v.(*state_proto.TrainState)))
return true
})
return trainArr, nil
}
func convertTrainState(v *state.TrainState) *state.TrainMapState {
t := &state.TrainMapState{
func convertTrainState(v *state_proto.TrainState) *state_proto.TrainMapState {
t := &state_proto.TrainMapState{
Id: v.Id,
Up: v.Up,
InitialSpeed: v.Speed,
@ -321,10 +322,10 @@ func convertTrainState(v *state.TrainState) *state.TrainMapState {
}
// 收集道岔状态
func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state.SwitchState, error) {
uidMap := memory.QueryMapUidMapByType(mapId, &graphicData.Turnout{})
func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state_proto.SwitchState, error) {
uidMap := memory.QueryMapUidMapByType(mapId, &data_proto.Turnout{})
wd := entity.GetWorldData(sim.World)
var switchArr []*state.SwitchState
var switchArr []*state_proto.SwitchState
for _, u := range uidMap {
entry, ok := entity.GetEntityByUid(sim.World, u.Uid)
if !ok {
@ -334,7 +335,7 @@ func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state.S
return nil, fmt.Errorf("道岔没有TurnoutPosition组件: World id=%d,道岔id=%s", sim.World.Id(), u.Uid)
}
pos := component.TurnoutPositionType.Get(entry)
s := &state.SwitchState{
s := &state_proto.SwitchState{
Id: u.CommonId,
Normal: pos.Db,
Reverse: pos.Fb,
@ -396,9 +397,9 @@ func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state.S
}
// 收集站台状态
func collectPlatformStates(world ecs.World, mapId int32) ([]*state.PlatformState, error) {
var states []*state.PlatformState
mapData := memory.QueryGiData[*graphicData.RtssGraphicStorage](mapId)
func collectPlatformStates(world ecs.World, mapId int32) ([]*state_proto.PlatformState, error) {
var states []*state_proto.PlatformState
mapData := memory.QueryGiData[*data_proto.RtssGraphicStorage](mapId)
uidsMap := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
platformScreenDoorMap := wrapScreenDoorToPlatform(mapData)
for _, platform := range mapData.Platforms {
@ -415,7 +416,7 @@ func collectPlatformStates(world ecs.World, mapId int32) ([]*state.PlatformState
if !ok {
return nil, fmt.Errorf("车站实体不存在: World id=%d, uid=%s", world.Id(), uidInfo.Uid)
}
sta := &state.PlatformState{Id: pid}
sta := &state_proto.PlatformState{Id: pid}
isX := strings.Contains(platform.Code, "下行站台") //下行站台
if entry.HasComponent(component.EmpElectronicType) { // 紧急停车继电器
empElectronic := component.EmpElectronicType.Get(entry)
@ -427,13 +428,13 @@ func collectPlatformStates(world ecs.World, mapId int32) ([]*state.PlatformState
if entry.HasComponent(component.SpkElectronicType) { // SPKS继电器
spkElectronic := component.SpkElectronicType.Get(entry)
if isX {
sta.SpksState = append(sta.SpksState, &state.ReplyState{Code: "SPKSX旁路", Xh: getRelayXqVal(spkElectronic.SPKSXPLAJ)})
sta.SpksState = append(sta.SpksState, &state.ReplyState{Code: "SPKS1", Xh: getRelayXqVal(spkElectronic.SPKSX1J)})
sta.SpksState = append(sta.SpksState, &state.ReplyState{Code: "SPKS3", Xh: getRelayXqVal(spkElectronic.SPKSX3J)})
sta.SpksState = append(sta.SpksState, &state_proto.ReplyState{Code: "SPKSX旁路", Xh: getRelayXqVal(spkElectronic.SPKSXPLAJ)})
sta.SpksState = append(sta.SpksState, &state_proto.ReplyState{Code: "SPKS1", Xh: getRelayXqVal(spkElectronic.SPKSX1J)})
sta.SpksState = append(sta.SpksState, &state_proto.ReplyState{Code: "SPKS3", Xh: getRelayXqVal(spkElectronic.SPKSX3J)})
} else {
sta.SpksState = append(sta.SpksState, &state.ReplyState{Code: "SPKSS旁路", Xh: getRelayXqVal(spkElectronic.SPKSSPLAJ)})
sta.SpksState = append(sta.SpksState, &state.ReplyState{Code: "SPKS2", Xh: getRelayXqVal(spkElectronic.SPKSS2J)})
sta.SpksState = append(sta.SpksState, &state.ReplyState{Code: "SPKS4", Xh: getRelayXqVal(spkElectronic.SPKSS4J)})
sta.SpksState = append(sta.SpksState, &state_proto.ReplyState{Code: "SPKSS旁路", Xh: getRelayXqVal(spkElectronic.SPKSSPLAJ)})
sta.SpksState = append(sta.SpksState, &state_proto.ReplyState{Code: "SPKS2", Xh: getRelayXqVal(spkElectronic.SPKSS2J)})
sta.SpksState = append(sta.SpksState, &state_proto.ReplyState{Code: "SPKS4", Xh: getRelayXqVal(spkElectronic.SPKSS4J)})
}
}
psdId := platformScreenDoorMap[pid]
@ -448,15 +449,15 @@ func collectPlatformStates(world ecs.World, mapId int32) ([]*state.PlatformState
}
if psdEntry.HasComponent(component.PlatformMkxCircuitType) {
mkxCircuit := component.PlatformMkxCircuitType.Get(psdEntry)
mkxj := &state.MkxJState{Code: psdUid.Code}
mkxj := &state_proto.MkxJState{Code: psdUid.Code}
if mkxCircuit.PABJ != nil {
mkxj.ReplyState = append(mkxj.ReplyState, &state.ReplyState{Code: "站台确认继电器", Xh: getRelayXqVal(mkxCircuit.PABJ)})
mkxj.ReplyState = append(mkxj.ReplyState, &state_proto.ReplyState{Code: "站台确认继电器", Xh: getRelayXqVal(mkxCircuit.PABJ)})
}
if mkxCircuit.PCBJ != nil {
mkxj.ReplyState = append(mkxj.ReplyState, &state.ReplyState{Code: "站台关门继电器", Xh: getRelayXqVal(mkxCircuit.PCBJ)})
mkxj.ReplyState = append(mkxj.ReplyState, &state_proto.ReplyState{Code: "站台关门继电器", Xh: getRelayXqVal(mkxCircuit.PCBJ)})
}
if mkxCircuit.POBJ != nil {
mkxj.ReplyState = append(mkxj.ReplyState, &state.ReplyState{Code: "站台开门继电器", Xh: getRelayXqVal(mkxCircuit.POBJ)})
mkxj.ReplyState = append(mkxj.ReplyState, &state_proto.ReplyState{Code: "站台开门继电器", Xh: getRelayXqVal(mkxCircuit.POBJ)})
}
sta.MkxJState = mkxj
}
@ -468,7 +469,7 @@ func collectPlatformStates(world ecs.World, mapId int32) ([]*state.PlatformState
}
// 将屏蔽门关联到站台
func wrapScreenDoorToPlatform(mapData *graphicData.RtssGraphicStorage) map[uint32]uint32 {
func wrapScreenDoorToPlatform(mapData *data_proto.RtssGraphicStorage) map[uint32]uint32 {
platformMap := make(map[uint32]uint32, len(mapData.Platforms))
for _, s := range mapData.ScreenDoors {
platformMap[s.RefPlatformId] = memory.GetMapElementId(s.Common)

View File

@ -1,8 +1,8 @@
package message_server
import (
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/mqtt"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
@ -11,10 +11,10 @@ func Start(vs *memory.VerifySimulation) {
for _, mapId := range vs.MapIds {
t := memory.QueryGiType(mapId)
switch t {
case graphicData.PictureType_StationLayout: // 平面布置图
case data_proto.PictureType_StationLayout: // 平面布置图
// 添加车站关联的平面布置图、IBP、PSL信息
mqtt.GetMsgClient().PublishTask(vs.SimulationId, NewSfpMs(vs, mapId), NewIBPMs(vs, mapId), NewPSLMs(vs, mapId))
case graphicData.PictureType_RelayCabinetLayout: // 继电器柜
case data_proto.PictureType_RelayCabinetLayout: // 继电器柜
mqtt.GetMsgClient().PublishTask(vs.SimulationId, NewRccMs(vs, mapId))
}
}

View File

@ -2,10 +2,10 @@ package message_server
import (
"fmt"
"joylink.club/bj-rtsts-server/dto/state_proto"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/mqtt"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
"joylink.club/ecs"
)
@ -13,14 +13,14 @@ import (
func NewStateMs(vs *memory.VerifySimulation) ms_api.MsgTask {
return ms_api.NewMonitorTask(fmt.Sprintf("仿真[%s]状态", vs.SimulationId), func() {
ecs.WorldStateChangeEvent.Subscribe(vs.World, func(_ ecs.World, e ecs.WorldStateChange) {
s := &state.SimulationStatus{SimulationId: vs.SimulationId}
s := &state_proto.SimulationStatus{SimulationId: vs.SimulationId}
switch e.NewState {
case ecs.WorldClosed:
s.State = state.SimulationStatus_DESTROY
s.State = state_proto.SimulationStatus_DESTROY
case ecs.WorldError:
s.State = state.SimulationStatus_ERROR
s.State = state_proto.SimulationStatus_ERROR
case ecs.WorldPause:
s.State = state.SimulationStatus_PAUSE
s.State = state_proto.SimulationStatus_PAUSE
default:
return
}

View File

@ -9,8 +9,8 @@ import (
"github.com/sagikazarmark/slog-shim"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"joylink.club/bj-rtsts-server/dto/state_proto"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/ts/protos/state"
)
var mqttClient *MqttClient
@ -107,26 +107,26 @@ func (client *MqttClient) CloseTask(simulationId string) {
}
// 发送仿真状态数据
func (client *MqttClient) PubSimulationState(simulationId string, msg *state.SimulationStatus) error {
func (client *MqttClient) PubSimulationState(simulationId string, msg *state_proto.SimulationStatus) error {
return client.pub(GetStateTopic(simulationId), msg)
}
// 发送IBP状态数据
func (client *MqttClient) PubIBPState(simulationId string, mapId int32, stationId uint32, msg *state.PushedDevicesStatus) error {
func (client *MqttClient) PubIBPState(simulationId string, mapId int32, stationId uint32, msg *state_proto.PushedDevicesStatus) error {
return client.pub(GetIbpTopic(simulationId, mapId, stationId), msg)
}
// 发送PSL状态数据
func (client *MqttClient) PubPSLState(simulationId string, mapId int32, boxId uint32, msg *state.PushedDevicesStatus) error {
func (client *MqttClient) PubPSLState(simulationId string, mapId int32, boxId uint32, msg *state_proto.PushedDevicesStatus) error {
return client.pub(GetPslTopic(simulationId, mapId, boxId), msg)
}
// 发送继电器状态数据
func (client *MqttClient) PubRCCState(simulationId string, mapId int32, msg *state.PushedDevicesStatus) error {
func (client *MqttClient) PubRCCState(simulationId string, mapId int32, msg *state_proto.PushedDevicesStatus) error {
return client.pub(GetRccTopic(simulationId, mapId), msg)
}
// 发送站场图状态数据
func (client *MqttClient) PubSfpState(simulationId string, mapId int32, msg *state.PushedDevicesStatus) error {
func (client *MqttClient) PubSfpState(simulationId string, mapId int32, msg *state_proto.PushedDevicesStatus) error {
return client.pub(GetSfpTopic(simulationId, mapId), msg)
}

View File

@ -1,18 +1,21 @@
package main
import (
"bufio"
"fmt"
"io/fs"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
)
var (
basePath, _ = os.Getwd()
protoFolder = filepath.Join(basePath, "bj-rtss-message", "protos")
protocPath = filepath.Join(basePath, "bj-rtss-message", "protoc-23.1", "bin", "win64", "protoc")
basePath, _ = os.Getwd()
protoFolder = filepath.Join(basePath, "bj-rtss-message", "protos")
protocPath = filepath.Join(basePath, "bj-rtss-message", "protoc-23.1", "bin", "win64", "protoc")
modulePrefix = "joylink.club/bj-rtsts-server"
)
func main() {
@ -44,7 +47,34 @@ func getProtoFiles() []string {
// 编译proto文件为Go文件
func compileProto(protoFiles []string) error {
for _, fileName := range protoFiles {
cmd := exec.Command(protocPath, "-I="+protoFolder, "--go_out=./", fileName)
file, err := os.Open(fileName)
if err != nil {
return err
}
scanner := bufio.NewScanner(file)
var outPath string
for scanner.Scan() {
text := scanner.Text()
if !strings.HasPrefix(text, "option go_package") {
continue
}
start := strings.Index(text, modulePrefix)
if start < 0 {
break
}
start += len(modulePrefix)
dir := "." + text[start:len(text)-2]
err := os.MkdirAll(dir, fs.ModeDir)
if err != nil {
panic(fmt.Sprintf("创建目录 %s 失败:%v", dir, err))
}
outPath = "paths=source_relative:" + dir
break
}
if outPath == "" {
outPath = "./"
}
cmd := exec.Command(protocPath, "-I="+protoFolder, "--go_out="+outPath, fileName)
fmt.Println(cmd.String())
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

@ -1 +1 @@
Subproject commit ef48c7ba0b65a11c599f1e6032f383d6a596e6f4
Subproject commit 655a0712af53b18d1eeb73eee309af12b2142b5a

View File

@ -8,11 +8,11 @@ import (
"joylink.club/bj-rtsts-server/db/dbquery"
"joylink.club/bj-rtsts-server/db/model"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
)
var trainDataType = int32(graphicData.PictureType_TrainData)
var trainDataType = int32(data_proto.PictureType_TrainData)
// 查询列车信息列表
func PageTrainInfoByPublished(query *dto.PageTrainInfoReqDto) *dto.PageDto {
@ -66,8 +66,8 @@ func CreateTrain(td *dto.TrainInfoDto, user *model.User) bool {
// 转成列车proto
func convertTrainProto(t *dto.TrainInfoDto) []byte {
message := &graphicData.Train{
TrainModel: graphicData.Train_TrainModel(t.TrainModel),
message := &data_proto.Train{
TrainModel: data_proto.Train_TrainModel(t.TrainModel),
CarriageLength: t.CarriageLength,
TotalLength: t.TotalLength,
MinDiameter: t.MinDiameter,

View File

@ -30,7 +30,8 @@ type Dynamics interface {
RequestAddTrain(info *message.InitTrainInfo) error
// 请求移除列车
RequestRemoveTrain(req *message.RemoveTrainReq) error
//请求变更列车参数
TrainOperationConfig(req *message.TrainOperationConfig) error
// 启动动力学消息功能
Start(manager DynamicsMessageManager) error
// 停止动力学消息功能
@ -167,6 +168,25 @@ func (d *dynamics) RequestRemoveTrain(req *message.RemoveTrainReq) error {
return nil
}
// 动力学数据设置
func (d *dynamics) TrainOperationConfig(req *message.TrainOperationConfig) error {
if !d.runConfig.Open {
return nil
}
data, _ := json.Marshal(req)
url := d.buildUrl("/api/config")
resp, err := d.httpClient.Post(url, "application/json", bytes.NewBuffer(data))
defer resp.Body.Close()
if err != nil {
return fmt.Errorf("动力学移除列车请求异常: %v", err)
}
var bodyData []byte
_, err = resp.Body.Read(bodyData)
if err != nil {
return fmt.Errorf("动力学移除列车响应读取异常: %v", err)
}
return nil
}
func (d *dynamics) Start(manager DynamicsMessageManager) error {
if manager == nil {
panic("启动动力学消息服务错误: DynamicsMessageManager不能为nil")

View File

@ -50,3 +50,24 @@ type Curve struct {
EndLinkOffset int32 `json:"endLinkOffset"`
Curvature int32 `json:"curvature"`
}
type TrainOperationConfig struct {
TrainIndex int `json:"trainIndex"`
Mass int `json:"mass" form:"mass"` //列车的质量100=1ton
Length int `json:"列车的长度cm"`
BaseResistanceParamA float32 `json:"基本阻力参数A"`
BaseResistanceParamB float32 `json:"基本阻力参数B"`
BaseResistanceParamC float32 `json:"基本阻力参数C"`
CurveResistanceParamR1 float32 `json:"曲线阻力参数R1"`
CurveResistanceParamR2 float32 `json:"曲线阻力参数R2"`
CurveResistanceParamR3 float32 `json:"曲线阻力参数R3"`
CurveResistanceParamR4 float32 `json:"曲线阻力参数R4"`
RevolvingMassParam float32 `json:"旋转质量参数"`
Jump bool `json:"是否跳跃"`
Slip float32 `json:"打滑(%"`
Slide int `json:"前溜/后溜mm正数前溜负数后溜"`
StopSign int `json:"过标/欠标mm正数过标负数欠标"`
WheelDiameter int `json:"轮径mm"`
//RadarSpeed float32 `json:"雷达速度差值m/s"`
//RadarDuration int `json:"雷达速度差值持续时间ms"`
//RadarIsValid bool `json:"雷达是否失效"`
}

View File

@ -2,20 +2,19 @@ package message
import (
"encoding/binary"
"joylink.club/bj-rtsts-server/dto/state_proto"
"math"
"time"
"joylink.club/bj-rtsts-server/ts/protos/state"
)
// 接收到的列车控制信息
type TrainControlMsg struct {
ControlInfo *state.TrainVobcState
ControlInfo *state_proto.TrainVobcState
}
// 解析VOBC列车信息
func (r *TrainControlMsg) Decode(buf []byte) error {
t := &state.TrainVobcState{}
t := &state_proto.TrainVobcState{}
t.LifeSignal = int32(binary.BigEndian.Uint16(buf[0:2]))
b2 := buf[2]
t.Tc1Active = (b2 & 1) != 0

View File

@ -3,7 +3,7 @@ package memory
import (
"fmt"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/rtsssimulation/fi"
)
@ -16,7 +16,7 @@ func ChangeIBPButtonState(sim *VerifySimulation, mapId int32, stationId, btnId u
if uidMap.IbpButtonIds[btnId] == nil {
return fmt.Errorf("车站【%d】按钮【%d】UID不存在", stationId, btnId)
}
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
stationUid := QueryUidByMidAndComId(mapId, stationId, &data_proto.Station{})
if pressDown {
return fi.PressDownButton(sim.World, stationUid+"_"+uidMap.IbpButtonIds[btnId].Uid)
} else {
@ -33,14 +33,14 @@ func ChangeIBPKeyState(sim *VerifySimulation, mapId int32, stationId, keyId uint
if uidMap.IbpKeyIds[keyId] == nil {
return fmt.Errorf("车站【%d】钥匙【%d】UID不存在", stationId, keyId)
}
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
stationUid := QueryUidByMidAndComId(mapId, stationId, &data_proto.Station{})
return fi.SwitchKeyGear(sim.World, stationUid+"_"+uidMap.IbpKeyIds[keyId].Uid, gear)
}
// 根据平面布置图ID、列车ID获取IbpUid信息
func getIbpUidByMapIdAndStationId(mapId int32, stationId uint32) (*IBPUidStructure, error) {
giData := QueryGiData[*graphicData.RtssGraphicStorage](mapId)
var station *graphicData.Station
giData := QueryGiData[*data_proto.RtssGraphicStorage](mapId)
var station *data_proto.Station
for _, s := range giData.Stations {
if GetMapElementId(s.Common) == stationId {
station = s
@ -54,6 +54,6 @@ func getIbpUidByMapIdAndStationId(mapId int32, stationId uint32) (*IBPUidStructu
if station.RefIbpMapCode == "" {
return nil, fmt.Errorf("车站【%s】未关联IBP地图", station.StationName)
}
ibpMapId, _ := QueryGiDataByName[*graphicData.IBPGraphicStorage](station.RefIbpMapCode)
ibpMapId, _ := QueryGiDataByName[*data_proto.IBPGraphicStorage](station.RefIbpMapCode)
return QueryUidStructure[*IBPUidStructure](ibpMapId), nil
}

View File

@ -13,16 +13,16 @@ import (
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/service"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
)
var giPublishData sync.Map
type giStoreData struct {
name string
giType graphicData.PictureType
giType data_proto.PictureType
message proto.Message
version int32
}
@ -30,15 +30,15 @@ type giStoreData struct {
// 将发布的地图数据放入内存中
func PublishMapVerifyStructure(graphic *dto.PublishedDto) {
var message proto.Message
switch graphicData.PictureType(graphic.Type) {
case graphicData.PictureType_StationLayout:
message = &graphicData.RtssGraphicStorage{}
case graphicData.PictureType_RelayCabinetLayout:
message = &graphicData.RelayCabinetGraphicStorage{}
case graphicData.PictureType_Psl:
message = &graphicData.PslGraphicStorage{}
case graphicData.PictureType_IBP:
message = &graphicData.IBPGraphicStorage{}
switch data_proto.PictureType(graphic.Type) {
case data_proto.PictureType_StationLayout:
message = &data_proto.RtssGraphicStorage{}
case data_proto.PictureType_RelayCabinetLayout:
message = &data_proto.RelayCabinetGraphicStorage{}
case data_proto.PictureType_Psl:
message = &data_proto.PslGraphicStorage{}
case data_proto.PictureType_IBP:
message = &data_proto.IBPGraphicStorage{}
}
err := proto.Unmarshal(graphic.Proto, message)
if err != nil {
@ -47,21 +47,21 @@ func PublishMapVerifyStructure(graphic *dto.PublishedDto) {
// 缓存数据
giPublishData.Store(graphic.ID, &giStoreData{
name: graphic.Name,
giType: graphicData.PictureType(graphic.Type),
giType: data_proto.PictureType(graphic.Type),
message: message,
version: graphic.Version,
})
// 初始化地图结构
switch graphicData.PictureType(graphic.Type) {
case graphicData.PictureType_StationLayout:
graphicStorage := message.(*graphicData.RtssGraphicStorage)
switch data_proto.PictureType(graphic.Type) {
case data_proto.PictureType_StationLayout:
graphicStorage := message.(*data_proto.RtssGraphicStorage)
filterOtherLineDevice(graphicStorage) // 处理掉其他线路的设备
giUidMap.Store(graphic.ID, initStationUid(graphicStorage))
case graphicData.PictureType_RelayCabinetLayout:
graphicStorage := message.(*graphicData.RelayCabinetGraphicStorage)
case data_proto.PictureType_RelayCabinetLayout:
graphicStorage := message.(*data_proto.RelayCabinetGraphicStorage)
giUidMap.Store(graphic.ID, initRelayCabinetUid(graphicStorage))
case graphicData.PictureType_IBP:
graphicStorage := message.(*graphicData.IBPGraphicStorage)
case data_proto.PictureType_IBP:
graphicStorage := message.(*data_proto.IBPGraphicStorage)
giUidMap.Store(graphic.ID, initIBPUid(graphicStorage))
}
}
@ -82,12 +82,12 @@ func DeleteMapVerifyStructure(mapId int32) {
}
// 获取地图类型
func QueryGiType(mapId int32) graphicData.PictureType {
func QueryGiType(mapId int32) data_proto.PictureType {
value, ok := giPublishData.Load(mapId)
if !ok {
graphic := service.GetPublishedById(mapId)
PublishMapVerifyStructure(graphic)
return graphicData.PictureType(graphic.Type)
return data_proto.PictureType(graphic.Type)
}
d, ok := value.(*giStoreData)
if !ok {

View File

@ -8,8 +8,8 @@ import (
"sync"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/rtsssimulation/repository"
)
@ -58,7 +58,7 @@ type deviceRelateUidPriex struct {
}
// 获取地图元素ID
func GetMapElementId(common *graphicData.CommonInfo) uint32 {
func GetMapElementId(common *data_proto.CommonInfo) uint32 {
if common.Id != 0 {
return common.Id
}
@ -79,7 +79,7 @@ func getMapELementCode(id uint32, code ...string) string {
}
// 获取关联的车站名
func handleRefStationName(stationMap map[uint32]*graphicData.Station, sid []uint32) []string {
func handleRefStationName(stationMap map[uint32]*data_proto.Station, sid []uint32) []string {
var stationNames []string
for _, id := range sid {
if id == 0 {
@ -96,12 +96,12 @@ func handleRefStationName(stationMap map[uint32]*graphicData.Station, sid []uint
// 获取UID的前缀信息
func getUIdPrefix(prefix interface{}) (string, string, string) {
switch p := prefix.(type) {
case *graphicData.UniqueIdOfStationLayout:
case *data_proto.UniqueIdOfStationLayout:
if p == nil {
return "", "", ""
}
return p.City, p.LineId, ""
case *graphicData.UniqueIdType:
case *data_proto.UniqueIdType:
if p == nil {
return "", "", ""
}
@ -112,7 +112,7 @@ func getUIdPrefix(prefix interface{}) (string, string, string) {
}
// 过滤掉其他线路的设备
func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) {
func filterOtherLineDevice(data *data_proto.RtssGraphicStorage) {
otherDeviceIdMap := make(map[uint32]bool)
for _, ods := range data.OtherLineList {
for _, id := range ods.Ids {
@ -127,7 +127,7 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) {
otherDeviceIdMap[did] = (strings.TrimSpace(d.Code) == "" || d.Code == "G000")
}
// 处理物理区段
var sections []*graphicData.Section
var sections []*data_proto.Section
for _, d := range data.Section {
did := GetMapElementId(d.Common)
if otherDeviceIdMap[did] {
@ -157,14 +157,14 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) {
}
data.Section = sections
// 处理计轴
var axleCounts []*graphicData.AxleCounting
var axleCounts []*data_proto.AxleCounting
for _, d := range data.AxleCountings {
did := GetMapElementId(d.Common)
if otherDeviceIdMap[did] {
slog.Warn("计轴[id:%v][code:%s]设备其他线路设备已过滤", did, d.Code)
continue
}
var refs []*graphicData.RelatedRef
var refs []*data_proto.RelatedRef
for _, r := range d.AxleCountingRef {
if otherDeviceIdMap[r.Id] {
continue
@ -176,7 +176,7 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) {
}
data.AxleCountings = axleCounts
// 处理道岔
var turnouts []*graphicData.Turnout
var turnouts []*data_proto.Turnout
for _, d := range data.Turnouts {
did := GetMapElementId(d.Common)
if otherDeviceIdMap[did] {
@ -208,7 +208,7 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) {
}
data.Turnouts = turnouts
// 处理信号机
var signals []*graphicData.Signal
var signals []*data_proto.Signal
for _, d := range data.Signals {
did := GetMapElementId(d.Common)
if otherDeviceIdMap[did] {
@ -219,7 +219,7 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) {
}
data.Signals = signals
// 处理应答器
var transponders []*graphicData.Transponder
var transponders []*data_proto.Transponder
for _, d := range data.Transponders {
did := GetMapElementId(d.Common)
if otherDeviceIdMap[did] {
@ -232,7 +232,7 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) {
}
// 初始化平面布置图 UID
func initStationUid(data *graphicData.RtssGraphicStorage) *StationUidStructure {
func initStationUid(data *data_proto.RtssGraphicStorage) *StationUidStructure {
gus := &StationUidStructure{
AxlePointIds: make(map[uint32]*elementIdStructure, len(data.AxleCountings)),
TurnoutIds: make(map[uint32]*elementIdStructure, len(data.Turnouts)),
@ -250,7 +250,7 @@ func initStationUid(data *graphicData.RtssGraphicStorage) *StationUidStructure {
}
city, lineId, _ := getUIdPrefix(data.UniqueIdPrefix)
// 处理车站信息
stationMap := make(map[uint32]*graphicData.Station)
stationMap := make(map[uint32]*data_proto.Station)
for _, s := range data.Stations {
eid := GetMapElementId(s.Common)
stationName := getMapELementCode(eid, s.StationName, s.Code)
@ -357,7 +357,7 @@ func initStationUid(data *graphicData.RtssGraphicStorage) *StationUidStructure {
}
}
// 站台
platformMap := make(map[uint32]*graphicData.Platform)
platformMap := make(map[uint32]*data_proto.Platform)
for _, platform := range data.Platforms {
eid := GetMapElementId(platform.Common)
platformMap[eid] = platform
@ -416,15 +416,15 @@ func initStationUid(data *graphicData.RtssGraphicStorage) *StationUidStructure {
}
// 初始化继电器柜 UID
func initRelayCabinetUid(data *graphicData.RelayCabinetGraphicStorage) *RelayUidStructure {
func initRelayCabinetUid(data *data_proto.RelayCabinetGraphicStorage) *RelayUidStructure {
rus := &RelayUidStructure{
RelayIds: make(map[uint32]*elementIdStructure, len(data.Relays)),
}
// 继电器所属设备
refMap := make(map[uint32]*deviceRelateUidPriex, len(data.Relays))
for _, r := range data.DeviceRelateRelayList {
isStation := r.DeviceType == graphicData.RelatedRef_station
isPsd := r.DeviceType == graphicData.RelatedRef_ScreenDoor
isStation := r.DeviceType == data_proto.RelatedRef_station
isPsd := r.DeviceType == data_proto.RelatedRef_ScreenDoor
for _, c := range r.Combinationtypes {
p := &deviceRelateUidPriex{deviceCode: r.Code, typeCode: c.Code, isStation: isStation, isPSD: isPsd}
for _, i := range c.RefRelays {
@ -473,7 +473,7 @@ func initRelayCabinetUid(data *graphicData.RelayCabinetGraphicStorage) *RelayUid
}
// 初始化IBP地图UID
func initIBPUid(data *graphicData.IBPGraphicStorage) *IBPUidStructure {
func initIBPUid(data *data_proto.IBPGraphicStorage) *IBPUidStructure {
rus := &IBPUidStructure{
IbpButtonIds: make(map[uint32]*elementIdStructure),
IbpAlarmIds: make(map[uint32]*elementIdStructure),
@ -580,29 +580,29 @@ func QueryUidStructure[T *StationUidStructure | *RelayUidStructure | *IBPUidStru
// 获取设备类型获取对应字段
func getUidMapByType(uidData any, m interface{}) map[uint32]*elementIdStructure {
switch m.(type) {
case *graphicData.AxleCounting:
case *data_proto.AxleCounting:
return (uidData.(*StationUidStructure)).AxlePointIds
case *graphicData.Turnout:
case *data_proto.Turnout:
return (uidData.(*StationUidStructure)).TurnoutIds
case *graphicData.Section:
case *data_proto.Section:
return (uidData.(*StationUidStructure)).PhysicalSectionIds
case *graphicData.Signal:
case *data_proto.Signal:
return (uidData.(*StationUidStructure)).SignalIds
case *graphicData.Transponder:
case *data_proto.Transponder:
return (uidData.(*StationUidStructure)).TransponderIds
case *graphicData.Slope:
case *data_proto.Slope:
return (uidData.(*StationUidStructure)).SlopeIds
case *graphicData.Curvature:
case *data_proto.Curvature:
return (uidData.(*StationUidStructure)).CurvatureIds
case *graphicData.Relay:
case *data_proto.Relay:
return (uidData.(*RelayUidStructure)).RelayIds
case *graphicData.EsbButton:
case *data_proto.EsbButton:
return (uidData.(*StationUidStructure)).ButtonIds
case *graphicData.Station:
case *data_proto.Station:
return (uidData.(*StationUidStructure)).StationIds
case *graphicData.SpksSwitch:
case *data_proto.SpksSwitch:
return (uidData.(*StationUidStructure)).SpksSwitchIds
case *graphicData.ScreenDoor:
case *data_proto.ScreenDoor:
return (uidData.(*StationUidStructure)).PsdIds
default:
panic(&dto.ErrorDto{Code: dto.ArgumentParseError, Message: "类型未映射字段"})

View File

@ -2,15 +2,15 @@ package memory
import (
"fmt"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/rtsssimulation/component/component_proto"
"joylink.club/rtsssimulation/fi"
)
// 处理道岔操作
func HandlePsdOperation(simulation *VerifySimulation, req *request_proto.PsdOperationReq) error {
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &graphicData.ScreenDoor{})
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.ScreenDoor{})
switch req.Operation {
case request_proto.Psd_Km:
return fi.SetInterlockKm(simulation.World, uid, req.Group)

View File

@ -3,14 +3,14 @@ package memory
import (
"fmt"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/rtsssimulation/fi"
)
// 处理继电器操作
func HandleRelayOperation(simulation *VerifySimulation, req *request_proto.RelayOperationReq) error {
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &graphicData.Relay{})
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.Relay{})
var err error
switch req.Operation {
case request_proto.Relay_ForceQw:

View File

@ -4,13 +4,13 @@ import (
"log/slog"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/rtsssimulation/fi"
)
func ChangeAxleSectionState(simulation *VerifySimulation, req *dto.AxleSectionOperationReqDto) error {
sectionUid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &graphicData.Section{})
sectionUid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.Section{})
slog.Debug("操作计轴区段", "axleSectionUid", sectionUid)
if req.TrainIn {
return fi.AxleSectionTrainDrive(simulation.World, sectionUid, true)

View File

@ -2,12 +2,12 @@ package memory
import (
"fmt"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/dto/state_proto"
"log/slog"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component/component_proto"
"joylink.club/rtsssimulation/consts"
@ -17,7 +17,7 @@ import (
)
func ChangeSignalState(simulation *VerifySimulation, req *dto.SignalOperationReqDto) {
signalUid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &graphicData.Signal{})
signalUid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.Signal{})
signalModel, err := simulation.Repo.FindModel(signalUid, proto.DeviceType_DeviceType_Signal)
if err != nil {
panic(fmt.Sprintf("信号机[%s]模型不存在", signalUid))
@ -119,107 +119,107 @@ func ChangeSignalState(simulation *VerifySimulation, req *dto.SignalOperationReq
}
}
func changeSignalJCKXHState(w ecs.World, signalUid string, toAspect state.Signal_Aspect) {
func changeSignalJCKXHState(w ecs.World, signalUid string, toAspect state_proto.Signal_Aspect) {
switch toAspect {
case state.Signal_U:
case state_proto.Signal_U:
fi.DriveSignalJCKXHLx(w, signalUid)
case state.Signal_B:
case state_proto.Signal_B:
fi.DriveSignalJCKXHDx(w, signalUid)
case state.Signal_H:
case state_proto.Signal_H:
fi.DriveSignalJCKXHNon(w, signalUid)
default:
panic(dto.ErrorDto{Code: dto.OperationOfSignalNotSupported, Message: dto.ErrorTipMap[dto.OperationOfSignalNotSupported]})
}
}
func changeSignalDCXHState(w ecs.World, signalUid string, toAspect state.Signal_Aspect) {
func changeSignalDCXHState(w ecs.World, signalUid string, toAspect state_proto.Signal_Aspect) {
switch toAspect {
case state.Signal_B:
case state_proto.Signal_B:
fi.DriveSignalDCXHDx(w, signalUid)
case state.Signal_A:
case state_proto.Signal_A:
fi.DriveSignalDCXHNon(w, signalUid)
default:
panic(dto.ErrorDto{Code: dto.OperationOfSignalNotSupported, Message: dto.ErrorTipMap[dto.OperationOfSignalNotSupported]})
}
}
func changeSignal3XH4State(w ecs.World, signalUid string, toAspect state.Signal_Aspect) {
func changeSignal3XH4State(w ecs.World, signalUid string, toAspect state_proto.Signal_Aspect) {
switch toAspect {
case state.Signal_OFF:
case state_proto.Signal_OFF:
fi.DriveSignal3XH4Dd(w, signalUid, false)
case state.Signal_L:
case state_proto.Signal_L:
fi.DriveSignal3XH4Dd(w, signalUid, true)
fi.DriveSignal3XH4Lx(w, signalUid, true)
case state.Signal_U:
case state_proto.Signal_U:
fi.DriveSignal3XH4Dd(w, signalUid, true)
fi.DriveSignal3XH4Lx(w, signalUid, false)
case state.Signal_H:
case state_proto.Signal_H:
fi.DriveSignal3XH4Dd(w, signalUid, true)
fi.DriveSignal3XH4Non(w, signalUid)
default:
panic(dto.ErrorDto{Code: dto.OperationOfSignalNotSupported, Message: dto.ErrorTipMap[dto.OperationOfSignalNotSupported]})
}
}
func changeSignal3XH3State(w ecs.World, signalUid string, toAspect state.Signal_Aspect) {
func changeSignal3XH3State(w ecs.World, signalUid string, toAspect state_proto.Signal_Aspect) {
switch toAspect {
case state.Signal_OFF:
case state_proto.Signal_OFF:
fi.DriveSignal3XH3Dd(w, signalUid, false)
case state.Signal_U:
case state_proto.Signal_U:
fi.DriveSignal3XH3Dd(w, signalUid, true)
fi.DriveSignal3XH3Lx(w, signalUid)
case state.Signal_HU:
case state_proto.Signal_HU:
fi.DriveSignal3XH3Dd(w, signalUid, true)
fi.DriveSignal3XH3Yx(w, signalUid)
case state.Signal_H:
case state_proto.Signal_H:
fi.DriveSignal3XH3Dd(w, signalUid, true)
fi.DriveSignal3XH3Non(w, signalUid)
default:
panic(dto.ErrorDto{Code: dto.OperationOfSignalNotSupported, Message: dto.ErrorTipMap[dto.OperationOfSignalNotSupported]})
}
}
func changeSignal3XH2State(w ecs.World, signalUid string, toAspect state.Signal_Aspect) {
func changeSignal3XH2State(w ecs.World, signalUid string, toAspect state_proto.Signal_Aspect) {
switch toAspect {
case state.Signal_OFF:
case state_proto.Signal_OFF:
fi.DriveSignal3XH2Dd(w, signalUid, false)
case state.Signal_L:
case state_proto.Signal_L:
fi.DriveSignal3XH2Dd(w, signalUid, true)
fi.DriveSignal3XH2Lx(w, signalUid)
case state.Signal_HU:
case state_proto.Signal_HU:
fi.DriveSignal3XH2Dd(w, signalUid, true)
fi.DriveSignal3XH2Yx(w, signalUid)
case state.Signal_H:
case state_proto.Signal_H:
fi.DriveSignal3XH2Dd(w, signalUid, true)
fi.DriveSignal3XH2Non(w, signalUid)
default:
panic(dto.ErrorDto{Code: dto.OperationOfSignalNotSupported, Message: dto.ErrorTipMap[dto.OperationOfSignalNotSupported]})
}
}
func changeSignal3XH1State(w ecs.World, signalUid string, toAspect state.Signal_Aspect) {
func changeSignal3XH1State(w ecs.World, signalUid string, toAspect state_proto.Signal_Aspect) {
switch toAspect {
case state.Signal_OFF:
case state_proto.Signal_OFF:
fi.DriveSignal3XH1Dd(w, signalUid, false)
case state.Signal_L:
case state_proto.Signal_L:
fi.DriveSignal3XH1Dd(w, signalUid, true)
fi.DriveSignal3XH1Lx(w, signalUid, true)
case state.Signal_U:
case state_proto.Signal_U:
fi.DriveSignal3XH1Dd(w, signalUid, true)
fi.DriveSignal3XH1Lx(w, signalUid, false)
case state.Signal_HU:
case state_proto.Signal_HU:
fi.DriveSignal3XH1Dd(w, signalUid, true)
fi.DriveSignal3XH1Yx(w, signalUid)
case state.Signal_H:
case state_proto.Signal_H:
fi.DriveSignal3XH1Dd(w, signalUid, true)
fi.DriveSignal3XH1Non(w, signalUid)
default:
panic(dto.ErrorDto{Code: dto.OperationOfSignalNotSupported, Message: dto.ErrorTipMap[dto.OperationOfSignalNotSupported]})
}
}
func changeSignal2XH1State(w ecs.World, signalUid string, toAspect state.Signal_Aspect) {
func changeSignal2XH1State(w ecs.World, signalUid string, toAspect state_proto.Signal_Aspect) {
switch toAspect {
case state.Signal_OFF:
case state_proto.Signal_OFF:
fi.DriveSignal2XH1Dd(w, signalUid, false)
case state.Signal_L:
case state_proto.Signal_L:
fi.DriveSignal2XH1Dd(w, signalUid, true)
fi.DriveSignal2XH1Lx(w, signalUid)
case state.Signal_H:
case state_proto.Signal_H:
fi.DriveSignal2XH1Dd(w, signalUid, true)
fi.DriveSignal2XH1Non(w, signalUid)
default:

View File

@ -1,13 +1,13 @@
package memory
import (
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/rtsssimulation/fi"
)
// 操作esb按钮
func ChangeEsbButtonState(sim *VerifySimulation, mapId int32, btnId uint32, pressDown bool) error {
uid := QueryUidByMidAndComId(mapId, btnId, &graphicData.EsbButton{})
uid := QueryUidByMidAndComId(mapId, btnId, &data_proto.EsbButton{})
if pressDown {
return fi.PressDownButton(sim.World, uid)
} else {

View File

@ -14,12 +14,12 @@ import (
"joylink.club/bj-rtsts-server/third_party/message"
"joylink.club/rtsssimulation/fi"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/state_proto"
)
// 增加列车状态
func AddTrainState(vs *VerifySimulation, status *state.TrainState, mapId int32) *state.TrainState {
func AddTrainState(vs *VerifySimulation, status *state_proto.TrainState, mapId int32) *state_proto.TrainState {
allTrainMap := &vs.Memory.Status.TrainStateMap
_, ok := allTrainMap.Load(status.Id)
if ok {
@ -33,9 +33,9 @@ func AddTrainState(vs *VerifySimulation, status *state.TrainState, mapId int32)
// 映射link、偏移量、运行方向
var uid string
if status.DevicePort == "" {
uid = QueryUidByMidAndComId(mapId, status.HeadDeviceId, &graphicData.Section{})
uid = QueryUidByMidAndComId(mapId, status.HeadDeviceId, &data_proto.Section{})
} else {
uid = QueryUidByMidAndComId(mapId, status.HeadDeviceId, &graphicData.Turnout{})
uid = QueryUidByMidAndComId(mapId, status.HeadDeviceId, &data_proto.Turnout{})
}
// 车头所在link、link上的偏移
linkId, loffset := QueryLinkAndOffsetByDevice(vs.Repo, uid, status.DevicePort, status.HeadOffset)
@ -53,14 +53,14 @@ func AddTrainState(vs *VerifySimulation, status *state.TrainState, mapId int32)
status.Up = up
status.PointTo = pointTo
status.TrainKilometer = kilometer.Value
status.DynamicState = &state.TrainDynamicState{
status.DynamicState = &state_proto.TrainDynamicState{
HeadLinkId: linkId,
HeadLinkOffset: loffset,
TailLinkId: tailLink,
TailLinkOffset: tailLOffset,
RunningUp: up,
}
status.VobcState = &state.TrainVobcState{}
status.VobcState = &state_proto.TrainVobcState{}
slog.Debug("列车初始化", "trainIndex", trainIndex, "linkId", linkId, "loffset", loffset)
linkIdInt, _ := strconv.Atoi(linkId)
err := dynamics.Default().RequestAddTrain(&message.InitTrainInfo{
@ -90,26 +90,75 @@ func AddTrainState(vs *VerifySimulation, status *state.TrainState, mapId int32)
return status
}
func UpdateConfigTrain(vs *VerifySimulation, ct *dto.ConfigTrainReqDto) {
allTrainMap := &vs.Memory.Status.TrainStateMap
data, ok := allTrainMap.Load(ct.TrainId)
if !ok {
panic(sys_error.New(fmt.Sprintf("列车【%s】不存在", ct.TrainId)))
}
trainState, ok := data.(*state_proto.TrainState)
if !ok {
panic(sys_error.New(fmt.Sprintf("列车参数修改断言:列车【%s】不存在", ct.TrainId)))
}
if trainState.DynamicState.TrainDynamicConfig == nil {
trainState.DynamicState.TrainDynamicConfig = &state_proto.TrainDynamicConfig{}
}
trainState.DynamicState.TrainDynamicConfig.BaseResistanceParamA = ct.ConfigData.BaseResistanceParamA
trainState.DynamicState.TrainDynamicConfig.BaseResistanceParamB = ct.ConfigData.BaseResistanceParamB
trainState.DynamicState.TrainDynamicConfig.BaseResistanceParamC = ct.ConfigData.BaseResistanceParamC
trainState.DynamicState.TrainDynamicConfig.CurveResistanceParamR1 = ct.ConfigData.CurveResistanceParamR1
trainState.DynamicState.TrainDynamicConfig.CurveResistanceParamR2 = ct.ConfigData.CurveResistanceParamR2
trainState.DynamicState.TrainDynamicConfig.CurveResistanceParamR3 = ct.ConfigData.CurveResistanceParamR3
trainState.DynamicState.TrainDynamicConfig.CurveResistanceParamR4 = ct.ConfigData.CurveResistanceParamR4
trainState.TrainLength = ct.ConfigData.Length
trainState.DynamicState.TrainDynamicConfig.Mass = ct.ConfigData.Mass
trainState.DynamicState.TrainDynamicConfig.Jump = ct.ConfigData.Jump
trainState.DynamicState.TrainDynamicConfig.Slip = ct.ConfigData.Slip
trainState.DynamicState.TrainDynamicConfig.Slide = ct.ConfigData.Slide
trainState.DynamicState.TrainDynamicConfig.StopSign = ct.ConfigData.StopSign
trainState.DynamicState.TrainDynamicConfig.RadarEnable = ct.ConfigData.RadarEnable
trainState.DynamicState.TrainDynamicConfig.RadarCheckSpeed = ct.ConfigData.RadarCheckSpeed
trainState.DynamicState.TrainDynamicConfig.RadarCheckTime = ct.ConfigData.RadarCheckTime
trainState.WheelDiameter = ct.ConfigData.WheelDiameter
requestDynamic(ct)
}
func requestDynamic(ct *dto.ConfigTrainReqDto) {
cd := ct.ConfigData
msg := &message.TrainOperationConfig{TrainIndex: ct.TrainId, Mass: int(cd.Mass), Length: int(cd.Length),
BaseResistanceParamA: cd.BaseResistanceParamA, BaseResistanceParamB: cd.BaseResistanceParamB,
BaseResistanceParamC: cd.BaseResistanceParamC, CurveResistanceParamR1: cd.CurveResistanceParamR1,
CurveResistanceParamR2: cd.CurveResistanceParamR2, CurveResistanceParamR3: cd.CurveResistanceParamR3,
CurveResistanceParamR4: cd.CurveResistanceParamR4, RevolvingMassParam: cd.RevolvingMassParam,
Jump: cd.Jump, Slip: cd.Slip, Slide: int(cd.Slide),
StopSign: int(cd.StopSign), WheelDiameter: int(cd.WheelDiameter)}
err := dynamics.Default().TrainOperationConfig(msg)
if err != nil {
slog.Error("列车参数变更请求动力学失败", err)
panic(sys_error.New(fmt.Sprintf("列车参数变更请求动力学失败")))
}
}
// 修改列车信息
func UpdateTrainInfo(vs *VerifySimulation, status *state.TrainState) *state.TrainState {
func UpdateTrainInfo(vs *VerifySimulation, status *state_proto.TrainState) *state_proto.TrainState {
allTrainMap := &vs.Memory.Status.TrainStateMap
data, ok := allTrainMap.Load(status.Id)
if !ok {
panic(sys_error.New(fmt.Sprintf("列车【%s】不存在", status.Id)))
}
sta := data.(*state.TrainState)
sta := data.(*state_proto.TrainState)
sta.TrainLength = status.TrainLength
sta.WheelDiameter = status.WheelDiameter
return sta
}
// 根据动力学发来的信息修改列车状态
func UpdateTrainStateByDynamics(vs *VerifySimulation, trainId string, info *message.DynamicsTrainInfo) *state.TrainState {
func UpdateTrainStateByDynamics(vs *VerifySimulation, trainId string, info *message.DynamicsTrainInfo) *state_proto.TrainState {
data, ok := vs.Memory.Status.TrainStateMap.Load(trainId)
if !ok {
panic(sys_error.New(fmt.Sprintf("动力学传输数据:列车【%s】不存在", trainId)))
}
sta := data.(*state.TrainState)
sta := data.(*state_proto.TrainState)
delayTime := time.Now().UnixMilli() - sta.VobcState.UpdateTime
sta.ControlDelayTime = (int64(sta.VobcState.LifeSignal)-int64(info.VobcLifeSignal))*20 + delayTime
//slog.Debug("收到动力学原始消息", "Number", info.Number, "Link", info.Link, "LinkOffset", info.LinkOffset)
@ -193,7 +242,7 @@ func RemoveTrainState(vs *VerifySimulation, id string) {
allTrainMap := &vs.Memory.Status.TrainStateMap
d, ok := allTrainMap.Load(id)
if ok {
t := d.(*state.TrainState)
t := d.(*state_proto.TrainState)
trainIndex, _ := strconv.ParseUint(id, 10, 16)
err := dynamics.Default().RequestRemoveTrain(&message.RemoveTrainReq{
TrainIndex: uint16(trainIndex),

View File

@ -1,11 +1,13 @@
package memory
import (
"encoding/hex"
"fmt"
"strings"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/component/component_data"
"joylink.club/rtsssimulation/entity"
@ -16,8 +18,8 @@ import (
)
// BalisePositionModify 应答器移位
func BalisePositionModify(simulation *VerifySimulation, req *dto.BaliseMoveReqDto) error {
uid := QueryMapUidMapByType(req.MapId, &graphicData.Transponder{})[req.BaliseId].Uid
func BalisePositionModify(simulation *VerifySimulation, req *dto.BaliseMoveReqDto) *sys_error.BusinessError {
uid := QueryMapUidMapByType(req.MapId, &data_proto.Transponder{})[req.BaliseId].Uid
transponder := simulation.Repo.FindTransponder(uid)
if transponder == nil {
return sys_error.New(fmt.Sprintf("未找到[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
@ -27,9 +29,9 @@ func BalisePositionModify(simulation *VerifySimulation, req *dto.BaliseMoveReqDt
Value: req.Km.Kilometer,
CoordinateSystem: req.Km.CoordinateSystem,
}
if req.Km.Direction == graphicData.KilometerSystem_LEFT {
if req.Km.Direction == data_proto.KilometerSystem_LEFT {
km.Direction = proto.Direction_LEFT
} else if req.Km.Direction == graphicData.KilometerSystem_RIGHT {
} else if req.Km.Direction == data_proto.KilometerSystem_RIGHT {
km.Direction = proto.Direction_RIGHT
} else {
panic(fmt.Sprintf("未知的公里标方向[%d]", req.Km.Direction))
@ -87,10 +89,8 @@ func BalisePositionModify(simulation *VerifySimulation, req *dto.BaliseMoveReqDt
}
//更新应答器公里标和Link位置
entry, _ := entity.GetEntityByUid(simulation.World, uid)
if km.Value < minKm.Value {
km.Value = minKm.Value
} else if km.Value > maxKm.Value {
km.Value = maxKm.Value
if km.Value <= minKm.Value || km.Value >= maxKm.Value {
return sys_error.New(fmt.Sprintf("超出可设置范围(%d:%d)", minKm.Value, maxKm.Value))
}
component.KmType.Set(entry, km)
offset := number.Abs(km.Value - akm.Value)
@ -103,52 +103,83 @@ func BalisePositionModify(simulation *VerifySimulation, req *dto.BaliseMoveReqDt
// BalisePositionReset 应答器复位
func BalisePositionReset(simulation *VerifySimulation, req *dto.BaliseReqDto) error {
uid := QueryMapUidMapByType(req.MapId, &graphicData.Transponder{})[req.BaliseId].Uid
transponder := simulation.Repo.FindTransponder(uid)
if transponder == nil {
uid := QueryMapUidMapByType(req.MapId, &data_proto.Transponder{})[req.BaliseId].Uid
balise := simulation.Repo.FindTransponder(uid)
if balise == nil {
return sys_error.New(fmt.Sprintf("未找到[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
}
entry, _ := entity.GetEntityByUid(simulation.World, uid)
component.KmType.Set(entry, transponder.Km())
return balisePositionReset(simulation, balise)
}
func balisePositionReset(simulation *VerifySimulation, balise *repository.Transponder) error {
entry, _ := entity.GetEntityByUid(simulation.World, balise.Id())
component.KmType.Set(entry, balise.Km())
component.LinkPositionType.SetValue(entry, component_data.LinkPosition{
LinkId: transponder.LinkPosition().Link().Id(),
Offset: transponder.LinkPosition().Offset(),
LinkId: balise.LinkPosition().Link().Id(),
Offset: balise.LinkPosition().Offset(),
})
return nil
}
// BaliseTelegramModify 修改应答器报文
func BaliseTelegramModify(simulation *VerifySimulation, req *dto.BaliseModifyTelegramReqDto) error {
uid := QueryMapUidMapByType(req.MapId, &graphicData.Transponder{})[req.BaliseId].Uid
uid := QueryMapUidMapByType(req.MapId, &data_proto.Transponder{})[req.BaliseId].Uid
entry, ok := entity.GetEntityByUid(simulation.World, uid)
if !ok {
return sys_error.New(fmt.Sprintf("没有[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
}
component.BaliseStateType.SetValue(entry, component.BaliseState{ValidTelegram: req.Telegram})
if len(req.Telegram) != 256 {
return sys_error.New(fmt.Sprintf("报文长度必须为[%d]", 256))
}
bytes, err := hex.DecodeString(req.Telegram)
if err != nil {
return sys_error.New("报文解析出错", err)
}
component.BaliseStateType.SetValue(entry, component.BaliseState{ValidTelegram: bytes})
return nil
}
// BaliseTelegramReset 重置应答器报文
func BaliseTelegramReset(simulation *VerifySimulation, req *dto.BaliseReqDto) error {
uid := QueryMapUidMapByType(req.MapId, &graphicData.Transponder{})[req.BaliseId].Uid
entry, ok := entity.GetEntityByUid(simulation.World, uid)
if !ok {
return sys_error.New(fmt.Sprintf("没有[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
}
uid := QueryMapUidMapByType(req.MapId, &data_proto.Transponder{})[req.BaliseId].Uid
worldData := entity.GetWorldData(simulation.World)
transponder := worldData.Repo.FindTransponder(uid)
balise := worldData.Repo.FindTransponder(uid)
if balise == nil {
return sys_error.New(fmt.Sprintf("未找到[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
}
return baliseTelegramReset(simulation, balise)
}
func baliseTelegramReset(simulation *VerifySimulation, balise *repository.Transponder) error {
entry, _ := entity.GetEntityByUid(simulation.World, balise.Id())
component.BaliseStateType.SetValue(entry, component.BaliseState{
ValidTelegram: transponder.FixedTelegram(),
ValidTelegram: balise.FixedTelegram(),
})
return nil
}
// BaliseReset 重置应答器所有状态
func BaliseReset(simulation *VerifySimulation, req *dto.BaliseReqDto) error {
err := BaliseTelegramReset(simulation, req)
if err != nil {
return err
func BaliseReset(simulation *VerifySimulation) error {
var errs []error
for _, balise := range simulation.Repo.ResponderList() {
err := baliseTelegramReset(simulation, balise)
if err != nil {
errs = append(errs, err)
}
err = balisePositionReset(simulation, balise)
if err != nil {
errs = append(errs, err)
}
}
err = BalisePositionReset(simulation, req)
return err
if len(errs) > 0 {
var userMsg []string
for _, err := range errs {
be, ok := err.(*sys_error.BusinessError)
if ok {
userMsg = append(userMsg, be.UserMsg)
}
}
return sys_error.New(strings.Join(userMsg, "\n"))
}
return nil
}

View File

@ -6,13 +6,13 @@ import (
"joylink.club/rtsssimulation/component/component_proto"
"joylink.club/rtsssimulation/fi"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
)
// 处理道岔操作
func HandleTurnoutOperation(simulation *VerifySimulation, req *request_proto.TurnoutOperationReq) error {
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &graphicData.Turnout{})
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.Turnout{})
var err error
switch req.Operation {
case request_proto.Turnout_DC:

View File

@ -12,13 +12,13 @@ import (
"joylink.club/bj-rtsts-server/config"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/state_proto"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/third_party/dynamics"
"joylink.club/bj-rtsts-server/third_party/electrical_machinery"
"joylink.club/bj-rtsts-server/third_party/message"
"joylink.club/bj-rtsts-server/third_party/semi_physical_train"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
@ -46,7 +46,7 @@ type VerifySimulation struct {
// 运行环境配置
runConfig *config.ThridPartyConfig
// 运行状态
runState state.SimulationStatus_SimulationState
runState state_proto.SimulationStatus_SimulationState
}
// 轨旁仿真内存模型
@ -61,19 +61,19 @@ type WaysideMemory struct {
// 轨旁仿真模型状态
type VerifyStatus struct {
//道岔状态key为道岔id即索引 state.SwitchState
//道岔状态key为道岔id即索引 state_proto.SwitchState
SwitchStateMap sync.Map
//轨道状态key为轨道id即索引 state.LinkState
//轨道状态key为轨道id即索引 state_proto.LinkState
LinkStateMap sync.Map
//列车状态key为列车id即索引 state.TrainState
//列车状态key为列车id即索引 state_proto.TrainState
TrainStateMap sync.Map
//计轴区段状态key为计轴区段的id即索引 state.SectionState
//计轴区段状态key为计轴区段的id即索引 state_proto.SectionState
AxleSectionStateMap sync.Map
//物理区段状态key为物理区段id即索引 state.SectionState
//物理区段状态key为物理区段id即索引 state_proto.SectionState
PhysicalSectionStateMap sync.Map
//逻辑区段状态key为逻辑区段id即索引 state.SectionState
//逻辑区段状态key为逻辑区段id即索引 state_proto.SectionState
LogicSectionStateMap sync.Map
//信号机状态key为信号机id,即索引 state.SignalState
//信号机状态key为信号机id,即索引 state_proto.SignalState
SignalStateMap sync.Map
}
@ -101,7 +101,7 @@ func CreateSimulation(projectId int32, mapIds []int32, runConfig *dto.ProjectRun
verifySimulation := &VerifySimulation{
ProjectId: projectId,
MapIds: mapIds,
runState: state.SimulationStatus_PAUSE,
runState: state_proto.SimulationStatus_PAUSE,
}
// 设置运行环境
err := verifySimulation.initRunConfig(runConfig)
@ -118,21 +118,21 @@ func CreateSimulation(projectId int32, mapIds []int32, runConfig *dto.ProjectRun
// 启动
func (s *VerifySimulation) Start() {
s.runState = state.SimulationStatus_START
s.runState = state_proto.SimulationStatus_START
}
// 销毁
func (s *VerifySimulation) Destroy() {
s.runState = state.SimulationStatus_DESTROY
s.runState = state_proto.SimulationStatus_DESTROY
}
// 暂停
func (s *VerifySimulation) Pause() {
s.runState = state.SimulationStatus_PAUSE
s.runState = state_proto.SimulationStatus_PAUSE
}
// 获取状态
func (s *VerifySimulation) GetRunState() state.SimulationStatus_SimulationState {
func (s *VerifySimulation) GetRunState() state_proto.SimulationStatus_SimulationState {
return s.runState
}
@ -202,13 +202,13 @@ func (s *VerifySimulation) CollectSectionStatus(city string, lineId string, cent
for _, codePoint := range codePoints {
sectionState, find := stateMap[codePoint.SectionId]
if find {
state := &message.SectionStatusMsg{}
state.Rac = sectionState.Rac
state.Rjt = sectionState.Rjt
state.Rjo = sectionState.Rjo
state.Occ = sectionState.Occ
state.Clr = sectionState.Clr
msg = append(msg, state)
state_proto := &message.SectionStatusMsg{}
state_proto.Rac = sectionState.Rac
state_proto.Rjt = sectionState.Rjt
state_proto.Rjo = sectionState.Rjo
state_proto.Occ = sectionState.Occ
state_proto.Clr = sectionState.Clr
msg = append(msg, state_proto)
} else {
return nil, fmt.Errorf("仿真中没有对应区段[%s]的状态", codePoint.SectionId)
}
@ -383,7 +383,7 @@ func speedParse(speed float32) int32 {
// 处理半实物仿真列车控制消息
func (s *VerifySimulation) HandleSemiPhysicalTrainControlMsg(b []byte) {
s.Memory.Status.TrainStateMap.Range(func(_, value any) bool {
train := value.(*state.TrainState)
train := value.(*state_proto.TrainState)
if !train.Show { // 下线列车
return false
}
@ -548,8 +548,8 @@ func buildProtoRepository(mapIds []int32) (*proto.Repository, error) {
//创建设备
for _, mapId := range mapIds {
giType := QueryGiType(mapId)
if giType == graphicData.PictureType_StationLayout {
stationGi := QueryGiData[*graphicData.RtssGraphicStorage](mapId)
if giType == data_proto.PictureType_StationLayout {
stationGi := QueryGiData[*data_proto.RtssGraphicStorage](mapId)
fillProtoRepository(repo, stationGi, mapId)
} else {
exceptStationGiMapIds = append(exceptStationGiMapIds, mapId)
@ -558,23 +558,23 @@ func buildProtoRepository(mapIds []int32) (*proto.Repository, error) {
//构建并关联电子元件
for _, mapId := range exceptStationGiMapIds {
giType := QueryGiType(mapId)
if giType == graphicData.PictureType_RelayCabinetLayout {
relayGi := QueryGiData[*graphicData.RelayCabinetGraphicStorage](mapId)
if giType == data_proto.PictureType_RelayCabinetLayout {
relayGi := QueryGiData[*data_proto.RelayCabinetGraphicStorage](mapId)
buildAndRelateElectronicComponent(repo, relayGi, mapId)
}
}
//构建信号平面图中物理区段码表与集中站的关系
for _, mapId := range mapIds {
giType := QueryGiType(mapId)
if giType == graphicData.PictureType_StationLayout {
stationGi := QueryGiData[*graphicData.RtssGraphicStorage](mapId)
if giType == data_proto.PictureType_StationLayout {
stationGi := QueryGiData[*data_proto.RtssGraphicStorage](mapId)
buildSectionCodePoint(repo, stationGi, mapId)
}
}
return repo, nil
}
func buildSectionCodePoint(repo *proto.Repository, storage *graphicData.RtssGraphicStorage, mapId int32) {
func buildSectionCodePoint(repo *proto.Repository, storage *data_proto.RtssGraphicStorage, mapId int32) {
// city := storage.UniqueIdPrefix.City
// lineId := storage.UniqueIdPrefix.LineId
uidsMap := QueryUidStructure[*StationUidStructure](mapId)
@ -587,13 +587,13 @@ func buildSectionCodePoint(repo *proto.Repository, storage *graphicData.RtssGrap
for sectionPoint, sectionGId := range sectionGIds {
cc := &proto.CiSectionCodePoint{}
cc.Row = int32(sectionPoint)
cc.SectionId = QueryUidByMidAndComId(mapId, sectionGId, &graphicData.Section{})
cc.SectionId = QueryUidByMidAndComId(mapId, sectionGId, &data_proto.Section{})
ccs = append(ccs, cc)
}
ref.SectionCodePoints = ccs
}
}
func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicData.RelayCabinetGraphicStorage, mapId int32) {
func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *data_proto.RelayCabinetGraphicStorage, mapId int32) {
relayUidStructure := QueryUidStructure[*RelayUidStructure](mapId)
city := relayGi.UniqueIdPrefix.City
lineId := relayGi.UniqueIdPrefix.LineId
@ -644,7 +644,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
}
for _, relationship := range relayGi.DeviceRelateRelayList {
switch relationship.DeviceType {
case graphicData.RelatedRef_Turnout:
case data_proto.RelatedRef_Turnout:
turnout := turnoutMap[GenerateElementUid(city, lineId, []string{station}, relationship.Code)]
if turnout == nil {
continue
@ -663,7 +663,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
ComponentIds: componentIds,
})
}
case graphicData.RelatedRef_signal:
case data_proto.RelatedRef_signal:
signal := signalMap[GenerateElementUid(city, lineId, []string{station}, relationship.Code)]
if signal == nil {
continue
@ -686,7 +686,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
Code: group.Code,
ComponentIds: componentIds,
})
case graphicData.RelatedRef_station:
case data_proto.RelatedRef_station:
station := stationMap[GenerateElementUid(city, lineId, nil, relationship.Code)]
if station == nil {
continue
@ -704,7 +704,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
}
station.ElectronicGroup = append(station.ElectronicGroup, d)
}
case graphicData.RelatedRef_ScreenDoor:
case data_proto.RelatedRef_ScreenDoor:
psd, ok := psdMap[GenerateElementUid(city, lineId, nil, relationship.Code)]
if !ok {
continue
@ -723,7 +723,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
ComponentIds: componentIds,
})
}
case graphicData.RelatedRef_SignalFaultAlarm: // 信号机故障报警仪设备组合
case data_proto.RelatedRef_SignalFaultAlarm: // 信号机故障报警仪设备组合
{
egs := buildEgs(relationship.Combinationtypes, relayUidStructure)
ciecs.Deccs = append(ciecs.Deccs, &proto.DeviceEcc{
@ -731,7 +731,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
Egs: egs,
})
}
case graphicData.RelatedRef_Breakers: // 断路器
case data_proto.RelatedRef_Breakers: // 断路器
{
egs := buildEgs(relationship.Combinationtypes, relayUidStructure)
ciecs.Deccs = append(ciecs.Deccs, &proto.DeviceEcc{
@ -739,7 +739,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
Egs: egs,
})
}
case graphicData.RelatedRef_PowerScreen: // 电源屏
case data_proto.RelatedRef_PowerScreen: // 电源屏
{
egs := buildEgs(relationship.Combinationtypes, relayUidStructure)
ciecs.Deccs = append(ciecs.Deccs, &proto.DeviceEcc{
@ -805,7 +805,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
sortQcTable(ref.QdList)
}
func buildEgs(cts []*graphicData.Combinationtype, relayUidStructure *RelayUidStructure) []*proto.ElectronicComponentGroup {
func buildEgs(cts []*data_proto.Combinationtype, relayUidStructure *RelayUidStructure) []*proto.ElectronicComponentGroup {
var egs []*proto.ElectronicComponentGroup
for _, ct := range cts {
d := &proto.ElectronicComponentGroup{Code: ct.Code}
@ -860,7 +860,7 @@ func queryCentralizedStationRef(stationId string, repo *proto.Repository) *proto
}
// 处理继电器采集信息
func handlerRelayGiCj(uidsMap *RelayUidStructure, stationId string, ciCj *graphicData.CiCj) []*proto.CjData {
func handlerRelayGiCj(uidsMap *RelayUidStructure, stationId string, ciCj *data_proto.CiCj) []*proto.CjData {
if ciCj == nil {
return nil
}
@ -881,7 +881,7 @@ func handlerRelayGiCj(uidsMap *RelayUidStructure, stationId string, ciCj *graphi
panic(sys_error.New(fmt.Sprintf("集中站【id:%s】不存在继电器的【comId:%d】UID映射关系", stationId, j.RelayId)))
}
d := &proto.CjDataItem{RelayId: u.Uid}
if j.Position == graphicData.CjDataItem_H {
if j.Position == data_proto.CjDataItem_H {
d.Q = false
} else {
d.Q = true
@ -897,7 +897,7 @@ func handlerRelayGiCj(uidsMap *RelayUidStructure, stationId string, ciCj *graphi
}
// 处理继电器驱动信息
func handlerRelayGiQd(uidsMap *RelayUidStructure, stationId string, ciQd *graphicData.CiQd) []*proto.QdData {
func handlerRelayGiQd(uidsMap *RelayUidStructure, stationId string, ciQd *data_proto.CiQd) []*proto.QdData {
if ciQd == nil {
return nil
}
@ -927,40 +927,40 @@ func handlerRelayGiQd(uidsMap *RelayUidStructure, stationId string, ciQd *graphi
return qdList
}
func convertRelayModel(modelType graphicData.Relay_ModelType) proto.Relay_Model {
func convertRelayModel(modelType data_proto.Relay_ModelType) proto.Relay_Model {
switch modelType {
case graphicData.Relay_Unknown:
case data_proto.Relay_Unknown:
return proto.Relay_Unknown
case graphicData.Relay_JPXC_1000:
case data_proto.Relay_JPXC_1000:
return proto.Relay_JPXC_1000
case graphicData.Relay_JPXC_1700:
case data_proto.Relay_JPXC_1700:
return proto.Relay_JPXC_1700
case graphicData.Relay_JWJXC_480:
case data_proto.Relay_JWJXC_480:
return proto.Relay_JWJXC_480
case graphicData.Relay_JWJXC_H125_80:
case data_proto.Relay_JWJXC_H125_80:
return proto.Relay_JWJXC_H125_80
case graphicData.Relay_JWXC_1700:
case data_proto.Relay_JWXC_1700:
return proto.Relay_JWXC_1700
case graphicData.Relay_JWXC_H340:
case data_proto.Relay_JWXC_H340:
return proto.Relay_JWXC_H340
case graphicData.Relay_JYJXC_160_260:
case data_proto.Relay_JYJXC_160_260:
return proto.Relay_JYJXC_160_260
case graphicData.Relay_JZXC_H18:
case data_proto.Relay_JZXC_H18:
return proto.Relay_JZXC_H18
default:
panic(fmt.Sprintf("意料之外的继电器型号:%s", modelType))
}
}
func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphicStorage, mapId int32) {
func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphicStorage, mapId int32) {
repo.MainCoordinateSystem = storage.UniqueIdPrefix.MainCoordinateSystem
axleCountingMap := make(map[uint32]*graphicData.AxleCounting)
axleCountingMap := make(map[uint32]*data_proto.AxleCounting)
uidsMap := QueryUidStructure[*StationUidStructure](mapId)
for _, data := range storage.AxleCountings {
id := GetMapElementId(data.Common)
axleCountingMap[id] = data
cpType := proto.CheckPointType_AxleCounter
if data.Type == graphicData.AxleCounting_SectionBoundary {
if data.Type == data_proto.AxleCounting_SectionBoundary {
cpType = proto.CheckPointType_Boundary
}
cp := &proto.CheckPoint{
@ -975,7 +975,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
}
for _, data := range storage.Section {
var turnoutUids []string
if data.SectionType == graphicData.Section_TurnoutPhysical {
if data.SectionType == data_proto.Section_TurnoutPhysical {
turnoutIds := findTurnoutIds(axleCountingMap, data.AxleCountings)
for _, tid := range turnoutIds {
turnoutUids = append(turnoutUids, uidsMap.TurnoutIds[tid].Uid)
@ -1013,9 +1013,9 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
CDevicePort: convertDevicePort(data.PcRef, uidsMap),
}
switch data.SwitchMachineType {
case graphicData.Turnout_ZDJ9_Single:
case data_proto.Turnout_ZDJ9_Single:
turnout.SwitchMachineType = proto.Turnout_ZDJ9_Single
case graphicData.Turnout_ZDJ9_Double:
case data_proto.Turnout_ZDJ9_Double:
turnout.SwitchMachineType = proto.Turnout_ZDJ9_Double
}
repo.Turnouts = append(repo.Turnouts, turnout)
@ -1027,9 +1027,9 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
Model: convertToProtoSignalModel(data.Mt),
}
switch data.RefDev.DeviceType {
case graphicData.RelatedRef_Section:
case data_proto.RelatedRef_Section:
signal.SectionId = uidsMap.PhysicalSectionIds[data.RefDev.Id].Uid
case graphicData.RelatedRef_Turnout:
case data_proto.RelatedRef_Turnout:
signal.TurnoutPort = convertDevicePort(data.RefDev, uidsMap)
}
repo.Signals = append(repo.Signals, signal)
@ -1043,9 +1043,9 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
Type: convertToProtoBaliseType(data.Type),
}
switch data.TransponderRef.DeviceType {
case graphicData.RelatedRef_Section:
case data_proto.RelatedRef_Section:
responder.SectionId = uidsMap.PhysicalSectionIds[data.TransponderRef.Id].Uid
case graphicData.RelatedRef_Turnout:
case data_proto.RelatedRef_Turnout:
responder.TurnoutPort = convertDevicePort(data.TransponderRef, uidsMap)
}
for _, stationId := range data.CentralizedStations {
@ -1057,7 +1057,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
}
repo.Transponders = append(repo.Transponders, responder)
}
slopeKsMap := make(map[uint32]*graphicData.SlopeKiloMarker)
slopeKsMap := make(map[uint32]*data_proto.SlopeKiloMarker)
for _, data := range storage.SlopeKiloMarker {
slopeKsMap[GetMapElementId(data.Common)] = data
}
@ -1073,7 +1073,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
}
repo.Slopes = append(repo.Slopes, slope)
}
curveKsMap := make(map[uint32]*graphicData.CurvatureKiloMarker)
curveKsMap := make(map[uint32]*data_proto.CurvatureKiloMarker)
for _, data := range storage.CurvatureKiloMarker {
curveKsMap[GetMapElementId(data.Common)] = data
}
@ -1105,7 +1105,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
})
}
// 车站关联关系
relateMap := make(map[string]*graphicData.StationRelateDevice)
relateMap := make(map[string]*data_proto.StationRelateDevice)
for _, data := range storage.StationRelateDeviceList {
relateMap[data.Code] = data
}
@ -1152,7 +1152,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
PsdId: uidsMap.PsdIds[data.RefScreenDoor].Uid,
}
repo.Mkxs = append(repo.Mkxs, mkx)
_, pslStorage := QueryGiDataByName[*graphicData.PslGraphicStorage](data.RefGatedBoxMapCode)
_, pslStorage := QueryGiDataByName[*data_proto.PslGraphicStorage](data.RefGatedBoxMapCode)
for _, button := range pslStorage.PslButtons {
repoButton := &proto.Button{
Id: boxUidInfo.Uid + "_" + button.Code,
@ -1172,7 +1172,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
}
}
//站台
platformMap := make(map[uint32]*graphicData.Platform)
platformMap := make(map[uint32]*data_proto.Platform)
for _, data := range storage.Platforms {
platformId := GetMapElementId(data.Common)
platformMap[platformId] = data
@ -1206,7 +1206,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
// 将IBP的设备关联到车站中
func handlerIBPDeviceToStation(station *proto.Station, repo *proto.Repository, ibpMapCode string) {
mapId, storage := QueryGiDataByName[*graphicData.IBPGraphicStorage](ibpMapCode)
mapId, storage := QueryGiDataByName[*data_proto.IBPGraphicStorage](ibpMapCode)
if storage == nil {
return
}
@ -1282,12 +1282,12 @@ func handlerIBPDeviceToStation(station *proto.Station, repo *proto.Repository, i
}
}
func convertKm(ks *graphicData.KilometerSystem) *proto.Kilometer {
func convertKm(ks *data_proto.KilometerSystem) *proto.Kilometer {
var dir proto.Direction
switch ks.Direction {
case graphicData.KilometerSystem_LEFT:
case data_proto.KilometerSystem_LEFT:
dir = proto.Direction_LEFT
case graphicData.KilometerSystem_RIGHT:
case data_proto.KilometerSystem_RIGHT:
dir = proto.Direction_RIGHT
}
return &proto.Kilometer{
@ -1297,26 +1297,26 @@ func convertKm(ks *graphicData.KilometerSystem) *proto.Kilometer {
}
}
func convertDevicePort(ref *graphicData.RelatedRef, uidsMap *StationUidStructure) *proto.DevicePort {
func convertDevicePort(ref *data_proto.RelatedRef, uidsMap *StationUidStructure) *proto.DevicePort {
if ref == nil {
return nil
}
var port proto.Port
switch ref.DevicePort {
case graphicData.RelatedRef_A:
case data_proto.RelatedRef_A:
port = proto.Port_A
case graphicData.RelatedRef_B:
case data_proto.RelatedRef_B:
port = proto.Port_B
case graphicData.RelatedRef_C:
case data_proto.RelatedRef_C:
port = proto.Port_C
}
var elementId string
var deviceType proto.DeviceType
switch ref.DeviceType {
case graphicData.RelatedRef_Section:
case data_proto.RelatedRef_Section:
deviceType = proto.DeviceType_DeviceType_PhysicalSection
elementId = uidsMap.PhysicalSectionIds[ref.Id].Uid
case graphicData.RelatedRef_Turnout:
case data_proto.RelatedRef_Turnout:
deviceType = proto.DeviceType_DeviceType_Turnout
elementId = uidsMap.TurnoutIds[ref.Id].Uid
default:
@ -1329,7 +1329,7 @@ func convertDevicePort(ref *graphicData.RelatedRef, uidsMap *StationUidStructure
}
}
func findTurnoutIds(axleCountingMap map[uint32]*graphicData.AxleCounting, axleIds []uint32) []uint32 {
func findTurnoutIds(axleCountingMap map[uint32]*data_proto.AxleCounting, axleIds []uint32) []uint32 {
if len(axleIds) <= 2 {
return nil
}
@ -1337,7 +1337,7 @@ func findTurnoutIds(axleCountingMap map[uint32]*graphicData.AxleCounting, axleId
for _, axleId := range axleIds {
axle := axleCountingMap[axleId]
for _, ref := range axle.AxleCountingRef {
if ref.DeviceType == graphicData.RelatedRef_Turnout {
if ref.DeviceType == data_proto.RelatedRef_Turnout {
turnoutMap[ref.Id] = turnoutMap[ref.Id] + 1
}
}
@ -1363,42 +1363,42 @@ func findTurnoutIds(axleCountingMap map[uint32]*graphicData.AxleCounting, axleId
HBU_DU = 7; //JCKXH 红白黄,不封灯,有单黄,无引导
}
*/
func convertToProtoSignalModel(gSmt graphicData.Signal_Model) proto.Signal_Model {
func convertToProtoSignalModel(gSmt data_proto.Signal_Model) proto.Signal_Model {
switch gSmt {
case graphicData.Signal_HL:
case data_proto.Signal_HL:
return proto.Signal_HL
case graphicData.Signal_HLU_FU:
case data_proto.Signal_HLU_FU:
return proto.Signal_HLU_FU
case graphicData.Signal_HLU_DU_YY:
case data_proto.Signal_HLU_DU_YY:
return proto.Signal_HLU_DU_YY
case graphicData.Signal_HLU_YY:
case data_proto.Signal_HLU_YY:
return proto.Signal_HLU_YY
case graphicData.Signal_HLU_FL_DU_YY:
case data_proto.Signal_HLU_FL_DU_YY:
return proto.Signal_HLU_FL_DU_YY
case graphicData.Signal_HLU_DU:
case data_proto.Signal_HLU_DU:
return proto.Signal_HLU_DU
case graphicData.Signal_AB:
case data_proto.Signal_AB:
return proto.Signal_AB
case graphicData.Signal_HBU_DU:
case data_proto.Signal_HBU_DU:
return proto.Signal_HBU_DU
default:
panic(fmt.Sprintf("graphicData.Signal_Model[%d]无法映射到proto.Signal_Model", gSmt))
panic(fmt.Sprintf("data_proto.Signal_Model[%d]无法映射到proto.Signal_Model", gSmt))
}
}
func convertToProtoBaliseType(bt graphicData.Transponder_TransponderTypeEnum) proto.Transponder_Type {
func convertToProtoBaliseType(bt data_proto.Transponder_TransponderTypeEnum) proto.Transponder_Type {
switch bt {
case graphicData.Transponder_FB:
case data_proto.Transponder_FB:
return proto.Transponder_FB
case graphicData.Transponder_WB:
case data_proto.Transponder_WB:
return proto.Transponder_WB
case graphicData.Transponder_DB:
case data_proto.Transponder_DB:
return proto.Transponder_DB
case graphicData.Transponder_VB:
case data_proto.Transponder_VB:
return proto.Transponder_VB
case graphicData.Transponder_IB:
case data_proto.Transponder_IB:
return proto.Transponder_IB
default:
panic(fmt.Sprintf("graphicData.Transponder_TransponderTypeEnum[%d]无法映射到proto.Transponder_Type", bt))
panic(fmt.Sprintf("data_proto.Transponder_TransponderTypeEnum[%d]无法映射到proto.Transponder_Type", bt))
}
}