From fb2b55caffcc2055c2c0e86f6a748cf0aaf7404b Mon Sep 17 00:00:00 2001 From: mytec Date: Sat, 31 Jan 2026 19:37:53 +0200 Subject: [PATCH] @mytec: propagation fix2 --- installer/rfcp-debug.bat | 54 +++++++++++++++++++++++++++++ installer/test-coverage.bat | 69 +++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 installer/rfcp-debug.bat create mode 100644 installer/test-coverage.bat diff --git a/installer/rfcp-debug.bat b/installer/rfcp-debug.bat new file mode 100644 index 0000000..b5ca711 --- /dev/null +++ b/installer/rfcp-debug.bat @@ -0,0 +1,54 @@ +@echo off +title RFCP Backend Debug Console +echo ============================================ +echo RFCP Backend - Debug Mode +echo ============================================ +echo. + +:: Kill any running instance +taskkill /F /IM rfcp-server.exe 2>nul +if %ERRORLEVEL% EQU 0 ( + echo [DEBUG] Killed existing rfcp-server.exe + timeout /t 2 /nobreak >nul +) else ( + echo [DEBUG] No existing rfcp-server.exe running +) + +:: Force unbuffered Python output +set PYTHONUNBUFFERED=1 +set RFCP_DEBUG=1 +set RFCP_HOST=127.0.0.1 +set RFCP_PORT=8888 + +echo [DEBUG] PYTHONUNBUFFERED=%PYTHONUNBUFFERED% +echo [DEBUG] RFCP_DEBUG=%RFCP_DEBUG% +echo [DEBUG] RFCP_HOST=%RFCP_HOST% +echo [DEBUG] RFCP_PORT=%RFCP_PORT% +echo. + +:: Check if exe exists in dist/ or current dir +if exist "%~dp0dist\rfcp-server.exe" ( + set EXE_PATH=%~dp0dist\rfcp-server.exe +) else if exist "%~dp0rfcp-server.exe" ( + set EXE_PATH=%~dp0rfcp-server.exe +) else ( + echo [ERROR] rfcp-server.exe not found! + echo Looked in: + echo %~dp0dist\rfcp-server.exe + echo %~dp0rfcp-server.exe + pause + exit /b 1 +) + +echo [DEBUG] Starting: %EXE_PATH% +echo [DEBUG] Working dir: %~dp0dist +echo. +echo ---- Server output below ---- +echo. + +cd /d "%~dp0dist" +"%EXE_PATH%" + +echo. +echo ---- Server stopped ---- +pause diff --git a/installer/test-coverage.bat b/installer/test-coverage.bat new file mode 100644 index 0000000..f1eddba --- /dev/null +++ b/installer/test-coverage.bat @@ -0,0 +1,69 @@ +@echo off +title RFCP Coverage API Test +echo ============================================ +echo RFCP Coverage API Test +echo ============================================ +echo. + +set API=http://127.0.0.1:8888 + +:: Test 1: Health check +echo [TEST 1] Health check... +curl -s -o nul -w "HTTP %%{http_code}" %API%/api/health +echo. +echo. + +:: Test 2: Health details +echo [TEST 2] Health details: +curl -s %API%/api/health +echo. +echo. + +:: Test 3: Coverage - Fast preset, 1 site, 2km radius, 500m resolution (small/quick) +echo [TEST 3] Coverage calculation (Fast preset, 2km radius, 500m res)... +echo This should complete in a few seconds. +echo. + +curl -s -w "\n\nHTTP %%{http_code} - Total time: %%{time_total}s\n" ^ + -X POST %API%/api/coverage/calculate ^ + -H "Content-Type: application/json" ^ + -d "{\"sites\": [{\"lat\": 50.45, \"lon\": 30.52, \"height\": 30, \"power\": 43, \"gain\": 15, \"frequency\": 1800}], \"settings\": {\"radius\": 2000, \"resolution\": 500, \"preset\": \"fast\"}}" ^ + -o coverage-result-fast.json + +echo Result saved to coverage-result-fast.json +echo. + +:: Test 4: Coverage - Standard preset, 5km radius +echo [TEST 4] Coverage calculation (Standard preset, 5km radius, 300m res)... +echo This tests building/material lookups. +echo. + +curl -s -w "\n\nHTTP %%{http_code} - Total time: %%{time_total}s\n" ^ + -X POST %API%/api/coverage/calculate ^ + -H "Content-Type: application/json" ^ + -d "{\"sites\": [{\"lat\": 50.45, \"lon\": 30.52, \"height\": 30, \"power\": 43, \"gain\": 15, \"frequency\": 1800}], \"settings\": {\"radius\": 5000, \"resolution\": 300, \"preset\": \"standard\"}}" ^ + -o coverage-result-standard.json + +echo Result saved to coverage-result-standard.json +echo. + +:: Test 5: Coverage - Detailed preset, 5km radius +echo [TEST 5] Coverage calculation (Detailed preset, 5km radius, 300m res)... +echo This tests dominant path + vegetation. +echo. + +curl -s -w "\n\nHTTP %%{http_code} - Total time: %%{time_total}s\n" ^ + -X POST %API%/api/coverage/calculate ^ + -H "Content-Type: application/json" ^ + -d "{\"sites\": [{\"lat\": 50.45, \"lon\": 30.52, \"height\": 30, \"power\": 43, \"gain\": 15, \"frequency\": 1800}], \"settings\": {\"radius\": 5000, \"resolution\": 300, \"preset\": \"detailed\"}}" ^ + -o coverage-result-detailed.json + +echo Result saved to coverage-result-detailed.json +echo. + +echo ============================================ +echo All tests complete! +echo Check the debug console for timing output. +echo Also check data/coverage-debug.log +echo ============================================ +pause