设备模型定义

This commit is contained in:
xzb 2023-07-28 18:12:50 +08:00
parent 82fd662d33
commit 73db31b5f2
6 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,11 @@
package device
import "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
//计轴检测点设备模型
type AxlePointDeviceModel struct {
//计轴检测点基本信息
DeviceModel
//端点的公里标,单位为mm
KilometerSystem graphicData.KilometerSystem
}

View File

@ -0,0 +1,35 @@
package device
import "strings"
//设备模型基类
type DeviceModel struct {
//图形id,即由前端作图时生成,且全局唯一
GraphicId string
//索引编号,同类设备唯一,不同类设备不唯一
Index string
}
type DeviceModeler interface {
//判断是否同一个设备
IsSame(other *DeviceModel) bool
}
//判断是否同一个设备
func (dm *DeviceModel) IsSame(other *DeviceModel) bool {
return strings.EqualFold(dm.GraphicId, other.GraphicId)
}
//////////////////////////////////////////////////////////////
//设备端口枚举定义
type PortEnum int8
//设备端口枚举值
const (
A PortEnum = iota
B
C
)
/////////////////////////////////////////////////////////////

View File

@ -0,0 +1,14 @@
package ref
import (
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/model/device"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/model/device/section"
)
// link端口引用
type LinkRef struct {
//引用的轨道
LinkSection *section.LinkSectionModel
//引用的轨道的端口
Port device.PortEnum
}

View File

@ -0,0 +1,10 @@
package section
import "joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/model/device"
//相邻端点(车档、计轴检测点、道岔岔心)定义的Link区段
//地图做数据时link区段的A端在左link区段的B端在右即上行方向A->B,下行方向B->A
type LinkSectionModel struct {
//轨道基本信息
device.DeviceModel
}

View File

@ -0,0 +1,11 @@
package device
import "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
//信号机装置
type SignalDeviceModel struct {
//信号机基本信息
DeviceModel
//信号机所在公里标,单位为mm
KilometerSystem graphicData.KilometerSystem
}

View File

@ -0,0 +1,14 @@
package device
import (
"container/list"
)
// 道岔装置(规定A端为岔尖规定B端为定位端轨道C端为反位端)
type SwitchDeviceModel struct {
//道岔基本信息
DeviceModel
//端点的公里标,单位为mm
//list中元素类型为graphicData.KilometerSystem
KilometerSystems *list.List
}