syntax = "proto2";
package globalmsg;

message msg
{
	required type msg_type=1;
	optional laserMsg laser_msg=2;
	optional plcMsg plc_msg=3;
	optional algMsg alg_msg=4;
	optional SysMsg sys_msg=5;
}

enum type
{
	ePLC=0;
	eLaser=1;
	eAlg=2;
	eLog=3;
}

enum laserStatus
{
	eLaserConnected=0;
	eLaserDisconnected=1;
	eLaserBusy=2;
	eLaserUnknown=3;
}
message laserMsg
{
	optional laserStatus laser_status=1;
	optional int32 queue_data_count=2;
	optional int32 cloud_count=3;
	required int32 id=4;
}

enum plcStatus
{
	ePLCConnected=0;
	ePLCDisconnected=1;
	ePLCRefused=2;
	ePLCUnknown=3;
}
message plcMsg
{
	optional plcStatus plc_status=1;
	repeated int32 plc_values=2;
}

message resultInfo
{
	required string time=1 [default=""];
	required bool correctness=2;
	optional int32 park_space_id=3;
	optional int32 laser_ids=4;
	
	optional double x=5;
	optional double y=6;
	optional double c=7;
	optional double wheel_base=8;
	optional double length=9;
	optional double width=10;
	optional double height=11;
	optional string error=12 [default=""];
	optional double front_theta=13;
}
message algMsg
{

	repeated resultInfo result=1;
	optional int32 thread_queue_size=2;
	optional string log_path=3 [default=""];
}

enum logLevel
{
	eSysInfo=0;
	eSysLog=1;
	eSysWarning=2;
	eSysError=3;
}

message SysMsg
{
	required string log=1 [default=""];
	optional logLevel level=2 [default=eSysInfo];
}
