aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2024-08-31 23:42:13 -0700
committerDeterminant <[email protected]>2024-08-31 23:42:43 -0700
commit02f63e8356ee5e3500507a588ef0afc41d75630b (patch)
treeb9771e07be180eba1bd7075b978317a64c5d2f7e
parent1f311f1c0241f7a1c863d1e51f40b02e5d337821 (diff)
add slip indicator to the PFD
-rwxr-xr-xapp.mjs7
-rw-r--r--package-lock.json4
-rw-r--r--package.json2
-rw-r--r--profile.yaml13
4 files changed, 16 insertions, 10 deletions
diff --git a/app.mjs b/app.mjs
index b2cac4f..666b8c6 100755
--- a/app.mjs
+++ b/app.mjs
@@ -413,7 +413,8 @@ const renderAttitudeIndicator = (c, display, values) => {
const pitch = values[0] || 0;
const roll = values[1] || 0;
- let src = isObject(display.navs) ? display.navs[values[2]] : null;
+ const slip = values[2] || 0;
+ let src = isObject(display.navs) ? display.navs[values[3]] : null;
if (!isObject(src)) {
src = null;
}
@@ -512,6 +513,10 @@ const renderAttitudeIndicator = (c, display, values) => {
c.moveTo(-3, -(bankR - 9));
c.lineTo(0, -(bankR - 1));
c.lineTo(3, -(bankR - 9));
+
+ const slipD = -slip * 2;
+ c.moveTo(-5 + slipD, -(bankR - 9));
+ c.lineTo(5 + slipD, -(bankR - 9));
c.stroke();
// draw vertical deflection dots
diff --git a/package-lock.json b/package-lock.json
index ff5f407..a8193cd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "loupe-flightdeck",
- "version": "0.0.4",
+ "version": "0.0.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "loupe-flightdeck",
- "version": "0.0.4",
+ "version": "0.0.6",
"dependencies": {
"async": "^3.2.6",
"canvas": "^2.11.2",
diff --git a/package.json b/package.json
index a7861e5..0a89f67 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "loupe-flightdeck",
- "version": "0.0.5",
+ "version": "0.0.6",
"description": "Turn your stream deck into a flight deck!",
"repository": {
"type": "git",
diff --git a/profile.yaml b/profile.yaml
index 691b6ad..68d48f5 100644
--- a/profile.yaml
+++ b/profile.yaml
@@ -140,20 +140,21 @@
source:
- xplane_dataref: sim/cockpit/gyros/the_ind_ahars_pilot_deg # pitch
- xplane_dataref: sim/cockpit/gyros/phi_ind_ahars_pilot_deg # roll
+ - xplane_dataref: sim/cockpit2/gauges/indicators/slip_deg
- xplane_dataref: sim/cockpit2/radios/actuators/HSI_source_select_pilot # navigation source for HSI
- xplane_dataref: sim/cockpit2/radios/indicators/hsi_vdef_dots_pilot
- xplane_dataref: sim/cockpit2/radios/indicators/hsi_flag_glideslope_pilot
# navs contains the mapping from the HSI source value (source[2]) to the index in source[] array
navs:
2:
- def: 3
- received: 4
+ def: 4
+ received: 5
0:
- def: 3
- received: 4
+ def: 4
+ received: 5
1:
- def: 3
- received: 4
+ def: 4
+ received: 5
- display:
type: alt
freq: 24