syntax = "proto3"; import "google/protobuf/timestamp.proto"; import "google/protobuf/empty.proto"; package Hexagon.MTM.V1; service MTMService { rpc GetMachineStatus(google.protobuf.Empty) returns (stream GetMachineStatusResponse); //Server response stram rpc GetProgramStatus(google.protobuf.Empty) returns (stream GetProgramStatusResponse); //Server response stram rpc UploadFile(stream UploadFileRequest) returns (UploadFileResponse); //Client request stream rpc DownloadMacroFile(DownloadMacroRequest) returns (stream DownloadMacroResponse); rpc GetJournals(stream GetJournalsRequest) returns (stream GetJournalsResponse); // Both ways stream rpc GetDFQFiles(stream GetDFQFilesRequest) returns (stream GetDFQFilesResponse); //Both ways stream rpc GetReportJasonFiles(stream GetReportJasonFilesRequest) returns (stream GetReportJasonFilesResponse); // Both ways stream rpc ReadMacroVariable(ReadMacroRequest) returns (ReadMacroResponse); rpc WriteMacroVariable(WriteMacroRequest) returns (WriteMacroResponse); rpc GetCNCType(google.protobuf.Empty) returns (GetCNCTypeResponse); rpc GetCNCModel(google.protobuf.Empty) returns (GetCNCModelResponse); rpc GetVersion(google.protobuf.Empty) returns (GetVersionResponse); rpc GetAxisInfo(google.protobuf.Empty) returns (GetAxisResponse); rpc GetMachineConfiguration(google.protobuf.Empty) returns (GetMachineConfigurationResponse); rpc GetReportFileList(google.protobuf.Empty) returns (GetReportFileListResponse); rpc DownloadReportFile(DownloadReportFileRequest) returns (stream DownloadReportFileResponse); // Server response stream rpc RequestInteractive(InteractiveRequest) returns (InteractiveResponse); rpc GetInteractiveResult(InteractiveResultRequest) returns (InteractiveResultResponse); rpc GetPRGPreviews(stream PRGPreviewsRequest) returns (stream PRGPreviewsResopnse); //Both ways stream rpc UploadImagePreviews(stream UploadImagePreviewsRequest) returns (UploadImagePreviewsResopnse); rpc ReadPositionStream(google.protobuf.Empty) returns (stream GetPositionResponse); //Server response stram rpc ReadPosition(google.protobuf.Empty) returns (GetPositionResponse); rpc ReadPositionInCurrentWorkOffset(google.protobuf.Empty) returns (GetPositionResponse); rpc StartSamplingPosition(StartSamplingPositionRequest) returns (InteractiveResponse); rpc ReadSamplingPosition(google.protobuf.Empty) returns(ReadSamplingPositionResponse); rpc EndSamplingPosition(google.protobuf.Empty) returns(InteractiveResponse); rpc GetActiveWorkOffset(google.protobuf.Empty) returns (GetActiveWorkOffsetResponse); rpc GetCalibrationResult(google.protobuf.Empty) returns (GetCalibrationResultResponse); rpc GetWorkOffset(GetWorkOffsetRequest) returns (GetWorkOffsetResponse); rpc UpdateWorkOffset(UpdateWorkOffsetRequest) returns (UpdateWorkOffsetResponse); rpc SetMainProgram(SetMainProgramRequest) returns (SetMainProgramResponse); //Set Main Program rpc GetLicenseInfo(google.protobuf.Empty) returns (LicenseInfoResponse); rpc Move(MoveRequest) returns (stream MoveResponse); rpc CancelMove(google.protobuf.Empty) returns (CancelMoveReponse); rpc GetMoveResults(google.protobuf.Empty) returns (GetMoveResultsResponse); rpc GetUnit(google.protobuf.Empty) returns (GetUnitResponse); rpc SendMsg(SendMsgRequest) returns (SendMsgResponse); rpc GetMsgResult(google.protobuf.Empty) returns (stream GetMsgResultResponse); } enum MachineStatus { machine_offline = 0; machine_idle = 1; machine_running = 2; machine_alarm = 3; } enum ProgramStatus { prog_none = 0; prog_executing = 1; prog_exec_success = 2; prog_exec_error = 3; } enum UploadFileTypes { cnc_macro = 0; cnc_measurement_routine = 1; pcd_report = 2; xmdf = 3; dat = 4; } message GetMachineStatusResponse { MachineStatus State = 1; string AlarmInfo = 2; string ProgramNumber = 3; } message GetProgramStatusResponse { ProgramStatus State = 1; bool IsDCM = 2; string ProgramName = 3; string ExecErrInfo = 4; } message UploadFileRequest { bytes FileData = 1; string FileName = 2; bool FileEOF = 3; bool NeedUploadMacro = 4; UploadFileTypes FileType = 5; string ControlPath = 6; bool TransferredToNCProgram = 7; } message DownloadMacroRequest { string FileName = 1; string ControlPath = 2; } message DownloadMacroResponse { bool IsSuccess = 1; string ErrInfo = 2; bytes FileData = 3; bool FileEOF = 4; } message UploadFileResponse { bool IsSuccess = 1; string ErrInfo = 2; } message GetJournalsRequest { int64 FileId = 1; bool FileOK = 2; } message GetJournalsResponse { int64 FileId = 1; string FileName = 2; bytes FileData = 3; bool FileEOF = 4; } message GetDFQFilesRequest { int64 FileId = 1; bool FileOK = 2; } message GetDFQFilesResponse { int64 FileId = 1; string FileName = 2; bytes FileData = 3; bool FileEOF = 4; } message GetReportJasonFilesRequest { int64 FileId = 1; bool FileOK = 2; } message GetReportJasonFilesResponse { int64 FileId = 1; string FileName = 2; bytes FileData = 3; bool FileEOF = 4; } message WriteMacroResponse { bool IsSuccess = 1; string ErrInfo = 2; } message WriteMacroRequest{ uint32 MacNumber = 1; double MacValue = 2; } message ReadMacroRequest { uint32 MacNumber = 1; } message ReadMacroResponse { bool IsSuccess = 1; string ErrInfo = 2; double MacValue = 3; } message GetCNCTypeResponse { string CNCTypeName = 1; } message GetCNCModelResponse { string CNCModelName = 1; } message GetVersionResponse { string MTMNetVersion = 1; string NCGageVersion = 2; string CNCApiVersion = 3; } message GetAxisResponse { repeated AxisItem AxisData = 1; //Object } message AxisItem { string Name = 1; string KinematicsType = 2; string Number = 3; } message ReportFileEntity { string FileName = 1; int64 FileSize = 2; google.protobuf.Timestamp LastWriteTimeUTC = 3; } message GetReportFileListResponse { repeated ReportFileEntity ReportFileList = 1; } message DownloadReportFileRequest { string FileName = 1; } message DownloadReportFileResponse { bytes FileData = 1; bool FileEOF = 2; } enum eMeasurementUnits { mm = 0; inch =1; } message RotateAxisCenter { string AxisName = 1; double RotateCenterX = 2; double RotateCenterY = 3; double RotateCenterZ = 4; double RotateVectorX = 5; double RotateVectorY = 6; double RotateVectorZ = 7; } enum MachineTypes { horizontal = 0; vertical = 1; lathe = 2; } message GetMachineConfigurationResponse { bool IsSuccess = 1; string ErrInfo = 2; string FileContent = 3; } enum InteractiveTypes { update_workoffset = 0; update_tooloffset = 1; write_var = 2; read_var = 3; } enum ImageTypes { png = 0; jpeg = 1; bmp = 2; } message InteractiveRequest { InteractiveTypes ReqType = 1; string ReqName = 2; bytes ReqData = 3; } message InteractiveResponse { bool IsSuccess = 1; string ErrInfo = 2; } message InteractiveResultRequest { InteractiveTypes ReqType = 1; string ReqName = 2; bool NeedSave = 3; } message InteractiveResultResponse { bool IsSuccess = 1; string ErrInfo = 2; double ValueOfReadVar = 3; } message PRGPreviewsRequest { string PrgFileName = 1; ImageTypes ImageType = 2; bytes ImageData = 3; bool ImageDataEOF = 4; } message PRGPreviewsResopnse { string PrgFileName = 1; ImageTypes ImageType = 2; } message UploadImagePreviewsRequest { string FileName = 1; ImageTypes ImageType = 2; bytes ImageData = 3; bool ImageDataEOF = 4; } message UploadImagePreviewsResopnse { bool IsSuccess = 1; string ErrInfo = 2; } message MachineAxisItem { string AxisName = 1; double AxisValue = 2; } message GetPositionResponse { repeated MachineAxisItem Axis = 1; } message StartSamplingPositionRequest { bytes SamplAxis =1; int32 NumAxis = 2; int32 MaxSamplingPoints = 3; } message ReadSamplingPositionResponse { bool IsSuccess = 1; string ErrInfo = 2; int64 DataNum = 3; repeated SamplingPositionData SamplData = 4; } message SamplingPositionData { int32 DelayTime = 1; uint32 DataFlag = 2; repeated int32 PosData = 3; } message GetActiveWorkOffsetResponse { bool IsSuccess = 1; string ErrInfo = 2; string GCode = 3; repeated MachineAxisItem Axis = 4; } enum KinematicsTypes { Linear = 0; RotaryTable = 1; Wrist = 2; } message CalibratedAxis { string AxisName = 1; KinematicsTypes KinematicsType = 2; double X = 3; double Y = 4; double Z = 5; double I = 6; double J = 7; double K = 8; } message GetCalibrationResultResponse { bool IsSuccess = 1; string ErrInfo = 2; string FileContent = 3; repeated CalibratedAxis CalibratedRotaryAxes = 4; } message WorkoffsetValue { string X = 1; string Y = 2; string Z = 3; string A = 4; string B = 5; string C = 6; string U = 7; string V = 8; string W = 9; } message GetWorkOffsetRequest{ string workOffsetCode = 1; } message GetWorkOffsetResponse { bool IsSuccess = 1; string ErrInfo = 2; WorkoffsetValue Value = 3; } message UpdateWorkOffsetRequest { string workOffsetCode = 1; WorkoffsetValue Value = 2; } message UpdateWorkOffsetResponse { bool IsSuccess = 1; string ErrInfo = 2; } message SetMainProgramRequest { uint32 ProgramNumber = 1; } message SetMainProgramResponse { bool IsSuccess = 1; string ErrInfo = 2; } enum LicenseType { Trial = 0; Permanent = 1; } message LicenseInfoResponse { bool IsSuccess = 1; string ErrInfo = 2; LicenseType type = 3; google.protobuf.Timestamp StartTime = 4; uint32 NumberOfDays = 5; // Trial: number of days left; Permanent: free upgrade left days } enum CommandStatus { ToDo = 0; InProcess = 1; Success = 2; Error = 3; } enum MoveType { Absolute = 0; Relative = 1; } enum MsgType { Message = 0; Input = 1; } enum MsgStyle { OkOnly = 0; OkCancel = 1; AbortRetryIgnore = 2; YesNoCancel = 3; YesNo = 4; RetryCancel = 5; } enum MsgClickedButton { None = 0; Ok = 1; Cancel = 2; Abort = 3; Retry = 4; Ignore = 5; Yes = 6; No = 7; } message SendMsgRequest { MsgType Type = 1; MsgStyle Style = 2; string MessageText = 3; string InputName = 4; } message SendMsgResponse { bool IsSuccess = 1; string ErrInfo = 2; uint64 MsgId = 3; } message GetMsgResultResponse { uint64 MsgId = 1; MsgClickedButton ClickedButton = 2; string InputValue = 3; } message MoveCommand { string Tag = 1; repeated AxisMovePosition TargetPosition = 2; double Feedrate = 3; MoveType MoveType = 4; } message MoveRequest { repeated MoveCommand Commands = 1; } message MoveResponse { bool IsSuccess = 1; string ErrInfo = 2; string Tag = 3; CommandStatus Status = 4; } message CancelMoveReponse { bool IsSuccess = 1; string ErrInfo = 2; } message GetMoveResultsResponse { repeated MoveResponse CommandResults = 1; } message AxisMovePosition { string AxisName = 1; double AxisValue = 2; } message GetUnitResponse { bool IsSuccess = 1; string ErrInfo = 2; eMeasurementUnits Unit = 3; }