feat(): new feature

This commit is contained in:
2026-01-29 15:59:08 +01:00
parent e9cca3daeb
commit c365b4fa6b
17 changed files with 617 additions and 83 deletions

View File

@@ -47,24 +47,24 @@
<div class="params-form">
<h3>Print Settings</h3>
<div class="form-group">
<label>Machine</label>
<select [(ngModel)]="params.machine">
<option *ngFor="let m of machines" [value]="m">{{ m }}</option>
</select>
</div>
<div class="form-group">
<label>Material</label>
<select [(ngModel)]="params.filament">
<option *ngFor="let f of filaments" [value]="f">{{ f }}</option>
<option *ngFor="let m of materialOptions" [value]="m.value">{{ m.label }}</option>
</select>
</div>
<div class="form-group">
<label>Quality / Process</label>
<label>Color</label>
<select [(ngModel)]="params.material_color">
<option *ngFor="let c of colorOptions" [value]="c">{{ c }}</option>
</select>
</div>
<div class="form-group">
<label>Quality</label>
<select [(ngModel)]="params.quality">
<option *ngFor="let q of qualities" [value]="q">{{ q }}</option>
<option *ngFor="let q of qualityOptions" [value]="q.value">{{ q.label }}</option>
</select>
</div>
@@ -75,6 +75,13 @@
<span>{{ params.infill_density }}%</span>
</div>
</div>
<div class="form-group">
<label>Infill Pattern</label>
<select [(ngModel)]="params.infill_pattern">
<option *ngFor="let p of infillPatternOptions" [value]="p.value">{{ p.label }}</option>
</select>
</div>
</div>
<div class="actions">
@@ -92,7 +99,7 @@
<div class="card result-card">
<h2>Estimated Cost</h2>
<div class="price-big">
{{ quoteResult?.cost?.total | currency:'EUR' }}
{{ quoteResult?.cost?.total | currency:'CHF' }}
</div>
<div class="specs-list">
@@ -104,10 +111,6 @@
<span>Material Weight</span>
<strong>{{ quoteResult?.material_grams | number:'1.0-0' }}g</strong>
</div>
<div class="spec-item">
<span>Printer</span>
<strong>{{ quoteResult?.printer }}</strong>
</div>
</div>
<!-- Param Summary (Future Proofing) -->
@@ -118,13 +121,21 @@
<span>{{ params.infill_density }}%</span>
</div>
<div class="spec-item compact">
<span>Layer Height</span>
<span>{{ params.layer_height || 'Standard' }}</span>
<span>Infill Pattern</span>
<span>{{ infillPatternLabel }}</span>
</div>
<div class="spec-item compact">
<span>Material</span>
<span>{{ materialLabel }}</span>
</div>
<div class="spec-item compact">
<span>Color</span>
<span>{{ params.material_color }}</span>
</div>
</div>
<div class="note-box">
<p>Note: Advanced parameters are saved for review but estimation currently uses standard profile benchmarks.</p>
<p>Note: Color does not affect the estimate. Printer is fixed to Bambu Lab A1.</p>
</div>
</div>
</div>

View File

@@ -141,6 +141,7 @@
}
}
.range-wrapper {
display: flex;
align-items: center;

View File

@@ -1,4 +1,4 @@
import { Component, inject, OnInit } from '@angular/core';
import { Component, inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink } from '@angular/router';
import { FormsModule } from '@angular/forms';
@@ -12,7 +12,7 @@ import { StlViewerComponent } from '../../common/stl-viewer/stl-viewer.component
templateUrl: './advanced-quote.component.html',
styleUrls: ['./advanced-quote.component.scss']
})
export class AdvancedQuoteComponent implements OnInit {
export class AdvancedQuoteComponent {
printService = inject(PrintService);
selectedFile: File | null = null;
@@ -20,27 +20,56 @@ export class AdvancedQuoteComponent implements OnInit {
isCalculating = false;
quoteResult: any = null;
// Available Profiles
machines: string[] = [];
filaments: string[] = [];
qualities: string[] = [];
// Selectable options (mapped to backend profile ids where needed)
readonly materialOptions = [
{ value: 'pla_basic', label: 'PLA' },
{ value: 'petg_basic', label: 'PETG' },
{ value: 'abs_basic', label: 'ABS' },
{ value: 'tpu_95a', label: 'TPU 95A' }
];
readonly colorOptions = [
'Black',
'White',
'Gray',
'Red',
'Blue',
'Green',
'Yellow'
];
readonly qualityOptions = [
{ value: 'draft', label: 'Draft' },
{ value: 'standard', label: 'Standard' },
{ value: 'fine', label: 'Fine' }
];
readonly infillPatternOptions = [
{ value: 'grid', label: 'Grid' },
{ value: 'gyroid', label: 'Gyroid' },
{ value: 'cubic', label: 'Cubic' },
{ value: 'triangles', label: 'Triangles' },
{ value: 'rectilinear', label: 'Rectilinear' },
{ value: 'crosshatch', label: 'Crosshatch' },
{ value: 'zig-zag', label: 'Zig-zag' },
{ value: 'alignedrectilinear', label: 'Aligned Rectilinear' }
];
// Parameters
params = {
machine: 'bambu_a1',
filament: 'pla_basic',
material_color: 'Black',
quality: 'standard',
layer_height: null,
infill_density: 15,
infill_pattern: 'grid',
support_enabled: false
};
ngOnInit() {
this.printService.getProfiles().subscribe(data => {
this.machines = data.machines;
this.filaments = data.filaments;
this.qualities = data.processes;
});
get materialLabel(): string {
const match = this.materialOptions.find(option => option.value === this.params.filament);
return match ? match.label : this.params.filament;
}
get infillPatternLabel(): string {
const match = this.infillPatternOptions.find(option => option.value === this.params.infill_pattern);
return match ? match.label : this.params.infill_pattern;
}
onDragOver(event: DragEvent) {
@@ -92,10 +121,10 @@ export class AdvancedQuoteComponent implements OnInit {
// Use PrintService
this.printService.calculateQuote(this.selectedFile, {
machine: this.params.machine,
filament: this.params.filament,
quality: this.params.quality,
infill_density: this.params.infill_density,
infill_pattern: this.params.infill_pattern,
// Optional mappings if user selected overrides
// layer_height: this.params.layer_height,
// support_enabled: this.params.support_enabled