diff -Nru aweather-0.6.1/config.h.in aweather-0.7/config.h.in --- aweather-0.6.1/config.h.in 2011-11-25 07:00:05.000000000 +0000 +++ aweather-0.7/config.h.in 2012-02-15 05:49:45.000000000 +0000 @@ -3,6 +3,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Have GPSD support */ +#undef HAVE_GPSD + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H diff -Nru aweather-0.6.1/configure aweather-0.7/configure --- aweather-0.6.1/configure 2011-11-25 06:59:59.000000000 +0000 +++ aweather-0.7/configure 2012-02-15 05:49:31.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for aweather 0.6.1. +# Generated by GNU Autoconf 2.68 for aweather 0.7. # # Report bugs to . # @@ -570,8 +570,8 @@ # Identity of this package. PACKAGE_NAME='aweather' PACKAGE_TARNAME='aweather' -PACKAGE_VERSION='0.6.1' -PACKAGE_STRING='aweather 0.6.1' +PACKAGE_VERSION='0.7' +PACKAGE_STRING='aweather 0.7' PACKAGE_BUGREPORT='andy753421@gmail.com' PACKAGE_URL='' @@ -615,11 +615,23 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -WIN32_FALSE -WIN32_TRUE +DOTS +MAC_LIBS +MAC_CFLAGS +SYS_X11_FALSE +SYS_X11_TRUE +SYS_MAC_FALSE +SYS_MAC_TRUE +SYS_WIN_FALSE +SYS_WIN_TRUE RSL_LIBS HAVE_RSL_FALSE HAVE_RSL_TRUE +HAVE_GPSD_FALSE +HAVE_GPSD_TRUE +HAVE_GPSD +GPSD_LIBS +GPSD_CFLAGS GRITS_LIBS GRITS_CFLAGS GLIB_LIBS @@ -749,6 +761,8 @@ with_gnu_ld with_sysroot enable_libtool_lock +enable_gps +enable_relative ' ac_precious_vars='build_alias host_alias @@ -765,7 +779,11 @@ GLIB_CFLAGS GLIB_LIBS GRITS_CFLAGS -GRITS_LIBS' +GRITS_LIBS +GPSD_CFLAGS +GPSD_LIBS +MAC_CFLAGS +MAC_LIBS' # Initialize some variables set by options. @@ -1308,7 +1326,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures aweather 0.6.1 to adapt to many kinds of systems. +\`configure' configures aweather 0.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1378,7 +1396,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of aweather 0.6.1:";; + short | recursive ) echo "Configuration of aweather 0.7:";; esac cat <<\_ACEOF @@ -1393,6 +1411,8 @@ --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-gps Build with gpsd support + --enable-relative enable runtime search paths [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1422,6 +1442,10 @@ GRITS_CFLAGS C compiler flags for GRITS, overriding pkg-config GRITS_LIBS linker flags for GRITS, overriding pkg-config + GPSD_CFLAGS C compiler flags for GPSD, overriding pkg-config + GPSD_LIBS linker flags for GPSD, overriding pkg-config + MAC_CFLAGS C compiler flags for MAC, overriding pkg-config + MAC_LIBS linker flags for MAC, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1489,7 +1513,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -aweather configure 0.6.1 +aweather configure 0.7 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1767,7 +1791,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by aweather $as_me 0.6.1, which was +It was created by aweather $as_me 0.7, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2582,7 +2606,7 @@ # Define the identity of the package. PACKAGE='aweather' - VERSION='0.6.1' + VERSION='0.7' cat >>confdefs.h <<_ACEOF @@ -11821,6 +11845,115 @@ fi +# Check for gpsd support +# Check whether --enable-gps was given. +if test "${enable_gps+set}" = set; then : + enableval=$enable_gps; +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPSD" >&5 +$as_echo_n "checking for GPSD... " >&6; } + +if test -n "$GPSD_CFLAGS"; then + pkg_cv_GPSD_CFLAGS="$GPSD_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgps >= 3.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libgps >= 3.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPSD_CFLAGS=`$PKG_CONFIG --cflags "libgps >= 3.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GPSD_LIBS"; then + pkg_cv_GPSD_LIBS="$GPSD_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgps >= 3.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libgps >= 3.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPSD_LIBS=`$PKG_CONFIG --libs "libgps >= 3.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPSD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libgps >= 3.0" 2>&1` + else + GPSD_PKG_ERRORS=`$PKG_CONFIG --print-errors "libgps >= 3.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPSD_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libgps >= 3.0) were not met: + +$GPSD_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GPSD_CFLAGS +and GPSD_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GPSD_CFLAGS +and GPSD_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + GPSD_CFLAGS=$pkg_cv_GPSD_CFLAGS + GPSD_LIBS=$pkg_cv_GPSD_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + +$as_echo "#define HAVE_GPSD /**/" >>confdefs.h + + HAVE_GPSD=TRUE + + +fi + + if test "$HAVE_GPSD" = "TRUE"; then + HAVE_GPSD_TRUE= + HAVE_GPSD_FALSE='#' +else + HAVE_GPSD_TRUE='#' + HAVE_GPSD_FALSE= +fi + + # Define odd RSL install location { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RSL_wsr88d_to_radar in -lrsl" >&5 $as_echo_n "checking for RSL_wsr88d_to_radar in -lrsl... " >&6; } @@ -11872,22 +12005,138 @@ -# Test for Windows vs. Unix +# Test for windowing system case "${host}" in - *mingw32*) WIN32="yes" ;; - *) WIN32="no" ;; + *mingw32*) SYS="WIN" ;; + *cygwin*) SYS="WIN" ;; + *apple*) SYS="MAC" ;; + *) SYS="X11" ;; esac -if test "$WIN32" = yes; then - ac_default_prefix="/" + if test "$SYS" = "WIN"; then + SYS_WIN_TRUE= + SYS_WIN_FALSE='#' +else + SYS_WIN_TRUE='#' + SYS_WIN_FALSE= fi - if test "$WIN32" = "yes"; then - WIN32_TRUE= - WIN32_FALSE='#' + + if test "$SYS" = "MAC"; then + SYS_MAC_TRUE= + SYS_MAC_FALSE='#' else - WIN32_TRUE='#' - WIN32_FALSE= + SYS_MAC_TRUE='#' + SYS_MAC_FALSE= fi + if test "$SYS" = "X11"; then + SYS_X11_TRUE= + SYS_X11_FALSE='#' +else + SYS_X11_TRUE='#' + SYS_X11_FALSE= +fi + + +# Check for Mac OX +if test "$SYS" = "MAC"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAC" >&5 +$as_echo_n "checking for MAC... " >&6; } + +if test -n "$MAC_CFLAGS"; then + pkg_cv_MAC_CFLAGS="$MAC_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-mac-integration\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk-mac-integration") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_MAC_CFLAGS=`$PKG_CONFIG --cflags "gtk-mac-integration" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$MAC_LIBS"; then + pkg_cv_MAC_LIBS="$MAC_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-mac-integration\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk-mac-integration") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_MAC_LIBS=`$PKG_CONFIG --libs "gtk-mac-integration" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + MAC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk-mac-integration" 2>&1` + else + MAC_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk-mac-integration" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$MAC_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (gtk-mac-integration) were not met: + +$MAC_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables MAC_CFLAGS +and MAC_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables MAC_CFLAGS +and MAC_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + MAC_CFLAGS=$pkg_cv_MAC_CFLAGS + MAC_LIBS=$pkg_cv_MAC_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi +fi + +# Check for relative build +# Check whether --enable-relative was given. +if test "${enable_relative+set}" = set; then : + enableval=$enable_relative; DOTS=".."; ac_default_prefix="/" +fi + + # Output ac_config_files="$ac_config_files Makefile src/Makefile src/resource.rc src/plugins/Makefile data/Makefile data/main.ui docs/Makefile" @@ -12017,12 +12266,24 @@ as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_GPSD_TRUE}" && test -z "${HAVE_GPSD_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GPSD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_RSL_TRUE}" && test -z "${HAVE_RSL_FALSE}"; then as_fn_error $? "conditional \"HAVE_RSL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then - as_fn_error $? "conditional \"WIN32\" was never defined. +if test -z "${SYS_WIN_TRUE}" && test -z "${SYS_WIN_FALSE}"; then + as_fn_error $? "conditional \"SYS_WIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SYS_MAC_TRUE}" && test -z "${SYS_MAC_FALSE}"; then + as_fn_error $? "conditional \"SYS_MAC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SYS_X11_TRUE}" && test -z "${SYS_X11_FALSE}"; then + as_fn_error $? "conditional \"SYS_X11\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -12434,7 +12695,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by aweather $as_me 0.6.1, which was +This file was extended by aweather $as_me 0.7, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12500,7 +12761,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -aweather config.status 0.6.1 +aweather config.status 0.7 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -Nru aweather-0.6.1/configure.ac aweather-0.7/configure.ac --- aweather-0.6.1/configure.ac 2011-11-25 06:55:31.000000000 +0000 +++ aweather-0.7/configure.ac 2012-02-15 05:48:46.000000000 +0000 @@ -1,5 +1,5 @@ # Init and options -AC_INIT([aweather], [0.6.1], [andy753421@gmail.com]) +AC_INIT([aweather], [0.7], [andy753421@gmail.com]) AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability foreign]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -16,22 +16,42 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) PKG_CHECK_MODULES(GRITS, grits >= 0.6) +# Check for gpsd support +AC_ARG_ENABLE([gps], AS_HELP_STRING([--enable-gps], [Build with gpsd support]), + [PKG_CHECK_MODULES(GPSD, libgps >= 3.0) + AC_DEFINE([HAVE_GPSD], [], [Have GPSD support]) + AC_SUBST(HAVE_GPSD, [TRUE])] +) +AM_CONDITIONAL([HAVE_GPSD], test "$HAVE_GPSD" = "TRUE") + # Define odd RSL install location AC_CHECK_LIB(rsl, RSL_wsr88d_to_radar, RSL_LIBS="-lrsl") AM_CONDITIONAL(HAVE_RSL, test "$RSL_LIBS" != "") AC_SUBST(RSL_LIBS) -# Test for Windows vs. Unix +# Test for windowing system case "${host}" in - *mingw32*) WIN32="yes" ;; - *) WIN32="no" ;; + *mingw32*) SYS="WIN" ;; + *cygwin*) SYS="WIN" ;; + *apple*) SYS="MAC" ;; + *) SYS="X11" ;; esac -if test "$WIN32" = yes; then - ac_default_prefix="/" +AM_CONDITIONAL([SYS_WIN], test "$SYS" = "WIN") +AM_CONDITIONAL([SYS_MAC], test "$SYS" = "MAC") +AM_CONDITIONAL([SYS_X11], test "$SYS" = "X11") + +# Check for Mac OX +if test "$SYS" = "MAC"; then + PKG_CHECK_MODULES(MAC, gtk-mac-integration) fi -AM_CONDITIONAL([WIN32], test "$WIN32" = "yes") -# Output +# Check for relative build +AC_ARG_ENABLE(relative, [AS_HELP_STRING([--enable-relative], + [enable runtime search paths @<:@default=no@:>@])], + [DOTS=".."; ac_default_prefix="/"]) +AC_SUBST([DOTS]) + +# Output AC_CONFIG_FILES([ Makefile src/Makefile Binary files /tmp/5SZUzKcHY5/aweather-0.6.1/data/arrow.png and /tmp/XFmhSJPn4k/aweather-0.7/data/arrow.png differ Binary files /tmp/5SZUzKcHY5/aweather-0.6.1/data/car.png and /tmp/XFmhSJPn4k/aweather-0.7/data/car.png differ diff -Nru aweather-0.6.1/data/main.ui aweather-0.7/data/main.ui --- aweather-0.6.1/data/main.ui 2011-11-25 07:00:04.000000000 +0000 +++ aweather-0.7/data/main.ui 2012-02-15 05:49:43.000000000 +0000 @@ -15,18 +15,18 @@ gtk-clear - - _Contents - Contents - AWeather Reference Manual - gtk-help - - _Fullscreen gtk-fullscreen + + _Man Page + Man Page + Unix Man Page + gtk-help + + _Offline gtk-disconnect @@ -54,6 +54,13 @@ gtk-media-play + + _User Guide + User Guide + AWeather User Guide + gtk-help + + Zoom _In gtk-zoom-in @@ -71,8 +78,8 @@ center-on-parent dialog AWeather - 0.6.1 - Copyright ©2008-2011 Andy Spencer + 0.7 + Copyright ©2008-2012 Andy Spencer A weather monitoring program http://lug.rose-hulman.edu/proj/aweather GNU GENERAL PUBLIC LICENSE @@ -320,6 +327,7 @@ The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>. Andy Spencer <andy753421@gmail.com> + Jason Holmes <Doppler5@aol.com> logo.svg True @@ -353,6 +361,7 @@ AWeather 600 400 + True @@ -524,10 +533,19 @@ True False - + + True + False + userguide + True + True + + + + True False - contents + manpage True True diff -Nru aweather-0.6.1/data/main.ui.in aweather-0.7/data/main.ui.in --- aweather-0.6.1/data/main.ui.in 2011-11-18 07:32:46.000000000 +0000 +++ aweather-0.7/data/main.ui.in 2012-02-09 07:01:59.000000000 +0000 @@ -15,18 +15,18 @@ gtk-clear - - _Contents - Contents - AWeather Reference Manual - gtk-help - - _Fullscreen gtk-fullscreen + + _Man Page + Man Page + Unix Man Page + gtk-help + + _Offline gtk-disconnect @@ -54,6 +54,13 @@ gtk-media-play + + _User Guide + User Guide + AWeather User Guide + gtk-help + + Zoom _In gtk-zoom-in @@ -72,7 +79,7 @@ dialog AWeather @VERSION@ - Copyright ©2008-2011 Andy Spencer + Copyright ©2008-2012 Andy Spencer A weather monitoring program http://lug.rose-hulman.edu/proj/aweather GNU GENERAL PUBLIC LICENSE @@ -320,6 +327,7 @@ The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>. Andy Spencer <andy753421@gmail.com> + Jason Holmes <Doppler5@aol.com> logo.svg True @@ -353,6 +361,7 @@ AWeather 600 400 + True @@ -524,10 +533,19 @@ True False - + + True + False + userguide + True + True + + + + True False - contents + manpage True True diff -Nru aweather-0.6.1/data/Makefile.am aweather-0.7/data/Makefile.am --- aweather-0.6.1/data/Makefile.am 2011-11-18 07:32:45.000000000 +0000 +++ aweather-0.7/data/Makefile.am 2012-02-09 07:03:07.000000000 +0000 @@ -10,6 +10,9 @@ logodir = $(datadir)/aweather/ dist_logo_DATA = logo.svg +icondir = $(datadir)/aweather/ +dist_icon_DATA = car.png arrow.png + colordir = $(datadir)/aweather/colors/ dist_color_DATA = colors/*.clr diff -Nru aweather-0.6.1/data/Makefile.in aweather-0.7/data/Makefile.in --- aweather-0.6.1/data/Makefile.in 2011-11-25 06:59:58.000000000 +0000 +++ aweather-0.7/data/Makefile.in 2012-02-15 05:49:29.000000000 +0000 @@ -39,8 +39,9 @@ $(dist_desktop_DATA) $(dist_fips_DATA) $(dist_gtkbuilder_DATA) \ $(dist_icon16_DATA) $(dist_icon22_DATA) $(dist_icon24_DATA) \ $(dist_icon32_DATA) $(dist_icon48_DATA) $(dist_iconSC_DATA) \ - $(dist_logo_DATA) $(dist_noinst_DATA) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/main.ui.in + $(dist_icon_DATA) $(dist_logo_DATA) $(dist_noinst_DATA) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/main.ui.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/dolt.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -77,15 +78,16 @@ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(colordir)" "$(DESTDIR)$(configdir)" \ "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(fipsdir)" \ - "$(DESTDIR)$(gtkbuilderdir)" "$(DESTDIR)$(icon16dir)" \ - "$(DESTDIR)$(icon22dir)" "$(DESTDIR)$(icon24dir)" \ - "$(DESTDIR)$(icon32dir)" "$(DESTDIR)$(icon48dir)" \ - "$(DESTDIR)$(iconSCdir)" "$(DESTDIR)$(logodir)" + "$(DESTDIR)$(gtkbuilderdir)" "$(DESTDIR)$(icondir)" \ + "$(DESTDIR)$(icon16dir)" "$(DESTDIR)$(icon22dir)" \ + "$(DESTDIR)$(icon24dir)" "$(DESTDIR)$(icon32dir)" \ + "$(DESTDIR)$(icon48dir)" "$(DESTDIR)$(iconSCdir)" \ + "$(DESTDIR)$(logodir)" DATA = $(dist_color_DATA) $(dist_config_DATA) $(dist_desktop_DATA) \ - $(dist_fips_DATA) $(dist_gtkbuilder_DATA) $(dist_icon16_DATA) \ - $(dist_icon22_DATA) $(dist_icon24_DATA) $(dist_icon32_DATA) \ - $(dist_icon48_DATA) $(dist_iconSC_DATA) $(dist_logo_DATA) \ - $(dist_noinst_DATA) + $(dist_fips_DATA) $(dist_gtkbuilder_DATA) $(dist_icon_DATA) \ + $(dist_icon16_DATA) $(dist_icon22_DATA) $(dist_icon24_DATA) \ + $(dist_icon32_DATA) $(dist_icon48_DATA) $(dist_iconSC_DATA) \ + $(dist_logo_DATA) $(dist_noinst_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -104,6 +106,7 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ +DOTS = @DOTS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -114,9 +117,12 @@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ +GPSD_CFLAGS = @GPSD_CFLAGS@ +GPSD_LIBS = @GPSD_LIBS@ GREP = @GREP@ GRITS_CFLAGS = @GRITS_CFLAGS@ GRITS_LIBS = @GRITS_LIBS@ +HAVE_GPSD = @HAVE_GPSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -132,6 +138,8 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ +MAC_CFLAGS = @MAC_CFLAGS@ +MAC_LIBS = @MAC_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -220,6 +228,8 @@ dist_fips_DATA = fips.txt logodir = $(datadir)/aweather/ dist_logo_DATA = logo.svg +icondir = $(datadir)/aweather/ +dist_icon_DATA = car.png arrow.png colordir = $(datadir)/aweather/colors/ dist_color_DATA = colors/*.clr desktopdir = $(datadir)/applications @@ -379,6 +389,26 @@ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(gtkbuilderdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(gtkbuilderdir)" && rm -f $$files +install-dist_iconDATA: $(dist_icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(dist_icon_DATA)'; test -n "$(icondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-dist_iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(icondir)" && rm -f $$files install-dist_icon16DATA: $(dist_icon16_DATA) @$(NORMAL_INSTALL) test -z "$(icon16dir)" || $(MKDIR_P) "$(DESTDIR)$(icon16dir)" @@ -560,7 +590,7 @@ check: check-am all-am: Makefile $(DATA) installdirs: - for dir in "$(DESTDIR)$(colordir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(fipsdir)" "$(DESTDIR)$(gtkbuilderdir)" "$(DESTDIR)$(icon16dir)" "$(DESTDIR)$(icon22dir)" "$(DESTDIR)$(icon24dir)" "$(DESTDIR)$(icon32dir)" "$(DESTDIR)$(icon48dir)" "$(DESTDIR)$(iconSCdir)" "$(DESTDIR)$(logodir)"; do \ + for dir in "$(DESTDIR)$(colordir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(fipsdir)" "$(DESTDIR)$(gtkbuilderdir)" "$(DESTDIR)$(icondir)" "$(DESTDIR)$(icon16dir)" "$(DESTDIR)$(icon22dir)" "$(DESTDIR)$(icon24dir)" "$(DESTDIR)$(icon32dir)" "$(DESTDIR)$(icon48dir)" "$(DESTDIR)$(iconSCdir)" "$(DESTDIR)$(logodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -613,7 +643,8 @@ install-dist_gtkbuilderDATA install-dist_icon16DATA \ install-dist_icon22DATA install-dist_icon24DATA \ install-dist_icon32DATA install-dist_icon48DATA \ - install-dist_iconSCDATA install-dist_logoDATA + install-dist_iconDATA install-dist_iconSCDATA \ + install-dist_logoDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am @@ -664,7 +695,8 @@ uninstall-dist_gtkbuilderDATA uninstall-dist_icon16DATA \ uninstall-dist_icon22DATA uninstall-dist_icon24DATA \ uninstall-dist_icon32DATA uninstall-dist_icon48DATA \ - uninstall-dist_iconSCDATA uninstall-dist_logoDATA + uninstall-dist_iconDATA uninstall-dist_iconSCDATA \ + uninstall-dist_logoDATA .MAKE: install-am install-data-am install-strip @@ -677,19 +709,20 @@ install-dist_gtkbuilderDATA install-dist_icon16DATA \ install-dist_icon22DATA install-dist_icon24DATA \ install-dist_icon32DATA install-dist_icon48DATA \ - install-dist_iconSCDATA install-dist_logoDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-local mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-dist_colorDATA uninstall-dist_configDATA \ - uninstall-dist_desktopDATA uninstall-dist_fipsDATA \ - uninstall-dist_gtkbuilderDATA uninstall-dist_icon16DATA \ - uninstall-dist_icon22DATA uninstall-dist_icon24DATA \ - uninstall-dist_icon32DATA uninstall-dist_icon48DATA \ + install-dist_iconDATA install-dist_iconSCDATA \ + install-dist_logoDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic maintainer-clean-local mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-dist_colorDATA \ + uninstall-dist_configDATA uninstall-dist_desktopDATA \ + uninstall-dist_fipsDATA uninstall-dist_gtkbuilderDATA \ + uninstall-dist_icon16DATA uninstall-dist_icon22DATA \ + uninstall-dist_icon24DATA uninstall-dist_icon32DATA \ + uninstall-dist_icon48DATA uninstall-dist_iconDATA \ uninstall-dist_iconSCDATA uninstall-dist_logoDATA diff -Nru aweather-0.6.1/debian/changelog aweather-0.7/debian/changelog --- aweather-0.6.1/debian/changelog 2011-11-28 06:43:00.000000000 +0000 +++ aweather-0.7/debian/changelog 2012-03-04 23:38:36.000000000 +0000 @@ -1,8 +1,14 @@ -aweather (0.6.1-1ppa1) oneiric; urgency=low +aweather (0.7-1ppa3+11.10) oneiric; urgency=low - * Build for Ubuntu PPA + * Build for Ubuntu Oneiric PPA - -- Andy Spencer Mon, 28 Nov 2011 06:42:54 +0000 + -- Andy Spencer Fri, 17 Feb 2012 00:01:57 +0000 + +aweather (0.7-1) unstable; urgency=low + + * New upstream release + + -- Andy Spencer Wed, 15 Feb 2012 06:13:46 +0000 aweather (0.6.1-1) unstable; urgency=low diff -Nru aweather-0.6.1/debian/control aweather-0.7/debian/control --- aweather-0.6.1/debian/control 2011-11-12 04:05:55.000000000 +0000 +++ aweather-0.7/debian/control 2012-03-04 23:38:28.000000000 +0000 @@ -3,7 +3,7 @@ Maintainer: Debian Science Maintainers Uploaders: Andy Spencer Build-Depends: debhelper (>= 7.0.50~), libbz2-dev, libcairo2-dev, - libglib2.0-dev (>= 2.14), libgrits-dev (>= 0.6), libgtk2.0-dev (>= 2.16), + libglib2.0-dev (>= 2.14), libgrits-dev (>= 0.7), libgtk2.0-dev (>= 2.16), librsl-dev (>= 1.41), libsoup2.4-dev (>= 2.26), mesa-common-dev, libglu1-mesa-dev Standards-Version: 3.9.2 diff -Nru aweather-0.6.1/debian/patches/debian-changes-0.7-1ppa3+11.10 aweather-0.7/debian/patches/debian-changes-0.7-1ppa3+11.10 --- aweather-0.6.1/debian/patches/debian-changes-0.7-1ppa3+11.10 1970-01-01 00:00:00.000000000 +0000 +++ aweather-0.7/debian/patches/debian-changes-0.7-1ppa3+11.10 2012-03-04 23:47:43.000000000 +0000 @@ -0,0 +1,89 @@ +Description: Upstream changes introduced in version 0.7-1ppa3+11.10 + This patch has been created by dpkg-source during the package build. + Here's the last changelog entry, hopefully it gives details on why + those changes were made: + . + aweather (0.7-1ppa3+11.10) oneiric; urgency=low + . + * Build for Ubuntu Oneiric PPA + . + The person named in the Author field signed this changelog entry. +Author: Andy Spencer + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- /dev/null ++++ aweather-0.7/doltcompile +@@ -0,0 +1,40 @@ ++#!/bin/bash ++args=("$@") ++for ((arg=0; arg<${#args[@]}; arg++)) ; do ++ if test x"${args[$arg]}" = x-o ; then ++ objarg=$((arg+1)) ++ break ++ fi ++done ++if test x$objarg = x ; then ++ echo 'Error: no -o on compiler command line' 1>&2 ++ exit 1 ++fi ++lo="${args[$objarg]}" ++obj="${lo%.lo}" ++if test x"$lo" = x"$obj" ; then ++ echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2 ++ exit 1 ++fi ++objbase="${obj##*/}" ++libobjdir="${obj%$objbase}.libs" ++if test ! -d "$libobjdir" ; then ++ mkdir_out="$(mkdir "$libobjdir" 2>&1)" ++ mkdir_ret=$? ++ if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then ++ echo "$mkdir_out" 1>&2 ++ exit $mkdir_ret ++ fi ++fi ++pic_object="$libobjdir/$objbase.o" ++args[$objarg]="$pic_object" ++"${args[@]}" -fPIC -DPIC || exit $? ++non_pic_object="$obj.o" ++args[$objarg]="$non_pic_object" ++"${args[@]}" >/dev/null 2>&1 || exit $? ++{ ++echo "# $lo - a libtool object file" ++echo "# Generated by doltcompile, not libtool" ++echo "pic_object='.libs/${objbase}.o'" ++echo "non_pic_object='${objbase}.o'" ++} > "$lo" +--- /dev/null ++++ aweather-0.7/doltlibtool +@@ -0,0 +1,18 @@ ++#!/bin/bash ++top_builddir_slash="${0%%doltlibtool}" ++: ${top_builddir_slash:=./} ++args=() ++modeok=false ++tagok=false ++for arg in "$@"; do ++ case "$arg" in ++ --mode=compile) modeok=true ;; ++ --tag=CC|--tag=CXX) tagok=true ;; ++ *) args[${#args[@]}]="$arg" ;; ++ esac ++done ++if $modeok && $tagok ; then ++ . ${top_builddir_slash}doltcompile "${args[@]}" ++else ++ exec ${top_builddir_slash}libtool "$@" ++fi diff -Nru aweather-0.6.1/debian/patches/series aweather-0.7/debian/patches/series --- aweather-0.6.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ aweather-0.7/debian/patches/series 2012-03-04 23:47:43.000000000 +0000 @@ -0,0 +1 @@ +debian-changes-0.7-1ppa3+11.10 diff -Nru aweather-0.6.1/docs/aweather.1 aweather-0.7/docs/aweather.1 --- aweather-0.6.1/docs/aweather.1 2011-11-18 08:24:27.000000000 +0000 +++ aweather-0.7/docs/aweather.1 2012-02-09 07:17:18.000000000 +0000 @@ -1,13 +1,22 @@ '\" t .\" Title: aweather -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 11/18/2011 +.\" Author: Andy Spencer +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 02/09/2012 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "AWEATHER" "1" "11/18/2011" "\ \&" "\ \&" +.TH "AWEATHER" "1" "02/09/2012" "\ \&" "\ \&" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -45,7 +54,7 @@ .PP \fB\-t\fR, \fB\-\-time\fR=\fItime\fR .RS 4 -Set initial time\&. The tiem format should be provided in the +Set initial time\&. The time format should be provided in the \fBYYYY\-MM\-DD HH:MM\fR format\&. .RE @@ -134,3 +143,9 @@ .SH "BUGS" .sp Many +.SH "AUTHOR" +.PP +\fBAndy Spencer\fR <\&andy753421@gmail\&.com\&> +.RS 4 +Author. +.RE diff -Nru aweather-0.6.1/docs/aweather.ad aweather-0.7/docs/aweather.ad --- aweather-0.6.1/docs/aweather.ad 2011-11-18 07:32:46.000000000 +0000 +++ aweather-0.7/docs/aweather.ad 2012-02-09 07:01:04.000000000 +0000 @@ -32,7 +32,7 @@ as KLSX. *-t*, *--time*='time':: - Set initial time. The tiem format should be provided in the + Set initial time. The time format should be provided in the *YYYY-MM-DD HH:MM* format. *-o*, *--offline*:: diff -Nru aweather-0.6.1/docs/aweather.html aweather-0.7/docs/aweather.html --- aweather-0.6.1/docs/aweather.html 2011-11-18 08:24:31.000000000 +0000 +++ aweather-0.7/docs/aweather.html 2012-02-09 07:17:22.000000000 +0000 @@ -2,15 +2,25 @@ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> - - + + aweather(1) - +
+

