Add IndexOf property to WSRequest and Description classes; implement getValue function in recipes-and-patterns.js
This commit is contained in:
36
Adaptation/_Tests/Static/loadLockSide.js
Normal file
36
Adaptation/_Tests/Static/loadLockSide.js
Normal file
@ -0,0 +1,36 @@
|
||||
// getValue(getContextData('2', 'cds.NULL_DATA', ''));
|
||||
|
||||
function getValue(json) {
|
||||
let result;
|
||||
if (json == undefined || json.length === 0)
|
||||
result = 'A) Invalid input!';
|
||||
else {
|
||||
let parsed;
|
||||
try {
|
||||
parsed = JSON.parse(json);
|
||||
} catch (error) {
|
||||
parsed = null;
|
||||
}
|
||||
if (parsed == null)
|
||||
result = 'B) Invalid input!';
|
||||
else {
|
||||
let reactorType = parsed.rds == undefined ? '' : parsed.rds.reactorType == undefined ? '' : parsed.rds.reactorType;
|
||||
if (parsed.rds == undefined)
|
||||
result = '-';
|
||||
else if (parsed.rds.loadLockSide == undefined)
|
||||
result = '_ - ' + reactorType;
|
||||
else if (parsed.rds.loadLockSide === 'L')
|
||||
result = 'Left - ' + reactorType;
|
||||
else if (parsed.rds.loadLockSide === 'R')
|
||||
result = 'Right - ' + reactorType;
|
||||
else
|
||||
result = parsed.rds.loadLockSide + ' - ' + reactorType;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const json = '{"rds":{"prodSpec":{"recipesAndPatterns":[{"recipe":"6IN25_ROTR","pattern":"","patternSize":0,"tool":"TENCOR"}]}}}';
|
||||
const testA = getValue(json);
|
||||
if (testA !== '1')
|
||||
throw 'Test A failed: ' + testA;
|
||||
Reference in New Issue
Block a user