GrpcPrint/PrintS/protobuf/stream.proto

140 lines
3.5 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//bytes替代string 防止乱码
syntax = "proto3";
import "google/protobuf/any.proto";
package stream;
//ption cc_generic_services = true;
option java_multiple_files = true;
option java_package = "io.grpc.examples.stream";
option java_outer_classname = "StreamProto";
option objc_class_prefix = "ST";
enum TYPE{
iBOOL = 0;
iSHORT = 1;
iUSHORT = 2;
iINT = 3;
iUINT = 4;
iFLOAT = 5;
iSTRING = 6;
iCHAR = 7;
iUCHAR = 8;
iWORD = 9;
iDOUBLE = 10;
iTIMET = 11;
}
enum DATAHANDLE {
UPDATE = 0;
ADD = 1;
DEL = 2;
}
/*==================begin 通用通信结构体====================*/
message ParamInfo{
bytes nameKey = 1; //参数key
bytes strValue = 2; //value
TYPE valueType = 3; //数据类型
bytes context = 4; //alarmcfg 使用
bool isEnable = 5;
bool isAlarm = 6;
bool isShow = 7;
}
message RequestInfo { //读
uint32 dataType = 1; //信息类型
bytes nameKey = 2; //参数key
bytes strValue = 3; //value值
TYPE valueType = 4; //value数据类型
DATAHANDLE handleType = 5; //增删改
repeated ParamInfo item = 6; //参数值列表(函数参数使用)
}
message ResponseInfo { //写
uint32 dataType = 1; //信息类型
bool result = 2; //执行成功与否
repeated ParamInfo item = 3; //参数值
}
/*==================end 通用通信结构体====================*/
message ResponseAny{
google.protobuf.Any data = 1;
}
/*==================begin h3d图层结构体===================*/
message LayerData{
float zCooldinate = 1; // Z 坐标 : Float 单位 mm
float powder = 2; // 供粉量: Float 单位 mm
float layerThickness = 3; //层厚
//LayerSummary layerSummary = 3; // 层统计区() : Struct
//uint32 layerBlock = 5; //层块数 决定多少个层块数据库
repeated LayerDataBlock layerDataBlock = 4; //层块数据区
bool result = 5; //是否ok
}
message LayerDataBlock
{
int32 elementId = 1; // 零件 ID : Int32
int32 elementParamId = 2; // 零件参数 ID : Int32
//DataBlockSummary dbSummary = 3; //块统计区 : Struct
//uint32 blockNum = 4; // 块数据数: Uint32 //决定有多少个块数据区
uint32 blockType = 3; // 块类型: Char //1 代表向量型数据块3 代表链型数据块
repeated VectorDataBlock vecBlocks= 4; //块数据区 向量型
repeated ChainDataBlock chainBlocks = 5; //块数据区 链型
uint32 order = 6;
}
message VectorDataBlock{
float startX = 1; // 始点 X 位置 : Float //单位 mm
float startY=2; // 始点 Y 位置 : Float //单位 mm
float endX = 3; // 终点 X 位置 : Float //单位 mm
float endY = 4; // 终点 Y 位置 : Float //单位 mm
}
message ChainDataBlock
{
uint32 dotNum = 1; // 点数:Uint32 //决定有多少个点区
repeated Point pointVec = 2; // 点区
}
message Point{
float xPos = 1; // X 位置 : Float //单位 mm
float yPos = 2; // Y 位置 : Float //单位 mm
}
//注册功能返回信息
message RegResponce{
int32 data = 1;
}
message ImgInfoResponce{
uint32 levelImage = 1;
int32 width = 2;
int32 height = 3;
}
//注册功能返回信息 IOVersionStr接口返回值
message ComResponce{
bytes data = 1;
}
service Stream {
rpc Simple(RequestInfo) returns (ResponseAny) {} // 简单模式
rpc ServerStream (RequestInfo) returns (stream ResponseInfo) {} // 服务端数据流模式
rpc ClientStream (stream RequestInfo) returns (ResponseInfo) {} // 客户端数据流模式
rpc AllStream (stream RequestInfo) returns (stream ResponseInfo) {} // 双向数据流模式
}