diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 789103ef..6cd3cd40 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Config/Config/AlarmsConfig.xml b/Step.Config/Config/AlarmsConfig.xml index ca9179a7..9b110d04 100644 --- a/Step.Config/Config/AlarmsConfig.xml +++ b/Step.Config/Config/AlarmsConfig.xml @@ -1,5 +1,5 @@  - + 1 1 @@ -5120,4 +5120,4 @@ 1024 false - \ No newline at end of file + \ No newline at end of file diff --git a/Step.Config/Config/alarmsConfigValidator.xsd b/Step.Config/Config/alarmsConfigValidator.xsd index 69c18779..9f59bd83 100644 --- a/Step.Config/Config/alarmsConfigValidator.xsd +++ b/Step.Config/Config/alarmsConfigValidator.xsd @@ -1,6 +1,6 @@  - + diff --git a/Step.Config/Config/headsConfig.xml b/Step.Config/Config/headsConfig.xml index 40ab86d4..f9820c95 100644 --- a/Step.Config/Config/headsConfig.xml +++ b/Step.Config/Config/headsConfig.xml @@ -1,5 +1,5 @@  - + Testa 1 SPINDLE @@ -18,4 +18,4 @@ 55 80 - \ No newline at end of file + \ No newline at end of file diff --git a/Step.Config/Config/headsConfigValidator.xsd b/Step.Config/Config/headsConfigValidator.xsd index 0eeb57c2..72af6110 100644 --- a/Step.Config/Config/headsConfigValidator.xsd +++ b/Step.Config/Config/headsConfigValidator.xsd @@ -1,6 +1,6 @@  - + diff --git a/Step.Config/Config/maintenancesConfig.xml b/Step.Config/Config/maintenancesConfig.xml index 9854087d..1d6f8277 100644 --- a/Step.Config/Config/maintenancesConfig.xml +++ b/Step.Config/Config/maintenancesConfig.xml @@ -1,5 +1,5 @@  - + 1 @@ -22,4 +22,4 @@ machine_interval 1 - \ No newline at end of file + \ No newline at end of file diff --git a/Step.Config/Config/maintenancesConfigValidator.xsd b/Step.Config/Config/maintenancesConfigValidator.xsd index 8178ed15..acc70b41 100644 --- a/Step.Config/Config/maintenancesConfigValidator.xsd +++ b/Step.Config/Config/maintenancesConfigValidator.xsd @@ -1,6 +1,6 @@  - + diff --git a/Step.Config/Config/ncSoftKeyConfig.xml b/Step.Config/Config/ncSoftKeyConfig.xml index a22ba79f..f30126ca 100644 --- a/Step.Config/Config/ncSoftKeyConfig.xml +++ b/Step.Config/Config/ncSoftKeyConfig.xml @@ -1,142 +1,142 @@  - true + true Auto false - true + true Edit false - true + true Mdi false - true + true Dnc false - true + true Ref false - true + true Jog false - true + true Jog Inc false - true + true Restart false - true + true Teach false - true + true Restract false - true + true Wcs Mcs false - true + true Handle true - true + true Reset false - true + true Blk/Blk false - true + true Blk Del false - true + true OpStop false - true + true DryRun false - true + true PrgTest false - true + true Manual Handle Interrupt true - true + true Teach In false - true + true Inc Planefalse - true + true + false - true + true - false - true + true Rapid false - true + true x1 false - true + true x10 false - true + true x10 false - true + true x10 false diff --git a/Step.Config/Config/ncSoftKeyConfigValidator.xsd b/Step.Config/Config/ncSoftKeyConfigValidator.xsd index 7384a502..7134f622 100644 --- a/Step.Config/Config/ncSoftKeyConfigValidator.xsd +++ b/Step.Config/Config/ncSoftKeyConfigValidator.xsd @@ -7,7 +7,7 @@ - + diff --git a/Step.Config/Config/serverConfig.xml b/Step.Config/Config/serverConfig.xml index 95a9f468..9ed5e08e 100644 --- a/Step.Config/Config/serverConfig.xml +++ b/Step.Config/Config/serverConfig.xml @@ -1,17 +1,17 @@ - + - DEMO + OSAI true - localhost + 192.168.157.2 8080 Ares 37 OF 9000 - + * en true localhost - \ No newline at end of file + \ No newline at end of file diff --git a/Step.Config/Config/serverConfigValidator.xsd b/Step.Config/Config/serverConfigValidator.xsd index 6b78d897..a704ecd9 100644 --- a/Step.Config/Config/serverConfigValidator.xsd +++ b/Step.Config/Config/serverConfigValidator.xsd @@ -1,6 +1,6 @@ - + diff --git a/Step.Config/Config/userSoftKeyConfig.xml b/Step.Config/Config/userSoftKeyConfig.xml index b221d6b1..73271d8f 100644 --- a/Step.Config/Config/userSoftKeyConfig.xml +++ b/Step.Config/Config/userSoftKeyConfig.xml @@ -1,5 +1,5 @@  - + true 1 @@ -133,4 +133,4 @@ Ita - \ No newline at end of file + \ No newline at end of file diff --git a/Step.Config/Config/userSoftKeyConfigValidator.xsd b/Step.Config/Config/userSoftKeyConfigValidator.xsd index ad154c86..d4b25de2 100644 --- a/Step.Config/Config/userSoftKeyConfigValidator.xsd +++ b/Step.Config/Config/userSoftKeyConfigValidator.xsd @@ -1,6 +1,6 @@  - + diff --git a/Step.Config/ServerConfigController.cs b/Step.Config/ServerConfigController.cs index e90e8edb..34ae6404 100644 --- a/Step.Config/ServerConfigController.cs +++ b/Step.Config/ServerConfigController.cs @@ -148,6 +148,7 @@ namespace Step.Config // Read nc Config with LINQ NcConfig = xmlConfigFile + .Root .Descendants(NC_CONFIG_KEY) .Select(x => new NcConfigModel() { @@ -160,6 +161,7 @@ namespace Step.Config // Read server config with LINQ and save into static config ServerStartupConfig = xmlConfigFile + .Root .Descendants(SERVER_CONFIG_KEY) .Select(x => new ServerConfigModel() { // Set server config model data @@ -178,7 +180,7 @@ namespace Step.Config // Read areas config with LINQ xmlConfigFile - .Descendants(AREAS_CONFIG_KEY) // Get areas config node + .Root // Get areas config node .Elements() .ToList() .ForEach(x => SetAreaValueByName(x)); // Loop through elements @@ -215,13 +217,13 @@ namespace Step.Config NcSoftKeysConfig = xmlConfigFile .Root .Elements() - .Where(x => Convert.ToBoolean(x.Element("active").Value) == true) // Filter for active softkey + .Where(x => Convert.ToBoolean(x.Element("enabled").Value) == true) // Filter for active softkey .Select(x => new NcSoftKeysModel() { Id = GetPlcIdFromNcSoftKey(x.Name.ToString()), Name = x.Name.ToString(), VisualizedName = x.Element("visualizedName").Value, - IsActive = Convert.ToBoolean(x.Element("active").Value), + IsActive = Convert.ToBoolean(x.Element("enabled").Value), IsReadOnly = Convert.ToBoolean(x.Element("readOnly").Value) }) .ToList(); diff --git a/Step.Database/Controllers/FunctionsAccessController.cs b/Step.Database/Controllers/FunctionsAccessController.cs index af524d50..144e150c 100644 --- a/Step.Database/Controllers/FunctionsAccessController.cs +++ b/Step.Database/Controllers/FunctionsAccessController.cs @@ -87,8 +87,13 @@ namespace Step.Database.Controllers // If id is not mapped or function is false by database config return if (id == -1 || !functionAccessIsEnabled) return functionAccessIsEnabled; - // Return PLC data - return functionalityList[id].IsActive; + // Find and Return PLC data + FunctionalityModel plcFunc = functionalityList.Where(x => x.Id == id).SingleOrDefault(); + + if (plcFunc == null) + return false; // If not found + + return plcFunc.IsActive; } } } \ No newline at end of file diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index 8b912272..f8f81853 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -298,6 +298,9 @@ namespace Step.NC Visible = tmpProcPP.Visible }); + if (tmpProcPP.IsSelected && processesData.selectedProcess == 0) // TODO remove with multi-process + processesData.selectedProcess = (ushort)tmpProcPP.Id; + // Check if there are running process if (!processesData.isRunning) { @@ -309,11 +312,6 @@ namespace Step.NC status = PROC_STATUS.IDLE; } } - - // Read selected process - cmsError = numericalControl.PROC_RSelectedProcess(ref processesData.selectedProcess); - if (cmsError.IsError()) - return cmsError; // Read selected axes cmsError = numericalControl.AXES_RSelectedAxis(ref processesData.selectedAxis); diff --git a/Step/Controllers/SignalR/NcHub.cs b/Step/Controllers/SignalR/NcHub.cs index 78cd59c5..d57c3246 100644 --- a/Step/Controllers/SignalR/NcHub.cs +++ b/Step/Controllers/SignalR/NcHub.cs @@ -1,4 +1,5 @@ using Microsoft.AspNet.SignalR; +using Step.Attributes; using Step.NC; using System.Collections.Generic; using System.Threading.Tasks; @@ -6,11 +7,11 @@ using TeamDev.SDK.MVVM; using static CMS_CORE_Library.DataStructures; using static Step.Config.ServerConfig; using static Step.Model.Constants; +using static Step.Model.Constants.FUNCTIONALITY_NAMES; namespace Step.Controllers.SignalR { // [SignalRAuthorize(FunctionAccess = "functionAccess", Action = ACTIONS.READ)] - public class NcHub : Hub { public static List ConnectedClients = new List(); @@ -50,6 +51,7 @@ namespace Step.Controllers.SignalR return base.OnDisconnected(stopCalled); } + [SignalRAuthorize(FunctionAccess = STARTUP_ICONS, Action = ACTIONS.WRITE)] public void PutPowerOnData(uint id) { using (NcHandler ncHandler = new NcHandler()) @@ -61,6 +63,7 @@ namespace Step.Controllers.SignalR // [SignalRAuthorize(FunctionAccess = "functionAccess", Action = ACTIONS.READ)] + [SignalRAuthorize(FunctionAccess = ALARM_CMD, Action = ACTIONS.WRITE)] public void RefreshAllAlarms() { using (NcHandler ncHandler = new NcHandler()) @@ -72,6 +75,7 @@ namespace Step.Controllers.SignalR MessageServices.Current.Publish(SHOW_MSG_UI, null, "Refresh All Alarms."); } + [SignalRAuthorize(FunctionAccess = ALARM_CMD, Action = ACTIONS.WRITE)] public void RefreshAlarm(uint id) { using (NcHandler ncHandler = new NcHandler()) @@ -86,6 +90,7 @@ namespace Step.Controllers.SignalR MessageServices.Current.Publish(SHOW_MSG_UI, null, "Refresh Single Alarm. ID: " + id); } + [SignalRAuthorize(FunctionAccess = ALARM_CMD, Action = ACTIONS.WRITE)] public void RecoveryProcedure(uint id) { using (NcHandler ncHandler = new NcHandler()) @@ -100,6 +105,7 @@ namespace Step.Controllers.SignalR MessageServices.Current.Publish(SHOW_MSG_UI, null, "Recovery Alarm. ID: " + id); } + [SignalRAuthorize(FunctionAccess = NC_SOFTKEY, Action = ACTIONS.WRITE)] public void NcSoftKeyClick(int id) { using (NcHandler ncHandler = new NcHandler()) @@ -112,6 +118,7 @@ namespace Step.Controllers.SignalR } } + [SignalRAuthorize(FunctionAccess = USER_SOFTKEY, Action = ACTIONS.WRITE)] public void UserSoftKeyClick(int id) { using (NcHandler ncHandler = new NcHandler()) @@ -146,6 +153,7 @@ namespace Step.Controllers.SignalR } } + [SignalRAuthorize(FunctionAccess = PROCESS_CMD, Action = ACTIONS.WRITE)] public void SelectProcess(ushort procNumber) { using (NcHandler ncHandler = new NcHandler()) @@ -159,6 +167,7 @@ namespace Step.Controllers.SignalR } } + [SignalRAuthorize(FunctionAccess = AXES_CMD, Action = ACTIONS.WRITE)] public void SelectAxis(byte axisId) { using (NcHandler ncHandler = new NcHandler()) @@ -172,6 +181,7 @@ namespace Step.Controllers.SignalR } } + [SignalRAuthorize(FunctionAccess = HEADS_CMD, Action = ACTIONS.WRITE)] public void AddOverride(uint id) { using (NcHandler ncHandler = new NcHandler()) @@ -186,6 +196,7 @@ namespace Step.Controllers.SignalR } } + [SignalRAuthorize(FunctionAccess = HEADS_CMD, Action = ACTIONS.WRITE)] public void SubOverride(uint id) { using (NcHandler ncHandler = new NcHandler())