ToolClass

This commit is contained in:
Mike Phares 2023-08-02 11:41:17 -07:00
parent f54b93c0d6
commit 2b9e48c61c
10 changed files with 46 additions and 47 deletions

View File

@ -11,12 +11,16 @@ type: "kanbn"
# Azure Pipeline # Azure Pipeline
```bash ```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 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 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 ```bash
apt-get install libicu66
mv vsts-agent-linux-x64-2.210.1.tar.gz vsts-agent-linux-x64-2.210.1-unity4 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 cd vsts-agent-linux-x64-2.210.1-unity4
tar xvzf vsts-agent-linux-x64-2.210.1.tar.gz tar xvzf vsts-agent-linux-x64-2.210.1.tar.gz
chown unity4 /home/unity4/vsts-agent-linux-x64-2.210.1-unity4 -R chown unity4 /home/unity4/vsts-agent-linux-x64-2.210.1-unity4 -R

View File

@ -43,7 +43,7 @@ public class UnitTestFileService
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
Server.Models.AppSettings appSettings = serviceProvider.GetRequiredService<Server.Models.AppSettings>(); Server.Models.AppSettings appSettings = serviceProvider.GetRequiredService<Server.Models.AppSettings>();
IFileService fileService = serviceProvider.GetRequiredService<IFileService>(); IFileService fileService = serviceProvider.GetRequiredService<IFileService>();
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); fileService.Write(appSettings.EquipmentName, appSettings.FileShare, calendar: null, notification);
_Logger.Information($"{_TestContext?.TestName} completed"); _Logger.Information($"{_TestContext?.TestName} completed");
NonThrowTryCatch(); NonThrowTryCatch();

View File

@ -44,7 +44,7 @@ public class UnitTestPostService
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
Server.Models.AppSettings appSettings = serviceProvider.GetRequiredService<Server.Models.AppSettings>(); Server.Models.AppSettings appSettings = serviceProvider.GetRequiredService<Server.Models.AppSettings>();
IPostService postService = serviceProvider.GetRequiredService<IPostService>(); IPostService postService = serviceProvider.GetRequiredService<IPostService>();
Notification notification = new(KeyPressEvent: null, "Test", null); Notification notification = new(KeyPressEvent: null, "Test", appSettings.ToolClass, null);
_ = postService.Post(appSettings.PostTo, httpClient, notification); _ = postService.Post(appSettings.PostTo, httpClient, notification);
_Logger.Information($"{_TestContext?.TestName} completed"); _Logger.Information($"{_TestContext?.TestName} completed");
NonThrowTryCatch(); NonThrowTryCatch();

View File

@ -137,7 +137,7 @@ public class TimedHostedService : IHostedService, IAggregateInputReader, IDispos
Result<string> result = _LastScanService.GetScan(); Result<string> result = _LastScanService.GetScan();
if (!string.IsNullOrEmpty(result.Results)) if (!string.IsNullOrEmpty(result.Results))
{ {
Notification notification = new(e, result.Results, null); Notification notification = new(e, result.Results, _AppSettings.ToolClass, null);
_Notifications.Add(notification); _Notifications.Add(notification);
_ = _HubContext.Clients.All.SendAsync(nameof(NotificationHub.NotifyAll), 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()); throw new Exception(httpResponseMessage.Result.StatusCode.ToString());
Task<string> content = httpResponseMessage.Result.Content.ReadAsStringAsync(); Task<string> content = httpResponseMessage.Result.Content.ReadAsStringAsync();
content.Wait(); 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); _ = _HubContext.Clients.All.SendAsync(nameof(NotificationHub.NotifyAll), notification);
} }
} }

View File

@ -24,6 +24,7 @@ public record AppSettings(string BuildNumber,
string RootPassword, string RootPassword,
string SerialPortName, string SerialPortName,
int ShareToEvery, int ShareToEvery,
string ToolClass,
string URLs, string URLs,
string WorkingDirectoryName, string WorkingDirectoryName,
int WriteToSerialEvery) int WriteToSerialEvery)

View File

@ -6,32 +6,31 @@ namespace Barcode.Host.Server.Models.Binder;
public class AppSettings 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 = "Last Scan Service Clear After"), Required] public int? ClearLastScanServiceAfter { get; set; }
[Display(Name = "Company"), Required] public string Company { 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 = "Device Name Ends With"), Required] public string? DeviceNameEndsWith { get; set; }
[Display(Name = "Equipment Name"), Required] public string EquipmentName { get; set; } [Display(Name = "Equipment Name"), Required] public string? EquipmentName { get; set; }
[Display(Name = "ExpectedScanLengthA"), Required] public int? ExpectedScanLengthA { get; set; } [Display(Name = "ExpectedScanLengthA"), Required] public int? ExpectedScanLengthA { get; set; }
[Display(Name = "ExpectedScanLengthB"), Required] public int? ExpectedScanLengthB { 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 Development"), Required] public bool? IsDevelopment { get; set; }
[Display(Name = "Is Staging"), Required] public bool? IsStaging { 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 = "Linux Device Path"), Required] public string? LinuxDevicePath { get; set; }
[Display(Name = "Mock Root"), Required] public string MockRoot { 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 Resource"), Required] public string? MonAResource { get; set; }
[Display(Name = "MonA Site"), Required] public string MonASite { get; set; } [Display(Name = "MonA Site"), Required] public string? MonASite { get; set; }
[Display(Name = "Notify Minimum"), Required] public int? NotifyMinimum { 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 = "OpenInsight Application Programming Interface"), Required] public string? OpenInsightApplicationProgrammingInterface { get; set; }
[Display(Name = "PostTo"), Required] public string PostTo { get; set; } [Display(Name = "PostTo"), Required] public string? PostTo { get; set; }
[Display(Name = "Post to Every"), Required] public int? PostToEvery { get; set; } [Display(Name = "Post to Every"), Required] public int? PostToEvery { get; set; }
[Display(Name = "RootPassword"), Required] public string RootPassword { get; set; } [Display(Name = "RootPassword"), Required] public string? RootPassword { get; set; }
[Display(Name = "Serial Port Name"), Required] public string SerialPortName { 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 = "Share to Every"), Required] public int? ShareToEvery { get; set; }
[Display(Name = "URLs"), Required] public string URLs { get; set; } [Display(Name = "ToolClass"), Required] public string? ToolClass { get; set; }
[Display(Name = "Working Directory Name"), Required] public string WorkingDirectoryName { 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; } [Display(Name = "WriteToSerialEvery"), Required] public int? WriteToSerialEvery { get; set; }
#nullable restore #nullable restore
@ -91,6 +90,8 @@ public class AppSettings
throw new NullReferenceException(nameof(SerialPortName)); throw new NullReferenceException(nameof(SerialPortName));
if (appSettings.ShareToEvery is null) if (appSettings.ShareToEvery is null)
throw new NullReferenceException(nameof(ShareToEvery)); throw new NullReferenceException(nameof(ShareToEvery));
if (appSettings.ToolClass is null)
throw new NullReferenceException(nameof(ToolClass));
if (appSettings.URLs is null) if (appSettings.URLs is null)
throw new NullReferenceException(nameof(URLs)); throw new NullReferenceException(nameof(URLs));
if (appSettings.WorkingDirectoryName is null) if (appSettings.WorkingDirectoryName is null)
@ -120,6 +121,7 @@ public class AppSettings
appSettings.RootPassword, appSettings.RootPassword,
appSettings.SerialPortName, appSettings.SerialPortName,
appSettings.ShareToEvery.Value, appSettings.ShareToEvery.Value,
appSettings.ToolClass,
appSettings.URLs, appSettings.URLs,
appSettings.WorkingDirectoryName, appSettings.WorkingDirectoryName,
appSettings.WriteToSerialEvery.Value); appSettings.WriteToSerialEvery.Value);

View File

@ -37,15 +37,7 @@
<p>&nbsp;</p> <p>&nbsp;</p>
<div class="row p-1"> <div class="row p-1">
<div class="col-6"> <div class="col-6">
<h1 id="recipe" style="text-align:center"></h1> <h1 id="qaMetTests" style="text-align:center"></h1>
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="row p-1">
<div class="col-6">
<h1 id="httpContentBody" style="text-align:center"></h1>
</div> </div>
</div> </div>
</div> </div>
@ -54,5 +46,5 @@
console.log(appSettings.BuildSourceVersion); console.log(appSettings.BuildSourceVersion);
console.log(appSettings.BuildNumber); console.log(appSettings.BuildNumber);
</script> </script>
<script src="~/js/signalr/dist/browser/signalr.js?dateTime=2023-07-26---12-08-00"></script> <script src="~/js/signalr/dist/browser/signalr.js?build_source_version=@(Html.Raw(this.Model.AppSettings.BuildSourceVersion))"></script>
<script src="~/js/notification.js?dateTime=2023-07-26---12-08-00"></script> <script src="~/js/notification.js?build_source_version=@(Html.Raw(this.Model.AppSettings.BuildSourceVersion))"></script>

View File

@ -67,6 +67,7 @@
}, },
"ShareToEvery": 1000, "ShareToEvery": 1000,
"RootPassword": "", "RootPassword": "",
"ToolClass": "FTIR",
"URLs": "http://localhost:5003;", "URLs": "http://localhost:5003;",
"WorkingDirectoryName": "IFXApps", "WorkingDirectoryName": "IFXApps",
"WriteToSerialEvery": 750 "WriteToSerialEvery": 750

View File

@ -17,12 +17,10 @@ connection.on("NotifyAll", function (data) {
} }
if (!data.httpContentBody) { if (!data.httpContentBody) {
if (!data.keyPressEvent || !data.lastScanServiceResultValue) { if (!data.keyPressEvent || !data.lastScanServiceResultValue) {
document.getElementById("httpContentBody").innerText = data;
document.getElementById("mId").innerText = ""; document.getElementById("mId").innerText = "";
document.getElementById("recipe").innerText = ""; document.getElementById("qaMetTests").innerText = "";
} }
} else { } else {
document.getElementById("httpContentBody").innerText = data.httpContentBody;
var postResult = JSON.parse(data.httpContentBody); var postResult = JSON.parse(data.httpContentBody);
if (!postResult.MId) { if (!postResult.MId) {
document.getElementById("mId").innerText = ""; document.getElementById("mId").innerText = "";
@ -31,19 +29,20 @@ connection.on("NotifyAll", function (data) {
"mId", "mId",
).innerText = `Use ${postResult.MId} for the wafer and input id`; ).innerText = `Use ${postResult.MId} for the wafer and input id`;
} }
if (!postResult.Recipe) { if (!postResult.QaMetTests) {
document.getElementById("recipe").innerText = ""; document.getElementById("qaMetTests").innerText = data.httpContentBody;
} else { } else {
if (postResult.Recipe != "Recipe") { var properties = [];
document.getElementById("recipe").innerText = postResult.Recipe; var qaMetTests = "";
} else { for (const property in postResult)
$.getJSON(appSettings.OpenInsightApplicationProgrammingInterface + "/materials/rds/" + postResult.LotName, properties.push(property);
function (data) { for (var i = 0; i < properties.length; i++) {
document.getElementById("recipe").innerText = data.rds.rdsLayers.length; for (var j = 0; j < postResult[properties[i]].length; j++) {
}, qaMetTests += properties[i] + " - [" + postResult[properties[i]][j].recipe + "] - [" + postResult[properties[i]][j].recipePattern + "]<br />";
);
} }
} }
document.getElementById("qaMetTests").innerText = qaMetTests;
}
} }
}); });

View File

@ -2,4 +2,4 @@ using Barcode.Host.Shared.KeyboardMouse;
namespace Barcode.Host.Shared.Models; namespace Barcode.Host.Shared.Models;
public record Notification(KeyPressEvent? KeyPressEvent, string? LastScanServiceResultValue, string? HttpContentBody); public record Notification(KeyPressEvent? KeyPressEvent, string? LastScanServiceResultValue, string ToolClass, string? HttpContentBody);