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,21 +26,23 @@ var Aircraft = {
# speedLimit - max speed # speedLimit - max speed
# rolling - factor for rolling # rolling - factor for rolling
# minRwyLength - minimum runway length required, in meters # 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 # name - full name of aircraft used in route dialog
# nameMenuCall - short name of aircraft for call a plane from menu # nameMenuCall - short name of aircraft for call a plane from menu
# modelPath - Path to the aircraft model # 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] }; var obj = { parents: [Aircraft] };
obj.vs = vs; obj.vs = vs;
obj.speed = speed; obj.speed = speed;
obj.speedLimit = speedLimit; obj.speedLimit = speedLimit;
obj.rolling = rolling; obj.rolling = rolling;
obj.minRwyLength = minRwyLength; obj.minRwyLength = minRwyLength;
obj.name = name; obj.minFinalLegDist = minFinalLegDist;
obj.nameMenuCall = nameMenuCall; obj.name = name;
obj.modelPath = modelPath; obj.nameMenuCall = nameMenuCall;
obj.modelPath = modelPath;
return obj; return obj;
}, },
@ -114,15 +116,16 @@ var AircraftCub = {
# #
new: func () { new: func () {
return { return {
parents: [Aircraft], parents: [Aircraft],
vs: 200, vs: 200,
speed: 55, speed: 55,
speedLimit: 60, speedLimit: 60,
rolling: 1, rolling: 1,
minRwyLength: 280, minRwyLength: 280,
name: "Piper J3 Cub", minFinalLegDist: 5000,
nameMenuCall: "Cub", name: "Piper J3 Cub",
modelPath: "Aircraft/Aerotow/Cub/Models/Cub-ai.xml", nameMenuCall: "Cub",
modelPath: "Aircraft/Aerotow/Cub/Models/Cub-ai.xml",
}; };
}, },
}; };
@ -140,15 +143,16 @@ var AircraftRobin = {
# #
new: func () { new: func () {
return { return {
parents: [Aircraft], parents: [Aircraft],
vs: 285, vs: 285,
speed: 70, speed: 70,
speedLimit: 75, speedLimit: 75,
rolling: 2, rolling: 2,
minRwyLength: 470, minRwyLength: 470,
name: "Robin DR400", minFinalLegDist: 5400,
nameMenuCall: "DR400", name: "Robin DR400",
modelPath: "Aircraft/Aerotow/DR400/Models/dr400-ai.xml", nameMenuCall: "DR400",
modelPath: "Aircraft/Aerotow/DR400/Models/dr400-ai.xml",
}; };
}, },
}; };
@ -163,15 +167,16 @@ var AircraftRobin = {
var AircraftC182 = { var AircraftC182 = {
new: func () { new: func () {
return { return {
parents: [Aircraft], parents: [Aircraft],
vs: 295, vs: 295,
speed: 75, speed: 75,
speedLimit: 80, speedLimit: 80,
rolling: 2.2, rolling: 2.2,
minRwyLength: 508, minRwyLength: 508,
name: "Cessna 182", minFinalLegDist: 5500,
nameMenuCall: "c182", name: "Cessna 182",
modelPath: "Aircraft/Aerotow/c182/Models/c182-ai.xml", nameMenuCall: "c182",
modelPath: "Aircraft/Aerotow/c182/Models/c182-ai.xml",
}; };
}, },
}; };
@ -186,15 +191,16 @@ var AircraftC182 = {
var AircraftC47 = { var AircraftC47 = {
new: func () { new: func () {
return { return {
parents: [Aircraft], parents: [Aircraft],
vs: 310, vs: 310,
speed: 85, speed: 85,
speedLimit: 90, speedLimit: 90,
rolling: 2.2, rolling: 2.2,
minRwyLength: 508, minRwyLength: 508,
name: "Douglas C-47", minFinalLegDist: 6000,
nameMenuCall: "C47", name: "Douglas C-47",
modelPath: "Aircraft/Aerotow/C-47/Models/c-47-ai.xml", 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}); me.addWptAir({"shift": {"hdgChange": 90, "dist": halfRwyLenght, "elevation": elevation}, "ktas": aircraft.speed});
# Fly downwind away of threshold, how far depend of the altitude # Fly downwind away of threshold, how far depend of the altitude
var desiredElevation = 2000; var desiredElevation = 1400;
var distance = (((elevation - desiredElevation) / (aircraft.vs * 3)) * 1000); var distance = (((elevation - desiredElevation) / (aircraft.vs * 2)) * 1000);
if (distance < 3000) { if (distance < aircraft.minFinalLegDist) {
distance = 3000; distance = aircraft.minFinalLegDist;
} }
me.addWptAir({"shift": {"hdgChange": -180, "dist": halfRwyLenght + distance, "elevation": desiredElevation}, "ktas": aircraft.speed}); me.addWptAir({"shift": {"hdgChange": -180, "dist": halfRwyLenght + distance, "elevation": desiredElevation}, "ktas": aircraft.speed});