produzione 1 #9

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

View File

@@ -83,11 +83,19 @@
[options]="materials" [options]="materials"
></app-select> ></app-select>
<app-select @if (mode() === 'easy') {
formControlName="quality" <app-select
[label]="'CALC.QUALITY' | translate" formControlName="quality"
[options]="qualities" [label]="'CALC.QUALITY' | translate"
></app-select> [options]="qualities"
></app-select>
} @else {
<app-select
formControlName="printSpeed"
[label]="'CALC.PRINT_SPEED' | translate"
[options]="printSpeeds"
></app-select>
}
</div> </div>
<!-- Global quantity removed, now per item --> <!-- Global quantity removed, now per item -->
@@ -99,6 +107,12 @@
[label]="'CALC.PATTERN' | translate" [label]="'CALC.PATTERN' | translate"
[options]="infillPatterns" [options]="infillPatterns"
></app-select> ></app-select>
<app-select
formControlName="layerHeight"
[label]="'CALC.LAYER_HEIGHT' | translate"
[options]="layerHeights"
></app-select>
</div> </div>
<div class="grid"> <div class="grid">

View File

@@ -47,6 +47,12 @@ export class UploadFormComponent {
{ label: 'Alta definizione', value: 'High' } { label: 'Alta definizione', value: 'High' }
]; ];
printSpeeds = [
{ label: 'Slow (High Quality)', value: 'Slow' },
{ label: 'Standard', value: 'Standard' },
{ label: 'Fast (Draft)', value: 'Fast' }
];
infillPatterns = [ infillPatterns = [
{ label: 'Grid', value: 'grid' }, { label: 'Grid', value: 'grid' },
{ label: 'Gyroid', value: 'gyroid' }, { label: 'Gyroid', value: 'gyroid' },
@@ -54,6 +60,15 @@ export class UploadFormComponent {
{ label: 'Triangles', value: 'triangles' } { label: 'Triangles', value: 'triangles' }
]; ];
layerHeights = [
{ label: '0.08 mm', value: 0.08 },
{ label: '0.12 mm (High Quality - Slow)', value: 0.12 },
{ 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 }
];
acceptedFormats = '.stl,.3mf,.step,.stp,.obj,.amf,.ply,.igs,.iges'; acceptedFormats = '.stl,.3mf,.step,.stp,.obj,.amf,.ply,.igs,.iges';
constructor(private fb: FormBuilder) { constructor(private fb: FormBuilder) {
@@ -61,10 +76,12 @@ 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],
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)]],
infillPattern: ['grid'], infillPattern: ['grid'],
supportEnabled: [false] supportEnabled: [false]
}); });

View File

@@ -2,14 +2,14 @@
@if (label()) { <label [for]="id()">{{ label() }}</label> } @if (label()) { <label [for]="id()">{{ label() }}</label> }
<select <select
[id]="id()" [id]="id()"
[value]="value" [ngModel]="value"
(change)="onSelect($event)" (ngModelChange)="onModelChange($event)"
(blur)="onTouched()" (blur)="onTouched()"
[disabled]="disabled" [disabled]="disabled"
class="form-control" class="form-control"
> >
@for (opt of options(); track opt.value) { @for (opt of options(); track opt.label) {
<option [value]="opt.value">{{ opt.label }}</option> <option [ngValue]="opt.value">{{ opt.label }}</option>
} }
</select> </select>
@if (error()) { <span class="error-text">{{ error() }}</span> } @if (error()) { <span class="error-text">{{ error() }}</span> }

View File

@@ -1,11 +1,11 @@
import { Component, input, output, forwardRef } from '@angular/core'; import { Component, input, output, forwardRef } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
@Component({ @Component({
selector: 'app-select', selector: 'app-select',
standalone: true, standalone: true,
imports: [CommonModule, ReactiveFormsModule], imports: [CommonModule, ReactiveFormsModule, FormsModule],
providers: [ providers: [
{ {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
@@ -33,9 +33,8 @@ export class AppSelectComponent implements ControlValueAccessor {
registerOnTouched(fn: any): void { this.onTouched = fn; } registerOnTouched(fn: any): void { this.onTouched = fn; }
setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; } setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; }
onSelect(event: Event) { onModelChange(val: any) {
const val = (event.target as HTMLSelectElement).value; this.value = val;
this.value = val; this.onChange(val);
this.onChange(val);
} }
} }

View File

@@ -17,17 +17,19 @@
"CTA_START": "Inizia Ora", "CTA_START": "Inizia Ora",
"BUSINESS": "Aziende", "BUSINESS": "Aziende",
"PRIVATE": "Privati", "PRIVATE": "Privati",
"MODE_EASY": "Rapida", "MODE_EASY": "Base",
"MODE_ADVANCED": "Avanzata", "MODE_ADVANCED": "Avanzata",
"UPLOAD_LABEL": "Trascina il tuo file 3D qui", "UPLOAD_LABEL": "Trascina il tuo file 3D qui",
"UPLOAD_SUB": "Supportiamo STL, 3MF, STEP, OBJ fino a 50MB", "UPLOAD_SUB": "Supportiamo STL, 3MF, STEP, OBJ fino a 50MB",
"MATERIAL": "Materiale", "MATERIAL": "Materiale",
"QUALITY": "Qualità", "QUALITY": "Qualità",
"PRINT_SPEED": "Velocità di Stampa",
"QUANTITY": "Quantità", "QUANTITY": "Quantità",
"NOTES": "Note aggiuntive", "NOTES": "Note aggiuntive",
"COLOR": "Colore", "COLOR": "Colore",
"INFILL": "Riempimento (%)", "INFILL": "Riempimento (%)",
"PATTERN": "Pattern di riempimento", "PATTERN": "Pattern di riempimento",
"LAYER_HEIGHT": "Altezza Layer",
"SUPPORT": "Supporti", "SUPPORT": "Supporti",
"SUPPORT_DESC": "Abilita supporti per sporgenze", "SUPPORT_DESC": "Abilita supporti per sporgenze",
"CALCULATE": "Calcola Preventivo", "CALCULATE": "Calcola Preventivo",