# Phase 16-01 — Fagor FTP Support ## Goal Aggiungere supporto Fagor CNC via FTP a `NcProgramManager`. Riusare pattern Siemens/Mitsubishi (FtpWebRequest + ASCII). Refactor validator per gating per-produttore dei check generic (block 80, no tab, no lowercase, nested parens, comment 32) — applicati ora solo a Fanuc+Mitsubishi (Fagor esente). Estendere CLI con `-manufacturer=fagor`. ## Modelli supportati | Modello | Supporto | Note | |---------|----------|------| | 8055 | Solo con opzione Ethernet | Richiede attivazione server FTP via parametri macchina | | 8060 | Sì | FTP nativo (Windows-based) | | 8065 | Sì | FTP nativo (Windows-based) | | 8070 | Sì | FTP nativo (Windows embedded) | ## Modelli non supportati | Modello | Motivo | |---------|--------| | 8055 base (senza Ethernet) | Solo RS232; protocollo seriale non implementato | | 8025 / 8030 / 8040 / 8050 | Legacy, esclusivamente RS232 | ## Files creati - `Cnc/Fagor/FagorConnectionConfig.cs` - `Cnc/Fagor/IFagorFtpClient.cs` - `Cnc/Fagor/FagorFtpClient.cs` - `Cnc/Fagor/FagorMachine.cs` - `NcProgramManager.Tests/Unit/FagorMachineTests.cs` - `NcProgramManager.Tests/Integration/FagorMachineIntegrationTests.cs` ## Files modificati - `Cnc/Models/CncManufacturer.cs` — enum aggiunto `Fagor` - `Cnc/CncMachineFactory.cs` — case `Fagor` - `Cnc/NcProgramValidator.cs` — refactor gating + case Fagor - `ArgParser.cs` — case `"fagor"` - `Program.cs` — help text - `NcProgramManager.csproj` — 4 `` - `NcProgramManager.Tests/NcProgramManager.Tests.csproj` — 2 `` - `NcProgramManager.Tests/Unit/NcProgramValidatorTests.cs` — 3 test esistenti spostati Siemens → Fanuc, 8 nuovi Fagor - `README.md` — sezione Controller Fagor ## Regole validatore Fagor - Nome programma: max 24 caratteri, no `ñ`, solo lettere/cifre/spazi - Contenuto programma: nessuna restrizione (Fagor permette ISO + linguaggio alto livello) - Check generic (block 80, tab, lowercase, nested parens, comment 32) NON applicati a Fagor ## Funzioni non supportate via FTP - `ReadActiveProgramAsync` — richiede DNC/OPC-UA - `SelectMainProgramAsync` — richiede DNC - `ReadAsync` ritorna `MachineSnapshot` con valori `Unknown` ## Variabili d'ambiente test integration - `FAGOR_TEST_IP` — indirizzo IP macchina (test skippato se assente) - `FAGOR_USER` — username FTP (default `user`) - `FAGOR_PASS` — password FTP (default `pass`)