GrpcPrint/PrintS/protobuf/stream.proto

427 lines
9.8 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;
int32 startLayer = 8; //层供粉量配置使用 struct PowderSet
int32 endLayer = 9;
float powder = 10;
}
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 GeneralInfo{
bool isOk = 1;
bytes job_name = 2; //任务名
JobDimensions jobDimensions = 3; //打印尺寸
bytes material = 4; //打印材料
//repeated Property properties = 4;
}
message MachineType{
message Dimension {
float xmin = 1;
float ymin = 2;
float xmax = 3;
float ymax = 4;
}
message ScanField{
int32 id = 1;
int32 reference = 2;
Dimension dimension = 3;
}
repeated ScanField sf = 1;
bool isOk = 2;
}
message JobDimensions {
float xmin = 1;
float ymin = 2;
float zmin = 3;
float xmax = 4;
float ymax = 5;
float zmax = 6;
}
message PartPosBean{
bytes jobId = 1;
int32 partId = 2;
float xOffset = 3;
float yOffset = 4;
float rotateAngle = 5;
float radians = 6;
float srcPartCenterX = 7;
float srcPartCenterY = 8;
float partCenterX = 9;
float partCenterY = 10;
float selectDataPoint1_1 = 11;
float selectDataPoint1_2 = 12;
float selectDataPoint2_1 = 13;
float selectDataPoint2_2 = 14;
float selectImagePoint1_1 = 15;
float selectImagePoint1_2 = 16;
float selectImagePoint2_1 = 17;
float selectImagePoint2_2 = 18;
bool isSelect = 19;
}
message ParameterSet {
message LaserSet{
int32 id = 1;
float laser_diameter = 2;
float laser_power = 3;
float laser_real_power = 4;
}
int32 scan_field = 1;
int32 id = 2; //key id
bytes name = 3; //<2F><><EFBFBD>ڿ<EFBFBD><DABF>ӻ<EFBFBD>
bytes set_type = 4;
float laser_speed = 5; //Speed in mm/s
LaserSet laser_set = 6;
}
message Parts{
repeated Part ps = 1;
bool isOk = 2;
}
message Part{ //传
int32 id = 1;
int32 sourceId = 2;
bytes name = 3;
JobDimensions dimensions = 4;
PartPosBean partPosBean = 5;
bool print_enable = 6;
uint64 param_pos = 7;
repeated ParameterSet paramSet = 8;
bool isCopy = 9; //是否复制的
JobDimensions layerDimensions = 10;
}
//注册功能返回信息
message RegResponce{
int32 data = 1;
}
message ImgInfoResponce{
uint32 levelImage = 1;
int32 width = 2;
int32 height = 3;
}
//注册功能 IOVersionStr接口 盘符文件路径接口
message ComResponce{
bytes data = 1;
bytes directory = 2;
message FileInfoStruct{
bytes type = 1; //类型
bytes filePath = 2;
bytes fileName = 3;
bytes ext = 4; //后缀
}
repeated FileInfoStruct fileInfo = 3;
bool res = 4;
bool isOk = 5;
}
message Layers{
repeated LayerInfo layer = 1;
bool isOk = 2;
}
message LayerInfo{
int32 index = 1;
uint32 powder = 2; //供粉量 传
uint32 layer_thickness = 3; //传
int32 scan_times = 4; //传
bool isOk = 5;
}
//ScannerCrtlCfg结构体
message ScannerCrtlCfgResp{
repeated ScannerCrtlCfgData scannerCfg = 1;
}
message ScannerCrtlCfgData{
int32 seqNo = 1;
repeated FixPointData fixPointData = 2;
ScanParamCfg scanParamCfg = 3;
ScanParamCfg hatchingParams = 4;
ScanParamCfg borderParams = 5;
ScanParamCfg supportParams = 6;
CorrectParamCfg correctParamCfg = 7;
ScanTestCfg scanTestCfg = 8;
SkyWritingCfg skyWritingCfg = 9;
repeated PowerCompensate powerCompensate = 10;
repeated TimePowerCompensate tPowerCompensate = 11;
int32 controlNo = 12;
int32 serialNo = 13;
int32 controlType = 14;
bytes cardName = 15;
bytes cardIP = 16;
bool isEnable = 17; //是否启动
bool hadAssign = 18;
bool hadMatch = 19;
}
message FixPointData{
int32 id = 1;
int32 cno = 2;
float pointX = 3;
float pointY = 4;
uint32 duration = 5;
}
message ScanParamCfg{
int32 edgeLevel = 1;
int32 edgeLevelMin = 2;
int32 edgeLevelMax = 3;
uint32 jumpDelay = 4;
uint32 jumpDelayMin = 5;
uint32 jumpDelayMax = 6;
uint32 scanDelay = 7;
uint32 scanDelayMin = 8;
uint32 scanDelayMax = 9;
uint32 polygonDelay = 10;
uint32 polygonDelayMin = 11;
uint32 polygonDelayMax = 12;
int64 laseroffDelay = 13;
int64 laseroffDelayMin = 14;
int64 laseroffDelayMax = 15;
int64 laseronDelay = 16;
int64 laseronDelayMin = 17;
int64 laseronDelayMax = 18;
uint32 minJumpDelay = 19;
uint32 minJumpDelayMin = 20;
uint32 minJumpDelayMax = 21;
uint32 jumpLengthLimit = 22;
uint32 jumpLengthLimitMin = 23;
uint32 jumpLengthLimitMax = 24;
double jumpSpeed = 25;
double jumpSpeedMin = 26;
double jumpSpeedMax = 27;
double markSpeed = 28;
double markSpeedMin = 29;
double markSpeedMax = 30;
}
message CorrectParamCfg{
double xmeasureMin = 1; //x可打印最小位置
double xmeasureMax = 2; //x可打印最大位置
double ymeasureMin = 3; //y可打印最小位置
double ymeasureMax = 4; //y可打印最大位置
double xposfix = 5; //x位置修正
double yposfix = 6; //y位置修正
double scanAngle = 7; //旋转角度 逆时针
double scanAngleMin = 8;
double scanAngleMax = 9;
double fixAngle = 10; //旋转角度 逆时针
double fixAngleMin = 11;
double fixAngleMax = 12;
double xcorrect = 13; //x尺寸修正
double ycorrect = 14; //y尺寸修正
double xcorrectMin = 15;
double xcorrectMax = 16;
double ycorrectMin = 17;
double ycorrectMax = 18;
double realXOffset = 19;
double realYOffset = 20;
double factorK = 21;
bool isCorrectFile3D = 22;
bool isDynamicFocus = 23; //是否动态聚焦
double defocusRatio = 24; //离焦比
double defocusRatioMin = 25;
double defocusRatioMax = 26;
}
message ScanTestCfg{
int32 debugShape = 1;
int32 shapeSize = 2;
int32 shapeSizeMin = 3;
int32 shape_size_max = 4;
int32 laser_power = 5;
int32 laser_power_min = 6;
int32 laser_power_max = 7;
double defocus = 8;
double defocus_min = 9;
double defocus_max = 10;
bool is_cycle = 11;
double cross_x = 12;
double cross_y = 13;
double z_distance = 14;
bool isAutoHeatingScanner = 15; //开启暂停开始时预热振镜
uint32 autoHeatingScannerMinutes = 16;
uint32 autoHeatingScannerSize = 17;
double autoHeatingScannerSpeed = 18;
double mark_test_start_x = 19;
double mark_test_start_y = 20;
double mark_test_end_x = 21;
double mark_test_end_y = 22;
}
message SkyWritingCfg{
bool isEnable = 1;
double timelag = 2;
double timelagMin = 3;
double timelagMax = 4;
int64 laserOnShift = 5;
int64 laserOnShiftMin = 6;
int64 laserOnShiftMax = 7;
uint32 nprev = 8;
uint32 nprevMin =9;
uint32 nprevMax = 10;
uint32 npost = 11;
uint32 npostMin = 12;
uint32 npostMax = 13;
int32 mode = 14;
double limite = 15;
double limiteMin = 16;
double limiteMax = 17;
}
message PowerCompensate{
int32 cno = 1;
int32 percent = 2;
float value = 3;
float value_min = 4;
float value_max = 5;
}
message TimePowerCompensate{
int32 id = 1;
int32 cno = 2;
uint32 startMinute = 3;
uint32 endMinute = 4;
float compensate = 5;
}
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) {} // 双向数据流模式
}