var tools = getToolTable();
if (tools.getNumberOfTools() > 0) {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
var comment = "T" + toolFormat.format(tool.number) + " " +
(tool.diameter != 0 ? "D=" + spatialFormat.format(tool.diameter) + " " : "") +
(tool.isTurningTool() ? localize("NR") + "=" + spatialFormat.format(tool.noseRadius) : localize("CR") + "=" + spatialFormat.format(tool.cornerRadius)) +
(tool.taperAngle > 0 && (tool.taperAngle < Math.PI) ? " " + localize("TAPER") + "=" + taperFormat.format(tool.taperAngle) + localize("deg") : "") +
(zRanges[tool.number] ? " - " + localize("ZMIN") + "=" + spatialFormat.format(zRanges[tool.number].getMinimum()) : "") +
" - " + localize(getToolTypeName(tool.type));
writeComment(comment);
}
}
This section is for the header that lists the tools at the top of the program, directly beneath the machine description. It has to be toggled on when posting.
I would like for the turret station (compensationOffset) to be directly before the tool number, but there are a couple of issues with this:
1) Drills don't have turret stations (they have length offsets)
2) When I added it where I wanted it, it just posted zeroes.
I changed this line: var comment = "T" + toolFormat.format(tool.number) + " " +
to this: var comment = (compensationOffset) + " " + "T" + toolFormat.format(tool.number) + " " +
But it just looked like this:
(0 T2002 NR=0.8 - ZMIN=-50.6 - BORING TURNING)
(0 T7001 D=25.4 CR=0. - ZMIN=-50.75 - DRILL)
It should look like this:
(9 T2002 NR=0.8 - ZMIN=-50.6 - BORING TURNING)
(7 T7001 D=25.4 CR=0. - ZMIN=-50.75 - DRILL)
I would also be okay with this:
(9) (T2002 NR=0.8 - ZMIN=-50.6 - BORING TURNING)
(7) (T7001 D=25.4 CR=0. - ZMIN=-50.75 - DRILL)
How can I change this to post the desired result?
Does it have to be conditional, in order to catch drill length offsets too?