Compare commits
264 Commits
RELEASE_0_
...
RELEASE_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b6af2f0c2 | ||
|
|
5bdff41641 | ||
|
|
67e9d105cb | ||
|
|
f1fc99f16f | ||
|
|
f89e359d53 | ||
|
|
77ec170a50 | ||
|
|
34320f5f20 | ||
|
|
a26271e46e | ||
|
|
e2e7466250 | ||
|
|
1e24cc4643 | ||
|
|
dfc23c3528 | ||
|
|
cd11a5dc27 | ||
|
|
899734296b | ||
|
|
7a3a81c152 | ||
|
|
e62a4a05ac | ||
|
|
463ca207ce | ||
|
|
da6e1b31ea | ||
|
|
8c783b1680 | ||
|
|
efce88ff12 | ||
|
|
01608b7e18 | ||
|
|
a5f0e0395a | ||
|
|
0b723174fd | ||
|
|
5d248bf0df | ||
|
|
c039ccdeb0 | ||
|
|
d88fb32a73 | ||
|
|
37ac409586 | ||
|
|
7b24e94c66 | ||
|
|
e12cd2a50c | ||
|
|
98b2ba4fc1 | ||
|
|
2f0afdccc1 | ||
|
|
79734df554 | ||
|
|
c52657fa1a | ||
|
|
9cac8409cd | ||
|
|
18703ce02d | ||
|
|
709a166bd6 | ||
|
|
8048e6297c | ||
|
|
fb0dded103 | ||
|
|
055e969e7a | ||
|
|
f10db8a30e | ||
|
|
c19af3525e | ||
|
|
7c60ccfc35 | ||
|
|
84cba33aab | ||
|
|
a52b1ec64f | ||
|
|
f30c4720ae | ||
|
|
7fc8c02688 | ||
|
|
54a7a0d534 | ||
|
|
8d73160a75 | ||
|
|
ff10602c65 | ||
|
|
ca50fe386d | ||
|
|
39f3c6e41d | ||
|
|
ba1b96e518 | ||
|
|
ef486b2cc6 | ||
|
|
06f3cb4f8e | ||
|
|
074f5ff996 | ||
|
|
8c26f32d5f | ||
|
|
9a2ee54389 | ||
|
|
ab69c03698 | ||
|
|
fab1f4e7a0 | ||
|
|
41eed484c1 | ||
|
|
7d18f9bdde | ||
|
|
3a48c3de7a | ||
|
|
d769a9936b | ||
|
|
1697cb3b1a | ||
|
|
62aa32a417 | ||
|
|
a0d0852838 | ||
|
|
2f479cae69 | ||
|
|
4820d57fa8 | ||
|
|
04e3b0b3c1 | ||
|
|
a7f78b9f68 | ||
|
|
f3d8eb4665 | ||
|
|
090f79b951 | ||
|
|
88c0dbf661 | ||
|
|
9e3822ceaf | ||
|
|
007b0a8fe6 | ||
|
|
7f0ebf8871 | ||
|
|
5414e94a1a | ||
|
|
461dee8657 | ||
|
|
297b6193fe | ||
|
|
4b74e40a5f | ||
|
|
5a9b08dec2 | ||
|
|
5e6f9f79a2 | ||
|
|
e2f93e6ae1 | ||
|
|
93314b59fb | ||
|
|
29269c6686 | ||
|
|
3c84b6e2f6 | ||
|
|
04fb708543 | ||
|
|
df302f277c | ||
|
|
5e63e663bb | ||
|
|
ca10cb2d37 | ||
|
|
c9854153f8 | ||
|
|
129e3c6326 | ||
|
|
66996711ae | ||
|
|
8fe37cea51 | ||
|
|
de64b6f267 | ||
|
|
9a9d9c7cc1 | ||
|
|
a191e9762a | ||
|
|
a7b35c6e22 | ||
|
|
5034346b67 | ||
|
|
661f64b902 | ||
|
|
bbc83f721c | ||
|
|
01f4541331 | ||
|
|
0e4a894f62 | ||
|
|
1c135a9b5b | ||
|
|
e65c85ce73 | ||
|
|
26b58991f9 | ||
|
|
8390df37ca | ||
|
|
371fc73f24 | ||
|
|
921dae5444 | ||
|
|
9b3abbec89 | ||
|
|
6935baba5b | ||
|
|
dec1e32f96 | ||
|
|
710c2ccfcd | ||
|
|
8e66e534ae | ||
|
|
0f5f30b993 | ||
|
|
b199f733f7 | ||
|
|
0cdcf3a3e0 | ||
|
|
8e09486e82 | ||
|
|
0c24b78573 | ||
|
|
1436be9699 | ||
|
|
0489ad7c62 | ||
|
|
c553570533 | ||
|
|
bda112297f | ||
|
|
331a4e4406 | ||
|
|
a9faf8ceff | ||
|
|
2866d1ace9 | ||
|
|
11a74f7a31 | ||
|
|
634a2035ee | ||
|
|
ffada9257d | ||
|
|
e09164e5b3 | ||
|
|
de1a5f3034 | ||
|
|
86e83faef3 | ||
|
|
9f06c8df76 | ||
|
|
6e511de7db | ||
|
|
e34aae9982 | ||
|
|
675b388b8e | ||
|
|
7d239fe4ac | ||
|
|
edd92caba1 | ||
|
|
5c3b4abf42 | ||
|
|
d3a3466b14 | ||
|
|
4399383781 | ||
|
|
bb383998bb | ||
|
|
ffeb174ca1 | ||
|
|
a90d74dde8 | ||
|
|
9d7fd79e76 | ||
|
|
6f29d234eb | ||
|
|
6f5517f602 | ||
|
|
cc43c745b2 | ||
|
|
db8d961b27 | ||
|
|
a0bdec2846 | ||
|
|
5bbcd386fa | ||
|
|
7657632024 | ||
|
|
ab29063a97 | ||
|
|
c06ef23eb1 | ||
|
|
7b2f7aa827 | ||
|
|
7113c10f4b | ||
|
|
14033946e5 | ||
|
|
6e0e056ca7 | ||
|
|
7aa4f0ccdb | ||
|
|
4b04450fa6 | ||
|
|
ad81560be5 | ||
|
|
5c26faa20e | ||
|
|
bd85fa2457 | ||
|
|
430136fdc9 | ||
|
|
a616aa8e55 | ||
|
|
05b9166c25 | ||
|
|
71770eb92e | ||
|
|
2089a2a956 | ||
|
|
488efa2316 | ||
|
|
44551dad2d | ||
|
|
00e0e72bca | ||
|
|
a611b70087 | ||
|
|
757ed2dfe7 | ||
|
|
8971a67aca | ||
|
|
5a343da5cc | ||
|
|
4c77c1691b | ||
|
|
aadff33011 | ||
|
|
25d7705379 | ||
|
|
867ba3c7da | ||
|
|
3f08d9604e | ||
|
|
5d813aa4d0 | ||
|
|
ce3a1ddcb0 | ||
|
|
e37752f957 | ||
|
|
40d920ddc9 | ||
|
|
4362eb79e6 | ||
|
|
f6c9af488b | ||
|
|
a34ac6a596 | ||
|
|
3b3baa996b | ||
|
|
d6b81a9721 | ||
|
|
a460c753e7 | ||
|
|
9f59e956fa | ||
|
|
bd02eb8e6b | ||
|
|
a266790a25 | ||
|
|
3462e3b6c1 | ||
|
|
ed29944b91 | ||
|
|
a0251b3256 | ||
|
|
557474095f | ||
|
|
b7dd267807 | ||
|
|
58a0b1d2c3 | ||
|
|
d8acc3a8f2 | ||
|
|
5f21c75e02 | ||
|
|
79d72b6292 | ||
|
|
aa67c738a1 | ||
|
|
117628bf7e | ||
|
|
70dbbf52f0 | ||
|
|
99bf2c6f9e | ||
|
|
3fdeea7f65 | ||
|
|
ea9d110036 | ||
|
|
16ad232e0d | ||
|
|
5b8e5fce20 | ||
|
|
0633d703d0 | ||
|
|
ec6ce9fcd8 | ||
|
|
c9e53d5a30 | ||
|
|
828e10773c | ||
|
|
34b5c1a1b9 | ||
|
|
b2a7975493 | ||
|
|
f0af686d17 | ||
|
|
eda1121054 | ||
|
|
d97eb240d9 | ||
|
|
8c296d96c7 | ||
|
|
65a49bb6e4 | ||
|
|
cfedc90fdd | ||
|
|
5665a62938 | ||
|
|
36521869ae | ||
|
|
84fd7a49ad | ||
|
|
24b5f05522 | ||
|
|
17415424bf | ||
|
|
920c0fdb62 | ||
|
|
40414f2823 | ||
|
|
3d43bc0480 | ||
|
|
7bee5f1ab6 | ||
|
|
a43f5c8d21 | ||
|
|
8361069344 | ||
|
|
c9661e2732 | ||
|
|
bd13cf84a1 | ||
|
|
e54cfc002b | ||
|
|
5aac63d9f5 | ||
|
|
6a19bbee7d | ||
|
|
2e5c4b4515 | ||
|
|
79d1aaf7f5 | ||
|
|
a659969bcf | ||
|
|
53bdf9dac4 | ||
|
|
ad394fb090 | ||
|
|
92a123a47d | ||
|
|
755173bd2e | ||
|
|
27477402c9 | ||
|
|
dc9c41e119 | ||
|
|
3c7f9e7ba4 | ||
|
|
fbf018598e | ||
|
|
83b4dcb55c | ||
|
|
5812571df4 | ||
|
|
b1c688abe8 | ||
|
|
f4b30bbdd7 | ||
|
|
e4008862ce | ||
|
|
2b7079eed2 | ||
|
|
983685fde3 | ||
|
|
eef1cc716d | ||
|
|
34e2a9dc37 | ||
|
|
1786692406 | ||
|
|
c37afce303 | ||
|
|
1ea99cdd4d | ||
|
|
4c1d22b8a6 | ||
|
|
5f22c93db7 | ||
|
|
13a42f1d9e | ||
|
|
c4d5d85c3e |
10
.cvsignore
10
.cvsignore
@@ -7,3 +7,13 @@ config.cache
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
do-config.sh
|
||||
.cdtproject
|
||||
.project
|
||||
config.guess
|
||||
config.sub
|
||||
depcomp
|
||||
INSTALL
|
||||
install-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
|
||||
2
Doxyfile
2
Doxyfile
@@ -22,7 +22,7 @@ PROJECT_NAME = SimGear
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.3.4
|
||||
PROJECT_NUMBER = 0.3.8
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
EXTRA_DIST = \
|
||||
acinclude.m4 \
|
||||
autogen.sh \
|
||||
DoxygenMain.cxx
|
||||
DoxygenMain.cxx \
|
||||
README.MSVC \
|
||||
README.metakit \
|
||||
README.zlib \
|
||||
SimGear.dsp \
|
||||
SimGear.dsw
|
||||
@@ -11,7 +10,7 @@ EXTRA_DIST = \
|
||||
SUBDIRS = src-libs simgear
|
||||
|
||||
dist-hook:
|
||||
(cd $(top_srcdir); $(HOME)/projects/FlightGear-0.9/admin/am2dsp.pl)
|
||||
(cd $(top_srcdir); $(HOME)/Projects/FlightGear-0.9/admin/am2dsp.pl)
|
||||
|
||||
#
|
||||
# Rule to build RPM distribution package
|
||||
|
||||
68
NEWS
68
NEWS
@@ -1,3 +1,71 @@
|
||||
New in 0.3.8
|
||||
* January 18, 2005
|
||||
|
||||
* Configure script does a sanity check for the existance of openal.
|
||||
* Better pthreads detection for FreeBSD.
|
||||
* Abstract out the location of gl.h, glu.h, and glut.h so we can more
|
||||
easily support MacOS which puts these in an oddball location.
|
||||
* Added two new debug output types for instrumentation and systems.
|
||||
* Add a name parameter to the waypoint class for supporting a route
|
||||
manager in the flightgear gps module.
|
||||
* Make display list usage optional.
|
||||
* Event manager: specifying a zero delay will force event execution in
|
||||
the next frame rather than entering an infinite loop.
|
||||
* gcc-4.0 fix.
|
||||
* Fixes to property tree loading and saving.
|
||||
* Make volume inaudible at startup.
|
||||
* Solaris fixes.
|
||||
* For low density cloud coverages, blend the layer to nothing as we pass
|
||||
through instead of fully engulfing the aircraft in the cloud.
|
||||
* Add several new capabilities to the texture management code for building
|
||||
normal maps and doing some simple on-the-fly effects on textures.
|
||||
* Better error message for sound problems.
|
||||
* Add support for binding a thread to a specific CPU.
|
||||
|
||||
|
||||
New in 0.3.7
|
||||
* October 12, 2004
|
||||
|
||||
* Add support for parsing xml from an in memory buffer, not just a file.
|
||||
* Don't reduce visibility for a "clear" cloud layer.
|
||||
* Add support for audio orientation (direction and cone) for internal
|
||||
view and tower view.
|
||||
* Add support for drawing from display lists rather than in immediate mode.
|
||||
This provides a big performance improvement on many systems.
|
||||
|
||||
|
||||
New in 0.3.6
|
||||
* July 29, 2004
|
||||
|
||||
* Better MinGW support
|
||||
* A bit better handling of OpenAL under Cygwin
|
||||
* Switched audio system from plib's "sl/sm" to OpenAL.
|
||||
* Add support for scaling an object based on distance. The scaling
|
||||
factor is determined by a lookup table based on distance.
|
||||
* Add a "flash" animation type.
|
||||
* Fix cloud positioning/animation bugs.
|
||||
* Fix an off-by-one error in props_io.cxx
|
||||
* Clip audio gain (volume) to 1.0
|
||||
|
||||
|
||||
New in 0.3.5
|
||||
* March 26, 2004
|
||||
|
||||
* Added Andy's nasal interpreter for small built in scripting tasks.
|
||||
Nasal integrates nicely with FlightGear's property system.
|
||||
* Added new (much simpler) metar parsing code (removed older more
|
||||
complex code.)
|
||||
* Support VASI/PAPI lights correctly.
|
||||
* Fixes to cloud animation.
|
||||
* Updates to sky dome coloring as well as sun/moon coloring.
|
||||
* Vary environment lighting with visibility (subtlely.)
|
||||
* Support control of alpha test in model animation.
|
||||
* Complete rewrite of the event manager.
|
||||
* Updates to low level socket code to make it more flexible.
|
||||
* Win32 serial port communication fixes.
|
||||
* sg_geodesy rewritten to be more accurate and robust and symmetric.
|
||||
|
||||
|
||||
New in 0.3.4
|
||||
* October 22, 2003
|
||||
|
||||
|
||||
12
README.OpenAL
Normal file
12
README.OpenAL
Normal file
@@ -0,0 +1,12 @@
|
||||
[This file is mirrored in both the FlightGear and SimGear packages.]
|
||||
|
||||
You *must* have the development components of OpenAL installed on your system
|
||||
to build FlightGear!" You can get a copy here:
|
||||
|
||||
http://www.openal.org
|
||||
|
||||
Build notes:
|
||||
|
||||
The OpenAL developers do not make "versioned" releases so we recommend that
|
||||
you pull the latest version via anonymous CVS (follow the instructions at
|
||||
the OpenAL web site) and build/install that.
|
||||
496
SimGear.dsp
496
SimGear.dsp
@@ -570,200 +570,20 @@ SOURCE=.\simgear\math\fastmath.cxx
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Lib_sgmetar"
|
||||
# Begin Group "Lib_sgenvironment"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Antoi.cpp
|
||||
SOURCE=.\simgear\environment\metar.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
# PROP Intermediate_Dir "Release\Lib_sgenvironment"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Charcmp.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Dcdmetar.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Dcdmtrmk.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Drvmetar.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Fracpart.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Local.h
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Metar.h
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\MetarReport.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\MetarStation.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Prtdmetr.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Stspack2.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\metar\Stspack3.cpp
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmetar"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmetar"
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgenvironment"
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -861,6 +681,265 @@ SOURCE=.\simgear\misc\zfstream.cxx
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\misc\interpolator.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmisc"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmisc"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Lib_sgnasal"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\code.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\code.h
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\codegen.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\data.h
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\debug.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\gc.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\hash.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\lex.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\lib.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\mathlib.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\misc.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\nasal.h
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\parse.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\parse.h
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\string.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\nasal\vector.c
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgnasal"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgnasal"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Lib_sgprops"
|
||||
@@ -1015,6 +1094,21 @@ SOURCE=.\simgear\scene\model\animation.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\scene\model\custtrans.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmodel"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmodel"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\scene\model\location.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
@@ -1060,6 +1154,21 @@ SOURCE=.\simgear\scene\model\modellib.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\scene\model\personality.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgmodel"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgmodel"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\scene\model\placement.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
@@ -2284,7 +2393,7 @@ SOURCE=.\simgear\serial\serial.cxx
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\sound\sound.cxx
|
||||
SOURCE=.\simgear\sound\sample_openal.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
@@ -2299,7 +2408,22 @@ SOURCE=.\simgear\sound\sound.cxx
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\sound\soundmgr.cxx
|
||||
SOURCE=.\simgear\sound\soundmgr_openal.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
# PROP Intermediate_Dir "Release\Lib_sgsound"
|
||||
|
||||
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"
|
||||
|
||||
# PROP Intermediate_Dir "Debug\Lib_sgsound"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\simgear\sound\xmlsound.cxx
|
||||
|
||||
!IF "$(CFG)" == "SimGear - Win32 Release"
|
||||
|
||||
|
||||
4
Thanks
4
Thanks
@@ -90,7 +90,7 @@ David Megginson <david@megginson.com>
|
||||
SimGear property manager/registry
|
||||
|
||||
|
||||
Curt Olson <curt@flightgear.org>
|
||||
Curt Olson http://www.flightgear.org/~curt/
|
||||
Curt is responsible for overall project and source code management.
|
||||
He has his hands in many of the areas.
|
||||
|
||||
@@ -175,7 +175,7 @@ NOTE:
|
||||
----
|
||||
|
||||
THIS DOCUMENT WAS INITIALLY WRITTEN BY
|
||||
Curt L. Olson <curt@flightgear.org>
|
||||
Curt L. Olson <http://www.flightgear.org/~curt>
|
||||
|
||||
|
||||
05 Jul 2000 Removed non-SimGear entries (CLO)
|
||||
|
||||
128
configure.ac
128
configure.ac
@@ -1,7 +1,5 @@
|
||||
dnl Process this file with autoget.sh to produce a working configure
|
||||
dnl script.
|
||||
dnl
|
||||
dnl $Id$
|
||||
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([simgear/bucket/newbucket.cxx])
|
||||
@@ -10,7 +8,7 @@ dnl Require at least automake 2.52
|
||||
AC_PREREQ(2.52)
|
||||
|
||||
dnl Initialize the automake stuff
|
||||
AM_INIT_AUTOMAKE(SimGear, 0.3.4)
|
||||
AM_INIT_AUTOMAKE(SimGear, 0.3.8)
|
||||
|
||||
dnl Specify KAI C++ compiler and flags.
|
||||
dnl Borrowed with slight modification from blitz distribution.
|
||||
@@ -47,8 +45,25 @@ case "${host}" in
|
||||
if test "x$CXX" = "xCC" -o "x$CXX" = "xccache CC"; then
|
||||
AR="$CXX -ar"
|
||||
ARFLAGS="-o"
|
||||
CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility"
|
||||
CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility/MIPSpro740"
|
||||
compatibility_DIR="compatibility"
|
||||
MIPSpro_DIRS="MIPSpro740"
|
||||
AC_MSG_CHECKING([for MIPSpro compiler version 7.4 or newer])
|
||||
AC_TRY_RUN([
|
||||
int main() {
|
||||
if ( _COMPILER_VERSION < 740 ) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
], AC_MSG_RESULT(yes),
|
||||
[ AC_MSG_RESULT(no)
|
||||
CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility/MIPSpro721"
|
||||
MIPSpro_DIRS="$(MIPSpro_DIRS) MIPSpro721"
|
||||
AC_MSG_WARN([Using our own subset of the STL headers])
|
||||
], AC_MSG_RESULT(yes))
|
||||
AC_SUBST(MIPSpro_DIRS)
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
@@ -96,6 +111,13 @@ else
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$with_jpeg_factory" = "xyes")
|
||||
|
||||
# specify the plib location
|
||||
AC_ARG_WITH(plib, [ --with-plib=PREFIX Specify the prefix path to plib])
|
||||
|
||||
if test "x$with_plib" != "x" ; then
|
||||
echo "plib prefix is $with_plib"
|
||||
EXTRA_DIRS="${EXTRA_DIRS} $with_plib"
|
||||
fi
|
||||
|
||||
dnl Determine an extra directories to add to include/lib search paths
|
||||
case "${host}" in
|
||||
@@ -110,7 +132,7 @@ case "${host}" in
|
||||
if test -d /opt/X11R6 ; then
|
||||
EXTRA_DIR2="/opt/X11R6"
|
||||
fi
|
||||
EXTRA_DIRS="$EXTRA_DIR1 $EXTRA_DIR2"
|
||||
EXTRA_DIRS="${EXTRA_DIRS} $EXTRA_DIR1 $EXTRA_DIR2"
|
||||
;;
|
||||
|
||||
esac
|
||||
@@ -141,33 +163,18 @@ dnl Checks for libraries.
|
||||
|
||||
dnl Thread related checks
|
||||
AC_CHECK_HEADER(pthread.h)
|
||||
AC_CHECK_LIB(pthread, pthread_exit)
|
||||
if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
|
||||
AC_SEARCH_LIBS(pthread_exit, [pthread c_r])
|
||||
if test "x$ac_cv_header_pthread_h" = "xyes"; then
|
||||
CXXFLAGS="$CXXFLAGS -D_REENTRANT"
|
||||
CFLAGS="$CFLAGS -D_REENTRANT"
|
||||
fi
|
||||
if test "x$ac_cv_lib_pthread_pthread_exit" != "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
|
||||
dnl FreeBSD: System has pthread.h, but -lpthread library check
|
||||
dnl fails. See if we need -pthread instead of -lpthread and look
|
||||
dnl for the functions in libc_r.
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
|
||||
if test "x$ac_cv_search_pthread_exit" = "x-lc_r"; then
|
||||
CXXFLAGS="-pthread $CXXFLAGS"
|
||||
CFLAGS="-pthread $FLAGS"
|
||||
save_LIBS=$LIBS
|
||||
AC_CHECK_LIB(c_r, pthread_exit)
|
||||
if test "x$ac_cv_lib_c_r_pthread_exit" != "xyes"; then
|
||||
CXXFLAGS=$save_CXXFLAGS
|
||||
CFLAGS=$save_CFLAGS
|
||||
else
|
||||
dnl This is cheating a bit. pthread_exit comes with using -pthread, not
|
||||
-lpthread
|
||||
ac_cv_lib_pthread_pthread_exit="yes"
|
||||
fi
|
||||
LIBS=$save_LIBS
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_header_pthread_h" = "xyes")
|
||||
|
||||
thread_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
@@ -246,7 +253,56 @@ esac
|
||||
opengl_LIBS="$LIBS"
|
||||
LIBS="$base_LIBS"
|
||||
|
||||
dnl check for OpenAL libraries
|
||||
OPENAL_OK="no"
|
||||
case "${host}" in
|
||||
*-*-cygwin* | *-*-mingw32*)
|
||||
dnl CygWin under Windoze.
|
||||
|
||||
AC_SEARCH_LIBS(alGenBuffers, openal32)
|
||||
AC_SEARCH_LIBS(alutInit, [ openal32 ALut ] )
|
||||
LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
|
||||
openal_LIBS="$LIBS"
|
||||
OPENAL_OK="$ac_cv_search_alGenBuffers"
|
||||
;;
|
||||
|
||||
*-apple-darwin*)
|
||||
dnl Mac OS X
|
||||
|
||||
LIBS="$LIBS -framework IOKit -framework OpenAL"
|
||||
openal_LIBS="$LIBS"
|
||||
# not sure how to test if OpenAL exists on MacOS (does it come by default?)
|
||||
OPENAL_OK="yes"
|
||||
;;
|
||||
|
||||
*)
|
||||
dnl default unix style machines
|
||||
|
||||
save_LIBS=$LIBS
|
||||
LIBS="$LIBS $thread_LIBS"
|
||||
AC_SEARCH_LIBS(alGenBuffers, openal)
|
||||
OPENAL_OK="$ac_cv_search_alGenBuffers"
|
||||
openal_LIBS="$LIBS"
|
||||
LIBS=$save_LIBS
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
if test "$OPENAL_OK" == "no"; then
|
||||
echo
|
||||
echo "You *must* have the openal library installed on your system to build"
|
||||
echo "SimGear!"
|
||||
echo
|
||||
echo "Please see README.OpenAL for more details."
|
||||
echo
|
||||
echo "configure aborted."
|
||||
exit
|
||||
fi
|
||||
|
||||
LIBS="$base_LIBS"
|
||||
|
||||
AC_SUBST(base_LIBS)
|
||||
AC_SUBST(openal_LIBS)
|
||||
AC_SUBST(opengl_LIBS)
|
||||
AC_SUBST(thread_LIBS)
|
||||
AC_SUBST(network_LIBS)
|
||||
@@ -273,11 +329,11 @@ if test "x$ac_cv_header_plib_ul_h" != "xyes"; then
|
||||
exit
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for plib 1.6.0 or newer])
|
||||
AC_MSG_CHECKING([for plib 1.8.4 or newer])
|
||||
AC_TRY_RUN([
|
||||
#include <plib/ul.h>
|
||||
|
||||
#define MIN_PLIB_VERSION 160
|
||||
#define MIN_PLIB_VERSION 184
|
||||
|
||||
int main() {
|
||||
int major, minor, micro;
|
||||
@@ -292,7 +348,7 @@ int main() {
|
||||
],
|
||||
AC_MSG_RESULT(yes),
|
||||
[AC_MSG_RESULT(wrong version);
|
||||
AC_MSG_ERROR([Install plib 1.6.0 or later first...])],
|
||||
AC_MSG_ERROR([Install plib 1.8.4 or later first...])],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
@@ -333,11 +389,14 @@ AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
|
||||
dnl Checks for library functions.
|
||||
old_LIBS=$LIBS
|
||||
LIBS="$base_LIBS $network_LIBS $opengl_LIBS"
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS( \
|
||||
AC_CHECK_FUNCS( [ \
|
||||
ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
|
||||
random drand48 setitimer getitimer signal GetLocalTime rint getrusage )
|
||||
random drand48 setitimer getitimer signal GetLocalTime rint getrusage ] )
|
||||
LIBS=$old_LIBS
|
||||
|
||||
AM_CONFIG_HEADER(simgear/simgear_config.h)
|
||||
|
||||
@@ -348,14 +407,17 @@ AC_CONFIG_FILES([ \
|
||||
simgear/Makefile \
|
||||
simgear/version.h \
|
||||
simgear/compatibility/Makefile \
|
||||
simgear/compatibility/MIPSpro721/Makefile \
|
||||
simgear/compatibility/MIPSpro740/Makefile \
|
||||
simgear/bucket/Makefile \
|
||||
simgear/debug/Makefile \
|
||||
simgear/ephemeris/Makefile \
|
||||
simgear/io/Makefile \
|
||||
simgear/magvar/Makefile \
|
||||
simgear/math/Makefile \
|
||||
simgear/metar/Makefile \
|
||||
simgear/environment/Makefile \
|
||||
simgear/misc/Makefile \
|
||||
simgear/nasal/Makefile \
|
||||
simgear/props/Makefile \
|
||||
simgear/route/Makefile \
|
||||
simgear/scene/Makefile \
|
||||
@@ -397,7 +459,7 @@ else
|
||||
echo "Without JPEG Factory support"
|
||||
fi
|
||||
|
||||
if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -a "x$ac_cv_header_pthread_h" = "xyes"; then
|
||||
if test "x$ac_cv_header_pthread_h" = "xyes"; then
|
||||
echo "Threads: pthread lib found."
|
||||
else
|
||||
echo "Threads: no threads (pthread lib not found.)"
|
||||
|
||||
@@ -5,7 +5,7 @@ SGTHREAD_DIR =
|
||||
endif
|
||||
|
||||
# METAR_DIRS =
|
||||
METAR_DIRS = metar
|
||||
METAR_DIRS = environment
|
||||
|
||||
EXTRA_DIST = simgear_config.h.vc5 version.h.in
|
||||
|
||||
@@ -24,6 +24,7 @@ SUBDIRS = \
|
||||
magvar \
|
||||
math \
|
||||
$(METAR_DIRS) \
|
||||
nasal \
|
||||
props \
|
||||
route \
|
||||
scene \
|
||||
@@ -34,4 +35,4 @@ SUBDIRS = \
|
||||
timing \
|
||||
xgl
|
||||
|
||||
DIST_SUBDIRS = $(SUBDIRS) compatibility metar threads
|
||||
DIST_SUBDIRS = $(SUBDIRS) compatibility threads
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Written by Curtis L. Olson, started February 1999.
|
||||
*
|
||||
* Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
* Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt/
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Written by Curtis L. Olson, started February 1999.
|
||||
*
|
||||
* Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
* Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -257,14 +257,16 @@ public:
|
||||
// Informational methods.
|
||||
|
||||
/**
|
||||
* @return the lon of the lower left corner of this tile.
|
||||
* @return the lon of the lower left corner of
|
||||
* the 1x1 chunk containing this tile.
|
||||
*/
|
||||
inline int get_lon() const { return lon; }
|
||||
inline int get_chunk_lon() const { return lon; }
|
||||
|
||||
/**
|
||||
* @return the lat of the lower left corner of this tile.
|
||||
* @return the lat of the lower left corner of
|
||||
* the 1x1 chunk containing this tile.
|
||||
*/
|
||||
inline int get_lat() const { return lat; }
|
||||
inline int get_chunk_lat() const { return lat; }
|
||||
|
||||
/**
|
||||
* @return the x coord within the 1x1 degree chunk this tile.
|
||||
|
||||
2
simgear/compatibility/MIPSpro721/.cvsignore
Normal file
2
simgear/compatibility/MIPSpro721/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
14
simgear/compatibility/MIPSpro721/Makefile.am
Normal file
14
simgear/compatibility/MIPSpro721/Makefile.am
Normal file
@@ -0,0 +1,14 @@
|
||||
includedir = @includedir@/compatibility/
|
||||
|
||||
include_HEADERS = \
|
||||
iostream \
|
||||
strstream \
|
||||
sstream \
|
||||
istream \
|
||||
fstream \
|
||||
iterator \
|
||||
iomanip \
|
||||
new \
|
||||
streambuf \
|
||||
\
|
||||
irix_string
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
namespace std {
|
||||
using ::fstream;
|
||||
using ::ifstream;
|
||||
using ::ofstream;
|
||||
using ::ifstream;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
# include <iomanip.h>
|
||||
|
||||
namespace std {
|
||||
|
||||
using ::setw;
|
||||
using ::setprecision;
|
||||
|
||||
inline int setfill(int f) { ::setfill(f); }
|
||||
};
|
||||
@@ -2,10 +2,9 @@
|
||||
#ifndef __SG_IOSTREAM
|
||||
#define __SG_IOSTREAM 1
|
||||
|
||||
# include <fstream>
|
||||
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
|
||||
# include <fstream>
|
||||
# include <iostream.h>
|
||||
|
||||
class ios_base : public ios {
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
#ifndef __SGI_HXX
|
||||
#define __SGI_HXX
|
||||
#define __SGI_HXX 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -40,4 +42,6 @@ operator+(const char* lhs, const std::string& rhs)
|
||||
return std::string(lhs) + rhs;
|
||||
}
|
||||
|
||||
#endif // !__SGI_HXX
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* !__SGI_HXX */
|
||||
@@ -14,8 +14,7 @@ namespace std {
|
||||
};
|
||||
|
||||
|
||||
class istringstream : public istrstream {
|
||||
};
|
||||
typedef istrstream istringstream;
|
||||
|
||||
};
|
||||
|
||||
2
simgear/compatibility/MIPSpro740/.cvsignore
Normal file
2
simgear/compatibility/MIPSpro740/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
22
simgear/compatibility/MIPSpro740/Makefile.am
Normal file
22
simgear/compatibility/MIPSpro740/Makefile.am
Normal file
@@ -0,0 +1,22 @@
|
||||
includedir = @includedir@/compatibility
|
||||
|
||||
EXTRA_DIST = README
|
||||
|
||||
include_HEADERS = \
|
||||
cfloat \
|
||||
csetjmp \
|
||||
cstdio \
|
||||
cwchar \
|
||||
cassert \
|
||||
climits \
|
||||
csignal \
|
||||
cstdlib \
|
||||
cwctype \
|
||||
cctype \
|
||||
clocale \
|
||||
cstdarg \
|
||||
cstring \
|
||||
cerrno \
|
||||
cmath \
|
||||
cstddef \
|
||||
ctime
|
||||
@@ -1,33 +1,3 @@
|
||||
includedir = @includedir@/compatibility
|
||||
SUBDIRS = $(MIPSpro_DIRS)
|
||||
|
||||
EXTRA_DIST = README
|
||||
|
||||
include_HEADERS = \
|
||||
cfloat \
|
||||
csetjmp \
|
||||
cstdio \
|
||||
cwchar \
|
||||
iostream \
|
||||
strstream \
|
||||
sstream \
|
||||
cassert \
|
||||
climits \
|
||||
csignal \
|
||||
cstdlib \
|
||||
cwctype \
|
||||
istream \
|
||||
cctype \
|
||||
clocale \
|
||||
cstdarg \
|
||||
cstring \
|
||||
fstream \
|
||||
iterator \
|
||||
cerrno \
|
||||
cmath \
|
||||
cstddef \
|
||||
ctime \
|
||||
iomanip \
|
||||
new \
|
||||
streambuf \
|
||||
\
|
||||
IRIX
|
||||
DIST_SUBDIRS = MIPSpro721 MIPSpro740
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
# define STL_STRSTREAM <strstream>
|
||||
|
||||
# endif
|
||||
# elif __GNUC__ == 3
|
||||
# elif __GNUC__ >= 3
|
||||
// g++-3.0.x
|
||||
# define SG_EXPLICIT_FUNCTION_TMPL_ARGS
|
||||
# define SG_NEED_AUTO_PTR
|
||||
@@ -149,12 +149,6 @@
|
||||
|
||||
#endif // __GNUC__
|
||||
|
||||
#if defined( __MINGW32__ )
|
||||
# define bcopy(from, to, n) memcpy(to, from, n)
|
||||
# define FG_MEM_COPY(to,from,n) memcpy(to, from, n)
|
||||
# define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
/* KAI C++ */
|
||||
#if defined(__KCC)
|
||||
|
||||
@@ -219,7 +213,7 @@
|
||||
# define bcopy(from, to, n) memcpy(to, from, n)
|
||||
# define FG_MEM_COPY(to,from,n) memcpy(to, from, n)
|
||||
|
||||
# if _MSC_VER == 1200 // msvc++ 6.0
|
||||
# if _MSC_VER >= 1200 // msvc++ 6.0 or greater
|
||||
# define SG_NAMESPACES
|
||||
# define SG_HAVE_STD
|
||||
# define SG_HAVE_STD_INCLUDES
|
||||
@@ -235,6 +229,7 @@
|
||||
# define STL_STRING <string>
|
||||
# define STL_STRSTREAM <strstream>
|
||||
|
||||
# define isnan _isnan
|
||||
# define snprintf _snprintf
|
||||
|
||||
# pragma warning(disable: 4786) // identifier was truncated to '255' characters
|
||||
@@ -290,8 +285,6 @@
|
||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
||||
# define SG_HAVE_NATIVE_SGI_COMPILERS
|
||||
|
||||
#include <simgear/compatibility/IRIX>
|
||||
|
||||
# define SG_EXPLICIT_FUNCTION_TMPL_ARGS
|
||||
# define SG_CLASS_PARTIAL_SPECIALIZATION
|
||||
# define SG_NEED_AUTO_PTR
|
||||
@@ -309,7 +302,11 @@
|
||||
# define STL_ITERATOR <iterator>
|
||||
# define STL_FSTREAM <fstream>
|
||||
# define STL_STDEXCEPT <stdexcept>
|
||||
#if (_COMPILER_VERSION < 740)
|
||||
# define STL_STRING <irix_string>
|
||||
#else
|
||||
# define STL_STRING <string>
|
||||
#endif
|
||||
# define STL_STRSTREAM <strstream>
|
||||
|
||||
#pragma set woff 1001,1012,1014,1116,1155,1172,1174
|
||||
@@ -317,6 +314,9 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
#pragma set woff 1682,3303
|
||||
#if (_COMPILER_VERSION >= 740)
|
||||
# pragma set woff 3624
|
||||
#endif
|
||||
#endif
|
||||
|
||||
# define SG_COMPILER_STR "SGI MipsPro compiler version " SG_STRINGIZE(_COMPILER_VERSION)
|
||||
@@ -336,7 +336,9 @@
|
||||
extern void *memmove(void *, const void *, size_t);
|
||||
# endif // __cplusplus
|
||||
|
||||
# define SG_COMPILER_STR "Sun compiler version " SG_STRINGIZE(__SUNPRO_CC)
|
||||
# if !defined( __GNUC__ )
|
||||
# define SG_COMPILER_STR "Sun compiler version " SG_STRINGIZE(__SUNPRO_CC)
|
||||
# endif
|
||||
|
||||
#endif // sun
|
||||
|
||||
@@ -364,6 +366,23 @@
|
||||
|
||||
#endif // __ICC
|
||||
|
||||
//
|
||||
// Platform dependent gl.h and glut.h definitions
|
||||
//
|
||||
|
||||
#ifdef __APPLE__
|
||||
# define SG_GL_H <OpenGL/gl.h>
|
||||
# define SG_GLU_H <OpenGL/glu.h>
|
||||
# define SG_GLEXT_H <OpenGL/glext.h>
|
||||
# define SG_GLUT_H <GLUT/glut.h>
|
||||
#else
|
||||
# define SG_GL_H <GL/gl.h>
|
||||
# define SG_GLU_H <GL/glu.h>
|
||||
# define SG_GLEXT_H <GL/glext.h>
|
||||
# define SG_GLUT_H <GL/glut.h>
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// No user modifiable definitions beyond here.
|
||||
//
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started February 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
@@ -106,21 +106,51 @@
|
||||
#define SG_METER_TO_FEET 3.28083989501312335958
|
||||
|
||||
/** Meters to Nautical Miles. 1 nm = 6076.11549 feet */
|
||||
#define SG_METER_TO_NM 0.00053995680
|
||||
#define SG_METER_TO_NM 0.0005399568034557235
|
||||
|
||||
/** Nautical Miles to Meters */
|
||||
#define SG_NM_TO_METER 1852.0000
|
||||
|
||||
/** Meters to Statute Miles. */
|
||||
#define SG_METER_TO_SM 0.0006213699494949496
|
||||
|
||||
/** Statute Miles to Meters. */
|
||||
#define SG_SM_TO_METER 1609.3412196
|
||||
|
||||
/** Radians to Nautical Miles. 1 nm = 1/60 of a degree */
|
||||
#define SG_NM_TO_RAD 0.00029088820866572159
|
||||
|
||||
/** Nautical Miles to Radians */
|
||||
#define SG_RAD_TO_NM 3437.7467707849392526
|
||||
|
||||
/** Miles per second to Knots */
|
||||
#define SG_MPS_TO_KT 1.9438444924406046432
|
||||
|
||||
/** Knots to Miles per second */
|
||||
#define SG_KT_TO_MPS 0.5144444444444444444
|
||||
|
||||
/** Miles per second to Miles per hour */
|
||||
#define SG_MPS_TO_MPH 2.2369362920544020312
|
||||
|
||||
/** Miles per hour to Miles per second */
|
||||
#define SG_MPH_TO_MPS 0.44704
|
||||
|
||||
/** Meters per second to Kilometers per hour */
|
||||
#define SG_MPS_TO_KMH 3.6
|
||||
|
||||
/** Kilometers per hour to Miles per second */
|
||||
#define SG_KMH_TO_MPS 0.2777777777777777778
|
||||
|
||||
/** Pascal to Inch Mercury */
|
||||
#define SG_PA_TO_INHG 0.0002952998330101010
|
||||
|
||||
/** Inch Mercury to Pascal */
|
||||
#define SG_INHG_TO_PA 3386.388640341
|
||||
|
||||
|
||||
/** For divide by zero avoidance, this will be close enough to zero */
|
||||
#define SG_EPSILON 0.0000001
|
||||
|
||||
|
||||
/** Highest binobj format version we know how to read/write. This starts at
|
||||
* 0 and can go up to 65535 */
|
||||
#define SG_BINOBJ_VERSION 6
|
||||
|
||||
@@ -24,7 +24,10 @@ typedef enum {
|
||||
SG_CLIPPER = 0x00002000,
|
||||
SG_NETWORK = 0x00004000,
|
||||
SG_ATC = 0x00008000,
|
||||
SG_UNDEFD = 0x00010000, // For range checking
|
||||
SG_NASAL = 0x00010000,
|
||||
SG_INSTR = 0x00020000,
|
||||
SG_SYSTEMS = 0x00040000,
|
||||
SG_UNDEFD = 0x00080000, // For range checking
|
||||
|
||||
SG_ALL = 0xFFFFFFFF
|
||||
} sgDebugClass;
|
||||
|
||||
@@ -28,6 +28,10 @@
|
||||
|
||||
#include <simgear/compiler.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef SG_HAVE_STD_INCLUDES
|
||||
# include <streambuf>
|
||||
# include <iostream>
|
||||
@@ -180,7 +184,23 @@ logbuf::set_log_state( sgDebugClass c, sgDebugPriority p )
|
||||
inline logbuf::int_type
|
||||
logbuf::overflow( int c )
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
static has_console = false;
|
||||
if ( logging_enabled ) {
|
||||
if ( !has_console ) {
|
||||
AllocConsole();
|
||||
freopen("conin$", "r", stdin);
|
||||
freopen("conout$", "w", stdout);
|
||||
freopen("conout$", "w", stderr);
|
||||
has_console = true;
|
||||
}
|
||||
sbuf->sputc(c);
|
||||
}
|
||||
else
|
||||
return EOF == 0 ? 1: 0;
|
||||
#else
|
||||
return logging_enabled ? sbuf->sputc(c) : (EOF == 0 ? 1: 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
4
simgear/environment/.cvsignore
Normal file
4
simgear/environment/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
metar
|
||||
9
simgear/environment/Makefile.am
Normal file
9
simgear/environment/Makefile.am
Normal file
@@ -0,0 +1,9 @@
|
||||
includedir = @includedir@/environment
|
||||
|
||||
lib_LIBRARIES = libsgenvironment.a
|
||||
|
||||
include_HEADERS = metar.hxx
|
||||
|
||||
libsgenvironment_a_SOURCES = metar.cxx
|
||||
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
1140
simgear/environment/metar.cxx
Normal file
1140
simgear/environment/metar.cxx
Normal file
File diff suppressed because it is too large
Load Diff
261
simgear/environment/metar.hxx
Normal file
261
simgear/environment/metar.hxx
Normal file
@@ -0,0 +1,261 @@
|
||||
// metar interface class
|
||||
//
|
||||
// Written by Melchior FRANZ, started December 2003.
|
||||
//
|
||||
// Copyright (C) 2003 Melchior FRANZ - mfranz@aon.at
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#ifndef _METAR_HXX
|
||||
#define _METAR_HXX
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include <simgear/constants.h>
|
||||
|
||||
SG_USING_STD(vector);
|
||||
SG_USING_STD(map);
|
||||
SG_USING_STD(string);
|
||||
|
||||
const double SGMetarNaN = -1E20;
|
||||
#define NaN SGMetarNaN
|
||||
|
||||
struct Token {
|
||||
char *id;
|
||||
char *text;
|
||||
};
|
||||
|
||||
|
||||
class SGMetar;
|
||||
|
||||
class SGMetarVisibility {
|
||||
friend class SGMetar;
|
||||
public:
|
||||
SGMetarVisibility() :
|
||||
_distance(NaN),
|
||||
_direction(-1),
|
||||
_modifier(EQUALS),
|
||||
_tendency(NONE) {}
|
||||
|
||||
enum Modifier {
|
||||
NOGO,
|
||||
EQUALS,
|
||||
LESS_THAN,
|
||||
GREATER_THAN
|
||||
};
|
||||
|
||||
enum Tendency {
|
||||
NONE,
|
||||
STABLE,
|
||||
INCREASING,
|
||||
DECREASING
|
||||
};
|
||||
|
||||
inline double getVisibility_m() const { return _distance; }
|
||||
inline double getVisibility_ft() const { return _distance == NaN ? NaN : _distance * SG_METER_TO_FEET; }
|
||||
inline double getVisibility_sm() const { return _distance == NaN ? NaN : _distance * SG_METER_TO_SM; }
|
||||
inline int getDirection() const { return _direction; }
|
||||
inline int getModifier() const { return _modifier; }
|
||||
inline int getTendency() const { return _tendency; }
|
||||
|
||||
protected:
|
||||
double _distance;
|
||||
int _direction;
|
||||
int _modifier;
|
||||
int _tendency;
|
||||
};
|
||||
|
||||
|
||||
// runway condition (surface and visibility)
|
||||
class SGMetarRunway {
|
||||
friend class SGMetar;
|
||||
public:
|
||||
SGMetarRunway() :
|
||||
_deposit(0),
|
||||
_extent(-1),
|
||||
_extent_string(0),
|
||||
_depth(NaN),
|
||||
_friction(NaN),
|
||||
_friction_string(0),
|
||||
_comment(0),
|
||||
_wind_shear(false) {}
|
||||
|
||||
inline const char *getDeposit() const { return _deposit; }
|
||||
inline double getExtent() const { return _extent; }
|
||||
inline const char *getExtentString() const { return _extent_string; }
|
||||
inline double getDepth() const { return _depth; }
|
||||
inline double getFriction() const { return _friction; }
|
||||
inline const char *getFrictionString() const { return _friction_string; }
|
||||
inline const char *getComment() const { return _comment; }
|
||||
inline const bool getWindShear() const { return _wind_shear; }
|
||||
inline SGMetarVisibility getMinVisibility() const { return _min_visibility; }
|
||||
inline SGMetarVisibility getMaxVisibility() const { return _max_visibility; }
|
||||
|
||||
protected:
|
||||
SGMetarVisibility _min_visibility;
|
||||
SGMetarVisibility _max_visibility;
|
||||
const char *_deposit;
|
||||
int _extent;
|
||||
const char *_extent_string;
|
||||
double _depth;
|
||||
double _friction;
|
||||
const char *_friction_string;
|
||||
const char *_comment;
|
||||
bool _wind_shear;
|
||||
};
|
||||
|
||||
|
||||
// cloud layer
|
||||
class SGMetarCloud {
|
||||
friend class SGMetar;
|
||||
public:
|
||||
SGMetarCloud() :
|
||||
_coverage(-1),
|
||||
_altitude(NaN),
|
||||
_type(0),
|
||||
_type_long(0) {}
|
||||
|
||||
inline int getCoverage() const { return _coverage; }
|
||||
inline double getAltitude_m() const { return _altitude; }
|
||||
inline double getAltitude_ft() const { return _altitude == NaN ? NaN : _altitude * SG_METER_TO_FEET; }
|
||||
inline char *getTypeString() const { return _type; }
|
||||
inline char *getTypeLongString() const { return _type_long; }
|
||||
|
||||
protected:
|
||||
int _coverage; // quarters: 0 -> clear ... 4 -> overcast
|
||||
double _altitude; // 1000 m
|
||||
char *_type; // CU
|
||||
char *_type_long; // cumulus
|
||||
};
|
||||
|
||||
|
||||
class SGMetar {
|
||||
public:
|
||||
SGMetar(const string& m, const string& proxy = "", const string& port = "", const string &auth = "");
|
||||
~SGMetar();
|
||||
|
||||
enum ReportType {
|
||||
NONE,
|
||||
AUTO,
|
||||
COR,
|
||||
RTD
|
||||
};
|
||||
|
||||
inline const char *getData() const { return _data; }
|
||||
inline const char *getUnusedData() const { return _m; }
|
||||
inline const char *getId() const { return _icao; }
|
||||
inline int getYear() const { return _year; }
|
||||
inline int getMonth() const { return _month; }
|
||||
inline int getDay() const { return _day; }
|
||||
inline int getHour() const { return _hour; }
|
||||
inline int getMinute() const { return _minute; }
|
||||
inline int getReportType() const { return _report_type; }
|
||||
|
||||
inline int getWindDir() const { return _wind_dir; }
|
||||
inline double getWindSpeed_mps() const { return _wind_speed; }
|
||||
inline double getWindSpeed_kmh() const { return _wind_speed == NaN ? NaN : _wind_speed * SG_MPS_TO_KMH; }
|
||||
inline double getWindSpeed_kt() const { return _wind_speed == NaN ? NaN : _wind_speed * SG_MPS_TO_KT; }
|
||||
inline double getWindSpeed_mph() const { return _wind_speed == NaN ? NaN : _wind_speed * SG_MPS_TO_MPH; }
|
||||
|
||||
inline double getGustSpeed_mps() const { return _gust_speed; }
|
||||
inline double getGustSpeed_kmh() const { return _gust_speed == NaN ? NaN : _gust_speed * SG_MPS_TO_KMH; }
|
||||
inline double getGustSpeed_kt() const { return _gust_speed == NaN ? NaN : _gust_speed * SG_MPS_TO_KT; }
|
||||
inline double getGustSpeed_mph() const { return _gust_speed == NaN ? NaN : _gust_speed * SG_MPS_TO_MPH; }
|
||||
|
||||
inline int getWindRangeFrom() const { return _wind_range_from; }
|
||||
inline int getWindRangeTo() const { return _wind_range_to; }
|
||||
|
||||
inline SGMetarVisibility& getMinVisibility() { return _min_visibility; }
|
||||
inline SGMetarVisibility& getMaxVisibility() { return _max_visibility; }
|
||||
inline SGMetarVisibility& getVertVisibility() { return _vert_visibility; }
|
||||
inline SGMetarVisibility *getDirVisibility() { return _dir_visibility; }
|
||||
|
||||
inline double getTemperature_C() const { return _temp; }
|
||||
inline double getTemperature_F() const { return _temp == NaN ? NaN : 1.8 * _temp + 32; }
|
||||
inline double getDewpoint_C() const { return _dewp; }
|
||||
inline double getDewpoint_F() const { return _dewp == NaN ? NaN : 1.8 * _dewp + 32; }
|
||||
inline double getPressure_hPa() const { return _pressure == NaN ? NaN : _pressure / 100; }
|
||||
inline double getPressure_inHg() const { return _pressure == NaN ? NaN : _pressure * SG_PA_TO_INHG; }
|
||||
|
||||
double getRelHumidity() const;
|
||||
|
||||
inline vector<SGMetarCloud>& getClouds() { return _clouds; }
|
||||
inline map<string, SGMetarRunway>& getRunways() { return _runways; }
|
||||
inline vector<string>& getWeather() { return _weather; }
|
||||
|
||||
protected:
|
||||
string _url;
|
||||
int _grpcount;
|
||||
char *_data;
|
||||
char *_m;
|
||||
char _icao[5];
|
||||
int _year;
|
||||
int _month;
|
||||
int _day;
|
||||
int _hour;
|
||||
int _minute;
|
||||
int _report_type;
|
||||
int _wind_dir;
|
||||
double _wind_speed;
|
||||
double _gust_speed;
|
||||
int _wind_range_from;
|
||||
int _wind_range_to;
|
||||
double _temp;
|
||||
double _dewp;
|
||||
double _pressure;
|
||||
|
||||
SGMetarVisibility _min_visibility;
|
||||
SGMetarVisibility _max_visibility;
|
||||
SGMetarVisibility _vert_visibility;
|
||||
SGMetarVisibility _dir_visibility[8];
|
||||
vector<SGMetarCloud> _clouds;
|
||||
map<string, SGMetarRunway> _runways;
|
||||
vector<string> _weather;
|
||||
|
||||
bool scanPreambleDate();
|
||||
bool scanPreambleTime();
|
||||
|
||||
bool scanType();
|
||||
bool scanId();
|
||||
bool scanDate();
|
||||
bool scanModifier();
|
||||
bool scanWind();
|
||||
bool scanVariability();
|
||||
bool scanVisibility();
|
||||
bool scanRwyVisRange();
|
||||
bool scanSkyCondition();
|
||||
bool scanWeather();
|
||||
bool scanTemperature();
|
||||
bool scanPressure();
|
||||
bool scanRunwayReport();
|
||||
bool scanWindShear();
|
||||
bool scanTrendForecast();
|
||||
bool scanColorState();
|
||||
bool scanRemark();
|
||||
bool scanRemainder();
|
||||
|
||||
int scanNumber(char **str, int *num, int min, int max = 0);
|
||||
bool scanBoundary(char **str);
|
||||
const struct Token *scanToken(char **str, const struct Token *list);
|
||||
char *loadData(const char *id, const string& proxy, const string& port, const string &auth);
|
||||
void normalizeData();
|
||||
};
|
||||
|
||||
#undef NaN
|
||||
#endif // _METAR_HXX
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started March 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// All the core code underneath this is written by Durk Talsma. See
|
||||
// the headers of all the other individual files for details.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
@@ -48,7 +48,7 @@
|
||||
/** Ephemeris class
|
||||
*
|
||||
* Written by Durk Talsma <d.talsma@direct.a2000.nl> and Curtis Olson
|
||||
* <curt@flightgear.org>
|
||||
* <http://www.flightgear.org/~curt>
|
||||
*
|
||||
* Introduction
|
||||
*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started March 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started March 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -49,9 +49,9 @@ tcp_client_LDADD = \
|
||||
socktest_SOURCES = socktest.cxx
|
||||
|
||||
socktest_LDADD = \
|
||||
$(top_builddir)/simgear/bucket/libsgbucket.a \
|
||||
$(top_builddir)/simgear/io/libsgio.a \
|
||||
$(top_builddir)/simgear/debug/libsgdebug.a \
|
||||
$(top_builddir)/simgear/bucket/libsgbucket.a \
|
||||
$(top_builddir)/simgear/misc/libsgmisc.a \
|
||||
-lplibnet -lplibul -lz \
|
||||
$(network_LIBS) \
|
||||
@@ -60,13 +60,17 @@ socktest_LDADD = \
|
||||
lowtest_SOURCES = lowtest.cxx
|
||||
|
||||
lowtest_LDADD = \
|
||||
$(top_builddir)/simgear/io/libsgio.a
|
||||
$(top_builddir)/simgear/io/libsgio.a \
|
||||
$(top_builddir)/simgear/debug/libsgdebug.a \
|
||||
$(top_builddir)/simgear/bucket/libsgbucket.a \
|
||||
$(top_builddir)/simgear/misc/libsgmisc.a \
|
||||
$(base_LIBS) -lz
|
||||
|
||||
decode_binobj_SOURCES = decode_binobj.cxx
|
||||
|
||||
decode_binobj_LDADD = \
|
||||
$(top_builddir)/simgear/io/libsgio.a \
|
||||
$(top_builddir)/simgear/debug/libsgdebug.a \
|
||||
$(top_builddir)/simgear/bucket/libsgbucket.a \
|
||||
$(top_builddir)/simgear/misc/libsgmisc.a \
|
||||
$(top_builddir)/simgear/debug/libsgdebug.a \
|
||||
$(base_LIBS) -lz
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Shamelessly adapted from plib (plib.sourceforge.net) January 2001
|
||||
//
|
||||
// Original version Copyright (C) 2000 the plib team
|
||||
// Local changes Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Local changes Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Shamelessly adapted from plib January 2001
|
||||
//
|
||||
// Original version Copyright (C) 2000 the plib team
|
||||
// Local changes Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Local changes Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started January 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
|
||||
// calculate the center of a list of points, by taking the halfway
|
||||
// point between the min and max points.
|
||||
static Point3D calc_center( point_list& wgs84_nodes ) {
|
||||
Point3D sgCalcCenter( point_list& wgs84_nodes ) {
|
||||
Point3D p, min, max;
|
||||
|
||||
if ( wgs84_nodes.size() ) {
|
||||
@@ -1145,7 +1145,7 @@ bool SGBinObject::write_ascii( const string& base, const string& name,
|
||||
for ( i = start; i < end; ++i ) {
|
||||
for ( j = 0; j < (int)tris_v[i].size(); ++j ) {
|
||||
group_nodes.push_back( wgs84_nodes[ tris_v[i][j] ] );
|
||||
bs_center = calc_center( group_nodes );
|
||||
bs_center = sgCalcCenter( group_nodes );
|
||||
bs_radius = sgCalcBoundingRadius( bs_center, group_nodes );
|
||||
}
|
||||
}
|
||||
@@ -1196,7 +1196,7 @@ bool SGBinObject::write_ascii( const string& base, const string& name,
|
||||
for ( i = start; i < end; ++i ) {
|
||||
for ( j = 0; j < (int)strips_v[i].size(); ++j ) {
|
||||
group_nodes.push_back( wgs84_nodes[ strips_v[i][j] ] );
|
||||
bs_center = calc_center( group_nodes );
|
||||
bs_center = sgCalcCenter( group_nodes );
|
||||
bs_radius = sgCalcBoundingRadius( bs_center, group_nodes );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started January 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@@ -221,6 +221,16 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \relates SGBinObject
|
||||
* Calculate the center of a list of points, by taking the halfway
|
||||
* point between the min and max points.
|
||||
* @param wgs84_nodes list of points in wgs84 coordinates
|
||||
* @return center point
|
||||
*/
|
||||
Point3D sgCalcCenter( point_list& wgs84_nodes );
|
||||
|
||||
|
||||
/**
|
||||
* \relates SGBinObject
|
||||
* Calculate the bounding sphere of a set of nodes.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
@@ -133,7 +133,7 @@ int SGSerial::write( const char *buf, const int length ) {
|
||||
int result = port.write_port( buf, length );
|
||||
|
||||
if ( result != length ) {
|
||||
SG_LOG( SG_IO, SG_ALERT, "Error writing data: " << device );
|
||||
SG_LOG( SG_IO, SG_WARN, "Error writing data: " << device );
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
// Modified by Bernie Bright <bbright@bigpond.net.au>, May 2002.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include STL_IOSTREAM
|
||||
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
#include "sg_socket.hxx"
|
||||
@@ -42,7 +44,8 @@ SGSocket::SGSocket( const string& host, const string& port_,
|
||||
client(0),
|
||||
is_tcp(false),
|
||||
is_server(false),
|
||||
first_read(false)
|
||||
first_read(false),
|
||||
timeout(0)
|
||||
{
|
||||
if (!init)
|
||||
{
|
||||
@@ -218,7 +221,14 @@ SGSocket::read( char *buf, int length )
|
||||
|
||||
if (result > 0)
|
||||
{
|
||||
result = sock.recv( buf, length );
|
||||
if (is_tcp && is_server)
|
||||
{
|
||||
result = client->recv( buf, length );
|
||||
}
|
||||
else
|
||||
{
|
||||
result = sock.recv( buf, length );
|
||||
}
|
||||
|
||||
if ( result != length )
|
||||
{
|
||||
@@ -250,7 +260,7 @@ SGSocket::readline( char *buf, int length )
|
||||
// read a chunk, keep in the save buffer until we have the
|
||||
// requested amount read
|
||||
|
||||
if (is_tcp)
|
||||
if (is_tcp && is_server)
|
||||
{
|
||||
char *buf_ptr = save_buf + save_len;
|
||||
result = client->recv( buf_ptr, SG_IO_MAX_MSG_SIZE - save_len );
|
||||
@@ -323,7 +333,7 @@ SGSocket::write( const char *buf, const int length )
|
||||
|
||||
if ( s->send( buf, length ) < 0 )
|
||||
{
|
||||
SG_LOG( SG_IO, SG_ALERT, "Error writing to socket: " << port );
|
||||
SG_LOG( SG_IO, SG_WARN, "Error writing to socket: " << port );
|
||||
error_condition = true;
|
||||
}
|
||||
|
||||
@@ -379,7 +389,7 @@ SGSocket::poll()
|
||||
netSocket* writers[1];
|
||||
writers[0] = 0;
|
||||
|
||||
int result = netSocket::select( readers, writers, 0 );
|
||||
int result = netSocket::select( readers, writers, timeout );
|
||||
|
||||
if (result > 0 && is_server && client == 0)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
@@ -64,6 +64,7 @@ private:
|
||||
bool is_tcp;
|
||||
bool is_server;
|
||||
bool first_read;
|
||||
int timeout;
|
||||
|
||||
static bool init;
|
||||
|
||||
@@ -156,6 +157,9 @@ public:
|
||||
*/
|
||||
bool nonblock();
|
||||
|
||||
// set timeout (default: 0)
|
||||
inline void set_timeout(int i) { timeout = i; }
|
||||
|
||||
/** @return the remote host name */
|
||||
inline string get_hostname() const { return hostname; }
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started November 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
@@ -162,7 +162,7 @@ int SGSocketUDP::write( const char *buf, const int length ) {
|
||||
bool error_condition = false;
|
||||
|
||||
if ( sock.send( buf, length, 0 ) < 0 ) {
|
||||
SG_LOG( SG_IO, SG_ALERT, "Error writing to socket: " << port );
|
||||
SG_LOG( SG_IO, SG_WARN, "Error writing to socket: " << port );
|
||||
error_condition = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started November 2001.
|
||||
//
|
||||
// Copyright (C) 2001 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started July 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started July 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
|
||||
@@ -9,9 +9,17 @@
|
||||
* IDSIA, Lugano, Switzerland
|
||||
* http://www.inf.ethz.ch/~schraudo/pubs/exp.pdf
|
||||
*
|
||||
* Base-2 exp, Laurent de Soras
|
||||
* http://www.musicdsp.org/archive.php?classid=5#106
|
||||
*
|
||||
* Fast log() Function, by Laurent de Soras:
|
||||
* http://www.flipcode.com/cgi-bin/msg.cgi?showThread=Tip-Fastlogfunction&forum=totd&id=-1
|
||||
*
|
||||
* Sin, Cos, Tan approximation
|
||||
* http://www.musicdsp.org/showArchiveComment.php?ArchiveID=115
|
||||
*
|
||||
* fast floating point power computation:
|
||||
* http://playstation2-linux.com/download/adam/power.c
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -21,6 +29,7 @@
|
||||
|
||||
|
||||
#include "fastmath.hxx"
|
||||
#define SGD_PI_2 1.57079632679489661923
|
||||
|
||||
/**
|
||||
* This function is on avarage 9 times faster than the system exp() function
|
||||
@@ -41,11 +50,76 @@ double fast_exp(double val) {
|
||||
const double a = 1048576/M_LN2;
|
||||
const double b_c = 1072632447; /* 1072693248 - 60801 */
|
||||
|
||||
_eco.n.i = a*val + b_c;
|
||||
_eco.n.i = (int)(a*val + b_c);
|
||||
|
||||
return _eco.d;
|
||||
}
|
||||
|
||||
/*
|
||||
* Linear approx. between 2 integer values of val. Uses 32-bit integers.
|
||||
* Not very efficient but faster than exp()
|
||||
*/
|
||||
double fast_exp2( const double val )
|
||||
{
|
||||
int e;
|
||||
double ret;
|
||||
|
||||
if (val >= 0) {
|
||||
e = int (val);
|
||||
ret = val - (e - 1);
|
||||
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
((*((int *) &ret)) &= ~(2047 << 20)) += (e + 1023) << 20;
|
||||
#else
|
||||
((*(1 + (int *) &ret)) &= ~(2047 << 20)) += (e + 1023) << 20;
|
||||
#endif
|
||||
} else {
|
||||
e = int (val + 1023);
|
||||
ret = val - (e - 1024);
|
||||
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
((*((int *) &ret)) &= ~(2047 << 20)) += e << 20;
|
||||
#else
|
||||
((*(1 + (int *) &ret)) &= ~(2047 << 20)) += e << 20;
|
||||
#endif
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
float _fast_log2(const float val)
|
||||
{
|
||||
float result, tmp;
|
||||
float mp = 0.346607f;
|
||||
|
||||
result = *(int*)&val;
|
||||
result *= 1.0/(1<<23);
|
||||
result = result - 127;
|
||||
|
||||
tmp = result - floor(result);
|
||||
tmp = (tmp - tmp*tmp) * mp;
|
||||
return tmp + result;
|
||||
}
|
||||
|
||||
float _fast_pow2(const float val)
|
||||
{
|
||||
float result;
|
||||
|
||||
float mp = 0.33971f;
|
||||
float tmp = val - floor(val);
|
||||
tmp = (tmp - tmp*tmp) * mp;
|
||||
|
||||
result = val + 127 - tmp;
|
||||
result *= (1<<23);
|
||||
*(int*)&result = (int)result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* While we're on the subject, someone might have use for these as well?
|
||||
@@ -63,3 +137,155 @@ void fast_BSR(float &x, register unsigned long shiftAmount) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* fastpow(f,n) gives a rather *rough* estimate of a float number f to the
|
||||
* power of an integer number n (y=f^n). It is fast but result can be quite a
|
||||
* bit off, since we directly mess with the floating point exponent.
|
||||
*
|
||||
* Use it only for getting rough estimates of the values and where precision
|
||||
* is not that important.
|
||||
*/
|
||||
float fast_pow(const float f, const int n)
|
||||
{
|
||||
long *lp,l;
|
||||
lp=(long*)(&f);
|
||||
l=*lp;l-=0x3F800000l;l<<=(n-1);l+=0x3F800000l;
|
||||
*lp=l;
|
||||
return f;
|
||||
}
|
||||
|
||||
float fast_root(const float f, const int n)
|
||||
{
|
||||
long *lp,l;
|
||||
lp=(long*)(&f);
|
||||
l=*lp;l-=0x3F800000l;l>>=(n-1);l+=0x3F800000l;
|
||||
*lp=l;
|
||||
return f;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Code for approximation of cos, sin, tan and inv sin, etc.
|
||||
* Surprisingly accurate and very usable.
|
||||
*
|
||||
* Domain:
|
||||
* Sin/Cos [0, pi/2]
|
||||
* Tan [0,pi/4]
|
||||
* InvSin/Cos [0, 1]
|
||||
* InvTan [-1, 1]
|
||||
*/
|
||||
|
||||
float fast_sin(const float val)
|
||||
{
|
||||
float fASqr = val*val;
|
||||
float fResult = -2.39e-08f;
|
||||
fResult *= fASqr;
|
||||
fResult += 2.7526e-06f;
|
||||
fResult *= fASqr;
|
||||
fResult -= 1.98409e-04f;
|
||||
fResult *= fASqr;
|
||||
fResult += 8.3333315e-03f;
|
||||
fResult *= fASqr;
|
||||
fResult -= 1.666666664e-01f;
|
||||
fResult *= fASqr;
|
||||
fResult += 1.0f;
|
||||
fResult *= val;
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
float fast_cos(const float val)
|
||||
{
|
||||
float fASqr = val*val;
|
||||
float fResult = -2.605e-07f;
|
||||
fResult *= fASqr;
|
||||
fResult += 2.47609e-05f;
|
||||
fResult *= fASqr;
|
||||
fResult -= 1.3888397e-03f;
|
||||
fResult *= fASqr;
|
||||
fResult += 4.16666418e-02f;
|
||||
fResult *= fASqr;
|
||||
fResult -= 4.999999963e-01f;
|
||||
fResult *= fASqr;
|
||||
fResult += 1.0f;
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
float fast_tan(const float val)
|
||||
{
|
||||
float fASqr = val*val;
|
||||
float fResult = 9.5168091e-03f;
|
||||
fResult *= fASqr;
|
||||
fResult += 2.900525e-03f;
|
||||
fResult *= fASqr;
|
||||
fResult += 2.45650893e-02f;
|
||||
fResult *= fASqr;
|
||||
fResult += 5.33740603e-02f;
|
||||
fResult *= fASqr;
|
||||
fResult += 1.333923995e-01f;
|
||||
fResult *= fASqr;
|
||||
fResult += 3.333314036e-01f;
|
||||
fResult *= fASqr;
|
||||
fResult += 1.0f;
|
||||
fResult *= val;
|
||||
|
||||
return fResult;
|
||||
|
||||
}
|
||||
|
||||
float fast_asin(float val)
|
||||
{
|
||||
float fRoot = sqrt(1.0f-val);
|
||||
float fResult = -0.0187293f;
|
||||
fResult *= val;
|
||||
fResult += 0.0742610f;
|
||||
fResult *= val;
|
||||
fResult -= 0.2121144f;
|
||||
fResult *= val;
|
||||
fResult += 1.5707288f;
|
||||
fResult = SGD_PI_2 - fRoot*fResult;
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
float fast_acos(float val)
|
||||
{
|
||||
float fRoot = sqrt(1.0f-val);
|
||||
float fResult = -0.0187293f;
|
||||
fResult *= val;
|
||||
fResult += 0.0742610f;
|
||||
fResult *= val;
|
||||
fResult -= 0.2121144f;
|
||||
fResult *= val;
|
||||
fResult += 1.5707288f;
|
||||
fResult *= fRoot;
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
float fast_atan(float val)
|
||||
{
|
||||
float fVSqr = val*val;
|
||||
float fResult = 0.0028662257f;
|
||||
fResult *= fVSqr;
|
||||
fResult -= 0.0161657367f;
|
||||
fResult *= fVSqr;
|
||||
fResult += 0.0429096138f;
|
||||
fResult *= fVSqr;
|
||||
fResult -= 0.0752896400f;
|
||||
fResult *= fVSqr;
|
||||
fResult += 0.1065626393f;
|
||||
fResult *= fVSqr;
|
||||
fResult -= 0.1420889944f;
|
||||
fResult *= fVSqr;
|
||||
fResult += 0.1999355085f;
|
||||
fResult *= fVSqr;
|
||||
fResult -= 0.3333314528f;
|
||||
fResult *= fVSqr;
|
||||
fResult += 1.0f;
|
||||
fResult *= val;
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
@@ -32,24 +32,41 @@
|
||||
|
||||
|
||||
double fast_exp(double val);
|
||||
double fast_exp2(const double val);
|
||||
|
||||
float fast_pow(const float val1, const float val2);
|
||||
float fast_log2(const float cal);
|
||||
float fast_root(const float f, const int n);
|
||||
|
||||
float _fast_pow2(const float cal);
|
||||
float _fast_log2(const float val);
|
||||
|
||||
float fast_sin(const float val);
|
||||
float fast_cos(const float val);
|
||||
float fast_tan(const float val);
|
||||
float fast_asin(const float val);
|
||||
float fast_acos(const float val);
|
||||
float fast_atan(const float val);
|
||||
|
||||
void fast_BSL(float &x, register unsigned long shiftAmount);
|
||||
void fast_BSR(float &x, register unsigned long shiftAmount);
|
||||
|
||||
|
||||
inline float fast_log2 (float val)
|
||||
{
|
||||
int * const exp_ptr = reinterpret_cast <int *> (&val);
|
||||
int x = *exp_ptr;
|
||||
const int log_2 = ((x >> 23) & 255) - 128;
|
||||
x &= ~(255 << 23);
|
||||
x += 127 << 23;
|
||||
*exp_ptr = x;
|
||||
int * const exp_ptr = reinterpret_cast <int *> (&val);
|
||||
int x = *exp_ptr;
|
||||
const int log_2 = ((x >> 23) & 255) - 128;
|
||||
x &= ~(255 << 23);
|
||||
x += 127 << 23;
|
||||
*exp_ptr = x;
|
||||
|
||||
val = ((-1.0f/3) * val + 2) * val - 2.0f/3; // (1)
|
||||
val = ((-1.0f/3) * val + 2) * val - 2.0f/3; // (1)
|
||||
|
||||
return (val + log_2);
|
||||
return (val + log_2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is about 3 times faster than the system log() function
|
||||
* and has an error of about 0.01%
|
||||
@@ -65,5 +82,36 @@ inline float fast_log10 (const float &val)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is about twice as fast as the system pow(x,y) function
|
||||
*/
|
||||
inline float fast_pow(const float val1, const float val2)
|
||||
{
|
||||
return _fast_pow2(val2 * _fast_log2(val1));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Haven't seen this elsewhere, probably because it is too obvious?
|
||||
* Anyway, these functions are intended for 32-bit floating point numbers
|
||||
* only and should work a bit faster than the regular ones.
|
||||
*/
|
||||
inline float fast_abs(float f)
|
||||
{
|
||||
int i=((*(int*)&f)&0x7fffffff);
|
||||
return (*(float*)&i);
|
||||
}
|
||||
|
||||
inline float fast_neg(float f)
|
||||
{
|
||||
int i=((*(int*)&f)^0x80000000);
|
||||
return (*(float*)&i);
|
||||
}
|
||||
|
||||
inline int fast_sgn(float f)
|
||||
{
|
||||
return 1+(((*(int*)&f)>>31)<<1);
|
||||
}
|
||||
|
||||
#endif // !_SG_FMATH_HXX
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started April 1998.
|
||||
//
|
||||
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
|
||||
// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
// Written by Curtis Olson, started April 1998.
|
||||
//
|
||||
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
|
||||
// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started September 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started September 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started September 2000.
|
||||
//
|
||||
// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Adapted from algebra3 by Jean-Francois Doue, started October 1998.
|
||||
*/
|
||||
|
||||
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
|
||||
// Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started June 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started June 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -1,167 +1,212 @@
|
||||
// sg_geodesy.cxx -- routines to convert between geodetic and geocentric
|
||||
// coordinate systems.
|
||||
//
|
||||
// Copied and adapted directly from LaRCsim/ls_geodesy.c
|
||||
//
|
||||
// See below for the complete original LaRCsim comments.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#include <simgear/compiler.h>
|
||||
|
||||
#ifdef SG_HAVE_STD_INCLUDES
|
||||
# include <cmath>
|
||||
# include <cerrno>
|
||||
# include <cstdio>
|
||||
#else
|
||||
# include <math.h>
|
||||
# include <errno.h>
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
#include "point3d.hxx"
|
||||
#include "sg_geodesy.hxx"
|
||||
#include "localconsts.hxx"
|
||||
|
||||
|
||||
SG_USING_STD(cout);
|
||||
|
||||
|
||||
// #define DOMAIN_ERR_DEBUG 1
|
||||
|
||||
|
||||
// sgGeocToGeod(lat_geoc, radius, *lat_geod, *alt, *sea_level_r)
|
||||
// INPUTS:
|
||||
// lat_geoc Geocentric latitude, radians, + = North
|
||||
// radius C.G. radius to earth center (meters)
|
||||
// Notes:
|
||||
//
|
||||
// OUTPUTS:
|
||||
// lat_geod Geodetic latitude, radians, + = North
|
||||
// alt C.G. altitude above mean sea level (meters)
|
||||
// sea_level_r radius from earth center to sea level at
|
||||
// local vertical (surface normal) of C.G. (meters)
|
||||
// The XYZ/cartesian coordinate system in use puts the X axis through
|
||||
// zero lat/lon (off west Africa), the Z axis through the north pole,
|
||||
// and the Y axis through 90 degrees longitude (in the Indian Ocean).
|
||||
//
|
||||
// All latitude and longitude values are in radians. Altitude is in
|
||||
// meters, with zero on the WGS84 ellipsoid.
|
||||
//
|
||||
// The code below makes use of the notion of "squashed" space. This
|
||||
// is a 2D cylindrical coordinate system where the radius from the Z
|
||||
// axis is multiplied by SQUASH; the earth in this space is a perfect
|
||||
// circle with a radius of POLRAD.
|
||||
//
|
||||
// Performance: with full optimization, a transformation from
|
||||
// lat/lon/alt to XYZ and back takes 5263 CPU cycles on my 2.2GHz
|
||||
// Pentium 4. About 83% of this is spent in the iterative sgCartToGeod()
|
||||
// algorithm.
|
||||
|
||||
// These are hard numbers from the WGS84 standard. DON'T MODIFY
|
||||
// unless you want to change the datum.
|
||||
static const double EQURAD = 6378137;
|
||||
static const double iFLATTENING = 298.257223563;
|
||||
|
||||
void sgGeocToGeod( const double& lat_geoc, const double& radius,
|
||||
double *lat_geod, double *alt, double *sea_level_r )
|
||||
// These are derived quantities more useful to the code:
|
||||
#if 0
|
||||
static const double SQUASH = 1 - 1/iFLATTENING;
|
||||
static const double STRETCH = 1/SQUASH;
|
||||
static const double POLRAD = EQURAD * SQUASH;
|
||||
#else
|
||||
// High-precision versions of the above produced with an arbitrary
|
||||
// precision calculator (the compiler might lose a few bits in the FPU
|
||||
// operations). These are specified to 81 bits of mantissa, which is
|
||||
// higher than any FPU known to me:
|
||||
static const double SQUASH = 0.9966471893352525192801545;
|
||||
static const double STRETCH = 1.0033640898209764189003079;
|
||||
static const double POLRAD = 6356752.3142451794975639668;
|
||||
#endif
|
||||
|
||||
// Returns a "local" geodetic latitude: an approximation that will be
|
||||
// correct only at zero altitude.
|
||||
static double localLat(double r, double z)
|
||||
{
|
||||
#ifdef DOMAIN_ERR_DEBUG
|
||||
errno = 0; // start with error zero'd
|
||||
#endif
|
||||
|
||||
double t_lat, x_alpha, mu_alpha, delt_mu, r_alpha, l_point, rho_alpha;
|
||||
double sin_mu_a, denom,delt_lambda, lambda_sl, sin_lambda_sl;
|
||||
|
||||
if( ( (SGD_PI_2 - lat_geoc) < SG_ONE_SECOND ) // near North pole
|
||||
|| ( (SGD_PI_2 + lat_geoc) < SG_ONE_SECOND ) ) // near South pole
|
||||
{
|
||||
*lat_geod = lat_geoc;
|
||||
*sea_level_r = SG_EQUATORIAL_RADIUS_M*E;
|
||||
*alt = radius - *sea_level_r;
|
||||
} else {
|
||||
// cout << " lat_geoc = " << lat_geoc << endl;
|
||||
t_lat = tan(lat_geoc);
|
||||
// cout << " tan(t_lat) = " << t_lat << endl;
|
||||
x_alpha = E*SG_EQUATORIAL_RADIUS_M/sqrt(t_lat*t_lat + E*E);
|
||||
#ifdef DOMAIN_ERR_DEBUG
|
||||
if ( errno ) {
|
||||
perror("fgGeocToGeod()");
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "sqrt(" << t_lat*t_lat + E*E << ")" );
|
||||
}
|
||||
#endif
|
||||
// cout << " x_alpha = " << x_alpha << endl;
|
||||
double tmp = sqrt(SG_EQ_RAD_SQUARE_M - x_alpha * x_alpha);
|
||||
if ( tmp < 0.0 ) { tmp = 0.0; }
|
||||
#ifdef DOMAIN_ERR_DEBUG
|
||||
if ( errno ) {
|
||||
perror("fgGeocToGeod()");
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "sqrt(" << SG_EQ_RAD_SQUARE_M - x_alpha * x_alpha
|
||||
<< ")" );
|
||||
}
|
||||
#endif
|
||||
mu_alpha = atan2(tmp,E*x_alpha);
|
||||
if (lat_geoc < 0) mu_alpha = - mu_alpha;
|
||||
sin_mu_a = sin(mu_alpha);
|
||||
delt_lambda = mu_alpha - lat_geoc;
|
||||
r_alpha = x_alpha/cos(lat_geoc);
|
||||
l_point = radius - r_alpha;
|
||||
*alt = l_point*cos(delt_lambda);
|
||||
|
||||
denom = sqrt(1-EPS*EPS*sin_mu_a*sin_mu_a);
|
||||
#ifdef DOMAIN_ERR_DEBUG
|
||||
if ( errno ) {
|
||||
perror("fgGeocToGeod()");
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "sqrt(" <<
|
||||
1-EPS*EPS*sin_mu_a*sin_mu_a << ")" );
|
||||
}
|
||||
#endif
|
||||
rho_alpha = SG_EQUATORIAL_RADIUS_M*(1-EPS)/
|
||||
(denom*denom*denom);
|
||||
delt_mu = atan2(l_point*sin(delt_lambda),rho_alpha + *alt);
|
||||
*lat_geod = mu_alpha - delt_mu;
|
||||
lambda_sl = atan( E*E * tan(*lat_geod) ); // SL geoc. latitude
|
||||
sin_lambda_sl = sin( lambda_sl );
|
||||
*sea_level_r =
|
||||
sqrt(SG_EQ_RAD_SQUARE_M / (1 + ((1/(E*E))-1)*sin_lambda_sl*sin_lambda_sl));
|
||||
#ifdef DOMAIN_ERR_DEBUG
|
||||
if ( errno ) {
|
||||
perror("fgGeocToGeod()");
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "sqrt(" <<
|
||||
SG_EQ_RAD_SQUARE_M / (1 + ((1/(E*E))-1)*sin_lambda_sl*sin_lambda_sl)
|
||||
<< ")" );
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// Squash to a spherical earth, compute a tangent vector to the
|
||||
// surface circle (in squashed space, the surface is a perfect
|
||||
// sphere) by swapping the components and negating one, stretch to
|
||||
// real coordinates, and take an inverse-tangent/perpedicular
|
||||
// vector to get a local geodetic "up" vector. (Those steps all
|
||||
// cook down to just a few multiplies). Then just turn it into an
|
||||
// angle.
|
||||
double upr = r * SQUASH;
|
||||
double upz = z * STRETCH;
|
||||
return atan2(upz, upr);
|
||||
}
|
||||
|
||||
|
||||
// sgGeodToGeoc( lat_geod, alt, *sl_radius, *lat_geoc )
|
||||
// INPUTS:
|
||||
// lat_geod Geodetic latitude, radians, + = North
|
||||
// alt C.G. altitude above mean sea level (meters)
|
||||
//
|
||||
// OUTPUTS:
|
||||
// sl_radius SEA LEVEL radius to earth center (meters)
|
||||
// (add Altitude to get true distance from earth center.
|
||||
// lat_geoc Geocentric latitude, radians, + = North
|
||||
//
|
||||
|
||||
|
||||
void sgGeodToGeoc( const double& lat_geod, const double& alt, double *sl_radius,
|
||||
double *lat_geoc )
|
||||
// This is the inverse of the algorithm in localLat(). It returns the
|
||||
// (cylindrical) coordinates of a surface latitude expressed as an
|
||||
// "up" unit vector.
|
||||
static void surfRZ(double upr, double upz, double* r, double* z)
|
||||
{
|
||||
double lambda_sl, sin_lambda_sl, cos_lambda_sl, sin_mu, cos_mu, px, py;
|
||||
|
||||
#ifdef DOMAIN_ERR_DEBUG
|
||||
errno = 0;
|
||||
#endif
|
||||
// We are
|
||||
// converting a (2D, cylindrical) "up" vector defined by the
|
||||
// geodetic latitude into unitless R and Z coordinates in
|
||||
// cartesian space.
|
||||
double R = upr * STRETCH;
|
||||
double Z = upz * SQUASH;
|
||||
|
||||
lambda_sl = atan( E*E * tan(lat_geod) ); // sea level geocentric latitude
|
||||
sin_lambda_sl = sin( lambda_sl );
|
||||
cos_lambda_sl = cos( lambda_sl );
|
||||
sin_mu = sin(lat_geod); // Geodetic (map makers') latitude
|
||||
cos_mu = cos(lat_geod);
|
||||
*sl_radius =
|
||||
sqrt(SG_EQ_RAD_SQUARE_M / (1 + ((1/(E*E))-1)*sin_lambda_sl*sin_lambda_sl));
|
||||
#ifdef DOMAIN_ERR_DEBUG
|
||||
if ( errno ) {
|
||||
perror("fgGeodToGeoc()");
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "sqrt(" <<
|
||||
SG_EQ_RAD_SQUARE_M / (1 + ((1/(E*E))-1)*sin_lambda_sl*sin_lambda_sl)
|
||||
<< ")" );
|
||||
}
|
||||
#endif
|
||||
py = *sl_radius*sin_lambda_sl + alt*sin_mu;
|
||||
px = *sl_radius*cos_lambda_sl + alt*cos_mu;
|
||||
*lat_geoc = atan2( py, px );
|
||||
// Now we need to turn R and Z into a surface point. That is,
|
||||
// pick a coefficient C for them such that the point is on the
|
||||
// surface when converted to "squashed" space:
|
||||
// (C*R*SQUASH)^2 + (C*Z)^2 = POLRAD^2
|
||||
// C^2 = POLRAD^2 / ((R*SQUASH)^2 + Z^2)
|
||||
double sr = R * SQUASH;
|
||||
double c = POLRAD / sqrt(sr*sr + Z*Z);
|
||||
R *= c;
|
||||
Z *= c;
|
||||
|
||||
*r = R; *z = Z;
|
||||
}
|
||||
|
||||
// Returns the insersection of the line joining the center of the
|
||||
// earth and the specified cylindrical point with the surface of the
|
||||
// WGS84 ellipsoid. Works by finding a normalization constant (in
|
||||
// squashed space) that places the squashed point on the surface of
|
||||
// the sphere.
|
||||
static double seaLevelRadius(double r, double z)
|
||||
{
|
||||
double sr = r * SQUASH;
|
||||
double norm = POLRAD/sqrt(sr*sr + z*z);
|
||||
r *= norm;
|
||||
z *= norm;
|
||||
return sqrt(r*r + z*z);
|
||||
}
|
||||
|
||||
// Convert a cartexian XYZ coordinate to a geodetic lat/lon/alt. This
|
||||
// is a "recursion relation". In essence, it iterates over the 2D
|
||||
// part of sgGeodToCart refining its approximation at each step. The
|
||||
// MAX_LAT_ERROR threshold is picked carefully to allow us to reach
|
||||
// the full precision of an IEEE double. While this algorithm might
|
||||
// look slow, it's not. It actually converges very fast indeed --
|
||||
// I've never seen it take more than six iterations under normal
|
||||
// conditions. Three or four is more typical. (It gets slower as the
|
||||
// altitude/error gets larger; at 50000m altitude, it starts to need
|
||||
// seven loops.) One caveat is that at *very* large altitudes, it
|
||||
// starts making very poor guesses as to latitude. As altitude
|
||||
// approaches infinity, it should be guessing with geocentric
|
||||
// coordinates, not "local geodetic up" ones.
|
||||
void sgCartToGeod(const double* xyz, double* lat, double* lon, double* alt)
|
||||
{
|
||||
// The error is expressed as a radian angle, and we want accuracy
|
||||
// to 1 part in 2^50 (an IEEE double has between 51 and 52
|
||||
// significant bits of magnitude due to the "hidden" digit; leave
|
||||
// at least one bit free for potential slop). In real units, this
|
||||
// works out to about 6 nanometers.
|
||||
static const double MAX_LAT_ERROR = 8.881784197001252e-16;
|
||||
double x = xyz[0], y = xyz[1], z = xyz[2];
|
||||
|
||||
// Longitude is trivial. Convert to cylindrical "(r, z)"
|
||||
// coordinates while we're at it.
|
||||
*lon = atan2(y, x);
|
||||
double r = sqrt(x*x + y*y);
|
||||
|
||||
double lat1, lat2 = localLat(r, z);
|
||||
double r2, z2, dot;
|
||||
do {
|
||||
lat1 = lat2;
|
||||
|
||||
// Compute an "up" vector
|
||||
double upr = cos(lat1);
|
||||
double upz = sin(lat1);
|
||||
|
||||
// Find the surface point with that latitude
|
||||
surfRZ(upr, upz, &r2, &z2);
|
||||
|
||||
// Convert r2z2 to the vector pointing from the surface to rz
|
||||
r2 = r - r2;
|
||||
z2 = z - z2;
|
||||
|
||||
// Dot it with "up" to get an approximate altitude
|
||||
dot = r2*upr + z2*upz;
|
||||
|
||||
// And compute an approximate geodetic surface coordinate
|
||||
// using that altitude, so now: R2Z2 = RZ - ((RZ - SURF) dot
|
||||
// UP)
|
||||
r2 = r - dot * upr;
|
||||
z2 = z - dot * upz;
|
||||
|
||||
// Find the latitude of *that* point, and iterate
|
||||
lat2 = localLat(r2, z2);
|
||||
} while(fabs(lat2 - lat1) > MAX_LAT_ERROR);
|
||||
|
||||
// All done! We have an accurate geodetic lattitude, now
|
||||
// calculate the altitude as a cartesian distance between the
|
||||
// final geodetic surface point and the initial r/z coordinate.
|
||||
*lat = lat1;
|
||||
double dr = r - r2;
|
||||
double dz = z - z2;
|
||||
double altsign = (dot > 0) ? 1 : -1;
|
||||
*alt = altsign * sqrt(dr*dr + dz*dz);
|
||||
}
|
||||
|
||||
void sgGeodToCart(double lat, double lon, double alt, double* xyz)
|
||||
{
|
||||
// This is the inverse of the algorithm in localLat(). We are
|
||||
// converting a (2D, cylindrical) "up" vector defined by the
|
||||
// geodetic latitude into unitless R and Z coordinates in
|
||||
// cartesian space.
|
||||
double upr = cos(lat);
|
||||
double upz = sin(lat);
|
||||
double r, z;
|
||||
surfRZ(upr, upz, &r, &z);
|
||||
|
||||
// Add the altitude using the "up" unit vector we calculated
|
||||
// initially.
|
||||
r += upr * alt;
|
||||
z += upz * alt;
|
||||
|
||||
// Finally, convert from cylindrical to cartesian
|
||||
xyz[0] = r * cos(lon);
|
||||
xyz[1] = r * sin(lon);
|
||||
xyz[2] = z;
|
||||
}
|
||||
|
||||
void sgGeocToGeod(double lat_geoc, double radius,
|
||||
double *lat_geod, double *alt, double *sea_level_r)
|
||||
{
|
||||
// Build a fake cartesian point, and run it through CartToGeod
|
||||
double lon_dummy, xyz[3];
|
||||
xyz[0] = cos(lat_geoc) * radius;
|
||||
xyz[1] = 0;
|
||||
xyz[2] = sin(lat_geoc) * radius;
|
||||
sgCartToGeod(xyz, lat_geod, &lon_dummy, alt);
|
||||
*sea_level_r = seaLevelRadius(xyz[0], xyz[2]);
|
||||
}
|
||||
|
||||
void sgGeodToGeoc(double lat_geod, double alt,
|
||||
double *sl_radius, double *lat_geoc)
|
||||
{
|
||||
double xyz[3];
|
||||
sgGeodToCart(lat_geod, 0, alt, xyz);
|
||||
*lat_geoc = atan2(xyz[2], xyz[0]);
|
||||
*sl_radius = seaLevelRadius(xyz[0], xyz[2]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Direct and inverse distance functions
|
||||
//
|
||||
// Proceedings of the 7th International Symposium on Geodetic
|
||||
@@ -175,13 +220,11 @@ void sgGeodToGeoc( const double& lat_geod, const double& alt, double *sl_radius,
|
||||
//
|
||||
// modified for FlightGear to use WGS84 only -- Norman Vine
|
||||
|
||||
#define GEOD_INV_PI SGD_PI
|
||||
static const double GEOD_INV_PI = SGD_PI;
|
||||
|
||||
// s == distance
|
||||
// az = azimuth
|
||||
|
||||
// for WGS_84 a = 6378137.000, rf = 298.257223563;
|
||||
|
||||
static inline double M0( double e2 ) {
|
||||
//double e4 = e2*e2;
|
||||
return GEOD_INV_PI*(1.0 - e2*( 1.0/4.0 + e2*( 3.0/64.0 +
|
||||
@@ -191,12 +234,12 @@ static inline double M0( double e2 ) {
|
||||
|
||||
// given, alt, lat1, lon1, az1 and distance (s), calculate lat2, lon2
|
||||
// and az2. Lat, lon, and azimuth are in degrees. distance in meters
|
||||
int geo_direct_wgs_84 ( const double& alt, const double& lat1,
|
||||
const double& lon1, const double& az1,
|
||||
const double& s, double *lat2, double *lon2,
|
||||
int geo_direct_wgs_84 ( double alt, double lat1,
|
||||
double lon1, double az1,
|
||||
double s, double *lat2, double *lon2,
|
||||
double *az2 )
|
||||
{
|
||||
double a = 6378137.000, rf = 298.257223563;
|
||||
double a = EQURAD, rf = iFLATTENING;
|
||||
double RADDEG = (GEOD_INV_PI)/180.0, testv = 1.0E-10;
|
||||
double f = ( rf > 0.0 ? 1.0/rf : 0.0 );
|
||||
double b = a*(1.0-f);
|
||||
@@ -284,12 +327,12 @@ int geo_direct_wgs_84 ( const double& alt, const double& lat1,
|
||||
// given alt, lat1, lon1, lat2, lon2, calculate starting and ending
|
||||
// az1, az2 and distance (s). Lat, lon, and azimuth are in degrees.
|
||||
// distance in meters
|
||||
int geo_inverse_wgs_84( const double& alt, const double& lat1,
|
||||
const double& lon1, const double& lat2,
|
||||
const double& lon2, double *az1, double *az2,
|
||||
int geo_inverse_wgs_84( double alt, double lat1,
|
||||
double lon1, double lat2,
|
||||
double lon2, double *az1, double *az2,
|
||||
double *s )
|
||||
{
|
||||
double a = 6378137.000, rf = 298.257223563;
|
||||
double a = EQURAD, rf = iFLATTENING;
|
||||
int iter=0;
|
||||
double RADDEG = (GEOD_INV_PI)/180.0, testv = 1.0E-10;
|
||||
double f = ( rf > 0.0 ? 1.0/rf : 0.0 );
|
||||
@@ -399,92 +442,3 @@ int geo_inverse_wgs_84( const double& alt, const double& lat1,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
TITLE: ls_geodesy
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
FUNCTION: Converts geocentric coordinates to geodetic positions
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MODULE STATUS: developmental
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
GENEALOGY: Written as part of LaRCSim project by E. B. Jackson
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
DESIGNED BY: E. B. Jackson
|
||||
|
||||
CODED BY: E. B. Jackson
|
||||
|
||||
MAINTAINED BY: E. B. Jackson
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MODIFICATION HISTORY:
|
||||
|
||||
DATE PURPOSE BY
|
||||
|
||||
930208 Modified to avoid singularity near polar region. EBJ
|
||||
930602 Moved backwards calcs here from ls_step. EBJ
|
||||
931214 Changed erroneous Latitude and Altitude variables to
|
||||
*lat_geod and *alt in routine ls_geoc_to_geod. EBJ
|
||||
940111 Changed header files from old ls_eom.h style to ls_types,
|
||||
and ls_constants. Also replaced old DATA type with new
|
||||
SCALAR type. EBJ
|
||||
|
||||
CURRENT RCS HEADER:
|
||||
|
||||
$Header$
|
||||
* Revision 1.5 1994/01/11 18:47:05 bjax
|
||||
* Changed include files to use types and constants, not ls_eom.h
|
||||
* Also changed DATA type to SCALAR type.
|
||||
*
|
||||
* Revision 1.4 1993/12/14 21:06:47 bjax
|
||||
* Removed global variable references Altitude and Latitude. EBJ
|
||||
*
|
||||
* Revision 1.3 1993/06/02 15:03:40 bjax
|
||||
* Made new subroutine for calculating geodetic to geocentric; changed name
|
||||
* of forward conversion routine from ls_geodesy to ls_geoc_to_geod.
|
||||
*
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
REFERENCES:
|
||||
|
||||
[ 1] Stevens, Brian L.; and Lewis, Frank L.: "Aircraft
|
||||
Control and Simulation", Wiley and Sons, 1992.
|
||||
ISBN 0-471-61397-5
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
CALLED BY: ls_aux
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
CALLS TO:
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
INPUTS:
|
||||
lat_geoc Geocentric latitude, radians, + = North
|
||||
radius C.G. radius to earth center, ft
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
OUTPUTS:
|
||||
lat_geod Geodetic latitude, radians, + = North
|
||||
alt C.G. altitude above mean sea level, ft
|
||||
sea_level_r radius from earth center to sea level at
|
||||
local vertical (surface normal) of C.G.
|
||||
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +1,7 @@
|
||||
/**
|
||||
* \file sg_geodesy.hxx
|
||||
* Routines to convert between geodetic and geocentric coordinate systems.
|
||||
* Copied and adapted directly from LaRCsim/ls_geodesy.c
|
||||
*/
|
||||
|
||||
// See below for the complete original LaRCsim comments.
|
||||
//
|
||||
// $Id$
|
||||
|
||||
|
||||
#ifndef _SG_GEODESY_HXX
|
||||
#define _SG_GEODESY_HXX
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
|
||||
#include <simgear/math/point3d.hxx>
|
||||
#include <simgear/math/polar3d.hxx>
|
||||
|
||||
|
||||
/**
|
||||
* Convert from geocentric coordinates to geodetic coordinates
|
||||
@@ -31,45 +12,78 @@
|
||||
* @param sea_level_r (out) radius from earth center to sea level at
|
||||
* local vertical (surface normal) of C.G. (meters)
|
||||
*/
|
||||
void sgGeocToGeod( const double& lat_geoc, const double& radius,
|
||||
double *lat_geod, double *alt, double *sea_level_r );
|
||||
void sgGeocToGeod(double lat_geoc, double radius,
|
||||
double *lat_geod, double *alt, double *sea_level_r);
|
||||
|
||||
|
||||
/**
|
||||
* Convert from geodetic coordinates to geocentric coordinates
|
||||
* Convert from geodetic coordinates to geocentric coordinates.
|
||||
* WARNING: this function is non-reversible. Due to the fact that
|
||||
* "up" is a different direction for geocentric and geodetic frames,
|
||||
* you can not simply add your "alt" parameter to the "sl_radius"
|
||||
* result and get back (via sgGeodToGeoc()) to the coordinates you
|
||||
* started with. The error under normal conditions will be of
|
||||
* centimeter order; whether that is important or not is application
|
||||
* dependent. Consider using sgGeodToCart() instead.
|
||||
*
|
||||
* @param lat_geod (in) Geodetic latitude, radians, + = North
|
||||
* @param alt (in) C.G. altitude above mean sea level (meters)
|
||||
* @param sl_radius (out) SEA LEVEL radius to earth center (meters)
|
||||
* (add Altitude to get true distance from earth center.
|
||||
* @param lat_geoc (out) Geocentric latitude, radians, + = North
|
||||
*/
|
||||
void sgGeodToGeoc( const double& lat_geod, const double& alt,
|
||||
double *sl_radius, double *lat_geoc );
|
||||
void sgGeodToGeoc(double lat_geod, double alt,
|
||||
double *sl_radius, double *lat_geoc );
|
||||
|
||||
/**
|
||||
* Convert a cartesian point to a geodetic lat/lon/altitude.
|
||||
*
|
||||
* @param xyz (in) Pointer to cartesian point.
|
||||
* @param lat (out) Latitude, in radians
|
||||
* @param lon (out) Longitude, in radians
|
||||
* @param alt (out) Altitude, in meters above the WGS84 ellipsoid
|
||||
*/
|
||||
void sgCartToGeod(const double* xyz, double* lat, double* lon, double* alt);
|
||||
|
||||
/**
|
||||
* Convert a cartesian point to a geodetic lat/lon/altitude.
|
||||
* Alternate form using Point3D objects.
|
||||
*
|
||||
* @param cartesian point
|
||||
* @return geodetic point
|
||||
*/
|
||||
inline Point3D sgCartToGeod(const Point3D& p)
|
||||
{
|
||||
double lat, lon, alt, xyz[3];
|
||||
xyz[0] = p.x(); xyz[1] = p.y(); xyz[2] = p.z();
|
||||
sgCartToGeod(xyz, &lat, &lon, &alt);
|
||||
return Point3D(lon, lat, alt);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a geodetic point lon(radians), lat(radians), elev(meter) to
|
||||
* a cartesian point.
|
||||
* Convert a geodetic lat/lon/altitude to a cartesian point.
|
||||
*
|
||||
* @param lat (in) Latitude, in radians
|
||||
* @param lon (in) Longitude, in radians
|
||||
* @param alt (in) Altitude, in meters above the WGS84 ellipsoid
|
||||
* @param xyz (out) Pointer to cartesian point.
|
||||
*/
|
||||
void sgGeodToCart(double lat, double lon, double alt, double* xyz);
|
||||
|
||||
/**
|
||||
* Convert a geodetic lat/lon/altitude to a cartesian point.
|
||||
* Alternate form using Point3D objects.
|
||||
*
|
||||
* @param geodetic point
|
||||
* @return cartesian point
|
||||
*/
|
||||
inline Point3D sgGeodToCart(const Point3D& geod) {
|
||||
double gc_lon, gc_lat, sl_radius;
|
||||
|
||||
// printf("A geodetic point is (%.2f, %.2f, %.2f)\n",
|
||||
// geod[0], geod[1], geod[2]);
|
||||
|
||||
gc_lon = geod.lon();
|
||||
sgGeodToGeoc(geod.lat(), geod.radius(), &sl_radius, &gc_lat);
|
||||
|
||||
// printf("A geocentric point is (%.2f, %.2f, %.2f)\n", gc_lon,
|
||||
// gc_lat, sl_radius+geod[2]);
|
||||
|
||||
Point3D pp = Point3D( gc_lon, gc_lat, sl_radius + geod.radius());
|
||||
return sgPolarToCart3d(pp);
|
||||
inline Point3D sgGeodToCart(const Point3D& geod)
|
||||
{
|
||||
double xyz[3];
|
||||
sgGeodToCart(geod.lat(), geod.lon(), geod.elev(), xyz);
|
||||
return Point3D(xyz[0], xyz[1], xyz[2]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Given a starting position and an offset radial and distance,
|
||||
* calculate an ending positon on a wgs84 ellipsoid.
|
||||
@@ -82,9 +96,9 @@ inline Point3D sgGeodToCart(const Point3D& geod) {
|
||||
* @param lon2 (out) degrees
|
||||
* @param az2 (out) return course in degrees
|
||||
*/
|
||||
int geo_direct_wgs_84 ( const double& alt, const double& lat1,
|
||||
const double& lon1, const double& az1,
|
||||
const double& s, double *lat2, double *lon2,
|
||||
int geo_direct_wgs_84 ( double alt, double lat1,
|
||||
double lon1, double az1,
|
||||
double s, double *lat2, double *lon2,
|
||||
double *az2 );
|
||||
|
||||
|
||||
@@ -100,98 +114,9 @@ int geo_direct_wgs_84 ( const double& alt, const double& lat1,
|
||||
* @param az2 (out) end heading degrees
|
||||
* @param s (out) distance meters
|
||||
*/
|
||||
int geo_inverse_wgs_84( const double& alt, const double& lat1,
|
||||
const double& lon1, const double& lat2,
|
||||
const double& lon2, double *az1, double *az2,
|
||||
int geo_inverse_wgs_84( double alt, double lat1,
|
||||
double lon1, double lat2,
|
||||
double lon2, double *az1, double *az2,
|
||||
double *s );
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
TITLE: ls_geodesy
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
FUNCTION: Converts geocentric coordinates to geodetic positions
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MODULE STATUS: developmental
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
GENEALOGY: Written as part of LaRCSim project by E. B. Jackson
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
DESIGNED BY: E. B. Jackson
|
||||
|
||||
CODED BY: E. B. Jackson
|
||||
|
||||
MAINTAINED BY: E. B. Jackson
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
MODIFICATION HISTORY:
|
||||
|
||||
DATE PURPOSE BY
|
||||
|
||||
930208 Modified to avoid singularity near polar region. EBJ
|
||||
930602 Moved backwards calcs here from ls_step. EBJ
|
||||
931214 Changed erroneous Latitude and Altitude variables to
|
||||
*lat_geod and *alt in routine ls_geoc_to_geod. EBJ
|
||||
940111 Changed header files from old ls_eom.h style to ls_types,
|
||||
and ls_constants. Also replaced old DATA type with new
|
||||
SCALAR type. EBJ
|
||||
|
||||
CURRENT RCS HEADER:
|
||||
|
||||
$Header$
|
||||
|
||||
* Revision 1.5 1994/01/11 18:47:05 bjax
|
||||
* Changed include files to use types and constants, not ls_eom.h
|
||||
* Also changed DATA type to SCALAR type.
|
||||
*
|
||||
* Revision 1.4 1993/12/14 21:06:47 bjax
|
||||
* Removed global variable references Altitude and Latitude. EBJ
|
||||
*
|
||||
* Revision 1.3 1993/06/02 15:03:40 bjax
|
||||
* Made new subroutine for calculating geodetic to geocentric; changed name
|
||||
* of forward conversion routine from ls_geodesy to ls_geoc_to_geod.
|
||||
*
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
REFERENCES:
|
||||
|
||||
[ 1] Stevens, Brian L.; and Lewis, Frank L.: "Aircraft
|
||||
Control and Simulation", Wiley and Sons, 1992.
|
||||
ISBN 0-471-61397-5
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
CALLED BY: ls_aux
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
CALLS TO:
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
INPUTS:
|
||||
lat_geoc Geocentric latitude, radians, + = North
|
||||
radius C.G. radius to earth center, ft
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
OUTPUTS:
|
||||
lat_geod Geodetic latitude, radians, + = North
|
||||
alt C.G. altitude above mean sea level, ft
|
||||
sea_level_r radius from earth center to sea level at
|
||||
local vertical (surface normal) of C.G.
|
||||
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#endif // _SG_GEODESY_HXX
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started July 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started July 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started March 1999.
|
||||
//
|
||||
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||
// Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Written by Curtis Olson, started December 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// Written by Curtis Olson, started December 1997.
|
||||
//
|
||||
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
||||
// Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: antoi */
|
||||
/* Date: Jan 28, 1991 */
|
||||
/* Organization: W/OSO242 - Graphics and Display Section */
|
||||
/* Programmer: Allan Darling */
|
||||
/* Language: C/370 */
|
||||
/* */
|
||||
/* Abstract: This function will convert a character array */
|
||||
/* (string) of length (len) into an integer. */
|
||||
/* The integer is created via a call to the */
|
||||
/* function atoi. This function extends the */
|
||||
/* functionality of atoi by removing the */
|
||||
/* requirement for a sentinal delimited string */
|
||||
/* as input. */
|
||||
/* */
|
||||
/* Input: - Pointer to an array of characters. */
|
||||
/* - Integer indicating the number of character to include */
|
||||
/* in the conversion. */
|
||||
/* */
|
||||
/* Output:- An integer corresponding to the value in the character */
|
||||
/* array or INT32_MIN (-2147483647-1) if the function is */
|
||||
/* unable to acquire system storage. */
|
||||
/* */
|
||||
/* Modification History: */
|
||||
/* None */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifndef INT32_MIN
|
||||
# define INT32_MIN (-2147483647-1)
|
||||
#endif
|
||||
|
||||
int antoi(char * string, int len)
|
||||
{
|
||||
|
||||
/*******************/
|
||||
/* local variables */
|
||||
/*******************/
|
||||
|
||||
char * tmpstr;
|
||||
int i,
|
||||
retval;
|
||||
|
||||
|
||||
/*****************/
|
||||
/* function body */
|
||||
/*****************/
|
||||
|
||||
tmpstr = (char *)malloc((len+1) * sizeof(char));
|
||||
|
||||
if (tmpstr == NULL) return INT32_MIN;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
tmpstr[i] = string[i];
|
||||
|
||||
tmpstr[len] = '\0';
|
||||
|
||||
retval = atoi(tmpstr);
|
||||
|
||||
free(tmpstr);
|
||||
|
||||
return(retval);
|
||||
|
||||
} /* end antoi */
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
#include "Local.h" /* standard header file */
|
||||
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: charcmp */
|
||||
/* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
|
||||
/* Date: 12 Dec 1995 */
|
||||
/* Programmer: CINDY L. CHONG */
|
||||
/* Language: C/370 */
|
||||
/* */
|
||||
/* Abstract: This function will compare each character in the */
|
||||
/* string match with each character in the pattern */
|
||||
/* which is made up of characters. The str can */
|
||||
/* be longer than the pattern. */
|
||||
/* */
|
||||
/* External Functions Called: */
|
||||
/* None. */
|
||||
/* */
|
||||
/* Input: str is a pointer to char */
|
||||
/* pattern is a pointer to char */
|
||||
/* */
|
||||
/* Output: Return true if str matches pattern, */
|
||||
/* otherwise, return false */
|
||||
/* */
|
||||
/* Modification History: */
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
|
||||
bool charcmp(char *str, char *pattern)
|
||||
{
|
||||
|
||||
|
||||
/**********************************************************/
|
||||
/* Loop while str and pattern is not equal to null, then */
|
||||
/* inscreases str and pattern by one */
|
||||
/**********************************************************/
|
||||
|
||||
for (; *pattern != '\0'; pattern++)
|
||||
{
|
||||
if (*str == '\0')
|
||||
return FALSE;
|
||||
|
||||
/************************************************************/
|
||||
/* If pattern match str, then increase str and jump out the */
|
||||
/* case and read next char of the str and pattern */
|
||||
/************************************************************/
|
||||
|
||||
if ( isspace(*pattern) )
|
||||
pattern = nxtalpha(pattern);
|
||||
|
||||
switch( *pattern )
|
||||
{
|
||||
case 'c':
|
||||
if ( !isalnum(*str++) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
if ( !isalpha(*str) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
str++;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
if ( !iscntrl(*str++) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
if ( !isdigit(*str) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
str++;
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
if ( !isgraph(*str++) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
if ( !islower(*str++) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
if ( !isprint(*str++) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 't':
|
||||
if ( !ispunct(*str++) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
if ( !isspace(*str++) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
if ( !isupper(*str++) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
if (*str++ != ' ')
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
if ( !isspace(*str) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
while ( isspace(*str) )
|
||||
str++;
|
||||
}
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
pattern++;
|
||||
if (*pattern != *str)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
pattern++;
|
||||
str++;
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
} /* end switch */
|
||||
|
||||
} /* end for */
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,539 +0,0 @@
|
||||
#include "Metar.h"
|
||||
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: dRVMETAR */
|
||||
/* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
|
||||
/* Date: 28 Oct 1994 */
|
||||
/* Programmer: CARL MCCALLA */
|
||||
/* Language: C/370 */
|
||||
/* */
|
||||
/* Abstract: DRVMETAR is a main routine that acts a driver */
|
||||
/* for testing the METAR Decoder function. */
|
||||
/* */
|
||||
/* External Functions Called: */
|
||||
/* None. */
|
||||
/* DcdMETAR */
|
||||
/* prtDcdMetar */
|
||||
/* Sec0MTSm */
|
||||
/* Sec1MTSm */
|
||||
/* */
|
||||
/* Input: None */
|
||||
/* */
|
||||
/* Output: None */
|
||||
/* */
|
||||
/* Modification History: */
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
int main()
|
||||
{
|
||||
static char *string[] =
|
||||
{
|
||||
"KAST 221156Z COR 09005KT 7SM -RA OVC026 09/08 A2996 RMK "
|
||||
"AO2 TNO SLP143 P0007 60047 70109 T00890084 10100 20089 55005",
|
||||
|
||||
"KAST COR 221156Z 09005KT 7SM -RA OVC026 09/08 A2996 RMK "
|
||||
"AO2 TNO SLP143 P0007 60047 70109 T00890084 10100 20089 55005",
|
||||
|
||||
"KAST COR 221156Z 09005KT 1/SM -RA OVC026 09/08 A2996 RMK "
|
||||
"AO2 TNO SLP143 P0007 60047 70109 T00890084 10100 20089 55005",
|
||||
|
||||
"KP88 COR 221156 09005KT 1/SM -RA OVC026 09/08 A2996 RMK "
|
||||
"AO2 TNO SLP143 P0007 60047 70109 T00890084 10100 20089 55005",
|
||||
|
||||
"KP88 COR 221156 09005KT 1/SM -RA OVC026 09/08 A2996 RMK "
|
||||
"AO2 TNO SLP143 P0007 6//// 70109 T00890084 10100 20089 55005",
|
||||
|
||||
NULL,
|
||||
|
||||
|
||||
"EPIT 1755 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1/2V3/4",
|
||||
|
||||
"KFAR 181154Z 10003KT 1/4SM HZ CLR 16/13 A2988 RMK AO2 "
|
||||
"SLP117 56012 10345 20226 T01610133 $",
|
||||
|
||||
"KFAR 181154Z 10003KT 1/SM HZ CLR 16/13 A2988 RMK AO2 "
|
||||
"SLP117 56012 10345 20226 T01610133 $",
|
||||
|
||||
|
||||
|
||||
|
||||
"RKSS 21009KT 1400 RP2000 // ////// 21/20 1006/2972 NOSIG",
|
||||
|
||||
"RKSS 1200 21009KT 1400 RP2000 // ////// 21/20 1006/2972 NOSIG",
|
||||
|
||||
"RKSS 1130Z 23011KT 1100 R14R/P1500N R14L/P1500N BR SCT010 BKN030 "
|
||||
"BKN080 21/21 Q1006 NOSIG",
|
||||
|
||||
"RKSS 1130Z 23011KT 1100 R14R/P1500 R14L/P1500 BR SCT010 BKN030 "
|
||||
"BKN080 21/21 Q1006 NOSIG",
|
||||
|
||||
NULL,
|
||||
"KFAR 181154Z 10003KT 4SM HZ CLR 16/13 A2988 RMK AO2 "
|
||||
"SLP117 56012 1//// 2//// T01610133 $",
|
||||
|
||||
"CYYE 061300Z 3500KT 15SM BKN005 OVC040 08/08 A3004 RMK "
|
||||
"SF6SC1 VSBY RDCE DUE LO CLD SLP186",
|
||||
|
||||
"CYYE 061300Z 3500KT 15SM BKN005 OVC040 08/08 A3004 RMK "
|
||||
"SF6SC1 VSBY RDCE DUE10 LO CLD SLP186",
|
||||
|
||||
"CYYE 061300Z 3500KT 15SM BKN005 OVC040 08/08 A3004 RMK "
|
||||
"SF6SC1 VSBY RDCE DUE9 LO CLD SLP186",
|
||||
|
||||
"CYYE 061300Z 3500KT 15SM BKN005 OVC040 08/08 A3004 RMK "
|
||||
"SF6SC1 VSBY RDCE FZDZE10 LO CLD SLP186",
|
||||
|
||||
"CYYE 061300Z 3500KT 15SM BKN005 OVC040 08/08 A3004 RMK "
|
||||
"SF6SC1 VSBY RDCE FZDZE9 LO CLD SLP186",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"MKJP 1400Z 13011KT 9999 FEW022 30/XX Q1015",
|
||||
"MKJP 1400Z 13011KT 9999 FEW022 M30/XX Q1015",
|
||||
"MKJP 1400Z 13011KT 9999 FEW022 MM/XX Q1015",
|
||||
"MKJP 1400Z 13011KT 9999 FEW022 MM/30 Q1015",
|
||||
"MKJP 1400Z 13011KT 9999 FEW022 MM/M30 Q1015",
|
||||
|
||||
|
||||
|
||||
|
||||
"EGPD 36016G26KT 320V030 9999 FEW015TCU SCT026 BKN045 OVC090 "
|
||||
"SCT120 FEW250 RMK OCNL LTGICCG OHD",
|
||||
|
||||
"EGPD 36016G26KT 320V030 9999 FEW015TCU SCT026 07/01 Q1011 "
|
||||
"RMK TEMPO 8000 -SHRA BKN015 FRQ LTG VC",
|
||||
|
||||
"EGPD 36016G26KT 320V030 9999 FEW015TCU SCT026 07/01 Q1011 "
|
||||
"RMK TEMPO 8000 -SHRA BKN015 LTG DSNT W",
|
||||
|
||||
|
||||
"METAR KLAX 281156Z AUTO VRB100G135KT 130V210 3 1/2SM "
|
||||
"R15L/0500FT R22L/2700FT R16/1200FT R34/1000V1600FT R01L/P6000FT FC "
|
||||
"+TS BLPY FEW/// SCT000 BKN050 SCT150 OVC250 3/M1 A2991 RMK "
|
||||
"TORNADO B13E45 6 NE MOV E A02 PK WND 18515/45 "
|
||||
"WSHFT 1350 FROPA TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 "
|
||||
"VIS 2 1/2 RY11 "
|
||||
"DVR/1000V1600FT "
|
||||
"OCNL LTG VCY STN "
|
||||
"RAB1030E1145 FZDZE56 BLPYE57 CIG 1000V1500 CIG 020 RY11 "
|
||||
"PRESFR PRESRR SLP013 FG FEW/// HZ SCT000 VIS NW 2 1/2 GR 3/4 "
|
||||
"VIRGA SE -XRAFG3 CIGE005 BKN014 V OVC "
|
||||
"FU BKN020 NOSPECI LAST 8/365 SNINCR 2/10 4/178 "
|
||||
"933125 98096 P 0125 60225 70565 "
|
||||
"T00261015 10369 21026 "
|
||||
"404800360 52101 VISNO RY05 CHINO RY27 PNO RVRNO "
|
||||
"PWINO FZRANO TSNO $",
|
||||
|
||||
|
||||
"KBOS 251356Z 26011KT 10SM CLR 12/02 A2995 RMK AO2 SC VCNTY "
|
||||
"STN SSE-NNW SCT CI ABV SLP141 T01220023",
|
||||
|
||||
"EFHK 36009KT 340V060 CAVOK 12/M02 Q1013 NOSIG",
|
||||
"EGKK 24011KT 210V300 9999 SCT020 BKN045 12/06 Q1007 NOSIG",
|
||||
"EGPD 31018KT 8000 RA FEW013 BKN021 OVC045 06/04 Q0994 NOSIG",
|
||||
"EKCH 16012KT CAVOK 20/07 Q1006 NOSIG",
|
||||
"ESKN 10014KT 9000 BR SCT100 14/04 Q1010",
|
||||
"LOWW 231450Z 14017KT CAVOK 23/07 Q1010 NOSIG",
|
||||
|
||||
|
||||
"METAR CYCH 171500Z CCA 30017KT 2SM -SN BKN006",
|
||||
|
||||
"METAR CYOW 171500Z CCA 30017KT 2SM -SN BKN006 OVC020 00/M02 "
|
||||
"A2957 RMK S35F4NS1 /S01/ SNW WET SNW MELTG ON GRND CIG 5-7 "
|
||||
"SLP018",
|
||||
|
||||
"KAST 221156Z AUTO 09005KT 7SM -RA OVC026 09/08 A2996 RMK "
|
||||
"AO2 TNO SLP143 P0007 60047 70109 T00890084 10100 20089 55005"
|
||||
" TSB0159E30 TS SE MOV NE",
|
||||
|
||||
"KAST 221156Z AUTO 09005KT 7SM -RA OVC026 09/08 A2996 RMK "
|
||||
"AO2 TNO SLP143 P0007 60047 70109 T00890084 10100 20089 55005"
|
||||
" TSE0159 TS SE",
|
||||
|
||||
"KHVR 1756Z 31007KT 5SM -SN SCT011 BKN024 OVC030 M05/M08 A3056 "
|
||||
"RMK AOA 933004 "
|
||||
"BKN V SCT TNO PCPN 000 $ SLP389 4/015 60002 "
|
||||
"T10501077 11050 21078 51010",
|
||||
|
||||
"SPECI KGFI 041420Z AUTO 18030KT 3 1/2SM RVRNO TS -RA BKN008 OVC060 "
|
||||
"26/22 A2991 RMK A02 RA15TSB20 PRESFR SLP 101 P 0000 T02640218",
|
||||
|
||||
"METAR KCLE 281156Z 170100G135KT 110V180 M1/4SM "
|
||||
"R01L/P6000FT +TSSHRA VCFG "
|
||||
"BKN025 SCT100 OVC200 M26/ A2991 RMK PK WND 18515/45 A02 "
|
||||
"WSHFT 1350 TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 "
|
||||
"CIG 1000V1500 PRESFR FRQ LTG CG NW "
|
||||
"RAB1030E1145 FZDZE56 PRESRR SLP135 GS "
|
||||
"T1263 "
|
||||
"VIRGA NW 8/365 4/178 P 0125 60225 7//// 70565 10369 21026 "
|
||||
"404800360 52101 PWINO FZRANO TSNO $",
|
||||
|
||||
"CYQR 161700Z 15015KT 15SM SCT045 SCT090 BKN250 10/03 A2955 "
|
||||
"RMK SC1AC2C11 OB TAKEN H+ 5 DUE AWOS FAILURE SLP027",
|
||||
|
||||
|
||||
|
||||
|
||||
"KPIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1V2",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"SPECI KGFI 041430Z 18045G56KT M1/4SM R15/0200FT FC +TS VV010 20/18 "
|
||||
"A2900 RMK A02A PK WND 18056/28 RAB15E25TSB20 FCB1430 PRESFR "
|
||||
"SLP 701 P 0254 199/182",
|
||||
|
||||
"SPECI KGFI 041430Z 18045G56KT M1/4SM R15/0200FT FC +TS VV010 20/18 "
|
||||
"A2900 RMK A02A PK WND 18056/28 RAB15E25TSB20 FCB1430 PRESFR "
|
||||
"SLP701 P0254 199/182",
|
||||
|
||||
"KHLN 281156Z AUTO 27005KT 10SM OVC023 07/05 A3011 RMK AOA OVC V "
|
||||
"BKN $ SLP202 60000 70001 T00670050 10122 20061 53003",
|
||||
|
||||
"KPHX 281156Z 12004KT 10SM CLR 15/05 A2996 RMK AOA SLP135 T01500050 "
|
||||
"10250 20150 53006",
|
||||
"KFCA 281156Z 30003KT 10SM CLR 06/02 A3009 RMK AO TNO $ SLP191 "
|
||||
"T00610023 10167 20056 53003",
|
||||
"KAST 281156Z 00000KT 10SM BKN095 09/08 A2997 RMK AOA SLP150 "
|
||||
"T00940084 10161 20094 52005 ",
|
||||
"KHVR 281156Z 03003KT 10SM OVC020 09/07 A3010 RMK AO TNO ZRNO "
|
||||
"$ SLP194 T00940073 10156 20089 51005",
|
||||
"KGGW 281156Z 35006KT 5SM BR OVC010 10/09 A3003 RMK AOA $ SLP177 "
|
||||
"70003 T01000095 10156 20110 53008",
|
||||
"KELY 1153Z AUTO 14004KT 10SM SCT075 01/M01 A3011 RMK AOA TNO ZRNO "
|
||||
"SLP171 70001 T00061011 10139 21006 51005",
|
||||
"KFLG 281156Z 29006KT 10SM CLR 04/M01 A3012 RMK AO TNO SLP147 "
|
||||
"T00391011 21006 51004",
|
||||
"KGTF 281156Z 27005KT 7SM BKN080 04/04 A3010 RMK AOA SLP205 "
|
||||
"T00440045 10117 20039 51006",
|
||||
|
||||
"K13A 1918Z 20011KT 26/M06 RMK AO PKWND 020/RNO 644V264 T02611061",
|
||||
|
||||
"KP88 1919Z 09001KT 14/03 RMK AO / PKWND 002/RNO 158 Z T01440034",
|
||||
|
||||
"K40B 1924Z 29004KT 15/M07 RMK AO PKWND 011/RM MV263 T01501072",
|
||||
|
||||
"KGGW 1756Z 33018KT 10SM OVC015 M03/M06 A3041 RMK AOA SLP338 "
|
||||
"4/007 60002 T10281055 11028 21072 51009",
|
||||
"KPHX 1756Z 130004KT 10SM CLR 18/M03 A3001 RMK AOA SLP154 "
|
||||
"T01781033 10178 20067 58007",
|
||||
"KFCA 1756Z 29005KT 10SM CLR 05/M11 A3049 RMK AOA TNO SLP352 "
|
||||
"T00501111 10050 21044 50004",
|
||||
"KAST 1756Z 01006KT 10SM CLR 11/04 A3047 RMK AOA SLP316 "
|
||||
"T01110045 10111 20000 50002",
|
||||
"KELY 1753Z 34010KT 10SM CLR 01/M07 A3022 RMK AOA TNO ZRNO "
|
||||
"SLP240 T00111066 10011 21078 58007",
|
||||
"KFLG 1756Z 07006KT 10SM CLR 06/M12 A3009 RMK AO TNO ZRNO "
|
||||
"SLP178 T00561122 10061 21100 58005",
|
||||
"KGTF 1756Z 35010KT 1/2SM -SN FG VV09 M06/M08 A3051 RMK AOA "
|
||||
"933004 SFC VSBY 3/4 "
|
||||
"PCPN M SLP393 60010 T10611077 11044 21067 53013",
|
||||
"KHLN 1756Z 35012KT 10SM SCT032 OVC060 M02/M09 A3048 RMK AOA "
|
||||
"SLP369 60000 T10171094 11017 21061 53006",
|
||||
"KAST 1756Z 01006KT 10SM CLR 11/04 A3047 RMK AOA SLP316 61104 "
|
||||
"71235 T01110045 10111 20000 401720056 58002",
|
||||
"METAR KLAX 04281156Z AUTO VRB100G135KT 130V210 3 1/2SM "
|
||||
"R15L/0500FT R22L/2700FT R16/1200FT R34/1000V1600FT R01L/P6000FT FC "
|
||||
"+TS BLPY FEW000 BKN050 SCT150 OVC250 3/M1 A2991 RMK "
|
||||
"TORNADO B13 DSNT NE A02 PK WND 18515/45 "
|
||||
"WSHFT 1350 FROPA TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 "
|
||||
"VIS 2 1/2 RY11 OCNL LTG VCY STN "
|
||||
"RAB1030E1145 FZDZE56 BLPYE57 CIG 1000V1500 CIG 020 RY11 "
|
||||
"PRESFR PRESRR SLP013 FG FEW000 VIS NW2 1/2 GR 3/4 "
|
||||
"VIRGA SE -XRAFG3 CIGE005 BKN014 V OVC "
|
||||
"FU BKN020 NOSPECI LAST 8/365 SNINCR 2/10 4/178 "
|
||||
"933125 98096 P 0125 60225 70565 "
|
||||
"T00261015 10369 21026 "
|
||||
"404800360 52101 PWINO FZRANO TSNO $",
|
||||
|
||||
|
||||
|
||||
"METAR KGFI 041356Z AUTO 17012KT 130V210 3 1/2SM R15L/0500FT -RA "
|
||||
"SCT050 OVC110 26/18 A2991 RMK FUNNEL CLOUDS A02 RAB30 "
|
||||
"SLP 101 GR M1/4 VIRGA SCT V BKN P 0010 T02640178",
|
||||
|
||||
"METAR KGFI 041356Z AUTO 05008KT 10SM R15L/P6000FT CLR A2991 "
|
||||
"RMK WATERSPOUTS VCY STN NW A02 SLP 101 10288 20243 52021 $ ",
|
||||
|
||||
"SPECI KGFI 041430Z 18045G56KT M1/4SM R15/0200FT FC +TS VV010 20/18 "
|
||||
"A2900 RMK A02A PK WND 18056/28 OCNL LTG AP "
|
||||
"RAB15E25TSB20 FCB1430 PRESFR "
|
||||
"SLP 701 P 0254 T01990182",
|
||||
|
||||
"KABE 281900Z NIL",
|
||||
|
||||
"METAR KPIT NIL",
|
||||
|
||||
"METAR KCLE 04281156Z 170100G135KT 110V180 M1/4SM "
|
||||
"R01L/P6000FT +TSSHRA VCFG "
|
||||
"BKN025 SCT100 OVC200 M26/ A2991 RMK PK WND 18515/45 A02 "
|
||||
"WSHFT 1350 TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 "
|
||||
"CIG 1000V1500 PRESFR FRQ LTG CG NW "
|
||||
"RAB1030E1145 FZDZE56 PRESRR SLP135 GS "
|
||||
"T1263 "
|
||||
"VIRGA NW 8/365 4/178 P 0125 60225 7//// 70565 10369 21026 "
|
||||
"404800360 52101 PWINO FZRANO TSNO $",
|
||||
|
||||
"METAR KPHL 040256Z AUTO 170100G135KT 130V210 1/2SM "
|
||||
"R15L/0500FT R22L/2700FT R16/1200FT R34/1000V1600FT R01L/P6000FT "
|
||||
"FC +TS BKN050 SCT150 OVC250 M26/ A2991 RMK A02 PK WND 185150/1345 "
|
||||
"WSHFT 1350 TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 LTG DSNT "
|
||||
"RAB1030E1145 FZDZE56 CIG 1000V1500 PRESFR PRESRR SLP037 GR 2 3/4 "
|
||||
"VIRGA E 8/365 4/178 P 0125 70565 21026 T0263 10369 60225 "
|
||||
"404800360 52101 PWINO FZRANO TSNO $",
|
||||
|
||||
"SPECI KGFI 041420Z AUTO 18030KT 2 1/2SM RVRNO TS -RA BKN008 "
|
||||
"OVC060 25/22 A2991 RMK A02 LTG DSNT W "
|
||||
"RAB15TSB20 PRESFR SLP101 P 0000 "
|
||||
"254/218",
|
||||
|
||||
"METAR KGFI 041356Z AUTO 170100G135KT 130V210 3 1/2SM "
|
||||
"R15L/0500FT R22L/2700FT R16/1200FT R34/1000V1600FT R01L/P6000FT "
|
||||
"FC +TS BKN050 SCT150 OVC250 M26/ A2991 RMK A02 PK WND 185150/1345 "
|
||||
"WSHFT 1350 TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 "
|
||||
"RAB1030E1145 FZDZE56 CIG 1000V1500 PRESFR PRESRR SLP997 GR M1/4 "
|
||||
"VIRGA SE 8/365 4/178 P 0125 6//// 60225 70565 T0263 10369 21026 "
|
||||
"404800360 52101 PWINO FZRANO TSNO $",
|
||||
|
||||
|
||||
|
||||
|
||||
"METAR KGFI 041356Z AUTO 170100G135KT 130V210 3 1/2SM "
|
||||
"R15L/0500FT R22L/2700FT R16/1200FT R34/1000V1600FT R01L/P6000FT "
|
||||
"FC +TS BKN050 SCT150 OVC250 M26/ A2991 RMK A02 PK WND 185150/1345 "
|
||||
"WSHFT 1350 TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 "
|
||||
"RAB1030E1145 FZDZE56 CIG 1000V1500 PRESFR PRESRR SLP997 GR 25 "
|
||||
"VIRGA 35 8/365 4/178 P 0125 6//// 60225 70565 T0263 10369 21026 "
|
||||
"VIRGA 35 8/365 4/178 P 0125 21026 70565 10369 60225 T0263 21026 "
|
||||
"404800360 52101 PWINO FZRANO TSNO $",
|
||||
|
||||
|
||||
"METAR KGFI 041356Z AUTO 170100G135KT 130V210 3 1/2SM "
|
||||
"R15L/0500FT R22L/2700FT R16/1200FT R34/1000V1600FT R01L/P6000FT "
|
||||
"FC +TS BKN050 SCT150 OVC250 3/M1 A2991 RMK A02 PK WND 18515/45 "
|
||||
"WSHFT 1350 TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 "
|
||||
"RAB1030E1145 FZDZE56 CIG 1000V1500 PRESFR PRESRR SLP997 GR 25 "
|
||||
"VIRGA 35 8/365 4/178 P 0125 60225 70565 T00261015 10369 21026 "
|
||||
"404800360 52101 PWINO FZRANO TSNO $",
|
||||
|
||||
"METAR KGFI 041356Z AUTO 170100G135KT 130V210 3 1/2SM "
|
||||
"R15L/0500FT R22L/2700FT R16/1200FT R34/1000V1600FT R01L/P6000FT "
|
||||
"FC +TS BKN050 SCT150 OVC250 3/M1 A2991 RMK A02 PK WND 185150/1345 "
|
||||
"WSHFT 1350 TWR VIS 1 1/2 SFC VIS 1/4 VIS 1/4V1 1/4 "
|
||||
"RAB1030E1145 FZDZE56 CIG 1000V1500 PRESFR PRESRR SLP997 GR 25 "
|
||||
"VIRGA 35 8/365 4/178 P 0125 60225 70565 T00261015 10369 21026 "
|
||||
"404800360 52101 PWINO FZRANO TSNO",
|
||||
|
||||
|
||||
|
||||
"METAR KGFI 041356Z AUTO 05008KT 10SM R15L/P6000FT CLR A2991 RMK "
|
||||
"A02 SLP 101 10288 20243 52021",
|
||||
"SPECI DGFI 041430Z 18045G56KT M1/4SM R15/0200FT FC +TS VV010 20/18 "
|
||||
"M20/M18 A2900 RMK A02A PK WND 18056/28 RAB15E25TSB20 FCB1430 PRESFR "
|
||||
"SLP 701 P 0254 M199/M182",
|
||||
|
||||
"SPECI DGFI 041430Z 18045G56KT M1/4SM R15/0200FT FC +TS VV010 20/18 "
|
||||
"M20/M18 A2900 RMK A02A PK WND 18056/28 RAB15E25TSB20 FCB1430 PRESFR "
|
||||
"SLP 701 P 0254 M199/182",
|
||||
|
||||
"SPECI DGFI 041430Z 18045G56KT M1/4SM R15/0200FT FC +TS VV010 20/18 "
|
||||
"M20/M18 A2900 RMK A02A PK WND 18056/28 RAB15E25TSB20 FCB1430 PRESFR "
|
||||
"SLP 701 P 0254 199/M182",
|
||||
|
||||
"METAR APIT 171755Z AUTO 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 4/369 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 8/563 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1 1/2V2 SLP875 SGB1213E1225",
|
||||
|
||||
"NZWN 1700Z 35030G49KT 320V030 20KM 02 5SC021 7SC046 12/08 "
|
||||
" Q0994.2 TEMPO 6000 RA 5ST012 2CB015 RMK SLP056 "
|
||||
"RAE0123",
|
||||
|
||||
"SPECI APIT 171755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 8/321 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1 SLP875 FGB1713",
|
||||
|
||||
"APIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1V2 SLP875",
|
||||
|
||||
|
||||
"APIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1 1/2V2 1/2 SLP875",
|
||||
|
||||
"APIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1V2 1/2 SLP875",
|
||||
|
||||
|
||||
"EGPF 1720Z 00000KT 9999 -SHRA STC014 SCT020CB BNK024 12/09 "
|
||||
"Q1003 NOSIG",
|
||||
|
||||
"NZAA 1700Z 03010KT 30KM 03 5CU022 7SC035 11/07 Q1006.5 NOSIG",
|
||||
"NZWN 1700Z 35030G49KT 320V030 20KM 02 5SC021 7SC046 12/08 "
|
||||
" Q0994.2 TEMPO 6000 RA 5ST012 2CB015 RMK KAUKAU 30050KT",
|
||||
"DGAA 1800Z 22012KT 9999 SCT009 BKN120 25/21 Q1015",
|
||||
"DAAT 1830Z 30010KT CAVOK 29/06 Q1019",
|
||||
|
||||
"GQPP 1800Z 34023KT 3000 DRSA SKC 24/20 Q1011 NSG",
|
||||
"DAAG 1830Z 06006KT 9999 SCT020 25/22 Q1015",
|
||||
"DABB 1830Z 04010KT 9999 SCT030TCU SCT033CB 27/18 Q1017",
|
||||
"DABC 1830Z 00000KT 9999 SCT026TCU SCT036CB 22/18 Q1020 RETS",
|
||||
|
||||
"NZAA 1700Z 03010KT 30KM 03 5CU022 7SC035 11/07 Q1006.5 NOSIG",
|
||||
"NZWN 1700Z 35030G49KT 320V030 20KM 02 5SC021 7SC046 12/08 "
|
||||
" Q0994.2 TEMPO 6000 RA 5ST012 2CB015 RMK K",
|
||||
"NZWN 1700Z 35030G49KT 320V030 20KM 02 5SC021 7SC046 12/08 "
|
||||
" Q0994.2 TEMPO 6000 RA 5ST012 2CB015 RMK KAUKAU 30050KT",
|
||||
"DGAA 1800Z 22012KT 9999 SCT009 BKN120 25/21 Q1015",
|
||||
|
||||
"GFLL 1900Z NIL",
|
||||
|
||||
"GOOY 1800Z 03006G17KT 340V080 6000 TSRA BKN016 BKN030CB "
|
||||
"BKN133 26/23 Q1013 NOSIG",
|
||||
|
||||
"GCXO 1930Z 32018KT 8000 SCT003 SCT007 18/16 Q1019",
|
||||
|
||||
"APIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1 1/2V2",
|
||||
|
||||
"BPIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1V2",
|
||||
|
||||
"CPIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1V2 1/2",
|
||||
|
||||
"DPIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 1 1/2V2 1/2",
|
||||
|
||||
|
||||
"FPIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 3/4V2 1/2",
|
||||
|
||||
"GPIT 1755Z 22015G25KT 1 3/4SM R22L/2700FT R16/1200FT "
|
||||
"R34/1000V1600FT R01L/P6000FT R04RR/900FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/16 A2992 "
|
||||
"RMK 58033 6003/ TWELVE 70125 10039 20029 410840112 "
|
||||
"PCPN 0009 WSHFT 1715 PK WND 2032/1725 "
|
||||
"CIG 20V25 WND 12V25 TWR VIS 2 1/2 "
|
||||
"SFC VIS 1 1/2 VIS 3/4V3",
|
||||
|
||||
"KPIT 1935Z 22015G25KT 1 3/4SM R22L/2700FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB M18/M16 A2992",
|
||||
|
||||
"KPIT 1935Z 22015G25KT 1 3/4SM R22L/2700FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB M18/16 A2992",
|
||||
|
||||
"KPIT 1935Z 22015G25KT 1 3/4SM R22L/2700FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/M16 A2992",
|
||||
|
||||
"KPIT 1935Z 22015G25KT 1 3/4SM R22L/2700FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB MM/M16 A2992",
|
||||
|
||||
"KPIT 1935Z 22015G25KT 1 3/4SM R22L/2700FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB MM/16 A2992",
|
||||
|
||||
"KPIT 1935Z 22015G25KT 1 3/4SM R22L/2700FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB M18/MM A2992",
|
||||
|
||||
"KPIT 1935Z 22015G25KT 1 3/4SM R22L/2700FT "
|
||||
"TSRA -DZ FG +SNPE SCT005 BKN010 OVC250CB 18/MM A2992",
|
||||
|
||||
NULL};
|
||||
|
||||
/***************************/
|
||||
/* DECLARE LOCAL VARIABLES */
|
||||
/***************************/
|
||||
|
||||
Decoded_METAR Metar;
|
||||
Decoded_METAR *Mptr = &Metar;
|
||||
int j,
|
||||
ErReturn;
|
||||
|
||||
|
||||
/***************************************************/
|
||||
/* START BODY OF MAIN ROUTINE FOR CALLING DcdMETAR */
|
||||
/***************************************************/
|
||||
|
||||
j = 0;
|
||||
|
||||
while( string[j] != NULL)
|
||||
{
|
||||
/*-- PRINT INPUT METAR REPORT ----------------------------*/
|
||||
printf("INPUT METAR REPORT: %s\n",string[j] );
|
||||
|
||||
/*-- DECODE INPUT REPORT ---------------------------------*/
|
||||
if ( (ErReturn = DcdMETAR( string[ j ], Mptr )) != 0 )
|
||||
printf("DcdMETAR: Error Return Number: %d\n",ErReturn);
|
||||
|
||||
/*-- PRINT DECODED METAR REPORT ELEMENTS -----------------*/
|
||||
prtDMETR( Mptr );
|
||||
|
||||
j++;
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
#include "Local.h" /* standard header file */
|
||||
#include "Metar.h"
|
||||
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: fracPart */
|
||||
/* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
|
||||
/* Date: 13 Jun 1995 */
|
||||
/* Programmer: CARL MCCALLA */
|
||||
/* Language: C/370 */
|
||||
/* */
|
||||
/* Abstract: Convert a character string fraction into a */
|
||||
/* decimal (floating point) number. */
|
||||
/* */
|
||||
/* External Functions Called: */
|
||||
/* None. */
|
||||
/* */
|
||||
/* Input: string - a pointer to a character string frac- */
|
||||
/* tion. */
|
||||
/* Output: A decimal (floating point) number. */
|
||||
/* */
|
||||
/* Modification History: */
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
|
||||
float fracPart( char *string )
|
||||
{
|
||||
|
||||
/***************************/
|
||||
/* DECLARE LOCAL VARIABLES */
|
||||
/***************************/
|
||||
|
||||
char buf[ 6 ],
|
||||
*slash;
|
||||
|
||||
float numerator,
|
||||
denominator;
|
||||
|
||||
/*************************/
|
||||
/* START BODY OF ROUTINE */
|
||||
/*************************/
|
||||
|
||||
slash = strchr(string, '/');
|
||||
|
||||
memset(buf , '\0', 6);
|
||||
strncpy( buf, string, slash-string);
|
||||
|
||||
numerator = (float) atoi(buf);
|
||||
|
||||
memset(buf , '\0', 6);
|
||||
strcpy( buf, slash+1);
|
||||
|
||||
denominator = (float) atoi(buf);
|
||||
|
||||
return (numerator/denominator);
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
includedir = @includedir@/metar
|
||||
|
||||
lib_LIBRARIES = libsgmetar.a
|
||||
|
||||
include_HEADERS = MetarReport.h MetarStation.h
|
||||
|
||||
libsgmetar_a_SOURCES = \
|
||||
Antoi.cpp Charcmp.cpp Dcdmetar.cpp Dcdmtrmk.cpp Drvmetar.c \
|
||||
Fracpart.cpp Local.h Metar.h \
|
||||
MetarReport.cpp \
|
||||
MetarStation.cpp \
|
||||
Prtdmetr.cpp Stspack2.cpp Stspack3.cpp
|
||||
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
@@ -1,149 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="Metar" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=Metar - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Metar.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Metar.mak" CFG="Metar - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Metar - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Metar - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Metar - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /G6 /W3 /GX /Zi /O2 /I "..\..\..\lib" /I "..\lib" /I "..\..\lib" /I "..\..\..\..\lib" /I ".." /I "..\.." /I "..\..\.." /I "..\..\..\.." /I "..\include" /I "..\..\include" /I "..\..\..\include" /I "..\..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Metar - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G6 /W3 /Gm /GX /Zi /Od /I "..\..\..\lib" /I "..\lib" /I "..\..\lib" /I "..\..\..\..\lib" /I ".." /I "..\.." /I "..\..\.." /I "..\..\..\.." /I "..\include" /I "..\..\include" /I "..\..\..\include" /I "..\..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Metar - Win32 Release"
|
||||
# Name "Metar - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Antoi.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Charcmp.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Dcdmetar.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Dcdmtrmk.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Fracpart.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MetarReport.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MetarStation.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Prtdmetr.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Stspack2.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Stspack3.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LOCAL.H
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\METAR.H
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MetarReport.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MetarStation.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,265 +0,0 @@
|
||||
#ifndef METARX
|
||||
#define METARX
|
||||
|
||||
/********************************************************************/
|
||||
/* */
|
||||
/* Title: METAR H */
|
||||
/* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
|
||||
/* Date: 19 Jan 1996 */
|
||||
/* Programmer: CARL MCCALLA */
|
||||
/* Language: C/370 */
|
||||
/* */
|
||||
/* Abstract: METAR Decoder Header File. */
|
||||
/* */
|
||||
/* Modification History: */
|
||||
/* None. */
|
||||
/* */
|
||||
/********************************************************************/
|
||||
|
||||
|
||||
#include "Local.h" /* standard header file */
|
||||
|
||||
|
||||
/*********************************************/
|
||||
/* */
|
||||
/* RUNWAY VISUAL RANGE STRUCTURE DECLARATION */
|
||||
/* AND VARIABLE TYPE DEFINITION */
|
||||
/* */
|
||||
/*********************************************/
|
||||
|
||||
typedef struct runway_VisRange {
|
||||
char runway_designator[6];
|
||||
bool vrbl_visRange;
|
||||
bool below_min_RVR;
|
||||
bool above_max_RVR;
|
||||
int visRange;
|
||||
int Max_visRange;
|
||||
int Min_visRange;
|
||||
} Runway_VisRange;
|
||||
|
||||
/***********************************************/
|
||||
/* */
|
||||
/* DISPATCH VISUAL RANGE STRUCTURE DECLARATION */
|
||||
/* AND VARIABLE TYPE DEFINITION */
|
||||
/* */
|
||||
/***********************************************/
|
||||
|
||||
typedef struct dispatch_VisRange {
|
||||
bool vrbl_visRange;
|
||||
bool below_min_DVR;
|
||||
bool above_max_DVR;
|
||||
int visRange;
|
||||
int Max_visRange;
|
||||
int Min_visRange;
|
||||
} Dispatch_VisRange;
|
||||
|
||||
/*****************************************/
|
||||
/* */
|
||||
/* CLOUD CONDITION STRUCTURE DECLARATION */
|
||||
/* AND VARIABLE TYPE DEFINITION */
|
||||
/* */
|
||||
/*****************************************/
|
||||
|
||||
typedef struct cloud_Conditions {
|
||||
char cloud_type[5];
|
||||
char cloud_hgt_char[4];
|
||||
char other_cld_phenom[4];
|
||||
int cloud_hgt_meters;
|
||||
} Cloud_Conditions;
|
||||
|
||||
/*****************************************/
|
||||
/* */
|
||||
/* WIND GROUP DATA STRUCTURE DECLARATION */
|
||||
/* AND VARIABLE TYPE DEFINITION */
|
||||
/* */
|
||||
/*****************************************/
|
||||
|
||||
typedef struct windstruct {
|
||||
char windUnits[ 4 ];
|
||||
bool windVRB;
|
||||
int windDir;
|
||||
int windSpeed;
|
||||
int windGust;
|
||||
} WindStruct;
|
||||
|
||||
/*****************************************/
|
||||
/* */
|
||||
/* RECENT WX GROUP STRUCTURE DECLARATION */
|
||||
/* AND VARIABLE TYPE DEFINITION */
|
||||
/* */
|
||||
/*****************************************/
|
||||
|
||||
typedef struct recent_wx {
|
||||
char Recent_weather[ 5 ];
|
||||
int Bhh;
|
||||
int Bmm;
|
||||
int Ehh;
|
||||
int Emm;
|
||||
} Recent_Wx;
|
||||
|
||||
/***************************************/
|
||||
/* */
|
||||
/* DECODED METAR STRUCTURE DECLARATION */
|
||||
/* AND VARIABLE TYPE DEFINITION */
|
||||
/* */
|
||||
/***************************************/
|
||||
|
||||
typedef struct decoded_METAR {
|
||||
char synoptic_cloud_type[ 6 ];
|
||||
char snow_depth_group[ 6 ];
|
||||
char codeName[ 6 ];
|
||||
char stnid[5];
|
||||
char horiz_vsby[5];
|
||||
char dir_min_horiz_vsby[3];
|
||||
char vsby_Dir[ 3 ];
|
||||
char WxObstruct[10][8];
|
||||
char autoIndicator[5];
|
||||
char VSBY_2ndSite_LOC[10];
|
||||
char SKY_2ndSite_LOC[10];
|
||||
char SKY_2ndSite[10];
|
||||
char SectorVsby_Dir[ 3 ];
|
||||
char ObscurAloft[ 12 ];
|
||||
char ObscurAloftSkyCond[ 12 ];
|
||||
char VrbSkyBelow[ 4 ];
|
||||
char VrbSkyAbove[ 4 ];
|
||||
char LTG_DIR[ 3 ];
|
||||
char CloudLow;
|
||||
char CloudMedium;
|
||||
char CloudHigh;
|
||||
char CIG_2ndSite_LOC[10];
|
||||
char VIRGA_DIR[3];
|
||||
char TornadicType[15];
|
||||
char TornadicLOC[10];
|
||||
char TornadicDIR[4];
|
||||
char TornadicMovDir[3];
|
||||
char CHINO_LOC[6];
|
||||
char VISNO_LOC[6];
|
||||
char PartialObscurationAmt[2][7];
|
||||
char PartialObscurationPhenom[2][12];
|
||||
char SfcObscuration[6][10];
|
||||
char charPrevailVsby[12];
|
||||
char charVertVsby[10];
|
||||
char TS_LOC[3];
|
||||
char TS_MOVMNT[3];
|
||||
|
||||
bool Indeterminant3_6HrPrecip;
|
||||
bool CIGNO;
|
||||
bool SLPNO;
|
||||
bool ACFTMSHP;
|
||||
bool NOSPECI;
|
||||
bool FIRST;
|
||||
bool LAST;
|
||||
bool SunSensorOut;
|
||||
bool AUTO;
|
||||
bool COR;
|
||||
bool NIL_rpt;
|
||||
bool CAVOK;
|
||||
bool RVRNO;
|
||||
bool A_altstng;
|
||||
bool Q_altstng;
|
||||
bool VIRGA;
|
||||
bool VOLCASH;
|
||||
bool GR;
|
||||
bool CHINO;
|
||||
bool VISNO;
|
||||
bool PNO;
|
||||
bool PWINO;
|
||||
bool FZRANO;
|
||||
bool TSNO;
|
||||
bool DollarSign;
|
||||
bool PRESRR;
|
||||
bool PRESFR;
|
||||
bool Wshft_FROPA;
|
||||
bool OCNL_LTG;
|
||||
bool FRQ_LTG;
|
||||
bool CNS_LTG;
|
||||
bool CG_LTG;
|
||||
bool IC_LTG;
|
||||
bool CC_LTG;
|
||||
bool CA_LTG;
|
||||
bool DSNT_LTG;
|
||||
bool AP_LTG;
|
||||
bool VcyStn_LTG;
|
||||
bool OVHD_LTG;
|
||||
bool LightningVCTS;
|
||||
bool LightningTS;
|
||||
|
||||
int TornadicDistance;
|
||||
int ob_hour;
|
||||
int ob_minute;
|
||||
int ob_date;
|
||||
int minWnDir;
|
||||
int maxWnDir;
|
||||
int VertVsby;
|
||||
int temp;
|
||||
int dew_pt_temp;
|
||||
int QFE;
|
||||
int hectoPasc_altstng;
|
||||
int char_prestndcy;
|
||||
int minCeiling;
|
||||
int maxCeiling;
|
||||
int WshfTime_hour;
|
||||
int WshfTime_minute;
|
||||
int min_vrbl_wind_dir;
|
||||
int max_vrbl_wind_dir;
|
||||
int PKWND_dir;
|
||||
int PKWND_speed;
|
||||
int PKWND_hour;
|
||||
int PKWND_minute;
|
||||
int SKY_2ndSite_Meters;
|
||||
int Ceiling;
|
||||
int Estimated_Ceiling;
|
||||
int SNINCR;
|
||||
int SNINCR_TotalDepth;
|
||||
int SunshineDur;
|
||||
int ObscurAloftHgt;
|
||||
int VrbSkyLayerHgt;
|
||||
int Num8thsSkyObscured;
|
||||
int CIG_2ndSite_Meters;
|
||||
int snow_depth;
|
||||
int BTornadicHour;
|
||||
int BTornadicMinute;
|
||||
int ETornadicHour;
|
||||
int ETornadicMinute;
|
||||
|
||||
|
||||
float SectorVsby;
|
||||
float WaterEquivSnow;
|
||||
float VSBY_2ndSite;
|
||||
float prevail_vsbySM;
|
||||
float prevail_vsbyM;
|
||||
float prevail_vsbyKM;
|
||||
float prestndcy;
|
||||
float precip_amt;
|
||||
float precip_24_amt;
|
||||
float maxtemp;
|
||||
float mintemp;
|
||||
float max24temp;
|
||||
float min24temp;
|
||||
float minVsby;
|
||||
float maxVsby;
|
||||
float hourlyPrecip;
|
||||
float TWR_VSBY;
|
||||
float SFC_VSBY;
|
||||
float Temp_2_tenths;
|
||||
float DP_Temp_2_tenths;
|
||||
float SLP;
|
||||
float GR_Size;
|
||||
|
||||
double inches_altstng;
|
||||
|
||||
Runway_VisRange RRVR[12];
|
||||
Dispatch_VisRange DVR;
|
||||
Recent_Wx ReWx[3];
|
||||
WindStruct winData;
|
||||
Cloud_Conditions cldTypHgt[6];
|
||||
|
||||
} Decoded_METAR;
|
||||
|
||||
#define MAXWXSYMBOLS 10 /*-- NOT TO EXCEED 10 PRES. WX GRPS --*/
|
||||
#define MAXTOKENS 500 /*-- RPT NOT TO EXCEED 500 GRPS --*/
|
||||
|
||||
void prtDMETR( Decoded_METAR *Mptr );
|
||||
int DcdMETAR( char *string, Decoded_METAR *Mptr );
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user