NAME

aweather - Advanced weather reporting program

+
+

SYNOPSIS

aweather [-hoaf] [-d level] [-s site] [-t time]

+
+

DESCRIPTION

AWeather is a advanced weather reporting program which is designed to be used @@ -572,6 +738,8 @@ that integrates a variety of weather data in simple unified interface; see features for more details.

+
+

OPTIONS

@@ -606,7 +774,7 @@

- Set initial time. The tiem format should be provided in the + Set initial time. The time format should be provided in the YYYY-MM-DD HH:MM format.

@@ -641,6 +809,8 @@
+
+

KEY BINDINGS

@@ -724,6 +894,8 @@
+
+

MOUSE MOTION

@@ -753,6 +925,8 @@
+
+

EXAMPLES

@@ -766,19 +940,24 @@
+
+

SEE ALSO

grits-demo(1)

+
+

BUGS

Many

+

diff -Nru aweather-0.6.1/docs/Makefile.am aweather-0.7/docs/Makefile.am --- aweather-0.6.1/docs/Makefile.am 2011-11-18 07:32:46.000000000 +0000 +++ aweather-0.7/docs/Makefile.am 2012-02-09 07:01:04.000000000 +0000 @@ -1,5 +1,5 @@ man1_MANS = aweather.1 wsr88ddec.1 -html_DATA = aweather.html +html_DATA = aweather.html userguide.html EXTRA_DIST = $(man1_MANS) $(html_DATA) \ aweather.ad wsr88ddec.ad diff -Nru aweather-0.6.1/docs/Makefile.in aweather-0.7/docs/Makefile.in --- aweather-0.6.1/docs/Makefile.in 2011-11-25 06:59:58.000000000 +0000 +++ aweather-0.7/docs/Makefile.in 2012-02-15 05:49:29.000000000 +0000 @@ -93,6 +93,7 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ +DOTS = @DOTS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -103,9 +104,12 @@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ +GPSD_CFLAGS = @GPSD_CFLAGS@ +GPSD_LIBS = @GPSD_LIBS@ GREP = @GREP@ GRITS_CFLAGS = @GRITS_CFLAGS@ GRITS_LIBS = @GRITS_LIBS@ +HAVE_GPSD = @HAVE_GPSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -121,6 +125,8 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ +MAC_CFLAGS = @MAC_CFLAGS@ +MAC_LIBS = @MAC_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -202,7 +208,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ man1_MANS = aweather.1 wsr88ddec.1 -html_DATA = aweather.html +html_DATA = aweather.html userguide.html EXTRA_DIST = $(man1_MANS) $(html_DATA) \ aweather.ad wsr88ddec.ad diff -Nru aweather-0.6.1/docs/userguide.html aweather-0.7/docs/userguide.html --- aweather-0.6.1/docs/userguide.html 1970-01-01 00:00:00.000000000 +0000 +++ aweather-0.7/docs/userguide.html 2012-02-09 07:17:26.000000000 +0000 @@ -0,0 +1,1601 @@ + + + + + +AWeather Users Guide + + + + + +
+
+

