Improve the approach to landing

This commit is contained in:
PlayeRom 2022-09-17 20:32:56 +02:00
parent 1d5bd7c7f5
commit f529f2ce7c
2 changed files with 55 additions and 49 deletions

View File

@ -26,11 +26,12 @@ var Aircraft = {
# speedLimit - max speed
# rolling - factor for rolling
# minRwyLength - minimum runway length required, in meters
# minFinalLegDist - minimum distance for final leg in meters (for landing)
# name - full name of aircraft used in route dialog
# nameMenuCall - short name of aircraft for call a plane from menu
# modelPath - Path to the aircraft model
#
new: func (vs, speed, speedLimit, rolling, minRwyLength, name, nameMenuCall, modelPath) {
new: func (vs, speed, speedLimit, rolling, minRwyLength, minFinalLegDist, name, nameMenuCall, modelPath) {
var obj = { parents: [Aircraft] };
obj.vs = vs;
@ -38,6 +39,7 @@ var Aircraft = {
obj.speedLimit = speedLimit;
obj.rolling = rolling;
obj.minRwyLength = minRwyLength;
obj.minFinalLegDist = minFinalLegDist;
obj.name = name;
obj.nameMenuCall = nameMenuCall;
obj.modelPath = modelPath;
@ -120,6 +122,7 @@ var AircraftCub = {
speedLimit: 60,
rolling: 1,
minRwyLength: 280,
minFinalLegDist: 5000,
name: "Piper J3 Cub",
nameMenuCall: "Cub",
modelPath: "Aircraft/Aerotow/Cub/Models/Cub-ai.xml",
@ -146,6 +149,7 @@ var AircraftRobin = {
speedLimit: 75,
rolling: 2,
minRwyLength: 470,
minFinalLegDist: 5400,
name: "Robin DR400",
nameMenuCall: "DR400",
modelPath: "Aircraft/Aerotow/DR400/Models/dr400-ai.xml",
@ -169,6 +173,7 @@ var AircraftC182 = {
speedLimit: 80,
rolling: 2.2,
minRwyLength: 508,
minFinalLegDist: 5500,
name: "Cessna 182",
nameMenuCall: "c182",
modelPath: "Aircraft/Aerotow/c182/Models/c182-ai.xml",
@ -192,6 +197,7 @@ var AircraftC47 = {
speedLimit: 90,
rolling: 2.2,
minRwyLength: 508,
minFinalLegDist: 6000,
name: "Douglas C-47",
nameMenuCall: "C47",
modelPath: "Aircraft/Aerotow/C-47/Models/c-47-ai.xml",

View File

@ -315,10 +315,10 @@ var FlightPlan = {
me.addWptAir({"shift": {"hdgChange": 90, "dist": halfRwyLenght, "elevation": elevation}, "ktas": aircraft.speed});
# Fly downwind away of threshold, how far depend of the altitude
var desiredElevation = 2000;
var distance = (((elevation - desiredElevation) / (aircraft.vs * 3)) * 1000);
if (distance < 3000) {
distance = 3000;
var desiredElevation = 1400;
var distance = (((elevation - desiredElevation) / (aircraft.vs * 2)) * 1000);
if (distance < aircraft.minFinalLegDist) {
distance = aircraft.minFinalLegDist;
}
me.addWptAir({"shift": {"hdgChange": -180, "dist": halfRwyLenght + distance, "elevation": desiredElevation}, "ktas": aircraft.speed});