Files

137 lines
5.4 KiB
Protocol Buffer
Raw Permalink 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.
syntax = "proto3";
package laserweld.command;
option csharp_namespace = "Laserweld.Protos.Command";
// ===== Java / Android 必须的配置 =====
option java_multiple_files = true;
option java_package = "com.lxsoft.weld.grpc";
option java_outer_classname = "CommandProto";
import "common.proto";
import "project_manager.proto";
import "project.proto";
import "motion.proto";
import "teach.proto";
// ==================== 命令服务 ====================
// 统一命令通道:所有非高优先级命令
// 高优先级 Stop 使用 MotionService.Stop()
// 坐标同步使用 CoordinateService
service CommandService {
// 双向流:发送命令,接收 Ack + Result
rpc Execute(stream CommandRequest) returns (stream CommandResponse);
}
// ==================== 请求 ====================
message CommandRequest {
string id = 1; // 命令唯一ID
oneof command {
// ========== 项目管理 ==========
laserweld.project_manager.CreateProject create_project = 10;
laserweld.project_manager.RenameProject rename_project = 11;
laserweld.project_manager.OpenProject open_project = 12;
laserweld.project_manager.CloseProject close_project = 13;
laserweld.project_manager.DeleteProject delete_project = 14;
laserweld.project_manager.ExportProject export_project = 15;
laserweld.project_manager.ImportProject import_project = 16;
laserweld.project_manager.QueryProjects query_projects = 17;
laserweld.project_manager.DownloadProject download_project = 18;
// ========== 项目详情 ==========
laserweld.project.GetProjectDetail get_project_detail = 30;
laserweld.project.GetGeneralProc get_general_proc = 31;
laserweld.project.SetGeneralProc set_general_proc = 32;
laserweld.project.GetEmptyProc get_empty_proc = 33;
laserweld.project.SetEmptyProc set_empty_proc = 34;
laserweld.project.GetInputPortNames get_input_port_names = 35;
laserweld.project.GetOutputPortNames get_output_port_names = 36;
// ========== 轨迹操作 ==========
laserweld.project.AddTrack add_track = 50;
laserweld.project.AddSubTrack add_sub_track = 51;
laserweld.project.DeleteTrack delete_track = 52;
laserweld.project.DeleteTracks delete_tracks = 53;
laserweld.project.ModifyTrack modify_track = 54;
laserweld.project.InsertTrack insert_track = 55;
laserweld.project.ModifyProc modify_proc = 56;
// ========== 示教控制 ==========
laserweld.teach.StartProcess start_process = 70;
laserweld.teach.KeepProcess keep_process = 71;
laserweld.teach.StopProcess stop_process = 72;
laserweld.teach.MoveToTrack move_to_track = 73;
laserweld.teach.ForwardTrack forward_track = 74;
laserweld.teach.BackwardTrack backward_track = 75;
// ========== 运动控制(非紧急)==========
laserweld.motion.GetPhysicModel get_physic_model = 90;
laserweld.motion.GetCoordinateEnable get_coordinate_enable = 91;
laserweld.motion.GetCurrentCoord get_current_coord = 92;
laserweld.motion.ResetCoord reset_coord = 93;
laserweld.motion.GetBackHomeInfo get_back_home_info = 94;
laserweld.motion.BackHome back_home = 95;
laserweld.motion.BackZero back_zero = 96;
laserweld.motion.SetRTCP set_rtcp = 97;
laserweld.motion.AlignCoord align_coord = 98;
laserweld.motion.MoveTo move_to = 99;
laserweld.motion.MoveAxis move_axis = 100;
laserweld.motion.MoveAxisContinuous move_axis_continuous = 101;
laserweld.motion.StopAxisContinuous stop_axis_continuous = 102;
}
}
// ==================== 响应 ====================
message CommandResponse {
string command_id = 1; // 对应的命令ID
oneof response {
laserweld.common.Ack ack = 2;
CommandResult result = 3;
}
}
// 端口名称列表(用于 GetInputPortNames/GetOutputPortNames 返回)
message PortNames {
repeated string names = 1;
}
// 命令结果
message CommandResult {
// 基础结果字段(对应 Result)
bool success = 1;
string message = 2;
int32 error_code = 3;
int64 completed_at = 4;
// 返回数据(对应 Result<T> 的 Value
oneof data {
// 项目管理
laserweld.project_manager.Project project = 10; // Create/Open 返回
laserweld.project_manager.ProjectList projects = 11; // Query 返回
bytes raw_data = 12; // Export 返回
// 项目详情
laserweld.common.ProjectDetail project_detail = 20; // GetProjectDetail 返回
laserweld.common.GeneralProc general_proc = 21; // Get/SetGeneralProc 返回
laserweld.common.EmptyProc empty_proc = 22; // Get/SetEmptyProc 返回
PortNames port_names = 23; // GetInputPortNames/GetOutputPortNames 返回
// 轨迹操作
laserweld.common.TrackItem track_item = 30; // Add/Modify/Insert 返回
// 运动控制
string physic_model = 40; // GetPhysicModel 返回
laserweld.motion.CoordinateEnableData coordinate_enable = 41; // GetCoordinateEnable 返回
laserweld.common.Vector6d current_coord = 42; // GetCurrentCoord 返回
string back_home_info = 44; // GetBackHomeInfo 返回
// 示教控制
uint32 track_id = 43; // MoveToTrack/ForwardTrack/BackwardTrack 返回
}
}