Skip to content

Commit

Permalink
Misc QOL Alterations
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Jul 21, 2021
1 parent b36bb36 commit 8a6e5ed
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 43 deletions.
34 changes: 19 additions & 15 deletions Haas_Next_Generation/Bechtel DT.cps
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ staticProperties = {
useM130ToolImages: false,
coolantPressure: "",
singleResultsFile: true,
useP9995: true
useP9995: true,
postVersion: 2893
};

const HAAS_DRILL = 1;
Expand Down Expand Up @@ -1202,14 +1203,11 @@ function onOpen() {
return;
}

writeWords(writeComment(getGlobalParameter("username") + ": " + getGlobalParameter("document-path")), writeComment(getGlobalParameter("generated-at")));

if (staticProperties.useG0) {
writeComment(localize("Using G0 which travels along dogleg path."));
} else {
writeComment(subst(localize("Using high feed G1 F%1 instead of G0."), feedFormat.format(highFeedrate)));
}

writeComment("Career Account Username: " + getGlobalParameter("username"));
writeComment("Filename: " + getGlobalParameter("document-path"));
writeComment("Date: " + getGlobalParameter("generated-at"));
writeComment("Post Version: " + staticProperties.postVersion);

if (staticProperties.writeVersion) {
if ((typeof getHeaderVersion == "function") && getHeaderVersion()) {
writeComment(localize("post version") + ": " + getHeaderVersion());
Expand Down Expand Up @@ -1268,7 +1266,7 @@ function onOpen() {
comment += " - " + localize("ZMIN") + "=" + xyzFormat.format(zRanges[tool.number].getMinimum());
}
comment += " - " + getToolTypeName(tool.type);
writeComment(comment);
// writeComment(comment);

if (staticProperties.useM130PartImages) {
var toolRenderer = createToolRenderer();
Expand All @@ -1294,12 +1292,13 @@ function onOpen() {
}

writeln("");
writeComment("Reset work plane, cancel all cycles and offsets");
writeBlock(gFormat.format(0),
gFormat.format(17),
gFormat.format(40),
gFormat.format(49),
gFormat.format(80),
gFormat.format(90), formatComment("Reset work plane, cancel all cycles and offsets"));
gFormat.format(90));

// 6/21/21 | Gavin Williams | will1742
// Probing now required. Using P9995.
Expand Down Expand Up @@ -1401,7 +1400,7 @@ function onOpen() {
}
comment += " - " + getToolTypeName(tool.type);
writeComment(tool.description);
writeComment(comment);
//writeComment(comment);
if (getProperty("measureToolsAtStart")) {
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg");
Expand All @@ -1412,7 +1411,9 @@ function onOpen() {
}
}
}

writeln("");
writeComment("SETUP FOR OPERATION");
writeBlock(mFormat.format(131));
}

Expand Down Expand Up @@ -2280,8 +2281,8 @@ function onSection() {
writeWords("IF [" + macroFormat.format(100) + " LT 0] THEN " + macroFormat.format(100) + "=0");
writeWords("IF [" + macroFormat.format(100) + " GT " + X_TRAVEL_LIMIT + "] THEN " + macroFormat.format(100) + "=" + X_TRAVEL_LIMIT);
writeBlock(gFormat.format(53), "X" + macroFormat.format(100), yOutput.format(0));
writeBlock(mFormat.format(0));
displayMedia("loadStock.jpg");
writeBlock(mFormat.format(0));
}


Expand Down Expand Up @@ -2388,12 +2389,13 @@ function onSection() {
writeln("");
}

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

if (staticProperties.showNotes) {
var notes = getParameter("notes");
writeComment("PEER MENTOR NOTES:")
if (notes) {
var lines = String(notes).split("\n");
var r1 = new RegExp("^[\\s]+", "g");
Expand Down Expand Up @@ -4483,9 +4485,11 @@ function onClose() {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); // get tool
displayMedia("removeTool" + tool.number + ".jpg");
writeBlock(mFormat.format(0));
}
}
writeBlock(mFormat.format(131));

