diff --git a/.vscode/launch.json b/.vscode/launch.json index 4d1d636..3495e20 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -66,6 +66,11 @@ "request": "attach", "preLaunchTask": "watchClientHub", "processName": "OI.Metrology.ClientHub.exe" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" } ] } \ No newline at end of file diff --git a/Server/.vscode/settings.json b/Server/.vscode/settings.json new file mode 100644 index 0000000..e69de29 diff --git a/Server/.vscode/tasks.json b/Server/.vscode/tasks.json index cd5c524..82dead4 100644 --- a/Server/.vscode/tasks.json +++ b/Server/.vscode/tasks.json @@ -44,7 +44,7 @@ "args": [ "watch", "--launch-profile", - "https", + "http", "run", "--project", "${workspaceFolder}/OI.Metrology.Server.csproj", diff --git a/Server/Repositories/PinRepository.cs b/Server/Repositories/PinRepository.cs index c91a37a..288f6ed 100644 --- a/Server/Repositories/PinRepository.cs +++ b/Server/Repositories/PinRepository.cs @@ -50,11 +50,11 @@ public class PinRepository : IPinRepository return new(bioRadHeader, cdeHeader); } - private static Pinned? GetPinned(IMetrologyRepository metrologyRepository, HeaderCommon bioRadHeader, int points, int column) + private static Pinned? GetPinned(IMetrologyRepository metrologyRepository, HeaderCommon headerCommon, int points, int column) { Pinned? result; List values; - System.Data.DataTable dataTable = metrologyRepository.GetData((int)bioRadHeader.ToolTypeID, bioRadHeader.ID); + System.Data.DataTable dataTable = metrologyRepository.GetData((int)headerCommon.ToolTypeID, headerCommon.ID); if (dataTable.Rows.Count <= points || dataTable.Columns.Count <= column) result = null; else @@ -69,7 +69,7 @@ public class PinRepository : IPinRepository if (values.Count <= points) result = null; else - result = new(bioRadHeader, values); + result = new(headerCommon, values); } return result; } @@ -92,7 +92,7 @@ public class PinRepository : IPinRepository { const int points = 9; List results = new(); - (HeaderCommon? cdeHeader, HeaderCommon? bioRadHeader) = GetBoth(rds, bioRadId, cdeId); + (HeaderCommon? bioRadHeader, HeaderCommon? cdeHeader) = GetBoth(rds, bioRadId, cdeId); if (bioRadHeader is not null) { const int thickness = 5; diff --git a/Server/appsettings.Development.json b/Server/appsettings.Development.json index 788f23d..d278535 100644 --- a/Server/appsettings.Development.json +++ b/Server/appsettings.Development.json @@ -1,6 +1,8 @@ { - "ApiUrl": "http://messa010ec.ec.local:50301/api", - "ConnectionString": "Data Source=MESSAD1001\\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;", + "xApiUrl": "http://messa010ec.ec.local:50301/api", + "ApiUrl": "http://localhost:5126/api", + "ConnectionString": "Data Source=messv01ec.ec.local\\PROD1,53959;Integrated Security=True;Initial Catalog=Metrology;", + "xConnectionString": "Data Source=MESSAD1001\\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;", "IsDevelopment": true, "xMockRoot": "/Data/Tests", "MockRoot": "", diff --git a/Server/wwwroot/js/common.js b/Server/wwwroot/js/common.js index d6bfde5..647cb14 100644 --- a/Server/wwwroot/js/common.js +++ b/Server/wwwroot/js/common.js @@ -123,9 +123,17 @@ function ConstructMessageDialog() { ' ' + '
' + '
' + + ' ' + ' ' + ' ' + ' ' + ''; diff --git a/Server/wwwroot/js/site.js b/Server/wwwroot/js/site.js index 2bf4537..013826d 100644 --- a/Server/wwwroot/js/site.js +++ b/Server/wwwroot/js/site.js @@ -465,14 +465,19 @@ function pinButtonRunInfo() { if (selectedRow !== null) { $("#PinButton").prop("disabled", true); var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index]; + var stringified = JSON.stringify(rowData); + stringified = stringified.replace(/"Tool":/gm, '"MesEntity":'); + stringified = stringified.replace(/"Equipment ID":/gm, '"MesEntity":'); + var jsonObject = JSON.parse(stringified); $.ajax({ type: "POST", - url: "http://localhost:5126/api" + '/pin/' + toolTypeId + "/markAsPinned", - data: rowData, + url: _apiUrl + '/pin/' + toolTypeId + "/markAsPinned", + data: jsonObject, success: function (e) { DisplayWSMessage("info", "Marked as pinned", e); + // DisplayWSMessage("info", stringified, e); $("#PinButton").prop("disabled", false); - $.getJSON("http://localhost:5126/api" + '/pin/' + toolTypeId + "/pinned?biorad_id=" + _BioRadId + "&cde_id=" + _CdeId + "&rds=" + rowData.RDS, function (data) { + $.getJSON(_apiUrl + '/pin/' + toolTypeId + "/pinned?biorad_id=" + _BioRadId + "&cde_id=" + _CdeId + "&rds=" + rowData.RDS, function (data) { $("#ModalHeaderGrid").igGrid({ dataSource: data, features: [ @@ -481,6 +486,7 @@ function pinButtonRunInfo() { columns: [ { key: "ID", dataType: "number", hidden: true, }, { key: "ToolTypeID", dataType: "number", hidden: true, }, + { headerText: "Tool", key: "MesEntity", dataType: "string", width: "10%" }, { key: "Reactor", dataType: "string", width: "10%" }, { key: "RDS", dataType: "string", width: "10%" }, { key: "PSN", dataType: "string", width: "10%" }, @@ -489,6 +495,11 @@ function pinButtonRunInfo() { ], responseDataKey: "Results", }); + var text = ""; + for (var i = 0; i < data.Results.length; i++) { + text = text + data.Results[i].Point1 + "\t" + data.Results[i].Point2 + "\t" + data.Results[i].Point3 + "\t" + data.Results[i].Point4 + "\t" + data.Results[i].Point5 + "\t" + data.Results[i].Point6 + "\t" + data.Results[i].Point7 + "\t" + data.Results[i].Point8 + "\t" + data.Results[i].Point9 + "\r"; + } + $("#textareaClipboard").val(text); $("#ModalBodyGrid").igGrid({ dataSource: data, features: [ @@ -497,14 +508,15 @@ function pinButtonRunInfo() { columns: [ { key: "ID", dataType: "number", hidden: true, }, { key: "ToolTypeID", dataType: "number", hidden: true, }, - { key: "PointA", dataType: "number", width: "10%" }, - { key: "PointB", dataType: "number", width: "10%" }, - { key: "PointC", dataType: "number", width: "10%" }, - { key: "PointD", dataType: "number", width: "10%" }, - { key: "PointE", dataType: "number", width: "10%" }, - { key: "PointF", dataType: "number", width: "10%" }, - { key: "PointG", dataType: "number", width: "10%" }, - { key: "PointI", dataType: "number", width: "10%" }, + { headerText: "Point 1", key: "Point1", dataType: "number", width: "10%" }, + { headerText: "Point 2", key: "Point2", dataType: "number", width: "10%" }, + { headerText: "Point 3", key: "Point3", dataType: "number", width: "10%" }, + { headerText: "Point 4", key: "Point4", dataType: "number", width: "10%" }, + { headerText: "Point 5", key: "Point5", dataType: "number", width: "10%" }, + { headerText: "Point 6", key: "Point6", dataType: "number", width: "10%" }, + { headerText: "Point 7", key: "Point7", dataType: "number", width: "10%" }, + { headerText: "Point 8", key: "Point8", dataType: "number", width: "10%" }, + { headerText: "Point 9", key: "Point9", dataType: "number", width: "10%" }, ], responseDataKey: "Results", }); @@ -611,4 +623,15 @@ function triggerFileDownload(fileName, url) { } function initIndex() { +} + +function copy() { + var copyText = document.getElementById("textareaClipboard"); + + // Select the text field + copyText.select(); + copyText.setSelectionRange(0, 99999); // For mobile devices + + // Copy the text inside the text field + navigator.clipboard.writeText(copyText.value); } \ No newline at end of file diff --git a/Shared/DataModels/HeaderCommon.cs b/Shared/DataModels/HeaderCommon.cs index d75f9e2..8851d68 100644 --- a/Shared/DataModels/HeaderCommon.cs +++ b/Shared/DataModels/HeaderCommon.cs @@ -2,15 +2,31 @@ public class HeaderCommon { + public long ID { get; set; } public DateTime InsertDate { get; set; } public Guid AttachmentID { get; set; } public string? Title { get; set; } - public string? Recipe { get; set; } public DateTime Date { get; set; } public long ToolTypeID { get; set; } public string? ToolTypeName { get; set; } - public string? Reactor { get; set; } - public string? RDS { get; set; } + + // [Newtonsoft.Json.JsonProperty("Tool")] + // [System.Text.Json.Serialization.JsonPropertyName("Tool")] + // public string? Tool { get; set; } + + // [Newtonsoft.Json.JsonProperty("Equipment ID")] + // [System.Text.Json.Serialization.JsonPropertyName("Equipment ID")] + // public string? Equipment_ID { get; set; } + + public string? MesEntity { get; set; } + + public string? Employee { get; set; } + public string? Layer { get; set; } public string? PSN { get; set; } + public string? RDS { get; set; } + public string? Reactor { get; set; } + public string? Recipe { get; set; } + public string? Zone { get; set; } + } \ No newline at end of file diff --git a/Shared/DataModels/Pinned.cs b/Shared/DataModels/Pinned.cs index 0211e43..d81af1d 100644 --- a/Shared/DataModels/Pinned.cs +++ b/Shared/DataModels/Pinned.cs @@ -3,15 +3,15 @@ public class Pinned : HeaderCommon { - public string PointA { get; set; } - public string PointB { get; set; } - public string PointC { get; set; } - public string PointD { get; set; } - public string PointE { get; set; } - public string PointF { get; set; } - public string PointG { get; set; } - public string PointH { get; set; } - public string PointI { get; set; } + public string Point1 { get; set; } + public string Point2 { get; set; } + public string Point3 { get; set; } + public string Point4 { get; set; } + public string Point5 { get; set; } + public string Point6 { get; set; } + public string Point7 { get; set; } + public string Point8 { get; set; } + public string Point9 { get; set; } public Pinned(HeaderCommon headerCommon, List values) { @@ -19,22 +19,29 @@ public class Pinned : HeaderCommon InsertDate = headerCommon.InsertDate; AttachmentID = headerCommon.AttachmentID; Title = headerCommon.Title; - Recipe = headerCommon.Recipe; Date = headerCommon.Date; ToolTypeID = headerCommon.ToolTypeID; ToolTypeName = headerCommon.ToolTypeName; - Reactor = headerCommon.Reactor; - RDS = headerCommon.RDS; + + MesEntity = headerCommon.MesEntity; + + Employee = headerCommon.Employee; + Layer = headerCommon.Layer; PSN = headerCommon.PSN; - PointA = values[0]; - PointB = values[1]; - PointC = values[2]; - PointD = values[3]; - PointE = values[4]; - PointF = values[5]; - PointG = values[6]; - PointH = values[7]; - PointI = values[8]; + RDS = headerCommon.RDS; + Reactor = headerCommon.Reactor; + Recipe = headerCommon.Recipe; + Zone = headerCommon.Zone; + + Point1 = values[0]; + Point2 = values[1]; + Point3 = values[2]; + Point4 = values[3]; + Point5 = values[4]; + Point6 = values[5]; + Point7 = values[6]; + Point8 = values[7]; + Point9 = values[8]; } } \ No newline at end of file