Ready to demo

This commit is contained in:
Mike Phares 2023-02-16 14:28:03 -07:00
parent 1e7f70c6c4
commit 1e1d4803b2
9 changed files with 104 additions and 43 deletions

5
.vscode/launch.json vendored
View File

@ -66,6 +66,11 @@
"request": "attach", "request": "attach",
"preLaunchTask": "watchClientHub", "preLaunchTask": "watchClientHub",
"processName": "OI.Metrology.ClientHub.exe" "processName": "OI.Metrology.ClientHub.exe"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
} }
] ]
} }

0
Server/.vscode/settings.json vendored Normal file
View File

View File

@ -44,7 +44,7 @@
"args": [ "args": [
"watch", "watch",
"--launch-profile", "--launch-profile",
"https", "http",
"run", "run",
"--project", "--project",
"${workspaceFolder}/OI.Metrology.Server.csproj", "${workspaceFolder}/OI.Metrology.Server.csproj",

View File

@ -50,11 +50,11 @@ public class PinRepository : IPinRepository
return new(bioRadHeader, cdeHeader); 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; Pinned? result;
List<string> values; List<string> 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) if (dataTable.Rows.Count <= points || dataTable.Columns.Count <= column)
result = null; result = null;
else else
@ -69,7 +69,7 @@ public class PinRepository : IPinRepository
if (values.Count <= points) if (values.Count <= points)
result = null; result = null;
else else
result = new(bioRadHeader, values); result = new(headerCommon, values);
} }
return result; return result;
} }
@ -92,7 +92,7 @@ public class PinRepository : IPinRepository
{ {
const int points = 9; const int points = 9;
List<Pinned> results = new(); List<Pinned> results = new();
(HeaderCommon? cdeHeader, HeaderCommon? bioRadHeader) = GetBoth(rds, bioRadId, cdeId); (HeaderCommon? bioRadHeader, HeaderCommon? cdeHeader) = GetBoth(rds, bioRadId, cdeId);
if (bioRadHeader is not null) if (bioRadHeader is not null)
{ {
const int thickness = 5; const int thickness = 5;

View File

@ -1,6 +1,8 @@
{ {
"ApiUrl": "http://messa010ec.ec.local:50301/api", "xApiUrl": "http://messa010ec.ec.local:50301/api",
"ConnectionString": "Data Source=MESSAD1001\\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;", "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, "IsDevelopment": true,
"xMockRoot": "/Data/Tests", "xMockRoot": "/Data/Tests",
"MockRoot": "", "MockRoot": "",

View File

@ -123,9 +123,17 @@ function ConstructMessageDialog() {
' <span id="spanMessageText"></span> ' + ' <span id="spanMessageText"></span> ' +
' <table id="ModalHeaderGrid"></table> ' + ' <table id="ModalHeaderGrid"></table> ' +
' <table id="ModalBodyGrid"></table> ' + ' <table id="ModalBodyGrid"></table> ' +
' <textarea type="text" value="Hello World" id="textareaClipboard" style="display:none"></textarea> ' +
' </div> ' + ' </div> ' +
' <div class="modal-footer"> ' + ' <div class="modal-footer"> ' +
' <button type="button" data-dismiss="modal">OK</button> ' + ' <div class="row" style="margin-top: 10px; margin-bottom: 20px;"> ' +
' <div class="col-xs-1"> ' +
' <button type="button" data-dismiss="modal" onclick="copy()">Copy</button> ' +
' </div> ' +
' <div class="col-xs-1"> ' +
' <button type="button" data-dismiss="modal">OK</button> ' +
' </div> ' +
' </div> ' +
' </div> ' + ' </div> ' +
' </div> ' + ' </div> ' +
'</div>'; '</div>';

View File

@ -465,14 +465,19 @@ function pinButtonRunInfo() {
if (selectedRow !== null) { if (selectedRow !== null) {
$("#PinButton").prop("disabled", true); $("#PinButton").prop("disabled", true);
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index]; 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({ $.ajax({
type: "POST", type: "POST",
url: "http://localhost:5126/api" + '/pin/' + toolTypeId + "/markAsPinned", url: _apiUrl + '/pin/' + toolTypeId + "/markAsPinned",
data: rowData, data: jsonObject,
success: function (e) { success: function (e) {
DisplayWSMessage("info", "Marked as pinned", e); DisplayWSMessage("info", "Marked as pinned", e);
// DisplayWSMessage("info", stringified, e);
$("#PinButton").prop("disabled", false); $("#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({ $("#ModalHeaderGrid").igGrid({
dataSource: data, dataSource: data,
features: [ features: [
@ -481,6 +486,7 @@ function pinButtonRunInfo() {
columns: [ columns: [
{ key: "ID", dataType: "number", hidden: true, }, { key: "ID", dataType: "number", hidden: true, },
{ key: "ToolTypeID", 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: "Reactor", dataType: "string", width: "10%" },
{ key: "RDS", dataType: "string", width: "10%" }, { key: "RDS", dataType: "string", width: "10%" },
{ key: "PSN", dataType: "string", width: "10%" }, { key: "PSN", dataType: "string", width: "10%" },
@ -489,6 +495,11 @@ function pinButtonRunInfo() {
], ],
responseDataKey: "Results", 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({ $("#ModalBodyGrid").igGrid({
dataSource: data, dataSource: data,
features: [ features: [
@ -497,14 +508,15 @@ function pinButtonRunInfo() {
columns: [ columns: [
{ key: "ID", dataType: "number", hidden: true, }, { key: "ID", dataType: "number", hidden: true, },
{ key: "ToolTypeID", dataType: "number", hidden: true, }, { key: "ToolTypeID", dataType: "number", hidden: true, },
{ key: "PointA", dataType: "number", width: "10%" }, { headerText: "Point 1", key: "Point1", dataType: "number", width: "10%" },
{ key: "PointB", dataType: "number", width: "10%" }, { headerText: "Point 2", key: "Point2", dataType: "number", width: "10%" },
{ key: "PointC", dataType: "number", width: "10%" }, { headerText: "Point 3", key: "Point3", dataType: "number", width: "10%" },
{ key: "PointD", dataType: "number", width: "10%" }, { headerText: "Point 4", key: "Point4", dataType: "number", width: "10%" },
{ key: "PointE", dataType: "number", width: "10%" }, { headerText: "Point 5", key: "Point5", dataType: "number", width: "10%" },
{ key: "PointF", dataType: "number", width: "10%" }, { headerText: "Point 6", key: "Point6", dataType: "number", width: "10%" },
{ key: "PointG", dataType: "number", width: "10%" }, { headerText: "Point 7", key: "Point7", dataType: "number", width: "10%" },
{ key: "PointI", dataType: "number", width: "10%" }, { headerText: "Point 8", key: "Point8", dataType: "number", width: "10%" },
{ headerText: "Point 9", key: "Point9", dataType: "number", width: "10%" },
], ],
responseDataKey: "Results", responseDataKey: "Results",
}); });
@ -611,4 +623,15 @@ function triggerFileDownload(fileName, url) {
} }
function initIndex() { 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);
} }

View File

@ -2,15 +2,31 @@
public class HeaderCommon public class HeaderCommon
{ {
public long ID { get; set; } public long ID { get; set; }
public DateTime InsertDate { get; set; } public DateTime InsertDate { get; set; }
public Guid AttachmentID { get; set; } public Guid AttachmentID { get; set; }
public string? Title { get; set; } public string? Title { get; set; }
public string? Recipe { get; set; }
public DateTime Date { get; set; } public DateTime Date { get; set; }
public long ToolTypeID { get; set; } public long ToolTypeID { get; set; }
public string? ToolTypeName { 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? PSN { get; set; }
public string? RDS { get; set; }
public string? Reactor { get; set; }
public string? Recipe { get; set; }
public string? Zone { get; set; }
} }

View File

@ -3,15 +3,15 @@
public class Pinned : HeaderCommon public class Pinned : HeaderCommon
{ {
public string PointA { get; set; } public string Point1 { get; set; }
public string PointB { get; set; } public string Point2 { get; set; }
public string PointC { get; set; } public string Point3 { get; set; }
public string PointD { get; set; } public string Point4 { get; set; }
public string PointE { get; set; } public string Point5 { get; set; }
public string PointF { get; set; } public string Point6 { get; set; }
public string PointG { get; set; } public string Point7 { get; set; }
public string PointH { get; set; } public string Point8 { get; set; }
public string PointI { get; set; } public string Point9 { get; set; }
public Pinned(HeaderCommon headerCommon, List<string> values) public Pinned(HeaderCommon headerCommon, List<string> values)
{ {
@ -19,22 +19,29 @@ public class Pinned : HeaderCommon
InsertDate = headerCommon.InsertDate; InsertDate = headerCommon.InsertDate;
AttachmentID = headerCommon.AttachmentID; AttachmentID = headerCommon.AttachmentID;
Title = headerCommon.Title; Title = headerCommon.Title;
Recipe = headerCommon.Recipe;
Date = headerCommon.Date; Date = headerCommon.Date;
ToolTypeID = headerCommon.ToolTypeID; ToolTypeID = headerCommon.ToolTypeID;
ToolTypeName = headerCommon.ToolTypeName; ToolTypeName = headerCommon.ToolTypeName;
Reactor = headerCommon.Reactor;
RDS = headerCommon.RDS; MesEntity = headerCommon.MesEntity;
Employee = headerCommon.Employee;
Layer = headerCommon.Layer;
PSN = headerCommon.PSN; PSN = headerCommon.PSN;
PointA = values[0]; RDS = headerCommon.RDS;
PointB = values[1]; Reactor = headerCommon.Reactor;
PointC = values[2]; Recipe = headerCommon.Recipe;
PointD = values[3]; Zone = headerCommon.Zone;
PointE = values[4];
PointF = values[5]; Point1 = values[0];
PointG = values[6]; Point2 = values[1];
PointH = values[7]; Point3 = values[2];
PointI = values[8]; Point4 = values[3];
Point5 = values[4];
Point6 = values[5];
Point7 = values[6];
Point8 = values[7];
Point9 = values[8];
} }
} }