-
-
Notifications
You must be signed in to change notification settings - Fork 10
Configuration
Configuration is pretty much required if you want ViLA to be of any use to you. Configuration is currently done in Configuration/config.json
.
The basic structure of a config.json file is like so:
{
// schema at the top
"$schema": "https://raw.githubusercontent.com/charliefoxtwo/ViLA/develop/ViLA/Configuration/Schema/ActionConfiguration.json.schema",
// devices, identified by hex code PID
"devices": {
"825B": {
"OnBoard": {
"1": [
// array of actions to take for LED #1
]
// other leds...
},
"SlaveBoard": {
// actions for slaved board
}
}
}
}
The schema provides syntax checking and makes editing much easier when using a supported editor (e.g. VS Code). If you don't have a supported editor and don't want to download one, you can use an online tool like JSON editor online (you can specify the schema in the options dropdown).
The devices are the PIDs of the Virpil devices you have, and the actions you want to map to each device. The PID should be in hex format. You can check the PID of your device in the Profile tab within the VPC Software Suite.
Known PID hex codes:
Device | Hex PID | Alternate PID |
---|---|---|
Control Panel #1 | 0259 |
|
Control Panel #2 | 825B |
025B |
CM2 Throttle | 8193 |
|
CM3 Throttle | 8194 |
0194 |
The actions define what should change in response to a particular event. A sample action might look like this:
{
// color to set the LED to if the trigger succeeds
"color": "ff8000",
"trigger": {
// id to test trigger
"id": "MASTER_CAUTION_LT",
// value to compare sent value to
"value": 1,
// how to compare the sent value to this value (<sent> <comparator> <value>)
"comparator": "EqualTo"
}
}
This action is one you might use for the DCS-BIOS reader plugin. You can read it like this:
When
MASTER_CAUTION_LT
equals1
, set the #1 on-board LED to #ff8000 (orange-ish)
Field | Description |
---|---|
color |
The color the LED should be set to if the condition evaluates to true. Each hex byte must be 00, 40, 80, or ff. No other options are allowed (this is a Virpil hardware limitation). Check out the Colors page for a list of all possible colors. |
trigger.id |
The string id to check the conditional for. Refer to the plugin documentation for more information on which ids you should be using. |
trigger.value |
The value on the right hand of the comparison statement. |
trigger.comparator |
The comparator to use in the comparison statement. |