rts-sim-module/model/device_model.go

29 lines
446 B
Go
Raw Normal View History

2023-08-14 16:23:34 +08:00
package model
2023-08-18 17:59:16 +08:00
type IDeviceModel interface {
GetId() string
IsSame(other IDeviceModel) bool
}
// 设备模型基础信息
2023-08-14 18:06:26 +08:00
type DeviceModel struct {
2023-08-14 16:23:34 +08:00
Id string
}
2023-08-18 17:59:16 +08:00
func (me *DeviceModel) GetId() string {
return me.Id
}
func (me *DeviceModel) IsSame(other IDeviceModel) bool {
return me.Id == other.GetId()
}
// 端口定义,如轨道、区段、道岔的端口
2023-08-14 16:23:34 +08:00
type PortEnum = int8
2023-08-18 17:59:16 +08:00
// 具体端口枚举
2023-08-14 16:23:34 +08:00
const (
A PortEnum = iota
B
C
)