25 lines
634 B
Go
25 lines
634 B
Go
|
package repository
|
||
|
|
||
|
import "joylink.club/rtsssimulation/repository/model/proto"
|
||
|
|
||
|
// 检测点
|
||
|
type CheckPoint struct {
|
||
|
Identity
|
||
|
|
||
|
km *proto.Kilometer
|
||
|
pointType proto.CheckPointType //检测点类型
|
||
|
devicePorts []DevicePort //检测点关联的设备及其端口
|
||
|
}
|
||
|
|
||
|
func NewCheckPoint(id string, km *proto.Kilometer, pointType proto.CheckPointType) *CheckPoint {
|
||
|
return &CheckPoint{
|
||
|
Identity: identity{id, proto.DeviceType_DeviceType_CheckPoint},
|
||
|
km: km,
|
||
|
pointType: pointType,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (c *CheckPoint) bindDevicePort(devicePort DevicePort) {
|
||
|
c.devicePorts = append(c.devicePorts, devicePort)
|
||
|
}
|