feat: FASE 3 - Flusso MeasurementTec (selezione ricetta, esecuzione misure, riepilogo)

Implementazione completa del flusso operativo per il ruolo MeasurementTec:

Blueprint measure.py:
- select_recipe: selezione ricetta con ricerca e barcode
- task_list: lista task con conteggi subtask e allegati
- task_execute: esecuzione misure con numpad, calibro USB, feedback real-time
- task_complete: riepilogo con statistiche pass/fail e export CSV
- API AJAX: lookup-barcode, save-traceability, save-measurement
- Autorizzazione role_required("MeasurementTec") su tutte le route

Componenti riutilizzabili:
- numpad.html/js/css: tastierino numerico touch-friendly con keyboard support
- caliper_status.html + caliper.js: integrazione calibro USB via Web Serial API
- barcode_scanner.html + barcode.js: scansione barcode con html5-qrcode
- measurement_feedback.html: feedback visivo pass/warning/fail in tempo reale
- next_measurement.html: indicatore prossima misurazione
- annotation-viewer.js: visualizzatore canvas con marker su disegni tecnici
- csv-export.js: export CSV con locale italiano (delimitatore ;, decimale ,)

Sicurezza:
- Decoratore role_required(*roles) per autorizzazione basata su ruoli
- CSRF token su tutti i POST AJAX
- |tojson per prevenire XSS su annotations_json
- Validazione input lato client e server

i18n: 23+ nuove chiavi tradotte IT/EN per tutti i template FASE 3

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Adriano
2026-02-07 08:40:58 +01:00
parent edd4580a5a
commit a386986c17
19 changed files with 3905 additions and 16 deletions
@@ -245,3 +245,260 @@ msgstr "Measurement Technician"
msgid "Metrologist"
msgstr "Metrologist"
# Measure - Recipe Selection
msgid "Seleziona Ricetta"
msgstr "Select Recipe"
msgid "Scegli la ricetta di misura da eseguire"
msgstr "Choose the measurement recipe to execute"
msgid "Scansiona Barcode"
msgstr "Scan Barcode"
msgid "Cerca ricetta"
msgstr "Search recipe"
msgid "Nome, codice o descrizione..."
msgstr "Name, code or description..."
msgid "Numero Lotto"
msgstr "Lot Number"
msgid "Numero Seriale"
msgstr "Serial Number"
msgid "Opzionale"
msgstr "Optional"
msgid "ricette trovate"
msgstr "recipes found"
msgid "Nessuna descrizione disponibile"
msgstr "No description available"
msgid "Seleziona"
msgstr "Select"
msgid "Nessuna ricetta trovata"
msgstr "No recipe found"
msgid "Nessun risultato per"
msgstr "No results for"
msgid "Prova con un termine diverso."
msgstr "Try a different search term."
msgid "Non ci sono ricette disponibili al momento."
msgstr "No recipes available at the moment."
msgid "Inserisci o scansiona il codice della ricetta per selezionarla automaticamente."
msgstr "Enter or scan the recipe code to select it automatically."
msgid "Codice Ricetta"
msgstr "Recipe Code"
msgid "Es. REC-001"
msgstr "E.g. REC-001"
msgid "Cerca"
msgstr "Search"
# Measure - Task List
msgid "Lotto"
msgstr "Lot"
msgid "Seriale"
msgstr "Serial"
msgid "Task da eseguire"
msgstr "Tasks to execute"
msgid "Task"
msgstr "Task"
msgid "misurazioni"
msgstr "measurements"
msgid "Allegato"
msgstr "Attachment"
msgid "Inizia Misure"
msgstr "Start Measurements"
msgid "Nessun task disponibile"
msgstr "No tasks available"
msgid "Questa ricetta non ha ancora task definiti."
msgstr "This recipe has no tasks defined yet."
msgid "Seleziona altra ricetta"
msgstr "Select another recipe"
msgid "misurazioni totali"
msgstr "total measurements"
# Measure - Task Execute
msgid "Task di misurazione"
msgstr "Measurement task"
msgid "Disegno Tecnico"
msgstr "Technical Drawing"
msgid "attivo"
msgstr "active"
msgid "Visualizzatore PDF"
msgstr "PDF Viewer"
msgid "In fase di sviluppo"
msgstr "Under development"
msgid "Apri PDF"
msgstr "Open PDF"
msgid "Nessuna immagine allegata"
msgstr "No image attached"
msgid "Segui le istruzioni nella direttiva"
msgstr "Follow the instructions in the directive"
msgid "Misurazione"
msgstr "Measurement"
msgid "Nominale"
msgstr "Nominal"
msgid "Misura"
msgstr "Measure"
msgid "Misurazione registrata"
msgstr "Measurement recorded"
msgid "Salvataggio..."
msgstr "Saving..."
msgid "Riepilogo"
msgstr "Summary"
msgid "Misurazioni Complete"
msgstr "Measurements Complete"
msgid "Tutte le"
msgstr "All"
msgid "misurazioni sono state registrate."
msgstr "measurements have been recorded."
msgid "Conformi"
msgstr "Pass"
msgid "Non Conf."
msgstr "Fail"
msgid "Vai al Riepilogo"
msgstr "Go to Summary"
msgid "Errore nel salvataggio della misurazione"
msgstr "Error saving measurement"
msgid "Errore di rete. Riprovare."
msgstr "Network error. Please retry."
# Measure - API Errors
msgid "Errore nel caricamento delle ricette: %(detail)s"
msgstr "Error loading recipes: %(detail)s"
msgid "Ricetta non trovata: %(detail)s"
msgstr "Recipe not found: %(detail)s"
msgid "Errore nel caricamento dei task: %(detail)s"
msgstr "Error loading tasks: %(detail)s"
msgid "Task non trovato: %(detail)s"
msgstr "Task not found: %(detail)s"
msgid "Codice non fornito"
msgstr "Code not provided"
msgid "Ricetta non trovata"
msgstr "Recipe not found"
msgid "Dati mancanti: subtask_id, task_id e value sono obbligatori"
msgstr "Missing data: subtask_id, task_id and value are required"
msgid "Errore nel salvataggio"
msgstr "Error saving"
# Task Complete Page
msgid "Codice"
msgstr "Code"
msgid "Nome"
msgstr "Name"
msgid "Versione"
msgstr "Version"
msgid "Totale"
msgstr "Total"
msgid "Dettaglio Misurazioni"
msgstr "Measurement Details"
msgid "Esporta CSV"
msgstr "Export CSV"
msgid "Descrizione"
msgstr "Description"
msgid "Deviazione"
msgstr "Deviation"
msgid "Esito"
msgstr "Result"
msgid "Metodo"
msgstr "Method"
msgid "Pass"
msgstr "Pass"
msgid "Warning"
msgstr "Warning"
msgid "Fail"
msgstr "Fail"
msgid "Manuale"
msgstr "Manual"
msgid "Calibro"
msgstr "Caliper"
msgid "Ripeti misurazioni"
msgstr "Repeat Measurements"
# Measurement Feedback
msgid "CONFORME"
msgstr "CONFORMING"
msgid "ATTENZIONE"
msgstr "WARNING"
msgid "NON CONFORME"
msgstr "NON-CONFORMING"
# Caliper Status
msgid "Connessione..."
msgstr "Connecting..."
msgid "Errore calibro"
msgstr "Caliper Error"
msgid "Browser non supporta Web Serial API"
msgstr "Browser does not support Web Serial API"
# Recipe Selection Additional
msgid "Errore di connessione"
msgstr "Connection Error"