diff --git a/.kanbn/tasks/azure-pipeline.md b/.kanbn/tasks/azure-pipeline.md index 5b4d09d..da41c29 100644 --- a/.kanbn/tasks/azure-pipeline.md +++ b/.kanbn/tasks/azure-pipeline.md @@ -11,12 +11,16 @@ type: "kanbn" # Azure Pipeline ```bash +apt install putty-tools pscp D:/Tmp/phares/ag/vsts-agent-linux-x64-2.210.1.tar.gz unity4@unity4:/home/unity4/vsts-agent-linux-x64-2.210.1.tar.gz pscp D:/Tmp/phares/ag/vsts-agent-linux-x64-2.210.1.tar.gz unity5@unity5:/home/unity5/vsts-agent-linux-x64-2.210.1.tar.gz +pscp D:/Tmp/phares/ag/vsts-agent-linux-x64-2.210.1.tar.gz room006@mescroom006:/home/room006/vsts-agent-linux-x64-2.210.1.tar.gz ``` ```bash +apt-get install libicu66 mv vsts-agent-linux-x64-2.210.1.tar.gz vsts-agent-linux-x64-2.210.1-unity4 +mkdir vsts-agent-linux-x64-2.210.1-unity4 cd vsts-agent-linux-x64-2.210.1-unity4 tar xvzf vsts-agent-linux-x64-2.210.1.tar.gz chown unity4 /home/unity4/vsts-agent-linux-x64-2.210.1-unity4 -R diff --git a/Server.Tests/UnitTestFileService.cs b/Server.Tests/UnitTestFileService.cs index cf0dec2..86b2b7e 100644 --- a/Server.Tests/UnitTestFileService.cs +++ b/Server.Tests/UnitTestFileService.cs @@ -43,7 +43,7 @@ public class UnitTestFileService IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; Server.Models.AppSettings appSettings = serviceProvider.GetRequiredService(); IFileService fileService = serviceProvider.GetRequiredService(); - Notification notification = new(KeyPressEvent: null, "Test", null); + Notification notification = new(KeyPressEvent: null, "Test", appSettings.ToolClass, null); fileService.Write(appSettings.EquipmentName, appSettings.FileShare, calendar: null, notification); _Logger.Information($"{_TestContext?.TestName} completed"); NonThrowTryCatch(); diff --git a/Server.Tests/UnitTestPostService.cs b/Server.Tests/UnitTestPostService.cs index bab866e..8dcdc7e 100644 --- a/Server.Tests/UnitTestPostService.cs +++ b/Server.Tests/UnitTestPostService.cs @@ -44,7 +44,7 @@ public class UnitTestPostService IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; Server.Models.AppSettings appSettings = serviceProvider.GetRequiredService(); IPostService postService = serviceProvider.GetRequiredService(); - Notification notification = new(KeyPressEvent: null, "Test", null); + Notification notification = new(KeyPressEvent: null, "Test", appSettings.ToolClass, null); _ = postService.Post(appSettings.PostTo, httpClient, notification); _Logger.Information($"{_TestContext?.TestName} completed"); NonThrowTryCatch(); diff --git a/Server/HostedService/TimedHostedService.cs b/Server/HostedService/TimedHostedService.cs index 734aa8f..df3e961 100644 --- a/Server/HostedService/TimedHostedService.cs +++ b/Server/HostedService/TimedHostedService.cs @@ -137,7 +137,7 @@ public class TimedHostedService : IHostedService, IAggregateInputReader, IDispos Result result = _LastScanService.GetScan(); if (!string.IsNullOrEmpty(result.Results)) { - Notification notification = new(e, result.Results, null); + Notification notification = new(e, result.Results, _AppSettings.ToolClass, null); _Notifications.Add(notification); _ = _HubContext.Clients.All.SendAsync(nameof(NotificationHub.NotifyAll), notification); } @@ -250,7 +250,7 @@ public class TimedHostedService : IHostedService, IAggregateInputReader, IDispos throw new Exception(httpResponseMessage.Result.StatusCode.ToString()); Task content = httpResponseMessage.Result.Content.ReadAsStringAsync(); content.Wait(); - Notification notification = new(null, null, content.Result); + Notification notification = new(null, null, _AppSettings.ToolClass, content.Result); _ = _HubContext.Clients.All.SendAsync(nameof(NotificationHub.NotifyAll), notification); } } diff --git a/Server/Models/AppSettings.cs b/Server/Models/AppSettings.cs index 17046cd..074919c 100644 --- a/Server/Models/AppSettings.cs +++ b/Server/Models/AppSettings.cs @@ -24,6 +24,7 @@ public record AppSettings(string BuildNumber, string RootPassword, string SerialPortName, int ShareToEvery, + string ToolClass, string URLs, string WorkingDirectoryName, int WriteToSerialEvery) diff --git a/Server/Models/Binder/AppSettings.cs b/Server/Models/Binder/AppSettings.cs index 43edf21..61e57de 100644 --- a/Server/Models/Binder/AppSettings.cs +++ b/Server/Models/Binder/AppSettings.cs @@ -6,32 +6,31 @@ namespace Barcode.Host.Server.Models.Binder; public class AppSettings { -#nullable disable - - [Display(Name = "Build Number"), Required] public string BuildNumber { get; set; } - [Display(Name = "Build Source Version"), Required] public string BuildSourceVersion { get; set; } + [Display(Name = "Build Number"), Required] public string? BuildNumber { get; set; } + [Display(Name = "Build Source Version"), Required] public string? BuildSourceVersion { get; set; } [Display(Name = "Last Scan Service Clear After"), Required] public int? ClearLastScanServiceAfter { get; set; } - [Display(Name = "Company"), Required] public string Company { get; set; } - [Display(Name = "Device Name Ends With"), Required] public string DeviceNameEndsWith { get; set; } - [Display(Name = "Equipment Name"), Required] public string EquipmentName { get; set; } + [Display(Name = "Company"), Required] public string? Company { get; set; } + [Display(Name = "Device Name Ends With"), Required] public string? DeviceNameEndsWith { get; set; } + [Display(Name = "Equipment Name"), Required] public string? EquipmentName { get; set; } [Display(Name = "ExpectedScanLengthA"), Required] public int? ExpectedScanLengthA { get; set; } [Display(Name = "ExpectedScanLengthB"), Required] public int? ExpectedScanLengthB { get; set; } - [Display(Name = "File Share"), Required] public string FileShare { get; set; } + [Display(Name = "File Share"), Required] public string? FileShare { get; set; } [Display(Name = "Is Development"), Required] public bool? IsDevelopment { get; set; } [Display(Name = "Is Staging"), Required] public bool? IsStaging { get; set; } - [Display(Name = "Linux Device Path"), Required] public string LinuxDevicePath { get; set; } - [Display(Name = "Mock Root"), Required] public string MockRoot { get; set; } - [Display(Name = "MonA Resource"), Required] public string MonAResource { get; set; } - [Display(Name = "MonA Site"), Required] public string MonASite { get; set; } + [Display(Name = "Linux Device Path"), Required] public string? LinuxDevicePath { get; set; } + [Display(Name = "Mock Root"), Required] public string? MockRoot { get; set; } + [Display(Name = "MonA Resource"), Required] public string? MonAResource { get; set; } + [Display(Name = "MonA Site"), Required] public string? MonASite { get; set; } [Display(Name = "Notify Minimum"), Required] public int? NotifyMinimum { get; set; } - [Display(Name = "OpenInsight Application Programming Interface"), Required] public string OpenInsightApplicationProgrammingInterface { get; set; } - [Display(Name = "PostTo"), Required] public string PostTo { get; set; } + [Display(Name = "OpenInsight Application Programming Interface"), Required] public string? OpenInsightApplicationProgrammingInterface { get; set; } + [Display(Name = "PostTo"), Required] public string? PostTo { get; set; } [Display(Name = "Post to Every"), Required] public int? PostToEvery { get; set; } - [Display(Name = "RootPassword"), Required] public string RootPassword { get; set; } - [Display(Name = "Serial Port Name"), Required] public string SerialPortName { get; set; } + [Display(Name = "RootPassword"), Required] public string? RootPassword { get; set; } + [Display(Name = "Serial Port Name"), Required] public string? SerialPortName { get; set; } [Display(Name = "Share to Every"), Required] public int? ShareToEvery { get; set; } - [Display(Name = "URLs"), Required] public string URLs { get; set; } - [Display(Name = "Working Directory Name"), Required] public string WorkingDirectoryName { get; set; } + [Display(Name = "ToolClass"), Required] public string? ToolClass { get; set; } + [Display(Name = "URLs"), Required] public string? URLs { get; set; } + [Display(Name = "Working Directory Name"), Required] public string? WorkingDirectoryName { get; set; } [Display(Name = "WriteToSerialEvery"), Required] public int? WriteToSerialEvery { get; set; } #nullable restore @@ -91,6 +90,8 @@ public class AppSettings throw new NullReferenceException(nameof(SerialPortName)); if (appSettings.ShareToEvery is null) throw new NullReferenceException(nameof(ShareToEvery)); + if (appSettings.ToolClass is null) + throw new NullReferenceException(nameof(ToolClass)); if (appSettings.URLs is null) throw new NullReferenceException(nameof(URLs)); if (appSettings.WorkingDirectoryName is null) @@ -120,6 +121,7 @@ public class AppSettings appSettings.RootPassword, appSettings.SerialPortName, appSettings.ShareToEvery.Value, + appSettings.ToolClass, appSettings.URLs, appSettings.WorkingDirectoryName, appSettings.WriteToSerialEvery.Value); diff --git a/Server/Pages/Notification.cshtml b/Server/Pages/Notification.cshtml index e4198d2..f9c9dfa 100644 --- a/Server/Pages/Notification.cshtml +++ b/Server/Pages/Notification.cshtml @@ -37,15 +37,7 @@

 

