diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 658bcdc2..6f267ceb 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Core/ThreadsFunctions.cs b/Step.Core/ThreadsFunctions.cs index 214086c3..1bc2b278 100644 --- a/Step.Core/ThreadsFunctions.cs +++ b/Step.Core/ThreadsFunctions.cs @@ -431,7 +431,7 @@ public static class ThreadsFunctions ReadAxesNamesTimes++; // Wait - Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds)); + Thread.Sleep(CalcSleepTime(1000, (int)sw.ElapsedMilliseconds)); } } catch (ThreadAbortException) @@ -497,7 +497,7 @@ public static class ThreadsFunctions switch (cmsError.errorCode) { case CMS_ERROR_CODES.NC_PROD_ERROR: - Manage(ERROR_LEVEL.WARNING, cmsError.message); + Manage(ERROR_LEVEL.WARNING, cmsError.localizationKey); break; case CMS_ERROR_CODES.NOT_CONNECTED: @@ -526,11 +526,11 @@ public static class ThreadsFunctions break; case CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND: - Manage(ERROR_LEVEL.FATAL, cmsError.message); + Manage(ERROR_LEVEL.FATAL, cmsError.localizationKey); break; case CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING: - Manage(ERROR_LEVEL.WARNING, cmsError.message); + Manage(ERROR_LEVEL.WARNING, cmsError.localizationKey); TryNcConnection(); // If not connected try reconnection break; } diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index 61cf5017..901edbe5 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -853,9 +853,9 @@ namespace Step.NC return numericalControl.TOOLS_WLoadToolIntoShank(shankId, positionId, toolId); } - public CmsError UnloadTooolFromShank(int shankId, int positionId, int toolId) + public CmsError UnloadTooolFromShank(int shankId, int positionId) { - return numericalControl.TOOLS_WUnloadToolFromShank(shankId, positionId, toolId); + return numericalControl.TOOLS_WUnloadToolFromShank(shankId, positionId); } #endregion diff --git a/Step/Controllers/SignalR/NcHub.cs b/Step/Controllers/SignalR/NcHub.cs index d57c3246..da07c31f 100644 --- a/Step/Controllers/SignalR/NcHub.cs +++ b/Step/Controllers/SignalR/NcHub.cs @@ -84,7 +84,7 @@ namespace Step.Controllers.SignalR // Call the library functions libraryError = ncHandler.RefreshAlarm(id); if (libraryError.IsError()) - throw new HubException(libraryError.message); + throw new HubException(libraryError.localizationKey); } MessageServices.Current.Publish(SHOW_MSG_UI, null, "Refresh Single Alarm. ID: " + id); @@ -99,7 +99,7 @@ namespace Step.Controllers.SignalR // Call the library functions libraryError = ncHandler.RestoreAlarm(id); if (libraryError.IsError()) - throw new HubException(libraryError.message); + throw new HubException(libraryError.localizationKey); } MessageServices.Current.Publish(SHOW_MSG_UI, null, "Recovery Alarm. ID: " + id); @@ -114,7 +114,7 @@ namespace Step.Controllers.SignalR // Write the click into memory CmsError libraryError = ncHandler.PutNcSoftKeyClick((uint)id); if (libraryError.IsError()) - throw new HubException(libraryError.message); + throw new HubException(libraryError.localizationKey); } } @@ -163,7 +163,7 @@ namespace Step.Controllers.SignalR // Put value into memory libraryError = ncHandler.PutSelectProcess(procNumber); if (libraryError.IsError()) - throw new HubException(libraryError.message); + throw new HubException(libraryError.localizationKey); } } @@ -177,7 +177,7 @@ namespace Step.Controllers.SignalR // Put value into memory libraryError = ncHandler.PutSelectAxis(axisId); if (libraryError.IsError()) - throw new HubException(libraryError.message); + throw new HubException(libraryError.localizationKey); } } @@ -192,7 +192,7 @@ namespace Step.Controllers.SignalR // Put value into memory libraryError = ncHandler.PutOverride(id, "plus"); if (libraryError.IsError()) - throw new HubException(libraryError.message); + throw new HubException(libraryError.localizationKey); } } @@ -207,7 +207,7 @@ namespace Step.Controllers.SignalR // Put value into memory libraryError = ncHandler.PutOverride(id, "minus"); if (libraryError.IsError()) - throw new HubException(libraryError.message); + throw new HubException(libraryError.localizationKey); } } } diff --git a/Step/Controllers/WebApi/ConfigurationController.cs b/Step/Controllers/WebApi/ConfigurationController.cs index 432e2b6f..9a116907 100644 --- a/Step/Controllers/WebApi/ConfigurationController.cs +++ b/Step/Controllers/WebApi/ConfigurationController.cs @@ -132,7 +132,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.GetToolTableConfiguration(out ToolTableConfiguration toolTableConfiguration); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(toolTableConfiguration); } diff --git a/Step/Controllers/WebApi/NcApiController.cs b/Step/Controllers/WebApi/NcApiController.cs index 434a21a0..8a30ee7a 100644 --- a/Step/Controllers/WebApi/NcApiController.cs +++ b/Step/Controllers/WebApi/NcApiController.cs @@ -22,7 +22,7 @@ namespace Step.Controllers.WebApi if (libraryError.errorCode == CMS_ERROR_CODES.NOT_CONNECTED) return Ok(genericData); else - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(genericData); } diff --git a/Step/Controllers/WebApi/ToolTableController.cs b/Step/Controllers/WebApi/ToolTableController.cs index 30222b02..f04092a0 100644 --- a/Step/Controllers/WebApi/ToolTableController.cs +++ b/Step/Controllers/WebApi/ToolTableController.cs @@ -21,7 +21,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.GetToolTableData(out List tools); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(tools); } @@ -41,7 +41,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.AddTool(ref siemensModel); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(siemensModel); } @@ -63,7 +63,7 @@ namespace Step.Controllers.WebApi CmsError libraryError = ncHandler.UpdateTool(ref siemensModel); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(siemensModel); } @@ -78,7 +78,7 @@ namespace Step.Controllers.WebApi // Call delete library function CmsError libraryError = ncHandler.DeleteTool(id); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(); } @@ -92,7 +92,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.GetFamiliesData(out List families); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(families); } @@ -109,7 +109,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.AddFamily(family.Name, out FamilyModel newFamily); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(newFamily); } @@ -127,7 +127,7 @@ namespace Step.Controllers.WebApi CmsError libraryError = ncHandler.UpdateFamilyName(oldName, family.Name); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(family); } @@ -142,7 +142,7 @@ namespace Step.Controllers.WebApi // Call delete library function CmsError libraryError = ncHandler.DeleteFamily(name); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(); } @@ -156,7 +156,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.GetMagazinesPositionsData(out List magazines); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(magazines); } @@ -183,7 +183,7 @@ namespace Step.Controllers.WebApi // Update CmsError libraryError = ncHandler.UpdateMagazinePosition(pos); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(); } @@ -197,7 +197,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.GetShanksData(out List shanks); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(shanks); } @@ -216,7 +216,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.AddShank(ref shank); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(shank); } @@ -236,7 +236,7 @@ namespace Step.Controllers.WebApi ncHandler.Connect(); CmsError libraryError = ncHandler.UpdateShank(ref shank); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(shank); } @@ -251,7 +251,7 @@ namespace Step.Controllers.WebApi // Call delete library function CmsError libraryError = ncHandler.DeleteShank(id); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(); } @@ -272,7 +272,7 @@ namespace Step.Controllers.WebApi // Call library add methods CmsError libraryError = ncHandler.AddEdge(toolId, ref edge); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(edge); } @@ -294,7 +294,7 @@ namespace Step.Controllers.WebApi // Call library add methods CmsError libraryError = ncHandler.UpdateEdge(toolId, ref edge); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(edge); } @@ -309,7 +309,7 @@ namespace Step.Controllers.WebApi // Call delete library function CmsError libraryError = ncHandler.DeleteEdge(toolId, edgeId); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(); } @@ -324,7 +324,7 @@ namespace Step.Controllers.WebApi // Call delete library function CmsError libraryError = ncHandler.GetMagazinePositionsAndTools(magazineId, out List magazinePos); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(magazinePos); } @@ -339,7 +339,7 @@ namespace Step.Controllers.WebApi // Call delete library function CmsError libraryError = ncHandler.GetNotInMagazinesTools(out List multiTools, out List tools); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(new { @@ -363,7 +363,7 @@ namespace Step.Controllers.WebApi // Call delete library function CmsError libraryError = ncHandler.LoadToolInMagazine(magazineId, libraryMag); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(newMag); } @@ -382,7 +382,7 @@ namespace Step.Controllers.WebApi // Call delete library function CmsError libraryError = ncHandler.UnloadToolInMagazine(magazineId, positionId); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(); } @@ -400,14 +400,14 @@ namespace Step.Controllers.WebApi CmsError libraryError = ncHandler.LoadTooolFromShank(shankId, positionId, toolId); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(); } } - [Route("shank/{shankId:int}/unload/{positionId:int}/{toolId:int}"), HttpPut] - public IHttpActionResult UnloadToolFromShank(int shankId, int positionId, int toolId) + [Route("shank/{shankId:int}/unload/{positionId:int}"), HttpPut] + public IHttpActionResult UnloadToolFromShank(int shankId, int positionId) { if (!ModelState.IsValid) return BadRequest(ModelState); @@ -416,9 +416,9 @@ namespace Step.Controllers.WebApi { ncHandler.Connect(); - CmsError libraryError = ncHandler.UnloadTooolFromShank(shankId, positionId, toolId); + CmsError libraryError = ncHandler.UnloadTooolFromShank(shankId, positionId); if (libraryError.IsError()) - return BadRequest(libraryError.message); + return BadRequest(libraryError.localizationKey); return Ok(); } diff --git a/Step/wwwroot/src/services/toolingService.ts b/Step/wwwroot/src/services/toolingService.ts index 7abcc83f..b47335bb 100644 --- a/Step/wwwroot/src/services/toolingService.ts +++ b/Step/wwwroot/src/services/toolingService.ts @@ -150,7 +150,7 @@ export class ToolingService extends baseRestService { } async removeToolToShank(shank: any, model: any){ - var response = await this.Put(this.BASE_URL + "shank/"+ shank.id + "/unload/" + model.multitoolId + "/" + model.id, model); + var response = await this.Put(this.BASE_URL + "shank/"+ shank.id + "/unload/" + model.multitoolId, model); toolingActions.removeToolToShank(store,{shank, model}); return response; }