From 4f301b1652ffdd7a4d8d3006b185293c1bd508dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=20K=C3=BCng?= Date: Mon, 9 Feb 2026 16:06:19 +0100 Subject: [PATCH] feat(web): update quality print advanced and base --- .../upload-form/upload-form.component.html | 6 +++--- .../upload-form/upload-form.component.ts | 14 ++++++++------ .../calculator/services/quote-estimator.service.ts | 12 +++++++++++- frontend/src/assets/i18n/en.json | 6 ++++++ frontend/src/assets/i18n/it.json | 1 + 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.html b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.html index d5a7876..594415a 100644 --- a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.html +++ b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.html @@ -91,9 +91,9 @@ > } @else { } diff --git a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts index c2ec404..4dd76ab 100644 --- a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts +++ b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts @@ -47,10 +47,11 @@ export class UploadFormComponent { { label: 'Alta definizione', value: 'High' } ]; - printSpeeds = [ - { label: 'Slow (High Quality)', value: 'Slow' }, - { label: 'Standard', value: 'Standard' }, - { label: 'Fast (Draft)', value: 'Fast' } + nozzleDiameters = [ + { label: '0.2 mm (+2 CHF)', value: 0.2 }, + { label: '0.4 mm (Standard)', value: 0.4 }, + { label: '0.6 mm (+2 CHF)', value: 0.6 }, + { label: '0.8 mm (+2 CHF)', value: 0.8 } ]; infillPatterns = [ @@ -66,7 +67,7 @@ export class UploadFormComponent { { label: '0.16 mm', value: 0.16 }, { label: '0.20 mm (Standard)', value: 0.20 }, { label: '0.24 mm', value: 0.24 }, - { label: '0.28 mm (Draft - Fast)', value: 0.28 } + { label: '0.28 mm', value: 0.28 } ]; acceptedFormats = '.stl,.3mf,.step,.stp,.obj,.amf,.ply,.igs,.iges'; @@ -76,12 +77,13 @@ export class UploadFormComponent { itemsTouched: [false], // Hack to track touched state for custom items list material: ['PLA', Validators.required], quality: ['Standard', Validators.required], - printSpeed: ['Standard', Validators.required], + // Print Speed removed notes: [''], // Advanced fields // Color removed from global form infillDensity: [20, [Validators.min(0), Validators.max(100)]], layerHeight: [0.2, [Validators.min(0.05), Validators.max(1.0)]], + nozzleDiameter: [0.4, Validators.required], infillPattern: ['grid'], supportEnabled: [false] }); diff --git a/frontend/src/app/features/calculator/services/quote-estimator.service.ts b/frontend/src/app/features/calculator/services/quote-estimator.service.ts index de25a77..e8e3e1c 100644 --- a/frontend/src/app/features/calculator/services/quote-estimator.service.ts +++ b/frontend/src/app/features/calculator/services/quote-estimator.service.ts @@ -13,6 +13,8 @@ export interface QuoteRequest { infillDensity?: number; infillPattern?: string; supportEnabled?: boolean; + layerHeight?: number; + nozzleDiameter?: number; mode: 'easy' | 'advanced'; } @@ -77,6 +79,8 @@ export class QuoteEstimatorService { if (request.infillDensity) formData.append('infill_density', request.infillDensity.toString()); if (request.infillPattern) formData.append('infill_pattern', request.infillPattern); if (request.supportEnabled) formData.append('support_enabled', 'true'); + if (request.layerHeight) formData.append('layer_height', request.layerHeight.toString()); + if (request.nozzleDiameter) formData.append('nozzle_diameter', request.nozzleDiameter.toString()); } const headers: any = {}; @@ -123,7 +127,13 @@ export class QuoteEstimatorService { observer.next(100); // Calculate Results - const setupCost = 10; + // Base setup cost + let setupCost = 10; + + // Surcharge for non-standard nozzle + if (request.nozzleDiameter && request.nozzleDiameter !== 0.4) { + setupCost += 2; + } const items: QuoteItem[] = []; diff --git a/frontend/src/assets/i18n/en.json b/frontend/src/assets/i18n/en.json index 826df25..0566e16 100644 --- a/frontend/src/assets/i18n/en.json +++ b/frontend/src/assets/i18n/en.json @@ -25,6 +25,12 @@ "QUALITY": "Quality", "QUANTITY": "Quantity", "NOTES": "Additional Notes", + "NOZZLE": "Nozzle Diameter", + "INFILL": "Infill (%)", + "PATTERN": "Infill Pattern", + "LAYER_HEIGHT": "Layer Height", + "SUPPORT": "Supports", + "SUPPORT_DESC": "Enable supports for overhangs", "CALCULATE": "Calculate Quote", "RESULT": "Estimated Quote", "TIME": "Print Time", diff --git a/frontend/src/assets/i18n/it.json b/frontend/src/assets/i18n/it.json index 56fad45..d1ee0c5 100644 --- a/frontend/src/assets/i18n/it.json +++ b/frontend/src/assets/i18n/it.json @@ -30,6 +30,7 @@ "INFILL": "Riempimento (%)", "PATTERN": "Pattern di riempimento", "LAYER_HEIGHT": "Altezza Layer", + "NOZZLE": "Diametro Ugello", "SUPPORT": "Supporti", "SUPPORT_DESC": "Abilita supporti per sporgenze", "CALCULATE": "Calcola Preventivo",