diff --git a/Client/Browser_Tools/BrowserJSObject.cs b/Client/Browser_Tools/BrowserJSObject.cs index 9d290353..048ba332 100644 --- a/Client/Browser_Tools/BrowserJSObject.cs +++ b/Client/Browser_Tools/BrowserJSObject.cs @@ -44,6 +44,7 @@ namespace CMS_Client.Browser_Tools AddFunction("maximizeForm").Execute += maximizeForm; AddFunction("closeForm").Execute += closeForm; AddFunction("forceStepFocus").Execute += forceStepFocus; + AddFunction("forceNcFocus").Execute += forceNcFocus; AddFunction("reloadBrokenPage").Execute += reloadBrokenPage; AddFunction("setNcWindowState").Execute += setNcWindowState; @@ -190,6 +191,13 @@ namespace CMS_Client.Browser_Tools NcWindow.ForceStepFocus(); } + public void forceNcFocus(object sender, CfrV8HandlerExecuteEventArgs e) + { + //NcWindow.ForceNcRedraw(); + NcWindow.ForceNcFocus(); + mainForm.ShowNCWindow(); + } + // Get the option of virtual Keyb configured private void isVirtualKeybConfigured(object sender, CfrV8HandlerExecuteEventArgs e) { diff --git a/Client/View/NcWindow.cs b/Client/View/NcWindow.cs index c2a8d695..ff8f70ac 100644 --- a/Client/View/NcWindow.cs +++ b/Client/View/NcWindow.cs @@ -262,7 +262,7 @@ namespace CMS_Client.View //If the NC is Siemens Exit from Function and lets the HMI to continue his life if (!forced && Config.VendorHmiConfig.Type == 2) { - HideNcWindow(); + MinimizeNcWindow(); return; } //If FollowNcWindow is OFF, set the Border and lets the HMI to continue his life @@ -310,11 +310,20 @@ namespace CMS_Client.View + //Minimize Nc Window + public static void MinimizeNcWindow() + { + if (windowstarted) + ShowWindow(ncprocess.MainWindowHandle, WS_MINIMIZE); + } + + + //Hide Nc Window public static void HideNcWindow() { if (windowstarted) - ShowWindow(ncprocess.MainWindowHandle, WS_MINIMIZE); + ShowWindow(ncprocess.MainWindowHandle, WS_HIDE); } @@ -366,7 +375,17 @@ namespace CMS_Client.View if (windowstarted) ForceFocus(ncprocess.MainWindowHandle); } + + //Force NC Focus + public static void ForceNcRedraw() + { + if (windowstarted){ + HideNcWindow(); + ShowNcWindow(); + } + } + //Force NC Focus @@ -1203,7 +1222,7 @@ namespace CMS_Client.View private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert); [DllImport("user32.dll", SetLastError = true)] - static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, StringBuilder lParam); + static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index ac96ecb9..f9e9f8df 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 454d2102..8570c0be 100644 --- a/Step.Config/Config/AlarmsConfig.xml +++ b/Step.Config/Config/AlarmsConfig.xml @@ -8,7 +8,7 @@ 2 2 - false + true 3 diff --git a/Step.Config/Config/serverConfig.xml b/Step.Config/Config/serverConfig.xml index 562bbb4b..3df48864 100644 --- a/Step.Config/Config/serverConfig.xml +++ b/Step.Config/Config/serverConfig.xml @@ -2,7 +2,11 @@ DEMO +<<<<<<< HEAD true +======= + false +>>>>>>> develop localhost 8080 Ares 37 OF diff --git a/Step.Config/ServerConfigController.cs b/Step.Config/ServerConfigController.cs index ce6e86c1..651f5480 100644 --- a/Step.Config/ServerConfigController.cs +++ b/Step.Config/ServerConfigController.cs @@ -47,7 +47,7 @@ namespace Step.Config { // Create new instance XmlSchemaSet readerSettings = new XmlSchemaSet(); - + // Add Schema from Assembly Assembly myAssembly = Assembly.GetExecutingAssembly(); using (Stream schemaStream = myAssembly.GetManifestResourceStream(configSchemaFilePath)) @@ -61,7 +61,7 @@ namespace Step.Config // Open file reader XDocument xmlConfigFile = XDocument.Load(BASE_PATH + "\\" + configFilePath); // Validate file - xmlConfigFile.Validate(readerSettings, ValidationHandler, true); + xmlConfigFile.Validate(readerSettings, ValidationHandler); return xmlConfigFile; } @@ -120,14 +120,14 @@ namespace Step.Config private static void ValidationHandler(object sender, ValidationEventArgs e) { if (e.Severity == XmlSeverityType.Warning) - { + { ExceptionManager.Manage(ERROR_LEVEL.WARNING, e.Message); - } + } else if (e.Severity == XmlSeverityType.Error) - { + { ExceptionManager.Manage(ERROR_LEVEL.FATAL, - "Error while reading file: " + e.Exception.SourceUri + - "\n Error: " + e.Message + // "Error while reading file: " + e.Exception.SourceUri + + "Error while reading configuration file: " + e.Message ); } } diff --git a/Step.Core/ThreadsFunctions.cs b/Step.Core/ThreadsFunctions.cs index 16eafe95..d2269c3f 100644 --- a/Step.Core/ThreadsFunctions.cs +++ b/Step.Core/ThreadsFunctions.cs @@ -24,10 +24,52 @@ public static class ThreadsFunctions private static long ReadAxesNamesTimer = 0, ReadAxesNamesTimes = 0; private static long ReadHeadsTimer = 0, ReadHeadsTimes = 0; private static long ReadToolDataTimer = 0, ReadToolDataTimes = 0; + private static long WatchdogTimer = 0, WatchdogTimes = 0; + private static Thread ConnThread; - #region Nc functions threads + #region Functions + + public static void ManageWatchdog() + { + NcHandler ncHandler = new NcHandler(); + Stopwatch sw = new Stopwatch(); + + try + { + CmsError libraryError = ncHandler.Connect(); + if (libraryError.errorCode != 0) + ManageLibraryError(libraryError); + + while (true) + { + sw.Restart(); + + // Check if client is connected + if (ncHandler.numericalControl.NC_IsConnected()) + { + // Manage watchdog + libraryError = ncHandler.ManageWatchdog(); + } + else + TryNcConnection(); + + sw.Stop(); + + //Update thread timer + WatchdogTimer += sw.ElapsedMilliseconds; + WatchdogTimes++; + + // Wait + Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds)); + } + } + catch (ThreadAbortException) + { + ncHandler.Dispose(); + } + } public static void ReadAlarms() { @@ -115,7 +157,6 @@ public static class ThreadsFunctions } } - // Read processes part program status public static void ReadProcessesPPStatus() { NcHandler ncHandler = new NcHandler(); @@ -146,10 +187,18 @@ public static class ThreadsFunctions ManageLibraryError(libraryError); else { - // Send processes through signalR - MessageServices.Current.Publish(SEND_PROCESSES_DATA, null, processesPPData); - // Send ncSoftKeys through signalR - MessageServices.Current.Publish(SEND_NC_SOFTKEYS_DATA, null, ncSoftKeys); + libraryError = ncHandler.GetM155Data(out List m155Data); + if (libraryError.errorCode != 0) + ManageLibraryError(libraryError); + else + { + // Send processes through signalR + MessageServices.Current.Publish(SEND_PROCESSES_DATA, null, processesPPData); + // Send ncSoftKeys through signalR + MessageServices.Current.Publish(SEND_NC_SOFTKEYS_DATA, null, ncSoftKeys); + // Send m155 through signalR + MessageServices.Current.Publish(SEND_M155_DATA, null, m155Data); + } } } } @@ -450,7 +499,7 @@ public static class ThreadsFunctions try { // Try connection - CmsError libraryError = ncHandler.Connect(); + CmsError libraryError = ncHandler.Connect(); if (libraryError.errorCode != 0) ManageLibraryError(libraryError); @@ -666,7 +715,7 @@ public static class ThreadsFunctions } } - #endregion Nc functions threads + #endregion Functions #region SupportFunctions diff --git a/Step.Database/Controllers/AlarmsController.cs b/Step.Database/Controllers/AlarmsController.cs index a83bbb0e..87a0b57b 100644 --- a/Step.Database/Controllers/AlarmsController.cs +++ b/Step.Database/Controllers/AlarmsController.cs @@ -7,6 +7,8 @@ using System.Data.Entity; using System.IO; using System.Linq; using static Step.Model.Constants; +using static Step.Config.ServerConfig; +using System.Diagnostics; namespace Step.Database.Controllers { @@ -26,24 +28,46 @@ namespace Step.Database.Controllers dbCtx.Dispose(); } - public List GetPaginatedWithFilter(string message, List types, int page, int pageSize, DateTime startDate, DateTime endDate, List userIds) + public List GetPaginatedWithFilter(string title, List types, int page, int pageSize, DateTime startDate, DateTime endDate, List userIds, Dictionary plcMessages) { - var occurrences = dbCtx + bool ifNoUser = false; + var index = userIds.IndexOf(-1); + if (userIds.IndexOf(-1) != -1) + ifNoUser = true; + + List ncAlarmDescIds = dbCtx + .AlarmDescriptions + .Where(x => x.Title.Contains(title)) + .Select(x => x.AlarmId) + .ToList(); + + // Get Plc messages ids + List plcAlarmDescIds = + plcMessages + .Where(x => x.Value.Contains(title)) + .Select(x => x.Key) + .ToList(); + + // Query + var occurrencesQuery = dbCtx .AlarmOccurrences .OrderBy(x => x.AlarmOccurrenceId) - .Include("Users") + .Include("Users") .Where(x => - x.TimeStamp >= startDate && x.TimeStamp <= endDate - && types.Contains(x.Type) - && x.Users.Any(y => userIds.Any(z => z == y.UserId)) - ) - .Skip(page * pageSize) + x.TimeStamp >= startDate && x.TimeStamp <= endDate // Filter by date + && types.Contains(x.Type) // Type + && ( (ifNoUser && x.Users.Count() == 0) || x.Users.Any(y => userIds.Any(z => z == y.UserId))) // Check user + && + ((x.Source == ALARM_SOURCE.NC && ncAlarmDescIds.Contains(x.AlarmDescriptionId.Value)) // Check if message is contained in NC messages + || (x.Source == ALARM_SOURCE.PLC && plcAlarmDescIds.Contains(x.PlcMessageId.Value))) // Check if message is contained in PLC messages + ) + .Skip(page * pageSize) // Paginate .Take(pageSize) - .Include("AlarmDescription") + .Include("AlarmDescription") // Include foreign key .ToList(); - - return occurrences - .Select(x => (DTOAlarmHistoricModel)x) + + return occurrencesQuery + .Select(x => (DTOAlarmHistoricModel)x) // Convert to DTOALarmHistoricModel .ToList(); } @@ -73,7 +97,7 @@ namespace Step.Database.Controllers { dbCtx.AlarmUsers.AddRange(loggedUser); - dbCtx.SaveChangesAsync(); // TODO check if it is the best solutions + dbCtx.SaveChanges(); // TODO check if it is the best solutions } public DTOAlarmsData GetAlarmsData(int pageSize) diff --git a/Step.Database/Controllers/NcToolManagerController.cs b/Step.Database/Controllers/NcToolManagerController.cs index 429c0a94..d286e847 100644 --- a/Step.Database/Controllers/NcToolManagerController.cs +++ b/Step.Database/Controllers/NcToolManagerController.cs @@ -147,14 +147,6 @@ namespace Step.Database.Controllers List dtoShanks = dbShanks .Select(x => (DTONcShankModel)x) .ToList(); - // new List(); - //foreach (var shank in dbShanks) - //{ - // //dbCtx.Shanks.Attach(shank); - // DTONcShankModel dtoShank = (DTONcShankModel)shank; - - // dtoShanks.Add(dtoShank); - //} return dtoShanks; } @@ -447,7 +439,10 @@ namespace Step.Database.Controllers // Set ids with new positions shank.MagazineId = magazineId; shank.PositionId = positionId; - + // Set original Ids + shank.OriginMagazineId = magazineId; + shank.OriginPositionId = positionId; + dbCtx.SaveChanges(); return FindMagazinePosition(magazineId, positionId); @@ -459,6 +454,9 @@ namespace Step.Database.Controllers // set id to null shank.MagazineId = null; shank.PositionId = null; + + shank.OriginMagazineId = null; + shank.OriginPositionId = null; dbCtx.SaveChanges(); diff --git a/Step.Database/Controllers/SessionsController.cs b/Step.Database/Controllers/SessionsController.cs index 098d32f6..1cee1f81 100644 --- a/Step.Database/Controllers/SessionsController.cs +++ b/Step.Database/Controllers/SessionsController.cs @@ -35,6 +35,8 @@ namespace Step.Database.Controllers .Sessions .Include("MachineUser") .Select(x => x.MachineUser) + .GroupBy(x => x.MachineUserId) + .Select(x => x.FirstOrDefault()) .ToList(); } diff --git a/Step.Database/Migrations/201810240848483_InitMigration.resx b/Step.Database/Migrations/201810240848483_InitMigration.resx deleted file mode 100644 index a9ea712c..00000000 --- a/Step.Database/Migrations/201810240848483_InitMigration.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1dWW/kOJJ+X2D/QyIfZ3ucdhVmsFOwZ+C2XT3G+Fqnq3r2SaCVzLTQOrJ1uO1e7C/bh/1J+xeWlJQS70PUkVndKBTgFMlgMPgxGCQjyP/7n/89/dtbFM5eYZoFSXw2Pzk6ns9g7CerIN6czYt8/cd/n//tr//6L6dXq+ht9nWX7yPOh0rG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/KZMHpaRn2MhR2Zgt0T5HP2IUh6iKBOhYVDjEI3kaYphyyb1LSrlkFM5DfU75MZsvCLgSyYI0xixsQYZZ0m01IikvsWlxIrqeKpfrIzUeGEMjaD1+lgbqgmSFXLZBi5NIQrh2rehQqT0IghVqIdEJsbRIVyzlOvfpomSXBqR8cv4hiCZ1DN6qtACLXgEEQj9NGAi5Ehd5wWSMHOzF23L8+2gExSikK20SSp9zj9iJ28TafDe4FRDuMV72QLi6z4LQTavGLgu9zazjC8EkfusUAhaP9sehSDeIKiFwCb2KQSxj6haHgZ+pf01T0ZJvFgUZxhGYAbIGWXtvAdCEbvrqWVj4OI3PIrENq04wzACM0DRKCb+VEIx8oASyMfec6o3UWk3dktailxDC00+/jq4Bw00CKcXotQdRSA3M9eV/iwbhcsJQYVOMBbI7i7Oxl+iSTtdVDvx9Qf0M09SsKlEnpVfTxePRYyv/6x+XcIs2LQkThHNGPqUf0aT5zpeJzt/EYajXRbm9tFbmIMVyMF5mgdr4OcP1aW/QbyZz77iS6TP5lfRM1xdx/dFvi1y1GQYPdMn2NjdRFX/6YLj+fS+2hXqowmIzQDfmHoff18E4arh+7PgjlQJCezHUl9Ri/syx1fVbt4bSncJe7YpI1SLr3G/eYLRNkTEsvt4CfADtPa8IQTfwA3w39H312CFR4+MiL4jaLGfXgYAX82c1TTa8ugnwvAqevvr/wMKSNjBzHwBAA== - - - dbo - - \ No newline at end of file diff --git a/Step.Database/Migrations/201810240848483_InitMigration.Designer.cs b/Step.Database/Migrations/201811300854588_InitMigration.Designer.cs similarity index 92% rename from Step.Database/Migrations/201810240848483_InitMigration.Designer.cs rename to Step.Database/Migrations/201811300854588_InitMigration.Designer.cs index 2f4b482d..3b07427a 100644 --- a/Step.Database/Migrations/201810240848483_InitMigration.Designer.cs +++ b/Step.Database/Migrations/201811300854588_InitMigration.Designer.cs @@ -13,7 +13,7 @@ namespace Step.Database.Migrations string IMigrationMetadata.Id { - get { return "201810240848483_InitMigration"; } + get { return "201811300854588_InitMigration"; } } string IMigrationMetadata.Source diff --git a/Step.Database/Migrations/201810240848483_InitMigration.cs b/Step.Database/Migrations/201811300854588_InitMigration.cs similarity index 98% rename from Step.Database/Migrations/201810240848483_InitMigration.cs rename to Step.Database/Migrations/201811300854588_InitMigration.cs index a1dea918..9ee3de80 100644 --- a/Step.Database/Migrations/201810240848483_InitMigration.cs +++ b/Step.Database/Migrations/201811300854588_InitMigration.cs @@ -56,6 +56,7 @@ namespace Step.Database.Migrations type = c.Int(nullable: false), processes = c.Int(nullable: false), timestamp = c.DateTime(nullable: false, precision: 0), + plc_message_id = c.Int(), }) .PrimaryKey(t => t.id) .ForeignKey("dbo.alarm_description", t => t.alarm_id) @@ -142,10 +143,12 @@ namespace Step.Database.Migrations c => new { magazine_id = c.Byte(), - position_id = c.Byte(), + position_id = c.Int(), id = c.Short(nullable: false), balluf = c.Int(), magazine_position_type = c.Byte(nullable: false), + origin_magazine_id = c.Byte(), + origin_position_id = c.Int(), }) .PrimaryKey(t => t.id) .ForeignKey("dbo.magazine_position", t => new { t.magazine_id, t.position_id }) @@ -156,7 +159,7 @@ namespace Step.Database.Migrations c => new { magazine_id = c.Byte(nullable: false), - position_id = c.Byte(nullable: false), + position_id = c.Int(nullable: false), type = c.Byte(nullable: false), disabled = c.Boolean(nullable: false), }) diff --git a/Step.Database/Migrations/201811300854588_InitMigration.resx b/Step.Database/Migrations/201811300854588_InitMigration.resx new file mode 100644 index 00000000..36ec683e --- /dev/null +++ b/Step.Database/Migrations/201811300854588_InitMigration.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + H4sIAAAAAAAEAO1dWW/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= + + + dbo + + \ No newline at end of file diff --git a/Step.Database/Migrations/Configuration.cs b/Step.Database/Migrations/Configuration.cs index ad8d7737..e81afc8e 100644 --- a/Step.Database/Migrations/Configuration.cs +++ b/Step.Database/Migrations/Configuration.cs @@ -25,22 +25,22 @@ namespace Step.Database.Migrations ); context.FunctionsAccess.AddOrUpdate( - // General Function - new FunctionAccessModel() { Name = GENERAL, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 100, ReadLevelMin = 1, PlcId = 0 }, - new FunctionAccessModel() { Name = USER_FUNCTIONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 }, - new FunctionAccessModel() { Name = NC_DATA, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 10, ReadLevelMin = 1, PlcId = 0 }, - new FunctionAccessModel() { Name = ALARM_CMD, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 1 }, - new FunctionAccessModel() { Name = STARTUP_ICONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 2 }, + // General Function, if plcId is 0 then the functionality is not connected to the NC + new FunctionAccessModel() { Name = GENERAL, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 100, ReadLevelMin = 1, PlcId = 0}, + new FunctionAccessModel() { Name = USER_FUNCTIONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0}, + new FunctionAccessModel() { Name = NC_DATA, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 10, ReadLevelMin = 1, PlcId = 0}, + new FunctionAccessModel() { Name = ALARM_CMD, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 1}, + new FunctionAccessModel() { Name = STARTUP_ICONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 2}, // Under hood - new FunctionAccessModel() { Name = PROCESS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 3 }, - new FunctionAccessModel() { Name = NC_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 4 }, - new FunctionAccessModel() { Name = USER_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 5 }, - new FunctionAccessModel() { Name = HEADS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 6 }, - new FunctionAccessModel() { Name = AXES_SELECTION, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 7 }, + new FunctionAccessModel() { Name = PROCESS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 3}, + new FunctionAccessModel() { Name = NC_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 4}, + new FunctionAccessModel() { Name = USER_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 5}, + new FunctionAccessModel() { Name = HEADS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 6}, + new FunctionAccessModel() { Name = AXES_SELECTION, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 7}, - new FunctionAccessModel() { Name = TOOL_MANAGER, Area = TOOLING_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 8 }, - new FunctionAccessModel() { Name = MAINTENANCE, Area = MAINTENANCE_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 9 } + new FunctionAccessModel() { Name = TOOL_MANAGER, Area = TOOLING_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 8}, + new FunctionAccessModel() { Name = MAINTENANCE, Area = MAINTENANCE_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 9} ); context.SaveChanges(); diff --git a/Step.Database/Step.Database.csproj b/Step.Database/Step.Database.csproj index f928b102..fba70262 100644 --- a/Step.Database/Step.Database.csproj +++ b/Step.Database/Step.Database.csproj @@ -81,9 +81,9 @@ - - - 201810240848483_InitMigration.cs + + + 201811300854588_InitMigration.cs @@ -119,8 +119,8 @@ - - 201810240848483_InitMigration.cs + + 201811300854588_InitMigration.cs diff --git a/Step.Model/Constants.cs b/Step.Model/Constants.cs index 01a735d9..94d630dd 100644 --- a/Step.Model/Constants.cs +++ b/Step.Model/Constants.cs @@ -185,6 +185,7 @@ namespace Step.Model public const string UPDATE_TOOLS_DATA = "UPDATE_TOOLS_DATA"; public const string NC_MAGAZINE_IS_ACTIVE = "UPDATE_NC_MAGAZINE_STATUS"; public const string SEND_QUEUE_DATA = "SEND_QUEUE_DATA"; + public const string SEND_M155_DATA = "SEND_M155_DATA"; public const string BROADCAST_DATA = "BROADCAST_DATA"; diff --git a/Step.Model/DTOModels/AlarmModels/DTOAlarmHistoricModel.cs b/Step.Model/DTOModels/AlarmModels/DTOAlarmHistoricModel.cs index 99d36695..54b781fb 100644 --- a/Step.Model/DTOModels/AlarmModels/DTOAlarmHistoricModel.cs +++ b/Step.Model/DTOModels/AlarmModels/DTOAlarmHistoricModel.cs @@ -4,8 +4,6 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Step.Model.Constants; namespace Step.Model.DTOModels.AlarmModels @@ -21,15 +19,15 @@ namespace Step.Model.DTOModels.AlarmModels public string Description { get; set; } public ALARM_SOURCE Source { get; set; } - + public ALARM_TYPE Type { get; set; } - + public List Processes { get; set; } - + public DateTime TimeStamp { get; set; } public List Users { get; set; } - + public static explicit operator DTOAlarmHistoricModel(AlarmOccurrencesModel obj) { List processes = new List(); @@ -55,29 +53,35 @@ namespace Step.Model.DTOModels.AlarmModels }; } } - + public class DTOAlarmsFilterModel { [Required] public int Page { get; set; } + [Required] public int PageSize { get; set; } - [Required] + public string Title { get; set; } + [Required] public List Type { get; set; } + [Required] public DateTime? StartDate { get; set; } + [Required] public DateTime EndDate { get; set; } + [Required] - public List UserIds { get; set; } + public List UserIds { get; set; } + + public string Language { get; set; } } - + public struct DTOAlarmsData { public int Pages; public DateTime FirstDate; } - -} +} \ No newline at end of file diff --git a/Step.Model/DTOModels/DTOProcessDataModel.cs b/Step.Model/DTOModels/DTOProcessDataModel.cs index 592ce9fa..9bbde251 100644 --- a/Step.Model/DTOModels/DTOProcessDataModel.cs +++ b/Step.Model/DTOModels/DTOProcessDataModel.cs @@ -60,7 +60,7 @@ namespace Step.Model.DTOModels { public override bool Equals(object obj) { - var item = obj as ProcessModel; + ProcessModel item = obj as ProcessModel; if (item == null) return false; @@ -84,4 +84,24 @@ namespace Step.Model.DTOModels return base.GetHashCode(); } } + + public class DTOM155InputModel : M155InputIsNeededModel + { + public new string Type; + public override bool Equals(object obj) + { + DTOM155InputModel item = obj as DTOM155InputModel; + + if (item == null) + return false; + + if (Process != item.Process) + return false; + + if (Type != item.Type) + return false; + + return true; + } + } } \ No newline at end of file diff --git a/Step.Model/DTOModels/ToolModels/DTONcMagazinePositionModel.cs b/Step.Model/DTOModels/ToolModels/DTONcMagazinePositionModel.cs index bd0aac05..4df92b93 100644 --- a/Step.Model/DTOModels/ToolModels/DTONcMagazinePositionModel.cs +++ b/Step.Model/DTOModels/ToolModels/DTONcMagazinePositionModel.cs @@ -12,7 +12,7 @@ namespace Step.Model.DTOModels.ToolModels { public byte MagazineId { get; set; } - public byte PositionId { get; set; } + public int PositionId { get; set; } [Required] public bool Disabled { get; set; } diff --git a/Step.Model/DTOModels/ToolModels/DTONcShankModel.cs b/Step.Model/DTOModels/ToolModels/DTONcShankModel.cs index c4a0b2df..03ce7fc5 100644 --- a/Step.Model/DTOModels/ToolModels/DTONcShankModel.cs +++ b/Step.Model/DTOModels/ToolModels/DTONcShankModel.cs @@ -38,9 +38,15 @@ namespace Step.Model.DTOModels.ToolModels [Range(1, byte.MaxValue)] public byte? MagazineId { get; set; } + [Range(1, ushort.MaxValue)] + public int? PositionId { get; set; } + [Range(1, byte.MaxValue)] - public byte? PositionId { get; set; } + public byte? OriginMagazineId { get; set; } + [Range(1, ushort.MaxValue)] + public int? OriginPositionId { get; set; } + public List ChildsTools { get; set; } public static explicit operator DTONcShankModel(DbNcShankModel obj) @@ -60,6 +66,8 @@ namespace Step.Model.DTOModels.ToolModels MagazinePositionType = obj.MagazinePositionType, MagazineId = obj.MagazineId, PositionId = obj.PositionId, + OriginMagazineId = obj.OriginMagazineId, + OriginPositionId = obj.OriginPositionId, ChildsTools = tools }; } @@ -72,7 +80,9 @@ namespace Step.Model.DTOModels.ToolModels Balluf = obj.Balluf, MagazinePositionType = obj.MagazinePositionType, MagazineId = obj.MagazineId, - PositionId = obj.PositionId + PositionId = obj.PositionId, + OriginMagazineId = obj.OriginMagazineId, + OriginPositionId = obj.OriginPositionId, }; } } diff --git a/Step.Model/DatabaseModels/AlarmOccurrencesModel.cs b/Step.Model/DatabaseModels/AlarmOccurrencesModel.cs index 02511096..d68a1d06 100644 --- a/Step.Model/DatabaseModels/AlarmOccurrencesModel.cs +++ b/Step.Model/DatabaseModels/AlarmOccurrencesModel.cs @@ -28,6 +28,9 @@ namespace Step.Model.DatabaseModels [Column("timestamp")] public DateTime TimeStamp { get; set; } + + [Column("plc_message_id")] + public int? PlcMessageId { get; set; } public AlarmDescriptionsModel AlarmDescription { get; set; } public List Users { get; set; } diff --git a/Step.Model/DatabaseModels/NcMagazinePositionModel.cs b/Step.Model/DatabaseModels/NcMagazinePositionModel.cs index 55c75ca5..f9a4a233 100644 --- a/Step.Model/DatabaseModels/NcMagazinePositionModel.cs +++ b/Step.Model/DatabaseModels/NcMagazinePositionModel.cs @@ -12,7 +12,7 @@ namespace Step.Model.DatabaseModels public byte MagazineId { get; set; } [Key, Column("position_id", Order = 1)] - public byte PositionId { get; set; } + public int PositionId { get; set; } [Column("type")] public byte Type { get; set; } @@ -25,7 +25,7 @@ namespace Step.Model.DatabaseModels return new NcMagazinePositionModel() { MagazineId = obj.MagazineId, - PositionId = obj.PositionId, + PositionId = (ushort)obj.PositionId, Disabled = obj.Disabled ? (byte)1 : (byte)0, Type = obj.Type }; diff --git a/Step.Model/DatabaseModels/NcShankModel.cs b/Step.Model/DatabaseModels/NcShankModel.cs index 49d9ef96..4684751e 100644 --- a/Step.Model/DatabaseModels/NcShankModel.cs +++ b/Step.Model/DatabaseModels/NcShankModel.cs @@ -24,7 +24,14 @@ namespace Step.Model.DatabaseModels public byte? MagazineId { get; set; } [ForeignKey("MagazinePosition"), Column("position_id", Order = 1)] - public byte? PositionId { get; set; } + public int? PositionId { get; set; } + + [Column("origin_magazine_id")] + public byte? OriginMagazineId { get; set; } + + [Column("origin_position_id")] + public int? OriginPositionId { get; set; } + public DbNcMagazinePositionModel MagazinePosition { get; set; } @@ -34,12 +41,14 @@ namespace Step.Model.DatabaseModels { return new NcShankModel() { - ShankId = obj.ShankId, + ShankId = (ushort)obj.ShankId, Balluf = obj.Balluf == null ? (ushort)0 : (ushort)obj.Balluf.Value, MagazineId = obj.MagazineId == null ? (byte)0 : obj.MagazineId.Value, - PositionId = obj.PositionId == null ? (byte)0 : obj.PositionId.Value, + PositionId = obj.PositionId == null ? (ushort)0 : (ushort)obj.PositionId.Value, MagazinePositionType = obj.MagazinePositionType, - }; + OriginMagazineId = obj.OriginMagazineId == null ? (byte)0 : obj.OriginMagazineId.Value, + OriginPositionId = obj.OriginPositionId == null ? (ushort)0 : (ushort)obj.OriginPositionId.Value, + }; } } } \ No newline at end of file diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index e3b3c19d..e1fa7161 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -15,6 +15,7 @@ using Step.Utils; using System; using System.Collections.Generic; using System.Data.Entity; +using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; @@ -30,8 +31,8 @@ namespace Step.NC public Nc numericalControl; public NcHandler() => - // Choose NC - numericalControl = SetNumericalControl(); + // Choose NC + numericalControl = SetNumericalControl(); public void Dispose() { @@ -87,7 +88,7 @@ namespace Step.NC CmsError cmsError = NO_ERROR; if (File.Exists(path)) - cmsError = LocalPartProgramFileInfo(path, out fileInfo); + cmsError = LocalPartProgramFileInfo(path, out fileInfo); else cmsError = numericalControl.FILES_RGetFileInfo(path, ref fileInfo); @@ -120,10 +121,10 @@ namespace Step.NC return FILE_NOT_FOUND_ERROR; string base64Img = model.Metadata.Generics.Images.Count() > 0 ? model.Metadata.Generics.Images[0].Base64 : ""; - + fileInfo = new DTOActiveImageAndNameDataModel() { - Image = base64Img, + Image = base64Img, Name = Path.GetFileName(path) // TODO: Get From NC }; @@ -139,13 +140,13 @@ namespace Step.NC fileInfo = new DTOActiveImageAndNameDataModel() { - Image = SupportFunctions.FindImageBase64String(IMAGES_PATH, name), + Image = SupportFunctions.FindImageBase64String(IMAGES_PATH, name), Name = Path.GetFileName(name) // TODO: Get From NC }; } return NO_ERROR; - } + } public CmsError LocalPartProgramFileInfo(string path, out InfoFile fileInfo) { @@ -164,7 +165,7 @@ namespace Step.NC // Populate fileInfo content fileInfo.Content = new List(); - while ((line = fileRead.ReadLine()) != null && count < 10) + while ((line = fileRead.ReadLine()) != null && count < 10) { fileInfo.Content.Add(line); count++; @@ -250,7 +251,7 @@ namespace Step.NC }; return cmsError; - } + } public CmsError UploadPartProgram(string localPath, string fileName, out string newFilePath) { @@ -430,34 +431,6 @@ namespace Step.NC return NO_ERROR; } - //public CmsError SwapQueueItems(int processId, int item1Index, int item2Index) - //{ - // item1Index = item1Index - 1; - // item2Index = item2Index - 1; - - // // Check if there is a queue - // if (!PartProgramQueue.ContainsKey(processId)) - // return INCORRECT_PARAMETERS_ERROR; - // // Check if items exists - // if (PartProgramQueue[processId].ElementAtOrDefault(item1Index) == null || PartProgramQueue[processId].ElementAtOrDefault(item2Index) == null) - // return INCORRECT_PARAMETERS_ERROR; - - // // Create a item - // DTOQueueModel tmp = PartProgramQueue[processId][item1Index]; - - // // Swap item 1 with 2 - // PartProgramQueue[processId][item1Index] = PartProgramQueue[processId][item2Index]; - // // Swap 2 with tmp - // PartProgramQueue[processId][item2Index] = tmp; - - // // Swap ids - // PartProgramQueue[processId][item2Index].Id = item2Index + 1; - // // Swap 2 with tmp - // PartProgramQueue[processId][item1Index].Id = item1Index + 1; - - // return NO_ERROR; - //} - public CmsError MoveQueueItems(int processId, int itemId, int newIndex, out List queue) { itemId = itemId - 1; @@ -578,6 +551,11 @@ namespace Step.NC #region Read Data + public CmsError ManageWatchdog() + { + return numericalControl.PLC_RWManageWatchdog(); + } + public CmsError GetNcGenericData(out DTONcGenericDataModel genericData) { genericData = new DTONcGenericDataModel(MachineConfig.Model); @@ -1327,7 +1305,7 @@ namespace Step.NC public CmsError ReadAxisData(out List axesNames) { axesNames = new List(); - List plcAxes = new List(); + List plcAxes = new List(); // Read selected process ushort selectedProcess = 0; CmsError cmsError = numericalControl.PROC_RSelectedProcess(ref selectedProcess); @@ -1343,7 +1321,7 @@ namespace Step.NC { Id = x.Id, Name = x.Name, - IsSelectable = x.IsSelectable + IsSelectable = x.IsSelectable }).ToList(); } @@ -1464,6 +1442,26 @@ namespace Step.NC return cmsError; } + public CmsError GetM155Data(out List data) + { + data = new List(); + List ncData = new List(); + CmsError cmsError = numericalControl.PLC_ROperatorInputIsNeeded(ref ncData); + if (cmsError.IsError()) + return cmsError; + + data = ncData.Select(x => new DTOM155InputModel() + { + Buttons = x.Buttons, + IsNeeded = x.IsNeeded, + Message = x.Message, + Process = x.Process, + Type = x.Type.ToString() + }).ToList(); + + return NO_ERROR; + } + #endregion Read Data #region Write data @@ -1537,6 +1535,11 @@ namespace Step.NC return numericalControl.NC_SetScreenVisible((Nc.SCREEN_PAGE)screen); } + public CmsError WriteM155Data(int process, double responseValue) + { + return numericalControl.PLC_WOperatorInputResponse(process, responseValue); + } + #endregion Write data #region Siemens Tools @@ -2227,7 +2230,7 @@ namespace Step.NC .Where(x => x.MagazineId != null) .Select(x => (NcShankModel)x) .ToList(); - + // Update shanks CmsError cmsError = numericalControl.TOOLS_WUpdateShanks(shanks); if (cmsError.IsError()) return cmsError; @@ -2236,6 +2239,7 @@ namespace Step.NC List positions = toolsManager.FindMagazinesPositions() .Select(x => (NcMagazinePositionModel)x) .ToList(); + // Update positions cmsError = numericalControl.TOOLS_WUpdateMagazinePositions(positions); if (cmsError.IsError()) return cmsError; @@ -2248,15 +2252,17 @@ namespace Step.NC .ToList(); // Update tools - cmsError = numericalControl.TOOLS_WUpdateTools(tools); + cmsError = numericalControl.TOOLS_WUpdateTools(tools); if (cmsError.IsError()) return cmsError; + // Get families List families = toolsManager .FindFamilies() .Select(x => (NcFamilyModel)x) .Where(x => tools.Any(y => y.FamilyId == x.FamilyId)) // Find only families of mounted tools .ToList(); + // Update families cmsError = numericalControl.TOOLS_WUpdateFamilies(families); if (cmsError.IsError()) diff --git a/Step.Utils/supportFunctions.cs b/Step.Utils/supportFunctions.cs index 3889b66e..80a221ad 100644 --- a/Step.Utils/supportFunctions.cs +++ b/Step.Utils/supportFunctions.cs @@ -131,12 +131,13 @@ namespace Step.Utils public static string FindImageBase64String(string directoryPath, string imageName) { + string fileName = Path.GetFileNameWithoutExtension(imageName); foreach (string ext in VALID_IMAGE_EXTENSIONS) { - if (File.Exists(directoryPath + "\\" + imageName + ext)) + if (File.Exists(directoryPath + "\\" + fileName + ext)) { // Convert image to a base 64 string - return "data:image/" + ext + ";base64," + Convert.ToBase64String(File.ReadAllBytes(directoryPath + "\\" + imageName + ext)); + return "data:image/" + ext + ";base64," + Convert.ToBase64String(File.ReadAllBytes(directoryPath + "\\" + fileName + ext)); } } diff --git a/Step/Attributes/WebApiAuthorizeAttribute.cs b/Step/Attributes/WebApiAuthorizeAttribute.cs index 68369299..cb2e88de 100644 --- a/Step/Attributes/WebApiAuthorizeAttribute.cs +++ b/Step/Attributes/WebApiAuthorizeAttribute.cs @@ -8,6 +8,7 @@ using Step.Config; using Step.Model.DatabaseModels; using static Step.Config.ServerConfig; using static Step.Model.Constants; +using static Step.Listeners.SignalRStaticObjects; namespace Step { @@ -79,6 +80,15 @@ namespace Step if (functionAccess.WriteLevelMin > machineUser.Role.Level) return false; // Not authorized } + + // Check if PLC bit exists + if(functionAccess.PlcId != 0) + { + // Check if functionality is enabled by PLC + var functionalityIsEnabled = LastRuntimeFunctionality.Where(x => x.Name == functionName).FirstOrDefault(); + if (functionalityIsEnabled == null || functionalityIsEnabled.Enabled == false) + return false; + } } else return false; diff --git a/Step/Controllers/SignalR/NcHub.cs b/Step/Controllers/SignalR/NcHub.cs index 9b38245b..7a922d10 100644 --- a/Step/Controllers/SignalR/NcHub.cs +++ b/Step/Controllers/SignalR/NcHub.cs @@ -210,5 +210,17 @@ namespace Step.Controllers.SignalR throw new HubException(libraryError.localizationKey); } } + + [SignalRAuthorize(FunctionAccess = GENERAL, Action = ACTIONS.WRITE)] + public void WriteM155Response(int process, double responseVal) + { + using (NcHandler ncHandler = new NcHandler()) + { + ncHandler.Connect(); + CmsError cmsError = ncHandler.WriteM155Data(process, responseVal); + if (cmsError.IsError()) + throw new HubException(cmsError.localizationKey); + } + } } } \ No newline at end of file diff --git a/Step/Controllers/WebApi/ApiAlarmController.cs b/Step/Controllers/WebApi/ApiAlarmController.cs index 4b21186a..493b8d1c 100644 --- a/Step/Controllers/WebApi/ApiAlarmController.cs +++ b/Step/Controllers/WebApi/ApiAlarmController.cs @@ -1,10 +1,10 @@ using Step.Database.Controllers; using Step.Model.DatabaseModels; using Step.Model.DTOModels.AlarmModels; +using Step.NC; using Step.Provider; using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.IO; using System.Linq; using System.Net; @@ -19,28 +19,23 @@ namespace Step.Controllers.WebApi [RoutePrefix("api/alarm")] public class ApiAlarmController : ApiController { - //[Route(""), HttpGet] - //public IHttpActionResult GetAll(int page, int pageSize) - //{ - // using (AlarmsController alarm = new AlarmsController()) - // { - // var a = alarm.GetPaginated(page, pageSize); - - // return Ok(a); - // } - //} - [Route("paginated"), HttpPost] - public IHttpActionResult GetDataPaginated([FromBody]DTOAlarmsFilterModel data) + public IHttpActionResult GetDataPaginated([FromBody]DTOAlarmsFilterModel filter) { - Validate(data); - var a = ModelState.Values.Select(x => x.Errors); if (!ModelState.IsValid) return BadRequest(ModelState); + Dictionary plcMessages = new Dictionary(); + using (NcHandler ncHandler = new NcHandler()) + { + // Read data + ncHandler.numericalControl.NC_GetTranslatedPlcMessages(filter.Language, ref plcMessages); + } + + using (AlarmsController alarm = new AlarmsController()) { - var alarms = alarm.GetPaginatedWithFilter(data.Title, data.Type, data.Page - 1, data.PageSize, data.StartDate.Value, data.EndDate, data.UserIds); + var alarms = alarm.GetPaginatedWithFilter(filter.Title, filter.Type, filter.Page - 1, filter.PageSize, filter.StartDate.Value, filter.EndDate, filter.UserIds, plcMessages); return Ok(alarms); } @@ -165,7 +160,6 @@ namespace Step.Controllers.WebApi #endregion Note - #region Attachment [Route("{alarmDescId:int}/attachments"), HttpGet] diff --git a/Step/Controllers/WebApi/FavoriteUserSoftKeyController.cs b/Step/Controllers/WebApi/FavoriteUserSoftKeyController.cs index 2d56b122..0b5f81e1 100644 --- a/Step/Controllers/WebApi/FavoriteUserSoftKeyController.cs +++ b/Step/Controllers/WebApi/FavoriteUserSoftKeyController.cs @@ -16,7 +16,7 @@ namespace Step.Controllers.WebApi public class FavoriteUserSoftkeyController : ApiController { [Route("favorite"), HttpGet] - [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.WRITE)] + [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.USER_SOFTKEY, Action = ACTIONS.WRITE)] public IHttpActionResult GetFavoriteSoftkeys() { var identity = User.Identity as ClaimsIdentity; @@ -32,7 +32,7 @@ namespace Step.Controllers.WebApi } [Route("favorite"), HttpPut] - [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.WRITE)] + [WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.USER_SOFTKEY, Action = ACTIONS.WRITE)] public IHttpActionResult PutFavoriteSoftkeys(List favoriteSoftkeyIds) { var identity = User.Identity as ClaimsIdentity; diff --git a/Step/Controllers/WebApi/LanguageController.cs b/Step/Controllers/WebApi/LanguageController.cs index 8c43ae29..e426bdb9 100644 --- a/Step/Controllers/WebApi/LanguageController.cs +++ b/Step/Controllers/WebApi/LanguageController.cs @@ -121,13 +121,12 @@ namespace Step.Controllers.WebApi { using (NcHandler ncHandler = new NcHandler()) { - CmsError cmsError = ncHandler.Connect(); Dictionary returnValue = new Dictionary(); Dictionary messages = new Dictionary(); // Read data from CN - cmsError = ncHandler.numericalControl.NC_GetTranslatedPlcMessages(language, ref messages); - + ncHandler.numericalControl.NC_GetTranslatedPlcMessages(language, ref messages); // Avoid checking error because in the worst case "messages" is empty + // Id start from 1 for (int i = 1; i <= 1024; i++) { diff --git a/Step/Listeners/Database/SignalRDatabaseHandler.cs b/Step/Listeners/Database/SignalRDatabaseHandler.cs index dc702e79..e59d61ef 100644 --- a/Step/Listeners/Database/SignalRDatabaseHandler.cs +++ b/Step/Listeners/Database/SignalRDatabaseHandler.cs @@ -141,6 +141,7 @@ namespace Step.Listeners.Database alarmNewOccurrences.AddRange(differences.PlcAlarms.Select(x => { int processesByte = 0; + // Convert list to byte x.Process.ForEach(y => processesByte |= (1 << y)); return new AlarmOccurrencesModel() @@ -149,7 +150,8 @@ namespace Step.Listeners.Database Type = x.IsWarning ? ALARM_TYPE.WARNING : ALARM_TYPE.ERROR, Processes = processesByte, TimeStamp = x.DateTime, - Source = ALARM_SOURCE.PLC + Source = ALARM_SOURCE.PLC, + PlcMessageId = (int)x.Id }; })); diff --git a/Step/Listeners/ListenersHandler.cs b/Step/Listeners/ListenersHandler.cs index 51c15a8c..498292b4 100644 --- a/Step/Listeners/ListenersHandler.cs +++ b/Step/Listeners/ListenersHandler.cs @@ -86,7 +86,10 @@ namespace Step.Listeners SignalRListener.SendPartProgramQueue(a); SignalRDatabaseHandler.UpdateQueue(a); })); - + infos.Add(MessageServices.Current.Subscribe(SEND_M155_DATA, (a, b) => + { + SignalRListener.SendM155Data(a); + })); // Database infos.Add(MessageServices.Current.Subscribe(UPDATE_TOOLS_DATA, (a, b) => @@ -100,6 +103,7 @@ namespace Step.Listeners SignalRListener.BroadcastData(); })); } + public static void Stop() { diff --git a/Step/Listeners/SignalR/SignalRListener.cs b/Step/Listeners/SignalR/SignalRListener.cs index 7c55ae3b..3d636350 100644 --- a/Step/Listeners/SignalR/SignalRListener.cs +++ b/Step/Listeners/SignalR/SignalRListener.cs @@ -232,6 +232,18 @@ namespace Step.Listeners.SignalR } } + public static void SendM155Data(object data) + { + List dtoM155Data = data as List; + + if (!LastM155Data.SequenceEqual(dtoM155Data)) + { + LastM155Data = dtoM155Data; + var context = GlobalHost.ConnectionManager.GetHubContext(); + context.Clients.Group("ncData").m155Data(dtoM155Data); + } + } + private volatile static object _broadcastlock = new Object(); public static void BroadcastData() @@ -282,6 +294,8 @@ namespace Step.Listeners.SignalR context.Clients.Group("ncData").magazineIsActive(LastNcMagazineIsActive); // Send PP Queue context.Clients.Group("ncData").partProgramQueue(LastPartProgramQueue); + // Send m155 data + context.Clients.Group("ncData").m155Data(LastM155Data); Debug.WriteLine(string.Format("{0} {1} Broadcast..completed", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"), DateTime.Now.Millisecond)); Monitor.Exit(_broadcastlock); diff --git a/Step/Listeners/SignalRStaticObjects.cs b/Step/Listeners/SignalRStaticObjects.cs index fdd2363c..dfa6669c 100644 --- a/Step/Listeners/SignalRStaticObjects.cs +++ b/Step/Listeners/SignalRStaticObjects.cs @@ -21,6 +21,7 @@ namespace Step.Listeners public static DTOActiveProgramDataModel LastProgramData = new DTOActiveProgramDataModel(); public static Dictionary LastNcMagazineIsActive = new Dictionary(); public static List LastPartProgramQueue = new List(); + public static List LastM155Data = new List(); public static bool LastIsNcConnected = false; } diff --git a/Step/program.cs b/Step/program.cs index 752edef4..9765ae6c 100644 --- a/Step/program.cs +++ b/Step/program.cs @@ -38,7 +38,7 @@ namespace Step ServerControlWindow.Start(); // Create unhandled exception handler - // AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler); + AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler); // Read config ServerConfigController.ReadStartupConfig(); @@ -117,7 +117,12 @@ namespace Step private static void ExceptionHandler(object sender, UnhandledExceptionEventArgs args) { using (NcHandler ncHandler = new NcHandler()) - ncHandler.Disconnect(); + { + if (ncHandler.numericalControl.NC_IsConnected()) + { + ncHandler.Disconnect(); + } + } LogException((Exception)args.ExceptionObject, ERROR_LEVEL.FATAL); } diff --git a/Step/wwwroot/assets/styles/base/alarms.less b/Step/wwwroot/assets/styles/base/alarms.less index 48f9dbc1..b77e51b5 100644 --- a/Step/wwwroot/assets/styles/base/alarms.less +++ b/Step/wwwroot/assets/styles/base/alarms.less @@ -9,16 +9,12 @@ top: 40px; background-color: #fff; padding: 0 0; - z-index: 949; + z-index: 800; box-sizing: border-box; display: flex; flex-wrap: nowrap; overflow: hidden; transition: width 200ms ease-in-out, height 200ms ease-in-out, padding 200ms ease-in-out, background-color 200ms ease-in-out,box-shadow 0ms 0ms; - &.coveredByModal{ - z-index: 500; - filter: blur(10px); - } &.expanded { width: 494px; diff --git a/Step/wwwroot/assets/styles/base/header.less b/Step/wwwroot/assets/styles/base/header.less index c2a7eae2..6fe25205 100644 --- a/Step/wwwroot/assets/styles/base/header.less +++ b/Step/wwwroot/assets/styles/base/header.less @@ -9,14 +9,10 @@ height: @header-height; width: calc(~"100% - 152px"); position: absolute; - z-index: 950; + z-index: 801; top: 0; right: 0; left: 0; - &.coveredByModal{ - z-index: 200; - filter: blur(10px); - } button { font-size: 28px; justify-content: center; diff --git a/Step/wwwroot/assets/styles/base/layout.less b/Step/wwwroot/assets/styles/base/layout.less index 63278682..0143bd16 100644 --- a/Step/wwwroot/assets/styles/base/layout.less +++ b/Step/wwwroot/assets/styles/base/layout.less @@ -117,14 +117,15 @@ body { height: calc(~'100vh - 80px'); background-color: @background-color; z-index: 100; - transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); + transition: transform 0.5s ease-out; .handle { display: none; } &.liftedUp { - transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.1s ease-out 1.0s; + transition: transform 0.5s ease-out, box-shadow 0.1s ease-out 0.5s; box-shadow: 2px 3px 5px 0 rgba(0, 0, 0, 0.2); } + } #main-view.turn-up, @@ -139,7 +140,7 @@ body { width: 100vw; // box-shadow: 2px 3px 5px 0 rgba(0, 0, 0, 0.4); box-shadow: none; z-index: 250; - transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); + transition: transform 0.5s ease-out; .handle { background-color: @background-color; display: block; diff --git a/Step/wwwroot/assets/styles/base/modals.less b/Step/wwwroot/assets/styles/base/modals.less index 41e6cb4f..af5ddbcd 100644 --- a/Step/wwwroot/assets/styles/base/modals.less +++ b/Step/wwwroot/assets/styles/base/modals.less @@ -338,6 +338,10 @@ background-color: @color-backdrop; z-index: 900; + &.nc { + z-index: 700; + } + &.internal { height: calc(~"100vh - 80px"); } @@ -1332,6 +1336,58 @@ justify-content: flex-end; border-top: solid 2px @color-whitethree; } + + .box-description{ + box-sizing: border-box; + padding-top: 10px; + height: 120px; + width: 100%; + border-top: solid 2px #e7e7e7; + } + .box-image{ + display: flex; + justify-content: flex-start; + flex-flow: column; + min-height: 415px; + width: 100%; + margin-top: 16px; + .box-image-container{ + display: flex; + justify-content: center; + align-items: center; + min-height: 329px; + width: 100%; + margin: 25px auto 23px auto; + img{ + max-width: 577px; + max-height: 329px; + box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.4); + } + } + .linenumber{ + display: flex; + justify-content: center; + align-items: center; + div{ + width: 32px; + height: 18px; + button{ + margin: auto 4px; + border: none; + padding: 0; + background: none; + font-size: 18px; + line-height: 1; + color: @color-greyish-brown; + } + .target{ + color: @color-clear-blue; + font-weight: 600; + } + + } + } + } } .@{modal}.modal-job-add-parameter { diff --git a/Step/wwwroot/assets/styles/base/nc.less b/Step/wwwroot/assets/styles/base/nc.less index ef2f17e6..6583732d 100644 --- a/Step/wwwroot/assets/styles/base/nc.less +++ b/Step/wwwroot/assets/styles/base/nc.less @@ -9,6 +9,15 @@ background-color: #4e585e; box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5); height: 784px; + + &.noproc{ + width: 1038px; + left:50px; + + #nc-hmi{ + left: -2px !important; + } + } } #nc-hmi{ diff --git a/Step/wwwroot/assets/styles/style.css b/Step/wwwroot/assets/styles/style.css index ea1aaf82..8a90348c 100644 --- a/Step/wwwroot/assets/styles/style.css +++ b/Step/wwwroot/assets/styles/style.css @@ -288,6 +288,9 @@ background-color: rgba(217, 217, 217, 0.5); z-index: 900; } +.backdrop.nc { + z-index: 700; +} .backdrop.internal { height: calc(100vh - 80px); } @@ -1414,6 +1417,64 @@ justify-content: flex-end; border-top: solid 2px #e7e7e7; } +.modal.modal-load-program .box-description, +.modal.modal-add-element-queue .box-description { + box-sizing: border-box; + padding-top: 10px; + height: 120px; + width: 100%; + border-top: solid 2px #e7e7e7; +} +.modal.modal-load-program .box-image, +.modal.modal-add-element-queue .box-image { + display: flex; + justify-content: flex-start; + flex-flow: column; + min-height: 415px; + width: 100%; + margin-top: 16px; +} +.modal.modal-load-program .box-image .box-image-container, +.modal.modal-add-element-queue .box-image .box-image-container { + display: flex; + justify-content: center; + align-items: center; + min-height: 329px; + width: 100%; + margin: 25px auto 23px auto; +} +.modal.modal-load-program .box-image .box-image-container img, +.modal.modal-add-element-queue .box-image .box-image-container img { + max-width: 577px; + max-height: 329px; + box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.4); +} +.modal.modal-load-program .box-image .linenumber, +.modal.modal-add-element-queue .box-image .linenumber { + display: flex; + justify-content: center; + align-items: center; +} +.modal.modal-load-program .box-image .linenumber div, +.modal.modal-add-element-queue .box-image .linenumber div { + width: 32px; + height: 18px; +} +.modal.modal-load-program .box-image .linenumber div button, +.modal.modal-add-element-queue .box-image .linenumber div button { + margin: auto 4px; + border: none; + padding: 0; + background: none; + font-size: 18px; + line-height: 1; + color: #4b4b4b; +} +.modal.modal-load-program .box-image .linenumber div .target, +.modal.modal-add-element-queue .box-image .linenumber div .target { + color: #1791ff; + font-weight: 600; +} .modal.modal-job-add-parameter { width: 704px; height: 608px; @@ -2612,15 +2673,11 @@ fieldset[disabled] .form-group.is-focused .togglebutton label { height: 80px; width: calc(100% - 152px); position: absolute; - z-index: 950; + z-index: 801; top: 0; right: 0; left: 0; } -#app > header.coveredByModal { - z-index: 200; - filter: blur(10px); -} #app > header button { font-size: 28px; justify-content: center; @@ -3222,18 +3279,13 @@ footer .container button.big:before { top: 40px; background-color: #fff; padding: 0 0; - z-index: 949; + z-index: 800; box-sizing: border-box; display: flex; flex-wrap: nowrap; overflow: hidden; transition: width 200ms ease-in-out, height 200ms ease-in-out, padding 200ms ease-in-out, background-color 200ms ease-in-out, box-shadow 0ms 0ms; } -#alarm-list.coveredByModal, -#service-list.coveredByModal { - z-index: 500; - filter: blur(10px); -} #alarm-list.expanded, #service-list.expanded { width: 494px; @@ -3881,6 +3933,13 @@ footer .container button.big:before { box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5); height: 784px; } +.hmi-container.noproc { + width: 1038px; + left: 50px; +} +.hmi-container.noproc #nc-hmi { + left: -2px !important; +} #nc-hmi { position: absolute; top: 0; @@ -13846,13 +13905,13 @@ body { height: calc(100vh - 80px); background-color: #d8d8d8; z-index: 100; - transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); + transition: transform 0.5s ease-out; } #main-view .handle { display: none; } #main-view.liftedUp { - transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.1s ease-out 1s; + transition: transform 0.5s ease-out, box-shadow 0.1s ease-out 0.5s; box-shadow: 2px 3px 5px 0 rgba(0, 0, 0, 0.2); } #main-view.turn-up, @@ -13866,7 +13925,7 @@ body { width: 100vw; box-shadow: none; z-index: 250; - transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); + transition: transform 0.5s ease-out; } #main-view-handler .handle { background-color: #d8d8d8; diff --git a/Step/wwwroot/src/App.vue b/Step/wwwroot/src/App.vue index f97ea1e8..9a73a2ad 100644 --- a/Step/wwwroot/src/App.vue +++ b/Step/wwwroot/src/App.vue @@ -1,15 +1,15 @@ - - + + - - + + - + - + @@ -17,16 +17,231 @@ - + + - - - - × - + + - + × + +<<<<<<< HEAD +======= + + +>>>>>>> develop diff --git a/Step/wwwroot/src/app.business-logic.ts b/Step/wwwroot/src/app.business-logic.ts index 6f985840..31e6b9d7 100644 --- a/Step/wwwroot/src/app.business-logic.ts +++ b/Step/wwwroot/src/app.business-logic.ts @@ -23,11 +23,13 @@ let HMIvisibleInProduction = false let oldHMIvisible = false; let HMIAlarmsVisible = false; let HMIModalsVisible = false; +let HMIModalsNcVisible = false; let HMIDragging = false; let HMIshowTimeout; let HMIAlarmsTimeout; let HMIModalsTimeout; let HMIDraggingTimeout; +let HMIModalsNcTimeout; let HMIScreenshotInterval; let HMIprodTimeout; let RerenderInterval; @@ -36,7 +38,12 @@ const messageService = Factory.Get(MessageService); messageService.subscribeToChannel("show-user-info", () => { ModalHelper.ShowModal(UserInfoDialog); }); messageService.subscribeToChannel("show-machine-info", () => { ModalHelper.ShowModal(MachineInfoDialog); }); +<<<<<<< HEAD messageService.subscribeToChannel("show-axes-calibration", () => { ModalHelper.ShowModal(AxesCalibration, null, true); }); +======= +messageService.subscribeToChannel("show-axes-calibration", () => { ModalHelper.ShowNcModal(AxesCalibration); }); +messageService.subscribeToChannel("hide-axes-calibration", () => { ModalHelper.HideNcModal(AxesCalibration); }); +>>>>>>> develop @@ -165,6 +172,14 @@ if (typeof cmsClient != "undefined") { showModal() }); + Factory.Get(MessageService).subscribeToChannel("HMI-show-modal-nc", args => { + clearTimeout(HMIModalsNcTimeout); + if (args[0] > 0) + HMIModalsNcTimeout = setTimeout(showNcModal, args[0]); + else + showNcModal() + }); + Factory.Get(MessageService).subscribeToChannel("HMI-hide-modal", args => { clearTimeout(HMIModalsTimeout); if (args[0] > 0) @@ -173,6 +188,14 @@ if (typeof cmsClient != "undefined") { hideModal() }); + Factory.Get(MessageService).subscribeToChannel("HMI-hide-modal-nc", args => { + clearTimeout(HMIModalsNcTimeout); + if (args[0] > 0) + HMIModalsNcTimeout = setTimeout(hideNcModal, args[0]); + else + hideNcModal() + }); + Factory.Get(MessageService).subscribeToChannel("HMI-start-drag", args => { clearTimeout(HMIDraggingTimeout); if (args[0] > 0) @@ -206,6 +229,10 @@ function hideModal() { HMIModalsVisible = false; ElaborateHMIStatus(); } +function hideNcModal() { + HMIModalsNcVisible = false; + ElaborateHMIStatus(); +} function stopDrag() { HMIDragging = false; ElaborateHMIStatus(); @@ -229,6 +256,10 @@ function showModal() { HMIModalsVisible = true; ElaborateHMIStatus(); } +function showNcModal() { + HMIModalsNcVisible = true; + ElaborateHMIStatus(); +} function startDrag() { HMIDragging = true; ElaborateHMIStatus(); @@ -248,12 +279,12 @@ function ElaborateHMIStatus() { clearInterval(HMIScreenshotInterval); cmsClient.setNcWindowState(0); } - else if (hmiv && !HMIAlarmsVisible && !HMIModalsVisible && !HMIDragging) { + else if (hmiv && !HMIAlarmsVisible && !HMIModalsVisible && !HMIDragging && !HMIModalsNcVisible) { if (HMIScreenshotInterval) clearInterval(HMIScreenshotInterval); cmsClient.setNcWindowState(1); } - else if (hmiv && (HMIAlarmsVisible || HMIModalsVisible || HMIDragging)) { + else if (hmiv && (HMIAlarmsVisible || HMIModalsVisible || HMIDragging || HMIModalsNcVisible)) { cmsClient.setNcWindowState(0); } } diff --git a/Step/wwwroot/src/app_modules/alarms/components/alarms-list.ts b/Step/wwwroot/src/app_modules/alarms/components/alarms-list.ts index fdbcf6bc..282af794 100644 --- a/Step/wwwroot/src/app_modules/alarms/components/alarms-list.ts +++ b/Step/wwwroot/src/app_modules/alarms/components/alarms-list.ts @@ -10,7 +10,7 @@ import { Hub } from "src/services"; declare let $: any; -@Component({ name: "alarms-list", components: { alarmItem, alarmDetail }, props: {modalOpened: Boolean, showHeaderOnBlur: Boolean} }) +@Component({ name: "alarms-list", components: { alarmItem, alarmDetail }, props: {applyBlur: Boolean} }) export default class alarmsList extends Vue { $store: any; $route: any; diff --git a/Step/wwwroot/src/app_modules/alarms/components/alarms-list.vue b/Step/wwwroot/src/app_modules/alarms/components/alarms-list.vue index a977a297..2cbc2962 100644 --- a/Step/wwwroot/src/app_modules/alarms/components/alarms-list.vue +++ b/Step/wwwroot/src/app_modules/alarms/components/alarms-list.vue @@ -1,6 +1,6 @@ - @@ -30,7 +30,7 @@ - + ? + @click="sendMessage('show-machine-info')" :title="'header_tooltip_btn_mchinfo' | localize('Show Machine Info')"> {{state.machineInfo.machineName}} @@ -19,7 +18,6 @@ v-if="currentUser" @click="sendMessage('show-user-info')" :title="'header_tooltip_btn_usrinfo' | localize('Show User Info')" - :disabled="disabledByModal" :class="{'colorWhite':isDarkColor(getColor(currentUser.lastName,currentUser.firstName))}" :style="{'background-color':getColor(currentUser.lastName,currentUser.firstName) }" > @@ -27,7 +25,6 @@ diff --git a/Step/wwwroot/src/app_modules/maintenance/components/maintenance.ts b/Step/wwwroot/src/app_modules/maintenance/components/maintenance.ts index 99d2c211..4ebf2e3f 100644 --- a/Step/wwwroot/src/app_modules/maintenance/components/maintenance.ts +++ b/Step/wwwroot/src/app_modules/maintenance/components/maintenance.ts @@ -15,6 +15,7 @@ declare let $: any; @Component({ components: { MaintenanceProgress, maintenanceCard } }) export default class Maintenance extends Vue { +<<<<<<< HEAD:Step/wwwroot/src/app_modules/maintenance/components/maintenance.ts $route: any; public get maintenances(): server.Maintenance[] { return (this.$store.state as AppModel).maintenance.maintenances; } @@ -92,6 +93,92 @@ export default class Maintenance extends Vue { for (let i = 0; i < this.arrayState.length; i++) { if (this.arrayState[i] == state) { bool = true; +======= + $route: any; + + public get maintenances(): server.Maintenance[] {return (this.$store.state as AppModel).maintenance.maintenances; } + + public enableMaintenance: boolean = true; + + + get selectedMaintenance() { + return (this.$store.getters as MaintenanceGetters).getMaintenance(this.selectedMaintenanceId); + } + + get noteMaintenance(){ + return (this.$store.state as AppModel).maintenance.noteMaintenance; + } + + get attachmentsMaintenance(){ + return (this.$store.state as AppModel).maintenance.attachMaintenance; + } + public searchText: string = ""; + public selectedState: Array = []; + public arrayState: Array = ["expired", "ending", "running"]; + public currentFilter: string = ""; + public currentFilterState: string = ""; + + + @Watch("searchText") + public applyFilter(n) { + this.currentFilter = n.toLowerCase(); + } + + selectedMaintenanceId : number = null; + // public static selectedMaintenance: any = null; + // public static currentSelected: any = null; + + @Watch("$route.path") + changePath(){ + /** Path che viene dall'allarme delle manutenzioni */ + if(this.$route.params.id){ + this.selectedMaintenanceId = this.$route.params.id; + this.enableMaintenance = false; + } + } + + async mounted(){ + Factory.Get(MessageService).subscribeToChannel("update-maintenance", args => { + awaiter(new MaintenanceService().GetMaintenances()); + }); + ModalHelper.HideModal("modal-internal"); + await awaiter(new MaintenanceService().GetMaintenances()); + if(this.$route.params.id){ + this.selectedMaintenanceId = this.$route.params.id; + this.enableMaintenance = false; + } + } + + updated(){ + $(document).mouseup(function (e) { + var container = $(".checkboxes"); + var selector = $("#selectListCheckboxes"); + if (!container.is(e.target) && !selector.is(e.target) && container.has(e.target).length === 0) + { + container.removeClass('checkboxesView'); + } + }); + } + + public openSelectState(){ + if(!$('.checkboxes').hasClass('checkboxesView')) + $('.checkboxes').addClass('checkboxesView'); + else + $('.checkboxes').removeClass('checkboxesView'); + } + + public controlState(state){ + let bool = true; + for(let i = 0; i < this.arrayState.length; i++){ + if(this.arrayState[i] == state){ + bool = true; + return bool; + } + else{ + bool = false; + } + } +>>>>>>> develop:Step/wwwroot/src/components/maintenance.ts return bool; } else { diff --git a/Step/wwwroot/src/app_modules/production/components/production.ts b/Step/wwwroot/src/app_modules/production/components/production.ts index 79934b9f..9ad22d77 100644 --- a/Step/wwwroot/src/app_modules/production/components/production.ts +++ b/Step/wwwroot/src/app_modules/production/components/production.ts @@ -35,7 +35,7 @@ export default class Production extends Vue { } async mounted() { this.confirmationDelegate = null; - ModalHelper.HideModal("modal2"); + ModalHelper.HideModal("modal-internal"); } get machineInfo() { diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts index c7faba86..5d7f219e 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts @@ -213,19 +213,19 @@ export default class depot extends Vue { @Watch("magazineStatusModel") public modalBlockMagazine() { if (this.magazineStatusModel.action == 0) { - ModalHelper.HideModal("modal2"); + ModalHelper.HideModal("modal-internal"); } else if (this.magazineStatusModel.action == 1) { - ModalHelper.ShowModal(DepotActionLoading, "modal2"); + ModalHelper.ShowModal(DepotActionLoading, "modal-internal"); } else if (this.magazineStatusModel.action == 2) { - ModalHelper.ShowModal(DepotActionUnloading, "modal2"); + ModalHelper.ShowModal(DepotActionUnloading, "modal-internal"); } else if (this.magazineStatusModel.action == 4) { - ModalHelper.ShowModal(DepotActionTransfer, "modal2"); + ModalHelper.ShowModal(DepotActionTransfer, "modal-internal"); } else if (this.magazineStatusModel.action == 5) { - ModalHelper.ShowModal(DepotActionGeneric, "modal2"); + ModalHelper.ShowModal(DepotActionGeneric, "modal-internal"); } } diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts index 20b88943..b1f35a10 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-equipment.ts @@ -60,19 +60,19 @@ export default class toolingEquipment extends Vue { @Watch("magazineStatusModel") public modalBlockMagazine(){ if(this.magazineStatusModel.action == 0){ - ModalHelper.HideModal("modal2"); + ModalHelper.HideModal("modal-internal"); } else if(this.magazineStatusModel.action == 1){ - ModalHelper.ShowModal(DepotActionLoading, "modal2"); + ModalHelper.ShowModal(DepotActionLoading, "modal-internal"); } else if(this.magazineStatusModel.action == 2){ - ModalHelper.ShowModal(DepotActionUnloading, "modal2"); + ModalHelper.ShowModal(DepotActionUnloading, "modal-internal"); } else if(this.magazineStatusModel.action == 4){ - ModalHelper.ShowModal(DepotActionTransfer, "modal2"); + ModalHelper.ShowModal(DepotActionTransfer, "modal-internal"); } else if(this.magazineStatusModel.action == 5){ - ModalHelper.ShowModal(DepotActionGeneric, "modal2"); + ModalHelper.ShowModal(DepotActionGeneric, "modal-internal"); } } diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-families.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-families.ts index c058536a..5924a1cc 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-families.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-families.ts @@ -38,19 +38,19 @@ export default class toolingFamilies extends Vue { @Watch("magazineStatusModel") public modalBlockMagazine(){ if(this.magazineStatusModel.action == 0){ - ModalHelper.HideModal("modal2"); + ModalHelper.HideModal("modal-internal"); } else if(this.magazineStatusModel.action == 1){ - ModalHelper.ShowModal(DepotActionLoading, "modal2"); + ModalHelper.ShowModal(DepotActionLoading, "modal-internal"); } else if(this.magazineStatusModel.action == 2){ - ModalHelper.ShowModal(DepotActionUnloading, "modal2"); + ModalHelper.ShowModal(DepotActionUnloading, "modal-internal"); } else if(this.magazineStatusModel.action == 4){ - ModalHelper.ShowModal(DepotActionTransfer, "modal2"); + ModalHelper.ShowModal(DepotActionTransfer, "modal-internal"); } else if(this.magazineStatusModel.action == 5){ - ModalHelper.ShowModal(DepotActionGeneric, "modal2"); + ModalHelper.ShowModal(DepotActionGeneric, "modal-internal"); } } diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-magpos.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-magpos.ts index a670c8af..6438b1cd 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-magpos.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-magpos.ts @@ -33,19 +33,19 @@ export default class toolingMagPos extends Vue { @Watch("magazineStatusModel") public modalBlockMagazine(){ if(this.magazineStatusModel.action == 0){ - ModalHelper.HideModal("modal2"); + ModalHelper.HideModal("modal-internal"); } else if(this.magazineStatusModel.action == 1){ - ModalHelper.ShowModal(DepotActionLoading, "modal2"); + ModalHelper.ShowModal(DepotActionLoading, "modal-internal"); } else if(this.magazineStatusModel.action == 2){ - ModalHelper.ShowModal(DepotActionUnloading, "modal2"); + ModalHelper.ShowModal(DepotActionUnloading, "modal-internal"); } else if(this.magazineStatusModel.action == 4){ - ModalHelper.ShowModal(DepotActionTransfer, "modal2"); + ModalHelper.ShowModal(DepotActionTransfer, "modal-internal"); } else if(this.magazineStatusModel.action == 5){ - ModalHelper.ShowModal(DepotActionGeneric, "modal2"); + ModalHelper.ShowModal(DepotActionGeneric, "modal-internal"); } } diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-shanks.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-shanks.ts index 1fd05cd9..f204039e 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-shanks.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-shanks.ts @@ -48,19 +48,19 @@ export default class toolingShanks extends Vue { @Watch("magazineStatusModel") public modalBlockMagazine(){ if(this.magazineStatusModel.action == 0){ - ModalHelper.HideModal("modal2"); + ModalHelper.HideModal("modal-internal"); } else if(this.magazineStatusModel.action == 1){ - ModalHelper.ShowModal(DepotActionLoading, "modal2"); + ModalHelper.ShowModal(DepotActionLoading, "modal-internal"); } else if(this.magazineStatusModel.action == 2){ - ModalHelper.ShowModal(DepotActionUnloading, "modal2"); + ModalHelper.ShowModal(DepotActionUnloading, "modal-internal"); } else if(this.magazineStatusModel.action == 4){ - ModalHelper.ShowModal(DepotActionTransfer, "modal2"); + ModalHelper.ShowModal(DepotActionTransfer, "modal-internal"); } else if(this.magazineStatusModel.action == 5){ - ModalHelper.ShowModal(DepotActionGeneric, "modal2"); + ModalHelper.ShowModal(DepotActionGeneric, "modal-internal"); } } diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling.ts index a92f7410..76305af5 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling.ts @@ -35,19 +35,19 @@ export default class Tooling extends Vue { @Watch("magazineStatusModel") public modalBlockMagazine() { if (this.magazineStatusModel.action == 0) { - ModalHelper.HideModal("modal2"); + ModalHelper.HideModal("modal-internal"); } else if (this.magazineStatusModel.action == 1) { - ModalHelper.ShowModal(DepotActionLoading, "modal2"); + ModalHelper.ShowModal(DepotActionLoading, "modal-internal"); } else if (this.magazineStatusModel.action == 2) { - ModalHelper.ShowModal(DepotActionUnloading, "modal2"); + ModalHelper.ShowModal(DepotActionUnloading, "modal-internal"); } else if (this.magazineStatusModel.action == 4) { - ModalHelper.ShowModal(DepotActionTransfer, "modal2"); + ModalHelper.ShowModal(DepotActionTransfer, "modal-internal"); } else if (this.magazineStatusModel.action == 5) { - ModalHelper.ShowModal(DepotActionGeneric, "modal2"); + ModalHelper.ShowModal(DepotActionGeneric, "modal-internal"); } } diff --git a/Step/wwwroot/src/app_modules/under-the-hood/components/jog-menu.vue b/Step/wwwroot/src/app_modules/under-the-hood/components/jog-menu.vue index 0211f905..66e06fe5 100644 --- a/Step/wwwroot/src/app_modules/under-the-hood/components/jog-menu.vue +++ b/Step/wwwroot/src/app_modules/under-the-hood/components/jog-menu.vue @@ -14,7 +14,8 @@ {{a.name}} diff --git a/Step/wwwroot/src/app_modules/under-the-hood/components/under-the-hood.ts b/Step/wwwroot/src/app_modules/under-the-hood/components/under-the-hood.ts index 81186154..320f348a 100644 --- a/Step/wwwroot/src/app_modules/under-the-hood/components/under-the-hood.ts +++ b/Step/wwwroot/src/app_modules/under-the-hood/components/under-the-hood.ts @@ -1,3 +1,32 @@ +<<<<<<< HEAD:Step/wwwroot/src/app_modules/under-the-hood/components/under-the-hood.ts +======= + + + + + × + + + + + + + + + + + + + + + + + + + + + + diff --git a/Step/wwwroot/src/modules/create-maintenance.ts b/Step/wwwroot/src/modules/create-maintenance.ts index b64ca2ef..5b82aa4e 100644 --- a/Step/wwwroot/src/modules/create-maintenance.ts +++ b/Step/wwwroot/src/modules/create-maintenance.ts @@ -28,8 +28,13 @@ export default class createMaintenance extends Vue { this.newMaintenance.time = this.newMaintenance.deadline; } } + Factory.Get(MessageService).subscribeToChannel("esc_pressed", args => { + this.close(); + }); + } + beforeDestroy() { + Factory.Get(MessageService).deleteChannel("esc_pressed"); } - close() { Factory.Get(MessageService).deleteChannel("esc_pressed"); ModalHelper.HideModal(); diff --git a/Step/wwwroot/src/services/dataService.ts b/Step/wwwroot/src/services/dataService.ts index 056bcf21..e8f8addc 100644 --- a/Step/wwwroot/src/services/dataService.ts +++ b/Step/wwwroot/src/services/dataService.ts @@ -2,6 +2,8 @@ import { baseRestService } from "src/_base/baseRestService"; import { store, MachineInfoModel, machineInfoActions } from "src/store"; import {SoftKeysConfigurationModel} from "../store/machineInfo.store" +declare var cmsClient: any; + export class DataService extends baseRestService { async GetSoftKeysConfiguration() { @@ -36,7 +38,10 @@ export class DataService extends baseRestService { } public async setActiveScreenOnHMI(screen) { - return await this.put("/api/nc/active_screen/"+ screen,null, true); + let result = await this.put("/api/nc/active_screen/"+ screen,null, true); + if(typeof cmsClient != "undefined"){} + cmsClient.forceNcFocus(); + return result; } //async GetAlarmsResetConfiguration(){ diff --git a/Step/wwwroot/src/services/hub.ts b/Step/wwwroot/src/services/hub.ts index ef03faea..92a51b8d 100644 --- a/Step/wwwroot/src/services/hub.ts +++ b/Step/wwwroot/src/services/hub.ts @@ -71,6 +71,7 @@ export class Hub { this._hub.client.magazinesStatus = Hub.magazineStatusChanged; this._hub.client.activeProgramData = Hub.activeProgramData; this._hub.client.magazineIsActive = Hub.magazineIsActive; + this._hub.client.m155Data = Hub.m155Data; this._hub.client.partProgramQueue = Hub.partProgramQueue; @@ -115,8 +116,7 @@ export class Hub { private static activeProgramData(data) { if(data.path != ""){ fileService.getActiveFileInfo(data.path).then(r => { - var image = r.previewBase64; - processModelActions.setCurrentProgramImage(store, image); + processModelActions.setCurrentProgramImage(store, r.image); processModelActions.setCurrentProgramName(store, r.name); }); } @@ -156,6 +156,11 @@ export class Hub { toolingActions.updateMagazine(store, newArrayMagazine); } + private static m155Data(data){ + console.log(data); + + } + private static magazineStatusChanged(data) { depotActions.setMagazineStatusModel(store, data); @@ -342,7 +347,7 @@ export class Hub { me._axesVisible = true; } else if (!resettingAxes && me._axesVisible) { - ModalHelper.HideModal(); + Factory.Get(MessageService).publishToChannel("hide-axes-calibration"); me._axesVisible = false; } }, 500); @@ -398,6 +403,10 @@ export class Hub { this._hub.server.selectAxis(id); } + public WriteM155Response(process: number,value: number) { + this._hub.server.WriteM155Response(process,value); + } + public Hello() { this._hub.server.hello(); }