diff --git a/md11-nav-data/src/App.tsx b/md11-nav-data/src/App.tsx index 163d1cf..270b871 100644 --- a/md11-nav-data/src/App.tsx +++ b/md11-nav-data/src/App.tsx @@ -17,6 +17,7 @@ function App() { const [params, setParams] = useState(null); const [selectedTransition, setSelectedTransition] = useState(); const [selectedChart, setSelectedChart] = useState(); + const [skippedNG, setSkippedNG] = useState(false); const { user, signIn, initialized } = useNavigraphAuth(); @@ -42,16 +43,22 @@ function App() { return ( <> - {!user ? ( + {!user && !skippedNG ? (
{initialized && !params && ( -
+
+
)} @@ -79,6 +86,7 @@ function App() { transitions={transitions} transition={selectedTransition} chart={selectedChart} + skippedNG={skippedNG} setTransition={setSelectedTransition} setChart={setSelectedChart} backAction={() => { diff --git a/md11-nav-data/src/components/Sidebar.tsx b/md11-nav-data/src/components/Sidebar.tsx index eba86b6..87b0649 100644 --- a/md11-nav-data/src/components/Sidebar.tsx +++ b/md11-nav-data/src/components/Sidebar.tsx @@ -12,6 +12,7 @@ interface SidebarProps { transitions: Procedure[]; transition: Procedure | undefined; chart: Chart | undefined; + skippedNG?: boolean; setTransition: Dispatch>; setChart: Dispatch>; backAction: () => void; @@ -24,6 +25,7 @@ export const Sidebar: FC = ({ transitions, transition, chart, + skippedNG, setTransition, setChart, backAction, @@ -36,6 +38,8 @@ export const Sidebar: FC = ({ }>({ star: [], sid: [], iap: [] }); useEffect(() => { + if (skippedNG) return; + setInFlight(true); (async () => { const _chartIndex = await charts.getChartsIndex({ icao: airport.ICAO, version: 'STD' }); @@ -134,61 +138,63 @@ export const Sidebar: FC = ({ ))}
-
-
Charts
- {inFlight && } - + {!skippedNG && (
-
Arrivals
- {chartIndex.star - .filter((_chart) => _chart.is_georeferenced) - .map((_chart) => ( - - ))} -
+
Charts
+ {inFlight && } -
-
Departures
- {chartIndex.sid - .filter((_chart) => _chart.is_georeferenced) - .map((_chart) => ( - - ))} -
+
+
Arrivals
+ {chartIndex.star + .filter((_chart) => _chart.is_georeferenced) + .map((_chart) => ( + + ))} +
-
-
Approaches
- {chartIndex.iap - .filter((_chart) => _chart.is_georeferenced) - .map((_chart) => ( - - ))} +
+
Departures
+ {chartIndex.sid + .filter((_chart) => _chart.is_georeferenced) + .map((_chart) => ( + + ))} +
+ +
+
Approaches
+ {chartIndex.iap + .filter((_chart) => _chart.is_georeferenced) + .map((_chart) => ( + + ))} +
-
+ )}
); diff --git a/md11-nav-data/src/parser/terminators/TF.ts b/md11-nav-data/src/parser/terminators/TF.ts index 007a73b..f9aa72d 100644 --- a/md11-nav-data/src/parser/terminators/TF.ts +++ b/md11-nav-data/src/parser/terminators/TF.ts @@ -32,7 +32,7 @@ export const TerminatorsTF = ( // Compute overfly arc let arc1: LineSegment[] | null = null; let arc2: LineSegment[] = [[previousFix.longitude, previousFix.latitude]]; - if (previousFix.isFlyOver) { + if (previousFix.isFlyOver && !lastCourse.equal(crsIntoEndpoint, 0.5)) { arc1 = generateTangentArc(crsIntoEndpoint, lastCourse, previousFix, targetFix, leg.TurnDir); } else { arc1 = [[previousFix.longitude, previousFix.latitude]]; diff --git a/md11-nav-data/src/parser/utils/extensions.ts b/md11-nav-data/src/parser/utils/extensions.ts index 0240f1d..e72745a 100644 --- a/md11-nav-data/src/parser/utils/extensions.ts +++ b/md11-nav-data/src/parser/utils/extensions.ts @@ -59,8 +59,8 @@ Number.prototype.toTrue = function (fix) { Number.prototype.toMetre = function () { return (this as number) * 1852.0; }; -Number.prototype.equal = function (other: number) { - return Math.abs((this as number) - other) <= 0.1; +Number.prototype.equal = function (other: number, accuracy = 0.1) { + return Math.abs((this as number) - other) <= accuracy; }; String.prototype.parseAltitude = function () { diff --git a/md11-nav-data/src/types/extensions.d.ts b/md11-nav-data/src/types/extensions.d.ts index 8670fcf..c43ef64 100644 --- a/md11-nav-data/src/types/extensions.d.ts +++ b/md11-nav-data/src/types/extensions.d.ts @@ -26,9 +26,9 @@ export declare global { */ toMetre: () => number; /** - * @returns True if delta is less than 0.1 + * @returns True if delta is less than accuracy (default 0.1) */ - equal: (other: number) => boolean; + equal: (other: number, accuracy?: number) => boolean; } interface String {