diff --git a/backend/src/main/java/com/printcalculator/controller/QuoteSessionController.java b/backend/src/main/java/com/printcalculator/controller/QuoteSessionController.java index 78d0528..c67e2ec 100644 --- a/backend/src/main/java/com/printcalculator/controller/QuoteSessionController.java +++ b/backend/src/main/java/com/printcalculator/controller/QuoteSessionController.java @@ -129,11 +129,13 @@ public class QuoteSessionController { .orElseThrow(() -> new RuntimeException("No active printer found")); // 2. Pick Profiles - String machineProfile = machine.getPrinterDisplayName(); // e.g. "Bambu Lab A1 0.4 nozzle" - // If the display name doesn't match the json profile name, we might need a mapping key in DB. - // For now assuming display name works or we use a tough default - machineProfile = "Bambu Lab A1 0.4 nozzle"; // Force known good for now? Or use DB field if exists. - // Ideally: machine.getSlicerProfileName(); + String machineProfile = machine.getSlicerMachineProfile(); + if (machineProfile == null || machineProfile.isBlank()) { + machineProfile = machine.getPrinterDisplayName(); // e.g. "Bambu Lab A1 0.4 nozzle" + } + if (machineProfile == null || machineProfile.isBlank()) { + machineProfile = "bambu_a1"; // final fallback (alias handled in ProfileManager) + } String filamentProfile = "Generic " + (settings.getMaterial() != null ? settings.getMaterial().toUpperCase() : "PLA"); // Mapping: "pla_basic" -> "Generic PLA", "petg_basic" -> "Generic PETG" diff --git a/backend/src/main/java/com/printcalculator/service/SlicerService.java b/backend/src/main/java/com/printcalculator/service/SlicerService.java index 47d3e58..9af77e8 100644 --- a/backend/src/main/java/com/printcalculator/service/SlicerService.java +++ b/backend/src/main/java/com/printcalculator/service/SlicerService.java @@ -103,7 +103,7 @@ public class SlicerService { command.add(localStl.getAbsolutePath()); - logger.info("Executing Slicer for Bambu Lab A1 on: " + localStl.getAbsolutePath()); + logger.info("Executing Slicer for " + machineName + " on: " + localStl.getAbsolutePath()); runSlicerCommand(command, tempDir);