Skip to content

Commit 186a7f1

Browse files
committed
Update definitions files to include new features and reading simvars
1 parent 5160099 commit 186a7f1

File tree

4 files changed

+138
-33
lines changed

4 files changed

+138
-33
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Features are essentially stored in a dictionary of dictionaries, of type `Featur
185185
features: FeatureAddresses = {
186186
// Aircraft feature
187187
[AircraftFeature.BeaconLights]: {
188-
'lvar name': FeatureType.Int,
188+
'Lookup Address': FeatureType.Int,
189189
},
190190
}
191191
```
@@ -194,6 +194,7 @@ In the above example:
194194

195195
- `AircraftFeature.BeaconLights` is an enum value of the feature type. It's put in `[]` because it's a variable name
196196
- It's set to an object, where the keys are the lookup address or lvar.
197+
- `Lookup Address` is where to find this data:
197198
- `FeatureType.Int` - is the type of value that's returned.
198199

199200
The different features available are:
@@ -211,6 +212,13 @@ The different features contain how to look up the value, and the type. You can h
211212
read and looked at for a feature. Each feature then corresponds to a method which is called to return if
212213
that feature is on or off. That method will have the equivalent number of arguments for each data reference
213214

215+
### Lookup Locations
216+
217+
- For FSUIPC, the lookup location is the offset
218+
- For X-Plane, it's the DRef
219+
- For MSFS, it's either the LVar name, or a Simvar:
220+
- Simvar has to be prefixed with `A:`, e.g, `A:LIGHT LOGO,bool`, and then the type
221+
214222
Example:
215223

