Integration finished
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
export const ImportFlightPlanKH = async (
|
||||
plan: any,
|
||||
maxZFW: number,
|
||||
maxTOW: number,
|
||||
maxFuel: number,
|
||||
isImperial: boolean
|
||||
) => {
|
||||
import { SimBrief } from '../types/general';
|
||||
|
||||
export const ImportFlightPlanKH = (plan: any, maxZFW: number, maxTOW: number, maxFuel: number, isImperial: boolean) => {
|
||||
if (!plan) return { type: 'error', message: 'Empty plan' };
|
||||
|
||||
let convFactor = 1;
|
||||
if (plan.params.units === 'kgs' && isImperial) convFactor = 2.20462262185;
|
||||
if (plan.params.units === 'lbs' && !isImperial) convFactor = 1 / 2.20462262185;
|
||||
@@ -17,6 +15,6 @@ export const ImportFlightPlanKH = async (
|
||||
pax: plan.weights.pax_count_actual,
|
||||
cargo: Math.round(plan.weights.freight_added * convFactor),
|
||||
fuel: Math.min(maxFuel, Math.round(plan.fuel.plan_ramp * convFactor)),
|
||||
},
|
||||
} as SimBrief,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user