Got it. I though I'd share some code to do the listing I was talking about above. Not the best code in the world ( new to JS ), but gets the job done.
This is called from on open and lists the tool sequence with the underlying ops per tool with the minimum Z and cycle times.
// formats the tool line in the header to display min Z and CycleTime
function entryFixup( entry, minZ, ct ) {
ct += 0.5;
var d = new Date(1899, 11, 31, 0, 0, ct, 0);
var zCol = 42;
var ctCol = 60;
if ( entry.length < zCol ) {
for( var i = entry.length; i < zCol; ++i ) {
entry += " ";
}
}
entry += "Z : " + zFormat.format( minZ )
if ( entry.length < ctCol ) {
for( var i = entry.length; i < ctCol; ++i ) {
entry += " ";
}
}
entry += "CT: " +
timeFormat.format( d.getHours( ) ) + ":" +
timeFormat.format( d.getMinutes( ) ) + ":" +
timeFormat.format( d.getSeconds( ) );
return entry;
}
/** writes the tool and op info. */
function writeToolInfo() {
var result = [];
var lastToolIndex;
var _maxZ = 1000000;
var minimumZ;
var cycleTime;
var tn_;
var numberOfSections = getNumberOfSections();
for (var i = 0; i < numberOfSections; ++i) {
var section = getSection(i);
// the next tool is up...
if (section.getTool().number != tn_) {
// fix up the last tool entry...on the first iteration tn_ will be empty
if (tn_) {
result[ lastToolIndex ] = entryFixup( result[ lastToolIndex ], minimumZ, cycleTime );
}
cycleTime = 0;
minimumZ = _maxZ;
tn_ = section.getTool().number;
lastToolIndex = result.length;
result.push( new String( "-- tool: " + tn_ + " " + section.getTool().vendor + " " + section.getTool().description ) );
}
if ( is3D( ) ) {
minimumZ = Math.min(minimumZ, section.getGlobalZRange().getMinimum());
}
cycleTime += section.getCycleTime();
// if (properties.rapidFeed > 0) {
// cycleTime += rapidDistance/properties.rapidFeed * 60;
// }
result.push( new String( " op: " + section.getParameter( "operation-comment" ) ) );
}
if ( result.length > 0 ) {
result[ lastToolIndex ] = entryFixup( result[ lastToolIndex ], minimumZ, cycleTime );
}
writeComment("Tool / Op list ...................................................")
for (var i = 0; i < result.length; ++i )
writeComment( result );
}
output looks something like this...
; Tool / Op list ...................................................
; -- tool: 2 SVJBR12-3B Z : -0.02 CT: 00:00:25
; op: face part
; -- tool: 20 #3 Center drill Z : -0.1258 CT: 00:00:03
; op: center drill
; -- tool: 2 SVJBR12-3B Z : -1.9743 CT: 00:06:12
; op: diameter roughing
; op: rear roughing
; op: finish profile
; -- tool: 15 Dorian Slot Grip Z : -1.858 CT: 00:00:10
; op: part-off
I find this useful .. maybe someone else will