Skip to content

Commit

Permalink
feat(ND): Position Trend Vector (#454)
Browse files Browse the repository at this point in the history
* feat(MCP): Cosmetic Update

* fix(AP) Fixed TO/GA keybind bug

* fix(AP): LOC Fix

* Fix(AP): LOC intercept

* Squashed commit of the following:

commit 8794e93
Author: Ninjo <ninjomcs@gmail.com>
Date:   Fri Apr 15 14:35:15 2022 +0200

    feat(sound): cchord and caution sounds (#429)

commit e417aed
Author: Ninjo <ninjomcs@gmail.com>
Date:   Thu Apr 14 23:53:44 2022 +0200

    build: upload fragmenter zip assets to release (#428)

commit 9f3a136
Author: Ninjo <ninjomcs@gmail.com>
Date:   Thu Apr 14 22:19:18 2022 +0200

    build: fragmenter script (#427)

commit d83c883
Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
Date:   Thu Apr 14 11:18:48 2022 +0200

    feat(EICAS) New Messages (#424)

commit 942cb62
Author: dcherrie <david.cherrie@me.com>
Date:   Tue Apr 12 03:32:09 2022 +1000

    feat: update salty livery model, new thumbnails (#420)

commit 366bbc5
Author: Robin Breitfeld <robin01196@gmail.com>
Date:   Sun Apr 10 22:10:49 2022 +0200

    feat(fmc): VNAV operating altitude suggestion (#419)

    * VNAV climb altitude suggestion

    * remove unnecessary variable

    * update NaN check

    * update max crz altitude formula

    * fix(FMC): Fixed VNAV NaN bug

    * fix(FMC): better aligned text

    Co-authored-by: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>

commit 63347e4
Author: Ninjo <ninjomcs@gmail.com>
Date:   Sun Apr 10 22:01:59 2022 +0200

    feat(fmc): improvements to simbrief uplink (#422)

    * feat(fmc): no wpt select on uplink, uplink chime, fixes

    * chore: remove debug stuff and stuff

    * fix: crz alt format on perf init uplink preview

* feat(Sounds): Added C-Chord and Caution Sound

* Squashed commit of the following:

commit d5fd734
Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
Date:   Sat Apr 16 12:19:37 2022 +0100

    feat(Sounds) Added C-Chord and Caution Sounds (#431)

    * feat(MCP): Cosmetic Update

    * fix(AP) Fixed TO/GA keybind bug

    * fix(AP): LOC Fix

    * Fix(AP): LOC intercept

    * Squashed commit of the following:

    commit 8794e93
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Fri Apr 15 14:35:15 2022 +0200

        feat(sound): cchord and caution sounds (#429)

    commit e417aed
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Thu Apr 14 23:53:44 2022 +0200

        build: upload fragmenter zip assets to release (#428)

    commit 9f3a136
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Thu Apr 14 22:19:18 2022 +0200

        build: fragmenter script (#427)

    commit d83c883
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Thu Apr 14 11:18:48 2022 +0200

        feat(EICAS) New Messages (#424)

    commit 942cb62
    Author: dcherrie <david.cherrie@me.com>
    Date:   Tue Apr 12 03:32:09 2022 +1000

        feat: update salty livery model, new thumbnails (#420)

    commit 366bbc5
    Author: Robin Breitfeld <robin01196@gmail.com>
    Date:   Sun Apr 10 22:10:49 2022 +0200

        feat(fmc): VNAV operating altitude suggestion (#419)

        * VNAV climb altitude suggestion

        * remove unnecessary variable

        * update NaN check

        * update max crz altitude formula

        * fix(FMC): Fixed VNAV NaN bug

        * fix(FMC): better aligned text

        Co-authored-by: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>

    commit 63347e4
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Sun Apr 10 22:01:59 2022 +0200

        feat(fmc): improvements to simbrief uplink (#422)

        * feat(fmc): no wpt select on uplink, uplink chime, fixes

        * chore: remove debug stuff and stuff

        * fix: crz alt format on perf init uplink preview

    * feat(Sounds): Added C-Chord and Caution Sound

commit 1f4fde8
Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
Date:   Fri Apr 15 23:24:19 2022 +0100

    fix(mcp): MCP Fixes (#432)

    * fix(FMC): Fixed POS page 4

    * fix(FMC): Fixed flight phase sequencing

    * Squashed commit of the following:

    commit ba4bc9d
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Fri Apr 15 19:13:58 2022 +0200

        fix(sounds): c chord volume (#430)

    commit 8794e93
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Fri Apr 15 14:35:15 2022 +0200

        feat(sound): cchord and caution sounds (#429)

    commit e417aed
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Thu Apr 14 23:53:44 2022 +0200

        build: upload fragmenter zip assets to release (#428)

    commit 9f3a136
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Thu Apr 14 22:19:18 2022 +0200

        build: fragmenter script (#427)

    commit d83c883
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Thu Apr 14 11:18:48 2022 +0200

        feat(EICAS) New Messages (#424)

    commit 942cb62
    Author: dcherrie <david.cherrie@me.com>
    Date:   Tue Apr 12 03:32:09 2022 +1000

        feat: update salty livery model, new thumbnails (#420)

    commit 366bbc5
    Author: Robin Breitfeld <robin01196@gmail.com>
    Date:   Sun Apr 10 22:10:49 2022 +0200

        feat(fmc): VNAV operating altitude suggestion (#419)

        * VNAV climb altitude suggestion

        * remove unnecessary variable

        * update NaN check

        * update max crz altitude formula

        * fix(FMC): Fixed VNAV NaN bug

        * fix(FMC): better aligned text

        Co-authored-by: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>

    commit 63347e4
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Sun Apr 10 22:01:59 2022 +0200

        feat(fmc): improvements to simbrief uplink (#422)

        * feat(fmc): no wpt select on uplink, uplink chime, fixes

        * chore: remove debug stuff and stuff

        * fix: crz alt format on perf init uplink preview

    commit fefd120
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Tue Apr 5 23:09:08 2022 +0200

        Fix(AP): LOC intercept (#418)

        * Fix(AP): LOC intercept

    commit e150e55
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Tue Apr 5 21:44:21 2022 +0200

        chore: hard-fork (#402)

    commit 4991807
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Tue Apr 5 20:30:37 2022 +0200

        AP LOC fix (#417)

        * fix(AP): LOC Fix

    commit 1e01a99
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Sat Apr 2 21:47:49 2022 +0200

        fix: nan in fmc vnav and legs pages when no crz alt set (#415)

    commit 8ca5c8e
    Author: iamdumdum1234 <63889859+iamdumdum1234@users.noreply.github.com>
    Date:   Sat Apr 2 22:12:56 2022 +0700

        fix(fmc): Inhibit VNAV when there is no CRZ ALT + ETA in POS Report fix (#414)

    commit cb0f445
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Sat Apr 2 16:25:02 2022 +0200

        feat(AP) ILS improvements (#403)

        * Initial Commit

        * Bug Fixes

        * fix(AP): fixed AFDS Inhibits

        * feat(AP): Enabled SPD switch

        * fix(AP): SPD now activates automatically on GS capture

        * fix(AT): Fixed Auto Idle during TO/GA

        * Bug Fixes

    commit 179d0f8
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Sun Mar 27 13:48:36 2022 +0100

        fix(fmc): Fixed POS page 4 & Flightphase sequencing (#407)

    commit ad1545e
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Sun Mar 27 13:48:20 2022 +0100

        feat(debug): AP Debug Page (#408)

    commit 62cbc51
    Author: Robin Breitfeld <robin01196@gmail.com>
    Date:   Sun Mar 27 13:18:50 2022 +0200

        feat(fmc): t/d indication in progress page + unit conversion fix (#385)

    commit 5d10e5d
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Thu Mar 24 22:30:04 2022 +0000

        fix(AP) Fixed TO/GA keybind. (#404)

        * feat(MCP): Cosmetic Update

        * fix(AP) Fixed TO/GA keybind bug

    commit 2f0cf18
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Thu Mar 24 22:28:45 2022 +0000

        feat(EFIS) : Visual update (#405)

    commit 72fdb8a
    Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com>
    Date:   Thu Mar 24 22:27:47 2022 +0000

        fix(Model) Reverts Wipers to working Asobo state (#406)

    commit 2b3c14e
    Author: Ninjo <ninjomcs@gmail.com>
    Date:   Tue Mar 22 21:07:43 2022 +0100

        fix(fmc): duped waypoints on repeated waypoint selection (#412)

    commit 00462a9
    Author: Giridhar Raut <61822722+giridat@users.noreply.github.com>
    Date:   Tue Mar 22 22:33:24 2022 +0530

        fix(model): bank angle selector set to auto by default (#411)

    * fix(AP) MCP Fixes

* Reworked Heading indicator

* Readded Minimums

* Added ND Position Trend Vector

* Dynamic Segment Length
  • Loading branch information
747-4EVER committed Jun 18, 2022
1 parent 2c7f306 commit f341d4e
Showing 1 changed file with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class SvgMap {
this.trackline = document.createElementNS(Avionics.SVG.NS, "line");
this.trackline.setAttribute("x1", "500");
this.trackline.setAttribute("x2", "500");
this.trackline.setAttribute("y1", "490");
this.trackline.setAttribute("y1", "342");
this.trackline.setAttribute("y2", "0");
this.trackline.setAttribute("stroke", "white");
this.trackline.setAttribute("stroke-width", "2.5px");
Expand Down Expand Up @@ -113,6 +113,15 @@ class SvgMap {
this.halfRangeText.textContent = "80";
this.trackLineGroup.appendChild(this.halfRangeText);

/* Construct Turn Prediction Arc */
this.turnArc = document.createElementNS(Avionics.SVG.NS, "path");
this.turnArc.setAttribute("d", "M 500, 400 a 100,100 0 1,1 200,0 a 100,100 0 1,1 -200,0 ");
this.turnArc.setAttribute("stroke", "white");
this.turnArc.setAttribute("stroke-width", "3px");
this.turnArc.setAttribute("fill", "none");
this.turnArc.setAttribute("stroke-dasharray", "40 8 40 8 40 30000");
this.trackLineGroup.appendChild(this.turnArc);

/* End Salty Mods */

this.flightPlanLayer = document.createElementNS(Avionics.SVG.NS, "svg");
Expand Down Expand Up @@ -716,6 +725,40 @@ class SvgMap {
else {
this.greenArc.style.visibility = "hidden";
}
/* Update Turn Prediction */
const segDist = speed * 0.0083 / mapRange * 460;
if (Simplane.getIsGrounded()){
this.turnArc.setAttribute("stroke-dasharray", `0 30000`);
this.trackline.setAttribute("y1", `${485}`);
}
else if (mapRange > 20) {
this.turnArc.setAttribute("stroke-dasharray", `${segDist * 0.95} ${segDist * 0.05} ${segDist * 0.95} ${segDist * 0.05} ${segDist * 0.95} ${segDist * 0.05} 0 30000`);
this.trackline.setAttribute("y1", `${485 - (segDist * 3)}`);
}
else if (mapRange == 20) {
this.turnArc.setAttribute("stroke-dasharray", `${segDist * 0.95} ${segDist * 0.05} ${segDist * 0.95} ${segDist * 0.05} 0 30000`);
this.trackline.setAttribute("y1", `${485 - (segDist * 2)}`);
}
else if (mapRange == 10 || mapRange == 5 || mapRange == 2) {
this.turnArc.setAttribute("stroke-dasharray", `${segDist * 0.975} ${segDist * 0.025} 0 30000`);
this.trackline.setAttribute("y1", `${485 - (segDist)}`);
}
else {
this.turnArc.setAttribute("stroke-dasharray", `0 30000`);
this.trackline.setAttribute("y1", `${485}`);
}

const bankAngle = SimVar.GetSimVarValue("ATTITUDE INDICATOR BANK DEGREES:1", "radians");
const turnRadius = (speed * speed) / (11.26 * Math.tan(Math.abs(bankAngle))) / 4076;
const pixelRadius = turnRadius / mapRange * 460;
const arcDir = bankAngle < 0 ? pixelRadius * 2 : pixelRadius * -2;
const sweepFlag = bankAngle < 0 ? 1 : 0;
if (Math.abs(bankAngle) < 0.012) {
this.turnArc.setAttribute("d", `M500 485, v${-600}`);
}
else {
this.turnArc.setAttribute("d", `M 500, 485 a ${pixelRadius.toString()},${pixelRadius.toString()} 0 1,${sweepFlag} ${arcDir},0 a ${pixelRadius.toString()},${pixelRadius.toString()} 0 1,${sweepFlag} ${-arcDir},0 `);
}
}
}
SvgMap.Index = 0;
Expand Down

0 comments on commit f341d4e

Please sign in to comment.