diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 97910bb7..94d6bcfd 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 712f2457..760f384b 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -122,6 +122,28 @@ namespace Step.NC return cmsError; } + public CmsError DeactivateProgram(out DTOActiveProgramDataModel dtoData) + { + dtoData = new DTOActiveProgramDataModel(); + // Get selectedProcess process id + ushort selectedProcess = 0; + CmsError cmsError = numericalControl.PROC_RSelectedProcess(ref selectedProcess); + if (cmsError.IsError()) + return cmsError; + + ActiveProgramDataModel data = new ActiveProgramDataModel(); + cmsError = numericalControl.FILES_WDeactivateProgram(selectedProcess); + + dtoData = new DTOActiveProgramDataModel() + { + IsoLines = data.IsoLines, + Path = data.Path, + TimeLeft = data.TimeLeft + }; + + return cmsError; + } + #endregion #region Read Data diff --git a/Step/Controllers/WebApi/NcFileController.cs b/Step/Controllers/WebApi/NcFileController.cs index 227507a0..8af478c5 100644 --- a/Step/Controllers/WebApi/NcFileController.cs +++ b/Step/Controllers/WebApi/NcFileController.cs @@ -67,6 +67,21 @@ namespace Step.Controllers.WebApi } } + [Route("file/deactivate"), HttpPut] + public IHttpActionResult DeactivateProgram() + { + using (NcHandler ncHandler = new NcHandler()) + { + ncHandler.Connect(); + + CmsError cmsError = ncHandler.DeactivateProgram(out DTOActiveProgramDataModel fileInfo); + if (cmsError.IsError()) + return BadRequest(cmsError.localizationKey); + + return Ok(fileInfo); + } + } + [Route("upload"), HttpPost] public async Task AddAttachment() {