Remove console.log statements for weight and filament detection in PrinterClient and PrinterDatabase. Update precision of currentFilamentUsed logging to 8 decimal places. Add placeholder for homeAxis method in PrinterClient.
Some checks failed
farmcontrol/farmcontrol-server/pipeline/head There was a failure building this commit

This commit is contained in:
Tom Butcher 2026-07-26 18:38:15 +01:00
parent 57e0c5a30d
commit db8e035c86
2 changed files with 5 additions and 4 deletions

View File

@ -496,7 +496,6 @@ export class PrinterDatabase {
) { ) {
const subJobId = subJob._id || subJob.id; const subJobId = subJob._id || subJob.id;
const jobId = job._id || job.id; const jobId = job._id || job.id;
console.log("WEIGHT", weight);
try { try {
const filamentStockStockEvents = await this.socketClient.listObjects({ const filamentStockStockEvents = await this.socketClient.listObjects({
objectType: "stockEvent", objectType: "stockEvent",

View File

@ -530,7 +530,6 @@ export class PrinterClient {
// Calculate weight in grams // Calculate weight in grams
const filamentWeightG = const filamentWeightG =
filamentVolumeCm3 * this.currentFilament?.density || 0; filamentVolumeCm3 * this.currentFilament?.density || 0;
console.log("FILAMENT WEIGHT", this.currentFilament);
this.currentFilamentUsed = -1 * filamentWeightG; this.currentFilamentUsed = -1 * filamentWeightG;
} }
@ -699,7 +698,6 @@ export class PrinterClient {
}, },
}); });
if (newFilamentDetected !== this.filamentDetected) { if (newFilamentDetected !== this.filamentDetected) {
console.log(status["filament_switch_sensor fsensor"]);
logger.info( logger.info(
`Printer ${this.printer.name} filament detection changed from ${this.filamentDetected} to ${newFilamentDetected}.`, `Printer ${this.printer.name} filament detection changed from ${this.filamentDetected} to ${newFilamentDetected}.`,
); );
@ -842,7 +840,7 @@ export class PrinterClient {
) { ) {
logger.debug( logger.debug(
"Updating stock event value:", "Updating stock event value:",
this.currentFilamentUsed.toFixed(2), this.currentFilamentUsed.toFixed(8),
); );
this.database.updateFilamentStockWeight( this.database.updateFilamentStockWeight(
this.currentFilamentStock, this.currentFilamentStock,
@ -1332,6 +1330,10 @@ export class PrinterClient {
} }
} }
async homeAxis(axis) {
}
async restartPrinterFirmware() { async restartPrinterFirmware() {
logger.info(`Restarting printer firmware for ${this.printer.name}`); logger.info(`Restarting printer firmware for ${this.printer.name}`);
if (!this.isOnline) { if (!this.isOnline) {