rts-sim-module/model/switch_model.go
2023-08-21 15:12:57 +08:00

28 lines
594 B
Go

package model
import "joylink.club/rtsssimulation/state"
//道岔
type SwitchModel struct {
DeviceModel
//道岔A端口连接的轨道
PortA *LinkPortRef
//道岔B端口连接的轨道
PortB *LinkPortRef
//道岔C端口连接的轨道
PortC *LinkPortRef
//道岔转动需要的时间(从开度0-100的时间),单位ms
TurnTime int64
}
//道岔端口引用
type SwitchPortRef struct {
Switch *SwitchModel
//引用道岔的端口
Port PortEnum
}
func NewSwitchModel(id string) *SwitchModel {
return &SwitchModel{DeviceModel: DeviceModel{Id: id, Type: state.DeviceType_Switch}}
}