171 lines
6.6 KiB
Go
171 lines
6.6 KiB
Go
package dto
|
||
|
||
import (
|
||
"joylink.club/bj-rtsts-server/dto/request_proto"
|
||
"joylink.club/bj-rtsts-server/ts/protos/state"
|
||
)
|
||
|
||
// 创建仿真请求
|
||
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 string `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 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 AddTrainRspDto struct {
|
||
//仿真id
|
||
SimulationId string `json:"simulationId" form:"simulationId"`
|
||
//新添加的列车的索引
|
||
TrainId string `json:"trainId" form:"trainId"`
|
||
// 场景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"`
|
||
}
|
||
type SignalOperationReqDto 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"`
|
||
Operation request_proto.Signal_Operation `form:"operation" json:"operation" binding:"required"` //信号机操作类型
|
||
Aspect state.Signal_Aspect `form:"aspect" json:"aspect" binding:"required"` // 当操作为Operation.Display时有效,表示显示的信号
|
||
}
|
||
|
||
// AxleSectionOperationReqDto 计轴区段操作
|
||
type AxleSectionOperationReqDto 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"`
|
||
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 string `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"`
|
||
StationId string `form:"stationId" json:"stationId" binding:"required"`
|
||
ButtonId string `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"`
|
||
GateBoxId string `form:"gateBoxId" json:"gateBoxId"`
|
||
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"`
|
||
StationId string `form:"stationId" json:"stationId" binding:"required"`
|
||
KeyId string `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 string `form:"id" json:"id" binding:"required"`
|
||
Td bool `form:"td" json:"td"`
|
||
}
|