rts-sim-testing-service/dto/simulation.go
tiger_zhou e0b0ae4566
All checks were successful
local-test分支打包构建docker并发布运行 / Docker-Build (push) Successful in 1m43s
列车pc仿真调整
2024-04-13 09:40:25 +08:00

284 lines
13 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package dto
import (
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/dto/state_proto"
)
// 创建仿真请求
type SimulationCreateReqDto struct {
//地图id
MapId int32 `json:"mapId" form:"mapId"`
// 项目id
ProjectId int32 `json:"projectId" form:"projectId"`
// 运行环境ID
ProjectRunConfigId int32 `json:"runConfigId" form:"runConfigId"`
}
// 创建仿真响应
type SimulationCreateRspDto struct {
//地图id
MapId int32 `json:"mapId" form:"mapId"`
// 项目ID
ProjectId int32 `json:"projectId" form:"projectId"`
//仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
// 地图列表
MapIds []int32 `json:"mapIds" form:"mapIds"`
// 运行环境ID
ProjectRunConfigId int32 `json:"runConfigId" form:"runConfigId"`
}
//////////////////////////////////////////////////////////////////////////////
// 为仿真添加测试车请求
type AddTrainReqDto struct {
//仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
//列车方向,true-上行false-下行
RunDirection bool `json:"up" form:"up"`
//车头所在link的索引
HeadLinkId string `json:"headLinkId" form:"headLinkId"`
//车头所在link内的偏移量单位为mm
HeadLinkOffset int64 `json:"headLinkOffset" form:"headLinkOffset"`
//物理区段、道岔ID
Id uint32 `json:"id" form:"id"`
//道岔端口
DevicePort string `json:"devicePort" form:"devicePort"`
//车头所在link内的偏移量单位为mm
HeadOffset int64 `json:"headOffset" form:"headOffset"`
//列车长度
TrainLength int64 `json:"trainLength" from:"trainLength"`
// 场景ID
MapId int32 `json:"mapId" from:"mapId"`
// 列车轮径
WheelDiameter int32 `json:"wheelDiameter" from:"wheelDiameter"`
}
type AddTrainReqDtoNew struct {
//仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
//列车方向,true-上行false-下行
RunDirection bool `json:"up" form:"up"`
//车头所在link的索引
HeadLinkId string `json:"headLinkId" form:"headLinkId"`
//车头所在link内的偏移量单位为mm
HeadLinkOffset int64 `json:"headLinkOffset" form:"headLinkOffset"`
//物理区段、道岔ID
Id uint32 `json:"id" form:"id"`
//道岔端口
DevicePort string `json:"devicePort" form:"devicePort"`
//车头所在link内的偏移量单位为mm
HeadOffset int64 `json:"headOffset" form:"headOffset"`
//列车长度
TrainLength int64 `json:"trainLength" from:"trainLength"`
// 场景ID
MapId int32 `json:"mapId" from:"mapId"`
WheelDiameter int32 `json:"wheelDiameter" from:"wheelDiameter"`
// 列车数据配置
ConfigTrain ConfigTrainData `json:"configTrain" from:"mapId"`
TrainEndsA ConfigTrainEnds `json:"trainEndsA"` // 车辆A端
TrainEndsB ConfigTrainEnds `json:"trainEndsB"` // 车辆B端
TrainId int `json:"trainId" from:"trainId"` // 列车id
TrainSpeed float32 `json:"trainSpeed" from:"trainSpeed"` // 列车时速
TrainControlMapId uint32 `json:"trainControlMapId" from:"trainControlMapId"` // 列车mapId
}
// 为反正列车修改对应的测试配置
type ConfigTrainReqDto struct {
SimulationId string `json:"simulationId" form:"simulationId"`
// 列车Id
TrainId int `json:"trainId" form:"trainId"`
Length int64 `json:"length"` // 列车的长度cm
ConfigData ConfigTrainData
TrainEndsA ConfigTrainEnds `json:"trainEndsA"` // 车辆A端
TrainEndsB ConfigTrainEnds `json:"trainEndsB"` // 车辆B端
WheelDiameter int32 `json:"wheelDiameter"` // 轮径mm
}
type ConfigTrainEnds struct {
SpeedSensorEnableA bool `json:"speedSensorEnableA"` // 2端速度传感器是否有效
SpeedSensorEnableB bool `json:"speedSensorEnableB"` // 2端速度传感器是否有效
RadarEnable bool `json:"radarEnable"` // 雷达是否有效
RadarCheckSpeedDiff float32 `json:"radarCheckSpeedDiff"` // 雷达测速数值
RadarCheckTime int32 `json:"radarCheckTime"` // 雷达检测时间(秒)
AccEnable bool `json:"accEnable"` // 加速计是否有效
AccCheckSpeedDiff float32 `json:"accCheckSpeedDiff"` // 加速计速度差
AccCheckTime int32 `json:"accCheckTime"` // 加速计储蓄时间
AccOutSpeed int32 `json:"accOutSpeed"` // 速传速度输出
RadarOutSpeed int32 `json:"radarOutSpeed"` // 雷达速度输出
}
type ConfigTrainData struct {
//Mass int32 `json:"mass" form:"mass"` // 列车的质量100=1ton
DavisParamA float32 `json:"davisParamA"` // 基本阻力参数A
DavisParamB float32 `json:"davisParamB"` // 基本阻力参数B
DavisParamC float32 `json:"davisParamC"` // 基本阻力参数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"` // 是否跳跃
SlipA float32 `json:"slipA"` // 打滑加速度(m/s) 默认0
SlipR float32 `json:"slipR"` // 打滑冲击率(m/s) 默认0
SlipD int32 `json:"slipD"` // 打滑持续时间ms 默认0
Slide float32 `json:"slide"` // 前溜/后溜m/s正数前溜负数后溜默认值0
StopSign int32 `json:"stopSign"` // 过标/欠标mm正数过标负数欠标
IdlingA float32 `json:"idlingA"` // 空转加速度(m/s) 默认0
IdlingR float32 `json:"idlingR"` // 空转冲击率(m/s) 默认0
IdlingD int32 `json:"idlingD"` // 空转持续时间s 默认0
TrainLoad int32 `json:"trainLoad"` // 列车载重 默认 16000
//TrainEndsA ConfigTrainEnds `json:"TrainEndsA"` // 车辆A端
//TrainEndsB ConfigTrainEnds `json:"TrainEndsB"` // 车辆B端
}
// 为仿真添加测试车请求
type UpdateTrainReqDto struct {
// 仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
// 列车Id
Id string `json:"id" form:"id"`
//列车长度
TrainLength int64 `json:"trainLength" from:"trainLength"`
// 列车轮径
WheelDiameter int32 `json:"wheelDiameter" from:"wheelDiameter"`
}
// 列车连接三方类型
type TrainConnThirdDto struct {
// 仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
Id string `json:"id" form:"id"` // 列车Id
ConnType state_proto.TrainConnState_TrainConnType `json:"connType" form:"connType"` //连接类型 0=未连接;1=半实物;2= 车载仿真
}
// 为仿真添加测试车请求
type AddTrainRspDto struct {
//仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
//新添加的列车的索引
TrainId string `json:"trainId" form:"trainId"`
// 场景ID
MapId int32 `json:"mapId" from:"mapId"`
}
// 为仿真添加测试车请求
type RemoveAllTrainRspDto struct {
//仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
// 场景ID
MapId int32 `json:"mapId" from:"mapId"`
}
/////////////////////////////////////////////////////////////////////////////////
// 仿真移除列车请求
type RemoveTrainDto AddTrainRspDto
/////////////////////////////////////////////////////////////////////////////////
type SwitchOperationReqDto struct {
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
DeviceId string `form:"id" json:"id" binding:"required"`
TurnNormal bool `form:"turnNormal" json:"turnNormal"`
TurnReverse bool `form:"turnReverse" json:"turnReverse"`
}
// AxleSectionOperationReqDto 计轴区段操作
type AxleSectionOperationReqDto struct {
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
DeviceId uint32 `form:"id" json:"id" binding:"required"`
Operation request_proto.Section_Operation `form:"operation" json:"operation"`
TrainIn bool `form:"trainIn" json:"trainIn"`
TrainOut bool `form:"trainOut" json:"trainOut"`
}
type EsbButtonOperationReqDto struct {
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
Id uint32 `form:"id" json:"id" binding:"required"`
Down bool `form:"down" json:"down"`
}
type IBPButtonOperationReqDto struct {
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
IbpId uint32 `form:"ibpId" json:"ibpId" binding:"required"`
ButtonId uint32 `form:"buttonId" json:"buttonId" binding:"required"`
Down bool `form:"down" json:"down"`
}
type PslOperationReqDto struct {
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
PslId uint32 `form:"pslId" json:"pslId"`
ButtonCode string `form:"buttonCode" json:"buttonCode" binding:"required"`
Down bool `form:"down" json:"down"`
}
type KeyOperationReqDto struct {
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
IbpId uint32 `form:"ibpId" json:"ibpId" binding:"required"`
KeyId uint32 `form:"keyId" json:"keyId"`
Gear int32 `form:"gear" json:"gear"`
}
/////////////////////////////////////////////////////////////////////////////////
// 地铁数据检测请求
type CheckMapDataReqDto struct {
Data []byte `form:"data" json:"data" binding:"required"`
}
// 地图检验数据响应
type CheckMapDataRspDto struct {
Success bool `form:"success" json:"success"`
Errors []string `form:"errors" json:"errors"`
}
// 仿真实例的基本信息响应
type SimulationInfoRspDto struct {
SimulationId string `form:"simulationId" json:"simulationId"`
MapId int32 `json:"mapId" form:"mapId"`
MapIds []int32 `form:"mapIds" json:"mapIds"`
ProjectId int32 `form:"projectId" json:"projectId"`
ProjectRunConfigId int32 `form:"runConfigId" json:"runConfigId" ` // 运行环境ID
}
type SimulationInfoRspDtoArr []SimulationInfoRspDto
type RelayOperationReqDto struct {
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
Id uint32 `form:"id" json:"id" binding:"required"`
Td bool `form:"td" json:"td"`
}
// 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 data_proto.KilometerSystem `json:"km" form:"km"` //公里标
}
// BaliseModifyTelegramReqDto 修改应答器报文
type BaliseModifyTelegramReqDto struct {
SimulationId string `json:"simulationId" form:"simulationId"` //仿真ID
MapId int32 `json:"mapId" form:"mapId"` //地图ID
BaliseId uint32 `json:"baliseId" form:"baliseId"` //应答器ID
FixedTelegram string `json:"fixedTelegram" from:"fixedTelegram"` //固定报文16进制字符串
FixedUserTelegram string `json:"fixedUserTelegram" from:"fixedUserTelegram"` //固定用户报文16进制字符串
VariableTelegram string `json:"variableTelegram" from:"variableTelegram"` //可变报文
VariableUserTelegram string `json:"variableUserTelegram" from:"variableUserTelegram"` //可变用户报文
}
// BaliseReqDto 应答器请求
type BaliseReqDto struct {
SimulationId string `json:"simulationId" form:"simulationId"` //仿真ID
MapId int32 `json:"mapId" form:"mapId"` //地图ID
BaliseId uint32 `json:"baliseId" form:"baliseId"` //应答器ID
}