# Configuration

Application settings are loaded from classpath properties files in `src/main/resources/config`.

## `application.properties`

| Key | Purpose | Current Default |
|---|---|---|
| `app.mode` | Generic mode flag | `test` |
| `streaming.url` | Initial URL for pixel streaming view | `http://localhost` |
| `python.path` | Python interpreter for simulator process | `C:\\Program Files\\PyManager\\python.exe` |
| `mqtt.broker.url` | MQTT broker connection URL | `tcp://localhost:1883` |
| `mqtt.client.id` | MQTT client identifier | `JavaClientPublisherSubscriber` |
| `mqtt.topic` | MQTT topic to subscribe to | `PREDICTION` |
| `mqtt_sim.enabled` | Enables simulator startup | `false` |
| `mqtt_sim.script` | Simulator script path | `src/main/resources/scripts/mqtt_simulator.py` |
| `mqtt_sim.broker` | Simulator broker override (env passthrough) | `localhost` |
| `mqtt_sim.port` | Simulator broker port override | `1883` |
| `mqtt_sim.topic` | Simulator publish topic override | `PREDICTION` |
| `mqtt_sim.qos` | Simulator QoS override | `0` |
| `mqtt_sim.interval_seconds` | Simulator publish interval override | `5` |
| `mqtt_sim.username` | Optional simulator auth username | empty |
| `mqtt_sim.password` | Optional simulator auth password | empty |
| `mqtt_sim.start_id` | Optional simulator initial payload id | `1` |
| `mqtt_sim.client_id` | Optional simulator MQTT client id | `mqtt-simulator` |
| `mqtt_sim.log_file` | Optional simulator log file path | `logs/mqtt_simulator.log` |
| `animation.output.path` | Generated animation state file path | `data/animation.json` |
| `unreal.enabled` | Enables Unreal startup flow | `true` |
| `unreal.executable` | PowerShell script to start Unreal process | absolute path |
| `unreal.signalling_server.script` | Signalling server BAT file path | absolute path |
| `unreal.pid.file` | Unreal PID file for shutdown cleanup | absolute path |
| `unreal.signalling.pid.file` | Signalling PID file for shutdown cleanup | absolute path |
| `unreal.pid.dir` | Script-side PID directory override | absolute path |
| `unreal.target.executable` | Script-side Unreal executable override | absolute path |
| `unreal.target.args` | Script-side Unreal argument string override | command string |
| `unreal.target.working_dir` | Script-side Unreal working dir override | absolute path |
| `unreal.startup.delay.seconds` | Script-side signalling warmup delay override | `5` |

Notes:

- Paths can be provided with or without wrapping quotes; startup sanitizes surrounding quotes.
- Unreal-related defaults are environment-specific and should be replaced per machine.
- `mqtt_sim.*` overrides are forwarded as environment variables to `mqtt_simulator.py`.
- `unreal.target.*` and `unreal.pid.dir` are forwarded as environment variables to `start_avatar.ps1`.

## `logger.properties`

| Key | Purpose | Current Default |
|---|---|---|
| `logger.level` | Minimum log level | `DEBUG` |
| `logger.file.enabled` | Enables file logging | `true` |
| `logger.file` | Log output file | `logs/application.log` |
| `logger.max.size.mb` | Rotation threshold | `10` |

## Related Script Files

- `src/main/resources/scripts/mqtt_simulator.py`
- `src/main/resources/scripts/start_avatar.ps1`

## Script Runtime Inputs

`mqtt_simulator.py` supports CLI options and equivalent env vars:

- `--broker` / `MQTT_SIM_BROKER`
- `--port` / `MQTT_SIM_PORT`
- `--topic` / `MQTT_SIM_TOPIC`
- `--username` / `MQTT_SIM_USERNAME`
- `--password` / `MQTT_SIM_PASSWORD`
- `--qos` / `MQTT_SIM_QOS`
- `--interval-seconds` / `MQTT_SIM_INTERVAL_SECONDS`
- `--start-id` / `MQTT_SIM_START_ID`
- `--client-id` / `MQTT_SIM_CLIENT_ID`
- `--log-file` / `MQTT_SIM_LOG_FILE`

`start_avatar.ps1` supports parameters and equivalent env vars:

- `-PidDir` / `VGA_PID_DIR`
- `-UeExe` / `VGA_UE_EXE`
- `-UeArgs` / `VGA_UE_ARGS`
- `-SignallingBat` / `VGA_SIGNALLING_BAT`
- `-UeWorkingDir` / `VGA_UE_WORKDIR`
- `-SignallingStartupDelaySeconds` / `VGA_SIGNALLING_DELAY`