-

-
-
-

 

-

 

-

 

-
-
-

+

@@ -54,5 +46,5 @@ console.log(appSettings.BuildSourceVersion); console.log(appSettings.BuildNumber); - - \ No newline at end of file + + \ No newline at end of file diff --git a/Server/appsettings.json b/Server/appsettings.json index fd4d2b9..fee4de3 100644 --- a/Server/appsettings.json +++ b/Server/appsettings.json @@ -67,6 +67,7 @@ }, "ShareToEvery": 1000, "RootPassword": "", + "ToolClass": "FTIR", "URLs": "http://localhost:5003;", "WorkingDirectoryName": "IFXApps", "WriteToSerialEvery": 750 diff --git a/Server/wwwroot/js/notification.js b/Server/wwwroot/js/notification.js index 07e9a50..23a1072 100644 --- a/Server/wwwroot/js/notification.js +++ b/Server/wwwroot/js/notification.js @@ -17,12 +17,10 @@ connection.on("NotifyAll", function (data) { } if (!data.httpContentBody) { if (!data.keyPressEvent || !data.lastScanServiceResultValue) { - document.getElementById("httpContentBody").innerText = data; document.getElementById("mId").innerText = ""; - document.getElementById("recipe").innerText = ""; + document.getElementById("qaMetTests").innerText = ""; } } else { - document.getElementById("httpContentBody").innerText = data.httpContentBody; var postResult = JSON.parse(data.httpContentBody); if (!postResult.MId) { document.getElementById("mId").innerText = ""; @@ -31,18 +29,19 @@ connection.on("NotifyAll", function (data) { "mId", ).innerText = `Use ${postResult.MId} for the wafer and input id`; } - if (!postResult.Recipe) { - document.getElementById("recipe").innerText = ""; + if (!postResult.QaMetTests) { + document.getElementById("qaMetTests").innerText = data.httpContentBody; } else { - if (postResult.Recipe != "Recipe") { - document.getElementById("recipe").innerText = postResult.Recipe; - } else { - $.getJSON(appSettings.OpenInsightApplicationProgrammingInterface + "/materials/rds/" + postResult.LotName, - function (data) { - document.getElementById("recipe").innerText = data.rds.rdsLayers.length; - }, - ); + var properties = []; + var qaMetTests = ""; + for (const property in postResult) + properties.push(property); + for (var i = 0; i < properties.length; i++) { + for (var j = 0; j < postResult[properties[i]].length; j++) { + qaMetTests += properties[i] + " - [" + postResult[properties[i]][j].recipe + "] - [" + postResult[properties[i]][j].recipePattern + "]
"; + } } + document.getElementById("qaMetTests").innerText = qaMetTests; } } }); diff --git a/Shared/Models/Notification.cs b/Shared/Models/Notification.cs index 0360949..3e7759f 100644 --- a/Shared/Models/Notification.cs +++ b/Shared/Models/Notification.cs @@ -2,4 +2,4 @@ using Barcode.Host.Shared.KeyboardMouse; namespace Barcode.Host.Shared.Models; -public record Notification(KeyPressEvent? KeyPressEvent, string? LastScanServiceResultValue, string? HttpContentBody); \ No newline at end of file +public record Notification(KeyPressEvent? KeyPressEvent, string? LastScanServiceResultValue, string ToolClass, string? HttpContentBody); \ No newline at end of file