syntax = "proto2"; package message; import "message_base.proto"; //连接口 message InputDi { required int32 Di0 = 1; //停车超前光电(0正常,1超界故障) required int32 Di1 = 2; //停车超后光电(0正常,1超界故障) required int32 Di2 = 3; //停车超左光电(0正常,1超界故障) required int32 Di3 = 4; //停车超1550光电(0正常,1超界故障) required int32 Di4 = 5; //2050高度(0默认,1被触发) required int32 Di5 = 6; //1750高度(0默认,1被触发) required int32 Di6 = 7; //2050高度(0默认,1被触发) required int32 Di7 = 8; //预留 required int32 Di8 = 9; //停车库门开到位(1表示开到位) required int32 Di9 = 10; //停车库门关到位(1表示关到位) required int32 Di10 = 11;//预留的门故障位(1表示门故障) required int32 Di11 = 12;//调度完成标志位,是否允许终端放下一辆车进入入口(0调度正忙,1调度允许下一辆车) required int32 Di12 = 13;//库内光电,判断门内是否有车(0无车,1有车) required int32 Di13 = 14;//库外地磁 ,判断门外(0无车,1有车) required int32 Di14 = 15;//重启 required int32 Di15 = 16;//急停 } //连接口 message OutputDo { required int32 Do0 = 1; //外门 开门(1) required int32 Do1 = 2; //外门 关门(1) required int32 Do2 = 3; //备用 required int32 Do3 = 4; //备用 required int32 Do4 = 5; //备用 required int32 Do5 = 6; //备用 required int32 Do6 = 7; //备用 required int32 Do7 = 8; //备用 } //流程控制 enum Process_control { PROCESS_CONTROL_UNKNOWN = 0;//未知 PROCESS_CONTROL_FULL_AUTO = 1;//全自动, PROCESS_CONTROL_MANUAL = 2;//手动 PROCESS_CONTROL_AUTO_CLOSE = 3;//半自动关门 PROCESS_CONTROL_AUTO_OPEN = 4;//半自动开门 PROCESS_CONTROL_TO_READY = 5;//切换到待机 PROCESS_CONTROL_RESET = 7;//重启 PROCESS_CONTROL_STOP = 8;//急停 PROCESS_CONTROL_FAULT = 9;//故障 PROCESS_CONTROL_INLET_0 = 10 ;//未知 PROCESS_CONTROL_INLET_1 = 11 ;//未知 PROCESS_CONTROL_INLET_2 = 12 ;//未知 PROCESS_CONTROL_INLET_3 = 13 ;//未知 PROCESS_CONTROL_INLET_4 = 14 ;//未知 PROCESS_CONTROL_INLET_5 = 15 ;//未知 PROCESS_CONTROL_INLET_6 = 16 ;//未知 PROCESS_CONTROL_INLET_7 = 17 ;//未知 PROCESS_CONTROL_INLET_8 = 18 ;//未知 PROCESS_CONTROL_INLET_9 = 19 ;//未知 PROCESS_CONTROL_OUTLET_0 = 30 ;//未知 PROCESS_CONTROL_OUTLET_1 = 31 ;//未知 PROCESS_CONTROL_OUTLET_2 = 32 ;//未知 PROCESS_CONTROL_OUTLET_3 = 33 ;//未知 PROCESS_CONTROL_OUTLET_4 = 34 ;//未知 PROCESS_CONTROL_OUTLET_5 = 35 ;//未知 PROCESS_CONTROL_OUTLET_6 = 36 ;//未知 PROCESS_CONTROL_OUTLET_7 = 37 ;//未知 PROCESS_CONTROL_OUTLET_8 = 38 ;//未知 PROCESS_CONTROL_OUTLET_9 = 39 ;//未知 }; //终端给单片机 message terminal_msg { required int32 TerminalID = 1; // 终端号(单片机号) required int32 DispatchDirection= 2; // 方向(1入口,2出口) required Process_control ProcessControl= 3; // 门控 required OutputDo OutPutDo= 4; // 输入口 } //超界状态 enum Over_border_status { OVER_BORDER_STATUS_UNKNOWN = 0 ;//未知 OVER_BORDER_STATUS_NORMAL = 1 ;//正常 OVER_BORDER_STATUS_FRONT = 2 ;//前超界 OVER_BORDER_STATUS_BACK = 3 ;//后超界 OVER_BORDER_STATUS_LEFT = 4 ;//左超界 OVER_BORDER_STATUS_RIGHT = 5 ;//右超界 }; //车高状态 enum Car_height_status { CAR_HEIGHT_STATUS_UNKNOWN = 0 ;//未知 CAR_HEIGHT_STATUS_SMALL = 1 ;//小车 CAR_HEIGHT_STATUS_MEDIUM = 2 ;//中车 CAR_HEIGHT_STATUS_LARGE = 3 ;//大车 CAR_HEIGHT_STATUS_HUGE = 4 ;//巨大车 CAR_HEIGHT_STATUS_FAULT = 5 ;//故障车 }; //外门的状态 enum Outside_door_status { OUTSIDE_DOOR_STATUS_UNKNOWN = 0 ;//未知 OUTSIDE_DOOR_STATUS_OPEN = 1 ;//外门开到位 OUTSIDE_DOOR_STATUS_CLOSE = 2 ;//外门关到位 OUTSIDE_DOOR_STATUS_RUN = 3 ;//外门运行中 OUTSIDE_DOOR_STATUS_FAULT = 4 ;//外门故障 }; //外门的控制 enum Outside_door_control { OUTSIDE_DOOR_CONTROL_UNKNOWN = 0 ;//未知 OUTSIDE_DOOR_CONTROL_OPEN = 1 ;//外门开 OUTSIDE_DOOR_CONTROL_CLOSE = 2 ;//外门关 }; //流程状态 enum Process_status { PROCESS_STATUS_UNKNOWN = 0;//未知 PROCESS_STATUS_FULL_AUTO = 1;//全自动, PROCESS_STATUS_MANUAL = 2;//手动 PROCESS_STATUS_AUTO_CLOSE = 3;//半自动关门 PROCESS_STATUS_AUTO_OPEN = 4;//半自动开门 PROCESS_STATUS_TO_READY = 5;//切换到待机 PROCESS_STATUS_RESET = 7;//重启 PROCESS_STATUS_STOP = 8;//急停 PROCESS_STATUS_FAULT = 9;//故障 //自动模式的步骤 PROCESS_STATUS_INLET_0 = 10 ;//入口待机, 等待门外地感触发。 PROCESS_STATUS_INLET_1 = 11 ;//执行开门 PROCESS_STATUS_INLET_2 = 12 ;//等待门开到位 PROCESS_STATUS_INLET_3 = 13 ;//等待汽车进入 PROCESS_STATUS_INLET_4 = 14 ;//停车完成,统计汽车经过门口的车高。 PROCESS_STATUS_INLET_5 = 15 ;//等待终端关门,执行关门 PROCESS_STATUS_INLET_6 = 16 ;//等待门关到位 PROCESS_STATUS_INLET_7 = 17 ;//等待plc调度,或者终端重置 PROCESS_STATUS_INLET_8 = 18 ;//未知 PROCESS_STATUS_INLET_9 = 19 ;//未知 PROCESS_STATUS_OUTLET_0 = 30 ;//出口待机,等待终端开门,执行开门 PROCESS_STATUS_OUTLET_1 = 31 ;//等待门开到位 PROCESS_STATUS_OUTLET_2 = 32 ;//等待门口的光电产生信号,表示汽车正从车库出去。汽车正在离开中。 PROCESS_STATUS_OUTLET_3 = 33 ;//汽车离开后,延迟5秒关门,执行关门 PROCESS_STATUS_OUTLET_4 = 34 ;//等待门关到位 PROCESS_STATUS_OUTLET_5 = 35 ;//等待plc调度,或者终端重置 PROCESS_STATUS_OUTLET_6 = 36 ;//未知 PROCESS_STATUS_OUTLET_7 = 37 ;//未知 PROCESS_STATUS_OUTLET_8 = 38 ;//未知 PROCESS_STATUS_OUTLET_9 = 39 ;//未知 }; //单片机给终端 message singlechip_data { required int32 TerminalID= 1; // 终端号(单片机号) required int32 DispatchDirection= 2; // 方向(1入口,2出口) required Process_status ProcessStatus= 3; //流程状态 required InputDi InPutDi = 4; // 输入口 required int32 ResetFlag = 5; //重置标志位 required Process_control ProcessControl = 6; //流程控制 required int32 InsideExistenceFlag = 7; //内部存在标志 required Over_border_status OverBorderStatus = 8; //边界状态 required Car_height_status CarHeightStatusCurrent = 9; //当前车高状态--斜角对射光电 required Car_height_status CarHeightStatusPassing = 10; //车高状态--门口经过式光电 required int32 StopFlag = 11; //停车标志位 required Outside_door_status OutsideDoorStatus = 12; //外门状态 required Outside_door_control OutsideDoorControl = 13; //外门控制 required int32 DispatchFinishFlag = 14; //调度完成标志 required int32 OutsideExistenceFlag = 15; //外部存在标志 } //终端状态消息 message terminal_status_msg { required Base_info base_info =1; //消息类型 required int32 terminal_id=2; //终端号 required singlechip_data singlechipData=3; //单片机的数据 }