"use strict"; // getValue($('gv.thicknessPoints', ''), $('dcp.BIORAD2/csv/Index', '0')); function getCollectionParseFloat(collection) { let result = []; let value; for (let i = 0; i < collection.length; i++) { value = parseFloat(collection[i]); result.push(value); } return result; } function getSum(collection) { let result = 0; if (!collection || collection.length === 0) { result = 0; } else { for (let i = 0; i < collection.length; i++) { result += collection[i]; } } return result; } function getAverage(collection) { let result = null; if (collection == null || collection.length === 0) result = 0; else { let sum = getSum(collection); result = sum / collection.length; } return result; } function getValueB(thicknessPoints, index) { let result = null; if (index === 13) { if (thicknessPoints != undefined && thicknessPoints.length > 1) { let collection = thicknessPoints[0] === '|' ? thicknessPoints.substring(1).split('|') : thicknessPoints.split('|'); let collectionParseFloat = getCollectionParseFloat(collection); let thicknessFourteen3mmEdgeMean = getAverage([[collectionParseFloat[10], collectionParseFloat[11], collectionParseFloat[12], collectionParseFloat[13]]]); let thicknessFourteenMeanFrom = getAverage([[collectionParseFloat[1], collectionParseFloat[2], collectionParseFloat[6], collectionParseFloat[7]]]); result = (thicknessFourteen3mmEdgeMean - thicknessFourteenMeanFrom) / thicknessFourteenMeanFrom * 100; } } return result; } function getVariance(collection) { let result = null; if (collection == null || collection.length === 0) result = null; else { let variance = 0; let t = collection[0]; for (let i = 1; i < collection.length; i++) { t += collection[i]; const diff = ((i + 1) * collection[i]) - t; variance += diff * diff / ((i + 1.0) * i); } result = variance / (collection.length - 1); } return result; } // $('gv.thicknessPoints', '') + '|' + $('dcp.BIORAD2/csv/Thickness', '') // $('gv.thicknessPoints', '') + '|' + $('dcp.BIORAD3/csv/Thickness', '') // $('gv.thicknessPoints', '') + '|' + $('dcp.BIORAD4/csv/Thickness', '') // $('gv.thicknessPoints', '') + '|' + $('dcp.BIORAD5/b-csv/Thickness', '') // \\mesfs.infineon.com\EC_Characterization_Si\Archive\BIORAD2\2025_Week_08\2025-02-20\64-659712-4626_2025-02-20_11;50_AM_5144331401\638756490128318288 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 const thicknessPoints = getCollectionParseFloat('|4.022|3.952|3.936|3.971|3.954|3.976|3.949|3.906|3.967|3.995|3.997|3.932|3.766|3.890'.substring(1).split('|')); const thicknessTenPoints = thicknessPoints.slice(0, 10); const thicknessFourteenCriticalPointsAverage = getAverage(thicknessTenPoints); // 15 // *3.962799999999999 const thicknessFourteenCriticalPointsStdDev = Math.sqrt(getVariance(thicknessTenPoints)); // 16 // *0.0318496467798311 const thicknessFourteenCenterMean = thicknessPoints[4]; // 17 // 3.954 const thicknessFourteenMeanFrom = getAverage([thicknessPoints[1], thicknessPoints[2], thicknessPoints[6], thicknessPoints[7]]); // 18 // *3.954 const thicknessFourteen5mmEdgeMean = getAverage([thicknessPoints[0], thicknessPoints[9]]); // 19 // *4.0085 const thicknessFourteen3mmEdgeMean = getAverage([thicknessPoints[10], thicknessPoints[11], thicknessPoints[12], thicknessPoints[13]]); // 20 // *3.89625 const thicknessFourteen5mmEdgePercent = (thicknessFourteen5mmEdgeMean - thicknessFourteenMeanFrom) / thicknessFourteenMeanFrom * 100; // 21 // *1.848440576764267 const thicknessFourteen3mmEdgePercent = (thicknessFourteen3mmEdgeMean - thicknessFourteenMeanFrom) / thicknessFourteenMeanFrom * 100; // 22 // *-1.0036206567998442 console.log(thicknessFourteenCriticalPointsAverage); // getValue($('dcp.BIORAD2/csv/Batch', ''), $('dcp.BIORAD2/csv/Wafer', '')); function getSlot(wafer) { let result = null; if (wafer.length !== 1 && wafer.length !== 2) result = null; else { let slot = parseInt(wafer); if (slot < 1 || slot > 27) result = null; else result = slot < 10 ? '0' + slot : slot; } return result; } function getBatch(batch, jobId, wafer) { let result = null; const slot = getSlot(wafer); result = slot == null ? jobId : batch; return result; } function getWafer(wafer) { let result = null; const slot = getSlot(wafer); result = slot == null ? wafer : slot; return result; } function getValue(batch, wafer) { let result = null; const slot = getSlot(wafer); const value = slot == null ? wafer : batch; result = value.replace(/[\{\}\\\/\:\*\?\"\<\>\|]/g, '_'); return result; } const values = [ { wafer: '11', jobId: 'BIORAD2', batch: 'O172068.1.60', waferCheck: '11', batchCheck: 'O172068.1.60', mid: 'O172068.1.60' }, { wafer: '27-588493-5008', jobId: 'BIORAD2', batch: 'BIORAD#2', waferCheck: '27-588493-5008', batchCheck: 'BIORAD2', mid: '27-588493-5008' }, { wafer: '27-588493-5"008', jobId: 'BIORAD2', batch: 'BIORAD#2', waferCheck: '27-588493-5008', batchCheck: 'BIORAD2', mid: '27-588493-5_008' }, ]; const wafer = "11"; const jobId = "BIORAD2"; const batch = "O172068.1.60"; const waferCheck = getWafer(wafer); const batchCheck = getBatch(batch, jobId, wafer); const mid = getValue(batch, wafer); console.log(mid); values.forEach(element => { let mid = getValue(element.batch, element.wafer); if (mid != element.mid) console.error("MID doesn't match!"); else console.info('Match'); });