设备模型定义
This commit is contained in:
parent
82fd662d33
commit
73db31b5f2
@ -0,0 +1,11 @@
|
||||
package device
|
||||
|
||||
import "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
|
||||
|
||||
//计轴检测点设备模型
|
||||
type AxlePointDeviceModel struct {
|
||||
//计轴检测点基本信息
|
||||
DeviceModel
|
||||
//端点的公里标,单位为mm
|
||||
KilometerSystem graphicData.KilometerSystem
|
||||
}
|
35
ats/verify/simulation/wayside/model/device/device_model.go
Normal file
35
ats/verify/simulation/wayside/model/device/device_model.go
Normal 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
|
||||
)
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
14
ats/verify/simulation/wayside/model/device/ref/link_ref.go
Normal file
14
ats/verify/simulation/wayside/model/device/ref/link_ref.go
Normal 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
|
||||
}
|
@ -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
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package device
|
||||
|
||||
import "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
|
||||
|
||||
//信号机装置
|
||||
type SignalDeviceModel struct {
|
||||
//信号机基本信息
|
||||
DeviceModel
|
||||
//信号机所在公里标,单位为mm
|
||||
KilometerSystem graphicData.KilometerSystem
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package device
|
||||
|
||||
import (
|
||||
"container/list"
|
||||
)
|
||||
|
||||
// 道岔装置(规定A端为岔尖,规定B端为定位端,轨道C端为反位端)
|
||||
type SwitchDeviceModel struct {
|
||||
//道岔基本信息
|
||||
DeviceModel
|
||||
//端点的公里标,单位为mm
|
||||
//list中元素类型为graphicData.KilometerSystem
|
||||
KilometerSystems *list.List
|
||||
}
|
Loading…
Reference in New Issue
Block a user