Skip to content

Commit

Permalink
Revert "VF2 Comments and TODO's"
Browse files Browse the repository at this point in the history
This reverts commit 7b3058b.
  • Loading branch information
will1742 committed Sep 7, 2021
1 parent 9b65098 commit cacf363
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions Haas_Mills_BIDC/Bechtel VF2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -1333,39 +1333,31 @@ function onOpen() {
// 6/21/21 | Gavin Williams | will1742
writeComment("Load and probe tools");

// Display general tool probe info
displayMedia("toolProbeReminder.jpg");
writeBlock(mFormat.format(0));

let parsedTools = [];

// Maybe should be anonymous function??
function defaultFill() {
parsedTools = []
for (var i = 0; i < tools.getNumberOfTools(); i++){
parsedTools[i] = tools.getTool(i).number;
}
}

// also maybe anonymous
// TODO: tool.getNumberOfTools needs to be machine-specific constant
function invalidToolNum(toolNum) {
function validateToolNum(toolNum) {
return (toolNum < 1 || toolNum > tools.getNumberOfTools() || tools.getTool(toolNum) == undefined);
}

// parse string for specific tools to load
if (getProperty("toolsToLoad") != "") {
// get list of numbers
let toolNumArray = getProperty("toolsToLoad").split(',');
// iterate through and fill ranges
for (var i = 0; i < toolNumArray.length; i++){
toolNumArray[i] = toolNumArray[i].trim();
// fill range
if (toolNumArray[i].indexOf("-") >= 0) {
let numRange = toolNumArray[i].split("-");
if (invalidToolNum(parseInt(numRange[0])) || invalidToolNum(parseInt(numRange[1]))) {
if (validateToolNum(parseInt(numRange[0])) || validateToolNum(parseInt(numRange[1]))) {
defaultFill();
break;
}
Expand All @@ -1374,12 +1366,10 @@ function onOpen() {
}
continue;
}
// check if valid num
if (invalidToolNum(parseInt(toolNumArray[i]))) {
if (validateToolNum(parseInt(toolNumArray[i]))) {
defaultFill();
break;
}
// push single num
parsedTools.push(parseInt(toolNumArray[i]));
}
} else {
Expand Down Expand Up @@ -1437,8 +1427,6 @@ function onOpen() {
writeln("");
writeComment("SETUP FOR OPERATION");
writeBlock(mFormat.format(131));
} else {
writeComment("SETUP FOR OPERATION");
}

if (staticProperties.useDWO) {
Expand Down Expand Up @@ -2417,7 +2405,7 @@ function onSection() {
}

if (hasParameter("notes") && getParameter("notes").toUpperCase().indexOf("APPROVED") <= -1) {
// throw "Operation \"" + getParameter("operation-comment") + "\" not approved. See a Peer Mentor."
throw "Operation \"" + getParameter("operation-comment") + "\" not approved. See a Peer Mentor."
}

if (staticProperties.showNotes) {
Expand Down

0 comments on commit cacf363

Please sign in to comment.