Each preset is a self-contained folder under the presets/
directory. It includes:
preset-config.yaml
: Defines preset metadata, attributes, and modified files.- YAML configuration files (e.g.,
wfb.yaml
,majestic.yaml
). - Optional
sensor/
folder: Includes binary files likemilos-sensor.bin
.
Example Structure:
presets/
├── high_power_fpv/
│ ├── preset-config.yaml
│ ├── wfb.yaml
│ ├── majestic.yaml
│ ├── sensor/
│ └── milos-sensor.bin
The preset-config.yaml
file defines:
- Metadata:
name
,author
,description
, andcategory
. - Optional Sensor: Specifies a binary file (e.g.,
milos-sensor.bin
) to be transferred to the remote device. - Files: Specifies files and their key-value modifications.
Example:
name: "High Power FPV"
author: "OpenIPC"
description: "Optimized settings for high-power FPV."
sensor: "milos-sensor.bin"
files:
wfb.yaml:
wireless.txpower: "30"
wireless.channel: "161"
majestic.yaml:
fpv.enabled: "true"
system.logLevel: "info"
- The application scans the
presets/
directory. - It parses each
preset-config.yaml
to create aPreset
object. - File modifications are transformed into a bindable
ObservableCollection<FileModification>
for the UI.
When a preset is applied:
-
Sensor File Transfer:
- If a sensor is specified, it is transferred using SCP:
scp presets/high_power_fpv/sensor/milos-sensor.bin user@remote:/etc/sensors/milos-sensor.bin
- If a sensor is specified, it is transferred using SCP:
-
File Modifications:
- Each attribute in
files
is applied usingyaml-cli
:yaml-cli -i /etc/wfb.yaml "wireless.txpower" "30" yaml-cli -i /etc/wfb.yaml "wireless.channel" "161" yaml-cli -i /etc/majestic.yaml "fpv.enabled" "true" yaml-cli -i /etc/majestic.yaml "system.logLevel" "info"
- Each attribute in
-
Logs:
- Logs success or failure of sensor transfer and YAML modifications.
-
Preset List:
- Displays all available presets using a
ListBox
. - Users can select a preset by its name.
- Displays all available presets using a
-
Details Panel:
- Displays metadata (
Name
,Author
,Description
). - Lists file modifications and sensor file.
- Displays metadata (
-
"Apply Preset" Button:
- Applies the selected preset’s changes to the remote device.
- Button is enabled only if a preset is selected.
- Dynamic Preset Management:
- Add/remove presets by simply editing the
presets/
directory.
- Add/remove presets by simply editing the
- File Abstraction:
- Presets only define attributes; the app handles file locations.
- Sensor File Handling:
- Automatically transfers sensor binaries if specified.
- User-Friendly UI:
- Select a preset, view details, and apply it with a single click.