rts-sim-module/repository/check_point.go

34 lines
834 B
Go
Raw Normal View History

package repository
import "joylink.club/rtsssimulation/repository/model/proto"
// 检测点
type CheckPoint struct {
Identity
km *proto.Kilometer
pointType proto.CheckPointType //检测点类型
devicePorts []DevicePort //检测点关联的设备及其端口
linkPosition LinkPosition
}
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) LinkPosition() LinkPosition {
return c.linkPosition
}
func (c *CheckPoint) bindDevicePort(devicePort DevicePort) {
c.devicePorts = append(c.devicePorts, devicePort)
}
func (c *CheckPoint) bindLinkPosition(position LinkPosition) {
c.linkPosition = position
}