Skip to content

Commit

Permalink
added comments, removed m131 for optional m130s
Browse files Browse the repository at this point in the history
  • Loading branch information
pan261 authored and will1742 committed Oct 2, 2021
1 parent a3391a2 commit 959ebba
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 87 deletions.
29 changes: 14 additions & 15 deletions Haas_Mills_BIDC/Bechtel DT.cps
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ function onOpen() {
comment += " - " + getToolTypeName(tool.type);
writeComment(tool.description);
writeFunction("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg", !getProperty("loadToolsAtStart"), "Load Tool");
displayMedia("toolLoad" + tool.number + ".jpg", !getProperty("loadToolsAtStart"), "Load Tool " + tool.number);
// writeFunction(formatComment("Load Tool")); //Pause until operator loads tool
writeToolMeasureBlock(tool, true);
}
Expand Down Expand Up @@ -2346,7 +2346,7 @@ function onSection() {
writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool
writeBlock(gFormat.format(55), gFormat.format(0), forceX.format(stockMidX), forceY.format(stockMidY));
displayMedia("xyWCSCheck.jpg", false, "Open door");
displayMedia("xyWCSCheck.jpg", false, "Open door and check x-y position");
/*
displayMedia("Net Share/Media/checkPrompt.jpg");
var gotoRef = takeInput("Is the pencil centered above your stock? stock? [Y/N]", ['N', 'Y']);
Expand All @@ -2357,7 +2357,7 @@ function onSection() {
writeWords("N" + nFormat.format(gotoRef['Y']), mFormat.format(131), formatComment("End Multimedia"));
*/
writeBlock(gFormat.format(55), gFormat.format(43), hFormat.format(19), zOutput.format(stockTopZ));
displayMedia("zWCSCheck.jpg", false, "Open door", "End Multimedia");
displayMedia("zWCSCheck.jpg", false, "Open door and check z position");
/*
displayMedia("Net Share/Media/checkPrompt.jpg");
Expand Down Expand Up @@ -2798,7 +2798,7 @@ function onSection() {
var toolDistance = initialPosition.z - stockTopZ;

// Prompt user to check stock-tool distance
displayMedia("checkDistance" + toolDistance.toPrecision(2).toString().replace(".", "_") + ".jpg", false);
displayMedia("checkDistance" + toolDistance.toPrecision(2).toString().replace(".", "_") + ".jpg", false, "Check tool distance: " + toolDistance.toPrecision(2).toString() + "in");
writeComment("OPEN DOOR");
//displayMedia("Net Share/Media/checkPrompt.jpg");

Expand Down Expand Up @@ -4554,28 +4554,27 @@ function onClose() {
continue;
}
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); // get tool
displayMedia("removeTool" + tool.number + ".jpg", false);
displayMedia("removeTool" + tool.number + ".jpg", false, "Remove tool " + tool.number);
}
}
writeBlock(mFormat.format(131));

function gotoWithMessage(xLoc, yLoc, fileName) {
function gotoWithMessage(xLoc, yLoc, fileName, comment) {
writeBlock(gFormat.format(53), xOutput.format(xLoc), yOutput.format(yLoc));
displayMedia(fileName, false);
displayMedia(fileName, false, comment);
}

writeln("");
writeComment("CLEAN MACHINE");
gotoWithMessage(X_TRAVEL_LIMIT/2, 0, "airGunClean.jpg");
displayMedia("floodCoolantOff.jpg", false)
gotoWithMessage(X_TRAVEL_LIMIT/2, 0, "airGunClean.jpg", "Clean air gun");
displayMedia("floodCoolantOff.jpg", false, "Turn flood coolant off")
setCoolant(COOLANT_FLOOD);
gotoWithMessage(0, Y_TRAVEL_LIMIT, "sprayLowerRight.jpg");
gotoWithMessage(X_TRAVEL_LIMIT, Y_TRAVEL_LIMIT, "sprayLowerLeft.jpg");
gotoWithMessage(0, 0, "sprayUpperRight.jpg")
gotoWithMessage(X_TRAVEL_LIMIT, 0, "sprayUpperLeft.jpg")
gotoWithMessage(0, Y_TRAVEL_LIMIT, "sprayLowerRight.jpg", "Spray lower right");
gotoWithMessage(X_TRAVEL_LIMIT, Y_TRAVEL_LIMIT, "sprayLowerLeft.jpg", "Spray lower left");
gotoWithMessage(0, 0, "sprayUpperRight.jpg", "Spray upper right")
gotoWithMessage(X_TRAVEL_LIMIT, 0, "sprayUpperLeft.jpg", "Spray upper left")
onCommand(COMMAND_COOLANT_OFF);
onCommand(COMMAND_START_CHIP_TRANSPORT);
gotoWithMessage(X_TRAVEL_LIMIT/2, Y_TRAVEL_LIMIT, "sweepChips.jpg");
gotoWithMessage(X_TRAVEL_LIMIT/2, Y_TRAVEL_LIMIT, "sweepChips.jpg", "Sweep chips");
onCommand(COMMAND_STOP_CHIP_TRANSPORT);

writeln("");
Expand Down
71 changes: 35 additions & 36 deletions Haas_Mills_BIDC/Bechtel VF2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ properties = {/*
scope: "post"
},
displayMediaCalls: {
title: "M130 Media calls",
description: "Enable to include M130 part images with the NC file..",
title: "Display Media",
description: "Enable to include M130 part images with the NC file, disable to see the information in comments.",
group: 4,
value: false,
scope: "post"
Expand Down Expand Up @@ -1363,7 +1363,6 @@ function onOpen() {

// Display general tool probe info
displayMedia("toolProbeReminder.jpg", !getProperty("loadToolsAtStart"));
writeFunction(mFormat.format(0));

let parsedTools = [];

Expand Down Expand Up @@ -1452,8 +1451,7 @@ function onOpen() {
comment += " - " + getToolTypeName(tool.type);
writeComment(tool.description);
writeFunction("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg", !getProperty("loadToolsAtStart"));
writeFunction(mFormat.format(0), formatComment("Load Tool")); //Pause until operator loads tool
displayMedia("toolLoad" + tool.number + ".jpg", !getProperty("loadToolsAtStart"), "Load Tool " + tool.number);
writeToolMeasureBlock(tool, true);
}
}
Expand Down Expand Up @@ -2333,7 +2331,6 @@ function onSection() {
writeBlock(gFormat.format(55), gFormat.format(0), xOutput.format(Stock_X_55));
writeBlock(gFormat.format(53), gFormat.format(0), yOutput.format(0));
displayMedia("loadStock.jpg", false);
writeBlock(mFormat.format(0));
}


Expand All @@ -2348,8 +2345,8 @@ function onSection() {
writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool
writeBlock(gFormat.format(55), gFormat.format(0), forceX.format(stockMidX), forceY.format(stockMidY));
displayMedia("xyWCSCheck.jpg", false);
writeBlock(mFormat.format(0), formatComment("Open door"));
displayMedia("xyWCSCheck.jpg", false, "Open door and check x-y position");
/*
displayMedia("Net Share/Media/checkPrompt.jpg");
var gotoRef = takeInput("Is the pencil centered above your stock? stock? [Y/N]", ['N', 'Y']);
Expand All @@ -2360,9 +2357,7 @@ function onSection() {
writeWords("N" + nFormat.format(gotoRef['Y']), mFormat.format(131), formatComment("End Multimedia"));
*/
writeBlock(gFormat.format(55), gFormat.format(43), hFormat.format(19), zOutput.format(stockTopZ));
displayMedia("zWCSCheck.jpg", false);
writeBlock(mFormat.format(0), formatComment("Open door"));
writeBlock(mFormat.format(131), formatComment("End Multimedia"));
displayMedia("zWCSCheck.jpg", false, "Open door and check z position");
/*
displayMedia("Net Share/Media/checkPrompt.jpg");
Expand Down Expand Up @@ -2422,9 +2417,7 @@ function onSection() {
}

if (!isFirstSection() && getProperty("toolLengthValidation")) {
displayMedia("checkPartTool.jpg", false);
writeBlock(mFormat.format(0));
writeBlock(mFormat.format(131));
displayMedia("checkPartTool.jpg", false, "Check Part and Tool");
} else if (!isFirstSection()) {
writeBlock(mFormat.format(1));
writeComment("Check Part and Tool");
Expand All @@ -2444,7 +2437,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 Expand Up @@ -2805,11 +2798,9 @@ function onSection() {
var toolDistance = initialPosition.z - stockTopZ;

// Prompt user to check stock-tool distance
displayMedia("checkDistance" + toolDistance.toPrecision(2).toString().replace(".", "_") + ".jpg", false);
writeBlock(mFormat.format(0));
displayMedia("checkDistance" + toolDistance.toPrecision(2).toString().replace(".", "_") + ".jpg", false, "Check distance: " + toolDistance.toPrecision(2).toString() + "in");
writeComment("OPEN DOOR");
//displayMedia("Net Share/Media/checkPrompt.jpg");
writeBlock(mFormat.format(131));

// asks user if measured height is accurate to displayed
//var gotoRef = takeInput(("Is the tool " + toolDistance.toPrecision(3) + "in from the stock? [Y/N]"), ['N', 'Y']);
Expand Down Expand Up @@ -2846,11 +2837,23 @@ function onSection() {
// Issue 001 Input and Validation
// Displays a file: MP4, MOV, PNG, JPEG. 1920x1080
// Input: Absolute path to file
function displayMedia(file, isOptional) {
if (isOptional || !getProperty("displayMediaCalls")) {
writeOptionalBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
function displayMedia(file, isOptional, comment) {
var writeFunction = isOptional ? writeOptionalBlock : writeBlock;
if (!getProperty("displayMediaCalls")) {
writeFunction(mFormat.format(0));
comment ?
writeComment(comment)
:
null;
return;
} else {
writeBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
writeFunction(mFormat.format(130), formatComment("Net Share/Media/" + file));
comment ?
writeFunction(mFormat.format(0), formatComment(comment))
:
writeFunction(mFormat.format(0));
writeFunction(mFormat.format(131));
}
}

Expand Down Expand Up @@ -4551,31 +4554,27 @@ function onClose() {
continue;
}
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); // get tool
displayMedia("removeTool" + tool.number + ".jpg", false);
writeBlock(mFormat.format(0));
displayMedia("removeTool" + tool.number + ".jpg", false, "Remove tool " + tool.number);
}
}
writeBlock(mFormat.format(131));

function gotoWithMessage(xLoc, yLoc, fileName) {
function gotoWithMessage(xLoc, yLoc, fileName, comment) {
writeBlock(gFormat.format(53), xOutput.format(xLoc), yOutput.format(yLoc));
displayMedia(fileName, false);
writeBlock(mFormat.format(0));
displayMedia(fileName, false, comment);
}

writeln("");
writeComment("CLEAN MACHINE");
gotoWithMessage(X_TRAVEL_LIMIT/2, 0, "airGunClean.jpg");
displayMedia("floodCoolantOff.jpg", false)
writeBlock(mFormat.format(0));
gotoWithMessage(X_TRAVEL_LIMIT/2, 0, "airGunClean.jpg", "Clean air gun");
displayMedia("floodCoolantOff.jpg", false, "Turn flood coolant off")
setCoolant(COOLANT_FLOOD);
gotoWithMessage(0, Y_TRAVEL_LIMIT, "sprayLowerRight.jpg");
gotoWithMessage(X_TRAVEL_LIMIT, Y_TRAVEL_LIMIT, "sprayLowerLeft.jpg");
gotoWithMessage(0, 0, "sprayUpperRight.jpg")
gotoWithMessage(X_TRAVEL_LIMIT, 0, "sprayUpperLeft.jpg")
gotoWithMessage(0, Y_TRAVEL_LIMIT, "sprayLowerRight.jpg", "Spray lower right");
gotoWithMessage(X_TRAVEL_LIMIT, Y_TRAVEL_LIMIT, "sprayLowerLeft.jpg", "Spray lower left");
gotoWithMessage(0, 0, "sprayUpperRight.jpg", "Spray upper right")
gotoWithMessage(X_TRAVEL_LIMIT, 0, "sprayUpperLeft.jpg", "Spray upper left")
onCommand(COMMAND_COOLANT_OFF);
onCommand(COMMAND_START_CHIP_TRANSPORT);
gotoWithMessage(X_TRAVEL_LIMIT/2, Y_TRAVEL_LIMIT, "sweepChips.jpg");
gotoWithMessage(X_TRAVEL_LIMIT/2, Y_TRAVEL_LIMIT, "sweepChips.jpg", "Sweep chips");
onCommand(COMMAND_STOP_CHIP_TRANSPORT);

writeln("");
Expand Down
70 changes: 34 additions & 36 deletions Haas_Mills_BIDC/Bechtel VF4.cps
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ properties = {/*
scope: "post"
},
displayMediaCalls: {
title: "M130 Media calls",
description: "Enable to include M130 part images with the NC file..",
title: "Display Media",
description: "Enable to include M130 part images with the NC file, disable to see the information in comments.",
group: 4,
value: false,
scope: "post"
Expand Down Expand Up @@ -1362,7 +1362,6 @@ function onOpen() {

// Display general tool probe info
displayMedia("toolProbeReminder.jpg", !getProperty("loadToolsAtStart"));
writeFunction(mFormat.format(0));

let parsedTools = [];

Expand Down Expand Up @@ -1451,8 +1450,7 @@ function onOpen() {
comment += " - " + getToolTypeName(tool.type);
writeComment(tool.description);
writeFunction("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg", !getProperty("loadToolsAtStart"));
writeFunction(mFormat.format(0), formatComment("Load Tool")); //Pause until operator loads tool
displayMedia("toolLoad" + tool.number + ".jpg", !getProperty("loadToolsAtStart"), "Load Tool " + tool.number);
writeToolMeasureBlock(tool, true);
}
}
Expand Down Expand Up @@ -2332,7 +2330,6 @@ function onSection() {
writeBlock(gFormat.format(55), gFormat.format(0), xOutput.format(Stock_X_55));
writeBlock(gFormat.format(53), gFormat.format(0), yOutput.format(0));
displayMedia("loadStock.jpg", false);
writeBlock(mFormat.format(0));
}


Expand All @@ -2352,8 +2349,7 @@ function onSection() {
} else if (staticProperties.hasAAxis != "false") {
writeBlock(gFormat.format(0), aOutput.format(0));
}
displayMedia("xyWCSCheck.jpg", false);
writeBlock(mFormat.format(0), formatComment("Open door"));
displayMedia("xyWCSCheck.jpg", false, "Open door and check x-y position");
/*
displayMedia("Net Share/Media/checkPrompt.jpg");
var gotoRef = takeInput("Is the pencil centered above your stock? stock? [Y/N]", ['N', 'Y']);
Expand All @@ -2364,9 +2360,7 @@ function onSection() {
writeWords("N" + nFormat.format(gotoRef['Y']), mFormat.format(131), formatComment("End Multimedia"));
*/
writeBlock(gFormat.format(55), gFormat.format(43), hFormat.format(19), zOutput.format(stockTopZ));
displayMedia("zWCSCheck.jpg", false);
writeBlock(mFormat.format(0), formatComment("Open door"));
writeBlock(mFormat.format(131), formatComment("End Multimedia"));
displayMedia("zWCSCheck.jpg", false, "Open door and check z position");

/*
displayMedia("Net Share/Media/checkPrompt.jpg");
Expand Down Expand Up @@ -2426,9 +2420,7 @@ function onSection() {
}

if (!isFirstSection() && getProperty("toolLengthValidation")) {
displayMedia("checkPartTool.jpg", false);
writeBlock(mFormat.format(0));
writeBlock(mFormat.format(131));
displayMedia("checkPartTool.jpg", false, "Check Part and Tool");
} else if (!isFirstSection()) {
writeBlock(mFormat.format(1));
writeComment("Check Part and Tool");
Expand All @@ -2448,7 +2440,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 Expand Up @@ -2809,11 +2801,9 @@ function onSection() {
var toolDistance = initialPosition.z - stockTopZ;

// Prompt user to check stock-tool distance
displayMedia("checkDistance" + toolDistance.toPrecision(2).toString().replace(".", "_") + ".jpg", false);
writeBlock(mFormat.format(0));
displayMedia("checkDistance" + toolDistance.toPrecision(2).toString().replace(".", "_") + ".jpg", false, "Check distance: " + toolDistance.toPrecision(2).toString() +"in");
writeComment("OPEN DOOR");
//displayMedia("Net Share/Media/checkPrompt.jpg");
writeBlock(mFormat.format(131));

// asks user if measured height is accurate to displayed
//var gotoRef = takeInput(("Is the tool " + toolDistance.toPrecision(3) + "in from the stock? [Y/N]"), ['N', 'Y']);
Expand Down Expand Up @@ -2850,11 +2840,23 @@ function onSection() {
// Issue 001 Input and Validation
// Displays a file: MP4, MOV, PNG, JPEG. 1920x1080
// Input: Absolute path to file
function displayMedia(file, isOptional) {
if (isOptional || !getProperty("displayMediaCalls")) {
writeOptionalBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
function displayMedia(file, isOptional, comment) {
var writeFunction = isOptional ? writeOptionalBlock : writeBlock;
if (!getProperty("displayMediaCalls")) {
writeFunction(mFormat.format(0));
comment ?
writeComment(comment)
:
null;
return;
} else {
writeBlock(mFormat.format(130), formatComment("Net Share/Media/" + file));
writeFunction(mFormat.format(130), formatComment("Net Share/Media/" + file));
comment ?
writeFunction(mFormat.format(0), formatComment(comment))
:
writeFunction(mFormat.format(0));
writeFunction(mFormat.format(131));
}
}

Expand Down Expand Up @@ -4555,31 +4557,27 @@ function onClose() {
continue;
}
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); // get tool
displayMedia("removeTool" + tool.number + ".jpg", false);
writeBlock(mFormat.format(0));
displayMedia("removeTool" + tool.number + ".jpg", false, "Remove tool " + tool.number);
}
}
writeBlock(mFormat.format(131));

function gotoWithMessage(xLoc, yLoc, fileName) {
function gotoWithMessage(xLoc, yLoc, fileName, comment) {
writeBlock(gFormat.format(53), xOutput.format(xLoc), yOutput.format(yLoc));
displayMedia(fileName, false);
writeBlock(mFormat.format(0));
displayMedia(fileName, false, comment);
}

writeln("");
writeComment("CLEAN MACHINE");
gotoWithMessage(X_TRAVEL_LIMIT/2, 0, "airGunClean.jpg");
displayMedia("floodCoolantOff.jpg", false)
writeBlock(mFormat.format(0));
gotoWithMessage(X_TRAVEL_LIMIT/2, 0, "airGunClean.jpg", "Clean air gun");
displayMedia("floodCoolantOff.jpg", false, "Turn flood coolant off");
setCoolant(COOLANT_FLOOD);
gotoWithMessage(0, Y_TRAVEL_LIMIT, "sprayLowerRight.jpg");
gotoWithMessage(X_TRAVEL_LIMIT, Y_TRAVEL_LIMIT, "sprayLowerLeft.jpg");
gotoWithMessage(0, 0, "sprayUpperRight.jpg")
gotoWithMessage(X_TRAVEL_LIMIT, 0, "sprayUpperLeft.jpg")
gotoWithMessage(0, Y_TRAVEL_LIMIT, "sprayLowerRight.jpg", "Spray lower right");
gotoWithMessage(X_TRAVEL_LIMIT, Y_TRAVEL_LIMIT, "sprayLowerLeft.jpg", "Spray lower left");
gotoWithMessage(0, 0, "sprayUpperRight.jpg", "Spray upper right")
gotoWithMessage(X_TRAVEL_LIMIT, 0, "sprayUpperLeft.jpg", "Spray upper left")
onCommand(COMMAND_COOLANT_OFF);
onCommand(COMMAND_START_CHIP_TRANSPORT);
gotoWithMessage(X_TRAVEL_LIMIT/2, Y_TRAVEL_LIMIT, "sweepChips.jpg");
gotoWithMessage(X_TRAVEL_LIMIT/2, Y_TRAVEL_LIMIT, "sweepChips.jpg", "Sweep chips");
onCommand(COMMAND_STOP_CHIP_TRANSPORT);

writeln("");
Expand Down

0 comments on commit 959ebba

Please sign in to comment.