diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 3a419291..1f441b3b 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index dca53bc2..15997179 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -769,6 +769,20 @@ namespace Step.NC return numericalControl.TOOLS_WUpdateMagazinesPositions(magazinePosition); } + public CmsError DeleteTool(int id) + { + return numericalControl.TOOLS_WDeleteTool(id); + } + + public CmsError DeleteShank(int id) + { + return numericalControl.TOOLS_WDeleteShank(id); + } + + public CmsError DeleteFamily(string name) + { + return numericalControl.TOOLS_WDeleteFamily(name); + } #endregion #endregion Write data diff --git a/Step/Controllers/WebApi/ToolTableController.cs b/Step/Controllers/WebApi/ToolTableController.cs index 5056a431..c47f42be 100644 --- a/Step/Controllers/WebApi/ToolTableController.cs +++ b/Step/Controllers/WebApi/ToolTableController.cs @@ -229,5 +229,55 @@ namespace Step.Controllers.WebApi return Ok(); } } + + [Route("tool/{id:int}"), HttpDelete] + public IHttpActionResult DeleteTool(int id) + { + using (NcHandler ncHandler = new NcHandler()) + { + ncHandler.Connect(); + // Call delete library function + CmsError libraryError = ncHandler.DeleteTool(id); + if (libraryError.IsError()) + if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED) + return BadRequest(libraryError.message); + + return Ok(); + } + } + + [Route("shank/{id:int}"), HttpDelete] + public IHttpActionResult DeleteShank(int id) + { + using (NcHandler ncHandler = new NcHandler()) + { + ncHandler.Connect(); + // Call delete library function + CmsError libraryError = ncHandler.DeleteShank(id); + if (libraryError.IsError()) + if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED) + return BadRequest(libraryError.message); + + return Ok(); + } + } + + [Route("family/{name}"), HttpDelete] + public IHttpActionResult DeleteFamily(string name) + { + using (NcHandler ncHandler = new NcHandler()) + { + ncHandler.Connect(); + // Call delete library function + CmsError libraryError = ncHandler.DeleteFamily(name); + if (libraryError.IsError()) + if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED) + return BadRequest(libraryError.message); + + return Ok(); + } + } + + } } \ No newline at end of file