Skip to content

Commit

Permalink
Update definitions files to include new features and reading simvars
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Dec 24, 2024
1 parent 5160099 commit 186a7f1
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 33 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Features are essentially stored in a dictionary of dictionaries, of type `Featur
features: FeatureAddresses = {
// Aircraft feature
[AircraftFeature.BeaconLights]: {
'lvar name': FeatureType.Int,
'Lookup Address': FeatureType.Int,
},
}
```
Expand All @@ -194,6 +194,7 @@ In the above example:

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

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

### Lookup Locations

- For FSUIPC, the lookup location is the offset
- For X-Plane, it's the DRef
- For MSFS, it's either the LVar name, or a Simvar:
- Simvar has to be prefixed with `A:`, e.g, `A:LIGHT LOGO,bool`, and then the type

Example:

```typescript
Expand Down
40 changes: 40 additions & 0 deletions package.g.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<PackageJsonName Condition="$(PackageJsonName) == ''">acars-pdk</PackageJsonName>
<PackageJsonVersion Condition="$(PackageJsonVersion) == ''">1.0.0</PackageJsonVersion>
<PackageJsonPrivate Condition="$(PackageJsonPrivate) == ''">true</PackageJsonPrivate>
<PackageJsonDescription Condition="$(PackageJsonDescription) == ''"></PackageJsonDescription>
<PackageJsonMain Condition="$(PackageJsonMain) == ''">app.js</PackageJsonMain>
<PackageJsonScriptsBuild Condition="$(PackageJsonScriptsBuild) == ''">gulp build</PackageJsonScriptsBuild>
<PackageJsonScriptsClean Condition="$(PackageJsonScriptsClean) == ''">gulp clean</PackageJsonScriptsClean>
<PackageJsonScriptsCopy Condition="$(PackageJsonScriptsCopy) == ''">gulp copy</PackageJsonScriptsCopy>
<PackageJsonScriptsCsbuild Condition="$(PackageJsonScriptsCsbuild) == ''">gulp csbuild</PackageJsonScriptsCsbuild>
<PackageJsonScriptsTsbuild Condition="$(PackageJsonScriptsTsbuild) == ''">tsc --build</PackageJsonScriptsTsbuild>
<PackageJsonScriptsLint Condition="$(PackageJsonScriptsLint) == ''">eslint --fix</PackageJsonScriptsLint>
<PackageJsonScriptsFormat Condition="$(PackageJsonScriptsFormat) == ''">prettier --ignore-path .gitignore --write "src/**/*.+(js|ts|json)"</PackageJsonScriptsFormat>
<PackageJsonScriptsTesting Condition="$(PackageJsonScriptsTesting) == ''">gulp testing</PackageJsonScriptsTesting>
<PackageJsonScriptsWatch Condition="$(PackageJsonScriptsWatch) == ''">gulp watch</PackageJsonScriptsWatch>
<PackageJsonKeywords Condition="$(PackageJsonKeywords) == ''">[]</PackageJsonKeywords>
<PackageJsonAuthor Condition="$(PackageJsonAuthor) == ''">Nabeel Shahzad &lt;[email protected]&gt;</PackageJsonAuthor>
<PackageJsonLicense Condition="$(PackageJsonLicense) == ''">ISC</PackageJsonLicense>
<PackageJsonDevdependenciesDotenvxDotenvx Condition="$(PackageJsonDevdependenciesDotenvxDotenvx) == ''">^1.13.2</PackageJsonDevdependenciesDotenvxDotenvx>
<PackageJsonDevdependenciesStylisticEslintPluginJs Condition="$(PackageJsonDevdependenciesStylisticEslintPluginJs) == ''">^2.7.2</PackageJsonDevdependenciesStylisticEslintPluginJs>
<PackageJsonDevdependenciesTypesNode Condition="$(PackageJsonDevdependenciesTypesNode) == ''">^22.5.1</PackageJsonDevdependenciesTypesNode>
<PackageJsonDevdependenciesTypescriptEslintEslintPlugin Condition="$(PackageJsonDevdependenciesTypescriptEslintEslintPlugin) == ''">^8.3.0</PackageJsonDevdependenciesTypescriptEslintEslintPlugin>
<PackageJsonDevdependenciesTypescriptEslintParser Condition="$(PackageJsonDevdependenciesTypescriptEslintParser) == ''">^8.3.0</PackageJsonDevdependenciesTypescriptEslintParser>
<PackageJsonDevdependenciesCrossEnv Condition="$(PackageJsonDevdependenciesCrossEnv) == ''">^7.0.3</PackageJsonDevdependenciesCrossEnv>
<PackageJsonDevdependenciesDel Condition="$(PackageJsonDevdependenciesDel) == ''">^7.1.0</PackageJsonDevdependenciesDel>
<PackageJsonDevdependenciesEslint Condition="$(PackageJsonDevdependenciesEslint) == ''">^9.9.1</PackageJsonDevdependenciesEslint>
<PackageJsonDevdependenciesGulp Condition="$(PackageJsonDevdependenciesGulp) == ''">^5.0.0</PackageJsonDevdependenciesGulp>
<PackageJsonDevdependenciesGulpEslintNew Condition="$(PackageJsonDevdependenciesGulpEslintNew) == ''">^2.3.0</PackageJsonDevdependenciesGulpEslintNew>
<PackageJsonDevdependenciesGulpTypescript Condition="$(PackageJsonDevdependenciesGulpTypescript) == ''">^6.0.0-alpha.1</PackageJsonDevdependenciesGulpTypescript>
<PackageJsonDevdependenciesMerge2 Condition="$(PackageJsonDevdependenciesMerge2) == ''">^1.4.1</PackageJsonDevdependenciesMerge2>
<PackageJsonDevdependenciesPrettier Condition="$(PackageJsonDevdependenciesPrettier) == ''">^3.3.3</PackageJsonDevdependenciesPrettier>
<PackageJsonDevdependenciesTypescript Condition="$(PackageJsonDevdependenciesTypescript) == ''">^5.5.4</PackageJsonDevdependenciesTypescript>
<PackageJsonPrettierTrailingcomma Condition="$(PackageJsonPrettierTrailingcomma) == ''">all</PackageJsonPrettierTrailingcomma>
<PackageJsonPrettierTabwidth Condition="$(PackageJsonPrettierTabwidth) == ''">2</PackageJsonPrettierTabwidth>
<PackageJsonPrettierSemi Condition="$(PackageJsonPrettierSemi) == ''">false</PackageJsonPrettierSemi>
<PackageJsonPrettierSinglequote Condition="$(PackageJsonPrettierSinglequote) == ''">true</PackageJsonPrettierSinglequote>
</PropertyGroup>
</Project>
74 changes: 46 additions & 28 deletions src/defs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** The different gate types */
export enum GateType {
None = 0,
Ramp_GA = 1,
Expand All @@ -13,32 +14,14 @@ export enum GateType {
Dock_GA = 11,
Fuel = 12,
Vehicles = 13,
/** Added for MSFS */
Ramp_GA_Extra = 14,
/** Added for MSFS */
Gate_Extra = 15,
/** Added for MSFS */
Jetway = 16,
}
export enum AircraftType {
Airliner = 0,
Cargo = 1,
GeneralAviation = 2,
Helicopter = 3,
}
export enum EngineType {
Piston = 0,
Jet = 1,
None = 2,
Helo = 3,
Rocket = 4,
Turboprop = 5,
}
export enum SimType {
None = 0,
Prepar3D = 1,
Xplane = 2,
FlightSimulator = 3,
Fsx = 4,
Fs9 = 5,
}
/** The runway/taxiway surface */
export enum Surface {
Concrete = 0,
Grass = 1,
Expand Down Expand Up @@ -66,6 +49,34 @@ export enum Surface {
Tarmac = 23,
Unknown = 99999,
}
export enum AircraftType {
Airliner = 0,
Cargo = 1,
GeneralAviation = 2,
Helicopter = 3,
}
/** The type of engine */
export enum EngineType {
Piston = 0,
Jet = 1,
None = 2,
Helo = 3,
Rocket = 4,
Turboprop = 5,
}
export enum SimType {
None = 0,
Prepar3D = 1,
Xplane = 2,
/** You can use this for ALL FlightSimulator (2020, 2024, and beyond) */
FlightSimulator = 3,
Fsx = 4,
Fs9 = 5,
/** Specifically only for MSFS 2020 */
FlightSimulator2020 = 6,
/** Specifically only for MSFS 2024 */
FlightSimulator2024 = 7,
}
export enum FareType {
/** Primarily a passenger flight */
Passenger = 0,
Expand Down Expand Up @@ -111,6 +122,13 @@ export enum PirepState {
Paused = 14,
OnBlock = 15,
}
/** The simtype for the rule file */
export enum AircraftConfigSimType {
MsFs = 0,
XPlane = 1,
Fsuipc = 2,
}
/** Features of an aircraft. They are binary on or off */
export enum AircraftFeature {
BeaconLights = 0,
LandingLights = 1,
Expand All @@ -127,12 +145,12 @@ export enum AircraftFeature {
AntiIce = 12,
Battery = 13,
Packs = 14,
}
/** The simtype for the rule file */
export enum AircraftConfigSimType {
MsFs = 0,
XPlane = 1,
Fsuipc = 2,
ParkingBrakes = 15,
Engines = 16,
Transponder = 17,
LandingGear = 18,
Autopilot = 19,
ExternalPower = 20,
}
/** The type of the dataref */
export enum FeatureType {
Expand Down
47 changes: 43 additions & 4 deletions src/interface/aircraft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ export abstract class AircraftConfig {
return this.flapNames[value] || value
}

apu(...args: any): FeatureState {
return null
}

/**
*
*/
autopilot(...args: any): FeatureState {
return null
}

/**
* Provide an implementation for but, by default, it's null
* @param args
Expand Down Expand Up @@ -136,10 +147,6 @@ export abstract class AircraftConfig {
return null
}

apu(...args: any): FeatureState {
return null
}

doors(...args: any): FeatureState {
return null
}
Expand All @@ -163,4 +170,36 @@ export abstract class AircraftConfig {
packs(...args: any): FeatureState {
return null
}

externalPower(...args: any): FeatureState {
return null
}

/**
* Not Implemented
*/
parkingBrakes(...args: any): FeatureState {
return null
}

/**
* Not Implemented
*/
engines(...args: any): FeatureState {
return null
}

/**
* Not Implemented
*/
transponder(...args: any): FeatureState {
return null
}

/**
* Not Implemented
*/
landingGear(...args: any): FeatureState {
return null
}
}

0 comments on commit 186a7f1

Please sign in to comment.