Skip to content

Commit

Permalink
Merge branch '#32-setupsheet' of https://github.itap.purdue.edu/Becht…
Browse files Browse the repository at this point in the history
  • Loading branch information
pan261 committed Oct 25, 2021
2 parents d072700 + 638ac11 commit 7edc931
Show file tree
Hide file tree
Showing 8 changed files with 5,208 additions and 359 deletions.
67 changes: 40 additions & 27 deletions Autodesk_Setup_BIDC/setup-sheet.cps
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ properties = {
}
};

var staticProperties = {
postVersion: "BIDC-NGC.G10.K21"
}

var showToolpath = false;
var useToolNumber = true;

Expand Down Expand Up @@ -405,7 +409,7 @@ function onOpen() {
c += "<style type=\"text/css\">" + ".preview img {width: " + getProperty("previewWidth") + ";}" + "</style>";
c += script;
if (programName) {
c += "<title>" + localize("Setup Sheet for Program") + " " + programName + "</title>";
c += "<title>" + getGlobalParameter("document-path") + "</title>";
} else {
c += "<title>" + localize("Setup Sheet") + "</title>";
}
Expand All @@ -414,7 +418,7 @@ function onOpen() {

write("<body onload=\"onLoad()\">");
if (programName) {
write("<h1>" + localize("Setup Sheet for Program") + " " + programName + "</h1>");
write("<h1>" + getGlobalParameter("document-path") + ": " + programName + "</h1>");
} else {
write("<h1>" + localize("Setup Sheet") + "</h1>");
}
Expand Down Expand Up @@ -490,6 +494,13 @@ function getCoolantDescription(coolant) {
}
}

var offsetMapping = {
0: "G54",
1: "G54",
2: "G55",
3: "G56",
}

/** Formats WCS to text. */
function formatWCS(id) {
/*
Expand All @@ -501,7 +512,7 @@ function formatWCS(id) {
}
return "G" + (getAsInt(id) + 53);
*/
return "#" + id;
return "#" + id + " (" + offsetMapping[id] + ")";;
}

function isProbeOperation(section) {
Expand Down Expand Up @@ -1264,19 +1275,21 @@ function onSectionEnd() {
if (isFirstSection()) {
var c = "";
c += makeRow(makeColumn(d(localize("User") + ": ") + v(getGlobalParameter("username"))));
c += makeRow(makeColumn(d(localize("Date") + ": ") + v(getGlobalParameter("generated-at"))));
c += makeRow(makeColumn(d(localize("User Name: ")) + v(getGlobalParameter("username"))));
c += makeRow(makeColumn(d(localize("Date: ")) + v(getGlobalParameter("generated-at"))));
c += makeRow(makeColumn(d(localize("Post Version: ")) + v(staticProperties.postVersion)));
if (programComment) {
c += makeRow(makeColumn(d(localize("Program Comment") + ": ") + v(programComment)));
}

if (hasParameter("job-description")) {
var description = getParameter("job-description");
if (description) {
c += makeRow(makeColumn(d(localize("Job Description") + ": ") + v(description)));
}
}
// if (hasParameter("job-description")) {
// var description = getParameter("job-description");
// if (description) {
// c += makeRow(makeColumn(d(localize("Job Description") + ": ") + v(description)));
// }
// }

if (hasParameter("iso9000/document-control")) {
var id = getParameter("iso9000/document-control");
Expand All @@ -1285,21 +1298,21 @@ function onSectionEnd() {
}
}

if (getProperty("showDocumentPath")) {
if (hasParameter("document-path")) {
var path = getParameter("document-path");
if (path) {
c += makeRow(makeColumn(d(localize("Document Path") + ": ") + v(pageWidthFitPath(path))));
}
}

if (hasParameter("document-version")) {
var version = getParameter("document-version");
if (version) {
c += makeRow(makeColumn(d(localize("Document Version") + ": ") + v(version)));
}
}
}
// if (getProperty("showDocumentPath")) {
// if (hasParameter("document-path")) {
// var path = getParameter("document-path");
// if (path) {
// c += makeRow(makeColumn(d(localize("Document Path") + ": ") + v(pageWidthFitPath(path))));
// }
// }

// if (hasParameter("document-version")) {
// var version = getParameter("document-version");
// if (version) {
// c += makeRow(makeColumn(d(localize("Document Version") + ": ") + v(version)));
// }
// }
// }

if (getProperty("showNotes") && hasParameter("job-notes")) {
var notes = getParameter("job-notes");
Expand Down Expand Up @@ -1358,7 +1371,7 @@ function onSectionEnd() {
}

c += makeRow(makeColumn(
d(localize("Stock")) + ": <br>&nbsp;&nbsp;" + v(localize("DX") + ": " + spatialFormat.format(delta.x) + getUnitSymbolAsString()) + "<br>&nbsp;&nbsp;" + v(localize("DY") + ": " + spatialFormat.format(delta.y) + getUnitSymbolAsString()) + "<br>&nbsp;&nbsp;" + v(localize("DZ") + ": " + spatialFormat.format(delta.z) + getUnitSymbolAsString())
d(localize("Stock")) + ": <br>&nbsp;&nbsp;" + v(localize("X Size") + ": " + spatialFormat.format(delta.x) + getUnitSymbolAsString()) + "<br>&nbsp;&nbsp;" + v(localize("Y Size") + ": " + spatialFormat.format(delta.y) + getUnitSymbolAsString()) + "<br>&nbsp;&nbsp;" + v(localize("Z Size") + ": " + spatialFormat.format(delta.z) + getUnitSymbolAsString())
));

// if (hasParameter("part-lower-x") && hasParameter("part-lower-y") && hasParameter("part-lower-z") &&
Expand Down
17 changes: 6 additions & 11 deletions Haas_Gantry_BIDC/Bechtel SR.cps
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
All rights reserved.

HAAS post processor configuration.

$Revision: 43348 37c695f19b2eab4d5737a29df773b981b83fa8d4 $
$Date: 2021-07-12 15:10:04 $

FORKID {241E0993-8BE0-463b-8888-47968B9D7F9F}
*/

description = "HAAS (pre-NGC)";
description = "Bechtel Center - HAAS (pre-NGC)";
vendor = "Haas Automation";
vendorUrl = "https://www.haascnc.com";
legal = "Copyright (C) 2012-2021 by Autodesk, Inc.";
Expand Down Expand Up @@ -263,31 +258,31 @@ properties = {/*
toolsToLoad: {
title: "Tools to load and probe",
description: "List or provide a range of tools to probe e.g. 1, 2, 3 or 1-5. Leaving this empty will probe all tools",
group: 4,
group: 0,
type: "string",
value: "",
scope: "post"
},
pencilWCSValidation: {
title: "WCS Validation",
description: "WCS validation. By turning this off, you accept responsibility for any resulting crashes.",
group: 99,
group: 0,
type: "boolean",
value: true,
scope: "post"
},
toolHeightValidation: {
title: "Tool Length Validation",
description: "Length validation. By turning this off, you accept responsibility for any resulting crashes.",
group: 99,
group: 0,
type: "boolean",
value: true,
scope: "post"
},
measureToolsAtStart: {
title: "Tool Probing",
description: "Tool Probing. By turning this off, you accept responsibility for any resulting crashes.",
group: 99,
group: 0,
type: "boolean",
value: true,
scope: "post"
Expand Down Expand Up @@ -927,7 +922,7 @@ function onOpen() {
// parse string for specific tools to load
if (getProperty("toolsToLoad") != "") {
// get list of numbers
let toolNumArray = getProperty("toolsToLoad").split(',');
let toolNumArray = getProperty("toolsToLoad").toString().split(',');
// iterate through and fill ranges
for (var i = 0; i < toolNumArray.length; i++){
toolNumArray[i] = toolNumArray[i].trim();
Expand Down
Loading

0 comments on commit 7edc931

Please sign in to comment.