Windows batch harness + extensive IT README for on-site Mitsubishi CNC testing. Covers connect/invia/scarica/validator/offset/param scenarios. Documents C1-C8 criticità found in code review: - path mapping mismatch (download /PRG/<int> vs upload relative <path>/<name>) - Standardize leading \n may trip validator first-line gate - hardcoded /PRG/ ProgramDirectory, no CLI override - Int16 -path limit, ASCII-only FTP, plaintext credentials Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
27 lines
1.2 KiB
Batchfile
27 lines
1.2 KiB
Batchfile
@echo off
|
|
REM ============================================================
|
|
REM T03 - VALIDATORE pre-invio (gating)
|
|
REM Tenta l'invio di 4 programmi non conformi + 1 valido.
|
|
REM Attesi (regole Fanuc/Mitsubishi in NcProgramValidator):
|
|
REM O0001_valid -> Errore:0 (ma vedi criticita C4)
|
|
REM O0002_lowercase -> -204 "Lowercase letters not allowed"
|
|
REM O0003_brackets -> -204 "Forbidden char '['/']'"
|
|
REM O0004_longblock -> -204 "Block length > 80 chars"
|
|
REM no_header -> -202 (GetProgramTitle eccezione: nessun O####)
|
|
REM Verificare che il validatore BLOCCHI prima di scrivere su CNC.
|
|
REM ============================================================
|
|
setlocal enabledelayedexpansion
|
|
call "%~dp0config.bat"
|
|
if not exist "%RESULTS%" mkdir "%RESULTS%"
|
|
set LOG=%RESULTS%\t03_validatore.log
|
|
echo === T03 VALIDATORE === > "%LOG%"
|
|
|
|
for %%F in (O0001_valid O0002_lowercase O0003_brackets O0004_longblock no_header) do (
|
|
echo. >> "%LOG%"
|
|
echo ----- INVIO %%F ----- >> "%LOG%"
|
|
"%EXE%" -manufacturer=mitsubishi -azione=Invia -ip=%IP% -porta=%PORT% -username=%USER% -password=%PASS% -path=%PROGNUM% -pathprogramma=%~dp0samples\%%F.nc >> "%LOG%" 2>&1
|
|
echo EXITCODE %%F = !ERRORLEVEL! >> "%LOG%"
|
|
)
|
|
echo Log: %LOG%
|
|
type "%LOG%"
|
|
endlocal
|