29 lines
446 B
Go
29 lines
446 B
Go
package model
|
|
|
|
type IDeviceModel interface {
|
|
GetId() string
|
|
IsSame(other IDeviceModel) bool
|
|
}
|
|
|
|
// 设备模型基础信息
|
|
type DeviceModel struct {
|
|
Id string
|
|
}
|
|
|
|
func (me *DeviceModel) GetId() string {
|
|
return me.Id
|
|
}
|
|
func (me *DeviceModel) IsSame(other IDeviceModel) bool {
|
|
return me.Id == other.GetId()
|
|
}
|
|
|
|
// 端口定义,如轨道、区段、道岔的端口
|
|
type PortEnum = int8
|
|
|
|
// 具体端口枚举
|
|
const (
|
|
A PortEnum = iota
|
|
B
|
|
C
|
|
)
|