mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-22 03:49:18 +02:00
Raise the chamber-temperature ceiling from 60 to 65 C
Every field that takes a chamber target stopped at 60: the per-filament chamber map and per-print override in Preheat & Heat Soak, the chamber quick-select presets, and the printer-card chamber control. 60 is the X1E's ceiling and the X1E was the only heated-chamber model when that limit was written; the H2 series and X2D heat to 65, so the top of their range was unreachable. The ceiling now lives in one constant per side (MAX_CHAMBER_TEMP_C in backend/app/utils/printer_models.py and frontend/src/utils/printer.ts) rather than as a literal at each call site. X1E firmware clamps a higher request to its own maximum, so a shared ceiling is safe. Also fixes a live bug at PrintersPage.tsx:7985: parsePresetTriple was bounded to 60 there, and it rejects the whole triple on any out-of-range entry, so a saved 65 preset would have silently reverted the printer card to the defaults while Settings still showed 65.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
// are chamber-temperature recommendations from BambuStudio's bundled filament
|
||||
// profiles; users can override the whole map via the Settings → Workflow card.
|
||||
|
||||
import { MAX_CHAMBER_TEMP_C } from './printer';
|
||||
|
||||
export const DEFAULT_PREHEAT_FILAMENT_TARGETS: Record<string, number> = {
|
||||
PLA: 0,
|
||||
PETG: 0,
|
||||
@@ -44,7 +46,7 @@ export function parsePreheatFilamentTargets(raw: string): Record<string, number>
|
||||
for (const [key, value] of Object.entries(parsed)) {
|
||||
const num = typeof value === 'number' ? value : Number(value);
|
||||
if (Number.isFinite(num)) {
|
||||
out[key] = Math.max(0, Math.min(60, Math.round(num)));
|
||||
out[key] = Math.max(0, Math.min(MAX_CHAMBER_TEMP_C, Math.round(num)));
|
||||
}
|
||||
}
|
||||
if (out.default === undefined) out.default = DEFAULT_PREHEAT_FILAMENT_TARGETS.default;
|
||||
|
||||
@@ -18,6 +18,14 @@ export function getPrinterImage(model: string | null | undefined): string {
|
||||
return '/img/printers/default.png';
|
||||
}
|
||||
|
||||
// Ceiling for every chamber-temperature target the UI accepts (manual set,
|
||||
// preheat filament map, per-item preheat override, chamber quick-select
|
||||
// presets). Mirrors backend MAX_CHAMBER_TEMP_C in
|
||||
// backend/app/utils/printer_models.py — keep the two in sync. The H2 series
|
||||
// (H2C / H2D / H2D Pro / H2S) and X2D heat the chamber to 65 °C; X1E tops out
|
||||
// at 60 and its firmware clamps anything higher.
|
||||
export const MAX_CHAMBER_TEMP_C = 65;
|
||||
|
||||
// G-code interchange families (#2578). Mirrors backend GCODE_COMPAT_FAMILIES
|
||||
// in backend/app/utils/printer_models.py — keep the two in sync. A sliced 3MF
|
||||
// may target a different model ONLY within its family; everything else is
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
* is not part of the configurable triple.
|
||||
*/
|
||||
|
||||
import { MAX_CHAMBER_TEMP_C } from './printer';
|
||||
|
||||
export type PresetTriple = readonly [number, number, number];
|
||||
|
||||
export const NOZZLE_TEMP_DEFAULTS: PresetTriple = [120, 220, 260];
|
||||
@@ -28,7 +30,7 @@ export interface PresetCategory {
|
||||
export const PRESET_CATEGORIES: readonly PresetCategory[] = [
|
||||
{ key: 'nozzle_temp_presets', defaults: NOZZLE_TEMP_DEFAULTS, lo: 0, hi: 320, unit: 'C' },
|
||||
{ key: 'bed_temp_presets', defaults: BED_TEMP_DEFAULTS, lo: 0, hi: 140, unit: 'C' },
|
||||
{ key: 'chamber_temp_presets', defaults: CHAMBER_TEMP_DEFAULTS, lo: 0, hi: 60, unit: 'C' },
|
||||
{ key: 'chamber_temp_presets', defaults: CHAMBER_TEMP_DEFAULTS, lo: 0, hi: MAX_CHAMBER_TEMP_C, unit: 'C' },
|
||||
{ key: 'fan_speed_presets', defaults: FAN_SPEED_DEFAULTS, lo: 0, hi: 100, unit: '%' },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user