216224
```typescript

package.g.props

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<PackageJsonName Condition="$(PackageJsonName) == ''">acars-pdk</PackageJsonName>
5+
<PackageJsonVersion Condition="$(PackageJsonVersion) == ''">1.0.0</PackageJsonVersion>
6+
<PackageJsonPrivate Condition="$(PackageJsonPrivate) == ''">true</PackageJsonPrivate>
7+
<PackageJsonDescription Condition="$(PackageJsonDescription) == ''"></PackageJsonDescription>
8+
<PackageJsonMain Condition="$(PackageJsonMain) == ''">app.js</PackageJsonMain>
9+
<PackageJsonScriptsBuild Condition="$(PackageJsonScriptsBuild) == ''">gulp build</PackageJsonScriptsBuild>
10+
<PackageJsonScriptsClean Condition="$(PackageJsonScriptsClean) == ''">gulp clean</PackageJsonScriptsClean>
11+
<PackageJsonScriptsCopy Condition="$(PackageJsonScriptsCopy) == ''">gulp copy</PackageJsonScriptsCopy>
12+
<PackageJsonScriptsCsbuild Condition="$(PackageJsonScriptsCsbuild) == ''">gulp csbuild</PackageJsonScriptsCsbuild>
13+
<PackageJsonScriptsTsbuild Condition="$(PackageJsonScriptsTsbuild) == ''">tsc --build</PackageJsonScriptsTsbuild>
14+
<PackageJsonScriptsLint Condition="$(PackageJsonScriptsLint) == ''">eslint --fix</PackageJsonScriptsLint>
15+
<PackageJsonScriptsFormat Condition="$(PackageJsonScriptsFormat) == ''">prettier --ignore-path .gitignore --write "src/**/*.+(js|ts|json)"</PackageJsonScriptsFormat>
16+
<PackageJsonScriptsTesting Condition="$(PackageJsonScriptsTesting) == ''">gulp testing</PackageJsonScriptsTesting>
17+
<PackageJsonScriptsWatch Condition="$(PackageJsonScriptsWatch) == ''">gulp watch</PackageJsonScriptsWatch>
18+
<PackageJsonKeywords Condition="$(PackageJsonKeywords) == ''">[]</PackageJsonKeywords>
19+
<PackageJsonAuthor Condition="$(PackageJsonAuthor) == ''">Nabeel Shahzad &lt;[email protected]&gt;</PackageJsonAuthor>
20+
<PackageJsonLicense Condition="$(PackageJsonLicense) == ''">ISC</PackageJsonLicense>
21+
<PackageJsonDevdependenciesDotenvxDotenvx Condition="$(PackageJsonDevdependenciesDotenvxDotenvx) == ''">^1.13.2</PackageJsonDevdependenciesDotenvxDotenvx>
22+
<PackageJsonDevdependenciesStylisticEslintPluginJs Condition="$(PackageJsonDevdependenciesStylisticEslintPluginJs) == ''">^2.7.2</PackageJsonDevdependenciesStylisticEslintPluginJs>
23+
<PackageJsonDevdependenciesTypesNode Condition="$(PackageJsonDevdependenciesTypesNode) == ''">^22.5.1</PackageJsonDevdependenciesTypesNode>
24+
<PackageJsonDevdependenciesTypescriptEslintEslintPlugin Condition="$(PackageJsonDevdependenciesTypescriptEslintEslintPlugin) == ''">^8.3.0</PackageJsonDevdependenciesTypescriptEslintEslintPlugin>
25+
<PackageJsonDevdependenciesTypescriptEslintParser Condition="$(PackageJsonDevdependenciesTypescriptEslintParser) == ''">^8.3.0</PackageJsonDevdependenciesTypescriptEslintParser>
26+
<PackageJsonDevdependenciesCrossEnv Condition="$(PackageJsonDevdependenciesCrossEnv) == ''">^7.0.3</PackageJsonDevdependenciesCrossEnv>
27+
<PackageJsonDevdependenciesDel Condition="$(PackageJsonDevdependenciesDel) == ''">^7.1.0</PackageJsonDevdependenciesDel>
28+
<PackageJsonDevdependenciesEslint Condition="$(PackageJsonDevdependenciesEslint) == ''">^9.9.1</PackageJsonDevdependenciesEslint>
29+
<PackageJsonDevdependenciesGulp Condition="$(PackageJsonDevdependenciesGulp) == ''">^5.0.0</PackageJsonDevdependenciesGulp>
30+
<PackageJsonDevdependenciesGulpEslintNew Condition="$(PackageJsonDevdependenciesGulpEslintNew) == ''">^2.3.0</PackageJsonDevdependenciesGulpEslintNew>
31+
<PackageJsonDevdependenciesGulpTypescript Condition="$(PackageJsonDevdependenciesGulpTypescript) == ''">^6.0.0-alpha.1</PackageJsonDevdependenciesGulpTypescript>
32+
<PackageJsonDevdependenciesMerge2 Condition="$(PackageJsonDevdependenciesMerge2) == ''">^1.4.1</PackageJsonDevdependenciesMerge2>
33+
<PackageJsonDevdependenciesPrettier Condition="$(PackageJsonDevdependenciesPrettier) == ''">^3.3.3</PackageJsonDevdependenciesPrettier>
34+
<PackageJsonDevdependenciesTypescript Condition="$(PackageJsonDevdependenciesTypescript) == ''">^5.5.4</PackageJsonDevdependenciesTypescript>
35+
<PackageJsonPrettierTrailingcomma Condition="$(PackageJsonPrettierTrailingcomma) == ''">all</PackageJsonPrettierTrailingcomma>
36+
<PackageJsonPrettierTabwidth Condition="$(PackageJsonPrettierTabwidth) == ''">2</PackageJsonPrettierTabwidth>
37+
<PackageJsonPrettierSemi Condition="$(PackageJsonPrettierSemi) == ''">false</PackageJsonPrettierSemi>
38+
<PackageJsonPrettierSinglequote Condition="$(PackageJsonPrettierSinglequote) == ''">true</PackageJsonPrettierSinglequote>
39+
</PropertyGroup>
40+
</Project>

src/defs.ts

+46-28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** The different gate types */
12
export enum GateType {
23
None = 0,
34
Ramp_GA = 1,
@@ -13,32 +14,14 @@ export enum GateType {
1314
Dock_GA = 11,
1415
Fuel = 12,
1516
Vehicles = 13,
17+
/** Added for MSFS */
1618
Ramp_GA_Extra = 14,
19+
/** Added for MSFS */
1720
Gate_Extra = 15,
21+
/** Added for MSFS */
1822
Jetway = 16,
1923
}
20-
export enum AircraftType {
21-
Airliner = 0,
22-
Cargo = 1,
23-
GeneralAviation = 2,
24-
Helicopter = 3,
25-
}
26-
export enum EngineType {
27-
Piston = 0,
28-
Jet = 1,
29-
None = 2,
30-
Helo = 3,
31-
Rocket = 4,
32-
Turboprop = 5,
33-
}
34-
export enum SimType {
35-
None = 0,
36-
Prepar3D = 1,
37-
Xplane = 2,
38-
FlightSimulator = 3,
39-
Fsx = 4,
40-
Fs9 = 5,
41-
}
24+
/** The runway/taxiway surface */
4225
export enum Surface {
4326
Concrete = 0,
4427
Grass = 1,
@@ -66,6 +49,34 @@ export enum Surface {
6649
Tarmac = 23,
6750
Unknown = 99999,
6851
}
52+
export enum AircraftType {
53+
Airliner = 0,
54+
Cargo = 1,
55+
GeneralAviation = 2,
56+
Helicopter = 3,
57+
}
58+
/** The type of engine */
59+
export enum EngineType {
60+
Piston = 0,
61+
Jet = 1,
62+
None = 2,
63+
Helo = 3,
64+
Rocket = 4,
65+
Turboprop = 5,
66+
}
67+
export enum SimType {
68+
None = 0,
69+
Prepar3D = 1,
70+
Xplane = 2,
71+
/** You can use this for ALL FlightSimulator (2020, 2024, and beyond) */
72+
FlightSimulator = 3,
73+
Fsx = 4,
74+
Fs9 = 5,
75+
/** Specifically only for MSFS 2020 */
76+
FlightSimulator2020 = 6,
77+
/** Specifically only for MSFS 2024 */
78+
FlightSimulator2024 = 7,
79+
}
6980
export enum FareType {
7081
/** Primarily a passenger flight */
7182
Passenger = 0,
@@ -111,6 +122,13 @@ export enum PirepState {
111122
Paused = 14,
112123
OnBlock = 15,
113124
}
125+
/** The simtype for the rule file */
126+
export enum AircraftConfigSimType {
127+
MsFs = 0,
128+
XPlane = 1,
129+
Fsuipc = 2,
130+
}
131+
/** Features of an aircraft. They are binary on or off */
114132
export enum AircraftFeature {
115133
BeaconLights = 0,
116134
LandingLights = 1,
@@ -127,12 +145,12 @@ export enum AircraftFeature {
127145
AntiIce = 12,
128146
Battery = 13,
129147
Packs = 14,
130-
}
131-
/** The simtype for the rule file */
132-
export enum AircraftConfigSimType {
133-
MsFs = 0,
134-
XPlane = 1,
135-
Fsuipc = 2,
148+
ParkingBrakes = 15,
149+
Engines = 16,
150+
Transponder = 17,
151+
LandingGear = 18,
152+
Autopilot = 19,
153+
ExternalPower = 20,
136154
}
137155
/** The type of the dataref */
138156
export enum FeatureType {

src/interface/aircraft.ts

+43-4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ export abstract class AircraftConfig {
104104
return this.flapNames[value] || value
105105
}
106106

107+
apu(...args: any): FeatureState {
108+
return null
109+
}
110+
111+
/**
112+
*
113+
*/
114+
autopilot(...args: any): FeatureState {
115+
return null
116+
}
117+
107118
/**
108119
* Provide an implementation for but, by default, it's null
109120
* @param args
@@ -136,10 +147,6 @@ export abstract class AircraftConfig {
136147
return null
137148
}
138149

139-
apu(...args: any): FeatureState {
140-
return null
141-
}
142-
143150
doors(...args: any): FeatureState {
144151
return null
145152
}
@@ -163,4 +170,36 @@ export abstract class AircraftConfig {
163170
packs(...args: any): FeatureState {
164171
return null
165172
}
173+
174+
externalPower(...args: any): FeatureState {
175+
return null
176+
}
177+
178+
/**
179+
* Not Implemented
180+
*/
181+
parkingBrakes(...args: any): FeatureState {
182+
return null
183+
}
184+
185+
/**
186+
* Not Implemented
187+
*/
188+
engines(...args: any): FeatureState {
189+
return null
190+
}
191+
192+
/**
193+
* Not Implemented
194+
*/
195+
transponder(...args: any): FeatureState {
196+
return null
197+
}
198+
199+
/**
200+
* Not Implemented
201+
*/
202+
landingGear(...args: any): FeatureState {
203+
return null
204+
}
166205
}

0 commit comments

Comments
 (0)