4 Commits

Author SHA1 Message Date
PlayeRom
5f83865218 Update help and readme 2022-11-09 23:11:31 +01:00
PlayeRom
a0ca6ac045 Code review 2022-11-09 18:27:53 +01:00
PlayeRom
a9b20818cd Update version to 1.8.1 2022-09-17 20:34:06 +02:00
PlayeRom
f529f2ce7c Improve the approach to landing 2022-09-17 20:32:56 +02:00
11 changed files with 91 additions and 60 deletions

View File

@@ -1,5 +1,9 @@
# CHANGELOG
## v.1.8.1
- Improve the approach to landing
## v.1.8.0
- The tow plane, after completing its route, returns to the runway from which it took off. For a bush take-off it does not land.

View File

@@ -22,7 +22,7 @@ Where `{username}` is the name of the user logged into the operating system.
Start FlightGear at any airport with your aircraft as a glider, such as ASK 21.
From the top menu, select `Aerotow Everywhere` -> `Call for Piper J3 Cub aircraft`, `Robin DR400` or `Cessna 182` (yes, you can choose from many aircrafts). The AI aircraft will appear to your right and align to the centreline of the runway in front of you. At this time you should hook up to the aircraft, most often by pressing the `Ctrl-o` key (check help of your glider). The AI aircraft will begin to accelerate and take off.
From the top menu, select `Aerotow Everywhere` -> `Call for Piper J3 Cub aircraft`, `Robin DR400`, `Cessna 182` or `Douglas C-47`. (Yes, you can choose from many aircrafts). The AI aircraft will appear to your right and align to the centreline of the runway in front of you. At this time you should hook up to the aircraft, most often by pressing the `Ctrl-o` key (check help of your glider). The AI aircraft will begin to accelerate and take off.
You can also take off in the bush. Then the tow plane will position itself in front of you (glider's course), so what heading you have is important. If you move away from the runway threshold further than 100 m, then the take-off of the tow plane will be as in the bush, i.e. according to the glider heading and not the runway.
@@ -122,7 +122,7 @@ Many thanks to the FG forum user "wlbragg" for proposing and presenting a soluti
## Troubleshotting
1. When I select `Aerotow Everywhere` -> `Call for Piper J3 Cub aircraft`, `Robin DR400` or `Cessana 182` from menu, I see "Let's fly!" message but nothing happened. The tow plane does not appear.
1. When I select `Aerotow Everywhere` -> `Call for Piper J3 Cub aircraft`, `Robin DR400`, `Cessana 182` or `Douglas C-47` from menu, I see "Let's fly!" message but nothing happened. The tow plane does not appear.
Probably you didn't include the `--data` command line option with the path where FlightGear should look for additional flight plan files for AI. Unfortunately, the simulator does not inform us that there was a problem with finding the flight plan file, so everything looks like it should work but does not.

View File

@@ -58,10 +58,10 @@
</sound>
<help-text type="string">=== How to start? ===
From the top menu, select "Aerotow Everywhere" -> "Call for Piper J3 Cub aircraft", "Robin DR400" or "Cessna 182" (yes, you can choose from many aircrafts).
The tow aircraft will appear to your right and align to the centreline of the runway in front of you. At this time you should hook up to the aircraft, most often by `Ctrl-o` key (check help of your glider). The aircraft will begin to accelerate and take off.
From the top menu, select "Aerotow Everywhere" -> "Call for Piper J3 Cub aircraft", "Robin DR400", "Cessna 182" or "Douglas C-47". (Yes, you can choose from many aircrafts.)
The tow aircraft will appear to your right and align to the centreline of the runway in front of you. At this time you should hook up to the aircraft, most often by `Ctrl-o` key. Check help of your glider. The aircraft will begin to accelerate and take off.
By default, the tow plane always takes off in front of your runway and flies along the runway for 5 km, then turns back and flies downwind for 6 km, then turns back again and flies another 6 km. During this flight it is constantly gaining altitude. Then when it has completed the entire set route it simply turns right 90 degrees and flies at a constant altitude.
The tow plane always takes off in front of your runway and flies along the runway for 5 km, then turns back and flies downwind for 6 km, then turns back again and flies another 6 km. During this flight it is constantly gaining altitude. Then, after having flown the entire given route, it lands at the airport from which it took off or when start in the bush turns in an unknown direction and flies at a constant altitude. If the aircraft lands at the airport, the scenario starts again, i.e. the aircraft respawn to take-off again.
You can disconnect from the aircraft at any time, most often by pressing the `o` key.

View File

@@ -21,7 +21,7 @@
<addon>
<identifier type="string">org.flightgear.addons.Aerotow</identifier>
<name type="string">Aerotow Everywhere</name>
<version type="string">1.8.0</version>
<version type="string">1.8.1</version>
<authors>
<author>

View File

@@ -45,7 +45,7 @@
<hrule/>
<text>
<label>Aerotow Everywhere version 1.8.0 - 9th September 2022</label>
<label>Aerotow Everywhere version 1.8.1 - 17th September 2022</label>
</text>
<text>

View File

@@ -42,6 +42,7 @@ var Aerotow = {
#
del: func () {
me.thermal.del();
me.scenario.del();
foreach (var listener; me.listeners) {
removelistener(listener);

View File

@@ -26,21 +26,23 @@ 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;
obj.speed = speed;
obj.speedLimit = speedLimit;
obj.rolling = rolling;
obj.minRwyLength = minRwyLength;
obj.name = name;
obj.nameMenuCall = nameMenuCall;
obj.modelPath = modelPath;
obj.vs = vs;
obj.speed = speed;
obj.speedLimit = speedLimit;
obj.rolling = rolling;
obj.minRwyLength = minRwyLength;
obj.minFinalLegDist = minFinalLegDist;
obj.name = name;
obj.nameMenuCall = nameMenuCall;
obj.modelPath = modelPath;
return obj;
},
@@ -114,15 +116,16 @@ var AircraftCub = {
#
new: func () {
return {
parents: [Aircraft],
vs: 200,
speed: 55,
speedLimit: 60,
rolling: 1,
minRwyLength: 280,
name: "Piper J3 Cub",
nameMenuCall: "Cub",
modelPath: "Aircraft/Aerotow/Cub/Models/Cub-ai.xml",
parents: [Aircraft],
vs: 200,
speed: 55,
speedLimit: 60,
rolling: 1,
minRwyLength: 280,
minFinalLegDist: 5000,
name: "Piper J3 Cub",
nameMenuCall: "Cub",
modelPath: "Aircraft/Aerotow/Cub/Models/Cub-ai.xml",
};
},
};
@@ -140,15 +143,16 @@ var AircraftRobin = {
#
new: func () {
return {
parents: [Aircraft],
vs: 285,
speed: 70,
speedLimit: 75,
rolling: 2,
minRwyLength: 470,
name: "Robin DR400",
nameMenuCall: "DR400",
modelPath: "Aircraft/Aerotow/DR400/Models/dr400-ai.xml",
parents: [Aircraft],
vs: 285,
speed: 70,
speedLimit: 75,
rolling: 2,
minRwyLength: 470,
minFinalLegDist: 5400,
name: "Robin DR400",
nameMenuCall: "DR400",
modelPath: "Aircraft/Aerotow/DR400/Models/dr400-ai.xml",
};
},
};
@@ -163,15 +167,16 @@ var AircraftRobin = {
var AircraftC182 = {
new: func () {
return {
parents: [Aircraft],
vs: 295,
speed: 75,
speedLimit: 80,
rolling: 2.2,
minRwyLength: 508,
name: "Cessna 182",
nameMenuCall: "c182",
modelPath: "Aircraft/Aerotow/c182/Models/c182-ai.xml",
parents: [Aircraft],
vs: 295,
speed: 75,
speedLimit: 80,
rolling: 2.2,
minRwyLength: 508,
minFinalLegDist: 5500,
name: "Cessna 182",
nameMenuCall: "c182",
modelPath: "Aircraft/Aerotow/c182/Models/c182-ai.xml",
};
},
};
@@ -186,15 +191,16 @@ var AircraftC182 = {
var AircraftC47 = {
new: func () {
return {
parents: [Aircraft],
vs: 310,
speed: 85,
speedLimit: 90,
rolling: 2.2,
minRwyLength: 508,
name: "Douglas C-47",
nameMenuCall: "C47",
modelPath: "Aircraft/Aerotow/C-47/Models/c-47-ai.xml",
parents: [Aircraft],
vs: 310,
speed: 85,
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

@@ -17,11 +17,13 @@ var RouteDialog = {
# Constants
#
ROUTE_SAVES_DIR: "route-saves",
MAX_ROUTE_WAYPOINTS: 10,
#
# Constructor
#
# addon - Addon object
# message - Message object
#
new: func (addon, message) {
var obj = { parents: [RouteDialog] };
@@ -31,7 +33,6 @@ var RouteDialog = {
obj.addonNodePath = addon.node.getPath();
obj.savePath = addon.storagePath ~ "/" ~ RouteDialog.ROUTE_SAVES_DIR;
obj.maxRouteWaypoints = 10;
obj.listeners = [];
# Set listener for aerotow combo box value in route dialog for recalculate altitude change
@@ -45,7 +46,7 @@ var RouteDialog = {
}));
# Set listeners for distance fields for calculate altitude change
for (var i = 0; i < obj.maxRouteWaypoints; i += 1) {
for (var i = 0; i < RouteDialog.MAX_ROUTE_WAYPOINTS; i += 1) {
append(obj.listeners, setlistener(obj.addonNodePath ~ "/addon-devel/route/wpts/wpt[" ~ i ~ "]/distance-m", func () {
obj.calculateAltChangeAndTotals();
}));
@@ -78,7 +79,7 @@ var RouteDialog = {
# 0 means without altitude limits
var maxAltAgl = getprop(me.addonNodePath ~ "/addon-devel/route/wpts/max-alt-agl") or 0;
for (var i = 0; i < me.maxRouteWaypoints; i += 1) {
for (var i = 0; i < RouteDialog.MAX_ROUTE_WAYPOINTS; i += 1) {
var distance = getprop(me.addonNodePath ~ "/addon-devel/route/wpts/wpt[" ~ i ~ "]/distance-m") or 0;
# If we have reached the altitude limit, the altitude no longer changes (0)

View File

@@ -43,6 +43,13 @@ var FlightPlan = {
return obj;
},
#
# Destructor
#
del: func () {
me.flightPlanWriter.del();
},
#
# Get inital location of glider.
#
@@ -315,10 +322,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});

View File

@@ -21,19 +21,30 @@ var FlightPlanWriter = {
new: func (addon) {
var obj = { parents: [FlightPlanWriter] };
obj.fpFileHandler = nil; # Handler for wrire flight plan to file
obj.fpFileHandler = nil; # Handler for wrire flight plan to the file
obj.flightPlanPath = addon.storagePath ~ "/AI/FlightPlans/" ~ FlightPlan.FILENAME_FLIGHTPLAN;
obj.wptCount = 1;
return obj;
},
#
# Destructor
#
del: func () {
me.close();
},
#
# Open XML file to wrire flight plan
#
open: func () {
me.wptCount = 1;
if (me.fpFileHandler) {
io.close(me.fpFileHandler);
}
me.fpFileHandler = io.open(me.flightPlanPath, "w");
if (me.fpFileHandler) {

View File

@@ -56,6 +56,7 @@ var Scenario = {
#
del: func () {
me.routeDialog.del();
me.flightPlan.del();
foreach (var listener; me.listeners) {
removelistener(listener);