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",
"preLaunchTask": "watchClientHub",
"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": [
"watch",
"--launch-profile",
"https",
"http",
"run",
"--project",
"${workspaceFolder}/OI.Metrology.Server.csproj",

View File

@ -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<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)
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<Pinned> 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;

View File

@ -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": "",

View File

@ -123,9 +123,17 @@ function ConstructMessageDialog() {
' <span id="spanMessageText"></span> ' +
' <table id="ModalHeaderGrid"></table> ' +
' <table id="ModalBodyGrid"></table> ' +
' <textarea type="text" value="Hello World" id="textareaClipboard" style="display:none"></textarea> ' +
' </div> ' +
' <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>';

View File

@ -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);
}

View File

@ -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; }
}

View File

@ -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<string> 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];
}
}