Skip to content

Commit f19a409

Browse files
committed
Added MsFs20 and MsFs24 as sim types
1 parent 1fe0e67 commit f19a409

File tree

2 files changed

+41
-29
lines changed

2 files changed

+41
-29
lines changed

README.md

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,28 @@ This will setup a watch, and then automatically transpile and then copy the cont
7575
npm run dev
7676
```
7777

78-
It's recommended to run this *after* you've started ACARS, or, in the ACARS configuration, disable the
79-
remote-download of configs:
78+
### Disable Downloading Latest Defaults
8079

81-
> TODO: Guide on how to disable remote config downloading
80+
Sometimes, it's just useful to disable downloading of the latest defaults, and just edit the scripts that are included
81+
to see how they work. To do that, create a file in your `Documents/vmsacars` directory, called `appsettings.local.json`,
82+
and place the following:
83+
84+
```json filename="appsettings.local.json"
85+
{
86+
"Config": {
87+
"App": {
88+
"DownloadConfig": false
89+
}
90+
},
91+
"Serilog": {
92+
"MinimumLevel": {
93+
"Default": "Verbose"
94+
}
95+
}
96+
}
97+
```
8298

99+
You can also adjust the log level to "Information", "Debug" or "Verbose" ("Debug" is recommended)
83100

84101
---
85102

@@ -104,31 +121,6 @@ It also includes other detailed type information, for example `Length`, so you c
104121

105122
---
106123

107-
## Disable Downloading Latest Defaults
108-
109-
Sometimes, it's just useful to disable downloading of the latest defaults, and just edit the scripts that are included
110-
to see how they work. To do that, create a file in your `Documents/vmsacars` directory, called `appsettings.local.json`,
111-
and place the following:
112-
113-
```json filename="appsettings.local.json"
114-
{
115-
"Config": {
116-
"App": {
117-
"DownloadConfig": false
118-
}
119-
},
120-
"Serilog": {
121-
"MinimumLevel": {
122-
"Default": "Verbose"
123-
}
124-
}
125-
}
126-
```
127-
128-
You can also adjust the log level to "Information", "Debug" or "Verbose" ("Debug" is recommended)
129-
130-
---
131-
132124
## Aircraft Configuration:
133125

134126
Aircraft rules are required to inherit the `AircraftConfig` abstract class. An example class would look like:
@@ -180,6 +172,8 @@ The configuration is a class which has a few different components.
180172
- `AircraftConfigSimType.XPlane`
181173
- `AircraftConfigSimType.Fsuipc`
182174
- `AircraftConfigSimType.MsFs`
175+
- `AircraftConfigSimType.MsFs20`
176+
- `AircraftConfigSimType.MsFs24`
183177
- `enabled`
184178
- `priority` - from 1 (lowest) to 10 (highest). If there are multiple rules which match this, then which one takes
185179
priority. All the built-in rules are at a priority 1, and aircraft specifics rules are priority 2. I recommend
@@ -202,6 +196,14 @@ The configuration is a class which has a few different components.
202196
In the above example, for the Fenix A320, the landing lights are controlled by two datarefs, both of which the
203197
values need to be 1 or 2 for the landing lights to be considered "on".
204198

199+
#### Targeting MSFS
200+
201+
There are 3 possible values for targetting MSFS in the configs:
202+
203+
- `AircraftConfigSimType.MsFs` - This will apply the configuration to both 2020 and 2024
204+
- `AircraftConfigSimType.MsFs20` - This will be for 2020 ONLY
205+
- `AircraftConfigSimType.MsFs24` - This will be for 2024 ONLY
206+
205207
### Features
206208

207209
Features are essentially stored in a dictionary of dictionaries, of type `FeatureAddresses`:
@@ -266,6 +268,11 @@ export default class Example extends AircraftConfig {
266268
}
267269
```
268270

271+
### Equality Checking
272+
273+
I recommend using `==` instead of `===` for equality comparisons, since the types coming from the sim
274+
may not always match up or be casted properly (e.g, `1` being returned instead of `true`)
275+
269276
### Ignoring Features
270277

271278
To ignore a feature in the rules (for example, if a feature doesn't work properly), set the feature to false:
@@ -391,7 +398,7 @@ export default class BatteryOnDuringPushback implements Rule {
391398
// First check that the battery is declared as part of the aircraft's feature set
392399
if (AircraftFeature.Battery in data.features
393400
// And then check its value to see if it's on or off
394-
&& data.features[AircraftFeature.Battery] === false) {
401+
&& data.features[AircraftFeature.Battery] == false) {
395402
return ['The battery must be on during pushback']
396403
}
397404
}

src/defs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,14 @@ export enum PirepState {
124124
}
125125
/** The simtype for the rule file */
126126
export enum AircraftConfigSimType {
127+
/** This configuration can be for either MSFS 2020 or 2024 */
127128
MsFs = 0,
128129
XPlane = 1,
129130
Fsuipc = 2,
131+
/** Configuration for MSFS 2020 *only* */
132+
MsFs20 = 3,
133+
/** Configuration for MSFS 2024 *only* */
134+
MsFs24 = 4,
130135
}
131136
/** Features of an aircraft. They are binary on or off */
132137
export enum AircraftFeature {

0 commit comments

Comments
 (0)