syntax = "proto3"; package state; option java_package = "club.joylink.bjrtss.ats.verify.protos"; option java_outer_classname = "DeviceStateProto"; //状态定义面向物理层即只定义物理状态,不定义逻辑层状态 //区段类型 enum SectionType{ Any=0; //计轴区段 Axle=1; //逻辑区段 Logic=2; //物理区段 Physic=3; } //相邻端点定义的link的状态 message LinkState{ //link索引 string id = 1; //link上的列车id列表 repeated string trainId = 2; } //区段状态 message SectionState{ //区段索引 string id = 1; //区段类型 SectionType type = 2; //区段占用 //true-占用;false-出清 bool occupied = 3; } //道岔状态 message SwitchState{ //道岔索引 string id = 1; //道岔处于定位 bool normal = 2; //道岔处于反位 bool reverse = 3; } //列车状态 message TrainState{ //列车索引 string id = 1; //车头所在link的索引 string headLinkId = 2; //车头所在link内的偏移量,单位为cm int64 headLinkOffset = 3; //车尾所在link的索引 string tailLinkId = 4; //车尾所在link内的偏移量,单位为cm int64 tailLinkOffset = 5; //列车所占用的link的索引的列表 //顺序为从车头到车尾 repeated string occupiedLinkId = 6; } //////////////////////////////////////////////////////////////////////////// //仿真运行时状态变化量,当前时刻与上一时刻比较得到 message VariationStatus{ //新增或变化的列车的状态 repeated TrainState updatedTrain = 1; //移除的列车的索引 repeated string removedTrainId = 2; //状态发生变化的道岔 repeated SwitchState updatedSwitch = 3; //状态发生变化的区段 repeated SectionState updatedSection = 4; } //仿真运行时的所有设备的状态 message AllDevicesStatus{ //所有列车状态 repeated TrainState trainState = 1; //所有道岔状态 repeated SwitchState switchState = 2; //所有类型区段状态 repeated SectionState sectionState = 3; }