Skip to content

Commit

Permalink
Split VF Post
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Jul 21, 2021
1 parent 0b43183 commit 222f9a8
Show file tree
Hide file tree
Showing 2 changed files with 4,632 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ properties = {/*
{title: "Yes", id: "true"},
{title: "Reversed", id: "reversed"}
],
value: "reversed",
value: "false",
scope: "post"
},
hasBAxis: {
Expand All @@ -108,7 +108,7 @@ properties = {/*
{title: "Yes", id: "true"},
{title: "Reversed", id: "reversed"}
],
value: "true",
value: "false",
scope: "post"
},/*
useDPMFeeds: {
Expand Down Expand Up @@ -294,7 +294,7 @@ properties = {/*
{title: "Patterns", id: "patterns"}
],
group: 3,
value: "allOperations",
value: "none",
scope: "post"
},/*
writeMachine: {
Expand Down Expand Up @@ -495,8 +495,8 @@ staticProperties = {
// VF4 specific
const MAX_TOOL_LENGTH = 11;
const MAX_TOOL_DIAM = 5;
const X_TRAVEL_LIMIT = 50;
const Y_TRAVEL_LIMIT = 25;
const X_TRAVEL_LIMIT = 30;
const Y_TRAVEL_LIMIT = 15;

var singleLineCoolant = false; // specifies to output multiple coolant codes in one line rather than in separate lines
// samples:
Expand Down Expand Up @@ -1293,6 +1293,14 @@ function onOpen() {
}
}

writeln("");
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"));

// 6/21/21 | Gavin Williams | will1742
// Probing now required. Using P9995.
// optionally cycle through all tools
Expand All @@ -1312,13 +1320,9 @@ function onOpen() {

// 6/21/21 | Gavin Williams | will1742
writeComment("Load and probe tools");
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"));

displayMedia("Net Share/Media/toolProbeReminder.jpg");
writeBlock(mFormat.format(0));

let parsedTools = [];

Expand Down Expand Up @@ -1362,7 +1366,6 @@ function onOpen() {

for (var i = 0; i < tools.getNumberOfTools(); i++) {
var tool = tools.getTool(i);
writeComment(tool.description);
if (tool.bodyLength + tool.holderLength > MAX_TOOL_LENGTH) {
throw "Error: T" + tool.number + " length greater than machine max"
}
Expand Down Expand Up @@ -2269,6 +2272,19 @@ function setAbsoluteMode(xyz, abc) {
}

function onSection() {
if (isFirstSection()) {
writeln("");
writeComment("STOCK PREP");
var Stock_X_55 = (stockUpperX - stockLowerX)/2;
writeln(macroFormat.format(100) + "=[" + (Stock_X_55.toFixed(4) + "-" + macroFormat.format(5241)) + "]");
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");
}


// 07/06/21 | Gavin Williams | will1742
// 002 Improved Probing
// uses pencil to verify WCS, prompts user
Expand Down Expand Up @@ -2353,6 +2369,12 @@ function onSection() {
}
}

if (!isFirstSection()) {
displayMedia("checkPartTool.jpg");
writeBlock(mFormat.format(0));
writeBlock(mFormat.format(131));
}

if (hasParameter("operation-comment")) {
var comment = getParameter("operation-comment");
if (comment && ((comment !== lastOperationComment) || !patternIsActive || insertToolCall)) {
Expand All @@ -2366,7 +2388,11 @@ function onSection() {
writeln("");
}

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

if (staticProperties.showNotes) {
var notes = getParameter("notes");
if (notes) {
var lines = String(notes).split("\n");
Expand Down Expand Up @@ -4448,6 +4474,7 @@ function onClose() {

onCommand(COMMAND_STOP_SPINDLE);
onCommand(COMMAND_COOLANT_OFF);
writeBlock(mFormat.format(0));

writeln("");
writeComment("UNLOAD TOOLS");
Expand Down
Loading

0 comments on commit 222f9a8

Please sign in to comment.