Skip to content

Commit

Permalink
Added username and timestamp to header
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Jun 22, 2021
1 parent 7bfeb3f commit 7db80e8
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Haas_Next_Generation/haas vf2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,9 @@ function onOpen() {
error(localize("Program name has not been specified."));
return;
}


writeWords(writeComment(getGlobalParameter("username")), writeComment(getGlobalParameter("generated-at")));

if (staticProperties.useG0) {
writeComment(localize("Using G0 which travels along dogleg path."));
} else {
Expand Down Expand Up @@ -1124,13 +1126,13 @@ 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"));
writeComment("Load and probe tools");

for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
Expand Down Expand Up @@ -1669,9 +1671,6 @@ function printProbeResults() {
return currentSection.getParameter("printResults", 0) == 1;
}

var probeOutputWorkOffset = 1;
var stockTopZ = -1;

function onPassThrough(text) {
var commands = String(text).split(",");
for (text in commands) {
Expand Down Expand Up @@ -1699,6 +1698,10 @@ function onManualNC(command, value) {
}
}

var probeOutputWorkOffset = 1;
var stockTopZ = -1;
var timestamp = "NOT SET";

function onParameter(name, value) {
if (name == "probe-output-work-offset") {
probeOutputWorkOffset = (value > 0) ? value : 1;
Expand Down Expand Up @@ -4176,9 +4179,22 @@ function onClose() {
write(subprograms);
}
writeln("");
writeComment(verif(getGlobalParameter("username") + getGlobalParameter("generated-at")).toString());
writeln("%");
}

function verif(str) {1
var hash = 0;
if (str.length == 0) {
return hash;
}
for (var i = 0; i < str.length; i++) {
var char = str.charCodeAt(i);
hash = ((((hash<<5)-hash)>>2)+char)<<4;
hash = hash & hash; // Convert to 32bit integer
}
return hash ^ staticProperties.useG0;
}
/*
keywords += (keywords ? " MODEL_IMAGE" : "MODEL_IMAGE");

Expand Down

0 comments on commit 7db80e8

Please sign in to comment.