You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since developers often use custom offsets or datarefs, and not the defaults, having configmaps allows you to map an aircraft feature (landing lights, etc) to a "feature", which tells ACARS where to read the data for those features. They're stored in the `configmaps` directory.
7
7
8
-
The configmaps are downloaded by the client on startup from the [configmaps repository](https://github.com/phpvms/configmaps), so updates can be more easily pushed out.
9
-
10
-
:::note
11
-
Config maps are now only for FSX/P3D or X-Plane. A lot of developers use the default offsets or datarefs, so it may not be required to change anything
12
-
:::
13
-
14
8
If you create a configmap for an aircraft, please let me know, I can include it in ACARS to be distributed out. That would be much appreciated! **Always create a new file**, otherwise the defaults that are included with the distribution will be overwritten by an updates.
15
9
16
10
## Anatomy of a ConfigMap
17
11
18
-
A config map is an XML file which looks like this:
- The simulator it's for (either `X-Plane` or `FSX/Prepar3d`)
38
-
- The aircraft title contains. This is how it's filtered. It must be broad but also specific to make sure it "catches" the right plane type.
39
-
- Each word is looked for and it's AND'd. In the example above, "FlightFactor" and "A320" must be present
40
+
The configuration is a class which has a few different components.
41
+
42
+
1.`meta`, which gives some general information about the configuration:
43
+
-`name` - a name for this script
44
+
-`sim` - The simulator it's for (either `xplane`, `fsuipc` or `msfs`)
45
+
-`enabled`
46
+
-`priority` - from 1 (lowest) to 10 (highest). If there are multiple rules which match this,
47
+
then which one takes priority. All the built-in rules are at a priority 1
48
+
2.`features`
49
+
- MSFS - the lookups you enter are LVars
50
+
- X-Plane - the looks ups are via datarefs
51
+
- FSUIPC - the lookups are offsets
52
+
3.`match()`
53
+
- A method (`match()`) which passes some information about the starting aircraft
54
+
- For MSFS, it's the aircraft ICAO
40
55
- For FSX/P3d, the value looked at is the aircraft title field, offset `0x3D00`
41
56
- For X-Plane, the value looked at is `sim/aircraft/view/acf_descrip`
42
-
1. The feature (see below)
57
+
- This method can be used to determine if this rule should match
58
+
4. Methods for the different features (see below)
43
59
- The maps - a group of datarefs or offsets which constitute that feature being "on" or "enabled"
44
60
45
61
In the above example, for the FlightFactor A320, the landing lights are controlled by two datarefs, both of which the values need to be 1 or 2 for the landing lights to be considered "on".
46
62
47
63
## Features
48
64
49
-
The base rules and rule types are available. This list may be expanded in the future.
50
-
51
-
- BeaconLights
52
-
- LandingLights
53
-
- NavigationLights
54
-
- StrobeLights
55
-
- TaxiLight
56
-
- WingLight
57
-
58
-
### Mapping data to a feature
59
-
60
-
Each `Key` consists a `Type`, `Key` and a `Value`. These are all "AND" together, so every value in the feature must evaluate to true.
-`Bool` - a `Value` is not required, the sim returns a `1` or `0` for this value
68
-
-`Byte`
69
-
-`Number`/`Double`/`Float`
70
-
-`Int`
71
-
-`Short`
72
-
-`Mask` - Find a value in a bit mask
73
-
-`String` - look for exactly matches
74
-
-`IntArray`/`FloatArray` - (X-Plane) - where the DataRef returns an array of integers or floats
75
-
-`LVar` - Look for an LVar value (**Microsoft Flight Simulator only**)
76
-
2.`Key` - This is where ACARS will look to get the value.
77
-
-`FS9/FSX/Prepar3d` - This is an FSUIPC offset. LVars aren't supported, though you can use LINDA and FSUIPC to map an LVAR to a custom offset, and read it here. This information is up to the aircraft developer to provide.
78
-
-**NOTE** You can use "FSUIPC" and it will detect it for the Prepar3d/FS9/FSX family
79
-
-`X-Plane`/`xplane` - This is the dataref value
80
-
-`Microsoft Flight`/`MSFS` - The name of the LVar to use
81
-
3. Value specifier, must be one of:
82
-
-`Value` - this is what value to look for, in the case of a non-boolean type. You can use the OR operator (`|`) to separate multiple values
83
-
-`ValueGt`/`ValueGte` - Value greater than or greater than equal to, respectively
84
-
-`ValueLt`/`ValueLte` - Value less than or less than or equal to, respectively
85
-
-`ValueBtwn` - Value between; this must include two values like `0|1`, and will include the first value up to the first
86
-
4.`Index` (required for `IntArray` and `FloatArray`)
87
-
- If using the above types, which index of the array to look for the value in (starts from 0)
88
-
89
-
:::note
90
-
A note for X-Plane: the `sim/cockpit/electrical` datarefs are usually not great to use - X-Plane emulates the electrical system, so the values may toggle between 0 and 1, for example, when the strobe light is blinking, the electrical will toggle between 0 and 1. These would show up as the strobe being on. You generally want to check any switches (see Debugging below)
91
-
:::
92
-
93
-
### Ignoring Features
94
-
95
-
To ignore a feature in the rules (for example, if a feature doesn't work properly), add `Ignore="True"` to the feature:
96
-
97
-
```xml
98
-
<LandingLightsIgnore="True">
102
+
The different features available are:
103
+
104
+
- beaconLights
105
+
- landingLights
106
+
- logoLights
107
+
- navigationLights
108
+
- strobeLights
109
+
- taxiLights
110
+
- wingLights
111
+
- flaps
112
+
113
+
The different features contain how to look up the value, and the type. You can have multiple variables to be
114
+
read and looked at for a feature. Each feature then corresponds to a method which is called to return if
115
+
that feature is on or off. That method will have the equivalent number of arguments for each data reference
116
+
117
+
Example:
118
+
119
+
```javascript
120
+
exportdefaultclassExample {
121
+
features = {
122
+
beaconLights: {
123
+
'sample/dataref/1':'bool',
124
+
'sample/dataref/2':'bool',
125
+
}
126
+
}
127
+
128
+
beaconLights(dataref_1, dataref_2) {
129
+
if (dataref_1 && dataref_2) {
130
+
returntrue;
131
+
}
132
+
133
+
returnfalse;
134
+
}
135
+
}
99
136
```
100
137
101
-
This will then ignore any landing light rules for that specific aircraft. You can also ignore a specific value, like if a switch has a 3 positions - 0 for off, 1 for on, and 3 for auto, you can ignore a rule with the value of 3:
To ignore a feature in the rules (for example, if a feature doesn't work properly), set the feature to false:
141
+
142
+
```javascript
143
+
exportdefaultclassExample {
144
+
features = {
145
+
beaconLights: {
146
+
'sample/dataref/1':'bool',
147
+
'sample/dataref/2':'bool',
148
+
},
149
+
landingLights:false
150
+
}
151
+
}
108
152
```
109
-
In this case, all of the `Key` values must match `3` in order for it to be ignored in any landing lights rules. In this next example, it's reading from an array of integers that's returned by the sim, looking at the 2nd index, and ignoring the value if it's a 3:
If there are two scripts which match a particular aircraft, and a feature is omitted, it will use the lower priority
157
+
one in place. For example:
158
+
159
+
```javascript
160
+
exportdefaultclassExample {
161
+
meta = {
162
+
// ...
163
+
priority:1
164
+
}
165
+
166
+
features = {
167
+
beaconLights: {
168
+
'sample/dataref/1':'bool',
169
+
'sample/dataref/2':'bool',
170
+
},
171
+
landingLights: {
172
+
'sample/landing/light/1':'bool',
173
+
'sample/landing/light/2':'bool',
174
+
},
175
+
}
176
+
}
177
+
178
+
exportdefaultclassExampleOverride {
179
+
meta = {
180
+
// ...
181
+
priority:10
182
+
}
183
+
184
+
features = {
185
+
landingLights: {
186
+
'override/landing/light/1':'bool',
187
+
'override/landing/light/2':'bool',
188
+
},
189
+
}
190
+
}
115
191
```
116
192
117
-
### Flaps
193
+
In this case, the lookups used for the rules will be:
118
194
119
-
You can also add the flaps naming to specific aircraft which might have different values. The flaps have an numeric index value that's reported and then a corresponding flap name:
In this example, both of the datarefs, in this last, the left and right landing lights, must have a value of `1` or `2` in order for the landing lights to be considered "on". This aircraft config also has differing flap names.
0 commit comments