produzione 1 #9

Merged
JoeKung merged 135 commits from dev into main 2026-03-03 09:58:04 +01:00
5 changed files with 29 additions and 10 deletions
Showing only changes of commit 4f301b1652 - Show all commits

View File

@@ -91,9 +91,9 @@
></app-select> ></app-select>
} @else { } @else {
<app-select <app-select
formControlName="printSpeed" formControlName="nozzleDiameter"
[label]="'CALC.PRINT_SPEED' | translate" [label]="'CALC.NOZZLE' | translate"
[options]="printSpeeds" [options]="nozzleDiameters"
></app-select> ></app-select>
} }
</div> </div>

View File

@@ -47,10 +47,11 @@ export class UploadFormComponent {
{ label: 'Alta definizione', value: 'High' } { label: 'Alta definizione', value: 'High' }
]; ];
printSpeeds = [ nozzleDiameters = [
{ label: 'Slow (High Quality)', value: 'Slow' }, { label: '0.2 mm (+2 CHF)', value: 0.2 },
{ label: 'Standard', value: 'Standard' }, { label: '0.4 mm (Standard)', value: 0.4 },
{ label: 'Fast (Draft)', value: 'Fast' } { label: '0.6 mm (+2 CHF)', value: 0.6 },
{ label: '0.8 mm (+2 CHF)', value: 0.8 }
]; ];
infillPatterns = [ infillPatterns = [
@@ -66,7 +67,7 @@ export class UploadFormComponent {
{ label: '0.16 mm', value: 0.16 }, { label: '0.16 mm', value: 0.16 },
{ label: '0.20 mm (Standard)', value: 0.20 }, { label: '0.20 mm (Standard)', value: 0.20 },
{ label: '0.24 mm', value: 0.24 }, { 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'; 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 itemsTouched: [false], // Hack to track touched state for custom items list
material: ['PLA', Validators.required], material: ['PLA', Validators.required],
quality: ['Standard', Validators.required], quality: ['Standard', Validators.required],
printSpeed: ['Standard', Validators.required], // Print Speed removed
notes: [''], notes: [''],
// Advanced fields // Advanced fields
// Color removed from global form // Color removed from global form
infillDensity: [20, [Validators.min(0), Validators.max(100)]], infillDensity: [20, [Validators.min(0), Validators.max(100)]],
layerHeight: [0.2, [Validators.min(0.05), Validators.max(1.0)]], layerHeight: [0.2, [Validators.min(0.05), Validators.max(1.0)]],
nozzleDiameter: [0.4, Validators.required],
infillPattern: ['grid'], infillPattern: ['grid'],
supportEnabled: [false] supportEnabled: [false]
}); });

View File

@@ -13,6 +13,8 @@ export interface QuoteRequest {
infillDensity?: number; infillDensity?: number;
infillPattern?: string; infillPattern?: string;
supportEnabled?: boolean; supportEnabled?: boolean;
layerHeight?: number;
nozzleDiameter?: number;
mode: 'easy' | 'advanced'; mode: 'easy' | 'advanced';
} }
@@ -77,6 +79,8 @@ export class QuoteEstimatorService {
if (request.infillDensity) formData.append('infill_density', request.infillDensity.toString()); if (request.infillDensity) formData.append('infill_density', request.infillDensity.toString());
if (request.infillPattern) formData.append('infill_pattern', request.infillPattern); if (request.infillPattern) formData.append('infill_pattern', request.infillPattern);
if (request.supportEnabled) formData.append('support_enabled', 'true'); 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 = {}; const headers: any = {};
@@ -123,7 +127,13 @@ export class QuoteEstimatorService {
observer.next(100); observer.next(100);
// Calculate Results // 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[] = []; const items: QuoteItem[] = [];

View File

@@ -25,6 +25,12 @@
"QUALITY": "Quality", "QUALITY": "Quality",
"QUANTITY": "Quantity", "QUANTITY": "Quantity",
"NOTES": "Additional Notes", "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", "CALCULATE": "Calculate Quote",
"RESULT": "Estimated Quote", "RESULT": "Estimated Quote",
"TIME": "Print Time", "TIME": "Print Time",

View File

@@ -30,6 +30,7 @@
"INFILL": "Riempimento (%)", "INFILL": "Riempimento (%)",
"PATTERN": "Pattern di riempimento", "PATTERN": "Pattern di riempimento",
"LAYER_HEIGHT": "Altezza Layer", "LAYER_HEIGHT": "Altezza Layer",
"NOZZLE": "Diametro Ugello",
"SUPPORT": "Supporti", "SUPPORT": "Supporti",
"SUPPORT_DESC": "Abilita supporti per sporgenze", "SUPPORT_DESC": "Abilita supporti per sporgenze",
"CALCULATE": "Calcola Preventivo", "CALCULATE": "Calcola Preventivo",