About and contact information

+
+

AWeather was created in the summer of 2008 and functions as a NEXRAD Level II +radar display program. The goal of this application is to fulfill a need through +providing ample weather information without excessive cost and size that is not +limited to the Linux operating system.

+

It is written in a standard GTK+/GObject architecture and features an +interactive display utilizing Grits and OpenGL technologies.

+

The software source code is available for download on the RHLUG server at +git://lug.rose-hulman.edu/proj/aweather.

+

AWeather relies upon the following dependencies: gtk+ 2.16 +or later, libsoup 2.26 or later, bzip, +rsl 1.42 or later, and +others.

+

Packaged versions of the software are currently available for Gentoo, Debian, +Ubuntu, Microsoft Windows, and Mac OSX operating systems.

+

The program currently provides data viewing from the standard one dimensional +plan view to user-defined three-dimensional dynamic views of current and recent +radar data.

+

The software was developed and is maintained by Andy Spencer. He may be +contacted through e-mail at andy753421@gmail.com and chat through IRC at #rhlug +on irc.freenode.net.

+
+
+
+

Licensing information

+
+

AWeather is provided as free software according to the terms of the GNU General +Public License (version 3 or later) as published by the Free Software Foundation +(http://www.gnu.org/licenses/).

+
+
+
+

Data types and sources

+
+

AWeather displays U.S. National Weather Service NEXt generation RADar data +(NEXRAD) Level II data. This is the highest resolution form of radar data +available in the public domain and consists of multiple tilts of data updated +every 5 to 10 minutes depending on the current scan mode of each radar.

+

The following Level II data types are supported by this program:

+
    +
  • +

    +Base reflectivity (power return of current precipitation intensity) +

    +
  • +
  • +

    +Base velocity (Doppler-derived speed and direction of radar returns) +

    +
  • +
  • +

    +Spectrum width (The variation of velocity detected within each radar pixel or + bin) +

    +
  • +
  • +

    +Differential Reflectivity (The ratio of the reflected horizontal and vertical + power returns)
    [dualpol]
    +

    +
  • +
  • +

    +Differential Phase (A comparison of the phase difference between the + horizontal and vertical returns)
    [dualpol]
    +

    +
  • +
  • +

    +Correlation Coefficient (A statistical correlation between the reflected + horizontal and vertical power returns)
    [Only available at WSR-88D sites that have been upgraded to support dual-polarization]
    +

    +
  • +
+

Level II data has been available through private weather data vendors for some +time but recently has been generously provided by some universities.

+

AWeather requires an active internet connection along with a data feed source in +order to retrieve, decode and display current or recent radar data.

+

The default radar feed is publically accessible thanks to Iowa State University +and is located at: http://mesonet.agron.iastate.edu/data/nexrd2/raw/.

+

AWeather also displays some severe weather alerts provided by the NOAA weather +alerts feed.

+
+
+
+

Program layout

+
+

AWeather consists of a graphical user interface window that contains a file menu +bar, a button bar, a date and time side bar, a large map and data viewing pane +and a bottom data status bar.

+
+
+
+

The file menu commands

+
+

The program file menu consists of 5 entries:

+
+

File

+
+
+Offline +
+
+

+stops the program from downloading data through the internet +

+
+
+Refresh +
+
+

+reloads the current display +

+
+
+Auto-updae +
+
+

+automatically refresh the the radar after a certain delay +

+
+
+Clean cache +
+
+

+removes data files from the program’s internal cache +

+
+
+Quit +
+
+

+closes the program window and exits from memory +

+
+
+
+
+

Edit

+
+
+Preferences +
+
+

+opens the preferences window, which contains the following + commands +

+
+
+General tab +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+Offline checkbox +
+
+

+if selected keeps the program from connecting + to the internet +

+
+Update Freq +
+
+

+sets the timeout value for automatic updating +

+
+Initial site listbox +
+
+

+allows the user to select a default radar site + to jump to when the program loads +

+
+NEXRAD URL text box +
+
+

+allows the user to select a different server to + download Level-II NEXRAD data from +

+
+Debug level text box +
+
+

+allows the user to select what level of + debugging the program should conduct while + running (7 is recommended only for debugging) +

+
+
+
+Plugins tab +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+alert checkbox +
+
+

+allows the user to toggle the weather alerts +

+
+elev checkbox +
+
+

+allows the user to toggle terrain rendering +

+
+env checkbox +
+
+

+allows the user to toggle a blue atmosphere +

+
+map checkbox +
+
+

+allows the user to toggle the map overlays +

+
+radar checkbox +
+
+

+allows the user to toggle the radar data +

+
+sat checkbox +
+
+

+allows the user to toggle satellite ground images +

+
+test checkbox +
+
+

+used by the developers for debugging +

+
+
+
+
+
+
+
+

View

+
+ + + + + + + + + + + + +
+Zoom in +
+
+

+decreases the viewing area +

+
+Zoom out +
+
+

+increases the viewing area +

+
+Fullscreen +
+
+

+maximizes the window and only displays the button menu bar along + with the map and data viewing pane when the mouse is moved to the + edge of the screen +

+
+
+
+

Radar

+

The radar menu contains list of all the support NEXRAD radar sites sorted by +state. Selecting a site will zoom AWeather to that location.

+
+
+

Help

+
+ + + + + + + + + + + + +
+User Guide +
+
+

+displays this documentation of program operation and features +

+
+Man Page +
+
+

+displays a HTML version of the UNIX man page +

+
+About +
+
+

+contains current program version, copyright, development site, + credits and licensing information +

+
+
+
+
+
+

The button bar

+
+

The program button bar contains 6 options:

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+Magnifying glass with plus sign +
+
+

+decreases the viewing area +

+
+Magnifying glass with minus sign +
+
+

+increases the viewing area +

+
+Window icon with expanding arrows +
+
+

+Toggles between fullscreen and normal viewing modes +

+
+Plug button +
+
+

+toggles between offline and online program mode +

+
+Circular arrow button +
+
+

+reloads the current display +

+
+Wrench and screwdriver button +
+
+

+Opens the preferences window +

+
+
+
+
+

The date and time side bar

+
+

The date and time side bar resides on the right side of the program window, it contains:

+
    +
  • +

    +The date button, which reveals a calendar of the current month when clicked +

    +
  • +
  • +

    +The time button, which reveals a list of each hour when clicked +

    +
      +
    • +

      +Clicking on an hour will reveal a list of times in 5 minute intervals that + the user can select to load radar data from
      [Radar data can only be + loaded if it has been previously cached or is from a recent enough date and + can still be obtained from the NEXRAD server]
      +

      +
    • +
    +
  • +
+
+
+
+

The map and data viewing pane

+
+

On program startup and when zoomed far from the earth’s surface AWeather +displays a national radar composite image.

+

As the user zooms closer to the earth AWeather will automatically activate +nearby radar sites.

+

The radar data will be plotted on the map while the scan and product information +will be displayed at the bottom of the program.

+

All active radar sites will show as tabs while site’s available tilt and product +data will display to the right of the tab.

+

Simply click on a button to display that product/tilt in the map window.

+

An isosurface slider is shown below the product/tilt buttons. Slide the +selector to reveal the rendered isosurface structure of reflectivity data.

+

A color scale will automatically appear at the top left corner of the map window +corresponding to each available product.

+
+
+
+

Viewing severe weather alerts

+
+

When the alert plugin is enabled, AWeather will automatically shade each county +that is under a weather alert in a color corresponding to the type of alert.

+

For storm based warnings, AWeather will also draw a polygon representing the +warning area.

+

Individual alert types can be enabled and disabled by clicking on the toggle +button in the alert tab at the bottom of the screen.

+

To view more information about a particular alert, click on one the shaded +county or inside the polygon warning area in the viewing pane. This will bring +up the alert details dialog with a tab for each alert that is active for the +location that was clicked.

+

The alert dialog displays the alert title and valid time along with the text +descriptions provided by the weather service. Clicking the "Full Text" button +will open the full text of the alert in a web browser.

+
+
+
+

Panning, zooming and tilt functions

+
+

AWeather supports the use of the mouse and keyboard commands to change the map +window settings.

+
+
+Mouse usage +
+
+
+ + + + + + + + + + + + +
+Left click and drag +
+
+

+Pan the surface of the earth +

+
+Middle click and drag +
+
+

+Zoom toward or away from the earth +

+
+Right click and drag +
+
+

+Rotate the camera left or right +

+
+
+
+Keyboard shortcuts +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+h +
+
+

+Pan left +

+
+j +
+
+

+Pan down +

+
+k +
+
+

+Pan up +

+
+l +
+
+

+Pan right +

+
+i, +, Scroll Up +
+
+

+Zoom in +

+
+o, -, Scroll Down +
+
+

+Zoom out +

+
+J +
+
+

+Rotate camera toward earth +

+
+K +
+
+

+Rotate camera toward sky +

+
+H +
+
+

+Rotate camera left +

+
+L +
+
+

+Rotate camera right +

+
+w +
+
+

+Draw wire frame of the earth (for debugging) +

+
+q +
+
+

+Exit the program +

+
+Tab +
+
+

+Cycle through available plugins +

+
+Escape +
+
+

+Close the currently active dialog box +

+
+CTRL+R +
+
+

+Refresh the display +

+
+
+
+
+
+
+

Command Line Options

+
+

The following command line options can help advanced users take full advantage +of the AWeather program:

+

aweather [-hoaf] [-d level] [-s site] [-t time]

+
+
+-h, --help +
+
+

+ Show usage. +

+
+
+-d, --debug=level +
+
+

+ Change default log level*, a debug level ranges from 0 to 5. A debug + level of 5 is recommended only for debugging purposes. +

+
+
+-s, --site=site +
+
+

+ Set initial site. The site should be given as a WSR88D site code such + as KLSX. +

+
+
+-t, --time=time +
+
+

+ Set initial time. The time format should be provided in the + YYYY-MM-DD HH:MM format. +

+
+
+-o, --offline +
+
+

+ Run in offline mode, AWeather will not attempt to connect to the + internet to download radar files but will show the closest matching + cached file. +

+
+
+-a, --autoupdate +
+
+

+ Run in autoupdate mode, AWeather will periodically poll data servers + for updated information. +

+
+
+-f, --fullscreen +
+
+

+ Run in fullscreen mode, AWeather start up using the entire screen as he + main display area. Toolbars and side panels are hidden by default. +

+
+
+
+
+
+

Future Features

+
+

The author intends to develop additional features in the future as time and +conditions allow.

+

Some of these enhancements include:

+
    +
  • +

    +Vertical cross sections +

    +
  • +
  • +

    +Support for derived L3 data (storm relative motion, echo tops, composite + reflectivity, etc) +

    +
  • +
  • +

    +Additional data sources for surface data, etc +

    +
  • +
  • +

    +Animation support +

    +
  • +
  • +

    +API for radar algorithms +

    +
  • +
  • +

    +Additional features +

    +
  • +
+
+
+
+

+ + + diff -Nru aweather-0.6.1/docs/wsr88ddec.1 aweather-0.7/docs/wsr88ddec.1 --- aweather-0.6.1/docs/wsr88ddec.1 2011-11-18 08:24:29.000000000 +0000 +++ aweather-0.7/docs/wsr88ddec.1 2012-02-09 07:17:20.000000000 +0000 @@ -1,13 +1,22 @@ '\" t .\" Title: wsr88ddec -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 11/18/2011 +.\" Author: Andy Spencer +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 02/09/2012 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "WSR88DDEC" "1" "11/18/2011" "\ \&" "\ \&" +.TH "WSR88DDEC" "1" "02/09/2012" "\ \&" "\ \&" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -36,3 +45,9 @@ .SH "SEE ALSO" .sp aweather(1) +.SH "AUTHOR" +.PP +\fBAndy Spencer\fR <\&andy753421@gmail\&.com\&> +.RS 4 +Author. +.RE diff -Nru aweather-0.6.1/Makefile.am aweather-0.7/Makefile.am --- aweather-0.6.1/Makefile.am 2011-11-18 07:32:45.000000000 +0000 +++ aweather-0.7/Makefile.am 2012-02-09 07:01:04.000000000 +0000 @@ -9,25 +9,6 @@ test: all (cd src && make test) -build: all - export DESTDIR="`pwd`/build"; \ - make -C ../aweather-win32 install; \ - make -C ../grits-win32 install; \ - make -C ../rsl-win32 install; - find build -name '*.a' -delete - find build -name '*.la' -delete - rm -rf build/share/rsl/colors - rm -rf build/include - touch $@ - -installers: $(PACKAGE)-$(VERSION).exe $(PACKAGE)-$(VERSION)-gtk.exe - -$(PACKAGE)-$(VERSION).exe: build - makensis -DVERSION=$(VERSION) aweather.nsi - -$(PACKAGE)-$(VERSION)-gtk.exe: build - makensis -DVERSION=$(VERSION) -DUSE_GTK aweather.nsi - release: all dist @echo -en "\nRelease $(PACKAGE)-$(VERSION) (y/n): " @read ans && [ "$$ans" != "y" ] && exit 1 || exit 0 diff -Nru aweather-0.6.1/Makefile.in aweather-0.7/Makefile.in --- aweather-0.6.1/Makefile.in 2011-11-25 06:59:59.000000000 +0000 +++ aweather-0.7/Makefile.in 2012-02-15 05:49:30.000000000 +0000 @@ -121,6 +121,7 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ +DOTS = @DOTS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -131,9 +132,12 @@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ +GPSD_CFLAGS = @GPSD_CFLAGS@ +GPSD_LIBS = @GPSD_LIBS@ GREP = @GREP@ GRITS_CFLAGS = @GRITS_CFLAGS@ GRITS_LIBS = @GRITS_LIBS@ +HAVE_GPSD = @HAVE_GPSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -149,6 +153,8 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ +MAC_CFLAGS = @MAC_CFLAGS@ +MAC_LIBS = @MAC_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -734,25 +740,6 @@ test: all (cd src && make test) -build: all - export DESTDIR="`pwd`/build"; \ - make -C ../aweather-win32 install; \ - make -C ../grits-win32 install; \ - make -C ../rsl-win32 install; - find build -name '*.a' -delete - find build -name '*.la' -delete - rm -rf build/share/rsl/colors - rm -rf build/include - touch $@ - -installers: $(PACKAGE)-$(VERSION).exe $(PACKAGE)-$(VERSION)-gtk.exe - -$(PACKAGE)-$(VERSION).exe: build - makensis -DVERSION=$(VERSION) aweather.nsi - -$(PACKAGE)-$(VERSION)-gtk.exe: build - makensis -DVERSION=$(VERSION) -DUSE_GTK aweather.nsi - release: all dist @echo -en "\nRelease $(PACKAGE)-$(VERSION) (y/n): " @read ans && [ "$$ans" != "y" ] && exit 1 || exit 0 diff -Nru aweather-0.6.1/src/aweather-gui.c aweather-0.7/src/aweather-gui.c --- aweather-0.6.1/src/aweather-gui.c 2011-11-18 07:32:46.000000000 +0000 +++ aweather-0.7/src/aweather-gui.c 2012-02-12 07:05:42.000000000 +0000 @@ -128,10 +128,17 @@ cleancache_r(cache); } -G_MODULE_EXPORT void on_contents(GtkMenuItem *menu, AWeatherGui *self) +G_MODULE_EXPORT void on_help(GtkMenuItem *menu, AWeatherGui *self) { GError *err = NULL; - gchar *path = g_strdup(HTMLDIR "/aweather.html"); + const gchar *name = gtk_buildable_get_name(GTK_BUILDABLE(menu)); + gchar *page = g_str_has_suffix(name, "userguide") ? "userguide" : + g_str_has_suffix(name, "manpage") ? "aweather" : NULL; + if (page == NULL) { + g_warning("Unknown help page: %s", page); + return; + } + gchar *path = g_strdup_printf("%s/%s.html", HTMLDIR, page); g_strdelimit(path, "/", G_DIR_SEPARATOR); gchar *argv[] = {"xdg-open", path, NULL}; g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &err); @@ -180,7 +187,9 @@ GtkWidget *toolbar = aweather_gui_get_widget(self, "main_toolbar"); GtkWidget *sidebar = aweather_gui_get_widget(self, "main_sidebar"); GtkWidget *tabs = aweather_gui_get_widget(self, "main_tabs"); + static gboolean menushow = TRUE; // Toolbar can be always disabled if (gtk_toggle_action_get_active(action)) { + menushow = gtk_widget_get_visible(menu); gtk_window_fullscreen(GTK_WINDOW(self)); gtk_widget_hide(menu); _gtk_widget_autohide(toolbar, GTK_WIDGET(self->viewer), GTK_POS_TOP); @@ -188,7 +197,7 @@ _gtk_widget_autohide(tabs, GTK_WIDGET(self->viewer), GTK_POS_BOTTOM); } else { gtk_window_unfullscreen(GTK_WINDOW(self)); - gtk_widget_show(menu); + gtk_widget_set_visible(menu, menushow); _gtk_widget_autoshow(toolbar); _gtk_widget_autoshow(sidebar); _gtk_widget_autoshow(tabs); @@ -308,6 +317,14 @@ //} } +G_MODULE_EXPORT gboolean on_configure(AWeatherGui *self, GdkEventConfigure *config) +{ + g_debug("AWeatherGui: on_configure - %dx%d", config->width, config->height); + grits_prefs_set_integer(self->prefs, "aweather/width", config->width); + grits_prefs_set_integer(self->prefs, "aweather/height", config->height); + return FALSE; +} + /* Prefs callbacks */ G_MODULE_EXPORT void on_offline(GtkToggleAction *action, AWeatherGui *self) { @@ -389,7 +406,7 @@ static void menu_setup(AWeatherGui *self) { GtkWidget *menu = aweather_gui_get_widget(self, "main_menu_radar"); - GtkWidget *states, *state, *sites, *site; + GtkWidget *states=NULL, *state=NULL, *sites=NULL, *site=NULL; states = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), states); @@ -608,6 +625,12 @@ prefs_setup(self); icons_setup(self); + /* Default size */ + gint width = grits_prefs_get_integer(self->prefs, "aweather/width", NULL); + gint height = grits_prefs_get_integer(self->prefs, "aweather/height", NULL); + if (width && height) + gtk_window_set_default_size(GTK_WINDOW(self), width, height); + /* Connect signals */ gtk_builder_connect_signals(self->builder, self); g_signal_connect(self, "key-press-event", @@ -644,16 +667,19 @@ g_debug("AWeatherGui: dispose"); AWeatherGui *self = AWEATHER_GUI(_self); if (self->plugins) { - grits_plugins_free(self->plugins); + GritsPlugins *plugins = self->plugins; self->plugins = NULL; + grits_plugins_free(plugins); } if (self->builder) { - g_object_unref(self->builder); + GtkBuilder *builder = self->builder; self->builder = NULL; + g_object_unref(builder); } if (self->prefs) { - g_object_unref(self->prefs); + GritsPrefs *prefs = self->prefs; self->prefs = NULL; + g_object_unref(prefs); } G_OBJECT_CLASS(aweather_gui_parent_class)->dispose(_self); } diff -Nru aweather-0.6.1/src/main.c aweather-0.7/src/main.c --- aweather-0.6.1/src/main.c 2011-11-24 10:41:48.000000000 +0000 +++ aweather-0.7/src/main.c 2012-02-09 07:01:04.000000000 +0000 @@ -21,6 +21,10 @@ #include #include +#ifdef MAC_INTEGRATION +#include +#endif + #include #include "aweather-gui.h" @@ -47,7 +51,7 @@ } } -static void xdg_open(GtkLinkButton *button, const gchar *link, gpointer user_data) +static void xdg_open(GtkWidget *widget, const gchar *link, gpointer user_data) { gchar *argv[] = {"xdg-open", (gchar*)link, NULL}; g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); @@ -64,19 +68,23 @@ /* Set time * Do this before setting setting location * so that it doesn't refresh twice */ - int year, mon, day, hour, min; - sscanf(time, "%d-%d-%d %d:%d", &year, &mon, &day, &hour, &min); - time_t sec = mktime(&(struct tm){0, year-1900, mon-1, day, hour, min}); - if (sec > 0) - grits_viewer_set_time(gui->viewer, sec); - g_debug("date = [%s] == %lu\n", time, sec); + if (time) { + int year, mon, day, hour, min; + sscanf(time, "%d-%d-%d %d:%d", &year, &mon, &day, &hour, &min); + time_t sec = mktime(&(struct tm){0, year-1900, mon-1, day, hour, min}); + if (sec > 0) + grits_viewer_set_time(gui->viewer, sec); + g_debug("date = [%s] == %lu\n", time, sec); + } /* Set location */ - for (city_t *city = cities; city->type; city++) { - if (city->type == LOCATION_CITY && g_str_equal(city->code, site)) { - grits_viewer_set_location(gui->viewer, - city->pos.lat, city->pos.lon, EARTH_R/35); - break; + if (site) { + for (city_t *city = cities; city->type; city++) { + if (city->type == LOCATION_CITY && g_str_equal(city->code, site)) { + grits_viewer_set_location(gui->viewer, + city->pos.lat, city->pos.lon, EARTH_R/35); + break; + } } } } @@ -87,6 +95,19 @@ gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(object), enabled); } +static void setup_mac(AWeatherGui *gui) +{ +#ifdef MAC_INTEGRATION + GtkWidget *menu = aweather_gui_get_widget(gui, "main_menu"); + GtkOSXApplication *app = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL); + gtk_widget_hide(menu); + gtk_osxapplication_set_menu_bar(app, GTK_MENU_SHELL(menu)); + gtk_osxapplication_set_use_quartz_accelerators(app, TRUE); + gtk_osxapplication_ready(app); + //gtk_osxapplication_sync_menubar(app) +#endif +} + /******** * Main * ********/ @@ -94,8 +115,8 @@ { /* Defaults */ gint debug = 2; // G_LOG_LEVEL_WARNING - gchar *site = ""; - gchar *time = ""; + gchar *site = NULL; + gchar *time = NULL; gboolean autoupdate = FALSE; gboolean offline = FALSE; gboolean fullscreen = FALSE; @@ -118,6 +139,9 @@ {NULL} }; + /* All times in UTC */ + g_setenv("TZ", "UTC", TRUE); + /* Init */ GError *error = NULL; g_thread_init(NULL); @@ -129,7 +153,9 @@ } /* Use external handler for link buttons */ - gtk_link_button_set_uri_hook(xdg_open, NULL, NULL); + gtk_link_button_set_uri_hook((GtkLinkButtonUriFunc)xdg_open, NULL, NULL); + gtk_about_dialog_set_url_hook((GtkAboutDialogActivateLinkFunc)xdg_open, NULL, NULL); + gtk_about_dialog_set_email_hook((GtkAboutDialogActivateLinkFunc)xdg_open, NULL, NULL); /* Setup debug level for aweather_gui_new */ g_log_set_handler(NULL, G_LOG_LEVEL_MASK, log_func, NULL); @@ -173,6 +199,7 @@ /* Done with init, show gui */ gtk_widget_show_all(GTK_WIDGET(gui)); set_toggle_action(gui, "fullscreen", fullscreen); // Resest widget hiding + setup_mac(gui); // done after show_all gtk_main(); gdk_threads_leave(); gdk_display_close(gdk_display_get_default()); diff -Nru aweather-0.6.1/src/Makefile.am aweather-0.7/src/Makefile.am --- aweather-0.6.1/src/Makefile.am 2011-11-24 10:41:48.000000000 +0000 +++ aweather-0.7/src/Makefile.am 2012-02-09 07:01:04.000000000 +0000 @@ -1,26 +1,27 @@ SUBDIRS = plugins AM_CFLAGS = -Wall --std=gnu99 $(GRITS_CFLAGS) -AM_LDFLAGS = -Wl,--export-dynamic \ - -Wl,--as-needed -Wl,--no-undefined +AM_LDFLAGS = -Wl,--export-dynamic -Wl,--no-undefined + +if !SYS_MAC +AM_LDFLAGS += -Wl,--as-needed +endif bin_PROGRAMS = aweather wsr88ddec aweather_SOURCES = main.c \ aweather-gui.c aweather-gui.h \ aweather-location.c aweather-location.h aweather_CPPFLAGS = \ - -DHTMLDIR="\"$(dots)$(htmldir)\"" \ - -DICONDIR="\"$(dots)$(datadir)/icons\"" \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ - -DPLUGINSDIR="\"$(dots)$(pkglibdir)\"" + -DHTMLDIR="\"$(DOTS)$(htmldir)\"" \ + -DICONDIR="\"$(DOTS)$(datadir)/icons\"" \ + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" \ + -DPLUGINSDIR="\"$(DOTS)$(pkglibdir)\"" aweather_LDADD = $(GRITS_LIBS) wsr88ddec = wsr88ddec.c wsr88ddec_LDADD = $(GLIB_LIBS) -lbz2 -if WIN32 -dots = .. - +if SYS_WIN wsr88ddec_LDFLAGS = -mwindows aweather_SOURCES += resource.rc @@ -33,6 +34,11 @@ aweather_dbg_LDADD = $(aweather_LDADD) endif +if SYS_MAC +aweather_CPPFLAGS += $(MAC_CFLAGS) +aweather_LDADD += $(MAC_LIBS) +endif + .rc.o: ../data/icons/48x48/aweather.ico $(RC) -o $@ $< @@ -40,7 +46,8 @@ MAINTAINERCLEANFILES = Makefile.in test: all - .libs/aweather -o -d 7 -s KOUN -t '2011-02-01 10:01Z' + .libs/aweather -o -d 5 +#.libs/aweather -o -d 7 -s KOUN -t '2011-02-01 10:01Z' #.libs/aweather -o -d 7 -s KLSX -t '2010-12-31 17:56Z' #.libs/aweather -o -d 7 -s KDGX -t '2010-12-31 23:10Z' #.libs/aweather -o -d 7 -s KDGX -t '1999-05-03 23:51Z' diff -Nru aweather-0.6.1/src/Makefile.in aweather-0.7/src/Makefile.in --- aweather-0.6.1/src/Makefile.in 2011-11-25 06:59:59.000000000 +0000 +++ aweather-0.7/src/Makefile.in 2012-02-15 05:49:29.000000000 +0000 @@ -34,10 +34,13 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@SYS_MAC_FALSE@am__append_1 = -Wl,--as-needed bin_PROGRAMS = aweather$(EXEEXT) wsr88ddec$(EXEEXT) $(am__EXEEXT_1) -@WIN32_TRUE@am__append_1 = resource.rc -@WIN32_TRUE@am__append_2 = -I$(top_srcdir)/lib -@WIN32_TRUE@am__append_3 = aweather-dbg +@SYS_WIN_TRUE@am__append_2 = resource.rc +@SYS_WIN_TRUE@am__append_3 = -I$(top_srcdir)/lib +@SYS_WIN_TRUE@am__append_4 = aweather-dbg +@SYS_MAC_TRUE@am__append_5 = $(MAC_CFLAGS) +@SYS_MAC_TRUE@am__append_6 = $(MAC_LIBS) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/resource.rc.in @@ -52,18 +55,19 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = resource.rc CONFIG_CLEAN_VPATH_FILES = -@WIN32_TRUE@am__EXEEXT_1 = aweather-dbg$(EXEEXT) +@SYS_WIN_TRUE@am__EXEEXT_1 = aweather-dbg$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__aweather_SOURCES_DIST = main.c aweather-gui.c aweather-gui.h \ aweather-location.c aweather-location.h resource.rc -@WIN32_TRUE@am__objects_1 = resource.$(OBJEXT) +@SYS_WIN_TRUE@am__objects_1 = resource.$(OBJEXT) am_aweather_OBJECTS = aweather-main.$(OBJEXT) \ aweather-aweather-gui.$(OBJEXT) \ aweather-aweather-location.$(OBJEXT) $(am__objects_1) aweather_OBJECTS = $(am_aweather_OBJECTS) am__DEPENDENCIES_1 = -aweather_DEPENDENCIES = $(am__DEPENDENCIES_1) +@SYS_MAC_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +aweather_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) aweather_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(aweather_LDFLAGS) \ $(LDFLAGS) -o $@ @@ -72,10 +76,10 @@ am__objects_2 = aweather_dbg-main.$(OBJEXT) \ aweather_dbg-aweather-gui.$(OBJEXT) \ aweather_dbg-aweather-location.$(OBJEXT) $(am__objects_1) -@WIN32_TRUE@am_aweather_dbg_OBJECTS = $(am__objects_2) +@SYS_WIN_TRUE@am_aweather_dbg_OBJECTS = $(am__objects_2) aweather_dbg_OBJECTS = $(am_aweather_dbg_OBJECTS) -am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -@WIN32_TRUE@aweather_dbg_DEPENDENCIES = $(am__DEPENDENCIES_2) +am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +@SYS_WIN_TRUE@aweather_dbg_DEPENDENCIES = $(am__DEPENDENCIES_3) wsr88ddec_SOURCES = wsr88ddec.c wsr88ddec_OBJECTS = wsr88ddec.$(OBJEXT) wsr88ddec_DEPENDENCIES = $(am__DEPENDENCIES_1) @@ -153,6 +157,7 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ +DOTS = @DOTS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -163,9 +168,12 @@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ +GPSD_CFLAGS = @GPSD_CFLAGS@ +GPSD_LIBS = @GPSD_LIBS@ GREP = @GREP@ GRITS_CFLAGS = @GRITS_CFLAGS@ GRITS_LIBS = @GRITS_LIBS@ +HAVE_GPSD = @HAVE_GPSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -181,6 +189,8 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ +MAC_CFLAGS = @MAC_CFLAGS@ +MAC_LIBS = @MAC_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -263,24 +273,22 @@ top_srcdir = @top_srcdir@ SUBDIRS = plugins AM_CFLAGS = -Wall --std=gnu99 $(GRITS_CFLAGS) -AM_LDFLAGS = -Wl,--export-dynamic \ - -Wl,--as-needed -Wl,--no-undefined - +AM_LDFLAGS = -Wl,--export-dynamic -Wl,--no-undefined $(am__append_1) aweather_SOURCES = main.c aweather-gui.c aweather-gui.h \ - aweather-location.c aweather-location.h $(am__append_1) -aweather_CPPFLAGS = -DHTMLDIR="\"$(dots)$(htmldir)\"" \ - -DICONDIR="\"$(dots)$(datadir)/icons\"" \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ - -DPLUGINSDIR="\"$(dots)$(pkglibdir)\"" $(am__append_2) -aweather_LDADD = $(GRITS_LIBS) + aweather-location.c aweather-location.h $(am__append_2) +aweather_CPPFLAGS = -DHTMLDIR="\"$(DOTS)$(htmldir)\"" \ + -DICONDIR="\"$(DOTS)$(datadir)/icons\"" \ + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" \ + -DPLUGINSDIR="\"$(DOTS)$(pkglibdir)\"" $(am__append_3) \ + $(am__append_5) +aweather_LDADD = $(GRITS_LIBS) $(am__append_6) wsr88ddec = wsr88ddec.c wsr88ddec_LDADD = $(GLIB_LIBS) -lbz2 -@WIN32_TRUE@dots = .. -@WIN32_TRUE@wsr88ddec_LDFLAGS = -mwindows -@WIN32_TRUE@aweather_LDFLAGS = -mwindows -@WIN32_TRUE@aweather_dbg_SOURCES = $(aweather_SOURCES) -@WIN32_TRUE@aweather_dbg_CPPFLAGS = $(aweather_CPPFLAGS) -@WIN32_TRUE@aweather_dbg_LDADD = $(aweather_LDADD) +@SYS_WIN_TRUE@wsr88ddec_LDFLAGS = -mwindows +@SYS_WIN_TRUE@aweather_LDFLAGS = -mwindows +@SYS_WIN_TRUE@aweather_dbg_SOURCES = $(aweather_SOURCES) +@SYS_WIN_TRUE@aweather_dbg_CPPFLAGS = $(aweather_CPPFLAGS) +@SYS_WIN_TRUE@aweather_dbg_LDADD = $(aweather_LDADD) CLEANFILES = gmon.out valgrind.out MAINTAINERCLEANFILES = Makefile.in all: all-recursive @@ -819,7 +827,8 @@ $(RC) -o $@ $< test: all - .libs/aweather -o -d 7 -s KOUN -t '2011-02-01 10:01Z' + .libs/aweather -o -d 5 +#.libs/aweather -o -d 7 -s KOUN -t '2011-02-01 10:01Z' #.libs/aweather -o -d 7 -s KLSX -t '2010-12-31 17:56Z' #.libs/aweather -o -d 7 -s KDGX -t '2010-12-31 23:10Z' #.libs/aweather -o -d 7 -s KDGX -t '1999-05-03 23:51Z' diff -Nru aweather-0.6.1/src/plugins/alert.c aweather-0.7/src/plugins/alert.c --- aweather-0.6.1/src/plugins/alert.c 2011-11-24 10:41:48.000000000 +0000 +++ aweather-0.7/src/plugins/alert.c 2012-02-12 07:05:42.000000000 +0000 @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -26,6 +25,7 @@ #include "alert-info.h" #define MSG_INDEX "http://alerts.weather.gov/cap/us.php?x=0" +#define CONFIG_HEIGHT 3 /* Format for single cap alert: * "http://alerts.weather.gov/cap/wwacapget.php?x=" @@ -549,7 +549,7 @@ /* Update polygons */ static void _load_common(GritsPluginAlert *alert, AlertMsg *msg, GritsPoly *poly, - float color, float border, int width) + float color, float border, int width, gchar *hidden) { g_object_set_data(G_OBJECT(poly), "msg", msg); poly->color[0] = poly->border[0] = (float)msg->info->color[0] / 256; @@ -559,7 +559,8 @@ poly->border[3] = border; poly->width = width; GRITS_OBJECT(poly)->lod = 0; - GRITS_OBJECT(poly)->hidden = msg->info->hidden; + GRITS_OBJECT(poly)->hidden = msg->info->hidden || + grits_prefs_get_boolean(alert->prefs, hidden, NULL); g_signal_connect(poly, "enter", G_CALLBACK(_alert_enter), alert); g_signal_connect(poly, "leave", G_CALLBACK(_alert_leave), alert); g_signal_connect(poly, "clicked", G_CALLBACK(_show_details), alert); @@ -573,8 +574,8 @@ msg_load_cap(alert->http, msg); GritsPoly *poly = grits_poly_parse(msg->polygon, "\t", " ", ","); - _load_common(alert, msg, poly, 0, 1, 3); - grits_viewer_add(alert->viewer, GRITS_OBJECT(poly), GRITS_LEVEL_WORLD+2, TRUE); + _load_common(alert, msg, poly, 0, 1, 3, "alert/hide_storm_based"); + grits_viewer_add(alert->viewer, GRITS_OBJECT(poly), GRITS_LEVEL_WORLD+4, FALSE); return poly; } @@ -599,7 +600,7 @@ /* Create new county based warning */ GritsPoly *poly = fips_combine(counties); - _load_common(alert, msg, poly, 0.25, 0.25, 0); + _load_common(alert, msg, poly, 0.25, 0.25, 0, "alert/hide_county_based"); grits_viewer_add(alert->viewer, GRITS_OBJECT(poly), GRITS_LEVEL_WORLD+1, FALSE); g_list_free(counties); @@ -607,24 +608,40 @@ } /* Update buttons */ -static void _button_click(GtkToggleButton *button, gpointer _alert) +static gboolean _show_hide(GtkToggleButton *button, GritsPluginAlert *alert) { - g_debug("GritsPluginAlert: _button_click"); - GritsPluginAlert *alert = _alert; + g_debug("GritsPluginAlert: _show_hide - alert=%p, config=%p", alert, alert->config); + + /* Check if we've clicked a alert type button */ AlertInfo *info = g_object_get_data(G_OBJECT(button), "info"); - info->hidden = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)); + if (info) + info->hidden = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)); + + /* Update county/storm based hiding */ + GtkWidget *ctoggle = g_object_get_data(G_OBJECT(alert->config), "county_based"); + GtkWidget *stoggle = g_object_get_data(G_OBJECT(alert->config), "storm_based"); + + gboolean cshow = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ctoggle)); + gboolean sshow = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(stoggle)); + + grits_prefs_set_boolean(alert->prefs, "alert/hide_county_based", !cshow); + grits_prefs_set_boolean(alert->prefs, "alert/hide_storm_based", !sshow); - /* Show/hide each polygons */ + /* Show/hide each message */ for (GList *cur = alert->msgs; cur; cur = cur->next) { AlertMsg *msg = cur->data; - if (msg->info != info) - continue; - if (msg->county_based) GRITS_OBJECT(msg->county_based)->hidden = info->hidden; - if (msg->storm_based) GRITS_OBJECT(msg->storm_based)->hidden = info->hidden; + gboolean hide = msg->info->hidden; + if (msg->county_based) + GRITS_OBJECT(msg->county_based)->hidden = !cshow || hide; + if (msg->storm_based) + GRITS_OBJECT(msg->storm_based)->hidden = !sshow || hide; } + gtk_widget_queue_draw(GTK_WIDGET(alert->viewer)); + return TRUE; } + static GtkWidget *_button_new(AlertInfo *info) { g_debug("GritsPluginAlert: _button_new - %s", info->title); @@ -685,18 +702,15 @@ GtkWidget *table = g_object_get_data(G_OBJECT(alerts), alert_info[i].category); GList *kids = gtk_container_get_children(GTK_CONTAINER(table)); - gint nkids = g_list_length(kids); - guint rows, cols; - gtk_table_get_size(GTK_TABLE(table), &rows, &cols); - gint x = nkids % cols; - gint y = nkids / cols; + gint nkids = g_list_length(kids); + gint x = nkids / CONFIG_HEIGHT; + gint y = nkids % CONFIG_HEIGHT; g_list_free(kids); GtkWidget *button = _button_new(&alert_info[i]); gtk_table_attach(GTK_TABLE(table), button, x, x+1, y, y+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0); - g_signal_connect(button, "clicked", - G_CALLBACK(_button_click), alert); + g_signal_connect(button, "clicked", G_CALLBACK(_show_hide), alert); } /* Set time widget */ @@ -718,6 +732,13 @@ (a->info->prior == b->info->prior) ? 0 : 1; } +static gboolean _update_end(gpointer _alert) +{ + GritsPluginAlert *alert = _alert; + gtk_widget_queue_draw(GTK_WIDGET(alert->viewer)); + return FALSE; +} + static void _update_warnings(GritsPluginAlert *alert, GList *old) { g_debug("GritsPluginAlert: _update_warnings"); @@ -737,11 +758,17 @@ } /* Add new messages */ + /* Load counties first since it does not require network access */ for (GList *cur = alert->msgs; cur; cur = cur->next) { AlertMsg *msg = cur->data; msg->county_based = _load_county_based(alert, msg); + } + g_idle_add(_update_end, alert); + for (GList *cur = alert->msgs; cur; cur = cur->next) { + AlertMsg *msg = cur->data; msg->storm_based = _load_storm_based(alert, msg); } + g_idle_add(_update_end, alert); g_debug("GritsPluginAlert: _load_warnings - end"); } @@ -764,7 +791,6 @@ g_list_foreach(old, (GFunc)msg_free, NULL); g_list_free(old); - gtk_widget_queue_draw(GTK_WIDGET(alert->viewer)); g_debug("GritsPluginAlert: _update - end"); } @@ -774,27 +800,34 @@ } /* Init helpers */ -static GtkWidget *_make_config(void) +static GtkWidget *_make_config(GritsPluginAlert *alert) { GtkWidget *config = gtk_vbox_new(FALSE, 0); /* Setup tools area */ GtkWidget *tools = gtk_hbox_new(FALSE, 10); GtkWidget *updated = gtk_label_new(" Loading..."); + GtkWidget *storm_based = gtk_toggle_button_new_with_label("Storm based"); + GtkWidget *county_based = gtk_toggle_button_new_with_label("County based"); gtk_label_set_use_markup(GTK_LABEL(updated), TRUE); - gtk_box_pack_start(GTK_BOX(tools), updated, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(tools), updated, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX(tools), storm_based, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX(tools), county_based, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(config), tools, FALSE, FALSE, 0); - g_object_set_data(G_OBJECT(config), "updated", updated); + g_object_set_data(G_OBJECT(config), "updated", updated); + g_object_set_data(G_OBJECT(config), "storm_based", storm_based); + g_object_set_data(G_OBJECT(config), "county_based", county_based); + g_signal_connect(storm_based, "toggled", G_CALLBACK(_show_hide), alert); + g_signal_connect(county_based, "toggled", G_CALLBACK(_show_hide), alert); /* Setup alerts */ gchar *labels[] = {"Warnings", "Watches", "Advisories", "Other"}; gchar *keys[] = {"warning", "watch", "advisory", "other"}; - gint cols[] = {2, 2, 3, 2}; GtkWidget *alerts = gtk_hbox_new(FALSE, 10); for (int i = 0; i < G_N_ELEMENTS(labels); i++) { GtkWidget *frame = gtk_frame_new(labels[i]); - GtkWidget *table = gtk_table_new(1, cols[i], TRUE); + GtkWidget *table = gtk_table_new(1, 1, TRUE); GtkWidget *label = gtk_frame_get_label_widget(GTK_FRAME(frame)); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE); @@ -871,6 +904,13 @@ for (GList *cur = alert->states; cur; cur = cur->next) grits_viewer_add(viewer, cur->data, GRITS_LEVEL_WORLD+1, FALSE); + gboolean chide = grits_prefs_get_boolean(alert->prefs, "alert/hide_county_based", NULL); + gboolean shide = grits_prefs_get_boolean(alert->prefs, "alert/hide_storm_based", NULL); + GtkWidget *ctoggle = g_object_get_data(G_OBJECT(alert->config), "county_based"); + GtkWidget *stoggle = g_object_get_data(G_OBJECT(alert->config), "storm_based"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctoggle), !chide); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stoggle), !shide); + _on_update(alert); return alert; } @@ -897,8 +937,8 @@ { g_debug("GritsPluginAlert: init"); /* Set defaults */ - alert->threads = g_thread_pool_new(_update, alert, 1, TRUE, NULL); - alert->config = _make_config(); + alert->threads = g_thread_pool_new(_update, alert, 1, FALSE, NULL); + alert->config = _make_config(alert); alert->http = grits_http_new(G_DIR_SEPARATOR_S "alerts" G_DIR_SEPARATOR_S "cap" G_DIR_SEPARATOR_S); diff -Nru aweather-0.6.1/src/plugins/gps-plugin.c aweather-0.7/src/plugins/gps-plugin.c --- aweather-0.6.1/src/plugins/gps-plugin.c 1970-01-01 00:00:00.000000000 +0000 +++ aweather-0.7/src/plugins/gps-plugin.c 2012-02-14 20:19:55.000000000 +0000 @@ -0,0 +1,972 @@ +/* + * Copyright (C) 2012 Adam Boggs + * + * 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 3 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, see . + */ + +/* TODO: + * If gpsd connection fails, try to connect again periodically. + * If gps stops sending data there should be an indication that it's stale. + */ + +#define _XOPEN_SOURCE +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "gps-plugin.h" +#include "level2.h" +#include "../aweather-location.h" + +/* interval to update map with new gps data in seconds. */ +#define GPS_UPDATE_INTERVAL (2) + +/* Filename and search path to use for gps marker, should be configurable */ +#define GPS_MARKER_ICON_PATH ".:" PKGDATADIR +#define GPS_MARKER_ICON "arrow.png" + +/* number of track points per group and number of groups to maintain */ +#define GPS_TRACK_POINTS (256) +#define GPS_TRACK_GROUPS (16) +#define GPS_TRACK_POINTS_FACTOR (1.5) + +/* interval to update log file in seconds (default value for slider) */ +#define GPS_LOG_DEFAULT_UPDATE_INTERVAL (30) +#define GPS_LOG_EXT "csv" + +/* For updating the status bar conveniently */ +#define GPS_STATUSBAR_CONTEXT "GPS" + +#if 0 +#define GPS_STATUS(gps, format, args...) \ + do { \ + gchar *buf = g_strdup_printf(format, ##args); \ + gtk_statusbar_push(GTK_STATUSBAR(gps->status_bar), \ + gtk_statusbar_get_context_id( \ + GTK_STATUSBAR(gps->status_bar), \ + GPS_STATUSBAR_CONTEXT), \ + buf); \ + } while (0) +#endif + +#define GPS_STATUS(gps, format, args...) \ + do { \ + gchar *buf = g_strdup_printf(format, ##args); \ + g_debug("STATUS: %s", buf); \ + } while (0) + + +/******************** + * Helper functions * + ********************/ + +/* Find a readable file in a colon delimeted path */ +static gchar *find_path(const gchar *path, const gchar *filename) +{ + gchar *end_ptr, *fullpath; + + end_ptr = (gchar *)path; + + /* find first : */ + while (*end_ptr != ':' && *end_ptr != '\0') + end_ptr++; + fullpath = g_strdup_printf("%.*s/%s", (int)(end_ptr-path), path, + filename); + g_debug("GritsPluginGps: find_path - searching %s", fullpath); + if (access(fullpath, R_OK) == 0) { + g_debug("GritsPluginGps: find_path - found %s", fullpath); + return fullpath; /* caller frees */ + } + + g_free(fullpath); + /* recurse */ + if (*end_ptr == '\0') { + return NULL; + } else { + return find_path(end_ptr + 1, filename); + } +} + + +/******************** + * GPS Status Table * + ********************/ + +static gchar *gps_get_status(struct gps_data_t *gps_data) +{ + gchar *status_color; + gchar *status_text; + + switch (gps_data->fix.mode) { + case MODE_NOT_SEEN: + status_color = "red"; + status_text = "No Signal"; + break; + case MODE_NO_FIX: + status_color = "red"; + status_text = "No Fix"; + break; + case MODE_2D: + status_color = "yellow"; + status_text = "2D Mode"; + break; + case MODE_3D: + status_color = "green"; + status_text = "3D Mode"; + break; + default: + status_color = "black"; + status_text = "Unknown"; + break; + } + return g_strdup_printf("%s", + status_color, status_text); +} + +#if 0 +static gchar *gps_get_online(struct gps_data_t *gps_data) +{ + gchar *status_str; + gchar *online_str; + + if (gps_data->online == -1.0) { + online_str = "Offline"; + } else { + online_str = "Online"; + } + + switch (gps_data->status) { + case 0: + status_str = "No Fix"; + break; + case 1: + status_str = "Fix Acquired"; + break; + case 2: + status_str = "DGPS Fix"; + break; + default: + status_str = "Unknown Status"; + break; + } + + return g_strdup_printf("%lf,%s,%s", gps_data->online, online_str, status_str); +} +#endif + +static gchar *gps_get_latitude(struct gps_data_t *gps_data) +{ + return g_strdup_printf("%10.4f", gps_data->fix.latitude); +} + +static gchar *gps_get_longitude(struct gps_data_t *gps_data) +{ + return g_strdup_printf("%10.4f", gps_data->fix.longitude); +} + +static gchar *gps_get_elevation(struct gps_data_t *gps_data) +{ + /* XXX Make units (m/ft) settable */ + return g_strdup_printf("%5.0lf %4s", + (gps_data->fix.altitude * METERS_TO_FEET), "ft"); +} + +static gchar *gps_get_heading(struct gps_data_t *gps_data) +{ + /* XXX Make units (m/ft) settable */ + return g_strdup_printf("%5.0lf %4s", gps_data->fix.track, "deg"); +} + +static gchar *gps_get_speed(struct gps_data_t *gps_data) +{ + /* XXX Make units (m/ft) settable */ + return g_strdup_printf("%5.0f %4s", + (gps_data->fix.speed*3600.0*METERS_TO_FEET/5280.0), "mph"); +} + +struct { + const gchar *label; + const gchar *initial_val; + gchar *(*get_data)(struct gps_data_t *); + guint font_size; + GtkWidget *label_widget; + GtkWidget *value_widget; +} gps_table[] = { + {"Status:", "No Data", gps_get_status, 14, NULL, NULL}, +// {"Online:", "No Data", gps_get_online, 14, NULL, NULL}, + {"Latitude:", "No Data", gps_get_latitude, 14, NULL, NULL}, + {"Longitude:", "No Data", gps_get_longitude, 14, NULL, NULL}, + {"Elevation:", "No Data", gps_get_elevation, 14, NULL, NULL}, + {"Heading:", "No Data", gps_get_heading, 14, NULL, NULL}, + {"Speed:", "No Data", gps_get_speed, 14, NULL, NULL}, +}; + + +/****************** + * Track handling * + ******************/ + +static void gps_track_init(GpsTrack *track) +{ + /* Save a spot at the end for the NULL termination */ + track->points = (gpointer)g_new0(double*, GPS_TRACK_GROUPS + 1); + track->cur_point = 0; + track->cur_group = 0; + track->num_points = 1; /* starts at 1 so realloc logic works */ + track->line = NULL; +} + +static void gps_track_clear(GpsTrack *track) +{ + gint pi; + for (pi = 0; pi < GPS_TRACK_GROUPS; pi++) { + if (track->points[pi] != NULL) { + g_free(track->points[pi]); + track->points[pi] = NULL; + } + } + track->cur_point = 0; + track->cur_group = 0; + track->num_points = 1; /* starts at 1 so realloc logic works */ +} + +static void gps_track_free(GpsTrack *track) +{ + gps_track_clear(track); + g_free(track->points); +} + +/* add a new track group (points in a track group are connected, and + * separated from points in other track groups). */ +static void gps_track_group_incr(GpsTrack *track) +{ + gdouble (**points)[3] = track->points; /* for simplicity */ + + /* Just return if they increment it again before any points have + * been added. + */ + if (points[track->cur_group] == NULL) { + return; + } + + g_debug("GritsPluginGps: track_group_incr - track group %u->%u.", + track->cur_group, track->cur_group + 1); + + track->cur_group++; + track->cur_point = 0; + track->num_points = 1; /* starts at 1 so realloc logic works */ + + if (track->cur_group >= GPS_TRACK_GROUPS) { + g_debug("GritsPluginGps: track_group_incr - track group %u " + "is at max %u, shifting groups", + track->cur_group, GPS_TRACK_GROUPS); + + /* Free the oldest one which falls off the end */ + g_free(points[0]); + + /* shift the rest down, last one should be NULL already */ + /* note we alloc GPS_TRACK_GROUPS+1 */ + for (int pi = 0; pi < GPS_TRACK_GROUPS; pi++) { + points[pi] = points[pi+1]; + } + + /* always write into the last group */ + track->cur_group = GPS_TRACK_GROUPS - 1; + } +} + +static void gps_track_add_point(GpsTrack *track, + gdouble lat, gdouble lon, gdouble elevation) +{ + gdouble (**points)[3] = track->points; /* for simplicity */ + + g_debug("GritsPluginGps: track_add_point"); + + g_assert(track->cur_group < GPS_TRACK_GROUPS && + (track->cur_point <= track->num_points)); + + /* resize/allocate the point group if the current one is full */ + if (track->cur_point >= track->num_points - 1) { + guint new_size = track->num_points == 1 ? + GPS_TRACK_POINTS : + track->num_points * GPS_TRACK_POINTS_FACTOR; + g_debug("GritsPluginGps: track_add_point - reallocating points " + "array from %u points to %u points.\n", + track->num_points, new_size); + points[track->cur_group] = (gpointer)g_renew(gdouble, + points[track->cur_group], 3*(new_size+1)); + track->num_points = new_size; + } + + g_assert(points[track->cur_group] != NULL); + + /* Add the coordinate */ + lle2xyz(lat, lon, elevation, + &points[track->cur_group][track->cur_point][0], + &points[track->cur_group][track->cur_point][1], + &points[track->cur_group][track->cur_point][2]); + + track->cur_point++; + + /* make sure last point is always 0s so the line drawing stops. */ + points[track->cur_group][track->cur_point][0] = 0.0; + points[track->cur_group][track->cur_point][1] = 0.0; + points[track->cur_group][track->cur_point][2] = 0.0; +} + + +/***************** + * Track Logging * + *****************/ + +static gchar *gps_get_date_string(double gps_time) +{ + static gchar buf[256]; + time_t int_time = (time_t)gps_time; + struct tm tm_time; + + gmtime_r(&int_time, &tm_time); + + snprintf(buf, sizeof(buf), "%04d-%02d-%02d", + tm_time.tm_year+1900, tm_time.tm_mon+1, tm_time.tm_mday); + + return buf; +} + +static gchar *gps_get_time_string(time_t gps_time) +{ + static gchar buf[256]; + time_t int_time = (time_t)gps_time; + struct tm tm_time; + + gmtime_r(&int_time, &tm_time); + + snprintf(buf, sizeof(buf), "%02d:%02d:%02dZ", + tm_time.tm_hour, tm_time.tm_min, tm_time.tm_sec); + + return buf; +} + +static gboolean gps_write_log(gpointer data) +{ + GritsPluginGps *gps = (GritsPluginGps *)data; + struct gps_data_t *gps_data = &gps->gps_data; + gchar buf[256]; + gchar filename[256]; + gint fd; + gboolean new_file = FALSE; + + if (gps_data == NULL) { + g_warning("Skipped write to GPS log file: " + "can not get GPS coordinates."); + GPS_STATUS(gps, "Skipped write to GPS log file: " + "can not get GPS coordinates."); + return TRUE; + } + + /* get filename from text entry box. If empty, generate a name from + * the date and time and set it. */ + if (strlen(gtk_entry_get_text( + GTK_ENTRY(gps->ui.gps_log_filename_entry))) == 0) { + snprintf(filename, sizeof(filename), + "%sT%s.%s", + gps_get_date_string(gps->gps_data.fix.time), + gps_get_time_string(gps->gps_data.fix.time), + GPS_LOG_EXT); + gtk_entry_set_text(GTK_ENTRY(gps->ui.gps_log_filename_entry), + filename); + } + + strncpy(filename, + gtk_entry_get_text(GTK_ENTRY(gps->ui.gps_log_filename_entry)), + sizeof(filename)); + + if (!g_file_test(filename, G_FILE_TEST_EXISTS)) { + new_file = TRUE; + } + + if ((fd = open(filename, O_CREAT|O_APPEND|O_WRONLY, 0644)) == -1) { + g_warning("Error opening log file %s: %s", + filename, strerror(errno)); + return FALSE; + } + + if (new_file) { + /* write header and reset record counter */ + snprintf(buf, sizeof(buf), + "No,Date,Time,Lat,Lon,Ele,Head,Speed,RTR\n"); + if (write(fd, buf, strlen(buf)) == -1) { + g_warning("Error writing header to log file %s: %s", + filename, strerror(errno)); + } + gps->ui.gps_log_number = 1; + } + + /* Write log entry. Make sure this matches the header */ + /* "No,Date,Time,Lat,Lon,Ele,Head,Speed,Fix,RTR\n" */ + /* RTR values: T=time, B=button push, S=speed, D=distance */ + snprintf(buf, sizeof(buf), "%d,%s,%s,%lf,%lf,%lf,%lf,%lf,%c\n", + gps->ui.gps_log_number++, + gps_get_date_string(gps->gps_data.fix.time), + gps_get_time_string(gps->gps_data.fix.time), + //gps_data->fix.time, + gps_data->fix.latitude, + gps_data->fix.longitude, + gps_data->fix.altitude * METERS_TO_FEET, + gps_data->fix.track, + gps_data->fix.speed * METERS_TO_FEET, + 'T'); /* position due to timer expired */ + + if (write(fd, buf, strlen(buf)) == -1) { + g_warning("Could not write log number %d to log file %s: %s", + gps->ui.gps_log_number-1, filename, strerror(errno)); + } + close(fd); + + GPS_STATUS(gps, "Updated GPS log file %s.", filename); + + /* reschedule */ + return TRUE; +} + + +/**************** + * Main drawing * + ****************/ + +static gboolean gps_data_is_valid(struct gps_data_t *gps_data) +{ + if (gps_data != NULL && gps_data->online != -1.0 && + gps_data->fix.mode >= MODE_2D && + gps_data->status > STATUS_NO_FIX) { + return TRUE; + } + + return FALSE; +} + +static void gps_update_status(GritsPluginGps *gps) +{ + struct gps_data_t *gps_data = &gps->gps_data; + + /* gps table update */ + for (gint i = 0; i < G_N_ELEMENTS(gps_table); i++) { + gchar *str = gps_table[i].get_data(gps_data); + gtk_label_set_markup(GTK_LABEL(gps_table[i].value_widget), str); + g_free(str); + } +} + +/* external interface to update UI from latest GPS data. */ +gboolean gps_redraw_all(gpointer data) +{ + GritsPluginGps *gps = (GritsPluginGps *)data; + g_assert(gps); + + struct gps_data_t *gps_data = &gps->gps_data; + + g_debug("GritsPluginGps: redraw_all"); + + g_assert(gps_data); + if (!gps_data_is_valid(gps_data)) { + g_debug("GritsPluginGps: redraw_all - gps_data is not valid."); + /* XXX Change marker to indicate data is not valid */ + return TRUE; + } + + /* update position labels */ + gps_update_status(gps); + + /* Update track and marker position */ + if (gps_data_is_valid(gps_data) && gps->track.active) { + g_debug("GritsPluginGps: redraw_all - updating track group %u " + "point %u at lat = %f, long = %f, track = %f", + gps->track.cur_group, + gps->track.cur_point, + gps_data->fix.latitude, + gps_data->fix.longitude, + gps_data->fix.track); + + gps_track_add_point(&gps->track, + gps_data->fix.latitude, gps_data->fix.longitude, 0.0); + + if (gps->track.line) { + grits_viewer_remove(gps->viewer, + GRITS_OBJECT(gps->track.line)); + gps->track.line = NULL; + } + + gps->track.line = grits_line_new(gps->track.points); + gps->track.line->color[0] = 1.0; + gps->track.line->color[1] = 0; + gps->track.line->color[2] = 0.1; + gps->track.line->color[3] = 1.0; + gps->track.line->width = 3; + + grits_viewer_add(gps->viewer, GRITS_OBJECT(gps->track.line), + GRITS_LEVEL_OVERLAY, FALSE); + grits_object_queue_draw(GRITS_OBJECT(gps->track.line)); + } + + if (gps_data_is_valid(gps_data)) { + if (gps->marker) { + grits_viewer_remove(gps->viewer, + GRITS_OBJECT(gps->marker)); + gps->marker = NULL; + } + + gchar *path = find_path(GPS_MARKER_ICON_PATH, GPS_MARKER_ICON); + if (path) { + gps->marker = grits_marker_icon_new("GPS", path, + gps_data->fix.track, TRUE, GRITS_MARKER_DMASK_ICON); + g_free(path); + } else { + /* if icon not found just use a point */ + g_warning("Could not find GPS marker icon %s in path %s.", + GPS_MARKER_ICON, GPS_MARKER_ICON_PATH); + gps->marker = grits_marker_icon_new("GPS", NULL, + gps_data->fix.track, FALSE, + GRITS_MARKER_DMASK_POINT | + GRITS_MARKER_DMASK_LABEL); + } + + GRITS_OBJECT(gps->marker)->center.lat = gps_data->fix.latitude; + GRITS_OBJECT(gps->marker)->center.lon = gps_data->fix.longitude; + GRITS_OBJECT(gps->marker)->center.elev = 0.0; + GRITS_OBJECT(gps->marker)->lod = EARTH_R * 5; + GRITS_MARKER(gps->marker)->ortho = FALSE; + + grits_viewer_add(gps->viewer, GRITS_OBJECT(gps->marker), + GRITS_LEVEL_OVERLAY+1, FALSE); + grits_object_queue_draw(GRITS_OBJECT(gps->marker)); + } + + if (gps->follow_gps && gps_data_is_valid(gps_data)) { + /* Center map at current GPS position. */ + g_debug("GritsPluginGps: redraw_all - centering map at " + "lat = %f, long = %f, track = %f", + gps_data->fix.latitude, + gps_data->fix.longitude, + gps_data->fix.track); + + double lat, lon, elev; + grits_viewer_get_location(gps->viewer, &lat, &lon, &elev); + grits_viewer_set_location(gps->viewer, gps_data->fix.latitude, + gps_data->fix.longitude, elev); + //grits_viewer_set_rotation(gps->viewer, 0, 0, 0); + } + + /* reschedule */ + return TRUE; +} + + +/*************** + * Config Area * + ***************/ + +/* GPS Data Frame */ +static void gps_init_status_info(GritsPluginGps *gps, GtkWidget *gbox) +{ + gps->ui.gps_status_frame = gtk_frame_new("GPS Data"); + GtkWidget *label = gtk_frame_get_label_widget( + GTK_FRAME(gps->ui.gps_status_frame)); + gtk_label_set_use_markup(GTK_LABEL(label), TRUE); + gtk_frame_set_shadow_type(GTK_FRAME(gps->ui.gps_status_frame), + GTK_SHADOW_NONE); + gps->ui.gps_status_table = gtk_table_new(5, 2, FALSE); + gtk_container_add(GTK_CONTAINER(gps->ui.gps_status_frame), + gps->ui.gps_status_table); + + + /* gps data table setup */ + gint i; + for (i = 0; i < G_N_ELEMENTS(gps_table); i++) { + gps_table[i].label_widget = gtk_label_new(gps_table[i].label); + gps_table[i].value_widget = gtk_label_new(gps_table[i].initial_val); + + gtk_misc_set_alignment(GTK_MISC(gps_table[i].label_widget), 0, 0); + gtk_misc_set_alignment(GTK_MISC(gps_table[i].value_widget), 1, 0); + + gtk_table_attach(GTK_TABLE(gps->ui.gps_status_table), + gps_table[i].label_widget, 0, 1, i, i+1, + GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0); + gtk_table_attach(GTK_TABLE(gps->ui.gps_status_table), + gps_table[i].value_widget, 1, 2, i, i+1, + GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0); + + PangoFontDescription *roman = pango_font_description_new(); + PangoFontDescription *mono = pango_font_description_from_string("monospace"); + pango_font_description_set_size(roman, gps_table[i].font_size*PANGO_SCALE); + pango_font_description_set_size(mono, gps_table[i].font_size*PANGO_SCALE); + gtk_widget_modify_font(gps_table[i].label_widget, roman); + gtk_widget_modify_font(gps_table[i].value_widget, mono); + pango_font_description_free(roman); + pango_font_description_free(mono); + } + gtk_box_pack_start(GTK_BOX(gbox), gps->ui.gps_status_frame, + FALSE, FALSE, 0); + + /* Start UI refresh task, which will reschedule itgps. */ + gps_redraw_all(gps); + gps->gps_update_timeout_id = g_timeout_add( + GPS_UPDATE_INTERVAL*1000, + gps_redraw_all, gps); + +} + +/* GPS Control Frame */ +static gboolean on_gps_follow_clicked_event(GtkWidget *widget, gpointer user_data) +{ + GritsPluginGps *gps = (GritsPluginGps *)user_data; + + g_debug("GritsPluginGps: follow_clicked_event - button status %d", + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))); + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + gps->follow_gps = TRUE; + } else { + gps->follow_gps = FALSE; + } + + return FALSE; +} + +static gboolean on_gps_track_enable_clicked_event(GtkWidget *widget, gpointer user_data) +{ + GritsPluginGps *gps = (GritsPluginGps *)user_data; + + g_debug("GritsPluginGps: track_enable_clicked_event"); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + /* start logging trip history */ + GPS_STATUS(gps, "Enabled GPS track."); + gps->track.active = TRUE; + } else { + /* stop logging trip history */ + GPS_STATUS(gps, "Disabled GPS track."); + gps->track.active = FALSE; + /* advance to the next track group, moving everything down if + * it's full. */ + gps_track_group_incr(&gps->track); + } + + return FALSE; +} + +static gboolean on_gps_track_clear_clicked_event(GtkWidget *widget, gpointer user_data) +{ + GritsPluginGps *gps = (GritsPluginGps *)user_data; + + g_debug("GritsPluginGps: track_clear_clicked_event"); + GPS_STATUS(gps, "Cleared GPS track."); + gps_track_clear(&gps->track); + + return FALSE; +} + +static void gps_init_control_frame(GritsPluginGps *gps, GtkWidget *gbox) +{ + /* Control checkboxes */ + GtkWidget *gps_control_frame = gtk_frame_new("GPS Control"); + GtkWidget *label = gtk_frame_get_label_widget( + GTK_FRAME(gps_control_frame)); + gtk_label_set_use_markup(GTK_LABEL(label), TRUE); + gtk_frame_set_shadow_type(GTK_FRAME(gps_control_frame), + GTK_SHADOW_NONE); + GtkWidget *cbox = gtk_vbox_new(FALSE, 2); + gtk_container_add(GTK_CONTAINER(gps_control_frame), cbox); + gtk_box_pack_start(GTK_BOX(gbox), gps_control_frame, FALSE, FALSE, 0); + + gps->ui.gps_follow_checkbox = + gtk_check_button_new_with_label("Follow GPS"); + g_signal_connect(G_OBJECT(gps->ui.gps_follow_checkbox), "clicked", + G_CALLBACK(on_gps_follow_clicked_event), + (gpointer)gps); + gtk_box_pack_start(GTK_BOX(cbox), gps->ui.gps_follow_checkbox, + FALSE, FALSE, 0); + + gps->ui.gps_track_checkbox = + gtk_check_button_new_with_label("Record Track"); + g_signal_connect(G_OBJECT(gps->ui.gps_track_checkbox), "clicked", + G_CALLBACK(on_gps_track_enable_clicked_event), + (gpointer)gps); + gtk_box_pack_start(GTK_BOX(cbox), gps->ui.gps_track_checkbox, + FALSE, FALSE, 0); + + gps->ui.gps_clear_button = gtk_button_new_with_label("Clear Track"); + g_signal_connect(G_OBJECT(gps->ui.gps_clear_button), "clicked", + G_CALLBACK(on_gps_track_clear_clicked_event), + (gpointer)gps); + gtk_box_pack_start(GTK_BOX(cbox), gps->ui.gps_clear_button, + FALSE, FALSE, 0); +} + +/* Track Log Frame */ +static gboolean on_gps_log_clicked_event(GtkWidget *widget, gpointer user_data) +{ + GritsPluginGps *gps = (GritsPluginGps *)user_data; + + g_debug("GritsPluginGps: log_clicked_event"); + + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget))) { + gps_write_log(gps); + + /* Schedule log file write */ + gps->ui.gps_log_timeout_id = g_timeout_add( + gtk_range_get_value( + GTK_RANGE(gps->ui.gps_log_interval_slider))*1000, + gps_write_log, gps); + } else { + /* button unchecked */ + g_source_remove(gps->ui.gps_log_timeout_id); + gps->ui.gps_log_timeout_id = 0; + g_debug("GritsPluginGps: log_clicked_event - closed log file."); + } + + return FALSE; +} + +static gboolean on_gps_log_interval_changed_event(GtkWidget *widget, gpointer user_data) +{ + GritsPluginGps *gps = (GritsPluginGps *)user_data; + + g_assert(gps); + + g_debug("GritsPluginGps: log_interval_changed_event - value = %f", + gtk_range_get_value(GTK_RANGE(widget))); + + if (gtk_toggle_button_get_active( + GTK_TOGGLE_BUTTON(gps->ui.gps_log_checkbox))) { + g_assert(gps->ui.gps_log_timeout_id != 0); + + /* disable old timeout */ + g_source_remove(gps->ui.gps_log_timeout_id); + gps->ui.gps_log_timeout_id = 0; + + /* Schedule new log file write */ + gps->ui.gps_log_timeout_id = g_timeout_add( + gtk_range_get_value(GTK_RANGE(widget))*1000, + gps_write_log, gps); + gps_write_log(gps); + } + + return FALSE; +} + +static void gps_init_track_log_frame(GritsPluginGps *gps, GtkWidget *gbox) +{ + /* Track log box with enable checkbox and filename entry */ + GtkWidget *gps_log_frame = gtk_frame_new("Track Log"); + GtkWidget *label = gtk_frame_get_label_widget(GTK_FRAME(gps_log_frame)); + gtk_label_set_use_markup(GTK_LABEL(label), TRUE); + gtk_frame_set_shadow_type(GTK_FRAME(gps_log_frame), GTK_SHADOW_NONE); + GtkWidget *lbox = gtk_vbox_new(FALSE, 2); + gtk_container_add(GTK_CONTAINER(gps_log_frame), lbox); + gtk_box_pack_start(GTK_BOX(gbox), gps_log_frame, + FALSE, FALSE, 0); + + gps->ui.gps_log_checkbox = + gtk_check_button_new_with_label("Log Position to File"); + g_signal_connect(G_OBJECT(gps->ui.gps_log_checkbox), "clicked", + G_CALLBACK(on_gps_log_clicked_event), + (gpointer)gps); + gtk_box_pack_start(GTK_BOX(lbox), gps->ui.gps_log_checkbox, + FALSE, FALSE, 0); + + /* Set up filename entry box */ + GtkWidget *fbox = gtk_hbox_new(FALSE, 2); + GtkWidget *filename_label = gtk_label_new("Filename:"); + gtk_box_pack_start(GTK_BOX(fbox), filename_label, FALSE, FALSE, 0); + gps->ui.gps_log_filename_entry = gtk_entry_new(); + gtk_box_pack_start(GTK_BOX(fbox), gps->ui.gps_log_filename_entry, + TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(lbox), fbox, FALSE, FALSE, 0); + + /* set up gps log interval slider */ + GtkWidget *ubox = gtk_hbox_new(FALSE, 4); + GtkWidget *interval_label = gtk_label_new("Update Interval:"); + gtk_box_pack_start(GTK_BOX(ubox), interval_label, FALSE, FALSE, 0); + gps->ui.gps_log_interval_slider = + gtk_hscale_new_with_range(1.0, 600.0, 30.0); + gtk_range_set_value(GTK_RANGE(gps->ui.gps_log_interval_slider), + GPS_LOG_DEFAULT_UPDATE_INTERVAL); + g_signal_connect(G_OBJECT(gps->ui.gps_log_interval_slider), + "value-changed", + G_CALLBACK(on_gps_log_interval_changed_event), + (gpointer)gps); + gtk_range_set_increments( + GTK_RANGE(gps->ui.gps_log_interval_slider), + 10.0 /* step */, 30.0 /* page up/down */); + gtk_range_set_update_policy( + GTK_RANGE(gps->ui.gps_log_interval_slider), + GTK_UPDATE_DELAYED); + gtk_box_pack_start(GTK_BOX(ubox), gps->ui.gps_log_interval_slider, + TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(lbox), ubox, FALSE, FALSE, 0); +} + + +/******************* + * GPSD interfaces * + *******************/ + +static void process_gps(gpointer data, gint source, GdkInputCondition condition) +{ + struct gps_data_t *gps_data = (struct gps_data_t *)data; + + g_debug("GritsPluginGps: process_gps"); + + /* Process any data from the gps and call the hook function */ + if (gps_data != NULL) { + gdouble track = gps_data->fix.track; + gint result = gps_read(gps_data); + if (isnan(gps_data->fix.track)) + gps_data->fix.track = track; + g_debug("GritsPluginGps: process_gps - gps_read returned %d, " + "position %f, %f.", result, + gps_data->fix.latitude, gps_data->fix.longitude); + } else { + g_warning("GritsPluginGps: process_gps - gps_data == NULL."); + } +} + +static gint initialize_gpsd(char *server, gchar *port, struct gps_data_t *gps_data) +{ +#if GPSD_API_MAJOR_VERSION < 5 +#error "GPSD protocol version 5 or greater required." +#endif + gint result = gps_open(server, port, gps_data); + if (result > 0) { + g_warning("Unable to open gpsd connection to %s:%s: %d, %d, %s", + server, port, result, errno, gps_errstr(errno)); + return 0; + } + + (void)gps_stream(gps_data, WATCH_ENABLE|WATCH_JSON, NULL); + g_debug("GritsPluginGps: initialize_gpsd - gpsd fd %u.", gps_data->gps_fd); + return gdk_input_add(gps_data->gps_fd, GDK_INPUT_READ, process_gps, gps_data); +} + + +/********************** + * GPS Plugin Methods * + **********************/ + +/* Methods */ +GritsPluginGps *grits_plugin_gps_new(GritsViewer *viewer, GritsPrefs *prefs) +{ + /* TODO: move to constructor if possible */ + g_debug("GritsPluginGps: new"); + GritsPluginGps *gps = g_object_new(GRITS_TYPE_PLUGIN_GPS, NULL); + gps->viewer = g_object_ref(viewer); + gps->prefs = g_object_ref(prefs); + + gps->input_tag = initialize_gpsd("localhost", DEFAULT_GPSD_PORT, &gps->gps_data); + gps->follow_gps = FALSE; + + gps_track_init(&gps->track); + gps_init_status_info(gps, gps->config); + gps_init_control_frame(gps, gps->config); + gps_init_track_log_frame(gps, gps->config); + + return gps; +} + +static GtkWidget *grits_plugin_gps_get_config(GritsPlugin *_gps) +{ + GritsPluginGps *gps = GRITS_PLUGIN_GPS(_gps); + return gps->config; +} + +/* GObject code */ +static void grits_plugin_gps_plugin_init(GritsPluginInterface *iface); +G_DEFINE_TYPE_WITH_CODE(GritsPluginGps, grits_plugin_gps, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE(GRITS_TYPE_PLUGIN, + grits_plugin_gps_plugin_init)); + +static void grits_plugin_gps_plugin_init(GritsPluginInterface *iface) +{ + g_debug("GritsPluginGps: plugin_init"); + /* Add methods to the interface */ + iface->get_config = grits_plugin_gps_get_config; +} + +static void grits_plugin_gps_init(GritsPluginGps *gps) +{ + g_debug("GritsPluginGps: gps_init"); + + gps->config = gtk_hbox_new(FALSE, 15); +} + +static void grits_plugin_gps_dispose(GObject *gobject) +{ + GritsPluginGps *gps = GRITS_PLUGIN_GPS(gobject); + + g_debug("GritsPluginGps: dispose"); + + if (gps->gps_update_timeout_id) { + g_source_remove(gps->gps_update_timeout_id); + gps->gps_update_timeout_id = 0; + } + if (gps->ui.gps_log_timeout_id) { + g_source_remove(gps->ui.gps_log_timeout_id); + gps->ui.gps_log_timeout_id = 0; + } + if (gps->input_tag) { + gdk_input_remove(gps->input_tag); + gps->input_tag = 0; + } + if (gps->viewer) { + GritsViewer *viewer = gps->viewer; + gps->viewer = NULL; + if (gps->marker) + grits_viewer_remove(viewer, + GRITS_OBJECT(gps->marker)); + g_object_unref(gps->prefs); + g_object_unref(viewer); + } + + /* Drop references */ + G_OBJECT_CLASS(grits_plugin_gps_parent_class)->dispose(gobject); +} + +static void grits_plugin_gps_finalize(GObject *gobject) +{ + GritsPluginGps *gps = GRITS_PLUGIN_GPS(gobject); + + g_debug("GritsPluginGps: finalize"); + + /* Free data */ + gps_track_free(&gps->track); + G_OBJECT_CLASS(grits_plugin_gps_parent_class)->finalize(gobject); +} + +static void grits_plugin_gps_class_init(GritsPluginGpsClass *klass) +{ + g_debug("GritsPluginGps: class_init"); + GObjectClass *gobject_class = (GObjectClass*)klass; + gobject_class->dispose = grits_plugin_gps_dispose; + gobject_class->finalize = grits_plugin_gps_finalize; +} diff -Nru aweather-0.6.1/src/plugins/gps-plugin.h aweather-0.7/src/plugins/gps-plugin.h --- aweather-0.6.1/src/plugins/gps-plugin.h 1970-01-01 00:00:00.000000000 +0000 +++ aweather-0.7/src/plugins/gps-plugin.h 2012-02-12 07:05:42.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2012 Adam Boggs + * + * 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 3 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, see . + */ +#ifndef _GPS_PLUGIN_H +#define _GPS_PLUGIN_H + +#define GRITS_TYPE_PLUGIN_GPS (grits_plugin_gps_get_type ()) +#define GRITS_PLUGIN_GPS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GRITS_TYPE_PLUGIN_GPS, GritsPluginGps)) +#define GRITS_IS_PLUGIN_GPS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GRITS_TYPE_PLUGIN_GPS)) +#define GRITS_PLUGIN_GPS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRITS_TYPE_PLUGIN_GPS, GritsPluginGpsClass)) +#define GRITS_IS_PLUGIN_GPS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRITS_TYPE_PLUGIN_GPS)) +#define GRITS_PLUGIN_GPS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRITS_TYPE_PLUGIN_GPS, GritsPluginGpsClass)) + +typedef struct _GritsPluginGps GritsPluginGps; +typedef struct _GritsPluginGpsClass GritsPluginGpsClass; + +/* All the User Interface objects we need to keep track of. */ +typedef struct { + /* gps info frame */ + GtkWidget *gps_status_frame; + GtkWidget *gps_status_table; + GtkWidget *gps_status_label; + GtkWidget *gps_latitude_label; + GtkWidget *gps_longitude_label; + GtkWidget *gps_heading_label; + GtkWidget *gps_elevation_label; + + GtkWidget *status_bar; + + /* control frame */ + GtkWidget *gps_follow_checkbox; + GtkWidget *gps_track_checkbox; + GtkWidget *gps_clear_button; + + /* log frame */ + GtkWidget *gps_log_checkbox; + GtkWidget *gps_log_filename_entry; + GtkWidget *gps_log_interval_slider; + guint gps_log_timeout_id; /* id of timeout so we can delete it */ + guint gps_log_number; /* sequential log number */ +} GpsUi; + +typedef struct { + /* track storage */ + gboolean active; /* Display track history */ + gdouble (**points)[3]; + GritsLine *line; + guint cur_point; + guint num_points; + guint cur_group; +} GpsTrack; + +/* GPS private data */ +struct _GritsPluginGps { + GObject parent_instance; + + /* instance members */ + GritsViewer *viewer; + GritsPrefs *prefs; + GtkWidget *config; + guint tab_id; + GritsMarker *marker; + + struct gps_data_t gps_data; + + gboolean follow_gps; + guint gps_update_timeout_id; /* id of timeout so we can delete it */ + gint input_tag; + + GpsTrack track; + GpsUi ui; +}; + +struct _GritsPluginGpsClass { + GObjectClass parent_class; +}; + +GType grits_plugin_gps_get_type(); + + +#endif /* GPS_PLUGIN_H */ + diff -Nru aweather-0.6.1/src/plugins/level2.c aweather-0.7/src/plugins/level2.c --- aweather-0.6.1/src/plugins/level2.c 2011-11-24 10:41:48.000000000 +0000 +++ aweather-0.7/src/plugins/level2.c 2012-02-14 18:16:51.000000000 +0000 @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -324,7 +323,7 @@ vol->disp = GRITS_VOLUME_SURFACE; GRITS_OBJECT(vol)->center = GRITS_OBJECT(level2)->center; grits_viewer_add(GRITS_OBJECT(level2)->viewer, - GRITS_OBJECT(vol), GRITS_LEVEL_WORLD+1, FALSE); + GRITS_OBJECT(vol), GRITS_LEVEL_WORLD+5, TRUE); level2->volume = vol; } if (ISO_MIN < level && level < ISO_MAX) { @@ -379,9 +378,9 @@ /* Load the radar file */ RSL_read_these_sweeps("all", NULL); - g_message("read start"); + g_debug("AWeatherLevel2: rsl read start"); Radar *radar = RSL_wsr88d_to_radar(raw, (gchar*)site); - g_message("read done"); + g_debug("AWeatherLevel2: rsl read done"); g_free(raw); if (!radar) return NULL; diff -Nru aweather-0.6.1/src/plugins/Makefile.am aweather-0.7/src/plugins/Makefile.am --- aweather-0.6.1/src/plugins/Makefile.am 2011-11-18 07:32:46.000000000 +0000 +++ aweather-0.7/src/plugins/Makefile.am 2012-02-09 07:03:36.000000000 +0000 @@ -1,8 +1,15 @@ AM_CFLAGS = -Wall --std=gnu99 $(GRITS_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib -AM_LDFLAGS = -shared -module -avoid-version -Wl,--as-needed +AM_LDFLAGS = -shared -module -avoid-version LIBS = $(GRITS_LIBS) +if SYS_WIN +AM_LDFLAGS += -no-undefined +endif +if !SYS_MAC +AM_LDFLAGS += -Wl,--as-needed +endif + pluginsdir = $(pkglibdir) plugins_LTLIBRARIES = alert.la @@ -11,9 +18,19 @@ alert.c alert.h \ alert-info.c alert-info.h alert_la_CPPFLAGS = \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" alert_la_LIBADD = $(GRITS_LIBS) +if HAVE_GPSD +plugins_LTLIBRARIES += gps.la +gps_la_SOURCES = \ + gps-plugin.c gps-plugin.h +gps_la_CPPFLAGS = \ + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" \ + -I$(top_srcdir)/src +gps_la_LIBADD = $(GPSD_LIBS) $(GRITS_LIBS) +endif + if HAVE_RSL plugins_LTLIBRARIES += radar.la radar_la_SOURCES = \ @@ -23,16 +40,11 @@ ../aweather-location.c \ ../aweather-location.h radar_la_CPPFLAGS = \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" \ -I$(top_srcdir)/src radar_la_LIBADD = $(RSL_LIBS) $(GRITS_LIBS) endif -if WIN32 -AM_LDFLAGS += -no-undefined -dots = .. -endif - test: ( cd ../; make test ) diff -Nru aweather-0.6.1/src/plugins/Makefile.in aweather-0.7/src/plugins/Makefile.in --- aweather-0.6.1/src/plugins/Makefile.in 2011-11-25 06:59:59.000000000 +0000 +++ aweather-0.7/src/plugins/Makefile.in 2012-02-15 05:49:29.000000000 +0000 @@ -34,8 +34,10 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@HAVE_RSL_TRUE@am__append_1 = radar.la -@WIN32_TRUE@am__append_2 = -no-undefined +@SYS_WIN_TRUE@am__append_1 = -no-undefined +@SYS_MAC_FALSE@am__append_2 = -Wl,--as-needed +@HAVE_GPSD_TRUE@am__append_3 = gps.la +@HAVE_RSL_TRUE@am__append_4 = radar.la subdir = src/plugins DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -76,6 +78,12 @@ alert_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_alert_la_OBJECTS = alert_la-alert.lo alert_la-alert-info.lo alert_la_OBJECTS = $(am_alert_la_OBJECTS) +@HAVE_GPSD_TRUE@gps_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ +@HAVE_GPSD_TRUE@ $(am__DEPENDENCIES_1) +am__gps_la_SOURCES_DIST = gps-plugin.c gps-plugin.h +@HAVE_GPSD_TRUE@am_gps_la_OBJECTS = gps_la-gps-plugin.lo +gps_la_OBJECTS = $(am_gps_la_OBJECTS) +@HAVE_GPSD_TRUE@am_gps_la_rpath = -rpath $(pluginsdir) @HAVE_RSL_TRUE@radar_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_RSL_TRUE@ $(am__DEPENDENCIES_1) am__radar_la_SOURCES_DIST = radar.c radar.h level2.c level2.h \ @@ -96,8 +104,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(alert_la_SOURCES) $(radar_la_SOURCES) -DIST_SOURCES = $(alert_la_SOURCES) $(am__radar_la_SOURCES_DIST) +SOURCES = $(alert_la_SOURCES) $(gps_la_SOURCES) $(radar_la_SOURCES) +DIST_SOURCES = $(alert_la_SOURCES) $(am__gps_la_SOURCES_DIST) \ + $(am__radar_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -118,6 +127,7 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ +DOTS = @DOTS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -128,9 +138,12 @@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ +GPSD_CFLAGS = @GPSD_CFLAGS@ +GPSD_LIBS = @GPSD_LIBS@ GREP = @GREP@ GRITS_CFLAGS = @GRITS_CFLAGS@ GRITS_LIBS = @GRITS_LIBS@ +HAVE_GPSD = @HAVE_GPSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -146,6 +159,8 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ +MAC_CFLAGS = @MAC_CFLAGS@ +MAC_LIBS = @MAC_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -228,18 +243,26 @@ top_srcdir = @top_srcdir@ AM_CFLAGS = -Wall --std=gnu99 $(GRITS_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib -AM_LDFLAGS = -shared -module -avoid-version -Wl,--as-needed \ +AM_LDFLAGS = -shared -module -avoid-version $(am__append_1) \ $(am__append_2) pluginsdir = $(pkglibdir) -plugins_LTLIBRARIES = alert.la $(am__append_1) +plugins_LTLIBRARIES = alert.la $(am__append_3) $(am__append_4) alert_la_SOURCES = \ alert.c alert.h \ alert-info.c alert-info.h alert_la_CPPFLAGS = \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" alert_la_LIBADD = $(GRITS_LIBS) +@HAVE_GPSD_TRUE@gps_la_SOURCES = \ +@HAVE_GPSD_TRUE@ gps-plugin.c gps-plugin.h + +@HAVE_GPSD_TRUE@gps_la_CPPFLAGS = \ +@HAVE_GPSD_TRUE@ -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" \ +@HAVE_GPSD_TRUE@ -I$(top_srcdir)/src + +@HAVE_GPSD_TRUE@gps_la_LIBADD = $(GPSD_LIBS) $(GRITS_LIBS) @HAVE_RSL_TRUE@radar_la_SOURCES = \ @HAVE_RSL_TRUE@ radar.c radar.h \ @HAVE_RSL_TRUE@ level2.c level2.h \ @@ -248,11 +271,10 @@ @HAVE_RSL_TRUE@ ../aweather-location.h @HAVE_RSL_TRUE@radar_la_CPPFLAGS = \ -@HAVE_RSL_TRUE@ -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ +@HAVE_RSL_TRUE@ -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" \ @HAVE_RSL_TRUE@ -I$(top_srcdir)/src @HAVE_RSL_TRUE@radar_la_LIBADD = $(RSL_LIBS) $(GRITS_LIBS) -@WIN32_TRUE@dots = .. MAINTAINERCLEANFILES = Makefile.in all: all-am @@ -321,6 +343,8 @@ done alert.la: $(alert_la_OBJECTS) $(alert_la_DEPENDENCIES) $(LINK) -rpath $(pluginsdir) $(alert_la_OBJECTS) $(alert_la_LIBADD) $(LIBS) +gps.la: $(gps_la_OBJECTS) $(gps_la_DEPENDENCIES) + $(LINK) $(am_gps_la_rpath) $(gps_la_OBJECTS) $(gps_la_LIBADD) $(LIBS) radar.la: $(radar_la_OBJECTS) $(radar_la_DEPENDENCIES) $(LINK) $(am_radar_la_rpath) $(radar_la_OBJECTS) $(radar_la_LIBADD) $(LIBS) @@ -332,6 +356,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alert_la-alert-info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alert_la-alert.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gps_la-gps-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radar_la-aweather-location.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radar_la-level2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radar_la-radar-info.Plo@am__quote@ @@ -372,6 +397,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alert_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alert_la-alert-info.lo `test -f 'alert-info.c' || echo '$(srcdir)/'`alert-info.c +gps_la-gps-plugin.lo: gps-plugin.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gps_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gps_la-gps-plugin.lo -MD -MP -MF $(DEPDIR)/gps_la-gps-plugin.Tpo -c -o gps_la-gps-plugin.lo `test -f 'gps-plugin.c' || echo '$(srcdir)/'`gps-plugin.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gps_la-gps-plugin.Tpo $(DEPDIR)/gps_la-gps-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gps-plugin.c' object='gps_la-gps-plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gps_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gps_la-gps-plugin.lo `test -f 'gps-plugin.c' || echo '$(srcdir)/'`gps-plugin.c + radar_la-radar.lo: radar.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(radar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT radar_la-radar.lo -MD -MP -MF $(DEPDIR)/radar_la-radar.Tpo -c -o radar_la-radar.lo `test -f 'radar.c' || echo '$(srcdir)/'`radar.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/radar_la-radar.Tpo $(DEPDIR)/radar_la-radar.Plo diff -Nru aweather-0.6.1/src/plugins/radar.c aweather-0.7/src/plugins/radar.c --- aweather-0.6.1/src/plugins/radar.c 2011-11-18 07:32:46.000000000 +0000 +++ aweather-0.7/src/plugins/radar.c 2012-02-12 07:05:42.000000000 +0000 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -183,7 +182,7 @@ } grits_object_hide(GRITS_OBJECT(site->level2), site->hidden); grits_viewer_add(site->viewer, GRITS_OBJECT(site->level2), - GRITS_LEVEL_WORLD+1, TRUE); + GRITS_LEVEL_WORLD+3, TRUE); out: g_idle_add(_site_update_end, site); @@ -284,12 +283,11 @@ radar_site_unload(site); } -gboolean _site_add_marker(gpointer _site) +gboolean _site_add_marker(RadarSite *site) { - RadarSite *site = _site; site->marker = grits_marker_new(site->city->name); GRITS_OBJECT(site->marker)->center = site->city->pos; - GRITS_OBJECT(site->marker)->lod = EARTH_R*site->city->lod; + GRITS_OBJECT(site->marker)->lod = EARTH_R*0.75*site->city->lod; grits_viewer_add(site->viewer, GRITS_OBJECT(site->marker), GRITS_LEVEL_OVERLAY, FALSE); return FALSE; @@ -306,6 +304,7 @@ "level2" G_DIR_SEPARATOR_S); site->city = city; site->pconfig = pconfig; + site->hidden = TRUE; /* Set initial location */ gdouble lat, lon, elev; @@ -313,7 +312,7 @@ _site_on_location_changed(viewer, lat, lon, elev, site); /* Add marker */ - g_idle_add_full(G_PRIORITY_LOW, _site_add_marker, site, NULL); + _site_add_marker(site); /* Connect signals */ site->location_id = g_signal_connect(viewer, "location-changed", @@ -379,13 +378,14 @@ glGenTextures(1, tile->data); } + gchar *clear = g_malloc0(2048*2048*4); guint *tex = tile->data; glBindTexture(GL_TEXTURE_2D, *tex); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); glTexImage2D(GL_TEXTURE_2D, 0, 4, 2048, 2048, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); + GL_RGBA, GL_UNSIGNED_BYTE, clear); glTexSubImage2D(GL_TEXTURE_2D, 0, 1,1, CONUS_WIDTH/2,CONUS_HEIGHT, GL_RGBA, GL_UNSIGNED_BYTE, pixels); tile->coords.n = 1.0/(CONUS_WIDTH/2); @@ -397,6 +397,7 @@ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glFlush(); + g_free(clear); } /* Split the pixbuf into east and west halves (with 2K sides) @@ -425,7 +426,7 @@ dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; - dst[3] = 0xff; + dst[3] = 0xff * 0.75; for (int j = 0; j < G_N_ELEMENTS(alphamap); j++) if (src[0] == alphamap[j][0] && src[1] == alphamap[j][1] && @@ -570,8 +571,8 @@ conus->tile[1] = grits_tile_new(NULL, CONUS_NORTH, south, east, mid); conus->tile[0]->zindex = 2; conus->tile[1]->zindex = 1; - grits_viewer_add(viewer, GRITS_OBJECT(conus->tile[0]), GRITS_LEVEL_WORLD, TRUE); - grits_viewer_add(viewer, GRITS_OBJECT(conus->tile[1]), GRITS_LEVEL_WORLD, TRUE); + grits_viewer_add(viewer, GRITS_OBJECT(conus->tile[0]), GRITS_LEVEL_WORLD+2, FALSE); + grits_viewer_add(viewer, GRITS_OBJECT(conus->tile[1]), GRITS_LEVEL_WORLD+2, FALSE); conus->time_id = g_signal_connect_swapped(viewer, "time-changed", G_CALLBACK(_conus_update), conus); @@ -776,9 +777,13 @@ { g_debug("GritsPluginRadar: dispose"); GritsPluginRadar *self = GRITS_PLUGIN_RADAR(gobject); - g_signal_handler_disconnect(self->config, self->tab_id); - grits_viewer_remove(self->viewer, GRITS_OBJECT(self->hud)); - radar_conus_free(self->conus); + if (self->viewer) { + GritsViewer *viewer = self->viewer; + self->viewer = NULL; + g_signal_handler_disconnect(self->config, self->tab_id); + grits_viewer_remove(viewer, GRITS_OBJECT(self->hud)); + radar_conus_free(self->conus); + } /* Drop references */ G_OBJECT_CLASS(grits_plugin_radar_parent_class)->dispose(gobject); } diff -Nru aweather-0.6.1/src/resource.rc aweather-0.7/src/resource.rc --- aweather-0.6.1/src/resource.rc 2011-11-25 07:00:04.000000000 +0000 +++ aweather-0.7/src/resource.rc 2012-02-15 05:49:42.000000000 +0000 @@ -16,12 +16,12 @@ BEGIN VALUE "CompanyName", "Andy Spencer" VALUE "FileDescription", "AWeather" - VALUE "FileVersion", "0.6.1" + VALUE "FileVersion", "0.7" VALUE "InternalName", "aweather" VALUE "LegalCopyright", "Copyright (C) 2008-2011 Andy Spencer" VALUE "OriginalFilename", "@ORIGINAL_FILENAME@" VALUE "ProductName", "AWeather" - VALUE "ProductVersion", "0.6.1" + VALUE "ProductVersion", "0.7" END END BLOCK "VarFileInfo"