function gotoWithMessage(xLoc, yLoc, fileName) {
writeBlock(gFormat.format(53), xOutput.format(xLoc), yOutput.format(yLoc));
Expand Down
32 changes: 18 additions & 14 deletions Haas_Next_Generation/Bechtel VF2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ staticProperties = {
useM130ToolImages: false,
coolantPressure: "",
singleResultsFile: true,
useP9995: true
useP9995: true,
postVersion: 2893
};

const HAAS_DRILL = 1;
Expand Down Expand Up @@ -1202,13 +1203,10 @@ function onOpen() {
return;
}

writeWords(writeComment(getGlobalParameter("username") + ": " + getGlobalParameter("document-path")), writeComment(getGlobalParameter("generated-at")));

if (staticProperties.useG0) {
writeComment(localize("Using G0 which travels along dogleg path."));
} else {
writeComment(subst(localize("Using high feed G1 F%1 instead of G0."), feedFormat.format(highFeedrate)));
}
writeComment("Career Account Username: " + getGlobalParameter("username"));
writeComment("Filename: " + getGlobalParameter("document-path"));
writeComment("Date: " + getGlobalParameter("generated-at"));
writeComment("Post Version: " + staticProperties.postVersion);

if (staticProperties.writeVersion) {
if ((typeof getHeaderVersion == "function") && getHeaderVersion()) {
Expand Down Expand Up @@ -1268,7 +1266,7 @@ function onOpen() {
comment += " - " + localize("ZMIN") + "=" + xyzFormat.format(zRanges[tool.number].getMinimum());
}
comment += " - " + getToolTypeName(tool.type);
writeComment(comment);
// writeComment(comment);

if (staticProperties.useM130PartImages) {
var toolRenderer = createToolRenderer();
Expand All @@ -1294,12 +1292,13 @@ function onOpen() {
}

writeln("");
writeComment("Reset work plane, cancel all cycles and offsets");
writeBlock(gFormat.format(0),
gFormat.format(17),
gFormat.format(40),
gFormat.format(49),
gFormat.format(80),
gFormat.format(90), formatComment("Reset work plane, cancel all cycles and offsets"));
gFormat.format(90));

// 6/21/21 | Gavin Williams | will1742
// Probing now required. Using P9995.
Expand Down Expand Up @@ -1401,7 +1400,7 @@ function onOpen() {
}
comment += " - " + getToolTypeName(tool.type);
writeComment(tool.description);
writeComment(comment);
//writeComment(comment);
if (getProperty("measureToolsAtStart")) {
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg");
Expand All @@ -1412,7 +1411,9 @@ function onOpen() {
}
}
}

writeln("");
writeComment("SETUP FOR OPERATION");
writeBlock(mFormat.format(131));
}

Expand Down Expand Up @@ -2280,8 +2281,8 @@ function onSection() {
writeWords("IF [" + macroFormat.format(100) + " LT 0] THEN " + macroFormat.format(100) + "=0");
writeWords("IF [" + macroFormat.format(100) + " GT " + X_TRAVEL_LIMIT + "] THEN " + macroFormat.format(100) + "=" + X_TRAVEL_LIMIT);
writeBlock(gFormat.format(53), "X" + macroFormat.format(100), yOutput.format(0));
writeBlock(mFormat.format(0));
displayMedia("loadStock.jpg");
writeBlock(mFormat.format(0));
}


Expand Down Expand Up @@ -2388,12 +2389,13 @@ function onSection() {
writeln("");
}

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

if (staticProperties.showNotes) {
var notes = getParameter("notes");
writeComment("PEER MENTOR NOTES:")
if (notes) {
var lines = String(notes).split("\n");
var r1 = new RegExp("^[\\s]+", "g");
Expand Down Expand Up @@ -4483,9 +4485,11 @@ function onClose() {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); // get tool
displayMedia("removeTool" + tool.number + ".jpg");
writeBlock(mFormat.format(0));
}
}
writeBlock(mFormat.format(131));

function gotoWithMessage(xLoc, yLoc, fileName) {
writeBlock(gFormat.format(53), xOutput.format(xLoc), yOutput.format(yLoc));
Expand Down
32 changes: 18 additions & 14 deletions Haas_Next_Generation/Bechtel VF4.cps
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ staticProperties = {
useM130ToolImages: false,
coolantPressure: "",
singleResultsFile: true,
useP9995: true
useP9995: true,
postVersion: 2893
};

const HAAS_DRILL = 1;
Expand Down Expand Up @@ -1202,13 +1203,10 @@ function onOpen() {
return;
}

writeWords(writeComment(getGlobalParameter("username") + ": " + getGlobalParameter("document-path")), writeComment(getGlobalParameter("generated-at")));

if (staticProperties.useG0) {
writeComment(localize("Using G0 which travels along dogleg path."));
} else {
writeComment(subst(localize("Using high feed G1 F%1 instead of G0."), feedFormat.format(highFeedrate)));
}
writeComment("Career Account Username: " + getGlobalParameter("username"));
writeComment("Filename: " + getGlobalParameter("document-path"));
writeComment("Date: " + getGlobalParameter("generated-at"));
writeComment("Post Version: " + staticProperties.postVersion);

if (staticProperties.writeVersion) {
if ((typeof getHeaderVersion == "function") && getHeaderVersion()) {
Expand Down Expand Up @@ -1268,7 +1266,7 @@ function onOpen() {
comment += " - " + localize("ZMIN") + "=" + xyzFormat.format(zRanges[tool.number].getMinimum());
}
comment += " - " + getToolTypeName(tool.type);
writeComment(comment);
// writeComment(comment);

if (staticProperties.useM130PartImages) {
var toolRenderer = createToolRenderer();
Expand All @@ -1294,12 +1292,13 @@ function onOpen() {
}

writeln("");
writeComment("Reset work plane, cancel all cycles and offsets");
writeBlock(gFormat.format(0),
gFormat.format(17),
gFormat.format(40),
gFormat.format(49),
gFormat.format(80),
gFormat.format(90), formatComment("Reset work plane, cancel all cycles and offsets"));
gFormat.format(90));

// 6/21/21 | Gavin Williams | will1742
// Probing now required. Using P9995.
Expand Down Expand Up @@ -1401,7 +1400,7 @@ function onOpen() {
}
comment += " - " + getToolTypeName(tool.type);
writeComment(tool.description);
writeComment(comment);
//writeComment(comment);
if (getProperty("measureToolsAtStart")) {
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg");
Expand All @@ -1412,7 +1411,9 @@ function onOpen() {
}
}
}

writeln("");
writeComment("SETUP FOR OPERATION");
writeBlock(mFormat.format(131));
}

Expand Down Expand Up @@ -2280,8 +2281,8 @@ function onSection() {
writeWords("IF [" + macroFormat.format(100) + " LT 0] THEN " + macroFormat.format(100) + "=0");
writeWords("IF [" + macroFormat.format(100) + " GT " + X_TRAVEL_LIMIT + "] THEN " + macroFormat.format(100) + "=" + X_TRAVEL_LIMIT);
writeBlock(gFormat.format(53), "X" + macroFormat.format(100), yOutput.format(0));
writeBlock(mFormat.format(0));
displayMedia("loadStock.jpg");
writeBlock(mFormat.format(0));
}


Expand Down Expand Up @@ -2388,12 +2389,13 @@ function onSection() {
writeln("");
}

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

if (staticProperties.showNotes) {
var notes = getParameter("notes");
writeComment("PEER MENTOR NOTES:")
if (notes) {
var lines = String(notes).split("\n");
var r1 = new RegExp("^[\\s]+", "g");
Expand Down Expand Up @@ -4483,9 +4485,11 @@ function onClose() {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); // get tool
displayMedia("removeTool" + tool.number + ".jpg");
writeBlock(mFormat.format(0));
}
}
writeBlock(mFormat.format(131));

function gotoWithMessage(xLoc, yLoc, fileName) {
writeBlock(gFormat.format(53), xOutput.format(xLoc), yOutput.format(yLoc));
Expand Down

0 comments on commit 8a6e5ed

Please sign in to comment.