2023-08-14 16:23:34 +08:00
|
|
|
package model
|
|
|
|
|
2023-08-21 15:12:57 +08:00
|
|
|
import "joylink.club/rtsssimulation/state"
|
|
|
|
|
2023-08-14 16:23:34 +08:00
|
|
|
//道岔
|
|
|
|
type SwitchModel struct {
|
2023-08-14 18:06:26 +08:00
|
|
|
DeviceModel
|
2023-08-14 16:23:34 +08:00
|
|
|
//道岔A端口连接的轨道
|
|
|
|
PortA *LinkPortRef
|
|
|
|
//道岔B端口连接的轨道
|
|
|
|
PortB *LinkPortRef
|
|
|
|
//道岔C端口连接的轨道
|
|
|
|
PortC *LinkPortRef
|
2023-08-18 17:59:16 +08:00
|
|
|
//道岔转动需要的时间(从开度0-100的时间),单位ms
|
|
|
|
TurnTime int64
|
2023-08-14 16:23:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//道岔端口引用
|
|
|
|
type SwitchPortRef struct {
|
|
|
|
Switch *SwitchModel
|
|
|
|
//引用道岔的端口
|
|
|
|
Port PortEnum
|
|
|
|
}
|
2023-08-21 15:12:57 +08:00
|
|
|
|
|
|
|
func NewSwitchModel(id string) *SwitchModel {
|
|
|
|
return &SwitchModel{DeviceModel: DeviceModel{Id: id, Type: state.DeviceType_Switch}}
|
|
|
|
}
|