Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29103533fb | ||
|
|
5aa5f731a6 | ||
|
|
1982df9f16 | ||
|
|
bd40f6830e | ||
|
|
1f8ea67e44 | ||
|
|
0c3046da80 | ||
|
|
267b231d8c |
@@ -1,5 +1,13 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v.1.3.0
|
||||
|
||||
- Add engine sound for AI aircrafts
|
||||
|
||||
## v.1.2.0
|
||||
|
||||
- Add possibility to change the flight plan of AI tow plane.
|
||||
|
||||
## v.1.1.0
|
||||
|
||||
- Fix AI aircraft going underground during take-off due to uneven runway elevations.
|
||||
|
||||
7
FGData/AI/Aircraft/Aerotow/Cub/Models/Cub-ai.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList include="AI/Aircraft/Cub/Models/Cub-ai.xml">
|
||||
<sound>
|
||||
<path>AI/Aircraft/Aerotow/Sound/sound.xml</path>
|
||||
</sound>
|
||||
</PropertyList>
|
||||
66879
FGData/AI/Aircraft/Aerotow/Cub/Models/Cub.ac
Normal file
BIN
FGData/AI/Aircraft/Aerotow/Cub/Models/placards.png
Normal file
|
After Width: | Height: | Size: 423 KiB |
BIN
FGData/AI/Aircraft/Aerotow/Cub/Models/propeller.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
FGData/AI/Aircraft/Aerotow/Cub/Models/propeller_slow.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
FGData/AI/Aircraft/Aerotow/Cub/Models/texture.png
Normal file
|
After Width: | Height: | Size: 4.6 MiB |
7
FGData/AI/Aircraft/Aerotow/DR400/Models/dr400-ai.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<PropertyList include="AI/Aircraft/DR400/Models/dr400-ai.xml">
|
||||
<sound>
|
||||
<path>AI/Aircraft/Aerotow/Sound/sound.xml</path>
|
||||
</sound>
|
||||
</PropertyList>
|
||||
44494
FGData/AI/Aircraft/Aerotow/DR400/Models/dr400.ac
Normal file
48
FGData/AI/Aircraft/Aerotow/DR400/Models/light/GreenLight.ac
Normal file
@@ -0,0 +1,48 @@
|
||||
AC3Db
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
OBJECT world
|
||||
kids 1
|
||||
OBJECT poly
|
||||
name "Light"
|
||||
data 4
|
||||
Mesh
|
||||
texture "lights.png"
|
||||
texrep 1 1
|
||||
crease 45.000000
|
||||
numvert 12
|
||||
0.5 0.5 0
|
||||
-0.5 0.5 0
|
||||
-0.5 -0.5 0
|
||||
0.5 -0.5 0
|
||||
0 -0.5 -0.5
|
||||
0 -0.5 0.5
|
||||
0 0.5 0.5
|
||||
0 0.5 -0.5
|
||||
0.5 0 -0.5
|
||||
-0.5 0 -0.5
|
||||
-0.5 0 0.5
|
||||
0.5 0 0.5
|
||||
numsurf 3
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
0 0.948961138725 0.442461937666
|
||||
1 0.563538074493 0.442461848259
|
||||
2 0.563538074493 0.0570387989283
|
||||
3 0.948961138725 0.0570387542248
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
7 0.948961257935 0.0570388287306
|
||||
6 0.948961257935 0.442461937666
|
||||
5 0.563538074493 0.442461937666
|
||||
4 0.563538074493 0.0570387542248
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
11 0.948961257935 0.442461937666
|
||||
10 0.563538193703 0.442461937666
|
||||
9 0.563538074493 0.0570388287306
|
||||
8 0.948961257935 0.0570387542248
|
||||
kids 0
|
||||
38
FGData/AI/Aircraft/Aerotow/DR400/Models/light/GreenLight.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<path>GreenLight.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Light</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>Light</object-name>
|
||||
<emission>
|
||||
<red> 1.0 </red>
|
||||
<green> 1.0 </green>
|
||||
<blue> 1.0 </blue>
|
||||
</emission>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Light</object-name>
|
||||
<interpolation>
|
||||
<entry><ind> 0 </ind><dep> 0.25 </dep></entry>
|
||||
<entry><ind> 20 </ind><dep> 0.50 </dep></entry>
|
||||
<entry><ind> 1500 </ind><dep> 5.00 </dep></entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
48
FGData/AI/Aircraft/Aerotow/DR400/Models/light/RedLight.ac
Normal file
@@ -0,0 +1,48 @@
|
||||
AC3Db
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
OBJECT world
|
||||
kids 1
|
||||
OBJECT poly
|
||||
name "Light"
|
||||
data 4
|
||||
Mesh
|
||||
texture "lights.png"
|
||||
texrep 1 1
|
||||
crease 45.000000
|
||||
numvert 12
|
||||
0.5 0.5 0
|
||||
-0.5 0.5 0
|
||||
-0.5 -0.5 0
|
||||
0.5 -0.5 0
|
||||
0 -0.5 -0.5
|
||||
0 -0.5 0.5
|
||||
0 0.5 0.5
|
||||
0 0.5 -0.5
|
||||
0.5 0 -0.5
|
||||
-0.5 0 -0.5
|
||||
-0.5 0 0.5
|
||||
0.5 0 0.5
|
||||
numsurf 3
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
0 0.448961138725 0.442461937666
|
||||
1 0.0635380744934 0.442461848259
|
||||
2 0.0635380744934 0.0570387989283
|
||||
3 0.448961138725 0.0570387542248
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
7 0.448961257935 0.0570388287306
|
||||
6 0.448961257935 0.442461937666
|
||||
5 0.0635380744934 0.442461937666
|
||||
4 0.0635380744934 0.0570387542248
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
11 0.448961257935 0.442461937666
|
||||
10 0.0635381937027 0.442461937666
|
||||
9 0.0635380744934 0.0570388287306
|
||||
8 0.448961257935 0.0570387542248
|
||||
kids 0
|
||||
38
FGData/AI/Aircraft/Aerotow/DR400/Models/light/RedLight.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<path>RedLight.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Light</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>Light</object-name>
|
||||
<emission>
|
||||
<red> 1.0 </red>
|
||||
<green> 1.0 </green>
|
||||
<blue> 1.0 </blue>
|
||||
</emission>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Light</object-name>
|
||||
<interpolation>
|
||||
<entry><ind> 0 </ind><dep> 0.25 </dep></entry>
|
||||
<entry><ind> 20 </ind><dep> 0.50 </dep></entry>
|
||||
<entry><ind> 1500 </ind><dep> 5.00 </dep></entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<path>WhiteLight.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Light</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>Light</object-name>
|
||||
<emission>
|
||||
<red> 1.0 </red>
|
||||
<green> 1.0 </green>
|
||||
<blue> 1.0 </blue>
|
||||
</emission>
|
||||
</animation>
|
||||
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Light</object-name>
|
||||
<interpolation>
|
||||
<entry><ind> 0 </ind><dep> 0.25 </dep></entry>
|
||||
<entry><ind> 20 </ind><dep> 0.50 </dep></entry>
|
||||
<entry><ind> 1500 </ind><dep> 5.00 </dep></entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
<PropertyList>
|
||||
<path>toggle-white.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Cube</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Cube</object-name>
|
||||
<interpolation>
|
||||
<entry>
|
||||
<ind>0</ind>
|
||||
<dep>0.25</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>20</ind>
|
||||
<dep>.50</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>1500</ind>
|
||||
<dep>5</dep>
|
||||
</entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
48
FGData/AI/Aircraft/Aerotow/DR400/Models/light/WhiteLight.ac
Normal file
@@ -0,0 +1,48 @@
|
||||
AC3Db
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
OBJECT world
|
||||
kids 1
|
||||
OBJECT poly
|
||||
name "Light"
|
||||
data 4
|
||||
Mesh
|
||||
texture "lights.png"
|
||||
texrep 1 1
|
||||
crease 45.000000
|
||||
numvert 12
|
||||
0.5 0.5 0
|
||||
-0.5 0.5 0
|
||||
-0.5 -0.5 0
|
||||
0.5 -0.5 0
|
||||
0 -0.5 -0.5
|
||||
0 -0.5 0.5
|
||||
0 0.5 0.5
|
||||
0 0.5 -0.5
|
||||
0.5 0 -0.5
|
||||
-0.5 0 -0.5
|
||||
-0.5 0 0.5
|
||||
0.5 0 0.5
|
||||
numsurf 3
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
0 0.943492412567 0.942461967468
|
||||
1 0.558069348335 0.942461848259
|
||||
2 0.558069348335 0.557038784027
|
||||
3 0.943492412567 0.557038784027
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
7 0.943492531776 0.557038843632
|
||||
6 0.943492531776 0.942461967468
|
||||
5 0.558069348335 0.942461967468
|
||||
4 0.558069348335 0.557038784027
|
||||
SURF 0x20
|
||||
mat 1
|
||||
refs 4
|
||||
11 0.943492531776 0.942461967468
|
||||
10 0.558069467545 0.942461967468
|
||||
9 0.558069348335 0.557038843632
|
||||
8 0.943492531776 0.557038784027
|
||||
kids 0
|
||||
38
FGData/AI/Aircraft/Aerotow/DR400/Models/light/WhiteLight.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<path>WhiteLight.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Light</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>Light</object-name>
|
||||
<emission>
|
||||
<red> 1.0 </red>
|
||||
<green> 1.0 </green>
|
||||
<blue> 1.0 </blue>
|
||||
</emission>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Light</object-name>
|
||||
<interpolation>
|
||||
<entry><ind> 0 </ind><dep> 0.25 </dep></entry>
|
||||
<entry><ind> 20 </ind><dep> 0.50 </dep></entry>
|
||||
<entry><ind> 1500 </ind><dep> 5.00 </dep></entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
38
FGData/AI/Aircraft/Aerotow/DR400/Models/light/beacon.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<path>RedLight.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Light</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>Light</object-name>
|
||||
<emission>
|
||||
<red> 1.0 </red>
|
||||
<green> 1.0 </green>
|
||||
<blue> 1.0 </blue>
|
||||
</emission>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Light</object-name>
|
||||
<interpolation>
|
||||
<entry><ind> 0 </ind><dep> 0.25 </dep></entry>
|
||||
<entry><ind> 20 </ind><dep> 0.50 </dep></entry>
|
||||
<entry><ind> 1500 </ind><dep> 5.00 </dep></entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
3268
FGData/AI/Aircraft/Aerotow/DR400/Models/light/light-cone.ac
Normal file
12
FGData/AI/Aircraft/Aerotow/DR400/Models/light/light-cone.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<path>light-cone.ac</path>
|
||||
|
||||
<effect>
|
||||
<inherits-from>Effects/light-cone</inherits-from>
|
||||
<object-name>Cone</object-name>
|
||||
</effect>
|
||||
|
||||
</PropertyList>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
BIN
FGData/AI/Aircraft/Aerotow/DR400/Models/light/lights.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,95 @@
|
||||
AC3Db
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
MATERIAL "Material" rgb 0.92013 0.92013 0.92013 amb 0.5 0.5 0.5 emis 0 0 0 spec 1 1 1 shi 32 trans 0
|
||||
OBJECT world
|
||||
kids 1
|
||||
OBJECT poly
|
||||
name "Cube"
|
||||
data 4
|
||||
Cube
|
||||
crease 30
|
||||
numvert 12
|
||||
0.009182 0.007635 -0.00748
|
||||
0.001377 -0.000598 -0.00748
|
||||
-0.005892 0.002033 -0.00748
|
||||
-0.001976 0.012793 -0.00748
|
||||
0.009182 0.007635 0.00748
|
||||
0.001377 -0.000598 0.00748
|
||||
-0.005892 0.002033 0.00748
|
||||
-0.001976 0.012793 0.00748
|
||||
-0.009655 -0.008307 -0.00748
|
||||
-0.009655 -0.008307 0.00748
|
||||
0.002203 -0.01154 -0.00748
|
||||
0.002203 -0.01154 0.00748
|
||||
numsurf 10
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
0 0 0
|
||||
1 0 0
|
||||
2 0 0
|
||||
3 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
4 0 0
|
||||
7 0 0
|
||||
6 0 0
|
||||
5 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
0 0 0
|
||||
4 0 0
|
||||
5 0 0
|
||||
1 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
2 0 0
|
||||
6 0 0
|
||||
7 0 0
|
||||
3 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
6 0 0
|
||||
2 0 0
|
||||
8 0 0
|
||||
9 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
1 0 0
|
||||
5 0 0
|
||||
11 0 0
|
||||
10 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
5 0 0
|
||||
6 0 0
|
||||
9 0 0
|
||||
11 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
2 0 0
|
||||
1 0 0
|
||||
10 0 0
|
||||
8 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
10 0 0
|
||||
11 0 0
|
||||
9 0 0
|
||||
8 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
0 0 0
|
||||
3 0 0
|
||||
7 0 0
|
||||
4 0 0
|
||||
kids 0
|
||||
BIN
FGData/AI/Aircraft/Aerotow/DR400/Models/prop.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
FGData/AI/Aircraft/Aerotow/DR400/Models/texture.png
Normal file
|
After Width: | Height: | Size: 361 KiB |
BIN
FGData/AI/Aircraft/Aerotow/DR400/Models/texture.xcf.gz
Normal file
25
FGData/AI/Aircraft/Aerotow/Sound/sound.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?>
|
||||
<PropertyList>
|
||||
<fx>
|
||||
<engine>
|
||||
<name>engine</name>
|
||||
<mode>looped</mode>
|
||||
<path>wasp.wav</path>
|
||||
<condition>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/sound/enable</property>
|
||||
</condition>
|
||||
<volume>
|
||||
<offset>-0.80</offset>
|
||||
</volume>
|
||||
<pitch>
|
||||
<property>velocities/true-airspeed-kt</property>
|
||||
<factor>0.012</factor>
|
||||
<offset>0.3</offset>
|
||||
<min>0.3</min>
|
||||
<max>1.0</max>
|
||||
</pitch>
|
||||
<reference-dist>150.0</reference-dist>
|
||||
<max-dist>5000.0</max-dist>
|
||||
</engine>
|
||||
</fx>
|
||||
</PropertyList>
|
||||
BIN
FGData/AI/Aircraft/Aerotow/Sound/wasp.wav
Normal file
53
FGData/AI/Aircraft/Aerotow/c182/Models/BeaconLight.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0"?>
|
||||
<PropertyList>
|
||||
<path>WhiteLight1.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Light</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>Light</object-name>
|
||||
<emission>
|
||||
<red>1.0</red>
|
||||
<green>0.0</green>
|
||||
<blue>0.0</blue>
|
||||
</emission>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>Light</object-name>
|
||||
<condition>
|
||||
<and>
|
||||
<greater-than>
|
||||
<property>/sim/time/sun-angle-rad</property>
|
||||
<value>1.57</value>
|
||||
</greater-than>
|
||||
<greater-than>
|
||||
<property>velocities/true-airspeed-kt</property>
|
||||
<value>0</value>
|
||||
</greater-than>
|
||||
</and>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Light</object-name>
|
||||
<interpolation>
|
||||
<entry><ind>0</ind><dep>0.25</dep></entry>
|
||||
<entry><ind>20</ind><dep>0.50</dep></entry>
|
||||
<entry><ind>1500</ind><dep>5</dep></entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
BIN
FGData/AI/Aircraft/Aerotow/c182/Models/Halos.rgb
Normal file
35
FGData/AI/Aircraft/Aerotow/c182/Models/StrobeLight.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
<PropertyList>
|
||||
<path>WhiteLight1.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Light</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Light</object-name>
|
||||
<interpolation>
|
||||
<entry>
|
||||
<ind>0</ind>
|
||||
<dep>0.25</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>20</ind>
|
||||
<dep>.50</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>1500</ind>
|
||||
<dep>5</dep>
|
||||
</entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
35
FGData/AI/Aircraft/Aerotow/c182/Models/ToggleLight.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
<PropertyList>
|
||||
<path>toggle-white.ac</path>
|
||||
|
||||
<animation>
|
||||
<type>alpha-test</type>
|
||||
<alpha-factor>0.01</alpha-factor>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>billboard</type>
|
||||
<object-name>Cube</object-name>
|
||||
<spherical type="bool">true</spherical>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>dist-scale</type>
|
||||
<object-name>Cube</object-name>
|
||||
<interpolation>
|
||||
<entry>
|
||||
<ind>0</ind>
|
||||
<dep>0.25</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>20</ind>
|
||||
<dep>.50</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>1500</ind>
|
||||
<dep>5</dep>
|
||||
</entry>
|
||||
</interpolation>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
44
FGData/AI/Aircraft/Aerotow/c182/Models/WhiteLight1.ac
Normal file
@@ -0,0 +1,44 @@
|
||||
AC3Db
|
||||
MATERIAL "ac3dmat1" rgb 1 1 1 amb 0.2 0.2 0.2 emis 1 1 1 spec 0 0 0 shi 10 trans 0
|
||||
OBJECT world
|
||||
kids 1
|
||||
OBJECT poly
|
||||
name "Light"
|
||||
texture "Halos.rgb"
|
||||
crease 45.000000
|
||||
numvert 12
|
||||
0.5 0.5 2.23517e-08
|
||||
-0.5 0.5 -2.23517e-08
|
||||
-0.5 -0.5 -2.23517e-08
|
||||
0.5 -0.5 2.23517e-08
|
||||
0 -0.5 -0.5
|
||||
0 -0.5 0.5
|
||||
0 0.5 0.5
|
||||
0 0.5 -0.5
|
||||
0.5 -4.96048e-10 -0.5
|
||||
-0.5 4.42074e-08 -0.5
|
||||
-0.5 4.96048e-10 0.5
|
||||
0.5 -4.42074e-08 0.5
|
||||
numsurf 3
|
||||
SURF 0x20
|
||||
mat 0
|
||||
refs 4
|
||||
0 0 0.5
|
||||
1 0.5 0.5
|
||||
2 0.5 0
|
||||
3 0 0
|
||||
SURF 0x20
|
||||
mat 0
|
||||
refs 4
|
||||
7 0 0.5
|
||||
6 0.5 0.5
|
||||
5 0.5 0
|
||||
4 0 0
|
||||
SURF 0x20
|
||||
mat 0
|
||||
refs 4
|
||||
11 0 0.5
|
||||
10 0.5 0.5
|
||||
9 0.5 0
|
||||
8 0 0
|
||||
kids 0
|
||||
BIN
FGData/AI/Aircraft/Aerotow/c182/Models/c182-01.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
FGData/AI/Aircraft/Aerotow/c182/Models/c182-02.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
7
FGData/AI/Aircraft/Aerotow/c182/Models/c182-ai.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList include="AI/Aircraft/c182/Models/c182-ai.xml">
|
||||
<sound>
|
||||
<path>AI/Aircraft/Aerotow/Sound/sound.xml</path>
|
||||
</sound>
|
||||
</PropertyList>
|
||||
217
FGData/AI/Aircraft/Aerotow/c182/Models/c182-dpm.xml
Normal file
@@ -0,0 +1,217 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<path>c182.ac</path>
|
||||
|
||||
|
||||
<!-- Object movements -->
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>Propeller</object-name>
|
||||
<condition>
|
||||
<less-than>
|
||||
<property>engines/engine[0]/rpm</property>
|
||||
<value>500</value>
|
||||
</less-than>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>Propeller.2</object-name>
|
||||
<condition>
|
||||
<greater-than>
|
||||
<property>engines/engine[0]/rpm</property>
|
||||
<value>400</value>
|
||||
</greater-than>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>blend</type>
|
||||
<object-name>Propeller.2</object-name>
|
||||
<property>engines/engine[0]/rpm</property>
|
||||
<factor>0.0004</factor>
|
||||
<max>1.0</max>
|
||||
<min>0.0</min>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>NoseWheel</object-name>
|
||||
<property>surface-positions/rudder-pos-norm</property>
|
||||
<factor>-20</factor>
|
||||
<center>
|
||||
<x-m>-0.8</x-m>
|
||||
<y-m>0.0</y-m>
|
||||
<z-m>-0.8</z-m>
|
||||
</center>
|
||||
<axis>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<z>1</z>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>spin</type>
|
||||
<object-name>Propeller</object-name>
|
||||
<property>engines/engine[0]/rpm</property>
|
||||
<factor>-1</factor>
|
||||
<center>
|
||||
<x-m>0</x-m>
|
||||
<y-m>0</y-m>
|
||||
<z-m>-0.214544</z-m>
|
||||
</center>
|
||||
<axis>
|
||||
<x>1.0</x>
|
||||
<y>0.0</y>
|
||||
<z>0.0</z>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>spin</type>
|
||||
<object-name>Propeller.2</object-name>
|
||||
<property>engines/engine[0]/rpm</property>
|
||||
<factor>-1</factor>
|
||||
<center>
|
||||
<x-m>0</x-m>
|
||||
<y-m>0</y-m>
|
||||
<z-m>-0.214544</z-m>
|
||||
</center>
|
||||
<axis>
|
||||
<x>1.0</x>
|
||||
<y>0.0</y>
|
||||
<z>0.0</z>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>LeftAileron</object-name>
|
||||
<property>surface-positions/left-aileron-pos-norm</property>
|
||||
<interpolation>
|
||||
<entry>
|
||||
<ind>-1.0</ind>
|
||||
<dep>15</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>0.0</ind>
|
||||
<dep>0</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>1.0</ind>
|
||||
<dep>-20</dep>
|
||||
</entry>
|
||||
</interpolation>
|
||||
<center>
|
||||
<x-m>0.94</x-m>
|
||||
<y-m>-3.83</y-m>
|
||||
<z-m>0.40</z-m>
|
||||
</center>
|
||||
<axis>
|
||||
<x>-0.15</x>
|
||||
<y>-1.00</y>
|
||||
<z>0.03</z>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>RightAileron</object-name>
|
||||
<property>surface-positions/left-aileron-pos-norm</property>
|
||||
<interpolation>
|
||||
<entry>
|
||||
<ind>-1.0</ind>
|
||||
<dep>15</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>0.0</ind>
|
||||
<dep>0</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>1.0</ind>
|
||||
<dep>-20</dep>
|
||||
</entry>
|
||||
</interpolation>
|
||||
<center>
|
||||
<x-m>0.94</x-m>
|
||||
<y-m>3.83</y-m>
|
||||
<z-m>0.40</z-m>
|
||||
</center>
|
||||
<axis>
|
||||
<x>-0.15</x>
|
||||
<y>1.00</y>
|
||||
<z>0.03</z>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>LeftFlap</object-name>
|
||||
<object-name>RightFlap</object-name>
|
||||
<property>surface-positions/flap-pos-norm</property>
|
||||
<factor>30</factor>
|
||||
<center>
|
||||
<x-m>1.1</x-m>
|
||||
<y-m>0.0</y-m>
|
||||
<z-m>0.28</z-m>
|
||||
</center>
|
||||
<axis>
|
||||
<x>0.0</x>
|
||||
<y>1.0</y>
|
||||
<z>0.0</z>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>LeftElevator</object-name>
|
||||
<object-name>RightElevator</object-name>
|
||||
<property>surface-positions/elevator-pos-norm</property>
|
||||
<interpolation>
|
||||
<entry>
|
||||
<ind>-1.0</ind>
|
||||
<dep>-28</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>0</ind>
|
||||
<dep>0</dep>
|
||||
</entry>
|
||||
<entry>
|
||||
<ind>1.0</ind>
|
||||
<dep>23</dep>
|
||||
</entry>
|
||||
</interpolation>
|
||||
<center>
|
||||
<x-m>5.1</x-m>
|
||||
<y-m>0.0</y-m>
|
||||
<z-m>-0.45</z-m>
|
||||
</center>
|
||||
<axis>
|
||||
<x>0.0</x>
|
||||
<y>1.0</y>
|
||||
<z>0.0</z>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>Rudder</object-name>
|
||||
<property>surface-positions/rudder-pos-norm</property>
|
||||
<factor>17.5</factor>
|
||||
<center>
|
||||
<x-m>5.45</x-m>
|
||||
<y-m>0.0</y-m>
|
||||
<z-m>0.0</z-m>
|
||||
</center>
|
||||
<axis>
|
||||
<x>0.72</x>
|
||||
<y>0.0</y>
|
||||
<z>1.0</z>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
8778
FGData/AI/Aircraft/Aerotow/c182/Models/c182.ac
Normal file
BIN
FGData/AI/Aircraft/Aerotow/c182/Models/chrome2.rgb
Normal file
64
FGData/AI/Aircraft/Aerotow/c182/Models/lights.ac
Normal file
@@ -0,0 +1,64 @@
|
||||
AC3Db
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
OBJECT world
|
||||
kids 1
|
||||
OBJECT poly
|
||||
name "Cube"
|
||||
data 8
|
||||
Cube.002
|
||||
texture "lights.rgb"
|
||||
texrep 1 1
|
||||
crease 30
|
||||
numvert 8
|
||||
5.2e-005 -0.024954 -0.09
|
||||
5.2e-005 -0.024954 0.173732
|
||||
-0.027131 -0.024954 0.173679
|
||||
-0.027131 -0.024954 -0.09
|
||||
5.2e-005 0.047045 -0.09
|
||||
5.2e-005 0.047045 0.173732
|
||||
-0.027131 0.047045 0.173679
|
||||
-0.027131 0.047045 -0.09
|
||||
numsurf 6
|
||||
SURF 0x00
|
||||
mat 0
|
||||
refs 4
|
||||
0 0.0462104454637 0.277649432421
|
||||
1 0.0462104454637 0.0592489615083
|
||||
2 0.264610916376 0.0592489615083
|
||||
3 0.264610916376 0.277649432421
|
||||
SURF 0x00
|
||||
mat 0
|
||||
refs 4
|
||||
4 0.0462104454637 0.277649432421
|
||||
7 0.0462104454637 0.0592489615083
|
||||
6 0.264610916376 0.0592489615083
|
||||
5 0.264610916376 0.277649432421
|
||||
SURF 0x00
|
||||
mat 0
|
||||
refs 4
|
||||
0 0.994239091873 0.706083416939
|
||||
4 0.994238674641 0.996782541275
|
||||
5 0.00671458244324 0.996782541275
|
||||
1 0.00671491026878 0.706083416939
|
||||
SURF 0x00
|
||||
mat 0
|
||||
refs 4
|
||||
1 0.0462104454637 0.277649432421
|
||||
5 0.0462104454637 0.0592489615083
|
||||
6 0.264610916376 0.0592489615083
|
||||
2 0.264610916376 0.277649432421
|
||||
SURF 0x00
|
||||
mat 0
|
||||
refs 4
|
||||
2 0.0 1.0
|
||||
6 0.0 0.0
|
||||
7 1.0 0.0
|
||||
3 1.0 1.0
|
||||
SURF 0x00
|
||||
mat 0
|
||||
refs 4
|
||||
4 0.0462104454637 0.277649432421
|
||||
0 0.0462104454637 0.0592489615083
|
||||
3 0.264610916376 0.0592489615083
|
||||
7 0.264610916376 0.277649432421
|
||||
kids 0
|
||||
BIN
FGData/AI/Aircraft/Aerotow/c182/Models/lights.rgb
Normal file
95
FGData/AI/Aircraft/Aerotow/c182/Models/toggle-white.ac
Normal file
@@ -0,0 +1,95 @@
|
||||
AC3Db
|
||||
MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
|
||||
MATERIAL "Material" rgb 0.92013 0.92013 0.92013 amb 0.5 0.5 0.5 emis 0 0 0 spec 1 1 1 shi 32 trans 0
|
||||
OBJECT world
|
||||
kids 1
|
||||
OBJECT poly
|
||||
name "Cube"
|
||||
data 4
|
||||
Cube
|
||||
crease 30
|
||||
numvert 12
|
||||
0.009182 0.007635 -0.00748
|
||||
0.001377 -0.000598 -0.00748
|
||||
-0.005892 0.002033 -0.00748
|
||||
-0.001976 0.012793 -0.00748
|
||||
0.009182 0.007635 0.00748
|
||||
0.001377 -0.000598 0.00748
|
||||
-0.005892 0.002033 0.00748
|
||||
-0.001976 0.012793 0.00748
|
||||
-0.009655 -0.008307 -0.00748
|
||||
-0.009655 -0.008307 0.00748
|
||||
0.002203 -0.01154 -0.00748
|
||||
0.002203 -0.01154 0.00748
|
||||
numsurf 10
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
0 0 0
|
||||
1 0 0
|
||||
2 0 0
|
||||
3 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
4 0 0
|
||||
7 0 0
|
||||
6 0 0
|
||||
5 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
0 0 0
|
||||
4 0 0
|
||||
5 0 0
|
||||
1 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
2 0 0
|
||||
6 0 0
|
||||
7 0 0
|
||||
3 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
6 0 0
|
||||
2 0 0
|
||||
8 0 0
|
||||
9 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
1 0 0
|
||||
5 0 0
|
||||
11 0 0
|
||||
10 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
5 0 0
|
||||
6 0 0
|
||||
9 0 0
|
||||
11 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
2 0 0
|
||||
1 0 0
|
||||
10 0 0
|
||||
8 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
10 0 0
|
||||
11 0 0
|
||||
9 0 0
|
||||
8 0 0
|
||||
SURF 0x00
|
||||
mat 1
|
||||
refs 4
|
||||
0 0 0
|
||||
3 0 0
|
||||
7 0 0
|
||||
4 0 0
|
||||
kids 0
|
||||
76
README.md
@@ -24,23 +24,75 @@ 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.
|
||||
|
||||
## How does the AI tow aircraft fly?
|
||||
## How does the AI tow aircraft fly 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 when it has completed the entire set route it turns to unknown direction and flies at a constant altitude.
|
||||
|
||||
You can disconnect from the aircraft at any time, most often by pressing the `o` key.
|
||||
You can disconnect from the aircraft at any time, most often by pressing the `o` key (check help of your glider).
|
||||
|
||||
```
|
||||
Default route
|
||||
^ - airport with heading direction to north
|
||||
1 - 1st waypoint
|
||||
2 - 2nd waypoint, etc.
|
||||
|
||||
2 . . 1 7
|
||||
. . .
|
||||
. . .
|
||||
3 . .
|
||||
. . .
|
||||
. . .
|
||||
. . .
|
||||
. . .
|
||||
. . .
|
||||
. . .
|
||||
. ^ 6
|
||||
. .
|
||||
. .
|
||||
4 . . . . 5
|
||||
```
|
||||
|
||||
## Menu of add-on
|
||||
|
||||
This add-on add a new item to main menu named `Aerotow Everywhere` with following items:
|
||||
|
||||
1. `Call for Piper J3 Cub aircraft` - load AI tow sceneraio with Piper J3 Cub. Possible altitude to reach ~3,600 ft.
|
||||
2. `Call for Robin DR400 aircraft` - load AI tow sceneraio with Robin DR400. This aircraft has better performance and can take you to over 4,500 ft.
|
||||
3. `Call for Cessna 182 aircraft` - load AI tow sceneraio with Cessna 182. This aircraft has little bit better performance than Robin.
|
||||
4. `Disable tow aircraft` - unload AI tow sceneraio.
|
||||
5. `Add thermal` - display the dialog for configuring and adding thermal.
|
||||
6. `Help` - display help dialog.
|
||||
7. `About` - display about dialog with add-on information.
|
||||
1. `Aerotow Route` - display the dialog for change aerotow route.
|
||||
2. `Call for Piper J3 Cub aircraft` - load AI tow sceneraio with Piper J3 Cub.
|
||||
3. `Call for Robin DR400 aircraft` - load AI tow sceneraio with Robin DR400. This aircraft has better performance and can take you higher then Piper Cub.
|
||||
4. `Call for Cessna 182 aircraft` - load AI tow sceneraio with Cessna 182. This aircraft has little bit better performance than Robin.
|
||||
5. `Disable tow aircraft` - unload AI tow sceneraio.
|
||||
6. `Add thermal` - display the dialog for configuring and adding thermal.
|
||||
7. `Help` - display help dialog.
|
||||
8. `About` - display about dialog with add-on information.
|
||||
|
||||
## Aerotow Route
|
||||
|
||||
You can change the AI aircraft's default route, for this go to menu `Aerotow Everywhere` -> `Aerotow Route`.
|
||||
|
||||
### Aerotow aircraft
|
||||
|
||||
On the top of the "Aerotow Route" dialog you have selector to change aircraft type. It's only for calculate performance and display how the altitude will change.
|
||||
|
||||
### Route
|
||||
|
||||
Next you have initial heading, distance and altitude change. "Initial heading" depend of the runway where you are located. The aircraft will always take-off along the runway, a distance of 100 m, where it will gain 20 ft in altitude above the terrain. These parameters you cannot change unless you change the airport/runway.
|
||||
|
||||
Next you can see a table with fields where you can change values. Each row represents a single waypoint of flight plan of AI aircraft. For each waypoint you have following columns:
|
||||
|
||||
1. `Heading change (deg)` - information on how the heading of the aircraft should change in relation to the previous one. A value of `0` means no change, so continue with the same heading. And e.g. `-90` means a left turn of 90 degrees, `60` means a right turn of 60 degrees, etc.
|
||||
2. `Distance (m)` - distance in meters from the previous waypoint to the present one.
|
||||
3. `Alt change (AGL ft)` - information on how much the altitude on this leg of the route will increase (in feet above ground.) This information depend of selected airplane.
|
||||
|
||||
If you enter a value less than or equal to `0` for `Distance (m)` field this means that here the route is end and the next rows will not be included to the flight plan.
|
||||
|
||||
You have a maximum of 10 waypoints to use, hope that's enough.
|
||||
|
||||
On the below of the dialog you can see a total amount of distance (in meters) and total altitude in feet above ground level.
|
||||
|
||||
### Buttons
|
||||
|
||||
1. `OK` - close the route dialog.
|
||||
2. `Default` - set default waypoints (your changes will be lost.)
|
||||
|
||||
## Adding thermals
|
||||
|
||||
@@ -53,11 +105,11 @@ An additional feature of this add-on is the possibility of placing the thermals
|
||||
|
||||
Click `Add thermal` button for add the thermal.
|
||||
|
||||
Many thanks to the forum user "wlbragg" for proposing and presenting a solution to this feature.
|
||||
Many thanks to the FG forum user "wlbragg" for proposing and presenting a solution to this feature.
|
||||
|
||||
## Limitations
|
||||
|
||||
1. This add-on doesn't check if there are any obstacles in the AI aircraft's path, e.g. terrain, buildings, power lines, etc. Keep this in mind when choosing an airport.
|
||||
1. This add-on doesn't check if there are any obstacles in the AI aircraft's path, e.g. terrain, buildings, power lines, etc. Keep this in mind when choosing an airport or planning your route.
|
||||
2. Minimum FlightGear version: 2020.4.0 (dev/nightly). Because only nightly version is able to search for flight plans in additional FGData folders added by `--data` command line option.
|
||||
|
||||
## Troubleshotting
|
||||
|
||||
@@ -37,15 +37,32 @@
|
||||
<height-msl type="int">9000</height-msl>
|
||||
<height-msl-m type="int">2742</height-msl-m>
|
||||
</add-thermal>
|
||||
<route>
|
||||
<ai-model>Piper J3 Cub</ai-model>
|
||||
<init-wpt>
|
||||
<heading-change type="double">0</heading-change>
|
||||
<distance-m type="double">0</distance-m>
|
||||
<alt-change-agl-ft type="double">0</alt-change-agl-ft>
|
||||
</init-wpt>
|
||||
<total>
|
||||
<distance>0</distance>
|
||||
<alt>0</alt>
|
||||
</total>
|
||||
</route>
|
||||
<sound>
|
||||
<enable type="bool">false</enable>
|
||||
</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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
You can disconnect from the aircraft at any time, most often by pressing the `o` key.
|
||||
|
||||
Before start you can change route of AI aircraft by menu "Aerotow Everywhere" -> "Aerotow Route".
|
||||
|
||||
=== Troubleshotting ===
|
||||
|
||||
1. When I select "Aerotow Everywhere" -> "Call for Piper J3 Cub aircraft", "Robin DR400" or "Cessna 182" from menu, I see "Let's fly!" message but nothing happened. The tow plane does not appear.
|
||||
|
||||
@@ -29,6 +29,13 @@
|
||||
<label>Aerotow Everywhere</label>
|
||||
<enabled type="bool">true</enabled>
|
||||
|
||||
<item>
|
||||
<label>Aerotow Route</label>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>route-aerotow</dialog-name>
|
||||
</binding>
|
||||
</item>
|
||||
<item>
|
||||
<label>Call for Piper J3 Cub aircraft</label>
|
||||
<binding>
|
||||
@@ -55,9 +62,21 @@
|
||||
</item>
|
||||
<item>
|
||||
<label>Disable tow aircraft</label>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/sound/enable</property>
|
||||
<value type="bool">false</value>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script><![CDATA[aerotow.stopAerotow();]]></script>
|
||||
<script><![CDATA[
|
||||
# Run stopAerotow() with a delay to ensure that the engine sound turns off
|
||||
var timer = maketimer(1, func () {
|
||||
aerotow.stopAerotow();
|
||||
});
|
||||
timer.singleShot = 1;
|
||||
timer.start();
|
||||
]]></script>
|
||||
</binding>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<addon>
|
||||
<identifier type="string">org.flightgear.addons.Aerotow</identifier>
|
||||
<name type="string">Aerotow Everywhere</name>
|
||||
<version type="string">1.1.0</version>
|
||||
<version type="string">1.3.0</version>
|
||||
|
||||
<authors>
|
||||
<author>
|
||||
|
||||
355
aerotow.nas
@@ -12,14 +12,17 @@
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
var addon = addons.getAddon("org.flightgear.addons.Aerotow");
|
||||
var ADDON = addons.getAddon("org.flightgear.addons.Aerotow");
|
||||
var ADDON_NODE_PATH = ADDON.node.getPath();
|
||||
var FILENAME_SCENARIO = "aerotown-addon.xml";
|
||||
var FILENAME_FLIGHTPLAN = "aerotown-addon-flightplan.xml";
|
||||
var PATH_SCENARIO = addon.storagePath ~ "/" ~ FILENAME_SCENARIO;
|
||||
var PATH_FLIGHTPLAN = addon.storagePath ~ "/AI/FlightPlans/" ~ FILENAME_FLIGHTPLAN;
|
||||
var PATH_SCENARIO = ADDON.storagePath ~ "/" ~ FILENAME_SCENARIO;
|
||||
var PATH_FLIGHTPLAN = ADDON.storagePath ~ "/AI/FlightPlans/" ~ FILENAME_FLIGHTPLAN;
|
||||
var SCENARIO_ID = "aerotow_addon";
|
||||
var SCENARIO_NAME = "Aerotow Add-on";
|
||||
var SCENARIO_DESC = "This scenario starts the towing plane at the airport where the pilot with the glider is located. Use Ctrl-o to hook the plane.";
|
||||
var MAX_ROUTE_WAYPOINT = 10;
|
||||
var DISTANCE_DETERMINANT = 1000; # meters
|
||||
|
||||
#
|
||||
# Global variables
|
||||
@@ -30,27 +33,115 @@ var g_fpFileHandler = nil; # Handler for wrire flight plan to file
|
||||
var g_coord = nil; # Coordinates for flight plan
|
||||
var g_heading = nil; # AI plane heading
|
||||
var g_altitude = nil; # AI plane altitude
|
||||
var g_listeners = [];
|
||||
var g_towListeners = [];
|
||||
|
||||
#
|
||||
# Initialize thermal module
|
||||
#
|
||||
var init = func () {
|
||||
# Listener for ai-model property triggered when the user select a tow aircraft from add-on menu
|
||||
append(g_listeners, setlistener(addon.node.getPath() ~ "/addon-devel/ai-model", func () {
|
||||
startAerotow();
|
||||
append(g_towListeners, setlistener(ADDON_NODE_PATH ~ "/addon-devel/ai-model", func () {
|
||||
restartAerotow();
|
||||
}));
|
||||
|
||||
append(g_towListeners, setlistener("/sim/presets/longitude-deg", func () {
|
||||
# User change airport/runway
|
||||
initialFlightPlan();
|
||||
}));
|
||||
|
||||
initialFlightPlan();
|
||||
|
||||
# Set listener for aerotow combo box value in route dialog for recalculate altitude change
|
||||
append(g_towListeners, setlistener(ADDON_NODE_PATH ~ "/addon-devel/route/ai-model", func () {
|
||||
calculateAltChangeAndTotals();
|
||||
}));
|
||||
|
||||
# Set listeners for distance fields for calculate altitude change
|
||||
for (var i = 0; i < MAX_ROUTE_WAYPOINT; i = i + 1) {
|
||||
append(g_towListeners, setlistener(ADDON_NODE_PATH ~ "/addon-devel/route/wpt[" ~ i ~ "]/distance-m", func (node) {
|
||||
calculateAltChangeAndTotals();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Calculate total distance and altitude and put in to property tree
|
||||
#
|
||||
var calculateAltChangeAndTotals = func () {
|
||||
var totalDistance = 0.0;
|
||||
var totalAlt = 0.0;
|
||||
var isEnd = 0;
|
||||
|
||||
var isRouteMode = 1;
|
||||
var perf = getAircraftPerformance(isRouteMode);
|
||||
|
||||
for (var i = 0; i < MAX_ROUTE_WAYPOINT; i = i + 1) {
|
||||
var distance = getprop(ADDON_NODE_PATH ~ "/addon-devel/route/wpt[" ~ i ~ "]/distance-m");
|
||||
var altChange = getAltChange(perf.vs, distance);
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/wpt[" ~ i ~ "]/alt-change-agl-ft", altChange);
|
||||
|
||||
if (!isEnd) {
|
||||
if (distance > 0.0) {
|
||||
totalDistance = totalDistance + distance;
|
||||
totalAlt = totalAlt + altChange;
|
||||
}
|
||||
else {
|
||||
isEnd = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/total/distance", totalDistance);
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/total/alt", totalAlt);
|
||||
}
|
||||
|
||||
#
|
||||
# Uninitialize thermal module
|
||||
#
|
||||
var uninit = func () {
|
||||
foreach (var listener; g_listeners) {
|
||||
foreach (var listener; g_towListeners) {
|
||||
removelistener(listener);
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Function for restart AI scenario with delay when the sound has to stop.
|
||||
#
|
||||
# Return 1 on successful, otherwise 0.
|
||||
#
|
||||
var restartAerotow = func () {
|
||||
messages.displayOk("Aerotow in the way");
|
||||
|
||||
# Stop playing engine sound
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/sound/enable", 0);
|
||||
|
||||
# Wait a second for the engine sound to turn off
|
||||
var timer = maketimer(1, func () {
|
||||
unloadScenario();
|
||||
});
|
||||
timer.singleShot = 1;
|
||||
timer.start();
|
||||
}
|
||||
|
||||
#
|
||||
# Unload scenario and start a new one
|
||||
#
|
||||
var unloadScenario = func () {
|
||||
if (g_isScenarioLoaded) {
|
||||
var args = props.Node.new({ "name": SCENARIO_ID });
|
||||
if (fgcommand("unload-scenario", args)) {
|
||||
g_isScenarioLoaded = 0;
|
||||
}
|
||||
}
|
||||
|
||||
# Start aerotow with delay to avoid duplicate engine sound playing
|
||||
var timer = maketimer(1, func () {
|
||||
startAerotow();
|
||||
});
|
||||
timer.singleShot = 1;
|
||||
timer.start();
|
||||
}
|
||||
|
||||
#
|
||||
# Main function to prepare AI scenario and run it.
|
||||
#
|
||||
@@ -58,8 +149,11 @@ var uninit = func () {
|
||||
#
|
||||
var startAerotow = func () {
|
||||
var args = props.Node.new({ "name": SCENARIO_ID });
|
||||
|
||||
if (g_isScenarioLoaded) {
|
||||
fgcommand("unload-scenario", args);
|
||||
if (fgcommand("unload-scenario", args)) {
|
||||
g_isScenarioLoaded = 0;
|
||||
}
|
||||
}
|
||||
|
||||
generateScenarioXml();
|
||||
@@ -71,6 +165,8 @@ var startAerotow = func () {
|
||||
if (fgcommand("load-scenario", args)) {
|
||||
g_isScenarioLoaded = 1;
|
||||
messages.displayOk("Let's fly!");
|
||||
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/sound/enable", 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -115,7 +211,7 @@ var generateScenarioXml = func () {
|
||||
"callsign": "FG-TOW",
|
||||
"type": "aircraft",
|
||||
"class": "aerotow-dragger",
|
||||
"model": "Aircraft/Cub/Models/Cub-ai.xml", # default Cub
|
||||
"model": "Aircraft/Aerotow/Cub/Models/Cub-ai.xml", # default Cub
|
||||
"flightplan": FILENAME_FLIGHTPLAN,
|
||||
"repeat": 1,
|
||||
}
|
||||
@@ -125,10 +221,10 @@ var generateScenarioXml = func () {
|
||||
|
||||
var aiModel = getSelectedAircraft();
|
||||
if (aiModel == "DR400") {
|
||||
scenarioXml.PropertyList.scenario.entry.model = "Aircraft/DR400/Models/dr400-ai.xml";
|
||||
scenarioXml.PropertyList.scenario.entry.model = "Aircraft/Aerotow/DR400/Models/dr400-ai.xml";
|
||||
}
|
||||
else if (aiModel == "c182") {
|
||||
scenarioXml.PropertyList.scenario.entry.model = "Aircraft/c182/Models/c182-ai.xml";
|
||||
scenarioXml.PropertyList.scenario.entry.model = "Aircraft/Aerotow/c182/Models/c182-ai.xml";
|
||||
}
|
||||
|
||||
var node = props.Node.new(scenarioXml);
|
||||
@@ -169,10 +265,126 @@ var isScenarioAdded = func () {
|
||||
}
|
||||
|
||||
#
|
||||
# Return name of selected aircraft. Possible values: "Cub", "DR400", "c182".
|
||||
# Return name of selected aircraft. Possible values depend of isRouteMode: "Cub", "DR400", "c182".
|
||||
#
|
||||
var getSelectedAircraft = func () {
|
||||
return getprop(addon.node.getPath() ~ "/addon-devel/ai-model") or "Cub";
|
||||
# isRouteMode - use 1 to get the plane for the "Aerotow Route" dialog, use 0 (default) for call the airplane for towing
|
||||
#
|
||||
var getSelectedAircraft = func (isRouteMode = 0) {
|
||||
if (isRouteMode) {
|
||||
return getprop(ADDON_NODE_PATH ~ "/addon-devel/route/ai-model") or "Piper J3 Cub";
|
||||
}
|
||||
|
||||
return getprop(ADDON_NODE_PATH ~ "/addon-devel/ai-model") or "Cub";
|
||||
}
|
||||
|
||||
#
|
||||
# Get airport an runway hash where the glider is located.
|
||||
#
|
||||
# Return hash with "airport" and "runway", otherwise nil.
|
||||
#
|
||||
var getAirportAndRunway = func () {
|
||||
var icao = getprop("/sim/airport/closest-airport-id");
|
||||
if (icao == nil) {
|
||||
messages.displayError("Airport code cannot be obtained.");
|
||||
return nil;
|
||||
}
|
||||
|
||||
var runwayName = getprop("/sim/atc/runway");
|
||||
if (runwayName == nil) {
|
||||
messages.displayError("Runway name cannot be obtained.");
|
||||
return nil;
|
||||
}
|
||||
|
||||
var airport = airportinfo(icao);
|
||||
|
||||
if (!contains(airport.runways, runwayName)) {
|
||||
messages.displayError("The " ~ icao ~" airport does not have runway " ~ runwayName);
|
||||
return nil;
|
||||
}
|
||||
|
||||
var runway = airport.runways[runwayName];
|
||||
|
||||
var minRwyLength = getMinRunwayLength();
|
||||
if (runway.length < minRwyLength) {
|
||||
messages.displayError(
|
||||
"This runway is too short. Please choose a longer one than " ~ minRwyLength ~ " m "
|
||||
~ "(" ~ math.round(minRwyLength * globals.M2FT) ~ " ft)."
|
||||
);
|
||||
return nil;
|
||||
}
|
||||
|
||||
return {
|
||||
"airport": airport,
|
||||
"runway": runway,
|
||||
};
|
||||
}
|
||||
|
||||
#
|
||||
# Initialize flight plan and set it to property tree
|
||||
#
|
||||
# Return 1 on successful, otherwise 0.
|
||||
#
|
||||
var initialFlightPlan = func () {
|
||||
var location = getAirportAndRunway();
|
||||
if (location == nil) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var perf = getAircraftPerformance();
|
||||
|
||||
initAircraftVariable(location.airport, location.runway, 0);
|
||||
|
||||
# inittial readonly waypoint
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/init-wpt/heading-change", g_heading);
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/init-wpt/distance-m", 100);
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/init-wpt/alt-change-agl-ft", perf.vs / 10);
|
||||
|
||||
# in air
|
||||
var wptData = [
|
||||
{"hdgChange": 0, "dist": 5000, "altChange": perf.vs * 5},
|
||||
{"hdgChange": -90, "dist": 1000, "altChange": perf.vs},
|
||||
{"hdgChange": -90, "dist": 1000, "altChange": perf.vs},
|
||||
{"hdgChange": 0, "dist": 5000, "altChange": perf.vs * 5},
|
||||
{"hdgChange": -90, "dist": 1500, "altChange": perf.vs * 1.5},
|
||||
{"hdgChange": -90, "dist": 1000, "altChange": perf.vs},
|
||||
{"hdgChange": 0, "dist": 5000, "altChange": perf.vs * 5},
|
||||
{"hdgChange": 0, "dist": 0, "altChange": 0},
|
||||
{"hdgChange": 0, "dist": 0, "altChange": 0},
|
||||
{"hdgChange": 0, "dist": 0, "altChange": 0},
|
||||
];
|
||||
|
||||
# Default route
|
||||
# ^ - airport with heading direction to north
|
||||
# 1 - 1st waypoint
|
||||
# 2 - 2nd waypoint, etc.
|
||||
#
|
||||
# 2 . . 1 7
|
||||
# . . .
|
||||
# . . .
|
||||
# 3 . .
|
||||
# . . .
|
||||
# . . .
|
||||
# . . .
|
||||
# . . .
|
||||
# . . .
|
||||
# . . .
|
||||
# . ^ 6
|
||||
# . .
|
||||
# . .
|
||||
# 4 . . . . 5
|
||||
|
||||
var index = 0;
|
||||
foreach (var wpt; wptData) {
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/wpt[" ~ index ~ "]/heading-change", wpt.hdgChange);
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/wpt[" ~ index ~ "]/distance-m", wpt.dist);
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/route/wpt[" ~ index ~ "]/alt-change-agl-ft", wpt.altChange);
|
||||
|
||||
index = index + 1;
|
||||
}
|
||||
|
||||
calculateAltChangeAndTotals();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#
|
||||
@@ -184,33 +396,8 @@ var getSelectedAircraft = func () {
|
||||
var generateFlightPlanXml = func () {
|
||||
g_wptCount = 0;
|
||||
|
||||
var icao = getprop("/sim/airport/closest-airport-id");
|
||||
if (icao == nil) {
|
||||
messages.displayError("Airport code cannot be obtained.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
var runwayName = getprop("/sim/atc/runway");
|
||||
if (runwayName == nil) {
|
||||
messages.displayError("Runway name cannot be obtained.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
var airport = airportinfo(icao);
|
||||
|
||||
if (!contains(airport.runways, runwayName)) {
|
||||
messages.displayError("The " ~ icao ~" airport does not have runway " ~ runwayName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
var runway = airport.runways[runwayName];
|
||||
|
||||
var minRwyLength = getMinRunwayLength();
|
||||
if (runway.length < minRwyLength) {
|
||||
messages.displayError(
|
||||
"This runway is too short. Please choose a longer one than " ~ minRwyLength ~ " m "
|
||||
~ "(" ~ math.round(minRwyLength * globals.M2FT) ~ " ft)."
|
||||
);
|
||||
var location = getAirportAndRunway();
|
||||
if (location == nil) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -225,16 +412,16 @@ var generateFlightPlanXml = func () {
|
||||
|
||||
var perf = getAircraftPerformance();
|
||||
|
||||
initAircraftVariable(airport, runway, 1);
|
||||
initAircraftVariable(location.airport, location.runway, 1);
|
||||
|
||||
# Start at 2 o'clock from the glider...
|
||||
# Inital ktas must be >= 1.0
|
||||
addWptGround({"hdgChange": 60, "dist": 25}, {"altChange": 0, "ktas": 5});
|
||||
|
||||
# Reset coord and heading
|
||||
initAircraftVariable(airport, runway, 0);
|
||||
initAircraftVariable(location.airport, location.runway, 0);
|
||||
|
||||
var gliderOffsetM = getGliderOffsetFromRunwayThreshold(runway);
|
||||
var gliderOffsetM = getGliderOffsetFromRunwayThreshold(location.runway);
|
||||
|
||||
# ... and line up with the runway
|
||||
addWptGround({"hdgChange": 0, "dist": 30 + gliderOffsetM}, {"altChange": 0, "ktas": 2.5});
|
||||
@@ -258,29 +445,24 @@ var generateFlightPlanXml = func () {
|
||||
addWptAir({"hdgChange": 0, "dist": 100 * perf.rolling}, {"elevationPlus": 3, "ktas": perf.speed * 1.05});
|
||||
addWptAir({"hdgChange": 0, "dist": 100}, {"altChange": perf.vs / 10, "ktas": perf.speed * 1.025});
|
||||
|
||||
# Circle around airport
|
||||
addWptAir({"hdgChange": 0, "dist": 500}, {"altChange": perf.vs / 1.5, "ktas": perf.speed});
|
||||
addWptAir({"hdgChange": 0, "dist": 500}, {"altChange": perf.vs / 1.7, "ktas": perf.speed});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.025});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.05});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.075});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.1});
|
||||
addWptAir({"hdgChange": -90, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.125}); # crosswind leg
|
||||
addWptAir({"hdgChange": -90, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.15}); # downwind leg
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.175});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.2});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.225});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.25});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.275});
|
||||
addWptAir({"hdgChange": -90, "dist": 500}, {"altChange": perf.vs / 2, "ktas": perf.speed * 1.25}); # base leg
|
||||
addWptAir({"hdgChange": 0, "dist": 500}, {"altChange": perf.vs / 2, "ktas": perf.speed * 1.275});
|
||||
addWptAir({"hdgChange": 0, "dist": 500}, {"altChange": perf.vs / 2, "ktas": perf.speed * 1.3});
|
||||
addWptAir({"hdgChange": -90, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.3}); # final leg
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.325});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.35});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.375});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.4});
|
||||
addWptAir({"hdgChange": 0, "dist": 1000}, {"altChange": perf.vs, "ktas": perf.speed * 1.425});
|
||||
var speedInc = 1.0;
|
||||
foreach (var wptNode; props.globals.getNode(ADDON_NODE_PATH ~ "/addon-devel/route").getChildren("wpt")) {
|
||||
var dist = wptNode.getChild("distance-m").getValue();
|
||||
if (dist <= 0.0) {
|
||||
break;
|
||||
}
|
||||
|
||||
var hdgChange = wptNode.getChild("heading-change").getValue();
|
||||
var altChange = getAltChange(perf.vs, dist);
|
||||
|
||||
speedInc = speedInc + ((dist / DISTANCE_DETERMINANT) * 0.025);
|
||||
var ktas = perf.speed * speedInc;
|
||||
if (ktas > perf.speedLimit) {
|
||||
ktas = perf.speedLimit;
|
||||
}
|
||||
|
||||
addWptAir({"hdgChange": hdgChange, "dist": dist}, {"altChange": altChange, "ktas": ktas});
|
||||
}
|
||||
|
||||
addWptEnd();
|
||||
|
||||
@@ -297,7 +479,7 @@ var generateFlightPlanXml = func () {
|
||||
#
|
||||
# Return hash with "vs", "speed", "rolling".
|
||||
#
|
||||
var getAircraftPerformance = func () {
|
||||
var getAircraftPerformance = func (isRouteMode = 0) {
|
||||
# Cub
|
||||
# Cruise Speed 61 kt
|
||||
# Max Speed 106 kt
|
||||
@@ -316,31 +498,44 @@ var getAircraftPerformance = func () {
|
||||
# Stall speed 50 kt
|
||||
# Best climb: 924 ft/min
|
||||
|
||||
var aiModel = getSelectedAircraft();
|
||||
if (aiModel == "DR400") {
|
||||
var aiModel = getSelectedAircraft(isRouteMode);
|
||||
if (aiModel == "DR400" or aiModel == "Robin DR400") {
|
||||
return {
|
||||
"vs": 285, # ft per 1000 m
|
||||
"speed": 70,
|
||||
"rolling": 2,
|
||||
"vs": 285, # ft per DISTANCE_DETERMINANT m
|
||||
"speed": 70,
|
||||
"speedLimit": 75,
|
||||
"rolling": 2,
|
||||
};
|
||||
}
|
||||
|
||||
if (aiModel == "c182") {
|
||||
if (aiModel == "c182" or aiModel == "Cessna 182") {
|
||||
return {
|
||||
"vs": 295, # ft per 1000 m
|
||||
"speed": 75,
|
||||
"rolling": 2.2,
|
||||
"vs": 295, # ft per DISTANCE_DETERMINANT m
|
||||
"speed": 75,
|
||||
"speedLimit": 80,
|
||||
"rolling": 2.2,
|
||||
};
|
||||
}
|
||||
|
||||
# Cub
|
||||
return {
|
||||
"vs": 200, # ft per 1000 m
|
||||
"speed": 55,
|
||||
"rolling": 1,
|
||||
"vs": 200, # ft per DISTANCE_DETERMINANT m
|
||||
"speed": 55,
|
||||
"speedLimit": 60,
|
||||
"rolling": 1,
|
||||
};
|
||||
}
|
||||
|
||||
#
|
||||
# Return how much the altitide increases for a given vertical speed and distance
|
||||
#
|
||||
# vs - vertical speed for DISTANCE_DETERMINANT m
|
||||
# distance - distance in meters
|
||||
#
|
||||
var getAltChange = func (vs, distance) {
|
||||
return vs * (distance / DISTANCE_DETERMINANT);
|
||||
}
|
||||
|
||||
#
|
||||
# Initialize AI aircraft variable
|
||||
#
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<hrule/>
|
||||
|
||||
<text>
|
||||
<label>Aerotow Everywhere version 1.1.0 - 16th August 2022</label>
|
||||
<label>Aerotow Everywhere version 1.3.0 - 18th August 2022</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</empty>
|
||||
|
||||
<text>
|
||||
<label>Add thermal</label>
|
||||
<label>Add Thermal</label>
|
||||
</text>
|
||||
|
||||
<empty>
|
||||
|
||||
528
gui/dialogs/route-aerotow.xml
Normal file
@@ -0,0 +1,528 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
#
|
||||
# Aerotow Everywhere - Add-on for FlightGear
|
||||
#
|
||||
# Written and developer by Roman Ludwicki (PlayeRom, SP-ROM)
|
||||
#
|
||||
# Copyright (C) 2022 Roman Ludwicki
|
||||
#
|
||||
# Aerotow Everywhere is an Open Source project and it is licensed
|
||||
# under the GNU Public License v3 (GPLv3)
|
||||
#
|
||||
-->
|
||||
|
||||
<!-- This file requires FlightGear version 2018.2 or newer -->
|
||||
|
||||
<PropertyList>
|
||||
<name>route-aerotow</name>
|
||||
<resizable>false</resizable>
|
||||
<layout>vbox</layout>
|
||||
<default-padding>3</default-padding>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
||||
<empty>
|
||||
<stretch>1</stretch>
|
||||
</empty>
|
||||
|
||||
<text>
|
||||
<label>Aerotow Route</label>
|
||||
</text>
|
||||
|
||||
<empty>
|
||||
<stretch>1</stretch>
|
||||
</empty>
|
||||
|
||||
<button>
|
||||
<pref-width>16</pref-width>
|
||||
<pref-height>16</pref-height>
|
||||
<legend></legend>
|
||||
<keynum>27</keynum>
|
||||
<border>2</border>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label> Here you can change the default flight path of the tow plane. </label>
|
||||
</text>
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label> You cannot change the initial point, the AI plane always </label>
|
||||
</text>
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label> takes-off in front of the runway you are on. </label>
|
||||
</text>
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label> Set 0 for `Distance` for completing the flight plan. </label>
|
||||
</text>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>table</layout>
|
||||
|
||||
<text>
|
||||
<row>0</row>
|
||||
<col>0</col>
|
||||
<halign>right</halign>
|
||||
<label>Aerotow</label>
|
||||
</text>
|
||||
|
||||
<combo>
|
||||
<row>0</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<pref-width>150</pref-width>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/ai-model</property>
|
||||
<value>Piper J3 Cub</value>
|
||||
<value>Robin DR400</value>
|
||||
<value>Cessna 182</value>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</combo>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>table</layout>
|
||||
|
||||
<text>
|
||||
<row>0</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<label>Initial Heading (deg)</label>
|
||||
</text>
|
||||
<text>
|
||||
<row>0</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<label>Distance (m)</label>
|
||||
</text>
|
||||
<text>
|
||||
<row>0</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label>Alt change (AGL ft)</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<row>1</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format>%.2f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/init-wpt/heading-change</property>
|
||||
</text>
|
||||
<text>
|
||||
<row>1</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format>%.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/init-wpt/distance-m</property>
|
||||
</text>
|
||||
<text>
|
||||
<row>1</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/init-wpt/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<row>2</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<label>Heading change (deg)</label>
|
||||
</text>
|
||||
<text>
|
||||
<row>2</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<label>Distance (m)</label>
|
||||
</text>
|
||||
<text>
|
||||
<row>2</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label>Alt change (AGL ft)</label>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>3</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[0]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>3</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[0]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>3</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[0]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>4</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[1]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>4</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[1]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>4</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[1]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>5</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[2]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>5</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[2]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>5</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[2]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>6</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[3]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>6</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[3]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>6</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[3]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>7</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[4]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>7</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[4]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>7</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[4]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>8</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[5]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>8</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[5]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>8</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[5]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>9</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[6]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>9</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[6]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>9</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[6]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>10</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[7]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>10</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[7]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>10</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[7]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>11</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[8]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>11</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[8]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>11</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[8]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<input>
|
||||
<row>12</row>
|
||||
<col>0</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[9]/heading-change</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<input>
|
||||
<row>12</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[9]/distance-m</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</input>
|
||||
<text>
|
||||
<row>12</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/wpt[9]/alt-change-agl-ft</property>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<row>13</row>
|
||||
<col>0</col>
|
||||
<halign>right</halign>
|
||||
<label>Total:</label>
|
||||
</text>
|
||||
<text>
|
||||
<row>13</row>
|
||||
<col>1</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format>%.f m</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/total/distance</property>
|
||||
</text>
|
||||
<text>
|
||||
<row>13</row>
|
||||
<col>2</col>
|
||||
<halign>left</halign>
|
||||
<label></label>
|
||||
<format> %.f ft</format>
|
||||
<live>true</live>
|
||||
<property>/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/route/total/alt</property>
|
||||
</text>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<empty>
|
||||
<stretch>true</stretch>
|
||||
</empty>
|
||||
|
||||
<layout>hbox</layout>
|
||||
|
||||
<button>
|
||||
<legend>OK</legend>
|
||||
<equal>true</equal>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Default</legend>
|
||||
<equal>true</equal>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script><![CDATA[aerotow.initialFlightPlan();]]></script>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<empty>
|
||||
<stretch>true</stretch>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
</PropertyList>
|
||||
45
thermal.nas
@@ -12,7 +12,8 @@
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
var addon = addons.getAddon("org.flightgear.addons.Aerotow");
|
||||
var ADDON = addons.getAddon("org.flightgear.addons.Aerotow");
|
||||
var ADDON_NODE_PATH = ADDON.node.getPath();
|
||||
|
||||
#
|
||||
# Variables
|
||||
@@ -23,32 +24,24 @@ var g_thermalListeners = [];
|
||||
# Initialize thermal module
|
||||
#
|
||||
var init = func () {
|
||||
append(g_thermalListeners, setlistener(addon.node.getPath() ~ "/addon-devel/add-thermal/distance-m", func () {
|
||||
setprop(
|
||||
addon.node.getPath() ~ "/addon-devel/add-thermal/distance-nm",
|
||||
getprop(addon.node.getPath() ~ "/addon-devel/add-thermal/distance-m") * globals.M2NM
|
||||
);
|
||||
# Listener for calculate distance from meters to nautical miles.
|
||||
append(g_thermalListeners, setlistener(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/distance-m", func (node) {
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/distance-nm", node.getValue() * globals.M2NM);
|
||||
}));
|
||||
|
||||
append(g_thermalListeners, setlistener(addon.node.getPath() ~ "/addon-devel/add-thermal/strength-fps", func () {
|
||||
setprop(
|
||||
addon.node.getPath() ~ "/addon-devel/add-thermal/strength-mps",
|
||||
getprop(addon.node.getPath() ~ "/addon-devel/add-thermal/strength-fps") * globals.FPS2KT * globals.KT2MPS
|
||||
);
|
||||
# Listener for calculate strength from ft/s to m/s.
|
||||
append(g_thermalListeners, setlistener(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/strength-fps", func (node) {
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/strength-mps", node.getValue() * globals.FPS2KT * globals.KT2MPS);
|
||||
}));
|
||||
|
||||
append(g_thermalListeners, setlistener(addon.node.getPath() ~ "/addon-devel/add-thermal/diameter-ft", func () {
|
||||
setprop(
|
||||
addon.node.getPath() ~ "/addon-devel/add-thermal/diameter-m",
|
||||
getprop(addon.node.getPath() ~ "/addon-devel/add-thermal/diameter-ft") * globals.FT2M
|
||||
);
|
||||
# Listener for calculate diameter from ft to m.
|
||||
append(g_thermalListeners, setlistener(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/diameter-ft", func (node) {
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/diameter-m", node.getValue() * globals.FT2M);
|
||||
}));
|
||||
|
||||
append(g_thermalListeners, setlistener(addon.node.getPath() ~ "/addon-devel/add-thermal/height-msl", func () {
|
||||
setprop(
|
||||
addon.node.getPath() ~ "/addon-devel/add-thermal/height-msl-m",
|
||||
getprop(addon.node.getPath() ~ "/addon-devel/add-thermal/height-msl") * globals.FT2M
|
||||
);
|
||||
# Listener for calculate height from ft to m.
|
||||
append(g_thermalListeners, setlistener(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/height-msl", func (node) {
|
||||
setprop(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/height-msl-m", node.getValue() * globals.FT2M);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -68,12 +61,12 @@ var uninit = func () {
|
||||
#
|
||||
var add = func () {
|
||||
var heading = getprop("/orientation/heading-deg") or 0;
|
||||
var distance = getprop(addon.node.getPath() ~ "/addon-devel/add-thermal/distance-m") or 300;
|
||||
var distance = getprop(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/distance-m") or 300;
|
||||
|
||||
var position = geo.aircraft_position();
|
||||
position.apply_course_distance(heading, distance);
|
||||
|
||||
# Get random layer from 1 do 4
|
||||
# Get random layer from 1 to 4
|
||||
var layer = int(rand() * 4) + 1;
|
||||
|
||||
var args = props.Node.new({
|
||||
@@ -81,9 +74,9 @@ var add = func () {
|
||||
"model": "Models/Weather/altocumulus_layer" ~ layer ~ ".xml",
|
||||
"latitude": position.lat(),
|
||||
"longitude": position.lon(),
|
||||
"strength-fps": getprop(addon.node.getPath() ~ "/addon-devel/add-thermal/strength-fps") or 16.0,
|
||||
"diameter-ft": getprop(addon.node.getPath() ~ "/addon-devel/add-thermal/diameter-ft") or 4000,
|
||||
"height-msl": getprop(addon.node.getPath() ~ "/addon-devel/add-thermal/height-msl") or 9000,
|
||||
"strength-fps": getprop(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/strength-fps") or 16.0,
|
||||
"diameter-ft": getprop(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/diameter-ft") or 4000,
|
||||
"height-msl": getprop(ADDON_NODE_PATH ~ "/addon-devel/add-thermal/height-msl") or 9000,
|
||||
"search-order": "DATA_ONLY"
|
||||
});
|
||||
|
||||
|
||||