-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
905fdc0
commit 82941e8
Showing
79 changed files
with
5,784 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ on: | |
- master | ||
|
||
jobs: | ||
test: | ||
name: test | ||
lint: | ||
name: lint | ||
runs-on: windows-latest | ||
timeout-minutes: 5 | ||
steps: | ||
|
@@ -36,6 +36,31 @@ jobs: | |
shell: bash | ||
run: | | ||
yarn tslint | ||
test: | ||
name: test | ||
runs-on: windows-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: setup:checkout | ||
uses: actions/checkout@master | ||
- name: setup:python3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.7' | ||
architecture: x64 | ||
- name: setup:cache:node | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/node_modules | ||
key: ${{ runner.os }}-api-test-node-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-api-test-node- | ||
${{ runner.os }}-api- | ||
- name: deps:install | ||
shell: bash | ||
run: | | ||
yarn | ||
- name: test:unit | ||
shell: bash | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: windows-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: setup:checkout | ||
uses: actions/checkout@master | ||
- name: setup:python3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.7' | ||
architecture: x64 | ||
- name: setup:cache | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/node_modules | ||
key: ${{ runner.os }}-api-build-node-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-api-build-node- | ||
${{ runner.os }}-api- | ||
- name: deps:install | ||
shell: bash | ||
run: | | ||
yarn | ||
- name: build:prod | ||
shell: bash | ||
run: | | ||
yarn compile:prod | ||
- name: build:upload:artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: fsuipc-api-${{ github.ref }} | ||
path: ${{ github.workspace }}/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Feature | ||
|
||
## Offsets depending on others offset value to be converted: | ||
- `0xBDC`: flaps levels | ||
- `0xBE0`: flaps position indicator | ||
- `0xBE4`: flaps position indicator | ||
- `0xB50`: bleed air source control, value depending on aircraft model | ||
- `0x892`, `0x92A`, `0x9C2`, `0xA5A`: engine 1-4 starter switch position value depending on propulsion type | ||
- `0x898`: require engineRPMScaler for proper calculation | ||
- `0xC52`: VOR or ILS depending value for signal strength percent? | ||
|
||
## Write offsets | ||
|
||
Convert should varies depending on write or read mode | ||
|
||
## Offset missing mappings: | ||
- `0xAF8`: fuel tank selected | ||
- `0xE84`: cloud type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Brakes } from '@shared/plane/brakes'; | ||
|
||
export const appliedBrakes = (value: number): Brakes => { | ||
switch (value) { | ||
case 1: | ||
return Brakes.LEFT; | ||
case 2: | ||
return Brakes.RIGHT; | ||
case 3: | ||
return Brakes.BOTH; | ||
default: | ||
return null; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const BackCourseFlags = [ | ||
{ name: 'backCourseAvailable', index: 0 }, | ||
{ name: 'localiserTunedIn', index: 1 }, | ||
{ name: 'onBackCourse', index: 2 }, | ||
{ name: 'stationActive', index: 7 }, | ||
]; | ||
|
||
export const navBackCourseFlags = (values: number[]): { [key: string]: boolean } => { | ||
const flags: { [key: string]: boolean } = {}; | ||
|
||
values.forEach((value, index) => { | ||
const flagName = BackCourseFlags.find(flag => flag.index === index); | ||
|
||
if (!flagName) { | ||
return; | ||
} | ||
|
||
flags[flagName.name] = !!value; | ||
}); | ||
|
||
return flags; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const Capabilities = ['dme', 'tacan', 'voice', 'noSignal', 'dmeGlideslope', 'noBackCourse', 'glideslope', 'isLocaliser']; | ||
|
||
export const navCapabilities = (values: number[]): { [key: string]: boolean } => { | ||
const capabilities: { [key: string]: boolean } = {}; | ||
|
||
values.forEach((value, index) => { | ||
const capability: string = Capabilities[index]; | ||
|
||
if (!capability) { | ||
return; | ||
} | ||
|
||
capabilities[capability] = !!value; | ||
}); | ||
|
||
return capabilities; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const spoilersControl = (value: number): number => { | ||
if (value < 4800) { | ||
return 0; | ||
} | ||
|
||
return Math.round((value - 4800) / (16383 - 4800) * 100); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { VorToFrom } from '@shared/radios/vor-to-from'; | ||
|
||
export const vorToFrom = (value: number): VorToFrom => { | ||
switch (value) { | ||
case 0: | ||
return VorToFrom.OFF; | ||
case 1: | ||
return VorToFrom.TO; | ||
case 2: | ||
return VorToFrom.FROM; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.