53 lines
1.5 KiB
Go
53 lines
1.5 KiB
Go
package message
|
|
|
|
type InitTrainInfo struct {
|
|
TrainIndex uint16 `json:"trainIndex"`
|
|
LinkIndex uint16 `json:"linkIndex"`
|
|
LinkOffset uint32 `json:"linkOffset"`
|
|
//单位0.1km/h
|
|
Speed uint16 `json:"speed"`
|
|
Up bool `json:"up"`
|
|
TrainLength uint32 `json:"trainLength"`
|
|
}
|
|
|
|
// 移除列车请求参数
|
|
type RemoveTrainReq struct {
|
|
TrainIndex uint16 `json:"trainIndex"`
|
|
}
|
|
|
|
// LineBaseInfo 线路基础信息,提供给动力学作为计算依据
|
|
type LineBaseInfo struct {
|
|
LinkList []*Link `json:"linkList"`
|
|
SlopeList []*Slope `json:"slopeList"`
|
|
CurveList []*Curve `json:"curveList"`
|
|
}
|
|
|
|
type Link struct {
|
|
ID int32 `json:"id"`
|
|
//长度 mm
|
|
Len int32 `json:"len"`
|
|
ARelTurnoutId int32 `json:"ARelTurnoutId"`
|
|
ARelTurnoutPoint string `json:"ARelTurnoutPoint"`
|
|
BRelTurnoutId int32 `json:"BRelTurnoutId"`
|
|
BRelTurnoutPoint string `json:"BRelTurnoutPoint"`
|
|
}
|
|
|
|
type Slope struct {
|
|
ID int32 `json:"id"`
|
|
StartLinkId int32 `json:"startLinkId"`
|
|
StartLinkOffset int32 `json:"startLinkOffset"`
|
|
EndLinkId int32 `json:"endLinkId"`
|
|
EndLinkOffset int32 `json:"endLinkOffset"`
|
|
//坡度的三角函数(猜是sin)值的*1000
|
|
DegreeTrig int32 `json:"degreeTrig"`
|
|
}
|
|
|
|
type Curve struct {
|
|
ID int32 `json:"id"`
|
|
StartLinkId int32 `json:"startLinkId"`
|
|
StartLinkOffset int32 `json:"startLinkOffset"`
|
|
EndLinkId int32 `json:"endLinkId"`
|
|
EndLinkOffset int32 `json:"endLinkOffset"`
|
|
Curvature int32 `json:"curvature"`
|
|
}
|