package memory import ( "joylink.club/bj-rtsts-server/ats/verify/protos/state" "joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/face" ) // 轨旁仿真模型结构 type VerifyStructure struct { //计轴检测点设备模型集合,key为索引编号 AxlePointDeviceModelMap map[string]face.AxlePointDeviceModeller //道岔设备模型集合,key为索引编号 SwitchDeviceModelMap map[string]face.SwitchDeviceModeller //由端点确定的link模型集合,key为索引编号 LinkSectionModelMap map[string]face.LinkSectionModeller //计轴区段模型集合,key为索引编号 AxleSectionModelMap map[string]face.AxleSectionModeller //物理区段模型集合,key为索引编号 PhysicalSectionModelMap map[string]face.PhysicalSectionModeller //逻辑区段模型集合,key为索引编号 LogicalSectionModelMap map[string]face.LogicalSectionModeller //信号机模型集合,key为索引编号 SignalDeviceModelMap map[string]face.SignalDeviceModeller } // 轨旁仿真模型状态 type VerifyStatus struct { //道岔状态,key为道岔id即索引 SwitchStateMap map[string]*state.SwitchState //轨道状态,key为轨道id即索引 LinkStateMap map[string]*state.LinkState //列车状态,key为列车id即索引 TrainStateMap map[string]*state.TrainState //计轴区段状态,key为计轴区段的id即索引 AxleSectionStateMap map[string]*state.SectionState //物理区段状态,key为物理区段id即索引 PhysicalSectionStateMap map[string]*state.SectionState //逻辑区段状态,key为逻辑区段id即索引 LogicSectionStateMap map[string]*state.SectionState //信号机状态,key为信号机id,即索引 SignalStateMap map[string]*state.SignalState } // 轨旁仿真内存模型 type WaysideMemory struct { //固定关系数据:轨旁仿真模型结构 Structure *VerifyStructure //可变状态数据:轨旁仿真模型状态 Status *VerifyStatus //对数据的操作管理实现:对内存模型初始化的初始化器 Initializer *WaysideMemoryInitializer //对数据的操作管理实现:对内存模型的列车运行时数据操作的更新器 TrainRuntime *WaysideMemoryTrainRuntime //对数据的操作管理实现:工具 Helper *WaysideMemoryHelper //对数据的操作管理实现:计算当前时刻与上一时刻状态的变化量,用于前端页面增量更新 Variation *WaysideMemoryVariation //对数据的操作管理实现:实现设备到区段的映射 SectionMapper *WaysideMemorySectionMapper //端点和轨道构成的路径层 PathLayer *WaysidePathLayer } // 初始化轨旁仿真内存模型 func (memory *WaysideMemory) Init() *WaysideMemory { memory.Initializer = new(WaysideMemoryInitializer).Init(memory) memory.TrainRuntime = new(WaysideMemoryTrainRuntime).Init(memory) memory.Helper = new(WaysideMemoryHelper).Init(memory) memory.Variation = new(WaysideMemoryVariation).Init(memory) memory.SectionMapper = new(WaysideMemorySectionMapper).Init(memory) memory.PathLayer = new(WaysidePathLayer).Init(memory) return memory }