Line Numbers (Solved)
Posted: Sat Oct 26, 2013 3:05 pm
Is it possible to turn off line numbering? This is not needed with LinuxCNC.
Thanks
JT
Thanks
JT
Code: Select all
Lcnc_Mill.prototype.writeLine = function(custom, append) {
var line = "";
if (!isNull(custom)) {
line = this.getLineNumberCode();
line = this.append(line, custom);
CamExporter.prototype.writeLine.call(this, line);
return;
}
var gotModeChange = this.gotModeChange(this.g);
var gotXMove = this.gotXMove(this.x);
var gotYMove = this.gotYMove(this.y);
var gotZMove = this.gotZMove(this.z);
var gotFeedrateChange = this.gotFeedrateChange(this.f);
// nothing to do:
if (this.g!==GCode.Mode.CircularCW && this.g!==GCode.Mode.CircularCCW &&
!gotXMove && !gotYMove && !gotZMove && !gotFeedrateChange) {
return;
}
// line = this.getLineNumberCode();
switch (this.g) {
case GCode.Mode.Rapid:
if (gotModeChange) {
line = this.append(line, this.getRapidMoveCode());
}
break;
case GCode.Mode.Normal:
if (gotModeChange) {
line = this.append(line, this.getLinearMoveCode());
}
break;
case GCode.Mode.CircularCW:
line = this.append(line, this.getCircularCWMoveCode());
break;
case GCode.Mode.CircularCCW:
line = this.append(line, this.getCircularCCWMoveCode());
break;
}
Code: Select all
Lcnc_Mill.prototype.writeLine = function(custom, append) {
var line = "";
if (!isNull(custom)) {
// line = this.getLineNumberCode();
line = this.append(line, custom);
CamExporter.prototype.writeLine.call(this, line);
return;
}
var gotModeChange = this.gotModeChange(this.g);
var gotXMove = this.gotXMove(this.x);
var gotYMove = this.gotYMove(this.y);
var gotZMove = this.gotZMove(this.z);
var gotFeedrateChange = this.gotFeedrateChange(this.f);
// nothing to do:
if (this.g!==GCode.Mode.CircularCW && this.g!==GCode.Mode.CircularCCW &&
!gotXMove && !gotYMove && !gotZMove && !gotFeedrateChange) {
return;
}
// line = this.getLineNumberCode();
switch (this.g) {
case GCode.Mode.Rapid:
if (gotModeChange) {
line = this.append(line, this.getRapidMoveCode());
}
break;
case GCode.Mode.Normal:
if (gotModeChange) {
line = this.append(line, this.getLinearMoveCode());
}
break;
case GCode.Mode.CircularCW:
line = this.append(line, this.getCircularCWMoveCode());
break;
case GCode.Mode.CircularCCW:
line = this.append(line, this.getCircularCCWMoveCode());
break;
}
if (gotXMove || this.g===GCode.Mode.CircularCW || this.g===GCode.Mode.CircularCCW) {
line = this.append(line, this.getXCode(this.x));
}
if (gotYMove || this.g===GCode.Mode.CircularCW || this.g===GCode.Mode.CircularCCW) {
line = this.append(line, this.getYCode(this.y));
}
if (gotZMove) {
line = this.append(line, this.getZCode(this.z));
}
if (gotFeedrateChange) {
line = this.append(line, this.getFCode(this.f));
}
if (this.g===GCode.Mode.CircularCW || this.g===GCode.Mode.CircularCCW) {
line = this.append(line, this.getICode(this.i));
line = this.append(line, this.getJCode(this.j));
}
if (!isNull(append)) {
line = this.append(line, append);
}
CamExporter.prototype.writeLine.call(this, line);
//this.lineNumber += 10;
this.xPrev = this.x;
this.yPrev = this.y;
this.zPrev = this.z;
this.fPrev = this.f;
this.gPrev = this.g;
};
Lcnc_Mill.prototype.getLineNumberCode = function() { return ""; };