13 lines
314 B
TypeScript
13 lines
314 B
TypeScript
import Parser from '../parser';
|
|
|
|
export const computeSpeed = (leg: TerminalEntry, previousFix: NavFix) => {
|
|
if (leg.SpeedLimit) return leg.SpeedLimit;
|
|
if (previousFix.speed) {
|
|
if (previousFix.speed < Parser.AC_SPEED) return Parser.AC_SPEED;
|
|
|
|
return previousFix.speed;
|
|
}
|
|
|
|
return Parser.AC_SPEED;
|
|
};
|