AzureDevOpsRepository
Markdown links
Ticks bug fix, default to *.wc files and formatting
This commit is contained in:
2025-02-21 11:13:56 -07:00
parent 4c2bef71ec
commit 2afb312065
32 changed files with 661 additions and 593 deletions

View File

@ -2,12 +2,14 @@ var _chart = null;
var _CdeId = null;
var _apiUrl = null;
var _BioRadId = null;
var _Collection = [];
var _toolType = null;
var _StaticUrl = null;
var _workMaterial = {};
var _initialHeaderId = null;
var _toolTypeMetaData = null;
var _initialHeaderAttachmentId = null;
var _EcMesaFileShareCharacterizationSi = null;
async function loadRunInfoAwaitingDisposition() {
var row = $("#grid").igGrid("selectedRow");
@ -169,6 +171,34 @@ function loadHeaderGridRunInfo() {
});
}
function loadHeaderGridFiles() {
var toolTypeName = $("#ToolType").igCombo("text");
$("#ToolTypeID").text("");
hideDetailsDivRunInfo();
disableHeaderButtonsRunInfo();
$("#HeaderId").text("");
$("#HeaderAttachmentId").text("");
var gridCreated = $("#HeaderGrid").data("igGrid");
if (gridCreated)
$("#HeaderGrid").igGrid("destroy");
$.ajax({
type: "GET",
url: _EcMesaFileShareCharacterizationSi + "/Archive/" + toolTypeName + ".json",
success: function (r) {
if ((r.Results == null) || (r.Results.ToolType == null) || (r.Results.Metadata == null))
ShowErrorMessage("Invalid tool-type: " + toolTypeName);
else {
_toolType = r.Results.ToolType;
_toolTypeMetaData = r.Results.Metadata;
requestHeaderDataFiles();
}
},
error: function (e) {
DisplayWSMessage("error", "There was an error getting tool-type info by archive.", e);
}
});
}
function disableHeaderButtonsRunInfo() {
$("#GetDataButton").prop("disabled", true);
$("#ReviewButton").prop("disabled", true);
@ -632,6 +662,39 @@ function copySelected(attachmentID, title, data) {
copy(allText);
}
function copySelectedB(attachmentID, title, collection) {
var allText = "";
var headerText = "";
var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow();
if (selectedRow !== null) {
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index];
for (const property in rowData) {
if (property === "ID" || property === attachmentID || property === title)
continue;
allText = allText + property + '\t';
headerText = headerText + rowData[property] + '\t';
}
}
for (var i = 0; i < collection.length; i++) {
if (i === 0) {
for (const property in collection[i]) {
if (property === "ID" || property === "InsertDate" || property === attachmentID || property === title)
continue;
allText = allText + property + '\t';
}
allText = allText + '\r';
}
allText = allText + headerText;
for (const property in collection[i]) {
if (property === "ID" || property === "InsertDate" || property === attachmentID || property === title)
continue;
allText = allText + collection[i][property] + '\t';
}
allText = allText + '\r';
}
copy(allText);
}
function loadDetailsRunInfo() {
showDetailsDivRunInfo();
loadHeaderAttachmentRunInfo();
@ -667,7 +730,7 @@ function loadDetailsRunInfo() {
}
}
$.getJSON(detailsURL, function (data) {
var gridParms = {
var gridParams = {
autoGenerateColumns: false,
primaryKey: "ID",
features: [
@ -682,21 +745,96 @@ function loadDetailsRunInfo() {
dataBound: markAsReviewedRunInfo,
};
if ((_toolType != null) && (_toolType.DataGridAttributes != null)) {
jQuery.extend(gridParms, JSON.parse(_toolType.DataGridAttributes));
jQuery.extend(gridParams, JSON.parse(_toolType.DataGridAttributes));
}
$("#DetailsGrid").igGrid(gridParms);
$("#DetailsGrid").igGrid(gridParams);
if ($("#chkCopyOnGet").is(':checked')) {
copySelected(attachmentID, title, data);
}
});
}
function loadDetailsGridFiles() {
showDetailsDivRunInfo();
loadHeaderAttachmentRunInfo();
var collection = [];
var gridCreated = $("#DetailsGrid").data("igGrid");
if (gridCreated)
$("#DetailsGrid").igGrid("destroy");
var title = "Title";
var attachmentID = "AttachmentID";
var gridColumns = [
{ key: "ID", dataType: "number", hidden: true },
{ key: attachmentID, dataType: "string", hidden: true },
{ key: title, dataType: "string", hidden: true },
];
var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow();
if (selectedRow == null)
return;
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index];
for (var i = 0; i < _Collection.length; i++) {
if (_Collection[i].Details == null || _Collection[i].ID !== rowData.ID || _Collection[i].ArchiveLot !== rowData.ArchiveLot)
continue;
for (var j = 0; j < _Collection[i].Details.length; j++) {
_Collection[i].Details[j]['ID'] = j;
collection.push(_Collection[i].Details[j]);
}
}
if (collection.length === 0) {
gridColumns.push({
key: "No Data",
headerText: "No Data",
width: "150px",
});
}
else {
for (var i = 0; i < _toolTypeMetaData.length; i++) {
var f = _toolTypeMetaData[i];
if ((f.Header == false) && (f.GridDisplayOrder > 0)) {
var col = {
key: f.ApiName,
headerText: f.DisplayTitle,
width: "150px",
};
if (f.GridAttributes != null)
jQuery.extend(col, JSON.parse(f.GridAttributes));
if (col.formatter != null) {
if (col.formatter == "boolToYesNo")
col.formatter = boolToYesNo;
else
col.formatter = null;
}
gridColumns.push(col);
}
}
}
var gridParams = {
autoGenerateColumns: false,
primaryKey: "ID",
features: [
{ name: "Selection", mode: "row" },
{ name: "Resizing" },
{ name: "Sorting", type: "local" }
],
columns: gridColumns,
dataSource: collection,
dataSourceType: 'json'
};
if ((_toolType != null) && (_toolType.DataGridAttributes != null)) {
jQuery.extend(gridParams, JSON.parse(_toolType.DataGridAttributes));
}
$("#DetailsGrid").igGrid(gridParams);
if ($("#chkCopyOnGet").is(':checked')) {
copySelectedB(attachmentID, title, collection);
}
}
function requestHeaderDataRunInfo() {
var startDate = $("#StartDate").igDatePicker("value");
var startTime = $("#StartTime").igTimePicker("value");
var endDate = $("#EndDate").igDatePicker("value");
var endTime = $("#EndTime").igTimePicker("value");
var parms = {
var params = {
datebegin: new Date(
startDate.getFullYear(), startDate.getMonth(), startDate.getDate(),
startTime.getHours(), startTime.getMinutes(), startTime.getSeconds()).toISOString(),
@ -707,7 +845,7 @@ function requestHeaderDataRunInfo() {
var headerId = 0;
if (_initialHeaderId > 0) {
headerId = _initialHeaderId;
parms.headerid = headerId;
params.headerid = headerId;
$("#HeaderId").text(headerId);
$("#HeaderAttachmentId").text(_initialHeaderAttachmentId);
_initialHeaderId = -1;
@ -716,7 +854,7 @@ function requestHeaderDataRunInfo() {
$("#PinButton").hide();
else
$("#PinButton").show();
var headerURL = _apiUrl + "/tooltypes/" + _toolType.ID + "/headers?" + $.param(parms);
var headerURL = _apiUrl + "/tooltypes/" + _toolType.ID + "/headers?" + $.param(params);
var gridColumns = [
{ key: "ID", dataType: "number", hidden: true },
{ key: "AttachmentID", dataType: "string", hidden: true },
@ -741,7 +879,7 @@ function requestHeaderDataRunInfo() {
gridColumns.push(col);
}
}
var gridParms = {
var gridParams = {
autoGenerateColumns: false,
primaryKey: "ID",
height: "100%",
@ -758,14 +896,99 @@ function requestHeaderDataRunInfo() {
responseDataKey: "Results",
};
if ((_toolType != null) && (_toolType.HeaderGridAttributes != null)) {
jQuery.extend(gridParms, JSON.parse(_toolType.HeaderGridAttributes));
jQuery.extend(gridParams, JSON.parse(_toolType.HeaderGridAttributes));
}
$("#HeaderGrid").igGrid(gridParms);
$("#HeaderGrid").igGrid(gridParams);
if (headerId > 0) {
loadDetailsRunInfo();
}
}
function clearArray(array) {
if (array !== null) {
while (array.length > 0) {
array.pop();
}
}
}
function requestHeaderDataFiles() {
clearArray(_Collection);
var toolTypeName = $("#ToolType").igCombo("text");
var startDate = $("#StartDate").igDatePicker("value");
var startTime = $("#StartTime").igTimePicker("value");
var endDate = $("#EndDate").igDatePicker("value");
var endTime = $("#EndTime").igTimePicker("value");
var params = {
area: null,
'end-time': new Date(
endDate.getFullYear(), endDate.getMonth(), endDate.getDate(),
endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()).toISOString(),
'equipment-id': toolTypeName,
'search-pattern': '*.wc',
'start-time': new Date(
startDate.getFullYear(), startDate.getMonth(), startDate.getDate(),
startTime.getHours(), startTime.getMinutes(), startTime.getSeconds()).toISOString(),
'wafer-size': null,
}
var headerURL = _apiUrl + "/v1/file-share/archive-data/?" + $.param(params);
var gridColumns = [
{ key: "ID", dataType: "number", hidden: true },
{ key: "ArchiveLot", dataType: "string", hidden: true },
{ key: "ArchiveLastWriteTime", dataType: "date", hidden: true },
{ key: "AttachmentID", dataType: "string", hidden: true },
{ key: "Title", dataType: "string", hidden: true },
];
for (var i = 0; i < _toolTypeMetaData.length; i++) {
var f = _toolTypeMetaData[i];
if ((f.Header == true) && (f.GridDisplayOrder > 0)) {
var col = {
key: f.ApiName,
headerText: f.DisplayTitle,
width: "150px",
};
if (f.GridAttributes != null)
jQuery.extend(col, JSON.parse(f.GridAttributes));
if (col.formatter != null) {
if (col.formatter == "boolToYesNo")
col.formatter = boolToYesNo;
else
col.formatter = null;
}
gridColumns.push(col);
}
}
$.getJSON(headerURL, function (data) {
var singleton;
for (var i = 0; i < data.length; i++) {
singleton = JSON.parse(data[i].lines.join(' '));
singleton['ID'] = i;
singleton['ArchiveLot'] = data[i].lot;
singleton['ArchiveLastWriteTime'] = data[i].lastWriteTime;
_Collection.push(singleton);
}
var gridParams = {
autoGenerateColumns: false,
height: "100%",
width: "100%",
features: [
{ name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 100, pageSizeList: [50, 100, 250, 500], pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page" },
{ name: "Selection", mode: "row", rowSelectionChanged: headerSelectionChangedRunInfo },
{ name: "Filtering", type: "local" },
{ name: 'Resizing' },
{ name: "Sorting", type: "local" }
],
columns: gridColumns,
dataSource: _Collection,
responseDataKey: "Results",
};
if ((_toolType != null) && (_toolType.HeaderGridAttributes != null)) {
jQuery.extend(gridParams, JSON.parse(_toolType.HeaderGridAttributes));
}
$("#HeaderGrid").igGrid(gridParams);
});
}
function reviewButtonRunInfo() {
var toolTypeId = $("#ToolTypeID").text();
var headerId = parseInt($("#HeaderId").text());
@ -1274,43 +1497,29 @@ function restartButton() {
clearWorkMaterial();
};
function initFiles(apiUrl, staticUrl, initialToolTypeID, initialHeaderId, initialHeaderAttachmentId) {
function initFiles(apiUrl, staticUrl, ecMesaFileShareCharacterizationSi) {
_apiUrl = apiUrl;
_initialHeaderId = ""
_StaticUrl = staticUrl;
_initialHeaderId = initialHeaderId === null ? "" : initialHeaderId;
_initialHeaderAttachmentId = initialHeaderAttachmentId === null ? "" : initialHeaderAttachmentId;
$.getJSON(_apiUrl + '/tooltypes', function (data) {
for (var i = 0; i < data.Results.length; i++) {
if (data.Results[i].ToolTypeName === "CDE") {
_CdeId = data.Results[i].ID;
}
else if (data.Results[i].ToolTypeName === "BioRad") {
_BioRadId = data.Results[i].ID;
}
}
_initialHeaderAttachmentId = "";
_EcMesaFileShareCharacterizationSi = ecMesaFileShareCharacterizationSi;
$.getJSON(_apiUrl + '/v1/file-share/equipment-ids', function (data) {
$("#ToolType").igCombo({
dataSource: data,
responseDataKey: "Results",
textKey: "ToolTypeName",
valueKey: "ID",
textKey: "toolTypeName",
valueKey: "id",
mode: "dropdown",
width: 150,
itemsRendered: function (evt, ui) {
loadHeaderGridRunInfo();
itemsRendered: function () {
loadHeaderGridFiles();
},
selectionChanged: loadHeaderGridRunInfo,
initialSelectedItems: [{ value: initialToolTypeID === null ? 1 : initialToolTypeID }]
selectionChanged: loadHeaderGridFiles,
});
});
setInitialDateTimesRunInfo(6 * 60 * 60 * 1000);
$("#HeaderGrid").on("dblclick", "tr", loadDetailsRunInfo);
$("#LoadHeadersButton").click(loadHeaderGridRunInfo);
$("#GetDataButton").click(loadDetailsRunInfo);
$("#ReviewButton").click(reviewButtonRunInfo);
$("#RecipeParametersButton").click(recipeParametersButtonRunInfo);
$("#ViewButton").click(viewButtonRunInfo);
$("#PinButton").click(pinButtonRunInfo);
$("#OIExportButton").click(oiExportButtonRunInfo);
$("#HeaderGrid").on("dblclick", "tr", loadDetailsGridFiles);
$("#LoadHeadersButton").click(loadHeaderGridFiles);
$("#GetDataButton").click(loadDetailsGridFiles);
setInterval(function () {
if ($("#chkAutoRefresh").is(':checked')) {
setInitialDateTimesRunInfo(null);