/**
Copyright (C) 2012-2024 by Autodesk, Inc.
All rights reserved.
Setup sheet configuration.
$Revision: 44115 86f283c49a2bb5324a205abec3cea6ae68b4e30e $
$Date: 2024-03-12 15:03:07 $
FORKID {BC98C807-412C-4ffc-BD2B-ABB3F0A59DB8}
*/
description = "Setup Sheet (HTML)";
vendor = "Autodesk";
vendorUrl = "http://www.autodesk.com";
legal = "Copyright (C) 2012-2024 by Autodesk, Inc.";
certificationLevel = 2;
minimumRevision = 45948;
longDescription = "Setup sheet for generating an HTML document with the relevant details for the setup, tools, and individual operations. You can print the document directly or alternatively convert it to a PDF file for later reference.";
capabilities = CAPABILITY_SETUP_SHEET;
extension = "html";
mimetype = "text/html";
keywords = "MODEL_IMAGE PREVIEW_IMAGE";
setCodePage("utf-8");
dependencies = "setup-sheet.css";
allowMachineChangeOnSection = true;
properties = {
embedStylesheet: {
title : "Embed stylesheet",
description: "Embeds the stylesheet in the HTML code.",
type : "boolean",
value : true,
scope : "post"
},
useUnitSymbol: {
title : "Use unit symbol",
description: "Specifies that symbols should be used for units (some printers may not support this).",
type : "boolean",
value : false,
scope : "post"
},
showDocumentPath: {
title : "Show document path",
description: "Specifies that the document path should be output.",
type : "boolean",
value : true,
scope : "post"
},
showModelImage: {
title : "Show model image",
description: "If enabled, a model image will be included in the setup sheet.",
type : "boolean",
value : true,
scope : "post"
},
showToolImage: {
title : "Show tool images",
description: "If enabled, tool images will be included in the seutp sheet.",
type : "boolean",
value : true,
scope : "post"
},
showPreviewImage: {
title : "Show preview image",
description: "If enabled, a preview image will be included in the setup sheet.",
type : "boolean",
value : true,
scope : "post"
},
previewWidth: {
title : "Preview width",
description: "Specifies the width of the preview image.",
type : "string",
value : "8cm",
scope : "post"
},
showPercentages: {
title : "Show percentages",
description: "Specifies that the percentage of the total cycle time should be shown for each operation cycle time.",
type : "boolean",
value : true,
scope : "post"
},
showFooter: {
title : "Show footer",
description: "Specifies whether a footer should be included in the HTML setup sheet.",
type : "boolean",
value : true,
scope : "post"
},
showRapidDistance: {
title : "Show rapid distance",
description: "Specifies whether the rapid distance should be output.",
type : "boolean",
value : true,
scope : "post"
},
rapidFeed: {
title : "Rapid feed",
description: "Sets the rapid traversal feedrate. Set this to get more accurate cycle times.",
type : "number",
value : 5000,
scope : "post"
},
toolChangeTime: {
title : "Tool change time",
description: "Sets the tool change time in seconds. Set this to get more accurate cycle times.",
type : "number",
value : 15,
scope : "post"
},
showNotes: {
title : "Show notes",
description: "Writes operation notes as comments in the outputted code.",
type : "boolean",
value : true,
scope : "post"
},
forcePreview: {
title : "Force preview",
description: "Enable to force a preview picture for all instances of a pattern.",
type : "boolean",
value : false,
scope : "post"
},
showOperations: {
title : "Show operations",
description: "Enable to output information for each operation.",
type : "boolean",
value : true,
scope : "post"
},
showTools: {
title : "Show tools",
description: "Enable to see information for each tool.",
type : "boolean",
value : true,
scope : "post"
},
showTotals: {
title : "Show totals",
description: "Enable to see total information.",
type : "boolean",
value : true,
scope : "post"
},
embedImages: {
title : "Embed images",
description: "If enabled, images are embedded into the HTML file.",
type : "boolean",
value : true,
scope : "post"
}
};
var showToolpath = false;
var useToolNumber = true;
var xyzFormat = createFormat({decimals:(unit == MM ? 3 : 4)});
var feedFormat = createFormat({decimals:(unit == MM ? 3 : 5)});
var toolFormat = createFormat({decimals:0});
var rpmFormat = createFormat({decimals:0});
var secFormat = createFormat({decimals:3});
var angleFormat = createFormat({decimals:0, scale:DEG});
var degFormat = createFormat({decimals:0});
var pitchFormat = createFormat({decimals:3});
var spatialFormat = createFormat({decimals:(unit == MM ? 2 : 3)});
var percentageFormat = createFormat({decimals:1, scale:100});
var timeFormat = createFormat({decimals:2});
var taperFormat = angleFormat; // share format
var supportedImageTypes = {
"bmp" : "image/bmp",
"gif" : "image/gif",
"jpg" : "image/jpeg",
"jpeg": "image/jpeg",
"png" : "image/png",
"tif" : "image/tiff",
"tiff": "image/tiff"
};
// collected state
var zRanges = {};
var totalCycleTime = 0;
var exportedTools = {};
var toolRenderer;
function getUnitSymbolAsString() {
switch (unit) {
case MM:
return getProperty("useUnitSymbol") ? "㎜" : "mm";
case IN:
return getProperty("useUnitSymbol") ? "∳" : "in";
default:
error(localize("Unit is not supported."));
return undefined;
}
}
function getFeedSymbolAsString() {
switch (unit) {
case MM:
return getProperty("useUnitSymbol") ? "㎜/min" : "mm/min";
case IN:
return getProperty("useUnitSymbol") ? "∳/min" : "in/min";
// return getProperty("useUnitSymbol") ? "′/min" : "ft/min";
default:
error(localize("Unit is not supported."));
return undefined;
}
}
function getFPRSymbolAsString() {
switch (unit) {
case MM:
return getProperty("useUnitSymbol") ? "㎜" : "mm";
case IN:
return getProperty("useUnitSymbol") ? "∳" : "in";
default:
error(localize("Unit is not supported."));
return undefined;
}
}
function toString(value) {
if (typeof value == "string") {
return "'" + value + "'";
} else {
return value;
}
}
function makeRow(content, classId) {
if (classId) {
return "
" + content + "
";
} else {
return "
" + content + "
";
}
}
function makeHeading(content, classId) {
if (classId) {
return "
" + content + "
";
} else {
return "
" + content + "
";
}
}
function makeColumn(content, classId) {
if (classId) {
return "
");
}
patternIds = {};
var numberOfSections = getNumberOfSections();
var j = 0;
for (var i = 0; i < numberOfSections; ++i) {
var section = getSection(i);
if (section.isPatterned()) {
var id = section.getPatternId();
if (patternIds[id] == undefined) {
patternIds[id] = formatPatternId(j);
++j;
}
}
}
}
/**
Returns the specified coolant as a string.
*/
function getCoolantDescription(coolant) {
switch (coolant) {
case COOLANT_OFF:
return localize("Off");
case COOLANT_FLOOD:
return localize("Flood");
case COOLANT_MIST:
return localize("Mist");
case COOLANT_THROUGH_TOOL:
return localize("Through tool");
case COOLANT_AIR:
return localize("Air");
case COOLANT_AIR_THROUGH_TOOL:
return localize("Air through tool");
case COOLANT_SUCTION:
return localize("Suction");
case COOLANT_FLOOD_MIST:
return localize("Flood and mist");
case COOLANT_FLOOD_THROUGH_TOOL:
return localize("Flood and through tool");
default:
return localize("Unknown");
}
}
/** Formats WCS to text. */
function formatWCS(id) {
/*
if (id == 0) {
id = 1;
}
if (id > 6) {
return "G54.1P" + (id - 6);
}
return "G" + (getAsInt(id) + 53);
*/
return "#" + id;
}
var svg;
/** Returns the SVG representation for the current toolpath. */
function getToolpathAsSVG() {
var fragment = "";
if (!svg) {
return "";
}
var pageWidth = 120;
var pageHeight = 100;
var box = currentSection.getGlobalBoundingBox();
// for turning only for now
box = {lower:new Vector(box.lower.z, box.lower.x, 0), upper:new Vector(box.upper.z, box.upper.x, 0)};
var width = box.upper.x - box.lower.x;
var height = box.upper.y - box.lower.y;
var dx = toMM(width);
var dy = toMM(height);
var dimension = Math.min(width, height);
var margin = toPreciseUnit(1, MM);
var backgroundColor = "#f0f0f0";
fragment += "";
// add support for tool animation
return fragment;
}
function onSection() {
if (showToolpath && (currentSection.getType() == TYPE_TURNING)) {
// var remaining = currentSection.workPlane;
var map2XY = new Matrix(new Vector(0, 0, 1), new Vector(1, 0, 0), new Vector(0, -1, 0));
setRotation(map2XY.getTransposed());
svg = new StringBuffer();
// add start position svg.append("");
} else {
skipRemainingSection();
}
}
function writeLine(x, y) {
if (radiusCompensation != RADIUS_COMPENSATION_OFF) {
return;
}
var color;
switch (movement) {
case MOVEMENT_CUTTING:
case MOVEMENT_REDUCED:
case MOVEMENT_FINISH_CUTTING:
color = "blue";
break;
case MOVEMENT_RAPID:
case MOVEMENT_HIGH_FEED:
color = "yellow";
break;
case MOVEMENT_LEAD_IN:
case MOVEMENT_LEAD_OUT:
case MOVEMENT_LINK_TRANSITION:
case MOVEMENT_LINK_DIRECT:
color = "green";
break;
default:
color = "red";
}
var start = getCurrentPosition();
if ((xyzFormat.format(start.x) == xyzFormat.format(x)) &&
(xyzFormat.format(start.y) == xyzFormat.format(y))) {
return; // ignore vertical
}
svg.append("");
}
function onRapid(x, y, z) {
writeLine(x, y);
}
function onLinear(x, y, z, feed) {
writeLine(x, y);
}
function onCircular(clockwise, cx, cy, cz, x, y, z, feed) {
// linearize(tolerance);
// return;
if (radiusCompensation != RADIUS_COMPENSATION_OFF) {
return;
}
var color;
switch (movement) {
case MOVEMENT_CUTTING:
case MOVEMENT_REDUCED:
case MOVEMENT_FINISH_CUTTING:
color = "blue";
break;
case MOVEMENT_RAPID:
case MOVEMENT_HIGH_FEED:
color = "yellow";
break;
case MOVEMENT_LEAD_IN:
case MOVEMENT_LEAD_OUT:
case MOVEMENT_LINK_TRANSITION:
case MOVEMENT_LINK_DIRECT:
color = "green";
break;
default:
color = "red";
}
var start = getCurrentPosition();
var largeArc = (getCircularSweep() > Math.PI) ? 1 : 0;
var sweepFlag = isClockwise() ? 1 : 0; // turning is flipped
var dpath = [
"M", xyzFormat.format(start.x), xyzFormat.format(start.y),
"A", xyzFormat.format(getCircularRadius()), xyzFormat.format(getCircularRadius()), 0, largeArc, sweepFlag, xyzFormat.format(x), xyzFormat.format(y)
].join(" ");
svg.append("");
}
function onCyclePoint(x, y, z) {
var color = "green";
var radius = tool.diameter * 0.5;
svg.append("");
}
function pageWidthFitPath(path) {
var PAGE_WIDTH = 70;
if (path.length < PAGE_WIDTH) {
return path;
}
var newPath = "";
var tempPath = "";
var flushPath = "";
var offset = 0;
var ids = "";
for (var i = 0; i < path.length; ++i) {
var cv = path[i];
if (i > (PAGE_WIDTH + offset)) {
if (flushPath.length == 0) { // No good place to break
flushPath = tempPath;
tempPath = "";
}
newPath += flushPath + " ";
offset += flushPath.length - 1;
flushPath = "";
}
if ((cv == "\\") || (cv == "/") || (cv == " ") || (cv == "_")) {
flushPath += tempPath + cv;
tempPath = "";
} else {
tempPath += cv;
}
}
newPath += flushPath + tempPath;
return newPath;
}
/** Returns the given spatial value in MM. */
function toMM(value) {
return value * ((unit == IN) ? 25.4 : 1);
}
/** Returns the SVG representation of the given tool. */
function getToolAsSVG(tool) {
var fragment = "";
var pageWidth = 30;
var pageHeight = 35;
var box = tool.getExtent(true);
var width = box.upper.x - box.lower.x;
var height = box.upper.y - box.lower.y;
var dx = toMM(width);
var dy = toMM(height);
var dimension = Math.min(width, height);
var margin = toPreciseUnit(1, MM);
var backgroundColor = "#ffffff";
fragment += "";
return fragment;
}
var TURNING_RELIEF_ANGLES = [
{id:"N", value:0},
{id:"A", value:3},
{id:"B", value:5},
{id:"C", value:7},
{id:"P", value:11},
{id:"D", value:15},
{id:"E", value:20},
{id:"F", value:25},
{id:"G", value:30}
];
/** Returns the turning ISO tool code. */
function getTurningToolISO(tool) {
if (!((tool.type == TOOL_TURNING_GENERAL) || (tool.type == TOOL_TURNING_BORING))) {
return "";
}
var reliefAngleCode = "?";
for (var e in TURNING_RELIEF_ANGLES) {
if (Math.abs(e.value - tool.reliefAngle) < 1e-3) {
reliefAngleCode = e.id;
break;
}
}
var name = "?";
name += reliefAngleCode;
return name;
}
var insertDescriptions = [
localize("User defined"), localize("ISO A 85deg"), localize("ISO B 82deg"), localize("ISO C 80deg"), localize("ISO D 55deg"), localize("ISO E 75deg"), localize("ISO H 120deg"), localize("ISO K 55deg"), localize("ISO L 90deg"), localize("ISO M 86deg"), localize("ISO O 135deg"), localize("ISO P 108deg"), localize("ISO R round"), localize("ISO S square"), localize("ISO T triangle"), localize("ISO V 35deg"), localize("ISO W 80deg"),
localize("Round"), localize("Radius"), localize("Square"), localize("Chamfer"), localize("40deg"),
localize("ISO double"), localize("ISO triple"), localize("UTS double"), localize("UTS triple"), localize("ISO double V"), localize("ISO triple V"), localize("UTS double V"), localize("UTS triple V")
];
var holderDescriptions = [
localize("No holder"), localize("ISO A"), localize("ISO B"), localize("ISO C"), localize("ISO D"), localize("ISO E"), localize("ISO F"), localize("ISO G"), localize("ISO H"), localize("ISO J"), localize("ISO K"), localize("ISO L"), localize("ISO M"), localize("ISO N"), localize("ISO P"), localize("ISO Q"), localize("ISO R"), localize("ISO S"), localize("ISO T"), localize("ISO U"), localize("ISO V"), localize("ISO W"), localize("ISO Y"), localize("Offset"), localize("Straight"),
localize("External"), localize("Internal"), localize("Face"),
localize("Straight"), localize("Offset"), localize("Face"),
localize("Boring bar ISO F"), localize("Boring bar ISO G"), localize("Boring bar ISO J"), localize("Boring bar ISO K"), localize("Boring bar ISO L"), localize("Boring bar ISO P"), localize("Boring bar ISO Q"), localize("Boring bar ISO S"), localize("Boring bar ISO U"), localize("Boring bar ISO W"), localize("Boring bar ISO Y"), localize("Boring bar ISO X")
];
/** Returns a HTML link if text looks like a link. */
function autoLink(link, description) {
if (!description) {
description = "";
}
if (!link) {
if ((description.toLowerCase().indexOf("https://") == 0) || (description.toLowerCase().indexOf("http://") == 0)) {
link = description;
if (description.length > 16) {
description = localize("click to visit");
}
}
}
if (!link) {
return description;
}
if (link.toLowerCase().indexOf("https://") == 0) {
if (!description) {
description = link.substr(8);
if (description.length > 16) {
description = localize("click to visit");
}
}
return "" + description + "";
} else if (link.toLowerCase().indexOf("http://") == 0) {
if (!description) {
description = link.substr(7);
if (description.length > 16) {
description = localize("click to visit");
}
}
return "" + description + "";
} else {
if (!description) {
description = link;
if (description.length > 16) {
description = localize("click to visit");
}
}
return "" + description + "";
}
}
function getSectionParameterForTool(tool, id) {
var numberOfSections = getNumberOfSections();
for (var i = 0; i < numberOfSections; ++i) {
var section = getSection(i);
if (section.getTool().number == tool.number) {
return section.hasParameter(id) ? section.getParameter(id) : undefined;
}
}
return undefined;
}
function getToolAngle(tool) {
var toolAngle = getSectionParameterForTool(tool, "operation:tool_angle");
if (toolAngle != undefined) {
switch (toolAngle) {
case 0:
return "Radial";
case 90:
case -90:
return "Axial";
default:
return toolAngle + " deg";
}
}
return "";
}
/** Returns a HTML table with the common tool information. Note that the table is not closed! */
function presentTool(tool) {
var c1 = "
";
if (!tool.isJetTool()) {
c1 += makeRow(
makeColumn(
bold(localize("T") + toolFormat.format(tool.number)) + " " +
localize("D") + toolFormat.format(!tool.isTurningTool() ? tool.diameterOffset : tool.compensationOffset) + " " +
conditional(!tool.isTurningTool(), localize("L") + toolFormat.format(tool.lengthOffset))
)
);
} else if (tool.isJetTool()) {
c1 += makeRow(makeColumn(" ")); // move 1 row down
}
if (tool.manualToolChange) {
c1 += makeRow(makeColumn(d(bold(localize("Manual tool change")))));
}
if (tool.isLiveTool && !tool.isTurningTool() && (machineConfiguration.getTurning() || isTurning())) {
c1 += makeRow(makeColumn(d(localize("Type") + ": ") + v(getToolTypeName(tool.type) + " " + (tool.isLiveTool() ? localize("LIVE") : localize("STATIC")))));
} else { // dont show for old versions or is non turning
c1 += makeRow(makeColumn(d(localize("Type") + ": ") + v(getToolTypeName(tool.type))));
}
if (!tool.isTurningTool()) {
c1 += makeRow(makeColumn(d(localize(tool.isJetTool() ? "Kerf Diameter" : "Diameter") + ": ") + v(spatialFormat.format(tool.isJetTool() ? tool.jetDiameter : tool.diameter) + getUnitSymbolAsString())));
if (tool.cornerRadius) {
c1 += makeRow(makeColumn(d(localize("Corner Radius") + ": ") + v(spatialFormat.format(tool.cornerRadius) + getUnitSymbolAsString())));
}
if ((tool.taperAngle > 0) && (tool.taperAngle < Math.PI)) {
if (tool.isDrill()) {
c1 += makeRow(makeColumn(d(localize("Tip Angle") + ": ") + v(taperFormat.format(tool.taperAngle) + "°")));
} else {
c1 += makeRow(makeColumn(d(localize("Taper Angle") + ": ") + v(taperFormat.format(tool.taperAngle) + "°")));
}
}
if (!tool.isJetTool()) {
c1 += makeRow(makeColumn(d(localize("Length") + ": ") + v(spatialFormat.format(tool.bodyLength) + getUnitSymbolAsString())));
if (tool.numberOfFlutes > 0) {
c1 += makeRow(makeColumn(d(localize("Flutes") + ": ") + v(tool.numberOfFlutes)));
}
}
} else {
if (tool.getInsertType() < insertDescriptions.length) {
c1 += makeRow(makeColumn(d(localize("Insert") + ": ") + v(insertDescriptions[tool.getInsertType()])));
}
if (tool.getHolderType() < holderDescriptions.length) {
var hand = "";
switch (tool.hand) {
case "L":
hand = localize("Left");
break;
case "R":
hand = localize("Right");
break;
case "N":
hand = localize("Neutral");
break;
}
if (!getProperty("showTools")) {
c1 += makeRow(makeColumn(d(localize("Holder") + ": ") + v(holderDescriptions[tool.getHolderType()] + " " + hand)));
}
if (false && tool.clamping) {
c1 += makeRow(makeColumn(d(localize("Clamping") + ": ") + v(tool.clamping)));
}
}
switch (tool.type) {
case TOOL_TURNING_GENERAL:
case TOOL_TURNING_BORING:
if ((tool.inscribedCircleDiameter !== undefined) && (tool.edgeLength !== undefined)) {
var edgeLength = tool.edgeLength;
if ((unit == MM) && (edgeLength > 0)) {
c1 += makeRow(makeColumn(d(localize("Edge length") + ": ") + v(spatialFormat.format(edgeLength) + getUnitSymbolAsString())));
} else {
c1 += makeRow(makeColumn(d(localize("Inscribed circle") + ": ") + v(spatialFormat.format(tool.inscribedCircleDiameter) + getUnitSymbolAsString())));
}
}
if (tool.noseRadius !== undefined) {
var NOSE_RADII = [
{idi:"X0", idm:"X0", vi:0.0015, vm:0.04},
{idi:"00", idm:"01", vi:0.004, vm:0.1},
{idi:"0.5", idm:"02", vi:0.008, vm:0.2},
{idi:"01", idm:"04", vi:1.0 / 64, vm:0.4},
{idi:"02", idm:"08", vi:2.0 / 64, vm:0.8},
{idi:"03", idm:"12", vi:3.0 / 64, vm:1.2},
{idi:"04", idm:"16", vi:4.0 / 64, vm:1.6},
{idi:"05", idm:"20", vi:5.0 / 64, vm:2.0},
{idi:"06", idm:"24", vi:6.0 / 64, vm:2.4},
{idi:"07", idm:"28", vi:7.0 / 64, vm:2.8},
{idi:"08", idm:"32", vi:8.0 / 64, vm:3.2},
{idi:"00", idm:"M0", vi:0, vm:0} // round
];
var id = "";
var value = tool.noseRadius;
/*
for (var i in NOSE_RADII) {
var e = NOSE_RADII[i];
var _value = (unit == MM) ? e.mi : e.vi; // we dont have a tool unit for now
if (Math.abs(_value - value) < 1e-3) {
id = (unit == MM) ? e.idm : e.idi;
value = _value;
break;
}
}
*/
var text = spatialFormat.format(value) + getUnitSymbolAsString();
if (id) {
text = id + " " + text;
}
c1 += makeRow(makeColumn(d(localize("Nose radius") + ": ") + v(text)));
}
if (tool.crossSection !== undefined) {
c1 += makeRow(makeColumn(d(localize("Cross section") + ": ") + v(tool.crossSection)));
}
if (tool.tolerance !== undefined) {
c1 += makeRow(makeColumn(d(localize("Tolerance") + ": ") + v(tool.tolerance)));
}
if (tool.reliefAngle !== undefined) {
var id = localize("Custom");
var value = tool.reliefAngle;
for (var ir in TURNING_RELIEF_ANGLES) {
var re2 = TURNING_RELIEF_ANGLES[ir];
if (Math.abs(re2.value - value) < 1e-3) {
id = re2.id;
value = re2.value;
break;
}
}
c1 += makeRow(makeColumn(d(localize("Relief") + ": ") + v(id + " " + degFormat.format(value) + "deg")));
}
break;
case TOOL_TURNING_THREADING:
if ((tool.pitch !== undefined) && (tool.pitch > 0)) {
c1 += makeRow(makeColumn(d(localize("Pitch") + ": ") + v(spatialFormat.format(tool.pitch) + getUnitSymbolAsString())));
}
// internal/external info
break;
case TOOL_TURNING_GROOVING:
// show shape also
if (tool.grooveWidth !== undefined) {
c1 += makeRow(makeColumn(d(localize("Width") + ": ") + v(spatialFormat.format(tool.grooveWidth) + getUnitSymbolAsString())));
}
if ((tool.noseRadius !== undefined) && (tool.noseRadius > 0)) {
c1 += makeRow(makeColumn(d(localize("Nose radius") + ": ") + v(spatialFormat.format(tool.noseRadius) + getUnitSymbolAsString())));
}
break;
case TOOL_TURNING_CUSTOM:
break;
}
var compensationDescription;
switch (tool.getCompensationMode()) {
case TOOL_COMPENSATION_INSERT_CENTER:
compensationDescription = localize("Insert center");
break;
case TOOL_COMPENSATION_TIP:
compensationDescription = localize("Tip");
break;
case TOOL_COMPENSATION_TIP_CENTER:
compensationDescription = localize("Tip center");
break;
case TOOL_COMPENSATION_TIP_TANGENT:
compensationDescription = localize("Tip tangent");
break;
}
if (compensationDescription) {
c1 += makeRow(makeColumn(d(localize("Compensation") + ": ") + v(compensationDescription)));
}
}
if (tool.material) {
c1 += makeRow(makeColumn(d(localize("Material") + ": ") + v(getMaterialName(tool.material))));
}
if (tool.description) {
c1 += makeRow(makeColumn(d(localize("Description") + ": ") + v(tool.description)));
}
if (tool.comment) {
c1 += makeRow(makeColumn(d(localize("Comment") + ": ") + v(tool.comment)));
}
if (tool.vendor) {
c1 += makeRow(makeColumn(d(localize("Vendor") + ": ") + v(tool.vendor)));
}
var productLink = getSectionParameterForTool(tool, "operation:tool_productLink");
if (tool.productId || productLink) {
c1 += makeRow(makeColumn(d(localize("Product") + ": ") + v(autoLink(productLink, tool.productId))));
}
if (!getProperty("showTools") && tool.holderDescription) {
c1 += makeRow(makeColumn(d(localize("Holder") + ": ") + v(tool.holderDescription)));
}
// c1 += "
"; // fixed width
// c1 += "
";
return c1;
}
function writeTools() {
writeln("
");
var colgroup = "
";
write(colgroup);
write(makeRow("
" + localize("Tools") + "
"));
var tools = getToolList("number", "lengthOffset");
if (tools.length > 0) {
var numberOfTools = useToolNumber ? tools.length : getNumberOfSections();
for (var i = 0; i < numberOfTools; ++i) {
var tool = useToolNumber ? tools[i].tool : getSection(i).getTool();
var c1 = presentTool(tool);
c1 += "
");
writeln("");
writeln("");
}
function onClose() {
if (getProperty("showOperations")) {
writeln("");
}
// footer
if (getProperty("showFooter")) {
write(" ");
write("");
write("");
}
function quote(text) {
var result = "";
for (var i = 0; i < text.length; ++i) {
var ch = text.charAt(i);
switch (ch) {
case "\\":
case "\"":
result += "\\";
}
result += ch;
}
return "\"" + result + "\"";
}
function onTerminate() {
// add this to print automatically - you could print to XPS and PDF writer
/*
var device = "Microsoft XPS Document Writer";
if (device) {
executeNoWait("rundll32.exe", "mshtml.dll,PrintHTML " + quote(getOutputPath()) + quote(device), false, "");
} else {
executeNoWait("rundll32.exe", "mshtml.dll,PrintHTML " + quote(getOutputPath()), false, "");
}
*/
}