]> Pileus Git - grits/commitdiff
Splitting out libgis
authorAndy Spencer <andy753421@gmail.com>
Sat, 24 Oct 2009 21:47:42 +0000 (21:47 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sat, 24 Oct 2009 21:47:42 +0000 (21:47 +0000)
63 files changed:
ChangeLog
Makefile.am
README
TODO
configure.ac
data/.gitignore [deleted file]
data/Makefile.am [deleted file]
data/aweather.desktop [deleted file]
data/aweather.svg [deleted file]
data/defaults.ini [deleted file]
data/main.ui [deleted file]
docs/api/Makefile.am
opt/.gitignore [deleted file]
opt/level2.c [deleted file]
opt/level2.h [deleted file]
opt/mkfile [deleted file]
opt/rsl/rsl-1.40.ebuild [deleted file]
opt/rsl/rsl-automake.patch [deleted file]
opt/rsl/rsl-gzip.patch [deleted file]
opt/rsl/rsl-type_str.patch [deleted file]
opt/rsl/rsl-valgrind.patch [deleted file]
opt/rsl/rsl-warnings.patch [deleted file]
src/.gitignore
src/Makefile.am
src/aweather-gui.c [deleted file]
src/aweather-gui.h [deleted file]
src/aweather-location.c [deleted file]
src/aweather-location.h [deleted file]
src/gis-data.c [moved from src/gis/gis-data.c with 100% similarity]
src/gis-data.h [moved from src/gis/gis-data.h with 100% similarity]
src/gis-opengl.c [moved from src/gis/gis-opengl.c with 100% similarity]
src/gis-opengl.h [moved from src/gis/gis-opengl.h with 100% similarity]
src/gis-plugin.c [moved from src/gis/gis-plugin.c with 100% similarity]
src/gis-plugin.h [moved from src/gis/gis-plugin.h with 100% similarity]
src/gis-prefs.c [moved from src/gis/gis-prefs.c with 100% similarity]
src/gis-prefs.h [moved from src/gis/gis-prefs.h with 100% similarity]
src/gis-view.c [moved from src/gis/gis-view.c with 100% similarity]
src/gis-view.h [moved from src/gis/gis-view.h with 100% similarity]
src/gis-world.c [moved from src/gis/gis-world.c with 100% similarity]
src/gis-world.h [moved from src/gis/gis-world.h with 100% similarity]
src/gis.h [moved from src/gis/gis.h with 100% similarity]
src/gis/.gitignore [deleted file]
src/gis/.vimrc [deleted file]
src/gis/Makefile.am [deleted file]
src/gis/gis-marshal.list [deleted file]
src/gis_test.c [moved from src/gis/gis_test.c with 100% similarity]
src/gpqueue.c [moved from src/gis/gpqueue.c with 100% similarity]
src/gpqueue.h [moved from src/gis/gpqueue.h with 100% similarity]
src/libgis.pc.in [moved from src/gis/libgis.pc.in with 100% similarity]
src/main.c [deleted file]
src/plugins/Makefile.am [deleted file]
src/plugins/gis [deleted symlink]
src/plugins/marching.c [deleted file]
src/plugins/marching.h [deleted file]
src/plugins/radar-colormap.c [deleted file]
src/plugins/radar.c [deleted file]
src/plugins/radar.h [deleted file]
src/roam.c [moved from src/gis/roam.c with 100% similarity]
src/roam.h [moved from src/gis/roam.h with 100% similarity]
src/wms.c [moved from src/gis/wms.c with 100% similarity]
src/wms.h [moved from src/gis/wms.h with 100% similarity]
src/wms_test.c [moved from src/gis/wms_test.c with 100% similarity]
src/wsr88ddec.c [deleted file]

index 934dcd1c9640efa4212b9f3780070d3620f4c4ce..08e91801c4c70d2f20d4d47fa0dbbee6ffdde713 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,5 @@
-See the subversion log for detailed information
-http://lug.rose-hulman.edu/svn/proj-aweather/
+See the Git log for detailed information
+http://lug.rose-hulman.edu/git/
 
-v0.1 (2009/06/29):
-  * Initial release
-  * Ridge overlays
-  * Level II radar
-  * Pan/zoom
-  * Offline mode
+v0.3 (2009/10/24):
+  * Split out of AWeather
index 06abab6b0a376b03fd8dcd83322260d6e3daf354..3373886299d0ab260fa9bebe67b0ed9ced6e2473 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = src data docs
+SUBDIRS = src docs
 
 ACLOCAL_AMFLAGS=-I m4
 
diff --git a/README b/README
index 8e2fb59ecfb68554b4861189f3025f8d0065ab44..2ed3bb752c06ab4554797318a15ac7008e28d92c 100644 (file)
--- a/README
+++ b/README
@@ -1,13 +1 @@
-Advanced Weather
-
-This may eventually become free software program/library/something used to
-access/process/visualize weather related data.
-
-Data:
-Ground    (WMS) - http://www.nasa.network.com/wms
-Elevation (WMS) - http://www.nasa.network.com/elev
-
-See also:
-WDSS II  - http://www.wdssii.org/
-AWIPS    - http://www.nws.noaa.gov/ops2/ops24/awips.htm
-AWIPS II - http://www.unidata.ucar.edu/Presentations/AWIPS/AE_Overview_NCEP_v2-1.pdf
+libgis is a Virtual Globe library using GTK+ and OpenGL
diff --git a/TODO b/TODO
index da68a8ce1e3206812da5b8304a273b16d297cdf3..93116d3c9e8260fecbbb03f68df4f87f7a6dfa3a 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,34 +1,7 @@
 Road plan
 ---------
-0.x - Misc
-  * Fix all memory leaks
-  * Pre-load textures and polys in OpenGL
-
-0.x - Docs
-  * Man page with key commands
-  * UI docs??
-  * GTK docs
-
-0.x - GIS
-  * Use Vertex Arrays/
-    VertexBufferObjects/
-    DisplayLists/
-    glInterleavedArrays
-  * States/cities/roads overlays
-  * NEXRAD LLE listings, click to center
-
-0.x - Volume scans
-  * Display iso surfaces of volume scans
-
-0.x - Animation
-  * Loop though times
-
-0.x - More data
-  * CONUS (composite) radar images
-  * Derived from Level 2:
-    * Composite reflectivity
-    * Storm relative motion
-    * Echo tops
-  * Warning/watch boxes
-  * Fronts
-  * Air pressure
+* Use Vertex Arrays/
+  VertexBufferObjects/
+  DisplayLists/
+  glInterleavedArrays
+* States/cities/roads overlays
index 0f21b0834d35911804695f73b1b80b1e99a28b59..904309b18517f08c8eee507cd108dee8d118158c 100644 (file)
@@ -1,5 +1,5 @@
 # Init and options
-AC_INIT([aweather], [0.3-p0], [spenceal@rose-hulman.edu])
+AC_INIT([libgis], [0.3], [spenceal@rose-hulman.edu])
 AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability foreign])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
@@ -16,25 +16,12 @@ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.14 gobject-2.0 gthread-2.0 gmodule-export-
 PKG_CHECK_MODULES(GTK,  gtk+-2.0 >= 2.16 gtkglext-1.0)
 PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.26)
 
-# 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)
-
 # Output 
 AC_CONFIG_FILES([
        Makefile
        src/Makefile
-       src/gis/Makefile
-       src/gis/libgis.pc
-       src/plugins/Makefile
-       data/Makefile
+       src/libgis.pc
        docs/Makefile
        docs/api/Makefile
 ])
 AC_OUTPUT
-
-# Print status messages
-if test "$RSL_LIBS" = ""; then
-       echo " ** Warning, RSL not found, radar plugin disabled"
-fi
diff --git a/data/.gitignore b/data/.gitignore
deleted file mode 100644 (file)
index 0d9808b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-aweather
-*.png
diff --git a/data/Makefile.am b/data/Makefile.am
deleted file mode 100644 (file)
index 6aa6e4f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-gtkbuilderdir = $(datadir)/aweather/
-dist_gtkbuilder_DATA = main.ui
-
-configdir = $(datadir)/aweather/
-dist_config_DATA = defaults.ini
-
-desktopdir = $(datadir)/applications
-dist_desktop_DATA = aweather.desktop
-
-pixmapdir = $(datadir)/pixmaps
-dist_pixmap_DATA = aweather.png
-
-.svg.png:
-       convert $< $@
-
-maintainer-clean-local:
-       rm -f Makefile.in
diff --git a/data/aweather.desktop b/data/aweather.desktop
deleted file mode 100644 (file)
index 7019aca..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=AWeather
-Comment=Advanced weather reporting program
-Exec=aweather
-Terminal=false
-Icon=aweather.png
-Categories=Education;Science;Geoscience
diff --git a/data/aweather.svg b/data/aweather.svg
deleted file mode 100644 (file)
index f5dadbd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150">
-
-       <title>thundery showers</title>
-
-       <rect width="150" height="150" fill="#3be" stroke="none"/>
-
-       <g style="stroke-width:7;stroke:#ff0">
-               <line x1="2" y1="67" x2="19" y2="67" transform="rotate(-20, 55, 67)" />
-               <line x1="2" y1="67" x2="19" y2="67" transform="rotate(4, 55, 67)" />
-               <line x1="2" y1="67" x2="19" y2="67" transform="rotate(28, 55, 67)" />
-               <line x1="2" y1="67" x2="19" y2="67" transform="rotate(52, 55, 67)" />
-               <line x1="2" y1="67" x2="19" y2="67" transform="rotate(76, 55, 67)" />
-       </g>
-
-
-       <g fill="none" stroke-width="12" stroke-linecap="round" stroke="#666" >
-               <path d="M 75 55 A 23 23, 0, 1, 0 55,90 L 60,90"/>
-               <path d="M 110,90 115,90 A 21 21, 0, 1, 0 115,45" />
-               <path d="M 105 60 A 25 25, 0, 1, 0 65,45 "  />
-       </g>
-
-       <polygon points="82,110 67,110 82,80 97,80 87,100 102,100 67,150" stroke="none" fill="#dee" />
-
-</svg>
diff --git a/data/defaults.ini b/data/defaults.ini
deleted file mode 100644 (file)
index 9c669b2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-[aweather]
-initial_site=KIND
-nexrad_url=http://mesonet.agron.iastate.edu/data/
-log_level=7
-
-[gis]
-offline=false
-
-[example]
-enabled=true
-
-[ridge]
-enabled=false
-
-[radar]
-enabled=true
diff --git a/data/main.ui b/data/main.ui
deleted file mode 100644 (file)
index 18d705b..0000000
+++ /dev/null
@@ -1,920 +0,0 @@
-<?xml version="1.0"?>
-<interface>
-  <requires lib="gtk+" version="2.16"/>
-  <!-- interface-naming-policy project-wide -->
-  <object class="GtkListStore" id="times">
-    <columns>
-      <!-- column-name time -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkTreeStore" id="sites">
-    <columns>
-      <!-- column-name label -->
-      <column type="gchararray"/>
-      <!-- column-name code -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkListStore" id="plugins">
-    <columns>
-      <!-- column-name plugin -->
-      <column type="gchararray"/>
-      <!-- column-name enabled -->
-      <column type="gboolean"/>
-    </columns>
-  </object>
-  <object class="GtkWindow" id="main_window">
-    <property name="title" translatable="yes">AWeather</property>
-    <child>
-      <object class="GtkVBox" id="main_body">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkMenuBar" id="main_menu">
-            <property name="visible">True</property>
-            <child>
-              <object class="GtkMenuItem" id="main_menu_file">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_File</property>
-                <property name="use_underline">True</property>
-                <child type="submenu">
-                  <object class="GtkMenu" id="main_menu_file_menu">
-                    <property name="visible">True</property>
-                    <child>
-                      <object class="GtkCheckMenuItem" id="main_menu_file_offline">
-                        <property name="visible">True</property>
-                        <property name="tooltip_text" translatable="yes">Work offline</property>
-                        <property name="related_action">offline</property>
-                        <property name="use_action_appearance">True</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkImageMenuItem" id="main_menu_file_prefs">
-                        <property name="visible">True</property>
-                        <property name="related_action">prefs</property>
-                        <property name="use_action_appearance">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkSeparatorMenuItem" id="main_menu_file_0">
-                        <property name="visible">True</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkImageMenuItem" id="main_menu_file_quit">
-                        <property name="visible">True</property>
-                        <property name="related_action">quit</property>
-                        <property name="use_action_appearance">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkMenuItem" id="main_menu_view">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_View</property>
-                <property name="use_underline">True</property>
-                <child type="submenu">
-                  <object class="GtkMenu" id="main_menu_view_menu">
-                    <property name="visible">True</property>
-                    <child>
-                      <object class="GtkImageMenuItem" id="main_menu_view_zoomin">
-                        <property name="visible">True</property>
-                        <property name="related_action">zoomin</property>
-                        <property name="use_action_appearance">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkImageMenuItem" id="main_menu_view_zoomout">
-                        <property name="visible">True</property>
-                        <property name="related_action">zoomout</property>
-                        <property name="use_action_appearance">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkSeparatorMenuItem" id="main_menu_view_0">
-                        <property name="visible">True</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkImageMenuItem" id="main_menu_view_refresh">
-                        <property name="visible">True</property>
-                        <property name="related_action">refresh</property>
-                        <property name="use_action_appearance">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkMenuItem" id="main_menu_help">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_Help</property>
-                <property name="use_underline">True</property>
-                <child type="submenu">
-                  <object class="GtkMenu" id="main_menu_help_menu">
-                    <property name="visible">True</property>
-                    <child>
-                      <object class="GtkImageMenuItem" id="main_menu_help_about">
-                        <property name="visible">True</property>
-                        <property name="related_action">about</property>
-                        <property name="use_action_appearance">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkToolbar" id="main_toolbar">
-            <property name="visible">True</property>
-            <property name="toolbar_style">icons</property>
-            <child>
-              <object class="GtkToolButton" id="main_tb_zoomin">
-                <property name="visible">True</property>
-                <property name="related_action">zoomin</property>
-                <property name="use_action_appearance">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkToolButton" id="main_tb_zoomout">
-                <property name="visible">True</property>
-                <property name="related_action">zoomout</property>
-                <property name="use_action_appearance">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkSeparatorToolItem" id="main_tb_0">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkToggleToolButton" id="main_tb_offline">
-                <property name="visible">True</property>
-                <property name="related_action">offline</property>
-                <property name="use_action_appearance">True</property>
-                <property name="label" translatable="yes">toolbutton3</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkToolButton" id="main_tb_refresh">
-                <property name="visible">True</property>
-                <property name="related_action">refresh</property>
-                <property name="use_action_appearance">True</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkSeparatorToolItem" id="main_tb_1">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkToolButton" id="main_tb_prefs">
-                <property name="visible">True</property>
-                <property name="related_action">prefs</property>
-                <property name="use_action_appearance">True</property>
-                <property name="label" translatable="yes">toolbutton1</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkVPaned" id="main_0">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <child>
-              <object class="GtkHPaned" id="main_paned">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <child>
-                  <object class="GtkLabel" id="main_placeholder">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">placeholder
-(it's buggy with blank placeholders)</property>
-                    <property name="justify">center</property>
-                  </object>
-                  <packing>
-                    <property name="resize">False</property>
-                    <property name="shrink">True</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkVBox" id="main_1">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">5</property>
-                    <child>
-                      <object class="GtkExpander" id="main_site_0">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="expanded">True</property>
-                        <property name="use_markup">True</property>
-                        <child>
-                          <object class="GtkComboBox" id="main_site">
-                            <property name="visible">True</property>
-                            <property name="model">sites</property>
-                            <property name="add_tearoffs">True</property>
-                            <signal name="changed" handler="on_site_changed"/>
-                            <child>
-                              <object class="GtkCellRendererText" id="main_site_rend"/>
-                              <attributes>
-                                <attribute name="text">0</attribute>
-                              </attributes>
-                            </child>
-                          </object>
-                        </child>
-                        <child type="label">
-                          <object class="GtkLabel" id="main_site_label">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">&lt;b&gt;Site&lt;/b&gt;</property>
-                            <property name="use_markup">True</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkExpander" id="main_time_0">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="expanded">True</property>
-                        <child>
-                          <object class="GtkScrolledWindow" id="main_time_1">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="hscrollbar_policy">never</property>
-                            <property name="vscrollbar_policy">automatic</property>
-                            <property name="shadow_type">in</property>
-                            <child>
-                              <object class="GtkTreeView" id="main_time">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="model">times</property>
-                                <property name="headers_visible">False</property>
-                                <signal name="row_activated" handler="on_time_changed"/>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                        <child type="label">
-                          <object class="GtkLabel" id="main_time_label">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">&lt;b&gt;Time&lt;/b&gt;</property>
-                            <property name="use_markup">True</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="resize">False</property>
-                    <property name="shrink">True</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="resize">True</property>
-                <property name="shrink">False</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkNotebook" id="main_tabs">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="tab_pos">bottom</property>
-              </object>
-              <packing>
-                <property name="resize">False</property>
-                <property name="shrink">False</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="position">2</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
-  <object class="GtkToggleAction" id="offline">
-    <property name="label">Offline</property>
-    <property name="stock_id">gtk-disconnect</property>
-    <signal name="toggled" handler="on_offline"/>
-  </object>
-  <object class="GtkAction" id="quit">
-    <property name="label">Quit</property>
-    <property name="stock_id">gtk-quit</property>
-    <signal name="activate" handler="on_quit"/>
-  </object>
-  <object class="GtkAction" id="zoomin">
-    <property name="label">Zoom In</property>
-    <property name="stock_id">gtk-zoom-in</property>
-    <signal name="activate" handler="on_zoomin"/>
-  </object>
-  <object class="GtkAction" id="zoomout">
-    <property name="label">Zoom Out</property>
-    <property name="stock_id">gtk-zoom-out</property>
-    <signal name="activate" handler="on_zoomout"/>
-  </object>
-  <object class="GtkAction" id="refresh">
-    <property name="label">Refresh</property>
-    <property name="stock_id">gtk-refresh</property>
-    <signal name="activate" handler="on_refresh"/>
-  </object>
-  <object class="GtkAction" id="about">
-    <property name="label">About</property>
-    <property name="stock_id">gtk-about</property>
-    <signal name="activate" handler="gtk_window_present" object="about_window"/>
-  </object>
-  <object class="GtkAction" id="prefs">
-    <property name="stock_id">gtk-preferences</property>
-    <signal name="activate" handler="gtk_window_present" object="prefs_window"/>
-  </object>
-  <object class="GtkDialog" id="prefs_window">
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">Preferences - AWeather</property>
-    <property name="type_hint">normal</property>
-    <property name="transient_for">main_window</property>
-    <property name="has_separator">False</property>
-    <signal name="response" handler="gtk_widget_hide" object="prefs_window"/>
-    <signal name="delete_event" handler="gtk_widget_hide_on_delete"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="prefs_0">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child>
-          <object class="GtkNotebook" id="prefs_notebook">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <child>
-              <object class="GtkVBox" id="prefs_general_0">
-                <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <object class="GtkFrame" id="prefs_general_1">
-                    <property name="visible">True</property>
-                    <property name="label_xalign">0</property>
-                    <property name="shadow_type">none</property>
-                    <child>
-                      <object class="GtkAlignment" id="prefs_general_2">
-                        <property name="visible">True</property>
-                        <property name="left_padding">12</property>
-                        <child>
-                          <object class="GtkVBox" id="prefs_general_3">
-                            <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
-                            <property name="spacing">5</property>
-                            <child>
-                              <object class="GtkCheckButton" id="prefs_general_offline">
-                                <property name="label" translatable="yes">Work offline</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="related_action">offline</property>
-                                <property name="draw_indicator">True</property>
-                              </object>
-                              <packing>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHBox" id="prefs_general_site_0">
-                                <property name="visible">True</property>
-                                <property name="spacing">5</property>
-                                <child>
-                                  <object class="GtkLabel" id="prefs_general_site_label">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Initial site</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkComboBox" id="prefs_general_site">
-                                    <property name="visible">True</property>
-                                    <property name="model">sites</property>
-                                    <signal name="changed" handler="on_initial_site_changed"/>
-                                    <child>
-                                      <object class="GtkCellRendererText" id="prefs_general_site_rend"/>
-                                      <attributes>
-                                        <attribute name="text">0</attribute>
-                                      </attributes>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHBox" id="prefs_general_url_0">
-                                <property name="visible">True</property>
-                                <property name="spacing">5</property>
-                                <child>
-                                  <object class="GtkLabel" id="prefs_general_url_label">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">NEXRAD URL</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkEntry" id="prefs_general_url">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <signal name="changed" handler="on_nexrad_url_changed"/>
-                                  </object>
-                                  <packing>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="position">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHBox" id="prefs_general_log_0">
-                                <property name="visible">True</property>
-                                <property name="spacing">5</property>
-                                <child>
-                                  <object class="GtkLabel" id="prefs_general_log_label">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Debug level</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="prefs_general_log">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">prefs_general_log_adj</property>
-                                    <property name="numeric">True</property>
-                                    <signal name="value_changed" handler="on_log_level_changed"/>
-                                  </object>
-                                  <packing>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="position">3</property>
-                              </packing>
-                            </child>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                    <child type="label">
-                      <object class="GtkLabel" id="prefs_general_prefs_label">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Preferences&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="prefs_general_label">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">General</property>
-              </object>
-              <packing>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkTreeView" id="prefs_plugins_view">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="prefs_plugins_label">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">Plugins</property>
-              </object>
-              <packing>
-                <property name="position">1</property>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="prefs_action">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="prefs_action_close">
-                <property name="label">gtk-close</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="0">prefs_action_close</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkAboutDialog" id="about_window">
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">About - AWeather</property>
-    <property name="window_position">center-on-parent</property>
-    <property name="type_hint">dialog</property>
-    <property name="transient_for">main_window</property>
-    <property name="has_separator">False</property>
-    <property name="program_name">AWeather</property>
-    <property name="version">(beta)</property>
-    <property name="copyright" translatable="yes">Copyright &#xA9;2008-2009 Andy Spencer</property>
-    <property name="comments" translatable="yes">A semi-advanced weather viewer</property>
-    <property name="website">http://lug.rose-hulman.edu/wiki/AWeather</property>
-    <property name="license" translatable="yes">                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. &lt;http://fsf.org/&gt; Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for software and other kinds of works.
-
-  The licenses for most software and other practical works are designed to take away your freedom to share and change the works.  By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.  We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors.  You can apply it to your programs, too.
-
-  When we speak of free software, we are referring to freedom, not price.  Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights.  Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received.  You must make sure that they, too, receive or can get the source code.  And you must show them these terms so they know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software.  For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
-
-  Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so.  This is fundamentally incompatible with the aim of protecting users' freedom to change the software.  The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable.  Therefore, we have designed this version of the GPL to prohibit the practice for those products.  If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.  States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary.  To prevent this, the GPL assures that patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this License.  Each licensee is addressed as "you".  "Licensees" and "recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy.  The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based on the Program.
-
-  To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy.  Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other parties to make or receive copies.  Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License.  If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.  
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work for making modifications to it.  "Object code" means any non-source form of a work.
-
-  A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form.  A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities.  However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work.  For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
-
-  The Corresponding Source for a work in source code form is that same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met.  This License explicitly affirms your unlimited permission to run the unmodified Program.  The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work.  This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force.  You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright.  Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under the conditions stated below.  Sublicensing is not allowed; section 10 makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
-
-  When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7.  This requirement modifies the requirement in section 4 to "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy.  This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged.  This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
-
-  A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit.  Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source.  This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
-
-    d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge.  You need not require recipients to copy the Corresponding Source along with the object code.  If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source.  Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling.  In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage.  For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product.  A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source.  The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
-
-  If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information.  But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
-
-  The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed.  Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions.  Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law.  If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it.  (Additional permissions may be written to require their own removal in certain cases when you modify the work.)  You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
-
-  All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10.  If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term.  If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly provided under this License.  Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
-
-  However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License.  If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or run a copy of the Program.  Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance.  However, nothing other than this License grants you permission to propagate or modify any covered work.  These actions infringe copyright if you do not accept this License.  Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License.  You are not responsible for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations.  If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License.  For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based.  The work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version.  For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement).  To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients.  "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License.  You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License.  If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all.  For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work.  The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time.  Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation.  If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
-
-  Later license versions may give you additional or different permissions.  However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
-
-    &lt;one line to give the program's name and a brief idea of what it does.&gt; Copyright (C) &lt;year&gt;  &lt;name of author&gt;
-
-    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 &lt;http://www.gnu.org/licenses/&gt;.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
-
-    &lt;program&gt;  Copyright (C) &lt;year&gt;  &lt;name of author&gt; This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.  This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License.  Of course, your program's commands might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary.  For more information on this, and how to apply and follow the GNU GPL, see &lt;http://www.gnu.org/licenses/&gt;.
-
-  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 &lt;http://www.gnu.org/philosophy/why-not-lgpl.html&gt;.
-</property>
-    <property name="authors">Andy Spencer &lt;andy753421@gmail.com&gt;</property>
-    <property name="wrap_license">True</property>
-    <signal name="response" handler="gtk_widget_hide"/>
-    <signal name="delete_event" handler="gtk_widget_hide_on_delete"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="about_0">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child>
-          <placeholder/>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="about_action">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
-  <object class="GtkSizeGroup" id="prefs_general_size">
-    <widgets>
-      <widget name="prefs_general_site_label"/>
-      <widget name="prefs_general_url_label"/>
-      <widget name="prefs_general_log_label"/>
-    </widgets>
-  </object>
-  <object class="GtkAdjustment" id="prefs_general_log_adj">
-    <property name="upper">8</property>
-    <property name="step_increment">1</property>
-  </object>
-</interface>
index 4c995bf2f8f95d3b3f7c920e217ec0dc08d706b9..89d9401a39edb9f1ada8e8c90cc8308590a24931 100644 (file)
@@ -1,18 +1,11 @@
 AM_CPPFLAGS=$(SOUP_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS)
-GTKDOC_LIBS=$(SOUP_LIBS) $(GLIB_LIBS) $(GTK_LIBS) \
-       $(top_srcdir)/src/aweather-aweather-*.o \
-       $(top_srcdir)/src/gis/libgis*.o
+GTKDOC_LIBS=$(SOUP_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(top_srcdir)/src/libgis.la
 IGNORE_HFILES= 
-if HAVE_RSL
-GTKDOC_LIBS += $(RSL_LIBS) $(top_srcdir)/src/plugins/*.o
-else
-IGNORE_HFILES += radar.h
-endif
-DOC_MODULE=aweather
+DOC_MODULE=libgis
 DOC_SOURCE_DIR=$(top_srcdir)/src/
 DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
 MKDB_OPTIONS=--sgml-mode --output-format=xml
 include $(top_srcdir)/gtk-doc.make
-CLEANFILES += aweather-sections.txt
+CLEANFILES += libgis-sections.txt
 MAINTAINERCLEANFILES=\
-       tmpl/* Makefile.in aweather-docs.sgml aweather-overrides.txt aweather.types aweather-scan.*
+       tmpl/* Makefile.in libgis-docs.sgml libgis-overrides.txt libgis.types libgis-scan.*
diff --git a/opt/.gitignore b/opt/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/opt/level2.c b/opt/level2.c
deleted file mode 100644 (file)
index a4ef136..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* Prototype stuff for parsing Level-II data */
-/*
- * TODO: ARGG, the packet sizses are all wrong..
- *       Check sizes of decompressed bzip files
- *       Split things back up to seperate files
- * The second bzip contains different size packets?
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <error.h>
-#include <glib.h>
-#include <bzlib.h>
-#include "level2.h"
-
-/* Not used in favor of RSL */
-level2_packet_t **level2_split_packets(char *data, int *num_packets, int data_size)
-{
-       int packet_i = 0;
-       level2_packet_t  *packet = (level2_packet_t *)data;
-       int max_packets = 128;
-       level2_packet_t **packets = malloc(sizeof(level2_packet_t *)*max_packets);
-       while ((void *)packet < (void *)(data+data_size)) {
-               /* Increase packets size if necessasairy */
-               if (packet_i >= max_packets) {
-                       max_packets *= 2;
-                       packets = realloc(packets, sizeof(level2_packet_t *)*max_packets);
-               }
-
-               /* Fix byte order for packet */
-               packet->size = g_ntohs(packet->size);
-               packet->seq  = g_ntohs(packet->seq);
-               // TODO: Convert the rest of the bytes
-
-               /* Save packet location */
-               packets[packet_i] = packet;
-
-               /* Increment packet and packet_i */
-               // new =                      old              + CTM + 2*size         + fcs
-               //packet = (level2_packet_t *)( ((char *)packet) + 12  + 2*packet->size + 4 );
-               packet++;
-               packet_i++;
-       }
-       packets = realloc(packets, sizeof(level2_packet_t *)*packet_i);
-       *num_packets = packet_i;
-       return packets;
-}
-
-/* Not used in favor of RSL */
-level2_packet_t *level2_decompress(char *raw_data, int *num_packets)
-{
-       /* Read header */
-       FILE *fd = fopen(raw_data, "r");
-       if (fd == NULL)
-               error(1, errno, "Error opening files `%s'", raw_data);
-       level2_header_t header;
-       if (1 != fread(&header, sizeof(level2_header_t), 1, fd))
-               error(1, errno, "Error reading header");
-
-       /* Decompress the bzips
-        *   store the entire sequence starting at data
-        *   cur_data is for each individual bzip and is the last chunk of data */
-       char *data = NULL;
-       int data_size = 0; // size of previously decmpressed data
-       char *bz2 = NULL;  // temp buf for bzipped data
-       unsigned int _bz2_size = 0;
-       while ((int)_bz2_size >= 0) {
-               if (1 != fread(&_bz2_size, 4, 1, fd))
-                       break; //error(1, errno, "Error reading _bz2_size, pos=%x", (unsigned int)ftell(fd));
-               _bz2_size = g_ntohl(_bz2_size);
-               int bz2_size = abs(_bz2_size);
-
-               /* Read data */
-               if (NULL == (bz2 = (char *)realloc(bz2, bz2_size)))
-                       error(1, errno, "cannot allocate `%d' bytes for buffer", bz2_size);
-               if (bz2_size != fread(bz2, 1, bz2_size, fd))
-                       error(1, errno, "error reading from input file");
-
-               /* Decompress on individual bzip to the end of the sequence */
-               unsigned int cur_data_size = 1<<17;
-               int status = BZ_OUTBUFF_FULL;
-               while (status == BZ_OUTBUFF_FULL) {
-                       cur_data_size *= 2;
-                       data = realloc(data, data_size + cur_data_size);
-                       status = BZ2_bzBuffToBuffDecompress(data + data_size, &cur_data_size, bz2, bz2_size, 0, 0);
-               }
-               if (status != BZ_OK)
-                       error(1, 1, "Error decompressing data");
-               data_size += cur_data_size; // Add current chunk to decompressed data
-
-               /* Debug */
-               printf("data_size = %d, cur_data_size = %d\n", data_size, cur_data_size);
-       }
-       data = realloc(data, data_size); // free unused space at the end
-
-       return (level2_packet_t *)data;
-       //return level2_split_packets(data, num_packets, data_size);
-}
-
-
-
-int main(int argc, char **argv)
-{
-       if (argc < 2) {
-               printf("usage: %s <level2-data>\n", argv[0]);
-               return 0;
-       }
-
-       int num_packets;
-       level2_packet_t *packets = level2_decompress(argv[1], &num_packets);
-       printf("read %d packets\n", num_packets);
-       
-       //FILE *output = fopen("output.dat", "w+");
-       //fwrite(packets[i], 1, 18470816, output);
-       //fclose(output);
-
-       FILE *output = fopen("output.dat", "w+");
-       int i;
-       for (i = 0; i < 10000; i++) {
-               printf("packet: size=%x, seq=%d\n", g_ntohs(packets[i].size), g_ntohs(packets[i].seq));
-               fwrite("################", 1, 16, output);
-               fwrite(packets+i, 1, sizeof(level2_packet_t), output);
-       }
-       fclose(output);
-
-       return 0;
-}
diff --git a/opt/level2.h b/opt/level2.h
deleted file mode 100644 (file)
index c0f10cb..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-#ifndef LEVEL2_H
-#define LEVEL2_H
-
-/* http://www.ncdc.noaa.gov/oa/radar/leveliidoc.html */
-typedef struct {
-       /* 24 bytes */
-       char version[4];
-       char unknown0[16];
-       char station[4];
-} __attribute__ ((packed)) level2_header_t;
-
-typedef struct {
-       /**
-        * Channel Terminal Manager:
-        *
-        * Archive II (the data tape) is a copy of messages or data packets
-        * prepared for transmission from the RDA to the RPG.  CTM information
-        * is attached to a message or data packet for checking data integrity
-        * during the transmission process and is of no importance to the base
-        * data (omit or read past these bytes).
-        */
-       short ctm[6]; // ignore
-
-       /**
-        * Message Header:
-        *
-        * This information is used to identify either base data or one of
-        * thirteen types of messages that may follow in bytes 28 - 2431.  This
-        * header includes the information indicated below:
-        */
-       // Message size in halfwords measure from this halfword to the end of
-       // record.
-       unsigned short size;
-
-       // Channel ID:
-       //   0 = Non-Redundant Site
-       //   1 = Redundant Site Channel 1
-       //   2 = Redundant Site Channel 2
-       unsigned char id;
-
-       // Message type, where:
-       //   1  = DIGITAL RADAR DATA (This message  may contain a combination of
-       //        either reflectivity, aliased velocity, or spectrum width)
-       //   2  = RDA STATUS DATA.
-       //   3  = PERFORMANCE/MAINTENANCE DATA.
-       //   4  = CONSOLE MESSAGE - RDA TO RPG.
-       //   5  = MAINTENANCE LOG DATA.
-       //   6  = RDA CONTROL COMMANDS.
-       //   7  = VOLUME COVERAGE PATTERN.
-       //   8  = CLUTTER CENSOR ZONES.
-       //   9  = REQUEST FOR DATA.
-       //   10 = CONSOLE MESSAGE - RPG TO RDA.
-       //   11 = LOOP BACK TEST  - RDA TO RPG.
-       //   12 = LOOP BACK TEST  - RPG TO RDA.
-       //   13 = CLUTTER FILTER BYPASS MAP - RDA to RPG.
-       //   14 = EDITED CLUTTER FILTER BYPASS MAP - RPG to RDA.
-       unsigned char type;
-
-       // I.D. Sequence = 0 to 7FFF, then roll over back to 0.
-       unsigned short seq;
-
-       // Modified Julian date starting from 1/1/70
-       unsigned short gen_date;
-
-       // Generation time of messages in milliseconds of day past midnight
-       // (UTC). This time may be different than time listed in halfwords
-       // 15-16 defined below.
-       unsigned int   gen_time;
-
-       // Number of message segments.  Messages larger than message size
-       // (halfword 7 defined above) are segmented and recorded in separate
-       // data packets.
-       unsigned short num_seg;
-
-       // Message segment number.
-       unsigned short seg;
-
-       /**
-        * Digital Radar Data Header:
-         * 
-        * This information describes the date, time, azimuth, elevation, and
-        * type of base data included in the radial. This header includes the
-        * following information:
-        */
-       // Collection time for this radial in milliseconds of the day from
-       // midnight (UTC).
-       unsigned int   coll_time;
-
-       // Modified Julian date referenced from 1/1/70.
-       unsigned short coll_date;
-
-       // Unambiguous range (scaled: Value/10. = KM).
-       unsigned short range;
-       
-       // Azimuth angle (coded: [Value/8.]*[180./4096.] = DEG). An azimuth of
-       // "0 degrees" points to true north while "90 degrees" points east.
-       // Rotation is always clockwise as viewed from above the radar.
-       unsigned short angle;
-
-       // Radial number within the elevation scan.
-       unsigned short radial;
-
-       // Radial status where:
-       //   0 = START OF NEW ELEVATION.
-       //   1 = INTERMEDIATE RADIAL.
-       //   2 = END OF ELEVATION.
-       //   3 = BEGINNING OF VOLUME SCAN.
-       //   4 = END OF VOLUME SCAN.
-       unsigned short rad_status;
-
-       // Elevation angle (coded:[Value/8.]*[180./4096.] = DEG). An elevation
-       // of "0 degree" is parallel to the pedestal base while "90 degrees" is
-       // perpendicular to the pedestal base.
-       unsigned short elev_angle;
-
-       // RDA elevation number within the volume scan.
-       unsigned short elev_num;
-
-       // Range to first gate of reflectivity data (METERS). Range may be
-       // negative to account for system delays in transmitter and/or receiver
-       // components. 
-       short          first_refl;
-
-       // Range to first gate of Doppler data.  Doppler data - velocity and
-       // spectrum width (METERS).  Range may be negative to account for
-       // system delays in transmitter and/or receiver components.
-       short          first_dopp;
-
-       // Reflectivity data gate size (METERS).
-       unsigned short refl_size;
-
-       // Doppler data gate size (METERS).
-       unsigned short dopp_size;
-
-       // Number of reflectivity gates.
-       unsigned short num_refl_gate;
-
-       // Number of velocity and/or spectrum width data gates.
-       unsigned short num_dopp_gate;
-
-       // Sector number within cut.
-       unsigned short sector;
-
-       // System gain calibration constant (dB biased).
-       float          gain;
-
-       // Reflectivity data pointer (byte # from the start of  digital radar
-       // data message header). This pointer locates the beginning of
-       // reflectivity data.
-       unsigned short refl_ptr;
-
-       // Velocity data pointer (byte # from the start of digital radar data
-       // message header). This pointer locates beginning of velocity data.
-       unsigned short vel_ptr;
-
-       // Spectrum-width pointer (byte # from the start of  digital radar data
-       // message header). This pointer locates beginning of spectrum-width
-       // data.
-       unsigned short spec_ptr;
-
-       // Doppler velocity resolution.
-       //   Value of: 2 = 0.5 m/s
-       //             4 = 1.0 
-       unsigned short dopp_res;
-
-       // Volume coverage pattern.
-       //   Value of: 11 = 16 elev. scans/ 5 mins.
-       //             21 = 11 elev. scans/ 6 mins.
-       //             31 = 8 elev. scans/ 10 mins.
-       //             32 = 7 elev. scans/ 10 mins.
-       unsigned short pattern;
-
-       // Unused.  Reserved for V&V Simulator.
-       short          vv_sim[4];
-
-       // Reflectivity data pointer for Archive II playback. Archive II
-       // playback pointer used exclusively by RDA.
-       unsigned short refl_ptr_rda;
-       
-       // Velocity data pointer for Archive II playback. Archive II playback
-       // pointer used exclusively by RDA.
-       unsigned short vel_ptr_rda;
-
-       // Spectrum-width data pointer for Archive II playback. Archive II
-       // playback pointer used exclusively by RDA.
-       unsigned short spec_ptr_rda;
-
-       // Nyquist velocity (scaled: Value/100. = M/S).
-       unsigned short nyquist;
-
-       // Atmospheric attenuation factor (scaled: [Value/1000. = dB/KM]).
-       unsigned short atten;
-
-       // Threshold parameter for minimum difference in echo power between two
-       // resolution volumes for them not to be labeled range ambiguous
-       // (i.e.,overlaid) [Value/10. = Watts].
-       short          thresh;
-
-       // Unused.
-       short          unused0[17];
-
-       /**
-        * Base Data:
-        *
-        * This information includes the three base data moments; reflectivity,
-        * velocity and spectrum width.  Depending on the collection method, up
-        * to three base data moments may exist in this section of the packet.
-        * (For this example, only reflectivity is present.) Base data is coded
-        * and placed in a single byte and is archived in the following format:
-        */
-       // A bit confsued by these docs.
-       // Note: Need to check size field to get correct size.
-       unsigned char data[2300];
-
-       // Reflectivity data (0 - 460 gates) (coded: [((Value-2)/2.)-32. =
-       // dBZ], for Value of 0 or 1 see note below).
-        //unsigned char refl[460];
-
-       // Doppler velocity data (coded: for doppler velocity resolution of 0.5
-       // M/S, [((Value-2)/2.)-63.5 = M/S]; for doppler resolution of 1.0 M/S,
-       // [(Value-2)-127.] = M/S], for Value of 0 or 1 see note below), (0 -
-       // 92 gates). Starting data location depends on length of the
-       // reflectivity field, stop location depends on length of the velocity
-       // field. Velocity data is range unambiguous out to 230 KM.
-        //unsigned char vel[920];
-        
-       // Doppler spectrum width (coded: [((Value - 2)/2.)-63.5 = M/S], for
-       // Value of 0 or 1 see note below), (0 - 920 gates). Starting data
-       // location depends on length of the reflectivity and velocity fields,
-       // stop location depends on length of the spectrum width field.
-       // Spectrum width is range unambiguous out to 230 KM.
-        //unsigned char spec[920];
-
-       // Four bytes of trailer characters referred to the Frame Check
-       // Sequence (FCS) follow the data. In cases where the three moments are
-       // not all present or the number of gates for each moment have been
-       // reduced, the record is padded out to a constant size of 1216
-       // halfwords (2432 bytes) following the trailer characters.
-       unsigned int fcs;
-} __attribute__ ((packed)) level2_packet_t;
-
-#endif
diff --git a/opt/mkfile b/opt/mkfile
deleted file mode 100644 (file)
index d3410f8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-PROGS=level2 dec
-level2_cflags=`{pkg-config --cflags glib-2.0}
-level2_libs=`{pkg-config --libs glib-2.0} -lbz2
-dec_libs=`{pkg-config --libs glib-2.0} -lbz2
-default: dec
-       ./dec ../data/KNQA_20090501_1925 KNQA_20090501_1925.raw
-       cmp ../data/KNQA_20090501_1925 KNQA_20090501_1925.raw
-<$HOME/lib/mkcommon
diff --git a/opt/rsl/rsl-1.40.ebuild b/opt/rsl/rsl-1.40.ebuild
deleted file mode 100644 (file)
index 07bc677..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-inherit eutils autotools
-
-DESCRIPTION="Radar Software Library"
-HOMEPAGE="http://trmm-fc.gsfc.nasa.gov/trmm_gv/software/rsl/index.html"
-SRC_URI="ftp://trmm-fc.gsfc.nasa.gov/software/rsl-v${PV}.tar.gz"
-S="${WORKDIR}/rsl-v${PV}"
-
-LICENSE="LGPL-2"
-SLOT="0"
-KEYWORDS="~x86"
-
-RDEPEND="sci-libs/hdf
-       media-libs/jpeg"
-DEPEND="${RDEPEND}"
-
-src_unpack() {
-       unpack ${A}
-       cd "${S}"
-       epatch "${FILESDIR}/${PN}-warnings.patch"
-       epatch "${FILESDIR}/${PN}-automake.patch"
-       epatch "${FILESDIR}/${PN}-type_str.patch"
-       epatch "${FILESDIR}/${PN}-valgrind.patch"
-       elibtoolize
-       eautoreconf
-}
-
-src_install() {
-       emake DESTDIR="${D}" install || die "install failed"
-       dodoc README CHANGES || die
-}
diff --git a/opt/rsl/rsl-automake.patch b/opt/rsl/rsl-automake.patch
deleted file mode 100644 (file)
index 1d1b308..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-diff -ru rsl-v1.40/colors/Makefile.am rsl-v1.40.new/colors/Makefile.am
---- rsl-v1.40/colors/Makefile.am       1999-12-10 03:28:38.000000000 +0000
-+++ rsl-v1.40.new/colors/Makefile.am   2008-12-27 11:26:01.000000000 +0000
-@@ -1,6 +1,6 @@
- AUTOMAKE_OPTIONS = foreign
--colordir = $(prefix)/lib/colors
-+colordir = $(datadir)/rsl/colors
- color_DATA = *.???
- EXTRA_DIST = $(color_DATA)
-diff -ru rsl-v1.40/colors/Makefile.in rsl-v1.40.new/colors/Makefile.in
---- rsl-v1.40/colors/Makefile.in       2008-12-27 11:30:45.000000000 +0000
-+++ rsl-v1.40.new/colors/Makefile.in   2008-12-27 11:26:07.000000000 +0000
-@@ -166,7 +166,7 @@
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
- AUTOMAKE_OPTIONS = foreign
--colordir = $(prefix)/lib/colors
-+colordir = $(datadir)/rsl/colors
- color_DATA = *.???
- EXTRA_DIST = $(color_DATA)
- all: all-am
-diff -ru rsl-v1.40/Makefile.am rsl-v1.40.new/Makefile.am
---- rsl-v1.40/Makefile.am      2008-10-10 20:06:57.000000000 +0000
-+++ rsl-v1.40.new/Makefile.am  2008-12-27 11:25:59.000000000 +0000
-@@ -1,73 +1,49 @@
- ## Process w/ automake.  Or, autoreconf; make ##
-+AM_CFLAGS = -DDATADIR="\"$(datadir)/rsl\""
- AUTOMAKE_OPTIONS = foreign
- SUBDIRS = . colors doc examples
- INCLUDES = -I. -I$(srcdir) -I$(prefix)/include -I$(prefix)/toolkit/include
--includedir = $(prefix)/include 
--colordir = $(libdir)/colors
--
- lib_LTLIBRARIES = librsl.la
--librsl_la_LDFLAGS = -version-info 1:40
--librsl_la_SOURCES = \
--$(rapic_c) $(radtec_c)\
--dorade.c dorade_print.c dorade_to_radar.c\
--lassen.c lassen_to_radar.c \
--edge_to_radar.c \
-- radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
-- range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
-- carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
-- ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
-- mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
-- gzip.c prune.c reverse.c fix_headers.c \
-- nsig_to_radar.c nsig.c nsig2_to_radar.c \
-- africa_to_radar.c africa.c \
-- radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
-- radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
--
--librsl_la_DEPENDENCIES = $(build_headers)
-+wsr88ddir = $(datadir)/rsl/
-+dist_wsr88d_DATA = wsr88d_locations.dat
--build_headers = rsl.h wsr88d.h toolkit_1BC-51_appl.h
-+include_HEADERS = rsl.h toolkit_1BC-51_appl.h
- headers = africa.h dorade.h lassen.h \
-           mcgill.h nsig.h radtec.h rainbow.h \
-           rapic_routines.h toga.h \
--                $(build_headers)
-+          wsr88d.h \
-+        $(include_HEADERS)
-+
-+librsl_la_LDFLAGS = -version-info 1:40
-+librsl_la_SOURCES = \
-+    $(rapic_c) $(radtec_c) \
-+    dorade.c dorade_print.c dorade_to_radar.c \
-+    lassen.c lassen_to_radar.c \
-+    edge_to_radar.c \
-+    radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
-+    range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
-+    carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
-+    ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
-+    mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
-+    gzip.c prune.c reverse.c fix_headers.c \
-+    nsig_to_radar.c nsig.c nsig2_to_radar.c \
-+    africa_to_radar.c africa.c \
-+    radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
-+    radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
-+
- rapic_c =  rapic_to_radar.c rapic.y rapic-lex.l rapic_routines.c
- radtec_c = radtec_to_radar.c radtec.c
--rsl.h: Makefile
--      @for h in $(build_headers); do \
--      echo -n "Checking substitutions in header file $$h ... "; \
--      cp $$h $$h.in; \
--      sed -e 's/RSL_VERSION_STR.*/RSL_VERSION_STR \"$(VERSION)\"/' \
--         -e 's|#define COLORDIR.*|#define COLORDIR \"$(colordir)\"|' \
--         -e 's|#define WSR88D_SITE_INFO_FILE.*|#define WSR88D_SITE_INFO_FILE \"$(libdir)/wsr88d_locations.dat\"|' \
--    < $$h.in > $$h.new; \
--      if cmp -s $$h $$h.new; then \
--       rm $$h.new; \
--       echo "$$h remains untouched."; \
--    else \
--       mv $$h.new $$h; \
--       echo "substitutions made in $$h."; \
--    fi; \
--      rm -f $$h.in; \
--    done
--
- PREFIX = rapic
- LFLAGS = -P$(PREFIX)
- YFLAGS = -d -p $(PREFIX)
- LEX_OUTPUT_ROOT = lex.$(PREFIX)
--
--install-exec-hook:
--      $(INSTALL) -d  $(includedir)
--      $(INSTALL) -m 644 rsl.h $(includedir)
--      $(INSTALL) -m 644 toolkit_1BC-51_appl.h $(includedir)
--      $(INSTALL) -m 644 wsr88d_locations.dat $(libdir)
--
- EXTRA_DIST = CHANGES CHECK_LIST Copyright GPL LGPL wsr88d_locations.dat rapic.h
- DISTCLEANFILES = rapic.c rapic-lex.c
-diff -ru rsl-v1.40/radar.c rsl-v1.40.new/radar.c
---- rsl-v1.40/radar.c  2006-08-09 19:35:53.000000000 +0000
-+++ rsl-v1.40.new/radar.c      2008-12-27 11:13:43.000000000 +0000
-@@ -60,7 +60,7 @@
- void RSL_print_version()
- {
--  printf("RSL version %s.\n", RSL_VERSION_STR);
-+  printf("RSL version %s.\n", VERSION);
- }
- /* Debug printing global variable: radar_verbose_flag */
-diff -ru rsl-v1.40/radar_to_uf.c rsl-v1.40.new/radar_to_uf.c
---- rsl-v1.40/radar_to_uf.c    2008-04-16 19:34:41.000000000 +0000
-+++ rsl-v1.40.new/radar_to_uf.c        2008-12-27 11:13:58.000000000 +0000
-@@ -316,7 +316,7 @@
-               uf_ma[37] = tm->tm_year % 100; /* Same format as data year */
-               uf_ma[38] = tm->tm_mon+1;
-               uf_ma[39] = tm->tm_mday;
--              memcpy(&uf_ma[40], "RSL" RSL_VERSION_STR, 8);
-+              memcpy(&uf_ma[40], "RSL" VERSION, 8);
-               if (little_endian()) swap2(&uf_ma[40], 8/2);
-               uf_ma[44] = (signed short)UF_NO_DATA;
-               len_ma = 45;
-diff -ru rsl-v1.40/read_write.c rsl-v1.40.new/read_write.c
---- rsl-v1.40/read_write.c     2008-10-07 22:30:06.000000000 +0000
-+++ rsl-v1.40.new/read_write.c 2008-12-27 11:14:05.000000000 +0000
-@@ -314,7 +314,7 @@
-   if (radar == NULL) return 0;
-   
-   memset(title, 0, sizeof(title));
--  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", RSL_VERSION_STR, sizeof(Range));
-+  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", VERSION, sizeof(Range));
-   n += fwrite(title, sizeof(char), sizeof(title), fp);
-   
-   memset(header_buf, 0, sizeof(header_buf));
-diff -ru rsl-v1.40/rsl.h rsl-v1.40.new/rsl.h
---- rsl-v1.40/rsl.h    2008-10-10 20:09:36.000000000 +0000
-+++ rsl-v1.40.new/rsl.h        2008-12-27 11:15:24.000000000 +0000
-@@ -27,8 +27,6 @@
- #include "config.h"
- #endif
--#define RSL_VERSION_STR "v1.40"
--
- /**********************************************************************/
- /* Configure: Define USE_TWO_BYTE_PRECISION to have RSL store internal*/
- /*            values with two bytes.  Otherwise, use one byte.        */
-@@ -46,7 +44,7 @@
- /*            so you shouldn't have to modify anything here.          */
- /**********************************************************************/
- #ifndef COLORDIR
--#define COLORDIR "/usr/local/trmm/GVBOX/lib/colors"
-+#define COLORDIR DATADIR "/colors"
- #endif
- /* These are the color table indexes. See RSL_set/get_color_table. */
-@@ -57,18 +55,18 @@
- /* The default color tables for reflectivity, velocity, spectral width,
-  * height, rainfall, and zdr.
-  */
--#define REFL_RED_FILE   COLORDIR "/red_reflectivity.clr"
--#define REFL_GREEN_FILE COLORDIR "/grn_reflectivity.clr"
--#define REFL_BLUE_FILE  COLORDIR "/blu_reflectivity.clr"
--#define VEL_RED_FILE    COLORDIR "/red_velocity.clr"
--#define VEL_GREEN_FILE  COLORDIR "/grn_velocity.clr"
--#define VEL_BLUE_FILE   COLORDIR "/blu_velocity.clr"
--#define SW_RED_FILE     COLORDIR "/red_spectral_width.clr"
--#define SW_GREEN_FILE   COLORDIR "/grn_spectral_width.clr"
--#define SW_BLUE_FILE    COLORDIR "/blu_spectral_width.clr"
--#define HEIGHT_RED_FILE   COLORDIR "/red_height.clr"
--#define HEIGHT_GREEN_FILE COLORDIR "/grn_height.clr"
--#define HEIGHT_BLUE_FILE  COLORDIR "/blu_height.clr"
-+#define REFL_RED_FILE       COLORDIR "/red_reflectivity.clr"
-+#define REFL_GREEN_FILE     COLORDIR "/grn_reflectivity.clr"
-+#define REFL_BLUE_FILE      COLORDIR "/blu_reflectivity.clr"
-+#define VEL_RED_FILE        COLORDIR "/red_velocity.clr"
-+#define VEL_GREEN_FILE      COLORDIR "/grn_velocity.clr"
-+#define VEL_BLUE_FILE       COLORDIR "/blu_velocity.clr"
-+#define SW_RED_FILE         COLORDIR "/red_spectral_width.clr"
-+#define SW_GREEN_FILE       COLORDIR "/grn_spectral_width.clr"
-+#define SW_BLUE_FILE        COLORDIR "/blu_spectral_width.clr"
-+#define HEIGHT_RED_FILE     COLORDIR "/red_height.clr"
-+#define HEIGHT_GREEN_FILE   COLORDIR "/grn_height.clr"
-+#define HEIGHT_BLUE_FILE    COLORDIR "/blu_height.clr"
- #define RAINFALL_RED_FILE   COLORDIR "/red_rainfall.clr"
- #define RAINFALL_GREEN_FILE COLORDIR "/grn_rainfall.clr"
- #define RAINFALL_BLUE_FILE  COLORDIR "/blu_rainfall.clr"
-diff -ru rsl-v1.40/wsr88d.h rsl-v1.40.new/wsr88d.h
---- rsl-v1.40/wsr88d.h 2004-03-12 17:12:09.000000000 +0000
-+++ rsl-v1.40.new/wsr88d.h     2008-12-27 11:16:01.000000000 +0000
-@@ -7,7 +7,7 @@
-  * The directory should be the same as the LIBDIR in the makefile.
-  */
- #ifndef WSR88D_SITE_INFO_FILE
--#define WSR88D_SITE_INFO_FILE "/usr/local/trmm/GVBOX/lib/wsr88d_locations.dat"
-+#define WSR88D_SITE_INFO_FILE DATADIR "/wsr88d_locations.dat"
- #endif
- /*===============================================================*/
- typedef struct {
diff --git a/opt/rsl/rsl-gzip.patch b/opt/rsl/rsl-gzip.patch
deleted file mode 100644 (file)
index 9b5f8a5..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-diff -ru rsl-v1.40.pre/africa_to_radar.c rsl-v1.40/africa_to_radar.c
---- rsl-v1.40.pre/africa_to_radar.c    2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/africa_to_radar.c        2009-05-14 10:27:13.000000000 +0000
-@@ -73,7 +73,7 @@
-   } else {
-       fp = fopen(infile, "r");
-   }
--  fp = uncompress_pipe(fp);
-+  fp = gunzip_pipe(fp);
-   n = 0;
-   
-   radar = RSL_new_radar(MAX_RADAR_VOLUMES);
-diff -ru rsl-v1.40.pre/anyformat_to_radar.c rsl-v1.40/anyformat_to_radar.c
---- rsl-v1.40.pre/anyformat_to_radar.c 2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/anyformat_to_radar.c     2009-05-14 10:27:13.000000000 +0000
-@@ -65,7 +65,7 @@
-   }
-   /* Read the magic bytes. */
--  fp = uncompress_pipe(fp); /* If gzip available. */
-+  fp = gunzip_pipe(fp); /* If gzip available. */
-   if (fread(magic, sizeof(magic), 1, fp) != 1) {
-       char *magic_str = (char *)calloc(sizeof(magic)+1, sizeof(char));
-       memcpy(magic_str, magic, sizeof(magic));
-diff -ru rsl-v1.40.pre/dorade_to_radar.c rsl-v1.40/dorade_to_radar.c
---- rsl-v1.40.pre/dorade_to_radar.c    2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/dorade_to_radar.c        2009-05-14 10:27:13.000000000 +0000
-@@ -97,7 +97,7 @@
-         return radar;
-     }
--  fp = uncompress_pipe(fp); /* Transparently, use gunzip. */
-+  fp = gunzip_pipe(fp); /* Transparently, use gunzip. */
-   /**********************************************************************/
-diff -ru rsl-v1.40.pre/gzip.c rsl-v1.40/gzip.c
---- rsl-v1.40.pre/gzip.c       2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/gzip.c   2009-05-14 10:28:40.000000000 +0000
-@@ -32,8 +32,8 @@
- /* Prototype definitions within this file. */
- int no_command (char *cmd);
--FILE *uncompress_pipe (FILE *fp);
--FILE *compress_pipe (FILE *fp);
-+FILE *gunzip_pipe (FILE *fp);
-+FILE *gzip_pipe (FILE *fp);
- /* Avoids the 'Broken pipe' message by reading the rest of the stream. */
-@@ -67,7 +67,7 @@
-   else return !0;
- }
--FILE *uncompress_pipe (FILE *fp)
-+FILE *gunzip_pipe (FILE *fp)
- {
-   /* Pass the file pointed to by 'fp' through the gzip pipe. */
-@@ -80,13 +80,13 @@
-   dup(fileno(fp));
-   fpipe = popen("gzip -q -d -f --stdout", "r");
--  if (fpipe == NULL) perror("uncompress_pipe");
-+  if (fpipe == NULL) perror("gunzip_pipe");
-   close(0);
-   dup(save_fd);
-   return fpipe;
- }
--FILE *compress_pipe (FILE *fp)
-+FILE *gzip_pipe (FILE *fp)
- {
-   /* Pass the file pointed to by 'fp' through the gzip pipe. */
-@@ -100,7 +100,7 @@
-   dup(fileno(fp));
-   fpipe = popen("gzip -q -1 -c", "w");
--  if (fpipe == NULL) perror("compress_pipe");
-+  if (fpipe == NULL) perror("gzip_pipe");
-   close(1);
-   dup(save_fd);
-   return fpipe;
-diff -ru rsl-v1.40.pre/lassen_to_radar.c rsl-v1.40/lassen_to_radar.c
---- rsl-v1.40.pre/lassen_to_radar.c    2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/lassen_to_radar.c        2009-05-14 10:27:13.000000000 +0000
-@@ -285,7 +285,7 @@
-         perror(infile);
-         return NULL;
-     }
--  f = uncompress_pipe(f); /* Transparently, use gunzip. */
-+  f = gunzip_pipe(f); /* Transparently, use gunzip. */
- #define NEW_BUFSIZ 16384
-   setvbuf(f,NULL,_IOFBF,(size_t)NEW_BUFSIZ); /* Faster i/o? */
-   
-diff -ru rsl-v1.40.pre/mcgill.c rsl-v1.40/mcgill.c
---- rsl-v1.40.pre/mcgill.c     2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/mcgill.c 2009-05-14 10:27:13.000000000 +0000
-@@ -97,7 +97,7 @@
-    120, 120, 120, 120
-    };
--FILE *uncompress_pipe (FILE *fp);
-+FILE *gunzip_pipe (FILE *fp);
- /**********************************************************************/
- mcgFile_t *mcgFileOpen(int *code, char *filename)
-@@ -131,7 +131,7 @@
-         *code = MCG_OPEN_FILE_ERR;
-         return(NULL);
-         }
--   file->fp = uncompress_pipe(file->fp); /* Transparently, use gunzip. */
-+   file->fp = gunzip_pipe(file->fp); /* Transparently, use gunzip. */
-    /* Read first (header) record from data file into buffer */
-    if (fread(buffer, sizeof(char), MCG_RECORD, file->fp) < MCG_RECORD)
-         {
-diff -ru rsl-v1.40.pre/nsig.c rsl-v1.40/nsig.c
---- rsl-v1.40.pre/nsig.c       2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/nsig.c   2009-05-14 10:27:13.000000000 +0000
-@@ -52,7 +52,7 @@
- #include "nsig.h"
--FILE *uncompress_pipe(FILE *fp);
-+FILE *gunzip_pipe(FILE *fp);
- int big_endian(void);
- int little_endian(void);
- void swap_4_bytes(void *word);
-@@ -76,7 +76,7 @@
-       return fp;
-   }
--  fp = uncompress_pipe(fp); /* Transparently gunzip. */
-+  fp = gunzip_pipe(fp); /* Transparently gunzip. */
-   return fp;
- }
-diff -ru rsl-v1.40.pre/radar_to_uf.c rsl-v1.40/radar_to_uf.c
---- rsl-v1.40.pre/radar_to_uf.c        2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/radar_to_uf.c    2009-05-14 10:27:13.000000000 +0000
-@@ -533,7 +533,7 @@
-       return;
-   }
--  fp = compress_pipe(fp);
-+  fp = gzip_pipe(fp);
-   RSL_radar_to_uf_fp(r, fp);
-   rsl_pclose(fp);
- }
-diff -ru rsl-v1.40.pre/rainbow_to_radar.c rsl-v1.40/rainbow_to_radar.c
---- rsl-v1.40.pre/rainbow_to_radar.c   2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/rainbow_to_radar.c       2009-05-14 10:27:13.000000000 +0000
-@@ -88,7 +88,7 @@
-       perror(infile);
-       return NULL;
-     }
--    fp = uncompress_pipe(fp); /* Transparently gunzip. */
-+    fp = gunzip_pipe(fp); /* Transparently gunzip. */
-     /* Read first character and verify file format. */
-diff -ru rsl-v1.40.pre/rapic_to_radar.c rsl-v1.40/rapic_to_radar.c
---- rsl-v1.40.pre/rapic_to_radar.c     2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/rapic_to_radar.c 2009-05-14 10:27:13.000000000 +0000
-@@ -22,7 +22,7 @@
-         return radar;
-       }
-   }
--  fp = uncompress_pipe(fp); /* Transparently gunzip. */
-+  fp = gunzip_pipe(fp); /* Transparently gunzip. */
-   close(0); dup(fileno(fp)); /* Redirect stdin. */
-   rapicparse();
-diff -ru rsl-v1.40.pre/read_write.c rsl-v1.40/read_write.c
---- rsl-v1.40.pre/read_write.c 2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/read_write.c     2009-05-14 10:27:13.000000000 +0000
-@@ -189,7 +189,7 @@
-       perror(infile);
-       return NULL;
-   }
--  fp = uncompress_pipe(fp);
-+  fp = gunzip_pipe(fp);
-   (void)fread(title, sizeof(char), sizeof(title), fp);
-   if (strncmp(title, "RSL", 3) != 0) return NULL;
-@@ -372,7 +372,7 @@
-       perror(outfile);
-       return -1;
-   }
--  fp = compress_pipe(fp);
-+  fp = gzip_pipe(fp);
-   n = RSL_write_radar_fp(radar, fp);
-   rsl_pclose(fp);
-diff -ru rsl-v1.40.pre/rsl.h rsl-v1.40/rsl.h
---- rsl-v1.40.pre/rsl.h        2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/rsl.h    2009-05-14 10:27:13.000000000 +0000
-@@ -697,8 +697,10 @@
- Histogram *RSL_read_histogram(char *infile);
- int no_command (char *cmd);
--FILE *uncompress_pipe (FILE *fp);
--FILE *compress_pipe (FILE *fp);
-+FILE *gunzip_pipe (FILE *fp);
-+FILE *gzip_pipe (FILE *fp);
-+FILE *bunzip2_pipe (FILE *fp);
-+FILE *bzip2_pipe (FILE *fp);
- int rsl_pclose(FILE *fp);
- /* Carpi image generation functions. These are modified clones of the
-diff -ru rsl-v1.40.pre/toga.c rsl-v1.40/toga.c
---- rsl-v1.40.pre/toga.c       2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/toga.c   2009-05-14 10:27:13.000000000 +0000
-@@ -84,7 +84,7 @@
- int tg_read_ray(tg_file_str *);
- void tg_prt_head(tg_map_head_str *,int);
--FILE *uncompress_pipe (FILE *fp);
-+FILE *gunzip_pipe (FILE *fp);
- int tg_open(char *filename,tg_file_str *tg_file)
-@@ -102,7 +102,7 @@
-    /* Unfortunately, there is no tg_close to modularize the following
-     * pipe close.  Shouldn't be any problems anyway.
-     */
--   (void) uncompress_pipe(fdopen(tg_file->fd, "r")); /* Redirect through gunzip. */
-+   (void) gunzip_pipe(fdopen(tg_file->fd, "r")); /* Redirect through gunzip. */
-    /* initialize buffer pointers, flags */
-    tg_file->buf_ind = 32769;
-    tg_file->buf_end = 32769;
-diff -ru rsl-v1.40.pre/uf_to_radar.c rsl-v1.40/uf_to_radar.c
---- rsl-v1.40.pre/uf_to_radar.c        2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/uf_to_radar.c    2009-05-14 10:27:13.000000000 +0000
-@@ -625,7 +625,7 @@
-       perror(infile);
-       return radar;
-   }
--  fp = uncompress_pipe(fp); /* Transparently gunzip. */
-+  fp = gunzip_pipe(fp); /* Transparently gunzip. */
-   radar = RSL_uf_to_radar_fp(fp);
-   rsl_pclose(fp);
-       
-diff -ru rsl-v1.40.pre/wsr88d.c rsl-v1.40/wsr88d.c
---- rsl-v1.40.pre/wsr88d.c     2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/wsr88d.c 2009-05-14 10:27:13.000000000 +0000
-@@ -246,7 +246,7 @@
-   }
-   if (wf->fptr == NULL) return NULL;
--  wf->fptr = uncompress_pipe(wf->fptr);
-+  wf->fptr = gunzip_pipe(wf->fptr);
- #define NEW_BUFSIZ 16384
-   setvbuf(wf->fptr,NULL,_IOFBF,(size_t)NEW_BUFSIZ); /* Faster i/o? */
-   return wf;
-diff -ru rsl-v1.40.pre/wsr88d.h rsl-v1.40/wsr88d.h
---- rsl-v1.40.pre/wsr88d.h     2009-05-14 10:26:55.000000000 +0000
-+++ rsl-v1.40/wsr88d.h 2009-05-14 10:27:13.000000000 +0000
-@@ -212,8 +212,8 @@
- float wsr88d_get_frequency(Wsr88d_ray *ray);
- int no_command (char *cmd);
--FILE *uncompress_pipe (FILE *fp);
--FILE *compress_pipe (FILE *fp);
-+FILE *gunzip_pipe (FILE *fp);
-+FILE *gzip_pipe (FILE *fp);
- int rsl_pclose(FILE *fp);
- #endif
diff --git a/opt/rsl/rsl-type_str.patch b/opt/rsl/rsl-type_str.patch
deleted file mode 100644 (file)
index 444d819..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
---- rsl-v1.40/wsr88d_m31.c     2008-10-08 23:43:03.000000000 +0000
-+++ rsl-mine/wsr88d_m31.c      2009-05-10 12:58:17.000000000 +0000
-@@ -546,6 +548,7 @@
-     Range (*invf)(float x);
-     float (*f)(Range x);
-     int vol_index, waveform;
-+    char *type_str;
-     enum waveforms {surveillance=1, doppler_ambres, doppler_no_ambres, batch};
-@@ -572,10 +575,10 @@
-     if (wsr88d_ray.ray_hdr.dbptr_ref > 0) {
-       vol_index = wsr88d_get_vol_index(wsr88d_ray.ref->data_hdr.dataname);
-       switch (vol_index) {
--          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; break;
--          case VR_INDEX: f = VR_F; invf = VR_INVF; break;
--          case SW_INDEX: f = SW_F; invf = SW_INVF; break;
--          default: f = DZ_F; invf = DZ_INVF; break;
-+          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; type_str = "Reflectivity";   break;
-+          case VR_INDEX: f = VR_F; invf = VR_INVF; type_str = "Velocity";       break;
-+          case SW_INDEX: f = SW_F; invf = SW_INVF; type_str = "Spectrum width"; break;
-+          default:       f = DZ_F; invf = DZ_INVF; type_str = "Unknown";        break;
-       }
-       /* If this is reflectivity, check the waveform type to make sure
-        * it isn't from a Doppler split cut.
-@@ -591,6 +594,7 @@
-               radar->v[vol_index] = RSL_new_volume(MAXSWEEPS);
-               radar->v[vol_index]->h.f = f;
-               radar->v[vol_index]->h.invf = invf;
-+                  radar->v[vol_index]->h.type_str = type_str;
-           }
-           if (radar->v[vol_index]->sweep[isweep] == NULL) {
-               radar->v[vol_index]->sweep[isweep] = RSL_new_sweep(MAXRAYS_M31);
-@@ -608,15 +612,16 @@
-     if (wsr88d_ray.ray_hdr.dbptr_vel > 0) {
-       vol_index = wsr88d_get_vol_index(wsr88d_ray.vel->data_hdr.dataname);
-       switch (vol_index) {
--          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; break;
--          case VR_INDEX: f = VR_F; invf = VR_INVF; break;
--          case SW_INDEX: f = SW_F; invf = SW_INVF; break;
--          default: f = DZ_F; invf = DZ_INVF; break;
-+          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; type_str = "Reflectivity";   break;
-+          case VR_INDEX: f = VR_F; invf = VR_INVF; type_str = "Velocity";       break;
-+          case SW_INDEX: f = SW_F; invf = SW_INVF; type_str = "Spectrum width"; break;
-+          default:       f = DZ_F; invf = DZ_INVF; type_str = "Unknown";        break;
-       }
-       if (radar->v[vol_index] == NULL) {
-           radar->v[vol_index] = RSL_new_volume(MAXSWEEPS);
-           radar->v[vol_index]->h.f = f;
-           radar->v[vol_index]->h.invf = invf;
-+          radar->v[vol_index]->h.type_str = type_str;
-       }
-       if (radar->v[vol_index]->sweep[isweep] == NULL) {
-           radar->v[vol_index]->sweep[isweep] = RSL_new_sweep(MAXRAYS_M31);
-@@ -633,15 +638,16 @@
-     if (wsr88d_ray.ray_hdr.dbptr_sw > 0) {
-       vol_index = wsr88d_get_vol_index(wsr88d_ray.sw->data_hdr.dataname);
-       switch (vol_index) {
--          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; break;
--          case VR_INDEX: f = VR_F; invf = VR_INVF; break;
--          case SW_INDEX: f = SW_F; invf = SW_INVF; break;
--          default: f = DZ_F; invf = DZ_INVF; break;
-+          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; type_str = "Reflectivity";   break;
-+          case VR_INDEX: f = VR_F; invf = VR_INVF; type_str = "Velocity";       break;
-+          case SW_INDEX: f = SW_F; invf = SW_INVF; type_str = "Spectrum width"; break;
-+          default:       f = DZ_F; invf = DZ_INVF; type_str = "Unknown";        break;
-       }
-       if (radar->v[vol_index] == NULL) {
-           radar->v[vol_index] = RSL_new_volume(MAXSWEEPS);
-           radar->v[vol_index]->h.f = f;
-           radar->v[vol_index]->h.invf = invf;
-+          radar->v[vol_index]->h.type_str = type_str;
-       }
-       if (radar->v[vol_index]->sweep[isweep] == NULL) {
-           radar->v[vol_index]->sweep[isweep] = RSL_new_sweep(MAXRAYS_M31);
diff --git a/opt/rsl/rsl-valgrind.patch b/opt/rsl/rsl-valgrind.patch
deleted file mode 100644 (file)
index bf8016b..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-diff -w -ru rsl-v1.40/wsr88d_m31.c rsl-v1.40.test/wsr88d_m31.c
---- rsl-v1.40/wsr88d_m31.c     2008-10-08 23:43:03.000000000 +0000
-+++ rsl-v1.40.test/wsr88d_m31.c        2009-05-14 10:06:23.000000000 +0000
-@@ -515,6 +515,7 @@
-     m1_ray.vol_cpat = vcp_data.vcp;
-     m1_ray.elev_num = ray_hdr.elev_num;
-     m1_ray.unam_rng = wsr88d_ray.unamb_rng;
-+    m1_ray.nyq_vel  = wsr88d_ray.nyq_vel; // TODO: is this correct?
-     if (ray_hdr.azm_res != 1)
-       ray->h.beam_width = 1.0;
-     else ray->h.beam_width = 0.5;
-@@ -603,6 +604,8 @@
-           radar->v[vol_index]->sweep[isweep]->ray[iray] = ray;
-           radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1;
-       }
-+      free(wsr88d_ray.ref->data);
-+      free(wsr88d_ray.ref);
-     }
-     if (wsr88d_ray.ray_hdr.dbptr_vel > 0) {
-@@ -628,6 +631,8 @@
-       wsr88d_load_ray_hdr(wsr88d_ray, ray);
-       radar->v[vol_index]->sweep[isweep]->ray[iray] = ray;
-       radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1;
-+      free(wsr88d_ray.vel->data);
-+      free(wsr88d_ray.vel);
-     }
-     if (wsr88d_ray.ray_hdr.dbptr_sw > 0) {
-@@ -653,6 +658,8 @@
-       wsr88d_load_ray_hdr(wsr88d_ray, ray);
-       radar->v[vol_index]->sweep[isweep]->ray[iray] = ray;
-       radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1;
-+      free(wsr88d_ray.sw->data);
-+      free(wsr88d_ray.sw);
-     }
- }
-@@ -706,15 +713,27 @@
-  * at the WSR-88D Radar Operations Center web site.
-  */
--    n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr);
--
--    /* printf("msgtype = %d\n", msghdr.msg_type); */
--    msg_hdr_size = sizeof(Wsr88d_msg_hdr) - sizeof(msghdr.rpg);
-     radar = RSL_new_radar(MAX_RADAR_VOLUMES);
-     
-     while (! end_of_vos) {
-+      /* Read current header */
-+      n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr);
-+      if (n < 1) {
-+          fprintf(stderr,"Warning: load_wsr88d_m31_into_radar: ");
-+          if (feof(wf->fptr) != 0) fprintf(stderr,
-+                  "Unexpected end of file.\n");
-+          else fprintf(stderr,"Failed reading msghdr.\n");
-+          fprintf(stderr,"Current sweep number: %d\n"
-+                  "Last ray read: %d\n", isweep+1, iray);
-+          wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
-+          return radar;
-+      }
-+
-+      /* printf("msgtype = %d\n", msghdr.msg_type); */
-+      msg_hdr_size = sizeof(Wsr88d_msg_hdr) - sizeof(msghdr.rpg);
-+
-       if (msghdr.msg_type == 31) {
-           if (little_endian()) wsr88d_swap_m31_hdr(&msghdr);
-@@ -729,6 +748,18 @@
-           /* Load this ray into radar structure ray. */
-           wsr88d_load_ray_into_radar(wsr88d_ray, isweep, iray, radar);
-           iray++;
-+
-+          /* Check for end of sweep */
-+          if (wsr88d_ray.ray_hdr.radial_status == END_OF_ELEV) {
-+              wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
-+              isweep++;
-+              iray = 0;
-+          }
-+
-+          if (wsr88d_ray.ray_hdr.radial_status == END_VOS) {
-+              //wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
-+              end_of_vos = 1;
-+          }
-       }
-       else { /* msg_type not 31 */
-           n = fread(&non31_seg_remainder, sizeof(non31_seg_remainder), 1,
-@@ -748,33 +779,11 @@
-               radar->h.vcp = vcp_data.vcp;
-               /* printf("VCP = %d\n", vcp_data.vcp); */
-           }
-+          /* TODO: check for end of sweep/volume */
-       }
--      /* Check for end of sweep */
--      if (wsr88d_ray.ray_hdr.radial_status == END_OF_ELEV) {
--          wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
--          isweep++;
--          iray = 0;
--      }
--
--      if (wsr88d_ray.ray_hdr.radial_status != END_VOS) {
--          n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr);
--          if (n < 1) {
--              fprintf(stderr,"Warning: load_wsr88d_m31_into_radar: ");
--              if (feof(wf->fptr) != 0) fprintf(stderr,
--                      "Unexpected end of file.\n");
--              else fprintf(stderr,"Failed reading msghdr.\n");
--              fprintf(stderr,"Current sweep number: %d\n"
--                      "Last ray read: %d\n", isweep+1, iray);
--              wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
--              return radar;
--          }
--      }
--      else {
-+      if (feof(wf->fptr) != 0)
-           end_of_vos = 1;
--          wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
--      }
--      if (feof(wf->fptr) != 0) end_of_vos = 1;
-     }
-     return radar;
-diff -w -ru rsl-v1.40/wsr88d_to_radar.c rsl-v1.40.test/wsr88d_to_radar.c
---- rsl-v1.40/wsr88d_to_radar.c        2008-07-30 22:41:20.000000000 +0000
-+++ rsl-v1.40.test/wsr88d_to_radar.c   2009-05-14 10:07:09.000000000 +0000
-@@ -429,5 +429,6 @@
-       radar->h.lpulse = sitep->lpulse;
-               
-   radar = RSL_prune_radar(radar);
-+  free(sitep);
-   return radar;
- }
diff --git a/opt/rsl/rsl-warnings.patch b/opt/rsl/rsl-warnings.patch
deleted file mode 100644 (file)
index ece00f3..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-diff -ru rsl-v1.40/africa.c warnings/africa.c
---- rsl-v1.40/africa.c 1999-12-01 03:48:29.000000000 +0000
-+++ warnings/africa.c  2008-12-27 11:53:44.000000000 +0000
-@@ -22,6 +22,7 @@
- */
- #include <stdio.h>
- #include <stdlib.h>
-+#include <string.h>
- #include "africa.h"
- int africa_read_buffer(FILE *fp, Africa_buffer *buffer)
-diff -ru rsl-v1.40/dorade_to_radar.c warnings/dorade_to_radar.c
---- rsl-v1.40/dorade_to_radar.c        1999-12-01 03:48:29.000000000 +0000
-+++ warnings/dorade_to_radar.c 2008-12-27 11:53:44.000000000 +0000
-@@ -24,7 +24,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
--#include <strings.h>
-+#include <string.h>
- #define USE_RSL_VARS
- #include "rsl.h"
- #include "dorade.h"
-diff -ru rsl-v1.40/examples/any_to_gif.c warnings/examples/any_to_gif.c
---- rsl-v1.40/examples/any_to_gif.c    1999-01-26 16:20:25.000000000 +0000
-+++ warnings/examples/any_to_gif.c     2008-12-27 11:53:44.000000000 +0000
-@@ -73,7 +73,7 @@
- }
--void main(int argc, char **argv)
-+int main(int argc, char **argv)
- {
-   Radar *radar;
-   Sweep *sweep;
-diff -ru rsl-v1.40/examples/any_to_ppm.c warnings/examples/any_to_ppm.c
---- rsl-v1.40/examples/any_to_ppm.c    1998-09-16 18:35:56.000000000 +0000
-+++ warnings/examples/any_to_ppm.c     2008-12-27 11:53:44.000000000 +0000
-@@ -9,11 +9,12 @@
-  * the RSL.
-  *
-  */
-+#include <stdlib.h>
- #define USE_RSL_VARS
- #include "rsl.h"
--void main(int argc, char **argv)
-+int main(int argc, char **argv)
- {
-   Radar *radar;
-   Sweep *sweep;
-diff -ru rsl-v1.40/examples/cappi_image.c warnings/examples/cappi_image.c
---- rsl-v1.40/examples/cappi_image.c   1998-09-16 18:35:56.000000000 +0000
-+++ warnings/examples/cappi_image.c    2008-12-27 11:53:44.000000000 +0000
-@@ -7,6 +7,7 @@
-  */
- #include <stdio.h>
-+#include <stdlib.h>
- #include <string.h>
- #include "rsl.h"
-diff -ru rsl-v1.40/examples/dorade_main.c warnings/examples/dorade_main.c
---- rsl-v1.40/examples/dorade_main.c   1999-08-12 20:44:30.000000000 +0000
-+++ warnings/examples/dorade_main.c    2008-12-27 11:53:44.000000000 +0000
-@@ -1,4 +1,5 @@
- #include <stdio.h>
-+#include <stdlib.h>
- #include "rsl.h"
- int main(int argc, char **argv)
-diff -ru rsl-v1.40/examples/killer_sweep.c warnings/examples/killer_sweep.c
---- rsl-v1.40/examples/killer_sweep.c  1998-09-16 18:35:56.000000000 +0000
-+++ warnings/examples/killer_sweep.c   2008-12-27 11:53:44.000000000 +0000
-@@ -146,7 +146,7 @@
-   }
- }
--void main(int argc, char **argv)
-+int main(int argc, char **argv)
- {
-   Radar *radar;
-   Sweep *sweep;
-diff -ru rsl-v1.40/examples/kwaj_subtract_one_day.c warnings/examples/kwaj_subtract_one_day.c
---- rsl-v1.40/examples/kwaj_subtract_one_day.c 1999-08-13 14:26:40.000000000 +0000
-+++ warnings/examples/kwaj_subtract_one_day.c  2008-12-27 11:53:44.000000000 +0000
-@@ -1,3 +1,4 @@
-+#include <stdlib.h>
- #include "rsl.h"
- /**********************************************************************/
-diff -ru rsl-v1.40/examples/lassen_to_gif.c warnings/examples/lassen_to_gif.c
---- rsl-v1.40/examples/lassen_to_gif.c 1998-09-16 18:35:56.000000000 +0000
-+++ warnings/examples/lassen_to_gif.c  2008-12-27 11:53:44.000000000 +0000
-@@ -4,9 +4,10 @@
-  * This program can read the file from stdin.
-  */
-+#include <stdlib.h>
- #include "rsl.h"
--void main(int argc, char **argv)
-+int main(int argc, char **argv)
- {
-   Radar *radar;
-diff -ru rsl-v1.40/examples/print_hash_table.c warnings/examples/print_hash_table.c
---- rsl-v1.40/examples/print_hash_table.c      1998-09-16 18:35:56.000000000 +0000
-+++ warnings/examples/print_hash_table.c       2008-12-27 11:53:44.000000000 +0000
-@@ -9,6 +9,7 @@
-  *
-  */
-+#include <stdlib.h>
- #include "rsl.h"
- void print_link_list(Azimuth_hash *list)
-@@ -87,7 +88,7 @@
- }
--void main(int argc, char **argv)
-+int main(int argc, char **argv)
- {
-   Radar *radar;
-   Sweep *sweep;
-diff -ru rsl-v1.40/examples/sector.c warnings/examples/sector.c
---- rsl-v1.40/examples/sector.c        1998-09-16 18:35:57.000000000 +0000
-+++ warnings/examples/sector.c 2008-12-27 11:53:44.000000000 +0000
-@@ -1,4 +1,5 @@
- #include <stdio.h>
-+#include <stdlib.h>
- #include "rsl.h"
- /*
-@@ -84,7 +85,7 @@
- }
--void main(int argc, char **argv)
-+int main(int argc, char **argv)
- {
-   Radar *radar;
-   Sweep *sector;
-diff -ru rsl-v1.40/examples/wsr88d_to_gif.c warnings/examples/wsr88d_to_gif.c
---- rsl-v1.40/examples/wsr88d_to_gif.c 1998-09-16 18:35:57.000000000 +0000
-+++ warnings/examples/wsr88d_to_gif.c  2008-12-27 11:53:44.000000000 +0000
-@@ -14,9 +14,10 @@
-  * wsr88d_to_gif file [tape_header_file]
-  */
-+#include <stdlib.h>
- #include "rsl.h"
--void main(int argc, char **argv)
-+int main(int argc, char **argv)
- {
-   Radar *radar;
-diff -ru rsl-v1.40/lassen_to_radar.c warnings/lassen_to_radar.c
---- rsl-v1.40/lassen_to_radar.c        2008-07-24 13:40:50.000000000 +0000
-+++ warnings/lassen_to_radar.c 2008-12-27 11:53:44.000000000 +0000
-@@ -31,6 +31,7 @@
- */
- #include <stdio.h>
-+#include <stdlib.h>
- #include <unistd.h>
- #include <string.h>
- #include <math.h>
-diff -ru rsl-v1.40/rainbow.c warnings/rainbow.c
---- rsl-v1.40/rainbow.c        2004-02-10 17:10:28.000000000 +0000
-+++ warnings/rainbow.c 2008-12-27 11:53:44.000000000 +0000
-@@ -22,6 +22,7 @@
- */
- #include <stdio.h>
-+#include <stdlib.h>
- #include <string.h>
- #include "rsl.h"
- #include "rainbow.h"
-diff -ru rsl-v1.40/rainbow_to_radar.c warnings/rainbow_to_radar.c
---- rsl-v1.40/rainbow_to_radar.c       2004-02-11 16:54:37.000000000 +0000
-+++ warnings/rainbow_to_radar.c        2008-12-27 11:53:44.000000000 +0000
-@@ -22,6 +22,7 @@
- */
- #include <stdio.h>
-+#include <stdlib.h>
- #include <string.h>
- #include "rsl.h"
- #include "rainbow.h"
-diff -ru rsl-v1.40/wsr88d_m31.c warnings/wsr88d_m31.c
---- rsl-v1.40/wsr88d_m31.c     2008-10-08 23:43:03.000000000 +0000
-+++ warnings/wsr88d_m31.c      2008-12-27 11:53:44.000000000 +0000
-@@ -25,6 +25,8 @@
-  * This file contains routines for processing Message Type 31, the digital
-  * radar message type introduced in WSR-88D Level II Build 10.
-  */
-+#include <stdlib.h>
-+#include <string.h>
- #include "rsl.h"
- #include "wsr88d.h"
index 488081715d85f0b50be1f1b910da29200509f584..28720c380df7808dcdfe06e616469dbce8cc0b02 100644 (file)
@@ -1,11 +1,12 @@
 *.la
 *.lo
 *.o
-*.so
+*.pc
 *.prof
+*.so
 .deps
 .libs
+gis-marshal.*
+gis_test
 gmon.*
-aweather
-level2
-wsr88ddec
+wms_test
index f8c79e8a9b0ad3d64d41927b9550fb308c98d430..bb6a37c7409867e56f8ff887200b80b0e6c2b708 100644 (file)
@@ -1,27 +1,73 @@
-SUBDIRS = gis plugins
-
 AM_CFLAGS   = -Wall --std=gnu99 
 AM_CPPFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(SOUP_CFLAGS)
 AM_LDADD    = $(GLIB_LIBS) $(GTK_LIBS) $(SOUP_LIBS)
 
-bin_PROGRAMS = aweather wsr88ddec
-aweather_SOURCES  = main.c \
-       aweather-gui.c      aweather-gui.h \
-       aweather-location.c aweather-location.h
-aweather_CPPFLAGS = $(AM_CPPFLAGS) -DDATADIR="\"$(datadir)\""
-aweather_LDADD    = $(AM_LDADD) gis/libgis.la
+# Library
+BUILT_SOURCES = gis-marshal.c gis-marshal.h
+lib_LTLIBRARIES  = libgis.la
+gis_includedir = $(includedir)/gis
+gis_include_HEADERS = \
+       gis.h         \
+       gis-world.h   \
+       gis-view.h    \
+       gis-prefs.h   \
+       gis-opengl.h  \
+       gis-plugin.h  \
+       gis-data.h    \
+       gpqueue.h     \
+       roam.h        \
+       wms.h
+libgis_la_SOURCES = \
+       gis-world.c   gis-world.h   \
+       gis-view.c    gis-view.h    \
+       gis-prefs.c   gis-prefs.h   \
+       gis-opengl.c  gis-opengl.h  \
+       gis-plugin.c  gis-plugin.h  \
+       gis-marshal.c gis-marshal.h \
+       gis-data.c    gis-data.h    \
+       roam.c        roam.h        \
+       wms.c         wms.h         \
+       gpqueue.c     gpqueue.h
+libgis_la_CPPFLAGS = $(AM_CPPFLAGS) \
+       -DDATADIR="\"$(datadir)\"" -DPLUGINDIR="\"$(libdir)/gis\""
+libgis_la_LIBADD = $(AM_LDADD)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libgis.pc
+
+# Test programs
+bin_PROGRAMS = gis_test wms_test
 
-wsr88ddec       = wsr88ddec.c
-wsr88ddec_LDADD = -lbz2
+gis_test_SOURCES  = gis_test.c gis.h
+gis_test_LDADD    = $(AM_LDADD) .libs/libgis.a
+
+wms_test_SOURCES  = wms_test.c gis-world.c gis-world.h wms.c wms.h
+wms_test_LDADD    = $(AM_LDADD)
 
-CLEANFILES = gmon.out valgrind.out
 MAINTAINERCLEANFILES = Makefile.in
 
+.list.c:
+       glib-genmarshal --prefix=gis_cclosure_marshal --body   $< > $@
+.list.h:
+       glib-genmarshal --prefix=gis_cclosure_marshal --header $< > $@
+
 test: all
-       LD_LIBRARY_PATH=gis/.libs .libs/aweather -o -d 7 -s KVNX
+       ./gis_test
 
 gdb: all
-       LD_LIBRARY_PATH=gis/.libs gdb .libs/aweather
+       LD_LIBRARY_PATH=.libs gdb .libs/gis_test
 
 ddd: all
-       LD_LIBRARY_PATH=gis/.libs ddd .libs/aweather
+       LD_LIBRARY_PATH=.libs ddd .libs/gis_test
+
+memcheck: all
+       LD_LIBRARY_PATH=.libs                      \
+       G_SLICE=always-malloc                      \
+       G_DEBUG=gc-friendly,resident-modules       \
+       valgrind --track-origins=yes               \
+                --leak-check=full                 \
+                --leak-resolution=high            \
+                --num-callers=100                 \
+                --suppressions=../gtk.suppression \
+                .libs/gis_test                    \
+       2> valgrind.out
diff --git a/src/aweather-gui.c b/src/aweather-gui.c
deleted file mode 100644 (file)
index 88bd966..0000000
+++ /dev/null
@@ -1,555 +0,0 @@
-/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
- * 
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-#include <math.h>
-
-#include <gis/gis.h>
-
-#include "aweather-gui.h"
-#include "aweather-location.h"
-
-
-/*************
- * Callbacks *
- *************/
-gboolean on_gui_key_press(GtkWidget *widget, GdkEventKey *event, AWeatherGui *self)
-{
-       g_debug("AWeatherGui: on_gui_key_press - key=%x, state=%x",
-                       event->keyval, event->state);
-       if (event->keyval == GDK_q)
-               gtk_widget_destroy(GTK_WIDGET(self));
-       else if (event->keyval == GDK_r && event->state & GDK_CONTROL_MASK)
-               gis_world_refresh(self->world);
-       else if (event->keyval == GDK_Tab || event->keyval == GDK_ISO_Left_Tab) {
-               GtkNotebook *tabs = GTK_NOTEBOOK(aweather_gui_get_widget(self, "main_tabs"));
-               gint num_tabs = gtk_notebook_get_n_pages(tabs);
-               gint cur_tab  = gtk_notebook_get_current_page(tabs);
-               if (event->state & GDK_SHIFT_MASK)
-                       gtk_notebook_set_current_page(tabs, (cur_tab-1)%num_tabs);
-               else 
-                       gtk_notebook_set_current_page(tabs, (cur_tab+1)%num_tabs);
-       };
-       return FALSE;
-}
-
-void on_quit(GtkMenuItem *menu, AWeatherGui *self)
-{
-       gtk_widget_destroy(GTK_WIDGET(self));
-}
-
-void on_zoomin(GtkAction *action, AWeatherGui *self)
-{
-       gis_view_zoom(self->view, 3./4);
-}
-
-void on_zoomout(GtkAction *action, AWeatherGui *self)
-{
-       gis_view_zoom(self->view, 4./3);
-}
-
-void on_refresh(GtkAction *action, AWeatherGui *self)
-{
-       gis_world_refresh(self->world);
-}
-
-void on_plugin_toggled(GtkCellRendererToggle *cell, gchar *path_str, AWeatherGui *self)
-{
-       GtkWidget    *tview = aweather_gui_get_widget(self, "prefs_plugins_view");
-       GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(tview));
-       gboolean state;
-       gchar *name;
-       GtkTreeIter iter;
-       gtk_tree_model_get_iter_from_string(model, &iter, path_str);
-       gtk_tree_model_get(model, &iter, 0, &name, 1, &state, -1);
-       state = !state;
-       gtk_list_store_set(GTK_LIST_STORE(model), &iter, 1, state, -1);
-       if (state)
-               aweather_gui_attach_plugin(self, name);
-       else
-               aweather_gui_deattach_plugin(self, name);
-       gis_prefs_set_boolean_v(self->prefs, name, "enabled", state);
-       g_free(name);
-}
-
-void on_time_changed(GtkTreeView *view, GtkTreePath *path,
-               GtkTreeViewColumn *column, AWeatherGui *self)
-{
-       gchar *time;
-       GtkTreeIter iter;
-       GtkTreeModel *model = gtk_tree_view_get_model(view);
-       gtk_tree_model_get_iter(model, &iter, path);
-       gtk_tree_model_get(model, &iter, 0, &time, -1);
-       gis_view_set_time(self->view, time);
-       g_free(time);
-}
-
-void on_site_changed(GtkComboBox *combo, AWeatherGui *self)
-{
-       gchar *site;
-       GtkTreeIter iter;
-       GtkTreeModel *model = gtk_combo_box_get_model(combo);
-       gtk_combo_box_get_active_iter(combo, &iter);
-       gtk_tree_model_get(model, &iter, 1, &site, -1);
-       gis_view_set_site(self->view, site);
-       g_free(site);
-}
-
-static gboolean gtk_tree_model_find_string(GtkTreeModel *model,
-               GtkTreeIter *rval, GtkTreeIter *parent, gint field, const gchar *key)
-{
-       g_debug("AWeatherGui: gtk_tree_model_find - field=%d key=%s", field, key);
-       char *text;
-       GtkTreeIter cur;
-       gint num_children = gtk_tree_model_iter_n_children(model, parent);
-       for (int i = 0; i < num_children; i++) {
-               gtk_tree_model_iter_nth_child(model, &cur, parent, i);
-               gtk_tree_model_get(model, &cur, field, &text, -1);
-               if (text != NULL && g_str_equal(text, key)) {
-                       *rval = cur;
-                       g_free(text);
-                       return TRUE;
-               }
-               g_free(text);
-               if (gtk_tree_model_iter_has_child(model, &cur))
-                       if (gtk_tree_model_find_string(model, rval, &cur, field, key))
-                               return TRUE;
-       }
-       return FALSE;
-}
-
-static void update_time_widget(GisView *view, const char *time, AWeatherGui *self)
-{
-       g_debug("AWeatherGui: update_time_widget - time=%s", time);
-       GtkTreeView  *tview = GTK_TREE_VIEW(aweather_gui_get_widget(self, "main_time"));
-       GtkTreeModel *model = GTK_TREE_MODEL(gtk_tree_view_get_model(tview));
-       GtkTreeIter iter;
-       if (gtk_tree_model_find_string(model, &iter, NULL, 0, time)) {
-               GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
-               g_signal_handlers_block_by_func(tview,
-                               G_CALLBACK(on_site_changed), self);
-               gtk_tree_view_set_cursor(tview, path, NULL, FALSE);
-               g_signal_handlers_unblock_by_func(tview,
-                               G_CALLBACK(on_site_changed), self);
-               gtk_tree_path_free(path);
-       }
-}
-
-static void update_site_widget(GisView *view, char *site, AWeatherGui *self)
-{
-       g_debug("AWeatherGui: update_site_widget - site=%s", site);
-       GtkComboBox  *combo = GTK_COMBO_BOX(aweather_gui_get_widget(self, "main_site"));
-       GtkTreeModel *model = GTK_TREE_MODEL(gtk_combo_box_get_model(combo));
-       GtkTreeIter iter;
-       if (gtk_tree_model_find_string(model, &iter, NULL, 1, site)) {
-               g_signal_handlers_block_by_func(combo,
-                               G_CALLBACK(on_site_changed), self);
-               gtk_combo_box_set_active_iter(combo, &iter);
-               g_signal_handlers_unblock_by_func(combo,
-                               G_CALLBACK(on_site_changed), self);
-       }
-}
-
-/* Prefs callbacks */
-void on_offline(GtkToggleAction *action, AWeatherGui *self)
-{
-       gboolean value = gtk_toggle_action_get_active(action);
-       g_debug("AWeatherGui: on_offline - offline=%d", value);
-       gis_prefs_set_boolean(self->prefs, "gis/offline", value);
-       gis_world_set_offline(self->world, value);
-}
-
-void on_initial_site_changed(GtkComboBox *combo, AWeatherGui *self)
-{
-       gchar *site;
-       GtkTreeIter iter;
-       GtkTreeModel *model = gtk_combo_box_get_model(combo);
-       gtk_combo_box_get_active_iter(combo, &iter);
-       gtk_tree_model_get(model, &iter, 1, &site, -1);
-       g_debug("AWeatherGui: on_initial_site_changed - site=%s", site);
-       gis_prefs_set_string(self->prefs, "aweather/initial_site", site);
-       g_free(site);
-}
-
-void on_nexrad_url_changed(GtkEntry *entry, AWeatherGui *self)
-{
-       const gchar *text = gtk_entry_get_text(entry);
-       g_debug("AWeatherGui: on_nexrad_url_changed - url=%s", text);
-       gis_prefs_set_string(self->prefs, "aweather/nexrad_url", text);
-}
-
-int on_log_level_changed(GtkSpinButton *spinner, AWeatherGui *self)
-{
-       gint value = gtk_spin_button_get_value_as_int(spinner);
-       g_debug("AWeatherGui: on_log_level_changed - %p, level=%d", self, value);
-       gis_prefs_set_integer(self->prefs, "aweather/log_level", value);
-       return TRUE;
-}
-
-
-/*****************
- * Setup helpers *
- *****************/
-static void prefs_setup(AWeatherGui *self)
-{
-       /* Set values */
-       gchar *nu = gis_prefs_get_string (self->prefs, "aweather/nexrad_url");
-       gint   ll = gis_prefs_get_integer(self->prefs, "aweather/log_level");
-       gchar *is = gis_prefs_get_string (self->prefs, "aweather/initial_site");
-       GtkWidget *nuw = aweather_gui_get_widget(self, "prefs_general_url");
-       GtkWidget *llw = aweather_gui_get_widget(self, "prefs_general_log");
-       GtkWidget *isw = aweather_gui_get_widget(self, "prefs_general_site");
-       if (nu) gtk_entry_set_text(GTK_ENTRY(nuw), nu), g_free(nu);
-       if (ll) gtk_spin_button_set_value(GTK_SPIN_BUTTON(llw), ll);
-       if (is) {
-               GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(isw));
-               GtkTreeIter iter;
-               if (gtk_tree_model_find_string(model, &iter, NULL, 1, is))
-                       gtk_combo_box_set_active_iter(GTK_COMBO_BOX(isw), &iter);
-       }
-
-       /* Load Plugins */
-       GtkTreeView       *tview = GTK_TREE_VIEW(aweather_gui_get_widget(self, "prefs_plugins_view"));
-       GtkCellRenderer   *rend1 = gtk_cell_renderer_text_new();
-       GtkCellRenderer   *rend2 = gtk_cell_renderer_toggle_new();
-       GtkTreeViewColumn *col1  = gtk_tree_view_column_new_with_attributes(
-                       "Plugin",  rend1, "text",   0, NULL);
-       GtkTreeViewColumn *col2  = gtk_tree_view_column_new_with_attributes(
-                       "Enabled", rend2, "active", 1, NULL);
-       gtk_tree_view_append_column(tview, col1);
-       gtk_tree_view_append_column(tview, col2);
-       g_signal_connect(rend2, "toggled", G_CALLBACK(on_plugin_toggled), self);
-       gtk_tree_view_set_model(GTK_TREE_VIEW(tview), GTK_TREE_MODEL(self->gtk_plugins));
-}
-
-static void combo_sensitive(GtkCellLayout *cell_layout, GtkCellRenderer *cell,
-               GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
-{
-       gboolean sensitive = !gtk_tree_model_iter_has_child(tree_model, iter);
-       g_object_set(cell, "sensitive", sensitive, NULL);
-}
-
-static void site_setup(AWeatherGui *self)
-{
-       GtkTreeIter state, city;
-       GtkTreeStore *store = GTK_TREE_STORE(aweather_gui_get_object(self, "sites"));
-       for (int i = 0; cities[i].label; i++) {
-               if (cities[i].type == LOCATION_STATE) {
-                       gtk_tree_store_append(store, &state, NULL);
-                       gtk_tree_store_set   (store, &state, 0, cities[i].label, 
-                                                            1, cities[i].code,  -1);
-               } else {
-                       gtk_tree_store_append(store, &city, &state);
-                       gtk_tree_store_set   (store, &city, 0, cities[i].label, 
-                                                           1, cities[i].code,  -1);
-               }
-       }
-
-       GtkWidget *combo    = aweather_gui_get_widget(self, "main_site");
-       GObject   *renderer = aweather_gui_get_object(self, "main_site_rend");
-       gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(combo),
-                       GTK_CELL_RENDERER(renderer), combo_sensitive, NULL, NULL);
-
-       g_signal_connect(self->view, "site-changed",
-                       G_CALLBACK(update_site_widget), self);
-}
-
-static void time_setup(AWeatherGui *self)
-{
-       GtkTreeView       *tview = GTK_TREE_VIEW(aweather_gui_get_widget(self, "main_time"));
-       GtkCellRenderer   *rend  = gtk_cell_renderer_text_new();
-       GtkTreeViewColumn *col   = gtk_tree_view_column_new_with_attributes(
-                                       "Time", rend, "text", 0, NULL);
-
-       gtk_tree_view_append_column(tview, col);
-       g_object_set(rend, "size-points", 8.0, NULL);
-
-       g_signal_connect(self->view, "time-changed",
-                       G_CALLBACK(update_time_widget), self);
-}
-
-
-/*************************
- * Deprecated site stuff *
- *************************/
-/* TODO: These update times functions are getting ugly... */
-static void update_times_gtk(AWeatherGui *self, GList *times)
-{
-       gchar *last_time = NULL;
-       GRegex *regex = g_regex_new("^[A-Z]{4}_([0-9]{8}_[0-9]{4})$", 0, 0, NULL); // KLSX_20090622_2113
-       GMatchInfo *info;
-
-       GtkTreeView  *tview  = GTK_TREE_VIEW(aweather_gui_get_widget(self, "main_time"));
-       GtkListStore *lstore = GTK_LIST_STORE(gtk_tree_view_get_model(tview));
-       gtk_list_store_clear(lstore);
-       GtkTreeIter iter;
-       times = g_list_reverse(times);
-       for (GList *cur = times; cur; cur = cur->next) {
-               if (g_regex_match(regex, cur->data, 0, &info)) {
-                       gchar *time = g_match_info_fetch(info, 1);
-                       gtk_list_store_insert(lstore, &iter, 0);
-                       gtk_list_store_set(lstore, &iter, 0, time, -1);
-                       last_time = time;
-               }
-       }
-
-       gis_view_set_time(self->view, last_time);
-
-       g_regex_unref(regex);
-       g_list_foreach(times, (GFunc)g_free, NULL);
-       g_list_free(times);
-}
-static void update_times_online_cb(char *path, gboolean updated, gpointer _self)
-{
-       GList *times = NULL;
-       gchar *data;
-       gsize length;
-       g_file_get_contents(path, &data, &length, NULL);
-       gchar **lines = g_strsplit(data, "\n", -1);
-       for (int i = 0; lines[i] && lines[i][0]; i++) {
-               char **parts = g_strsplit(lines[i], " ", 2);
-               times = g_list_prepend(times, g_strdup(parts[1]));
-               g_strfreev(parts);
-       }
-       g_strfreev(lines);
-       g_free(data);
-
-       update_times_gtk(_self, times);
-}
-static void update_times(AWeatherGui *self, GisView *view, char *site)
-{
-       g_debug("AWeatherGui: update_times - site=%s", site);
-       if (gis_world_get_offline(self->world)) {
-               GList *times = NULL;
-               gchar *path = g_build_filename(g_get_user_cache_dir(), PACKAGE, "nexrd2", "raw", site, NULL);
-               GDir *dir = g_dir_open(path, 0, NULL);
-               if (dir) {
-                       const gchar *name;
-                       while ((name = g_dir_read_name(dir))) {
-                               times = g_list_prepend(times, g_strdup(name));
-                       }
-                       g_dir_close(dir);
-               }
-               g_free(path);
-               update_times_gtk(self, times);
-       } else {
-               gchar *path = g_strdup_printf("nexrd2/raw/%s/dir.list", site);
-               char *base = gis_prefs_get_string(self->prefs, "aweather/nexrad_url");
-               cache_file(base, path, GIS_REFRESH, NULL, update_times_online_cb, self);
-               /* update_times_gtk from update_times_online_cb */
-       }
-}
-static void on_gis_site_changed(GisView *view, char *site, gpointer _self)
-{
-       AWeatherGui *self = AWEATHER_GUI(_self);
-       g_debug("AWeatherGui: on_site_changed - Loading wsr88d list for %s", site);
-       update_times(self, view, site);
-}
-static void on_gis_refresh(GisWorld *world, gpointer _self)
-{
-       AWeatherGui *self = AWEATHER_GUI(_self);
-       char *site = gis_view_get_site(self->view);
-       update_times(self, self->view, site);
-}
-
-
-/***********
- * Methods *
- ***********/
-AWeatherGui *aweather_gui_new()
-{
-       g_debug("AWeatherGui: new");
-       return g_object_new(AWEATHER_TYPE_GUI, NULL);
-}
-GisWorld *aweather_gui_get_world(AWeatherGui *self)
-{
-       g_assert(AWEATHER_IS_GUI(self));
-       return self->world;
-}
-GisView *aweather_gui_get_view(AWeatherGui *self)
-{
-       g_assert(AWEATHER_IS_GUI(self));
-       return self->view;
-}
-GisOpenGL *aweather_gui_get_opengl(AWeatherGui *self)
-{
-       g_assert(AWEATHER_IS_GUI(self));
-       return self->opengl;
-}
-GtkBuilder *aweather_gui_get_builder(AWeatherGui *self)
-{
-       g_debug("AWeatherGui: get_builder");
-       g_assert(AWEATHER_IS_GUI(self));
-       return self->builder;
-}
-GtkWidget *aweather_gui_get_widget(AWeatherGui *self, const gchar *name)
-{
-       g_debug("AWeatherGui: get_widget - name=%s", name);
-       g_assert(AWEATHER_IS_GUI(self));
-       GObject *widget = gtk_builder_get_object(self->builder, name);
-       if (!GTK_IS_WIDGET(widget))
-               g_error("Failed to get widget `%s'", name);
-       return GTK_WIDGET(widget);
-}
-GObject *aweather_gui_get_object(AWeatherGui *self, const gchar *name)
-{
-       g_debug("AWeatherGui: get_widget - name=%s", name);
-       g_assert(AWEATHER_IS_GUI(self));
-       return gtk_builder_get_object(self->builder, name);
-}
-void aweather_gui_attach_plugin(AWeatherGui *self, const gchar *name)
-{
-       GisPlugin *plugin = gis_plugins_load(self->plugins, name,
-                       self->world, self->view, self->opengl, self->prefs);
-       GtkWidget *config = aweather_gui_get_widget(self, "main_tabs");
-       GtkWidget *tab    = gtk_label_new(name);
-       GtkWidget *body   = gis_plugin_get_config(plugin);
-       gtk_notebook_append_page(GTK_NOTEBOOK(config), body, tab);
-       gtk_widget_show_all(config);
-       gis_opengl_redraw(self->opengl);
-}
-void aweather_gui_deattach_plugin(AWeatherGui *self, const gchar *name)
-{
-       GtkWidget *config = aweather_gui_get_widget(self, "main_tabs");
-       guint n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(config));
-       for (int i = 0; i < n_pages; i++) {
-               g_debug("testing tab %d", i);
-               GtkWidget *body = gtk_notebook_get_nth_page(GTK_NOTEBOOK(config), i);
-               if (!body) continue;
-               GtkWidget *tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(config), body);
-               if (!tab) continue;
-               const gchar *tab_name = gtk_label_get_text(GTK_LABEL(tab));
-               if (tab_name && g_str_equal(name, tab_name))
-                       gtk_notebook_remove_page(GTK_NOTEBOOK(config), i);
-       }
-       gis_plugins_unload(self->plugins, name);
-       gis_opengl_redraw(self->opengl);
-}
-
-
-/****************
- * GObject code *
- ****************/
-G_DEFINE_TYPE(AWeatherGui, aweather_gui, GTK_TYPE_WINDOW);
-static void aweather_gui_init(AWeatherGui *self)
-{
-       g_debug("AWeatherGui: init");
-
-       /* Simple things */
-       self->prefs   = gis_prefs_new("aweather");
-       self->plugins = gis_plugins_new();
-       self->world   = gis_world_new();
-       self->view    = gis_view_new();
-       self->opengl  = gis_opengl_new(self->world, self->view, self->plugins);
-
-       /* Setup window */
-       self->builder = gtk_builder_new();
-       GError *error = NULL;
-       if (!gtk_builder_add_from_file(self->builder, DATADIR "/aweather/main.ui", &error))
-               g_error("Failed to create gtk builder: %s", error->message);
-       gtk_widget_reparent(aweather_gui_get_widget(self, "main_body"), GTK_WIDGET(self));
-       GtkWidget *paned = aweather_gui_get_widget(self, "main_paned");
-       gtk_widget_destroy(gtk_paned_get_child1(GTK_PANED(paned)));
-       gtk_paned_pack1(GTK_PANED(paned), GTK_WIDGET(self->opengl), TRUE, FALSE);
-
-       /* Plugins */
-       GtkTreeIter iter;
-       self->gtk_plugins = GTK_LIST_STORE(aweather_gui_get_object(self, "plugins"));
-       for (GList *cur = gis_plugins_available(); cur; cur = cur->next) {
-               gchar *name = cur->data;
-               gboolean enabled = gis_prefs_get_boolean_v(self->prefs, cur->data, "enabled");
-               gtk_list_store_append(self->gtk_plugins, &iter);
-               gtk_list_store_set(self->gtk_plugins, &iter, 0, name, 1, enabled, -1);
-               if (enabled)
-                       aweather_gui_attach_plugin(self, name);
-       }
-
-       /* Misc, helpers */
-       site_setup(self);
-       time_setup(self);
-       prefs_setup(self);
-
-       /* Connect signals */
-       gtk_builder_connect_signals(self->builder, self);
-       g_signal_connect(self, "key-press-event",
-                       G_CALLBACK(on_gui_key_press), self);
-       g_signal_connect_swapped(self->world, "offline",
-                       G_CALLBACK(gtk_toggle_action_set_active),
-                       aweather_gui_get_object(self, "offline"));
-
-       /* deprecated site stuff */
-       g_signal_connect(self->view,  "site-changed", G_CALLBACK(on_gis_site_changed), self);
-       g_signal_connect(self->world, "refresh",      G_CALLBACK(on_gis_refresh),      self);
-}
-static GObject *aweather_gui_constructor(GType gtype, guint n_properties,
-               GObjectConstructParam *properties)
-{
-       g_debug("aweather_gui: constructor");
-       GObjectClass *parent_class = G_OBJECT_CLASS(aweather_gui_parent_class);
-       return parent_class->constructor(gtype, n_properties, properties);
-}
-static void aweather_gui_dispose(GObject *_self)
-{
-       g_debug("AWeatherGui: dispose");
-       AWeatherGui *self = AWEATHER_GUI(_self);
-       if (self->builder) {
-               /* Reparent to avoid double unrefs */
-               GtkWidget *body   = aweather_gui_get_widget(self, "main_body");
-               GtkWidget *window = aweather_gui_get_widget(self, "main_window");
-               gtk_widget_reparent(body, window);
-               g_object_unref(self->builder);
-               self->builder = NULL;
-       }
-       if (self->world) {
-               g_object_unref(self->world);
-               self->world = NULL;
-       }
-       if (self->view) {
-               g_object_unref(self->view);
-               self->view = NULL;
-       }
-       if (self->opengl) {
-               g_object_unref(self->opengl);
-               self->opengl = NULL;
-       }
-       if (self->plugins) {
-               gis_plugins_free(self->plugins);
-               self->plugins = NULL;
-       }
-       if (self->prefs) {
-               g_object_unref(self->prefs);
-               self->prefs = NULL;
-       }
-       G_OBJECT_CLASS(aweather_gui_parent_class)->dispose(_self);
-}
-static void aweather_gui_finalize(GObject *_self)
-{
-       g_debug("AWeatherGui: finalize");
-       G_OBJECT_CLASS(aweather_gui_parent_class)->finalize(_self);
-       gtk_main_quit();
-
-}
-static void aweather_gui_class_init(AWeatherGuiClass *klass)
-{
-       g_debug("AWeatherGui: class_init");
-       GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-       gobject_class->constructor  = aweather_gui_constructor;
-       gobject_class->dispose      = aweather_gui_dispose;
-       gobject_class->finalize     = aweather_gui_finalize;
-}
diff --git a/src/aweather-gui.h b/src/aweather-gui.h
deleted file mode 100644 (file)
index eb28a55..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
- * 
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __AWEATHER_GUI_H__
-#define __AWEATHER_GUI_H__
-
-#include <gtk/gtk.h>
-#include <glib-object.h>
-
-#include <gis/gis.h>
-
-/* Type macros */
-#define AWEATHER_TYPE_GUI            (aweather_gui_get_type())
-#define AWEATHER_GUI(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),   AWEATHER_TYPE_GUI, AWeatherGui))
-#define AWEATHER_IS_GUI(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),   AWEATHER_TYPE_GUI))
-#define AWEATHER_GUI_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST   ((klass), AWEATHER_TYPE_GUI, AWeatherGuiClass))
-#define AWEATHER_IS_GUI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE   ((klass), AWEATHER_TYPE_GUI))
-#define AWEATHER_GUI_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),   AWEATHER_TYPE_GUI, AWeatherGuiClass))
-
-typedef struct _AWeatherGui      AWeatherGui;
-typedef struct _AWeatherGuiClass AWeatherGuiClass;
-
-struct _AWeatherGui {
-       GtkWindow parent_instance;
-
-       /* instance members */
-       GtkBuilder   *builder;
-       GisWorld     *world;
-       GisView      *view;
-       GisOpenGL    *opengl;
-       GisPlugins   *plugins;
-       GisPrefs     *prefs;
-       GtkListStore *gtk_plugins;
-};
-
-struct _AWeatherGuiClass {
-       GtkWindowClass parent_class;
-       
-       /* class members */
-};
-
-GType aweather_gui_get_type(void);
-
-/* Methods */
-AWeatherGui *aweather_gui_new();
-
-GisWorld    *aweather_gui_get_world(AWeatherGui *gui);
-GisOpenGL   *aweather_gui_get_opengl(AWeatherGui *gui);
-GisView     *aweather_gui_get_view(AWeatherGui *gui);
-
-GtkWidget   *aweather_gui_get_widget(AWeatherGui *gui, const gchar *name);
-GObject     *aweather_gui_get_object(AWeatherGui *gui, const gchar *name);
-
-void         aweather_gui_attach_plugin(AWeatherGui *self, const gchar *name);
-void         aweather_gui_deattach_plugin(AWeatherGui *self, const gchar *name);
-
-#endif
diff --git a/src/aweather-location.c b/src/aweather-location.c
deleted file mode 100644 (file)
index c4952d0..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
- * 
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-#include <gtk/gtk.h>
-
-#include "aweather-location.h"
-
-city_t cities[] = {
-       {LOCATION_STATE, NULL,   "Alabama",           0, 0, 0},
-       {LOCATION_CITY,  "KBMX", "Birmingham",        0, 0, 0},
-       {LOCATION_CITY,  "KMXX", "E. Alabama",        0, 0, 0},
-       {LOCATION_CITY,  "KEOX", "Fort Rucker",       0, 0, 0},
-       {LOCATION_CITY,  "KMOB", "Mobile",            0, 0, 0},
-       {LOCATION_CITY,  "KHTX", "Nrn. Alabama",      0, 0, 0},
-       {LOCATION_STATE, NULL,   "Alaska",            0, 0, 0},
-       {LOCATION_CITY,  "KABC", "Bethel",            0, 0, 0},
-       {LOCATION_CITY,  "KACG", "Biorka Is.",        0, 0, 0},
-       {LOCATION_CITY,  "KAPD", "Fairbanks",         0, 0, 0},
-       {LOCATION_CITY,  "KAHG", "Kenai",             0, 0, 0},
-       {LOCATION_CITY,  "KAKC", "King Salmon",       0, 0, 0},
-       {LOCATION_CITY,  "KAIH", "Middleton Is.",     0, 0, 0},
-       {LOCATION_CITY,  "KAEC", "Nome",              0, 0, 0},
-       {LOCATION_CITY,  "KAPD", "Pedro Dome",        0, 0, 0},
-       {LOCATION_CITY,  "KACG", "Sitka",             0, 0, 0},
-       {LOCATION_STATE, NULL,   "Arizona",           0, 0, 0},
-       {LOCATION_CITY,  "KFSX", "Flagstaff",         0, 0, 0},
-       {LOCATION_CITY,  "KIWA", "Phoenix",           0, 0, 0},
-       {LOCATION_CITY,  "KEMX", "Tucson",            0, 0, 0},
-       {LOCATION_CITY,  "KYUX", "Yuma",              0, 0, 0},
-       {LOCATION_STATE, NULL,   "Arkansas",          0, 0, 0},
-       {LOCATION_CITY,  "KLZK", "Little Rock",       0, 0, 0},
-       {LOCATION_CITY,  "KSRX", "W. Ark./Ft. Smith", 0, 0, 0},
-       {LOCATION_STATE, NULL,   "California",        0, 0, 0},
-       {LOCATION_CITY,  "KBBX", "Beale AFB",         0, 0, 0},
-       {LOCATION_CITY,  "KEYX", "Edwards AFB",       0, 0, 0},
-       {LOCATION_CITY,  "KBHX", "Eureka",            0, 0, 0},
-       {LOCATION_CITY,  "KHNX", "Hanford",           0, 0, 0},
-       {LOCATION_CITY,  "KVTX", "Los Angeles",       0, 0, 0},
-       {LOCATION_CITY,  "KDAX", "Sacramento",        0, 0, 0},
-       {LOCATION_CITY,  "KNKX", "San Diego",         0, 0, 0},
-       {LOCATION_CITY,  "KMUX", "San Francisco",     0, 0, 0},
-       {LOCATION_CITY,  "KHNX", "San Joaquin Vly.",  0, 0, 0},
-       {LOCATION_CITY,  "KSOX", "Santa Ana Mtns",    0, 0, 0},
-       {LOCATION_CITY,  "KVBX", "Vandenberg AFB",    0, 0, 0},
-       {LOCATION_STATE, NULL,   "Colorado",          0, 0, 0},
-       {LOCATION_CITY,  "KFTG", "Denver/Boulder",    0, 0, 0},
-       {LOCATION_CITY,  "KGJX", "Grand Junction",    0, 0, 0},
-       {LOCATION_CITY,  "KPUX", "Pueblo",            0, 0, 0},
-       {LOCATION_STATE, NULL,   "Delaware",          0, 0, 0},
-       {LOCATION_CITY,  "KDOX", "Dover AFB",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Florida",           0, 0, 0},
-       {LOCATION_CITY,  "KEVX", "Eglin AFB",         0, 0, 0},
-       {LOCATION_CITY,  "KJAX", "Jacksonville",      0, 0, 0},
-       {LOCATION_CITY,  "KBYX", "Key West",          0, 0, 0},
-       {LOCATION_CITY,  "KMLB", "Melbourne",         0, 0, 0},
-       {LOCATION_CITY,  "KAMX", "Miami",             0, 0, 0},
-       {LOCATION_CITY,  "KEVX", "NW Florida",        0, 0, 0},
-       {LOCATION_CITY,  "KTLH", "Tallahassee",       0, 0, 0},
-       {LOCATION_CITY,  "KTBW", "Tampa Bay Area",    0, 0, 0},
-       {LOCATION_STATE, NULL,   "Georgia",           0, 0, 0},
-       {LOCATION_CITY,  "KFFC", "Atlanta",           0, 0, 0},
-       {LOCATION_CITY,  "KVAX", "Moody AFB",         0, 0, 0},
-       {LOCATION_CITY,  "KFFC", "Peachtree City",    0, 0, 0},
-       {LOCATION_CITY,  "KJGX", "Robins AFB",        0, 0, 0},
-       {LOCATION_STATE, NULL,   "Guam",              0, 0, 0},
-       {LOCATION_CITY,  "KGUA", "Andersen AFB",      0, 0, 0},
-       {LOCATION_STATE, NULL,   "Hawaii",            0, 0, 0},
-       {LOCATION_CITY,  "KHKI", "Kauai",             0, 0, 0},
-       {LOCATION_CITY,  "KHKM", "Kohala",            0, 0, 0},
-       {LOCATION_CITY,  "KHMO", "Molokai",           0, 0, 0},
-       {LOCATION_CITY,  "KHWA", "South Shore",       0, 0, 0},
-       {LOCATION_STATE, NULL,   "Idaho",             0, 0, 0},
-       {LOCATION_CITY,  "KCBX", "Boise",             0, 0, 0},
-       {LOCATION_CITY,  "KSFX", "Pocatello",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Illinois",          0, 0, 0},
-       {LOCATION_CITY,  "KILX", "Central IL",        0, 0, 0},
-       {LOCATION_CITY,  "KLOT", "Chicago",           0, 0, 0},
-       {LOCATION_STATE, NULL,   "Indiana",           0, 0, 0},
-       {LOCATION_CITY,  "KVWX", "Evansville",        0, 0, 0},
-       {LOCATION_CITY,  "KIND", "Indianapolis",      0, 0, 0},
-       {LOCATION_CITY,  "KIWX", "Nrn. Indiana",      0, 0, 0},
-       {LOCATION_STATE, NULL,   "Iowa",              0, 0, 0},
-       {LOCATION_CITY,  "KDMX", "Des Moines",        0, 0, 0},
-       {LOCATION_CITY,  "KDVN", "Quad Cities",       0, 0, 0},
-       {LOCATION_STATE, NULL,   "Kansas",            0, 0, 0},
-       {LOCATION_CITY,  "KDDC", "Dodge City",        0, 0, 0},
-       {LOCATION_CITY,  "KGLD", "Goodland",          0, 0, 0},
-       {LOCATION_CITY,  "KTWX", "Topeka",            0, 0, 0},
-       {LOCATION_CITY,  "KICT", "Wichita",           0, 0, 0},
-       {LOCATION_STATE, NULL,   "Kentucky",          0, 0, 0},
-       {LOCATION_CITY,  "KHPX", "Fort Cambell",      0, 0, 0},
-       {LOCATION_CITY,  "KJKL", "Jackson",           0, 0, 0},
-       {LOCATION_CITY,  "KLVX", "Louisville",        0, 0, 0},
-       {LOCATION_CITY,  "KPAH", "Paducah",           0, 0, 0},
-       {LOCATION_STATE, NULL,   "Louisiana",         0, 0, 0},
-       {LOCATION_CITY,  "KPOE", "Fort Polk",         0, 0, 0},
-       {LOCATION_CITY,  "KLCH", "Lake Charles",      0, 0, 0},
-       {LOCATION_CITY,  "KLIX", "New Orleans",       0, 0, 0},
-       {LOCATION_CITY,  "KSHV", "Shreveport",        0, 0, 0},
-       {LOCATION_STATE, NULL,   "Maine",             0, 0, 0},
-       {LOCATION_CITY,  "KCBW", "Caribou",           0, 0, 0},
-       {LOCATION_CITY,  "KGYX", "Portland",          0, 0, 0},
-       {LOCATION_STATE, NULL,   "Maryland",          0, 0, 0},
-       {LOCATION_CITY,  "KLWX", "Baltimore",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Massachusetts",     0, 0, 0},
-       {LOCATION_CITY,  "KBOX", "Boston",            0, 0, 0},
-       {LOCATION_STATE, NULL,   "Michigan",          0, 0, 0},
-       {LOCATION_CITY,  "KDTX", "Detroit",           0, 0, 0},
-       {LOCATION_CITY,  "KAPX", "Gaylord",           0, 0, 0},
-       {LOCATION_CITY,  "KGRR", "Grand Rapids",      0, 0, 0},
-       {LOCATION_CITY,  "KMQT", "Marquette",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Minnesota",         0, 0, 0},
-       {LOCATION_CITY,  "KDLH", "Duluth",            0, 0, 0},
-       {LOCATION_CITY,  "KMPX", "Minneapolis",       0, 0, 0},
-       {LOCATION_STATE, NULL,   "Mississippi",       0, 0, 0},
-       {LOCATION_CITY,  "KGWX", "Columbus AFB",      0, 0, 0},
-       {LOCATION_CITY,  "KDGX", "Jackson/Brandon",   0, 0, 0},
-       {LOCATION_STATE, NULL,   "Missouri",          0, 0, 0},
-       {LOCATION_CITY,  "KEAX", "Kansas City",       0, 0, 0},
-       {LOCATION_CITY,  "KSGF", "Springfield",       0, 0, 0},
-       {LOCATION_CITY,  "KLSX", "St. Louis",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Montana",           0, 0, 0},
-       {LOCATION_CITY,  "KBLX", "Billings",          0, 0, 0},
-       {LOCATION_CITY,  "KGGW", "Glasgow",           0, 0, 0},
-       {LOCATION_CITY,  "KTFX", "Great Falls",       0, 0, 0},
-       {LOCATION_CITY,  "KMSX", "Missoula",          0, 0, 0},
-       {LOCATION_STATE, NULL,   "Nebraska",          0, 0, 0},
-       {LOCATION_CITY,  "KUEX", "Hastings",          0, 0, 0},
-       {LOCATION_CITY,  "KLNX", "North Platte",      0, 0, 0},
-       {LOCATION_CITY,  "KOAX", "Omaha",             0, 0, 0},
-       {LOCATION_STATE, NULL,   "Nevada",            0, 0, 0},
-       {LOCATION_CITY,  "KLRX", "Elko",              0, 0, 0},
-       {LOCATION_CITY,  "KESX", "Las Vegas",         0, 0, 0},
-       {LOCATION_CITY,  "KRGX", "Reno",              0, 0, 0},
-       {LOCATION_STATE, NULL,   "New Jersey",        0, 0, 0},
-       {LOCATION_CITY,  "KDIX", "Mt. Holly",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "New Mexico",        0, 0, 0},
-       {LOCATION_CITY,  "KABX", "Albuquerque",       0, 0, 0},
-       {LOCATION_CITY,  "KFDX", "Cannon AFB",        0, 0, 0},
-       {LOCATION_CITY,  "KHDX", "Holloman AFB",      0, 0, 0},
-       {LOCATION_STATE, NULL,   "New York",          0, 0, 0},
-       {LOCATION_CITY,  "KENX", "Albany",            0, 0, 0},
-       {LOCATION_CITY,  "KBGM", "Binghamton",        0, 0, 0},
-       {LOCATION_CITY,  "KBUF", "Buffalo",           0, 0, 0},
-       {LOCATION_CITY,  "KTYX", "Montague",          0, 0, 0},
-       {LOCATION_CITY,  "KOKX", "New York City",     0, 0, 0},
-       {LOCATION_CITY,  "KOKX", "Upton",             0, 0, 0},
-       {LOCATION_STATE, NULL,   "North Carolina",    0, 0, 0},
-       {LOCATION_CITY,  "KRAX", "Durham",            0, 0, 0},
-       {LOCATION_CITY,  "KMHX", "Morehead City",     0, 0, 0},
-       {LOCATION_CITY,  "KRAX", "Raleigh",           0, 0, 0},
-       {LOCATION_CITY,  "KLTX", "Wilmington",        0, 0, 0},
-       {LOCATION_STATE, NULL,   "North Dakota",      0, 0, 0},
-       {LOCATION_CITY,  "KBIS", "Bismarck",          0, 0, 0},
-       {LOCATION_CITY,  "KMVX", "Grand Forks",       0, 0, 0},
-       {LOCATION_CITY,  "KMBX", "Minot AFB",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Ohio",              0, 0, 0},
-       {LOCATION_CITY,  "KILN", "Cincinnati",        0, 0, 0},
-       {LOCATION_CITY,  "KCLE", "Cleveland",         0, 0, 0},
-       {LOCATION_CITY,  "KILN", "Dayton",            0, 0, 0},
-       {LOCATION_CITY,  "KILN", "Wilmington",        0, 0, 0},
-       {LOCATION_STATE, NULL,   "Oklahoma",          0, 0, 0},
-       {LOCATION_CITY,  "KFDR", "Frederick",         0, 0, 0},
-       {LOCATION_CITY,  "KTLX", "Oklahoma City",     0, 0, 0},
-       {LOCATION_CITY,  "KINX", "Tulsa",             0, 0, 0},
-       {LOCATION_CITY,  "KVNX", "Vance AFB",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Oregon",            0, 0, 0},
-       {LOCATION_CITY,  "KMAX", "Medford",           0, 0, 0},
-       {LOCATION_CITY,  "KPDT", "Pendleton",         0, 0, 0},
-       {LOCATION_CITY,  "KRTX", "Portland",          0, 0, 0},
-       {LOCATION_STATE, NULL,   "Pennsylvania",      0, 0, 0},
-       {LOCATION_CITY,  "KDIX", "Philadelphia",      0, 0, 0},
-       {LOCATION_CITY,  "KPBZ", "Pittsburgh",        0, 0, 0},
-       {LOCATION_CITY,  "KCCX", "State College",     0, 0, 0},
-       {LOCATION_STATE, NULL,   "Puerto Rico",       0, 0, 0},
-       {LOCATION_CITY,  "KJUA", "Puerto Rico/V.I.",  0, 0, 0},
-       {LOCATION_STATE, NULL,   "South Carolina",    0, 0, 0},
-       {LOCATION_CITY,  "KCLX", "Charleston",        0, 0, 0},
-       {LOCATION_CITY,  "KCAE", "Columbia",          0, 0, 0},
-       {LOCATION_CITY,  "KGSP", "Greenville",        0, 0, 0},
-       {LOCATION_CITY,  "KGSP", "Spartanburg",       0, 0, 0},
-       {LOCATION_CITY,  "KGSP", "Greer",             0, 0, 0},
-       {LOCATION_STATE, NULL,   "South Dakota",      0, 0, 0},
-       {LOCATION_CITY,  "KABR", "Aberdeen",          0, 0, 0},
-       {LOCATION_CITY,  "KUDX", "Rapid City",        0, 0, 0},
-       {LOCATION_CITY,  "KFSD", "Sioux falls",       0, 0, 0},
-       {LOCATION_STATE, NULL,   "Tennessee",         0, 0, 0},
-       {LOCATION_CITY,  "KMRX", "Knoxville",         0, 0, 0},
-       {LOCATION_CITY,  "KNQA", "Memphis",           0, 0, 0},
-       {LOCATION_CITY,  "KMRX", "Morristown",        0, 0, 0},
-       {LOCATION_CITY,  "KOHX", "Nashville",         0, 0, 0},
-       {LOCATION_CITY,  "KMRX", "Tri Cities",        0, 0, 0},
-       {LOCATION_STATE, NULL,   "Texas",             0, 0, 0},
-       {LOCATION_CITY,  "KAMA", "Amarillo",          0, 0, 0},
-       {LOCATION_CITY,  "KEWX", "Austin",            0, 0, 0},
-       {LOCATION_CITY,  "KBRO", "Brownsville",       0, 0, 0},
-       {LOCATION_CITY,  "KGRK", "Central Texas",     0, 0, 0},
-       {LOCATION_CITY,  "KCRP", "Corpus Christi",    0, 0, 0},
-       {LOCATION_CITY,  "KFWS", "Dallas",            0, 0, 0},
-       {LOCATION_CITY,  "KDYX", "Dyess AFB",         0, 0, 0},
-       {LOCATION_CITY,  "KEPZ", "El Paso",           0, 0, 0},
-       {LOCATION_CITY,  "KFWS", "Fort Worth",        0, 0, 0},
-       {LOCATION_CITY,  "KHGX", "Galveston",         0, 0, 0},
-       {LOCATION_CITY,  "KHGX", "Houston",           0, 0, 0},
-       {LOCATION_CITY,  "KDFX", "Laughlin AFB",      0, 0, 0},
-       {LOCATION_CITY,  "KLBB", "Lubbock",           0, 0, 0},
-       {LOCATION_CITY,  "KMAF", "Midland/Odessa",    0, 0, 0},
-       {LOCATION_CITY,  "KSJT", "San Angelo",        0, 0, 0},
-       {LOCATION_CITY,  "KEWX", "San Antonio",       0, 0, 0},
-       {LOCATION_STATE, NULL,   "Utah",              0, 0, 0},
-       {LOCATION_CITY,  "KICX", "Cedar City",        0, 0, 0},
-       {LOCATION_CITY,  "KMTX", "Salt Lake City",    0, 0, 0},
-       {LOCATION_STATE, NULL,   "Vermont",           0, 0, 0},
-       {LOCATION_CITY,  "KCXX", "Burlington",        0, 0, 0},
-       {LOCATION_STATE, NULL,   "Virginia",          0, 0, 0},
-       {LOCATION_CITY,  "KFCX", "Blacksburg",        0, 0, 0},
-       {LOCATION_CITY,  "KAKQ", "Norfolk",           0, 0, 0},
-       {LOCATION_CITY,  "KAKQ", "Richmond",          0, 0, 0},
-       {LOCATION_CITY,  "KFCX", "Roanoke",           0, 0, 0},
-       {LOCATION_CITY,  "KLWX", "Sterling",          0, 0, 0},
-       {LOCATION_CITY,  "KAKQ", "Wakefield",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Washington",        0, 0, 0},
-       {LOCATION_CITY,  "KATX", "Seattle",           0, 0, 0},
-       {LOCATION_CITY,  "KOTX", "Spokane",           0, 0, 0},
-       {LOCATION_CITY,  "KATX", "Tacoma",            0, 0, 0},
-       {LOCATION_STATE, NULL,   "Washington DC",     0, 0, 0},
-       {LOCATION_CITY,  "KLWX", "Washington",        0, 0, 0},
-       {LOCATION_STATE, NULL,   "West Virginia",     0, 0, 0},
-       {LOCATION_CITY,  "KRLX", "Charleston",        0, 0, 0},
-       {LOCATION_STATE, NULL,   "Wisconsin",         0, 0, 0},
-       {LOCATION_CITY,  "KGRB", "Green Bay",         0, 0, 0},
-       {LOCATION_CITY,  "KARX", "La Crosse",         0, 0, 0},
-       {LOCATION_CITY,  "KMKX", "Milwaukee",         0, 0, 0},
-       {LOCATION_STATE, NULL,   "Wyoming",           0, 0, 0},
-       {LOCATION_CITY,  "KCYS", "Cheyenne",          0, 0, 0},
-       {LOCATION_CITY,  "KRIW", "Riverton",          0, 0, 0},
-       {0,               NULL,   NULL,               0, 0, 0},
-};
diff --git a/src/aweather-location.h b/src/aweather-location.h
deleted file mode 100644 (file)
index 1c39668..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
- * 
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __LOCATION_H__
-#define __LOCATION_H__
-
-enum {
-       LOCATION_CITY,
-       LOCATION_STATE
-};
-
-typedef struct {
-       int type;
-       char *code;
-       char *label;
-       double lat;
-       double lon;
-       double elev;
-} city_t;
-
-extern city_t cities[];
-
-
-#endif
similarity index 100%
rename from src/gis/gis-data.c
rename to src/gis-data.c
similarity index 100%
rename from src/gis/gis-data.h
rename to src/gis-data.h
similarity index 100%
rename from src/gis/gis-opengl.c
rename to src/gis-opengl.c
similarity index 100%
rename from src/gis/gis-opengl.h
rename to src/gis-opengl.h
similarity index 100%
rename from src/gis/gis-plugin.c
rename to src/gis-plugin.c
similarity index 100%
rename from src/gis/gis-plugin.h
rename to src/gis-plugin.h
similarity index 100%
rename from src/gis/gis-prefs.c
rename to src/gis-prefs.c
similarity index 100%
rename from src/gis/gis-prefs.h
rename to src/gis-prefs.h
similarity index 100%
rename from src/gis/gis-view.c
rename to src/gis-view.c
similarity index 100%
rename from src/gis/gis-view.h
rename to src/gis-view.h
similarity index 100%
rename from src/gis/gis-world.c
rename to src/gis-world.c
similarity index 100%
rename from src/gis/gis-world.h
rename to src/gis-world.h
similarity index 100%
rename from src/gis/gis.h
rename to src/gis.h
diff --git a/src/gis/.gitignore b/src/gis/.gitignore
deleted file mode 100644 (file)
index 68820ba..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-*.pc
-gis-marshal.*
-gis_test
-wms_test
diff --git a/src/gis/.vimrc b/src/gis/.vimrc
deleted file mode 100644 (file)
index 5de2904..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-set makeprg=make\ test
-set tw=100
diff --git a/src/gis/Makefile.am b/src/gis/Makefile.am
deleted file mode 100644 (file)
index 84e57d2..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-AM_CFLAGS   = -Wall --std=gnu99 
-AM_CPPFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(SOUP_CFLAGS)
-AM_LDADD    = $(GLIB_LIBS) $(GTK_LIBS) $(SOUP_LIBS)
-
-# Library
-BUILT_SOURCES = gis-marshal.c gis-marshal.h
-lib_LTLIBRARIES  = libgis.la
-gis_includedir = $(includedir)/gis
-gis_include_HEADERS = \
-       gis.h         \
-       gis-world.h   \
-       gis-view.h    \
-       gis-prefs.h   \
-       gis-opengl.h  \
-       gis-plugin.h  \
-       gis-data.h    \
-       gpqueue.h     \
-       roam.h        \
-       wms.h
-libgis_la_SOURCES = \
-       gis-world.c   gis-world.h   \
-       gis-view.c    gis-view.h    \
-       gis-prefs.c   gis-prefs.h   \
-       gis-opengl.c  gis-opengl.h  \
-       gis-plugin.c  gis-plugin.h  \
-       gis-marshal.c gis-marshal.h \
-       gis-data.c    gis-data.h    \
-       roam.c        roam.h        \
-       wms.c         wms.h         \
-       gpqueue.c     gpqueue.h
-libgis_la_CPPFLAGS = $(AM_CPPFLAGS) \
-       -DDATADIR="\"$(datadir)\"" -DPLUGINDIR="\"$(libdir)/gis\""
-libgis_la_LIBADD = $(AM_LDADD)
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libgis.pc
-
-# Test programs
-bin_PROGRAMS = gis_test wms_test
-
-gis_test_SOURCES  = gis_test.c gis.h
-gis_test_LDADD    = $(AM_LDADD) .libs/libgis.a
-
-wms_test_SOURCES  = wms_test.c gis-world.c gis-world.h wms.c wms.h
-wms_test_LDADD    = $(AM_LDADD)
-
-MAINTAINERCLEANFILES = Makefile.in
-
-.list.c:
-       glib-genmarshal --prefix=gis_cclosure_marshal --body   $< > $@
-.list.h:
-       glib-genmarshal --prefix=gis_cclosure_marshal --header $< > $@
-
-test: all
-       make -C ../plugins all
-       ./gis_test
-
-gdb: all
-       LD_LIBRARY_PATH=.libs gdb .libs/gis_test
-
-ddd: all
-       LD_LIBRARY_PATH=.libs ddd .libs/gis_test
-
-memcheck: all
-       LD_LIBRARY_PATH=.libs                      \
-       G_SLICE=always-malloc                      \
-       G_DEBUG=gc-friendly,resident-modules       \
-       valgrind --track-origins=yes               \
-                --leak-check=full                 \
-                --leak-resolution=high            \
-                --num-callers=100                 \
-                --suppressions=../gtk.suppression \
-                .libs/gis_test                    \
-       2> valgrind.out
diff --git a/src/gis/gis-marshal.list b/src/gis/gis-marshal.list
deleted file mode 100644 (file)
index f588897..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-VOID:DOUBLE,DOUBLE,DOUBLE
-VOID:STRING,UINT,POINTER
similarity index 100%
rename from src/gis/gis_test.c
rename to src/gis_test.c
similarity index 100%
rename from src/gis/gpqueue.c
rename to src/gpqueue.c
similarity index 100%
rename from src/gis/gpqueue.h
rename to src/gpqueue.h
similarity index 100%
rename from src/gis/libgis.pc.in
rename to src/libgis.pc.in
diff --git a/src/main.c b/src/main.c
deleted file mode 100644 (file)
index 09a3bfd..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
- * 
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkgl.h>
-
-#include <gis/gis.h>
-
-#include "aweather-gui.h"
-
-static gint log_levels = 0;
-
-static void log_func(const gchar *log_domain, GLogLevelFlags log_level,
-              const gchar *message, gpointer udata)
-{
-       if (log_level & log_levels)
-               g_log_default_handler(log_domain, log_level, message, udata);
-}
-
-static void on_log_level_changed(GtkSpinButton *spinner, AWeatherGui *self)
-{
-       g_message("main: log_level_changed");
-       gint value = gtk_spin_button_get_value_as_int(spinner);
-       log_levels = (1 << (value+1))-1;
-}
-
-
-/********
- * Main *
- ********/
-int main(int argc, char *argv[])
-{
-       /* Defaults */
-       gint     debug   = 6;
-       gchar   *site    = "KIND";
-       gboolean offline = FALSE;
-
-       /* Arguments */
-       gint     opt_debug   = 0;
-       gchar   *opt_site    = NULL;
-       gboolean opt_auto    = FALSE;
-       gboolean opt_offline = FALSE;
-       GOptionEntry entries[] = {
-               //long      short flg type                 location      description                 arg desc
-               {"debug",   'd',  0,  G_OPTION_ARG_INT,    &opt_debug,   "Change default log level", "[1-7]"},
-               {"site",    's',  0,  G_OPTION_ARG_STRING, &opt_site,    "Set initial site",         NULL},
-               {"offline", 'o',  0,  G_OPTION_ARG_NONE,   &opt_offline, "Run in offline mode",      NULL},
-               {"auto",    'a',  0,  G_OPTION_ARG_NONE,   &opt_auto,    "Auto update radar (todo)", NULL},
-               {NULL}
-       };
-
-       /* Init */
-       GError *error = NULL;
-       g_thread_init(NULL);
-       if (!gtk_init_with_args(&argc, &argv, "aweather", entries, NULL, &error)) {
-               g_print("%s\n", error->message);
-               g_error_free(error);
-               return -1;
-       }
-       gtk_gl_init(&argc, &argv);
-
-       /* Do some logging here for aweather_gui_new */
-       if (opt_debug) log_levels = (1 << (opt_debug+1))-1;
-       else           log_levels = (1 << (6+1))-1;
-       g_log_set_handler(NULL, G_LOG_LEVEL_MASK, log_func, NULL);
-
-       /* Set up AWeather */
-       AWeatherGui *gui    = aweather_gui_new();
-
-       gint     prefs_debug   = gis_prefs_get_integer(gui->prefs, "aweather/log_level");
-       gchar   *prefs_site    = gis_prefs_get_string(gui->prefs,  "aweather/initial_site");
-       gboolean prefs_offline = gis_prefs_get_boolean(gui->prefs, "gis/offline");
-
-       debug   = (opt_debug   ?: prefs_debug   ?: debug);
-       site    = (opt_site    ?: prefs_site    ?: site);
-       offline = (opt_offline ?: prefs_offline ?: offline);
-
-       gis_world_set_offline(gui->world, offline);
-       log_levels = (1 << (debug+1))-1;
-
-       GObject *action = aweather_gui_get_object(gui, "prefs_general_log");
-       g_signal_connect(action, "changed", G_CALLBACK(on_log_level_changed), NULL);
-
-       gtk_widget_show_all(GTK_WIDGET(gui));
-       gis_view_set_site(gui->view, site);
-       gtk_main();
-       return 0;
-}
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
deleted file mode 100644 (file)
index 87b74f1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-AM_CFLAGS   = -Wall --std=gnu99  -I../
-AM_CPPFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(SOUP_CFLAGS)
-AM_LDFLAGS  = -module -avoid-version
-LIBS        = $(top_srcdir)/src/gis/libgis.la
-
-plugindir = $(libdir)/gis
-
-plugin_LTLIBRARIES =
-
-if HAVE_RSL
-plugin_LTLIBRARIES += radar.la
-radar_la_SOURCES = radar.c   radar.h \
-       marching.c marching.h \
-       radar-colormap.c
-radar_la_LDFLAGS = $(AM_LDFLAGS) $(RSL_LIBS)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/plugins/gis b/src/plugins/gis
deleted file mode 120000 (symlink)
index 9e696c6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.libs
\ No newline at end of file
diff --git a/src/plugins/marching.c b/src/plugins/marching.c
deleted file mode 100644 (file)
index 7c88311..0000000
+++ /dev/null
@@ -1,645 +0,0 @@
-/**
- * Copyright (c) 2002 Jamie Zawinski <jwz@jwz.org>
- * Copyright (c) 2009 Andy Spencer <andy753421@gmail.com>
- *
- * Utility functions to create "marching cubes" meshes from 3d fields.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation.  No representations are made about the suitability of this
- * software for any purpose.  It is provided "as is" without express or 
- * implied warranty.
- *
- * Marching cubes implementation by Paul Bourke <pbourke@swin.edu.au>
- * http://astronomy.swin.edu.au/~pbourke/modelling/polygonise/
- */
-
-#include <math.h>
-#include <glib.h>
-
-#include <GL/gl.h>
-
-#include "marching.h"
-
-/* Calculate the unit normal at p given two other points p1,p2 on the
- * surface. The normal points in the direction of p1 crossproduct p2
- */
-XYZ calc_normal (XYZ p, XYZ p1, XYZ p2)
-{
-       XYZ n, pa, pb;
-       pa.x = p1.x - p.x;
-       pa.y = p1.y - p.y;
-       pa.z = p1.z - p.z;
-       pb.x = p2.x - p.x;
-       pb.y = p2.y - p.y;
-       pb.z = p2.z - p.z;
-       n.x = pa.y * pb.z - pa.z * pb.y;
-       n.y = pa.z * pb.x - pa.x * pb.z;
-       n.z = pa.x * pb.y - pa.y * pb.x;
-       return (n);
-}
-
-/* Call glNormal3f() with a normal of the indicated triangle.
- */
-void do_normal(GLfloat x1, GLfloat y1, GLfloat z1,
-               GLfloat x2, GLfloat y2, GLfloat z2,
-               GLfloat x3, GLfloat y3, GLfloat z3)
-{
-       XYZ p1, p2, p3, p;
-       p1.x = x1; p1.y = y1; p1.z = z1;
-       p2.x = x2; p2.y = y2; p2.z = z2;
-       p3.x = x3; p3.y = y3; p3.z = z3;
-       p = calc_normal (p1, p2, p3);
-       glNormal3f (p.x, p.y, p.z);
-}
-
-/* Indexing convention:
- * 
- *           Vertices:                    Edges:
- * 
- *        4  ______________ 5           ______________
- *         /|            /|           /|     4      /|
- *        / |         6 / |       7  / |8        5 / |
- *    7  /_____________/  |        /______________/  | 9
- *      |   |         |   |        |   |   6     |   |
- *      | 0 |_________|___| 1      |   |_________|10_|
- *      |  /          |  /      11 | 3/     0    |  /
- *      | /           | /          | /           | / 1
- *    3 |/____________|/ 2         |/____________|/
- *                                        2
- */
-
-static const int edgeTable[256] = {
-       0x0  , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,
-       0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,
-       0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,
-       0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,
-       0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,
-       0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,
-       0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,
-       0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,
-       0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,
-       0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,
-       0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,
-       0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,
-       0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,
-       0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,
-       0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,
-       0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,
-       0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,
-       0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,
-       0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,
-       0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,
-       0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,
-       0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,
-       0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,
-       0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,
-       0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,
-       0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,
-       0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,
-       0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,
-       0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,
-       0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,
-       0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,
-       0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0
-};
-
-static const int triTable[256][16] = {
-       {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  1,  9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  8,  3,  9,  8,  1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8,  3,  1,  2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  2, 10,  0,  2,  9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 2,  8,  3,  2, 10,  8, 10,  9,  8, -1, -1, -1, -1, -1, -1, -1},
-       { 3, 11,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0, 11,  2,  8, 11,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  9,  0,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1, 11,  2,  1,  9, 11,  9,  8, 11, -1, -1, -1, -1, -1, -1, -1},
-       { 3, 10,  1, 11, 10,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0, 10,  1,  0,  8, 10,  8, 11, 10, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  9,  0,  3, 11,  9, 11, 10,  9, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  8, 10, 10,  8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  7,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  3,  0,  7,  3,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  1,  9,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  1,  9,  4,  7,  1,  7,  3,  1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2, 10,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  4,  7,  3,  0,  4,  1,  2, 10, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  2, 10,  9,  0,  2,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1},
-       { 2, 10,  9,  2,  9,  7,  2,  7,  3,  7,  9,  4, -1, -1, -1, -1},
-       { 8,  4,  7,  3, 11,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       {11,  4,  7, 11,  2,  4,  2,  0,  4, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  0,  1,  8,  4,  7,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  7, 11,  9,  4, 11,  9, 11,  2,  9,  2,  1, -1, -1, -1, -1},
-       { 3, 10,  1,  3, 11, 10,  7,  8,  4, -1, -1, -1, -1, -1, -1, -1},
-       { 1, 11, 10,  1,  4, 11,  1,  0,  4,  7, 11,  4, -1, -1, -1, -1},
-       { 4,  7,  8,  9,  0, 11,  9, 11, 10, 11,  0,  3, -1, -1, -1, -1},
-       { 4,  7, 11,  4, 11,  9,  9, 11, 10, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  5,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  5,  4,  0,  8,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  5,  4,  1,  5,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 8,  5,  4,  8,  3,  5,  3,  1,  5, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2, 10,  9,  5,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  0,  8,  1,  2, 10,  4,  9,  5, -1, -1, -1, -1, -1, -1, -1},
-       { 5,  2, 10,  5,  4,  2,  4,  0,  2, -1, -1, -1, -1, -1, -1, -1},
-       { 2, 10,  5,  3,  2,  5,  3,  5,  4,  3,  4,  8, -1, -1, -1, -1},
-       { 9,  5,  4,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0, 11,  2,  0,  8, 11,  4,  9,  5, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  5,  4,  0,  1,  5,  2,  3, 11, -1, -1, -1, -1, -1, -1, -1},
-       { 2,  1,  5,  2,  5,  8,  2,  8, 11,  4,  8,  5, -1, -1, -1, -1},
-       {10,  3, 11, 10,  1,  3,  9,  5,  4, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  9,  5,  0,  8,  1,  8, 10,  1,  8, 11, 10, -1, -1, -1, -1},
-       { 5,  4,  0,  5,  0, 11,  5, 11, 10, 11,  0,  3, -1, -1, -1, -1},
-       { 5,  4,  8,  5,  8, 10, 10,  8, 11, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  7,  8,  5,  7,  9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  3,  0,  9,  5,  3,  5,  7,  3, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  7,  8,  0,  1,  7,  1,  5,  7, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  5,  3,  3,  5,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  7,  8,  9,  5,  7, 10,  1,  2, -1, -1, -1, -1, -1, -1, -1},
-       {10,  1,  2,  9,  5,  0,  5,  3,  0,  5,  7,  3, -1, -1, -1, -1},
-       { 8,  0,  2,  8,  2,  5,  8,  5,  7, 10,  5,  2, -1, -1, -1, -1},
-       { 2, 10,  5,  2,  5,  3,  3,  5,  7, -1, -1, -1, -1, -1, -1, -1},
-       { 7,  9,  5,  7,  8,  9,  3, 11,  2, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  5,  7,  9,  7,  2,  9,  2,  0,  2,  7, 11, -1, -1, -1, -1},
-       { 2,  3, 11,  0,  1,  8,  1,  7,  8,  1,  5,  7, -1, -1, -1, -1},
-       {11,  2,  1, 11,  1,  7,  7,  1,  5, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  5,  8,  8,  5,  7, 10,  1,  3, 10,  3, 11, -1, -1, -1, -1},
-       { 5,  7,  0,  5,  0,  9,  7, 11,  0,  1,  0, 10, 11, 10,  0, -1},
-       {11, 10,  0, 11,  0,  3, 10,  5,  0,  8,  0,  7,  5,  7,  0, -1},
-       {11, 10,  5,  7, 11,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       {10,  6,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8,  3,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  0,  1,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  8,  3,  1,  9,  8,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  6,  5,  2,  6,  1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  6,  5,  1,  2,  6,  3,  0,  8, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  6,  5,  9,  0,  6,  0,  2,  6, -1, -1, -1, -1, -1, -1, -1},
-       { 5,  9,  8,  5,  8,  2,  5,  2,  6,  3,  2,  8, -1, -1, -1, -1},
-       { 2,  3, 11, 10,  6,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       {11,  0,  8, 11,  2,  0, 10,  6,  5, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  1,  9,  2,  3, 11,  5, 10,  6, -1, -1, -1, -1, -1, -1, -1},
-       { 5, 10,  6,  1,  9,  2,  9, 11,  2,  9,  8, 11, -1, -1, -1, -1},
-       { 6,  3, 11,  6,  5,  3,  5,  1,  3, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8, 11,  0, 11,  5,  0,  5,  1,  5, 11,  6, -1, -1, -1, -1},
-       { 3, 11,  6,  0,  3,  6,  0,  6,  5,  0,  5,  9, -1, -1, -1, -1},
-       { 6,  5,  9,  6,  9, 11, 11,  9,  8, -1, -1, -1, -1, -1, -1, -1},
-       { 5, 10,  6,  4,  7,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  3,  0,  4,  7,  3,  6,  5, 10, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  9,  0,  5, 10,  6,  8,  4,  7, -1, -1, -1, -1, -1, -1, -1},
-       {10,  6,  5,  1,  9,  7,  1,  7,  3,  7,  9,  4, -1, -1, -1, -1},
-       { 6,  1,  2,  6,  5,  1,  4,  7,  8, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2,  5,  5,  2,  6,  3,  0,  4,  3,  4,  7, -1, -1, -1, -1},
-       { 8,  4,  7,  9,  0,  5,  0,  6,  5,  0,  2,  6, -1, -1, -1, -1},
-       { 7,  3,  9,  7,  9,  4,  3,  2,  9,  5,  9,  6,  2,  6,  9, -1},
-       { 3, 11,  2,  7,  8,  4, 10,  6,  5, -1, -1, -1, -1, -1, -1, -1},
-       { 5, 10,  6,  4,  7,  2,  4,  2,  0,  2,  7, 11, -1, -1, -1, -1},
-       { 0,  1,  9,  4,  7,  8,  2,  3, 11,  5, 10,  6, -1, -1, -1, -1},
-       { 9,  2,  1,  9, 11,  2,  9,  4, 11,  7, 11,  4,  5, 10,  6, -1},
-       { 8,  4,  7,  3, 11,  5,  3,  5,  1,  5, 11,  6, -1, -1, -1, -1},
-       { 5,  1, 11,  5, 11,  6,  1,  0, 11,  7, 11,  4,  0,  4, 11, -1},
-       { 0,  5,  9,  0,  6,  5,  0,  3,  6, 11,  6,  3,  8,  4,  7, -1},
-       { 6,  5,  9,  6,  9, 11,  4,  7,  9,  7, 11,  9, -1, -1, -1, -1},
-       {10,  4,  9,  6,  4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4, 10,  6,  4,  9, 10,  0,  8,  3, -1, -1, -1, -1, -1, -1, -1},
-       {10,  0,  1, 10,  6,  0,  6,  4,  0, -1, -1, -1, -1, -1, -1, -1},
-       { 8,  3,  1,  8,  1,  6,  8,  6,  4,  6,  1, 10, -1, -1, -1, -1},
-       { 1,  4,  9,  1,  2,  4,  2,  6,  4, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  0,  8,  1,  2,  9,  2,  4,  9,  2,  6,  4, -1, -1, -1, -1},
-       { 0,  2,  4,  4,  2,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 8,  3,  2,  8,  2,  4,  4,  2,  6, -1, -1, -1, -1, -1, -1, -1},
-       {10,  4,  9, 10,  6,  4, 11,  2,  3, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8,  2,  2,  8, 11,  4,  9, 10,  4, 10,  6, -1, -1, -1, -1},
-       { 3, 11,  2,  0,  1,  6,  0,  6,  4,  6,  1, 10, -1, -1, -1, -1},
-       { 6,  4,  1,  6,  1, 10,  4,  8,  1,  2,  1, 11,  8, 11,  1, -1},
-       { 9,  6,  4,  9,  3,  6,  9,  1,  3, 11,  6,  3, -1, -1, -1, -1},
-       { 8, 11,  1,  8,  1,  0, 11,  6,  1,  9,  1,  4,  6,  4,  1, -1},
-       { 3, 11,  6,  3,  6,  0,  0,  6,  4, -1, -1, -1, -1, -1, -1, -1},
-       { 6,  4,  8, 11,  6,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 7, 10,  6,  7,  8, 10,  8,  9, 10, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  7,  3,  0, 10,  7,  0,  9, 10,  6,  7, 10, -1, -1, -1, -1},
-       {10,  6,  7,  1, 10,  7,  1,  7,  8,  1,  8,  0, -1, -1, -1, -1},
-       {10,  6,  7, 10,  7,  1,  1,  7,  3, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2,  6,  1,  6,  8,  1,  8,  9,  8,  6,  7, -1, -1, -1, -1},
-       { 2,  6,  9,  2,  9,  1,  6,  7,  9,  0,  9,  3,  7,  3,  9, -1},
-       { 7,  8,  0,  7,  0,  6,  6,  0,  2, -1, -1, -1, -1, -1, -1, -1},
-       { 7,  3,  2,  6,  7,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 2,  3, 11, 10,  6,  8, 10,  8,  9,  8,  6,  7, -1, -1, -1, -1},
-       { 2,  0,  7,  2,  7, 11,  0,  9,  7,  6,  7, 10,  9, 10,  7, -1},
-       { 1,  8,  0,  1,  7,  8,  1, 10,  7,  6,  7, 10,  2,  3, 11, -1},
-       {11,  2,  1, 11,  1,  7, 10,  6,  1,  6,  7,  1, -1, -1, -1, -1},
-       { 8,  9,  6,  8,  6,  7,  9,  1,  6, 11,  6,  3,  1,  3,  6, -1},
-       { 0,  9,  1, 11,  6,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 7,  8,  0,  7,  0,  6,  3, 11,  0, 11,  6,  0, -1, -1, -1, -1},
-       { 7, 11,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 7,  6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  0,  8, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  1,  9, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 8,  1,  9,  8,  3,  1, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1},
-       {10,  1,  2,  6, 11,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2, 10,  3,  0,  8,  6, 11,  7, -1, -1, -1, -1, -1, -1, -1},
-       { 2,  9,  0,  2, 10,  9,  6, 11,  7, -1, -1, -1, -1, -1, -1, -1},
-       { 6, 11,  7,  2, 10,  3, 10,  8,  3, 10,  9,  8, -1, -1, -1, -1},
-       { 7,  2,  3,  6,  2,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 7,  0,  8,  7,  6,  0,  6,  2,  0, -1, -1, -1, -1, -1, -1, -1},
-       { 2,  7,  6,  2,  3,  7,  0,  1,  9, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  6,  2,  1,  8,  6,  1,  9,  8,  8,  7,  6, -1, -1, -1, -1},
-       {10,  7,  6, 10,  1,  7,  1,  3,  7, -1, -1, -1, -1, -1, -1, -1},
-       {10,  7,  6,  1,  7, 10,  1,  8,  7,  1,  0,  8, -1, -1, -1, -1},
-       { 0,  3,  7,  0,  7, 10,  0, 10,  9,  6, 10,  7, -1, -1, -1, -1},
-       { 7,  6, 10,  7, 10,  8,  8, 10,  9, -1, -1, -1, -1, -1, -1, -1},
-       { 6,  8,  4, 11,  8,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  6, 11,  3,  0,  6,  0,  4,  6, -1, -1, -1, -1, -1, -1, -1},
-       { 8,  6, 11,  8,  4,  6,  9,  0,  1, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  4,  6,  9,  6,  3,  9,  3,  1, 11,  3,  6, -1, -1, -1, -1},
-       { 6,  8,  4,  6, 11,  8,  2, 10,  1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2, 10,  3,  0, 11,  0,  6, 11,  0,  4,  6, -1, -1, -1, -1},
-       { 4, 11,  8,  4,  6, 11,  0,  2,  9,  2, 10,  9, -1, -1, -1, -1},
-       {10,  9,  3, 10,  3,  2,  9,  4,  3, 11,  3,  6,  4,  6,  3, -1},
-       { 8,  2,  3,  8,  4,  2,  4,  6,  2, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  4,  2,  4,  6,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  9,  0,  2,  3,  4,  2,  4,  6,  4,  3,  8, -1, -1, -1, -1},
-       { 1,  9,  4,  1,  4,  2,  2,  4,  6, -1, -1, -1, -1, -1, -1, -1},
-       { 8,  1,  3,  8,  6,  1,  8,  4,  6,  6, 10,  1, -1, -1, -1, -1},
-       {10,  1,  0, 10,  0,  6,  6,  0,  4, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  6,  3,  4,  3,  8,  6, 10,  3,  0,  3,  9, 10,  9,  3, -1},
-       {10,  9,  4,  6, 10,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  9,  5,  7,  6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8,  3,  4,  9,  5, 11,  7,  6, -1, -1, -1, -1, -1, -1, -1},
-       { 5,  0,  1,  5,  4,  0,  7,  6, 11, -1, -1, -1, -1, -1, -1, -1},
-       {11,  7,  6,  8,  3,  4,  3,  5,  4,  3,  1,  5, -1, -1, -1, -1},
-       { 9,  5,  4, 10,  1,  2,  7,  6, 11, -1, -1, -1, -1, -1, -1, -1},
-       { 6, 11,  7,  1,  2, 10,  0,  8,  3,  4,  9,  5, -1, -1, -1, -1},
-       { 7,  6, 11,  5,  4, 10,  4,  2, 10,  4,  0,  2, -1, -1, -1, -1},
-       { 3,  4,  8,  3,  5,  4,  3,  2,  5, 10,  5,  2, 11,  7,  6, -1},
-       { 7,  2,  3,  7,  6,  2,  5,  4,  9, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  5,  4,  0,  8,  6,  0,  6,  2,  6,  8,  7, -1, -1, -1, -1},
-       { 3,  6,  2,  3,  7,  6,  1,  5,  0,  5,  4,  0, -1, -1, -1, -1},
-       { 6,  2,  8,  6,  8,  7,  2,  1,  8,  4,  8,  5,  1,  5,  8, -1},
-       { 9,  5,  4, 10,  1,  6,  1,  7,  6,  1,  3,  7, -1, -1, -1, -1},
-       { 1,  6, 10,  1,  7,  6,  1,  0,  7,  8,  7,  0,  9,  5,  4, -1},
-       { 4,  0, 10,  4, 10,  5,  0,  3, 10,  6, 10,  7,  3,  7, 10, -1},
-       { 7,  6, 10,  7, 10,  8,  5,  4, 10,  4,  8, 10, -1, -1, -1, -1},
-       { 6,  9,  5,  6, 11,  9, 11,  8,  9, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  6, 11,  0,  6,  3,  0,  5,  6,  0,  9,  5, -1, -1, -1, -1},
-       { 0, 11,  8,  0,  5, 11,  0,  1,  5,  5,  6, 11, -1, -1, -1, -1},
-       { 6, 11,  3,  6,  3,  5,  5,  3,  1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2, 10,  9,  5, 11,  9, 11,  8, 11,  5,  6, -1, -1, -1, -1},
-       { 0, 11,  3,  0,  6, 11,  0,  9,  6,  5,  6,  9,  1,  2, 10, -1},
-       {11,  8,  5, 11,  5,  6,  8,  0,  5, 10,  5,  2,  0,  2,  5, -1},
-       { 6, 11,  3,  6,  3,  5,  2, 10,  3, 10,  5,  3, -1, -1, -1, -1},
-       { 5,  8,  9,  5,  2,  8,  5,  6,  2,  3,  8,  2, -1, -1, -1, -1},
-       { 9,  5,  6,  9,  6,  0,  0,  6,  2, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  5,  8,  1,  8,  0,  5,  6,  8,  3,  8,  2,  6,  2,  8, -1},
-       { 1,  5,  6,  2,  1,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  3,  6,  1,  6, 10,  3,  8,  6,  5,  6,  9,  8,  9,  6, -1},
-       {10,  1,  0, 10,  0,  6,  9,  5,  0,  5,  6,  0, -1, -1, -1, -1},
-       { 0,  3,  8,  5,  6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       {10,  5,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       {11,  5, 10,  7,  5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       {11,  5, 10, 11,  7,  5,  8,  3,  0, -1, -1, -1, -1, -1, -1, -1},
-       { 5, 11,  7,  5, 10, 11,  1,  9,  0, -1, -1, -1, -1, -1, -1, -1},
-       {10,  7,  5, 10, 11,  7,  9,  8,  1,  8,  3,  1, -1, -1, -1, -1},
-       {11,  1,  2, 11,  7,  1,  7,  5,  1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8,  3,  1,  2,  7,  1,  7,  5,  7,  2, 11, -1, -1, -1, -1},
-       { 9,  7,  5,  9,  2,  7,  9,  0,  2,  2, 11,  7, -1, -1, -1, -1},
-       { 7,  5,  2,  7,  2, 11,  5,  9,  2,  3,  2,  8,  9,  8,  2, -1},
-       { 2,  5, 10,  2,  3,  5,  3,  7,  5, -1, -1, -1, -1, -1, -1, -1},
-       { 8,  2,  0,  8,  5,  2,  8,  7,  5, 10,  2,  5, -1, -1, -1, -1},
-       { 9,  0,  1,  5, 10,  3,  5,  3,  7,  3, 10,  2, -1, -1, -1, -1},
-       { 9,  8,  2,  9,  2,  1,  8,  7,  2, 10,  2,  5,  7,  5,  2, -1},
-       { 1,  3,  5,  3,  7,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8,  7,  0,  7,  1,  1,  7,  5, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  0,  3,  9,  3,  5,  5,  3,  7, -1, -1, -1, -1, -1, -1, -1},
-       { 9,  8,  7,  5,  9,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 5,  8,  4,  5, 10,  8, 10, 11,  8, -1, -1, -1, -1, -1, -1, -1},
-       { 5,  0,  4,  5, 11,  0,  5, 10, 11, 11,  3,  0, -1, -1, -1, -1},
-       { 0,  1,  9,  8,  4, 10,  8, 10, 11, 10,  4,  5, -1, -1, -1, -1},
-       {10, 11,  4, 10,  4,  5, 11,  3,  4,  9,  4,  1,  3,  1,  4, -1},
-       { 2,  5,  1,  2,  8,  5,  2, 11,  8,  4,  5,  8, -1, -1, -1, -1},
-       { 0,  4, 11,  0, 11,  3,  4,  5, 11,  2, 11,  1,  5,  1, 11, -1},
-       { 0,  2,  5,  0,  5,  9,  2, 11,  5,  4,  5,  8, 11,  8,  5, -1},
-       { 9,  4,  5,  2, 11,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 2,  5, 10,  3,  5,  2,  3,  4,  5,  3,  8,  4, -1, -1, -1, -1},
-       { 5, 10,  2,  5,  2,  4,  4,  2,  0, -1, -1, -1, -1, -1, -1, -1},
-       { 3, 10,  2,  3,  5, 10,  3,  8,  5,  4,  5,  8,  0,  1,  9, -1},
-       { 5, 10,  2,  5,  2,  4,  1,  9,  2,  9,  4,  2, -1, -1, -1, -1},
-       { 8,  4,  5,  8,  5,  3,  3,  5,  1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  4,  5,  1,  0,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 8,  4,  5,  8,  5,  3,  9,  0,  5,  0,  3,  5, -1, -1, -1, -1},
-       { 9,  4,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4, 11,  7,  4,  9, 11,  9, 10, 11, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  8,  3,  4,  9,  7,  9, 11,  7,  9, 10, 11, -1, -1, -1, -1},
-       { 1, 10, 11,  1, 11,  4,  1,  4,  0,  7,  4, 11, -1, -1, -1, -1},
-       { 3,  1,  4,  3,  4,  8,  1, 10,  4,  7,  4, 11, 10, 11,  4, -1},
-       { 4, 11,  7,  9, 11,  4,  9,  2, 11,  9,  1,  2, -1, -1, -1, -1},
-       { 9,  7,  4,  9, 11,  7,  9,  1, 11,  2, 11,  1,  0,  8,  3, -1},
-       {11,  7,  4, 11,  4,  2,  2,  4,  0, -1, -1, -1, -1, -1, -1, -1},
-       {11,  7,  4, 11,  4,  2,  8,  3,  4,  3,  2,  4, -1, -1, -1, -1},
-       { 2,  9, 10,  2,  7,  9,  2,  3,  7,  7,  4,  9, -1, -1, -1, -1},
-       { 9, 10,  7,  9,  7,  4, 10,  2,  7,  8,  7,  0,  2,  0,  7, -1},
-       { 3,  7, 10,  3, 10,  2,  7,  4, 10,  1, 10,  0,  4,  0, 10, -1},
-       { 1, 10,  2,  8,  7,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  9,  1,  4,  1,  7,  7,  1,  3, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  9,  1,  4,  1,  7,  0,  8,  1,  8,  7,  1, -1, -1, -1, -1},
-       { 4,  0,  3,  7,  4,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 4,  8,  7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 9, 10,  8, 10, 11,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  0,  9,  3,  9, 11, 11,  9, 10, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  1, 10,  0, 10,  8,  8, 10, 11, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  1, 10, 11,  3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  2, 11,  1, 11,  9,  9, 11,  8, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  0,  9,  3,  9, 11,  1,  2,  9,  2, 11,  9, -1, -1, -1, -1},
-       { 0,  2, 11,  8,  0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 3,  2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 2,  3,  8,  2,  8, 10, 10,  8,  9, -1, -1, -1, -1, -1, -1, -1},
-       { 9, 10,  2,  0,  9,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 2,  3,  8,  2,  8, 10,  0,  1,  8,  1, 10,  8, -1, -1, -1, -1},
-       { 1, 10,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 1,  3,  8,  9,  1,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  9,  1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       { 0,  3,  8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
-       {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
-};
-
-
-
-/* Linearly interpolate the position where an isosurface cuts
- * an edge between two vertices, each with their own scalar value
- */
-static XYZ interp_vertex (double isolevel, XYZ p1, XYZ p2, double valp1, double valp2)
-{
-       double mu;
-       XYZ p;
-
-       if (ABS(isolevel-valp1) < 0.00001)
-               return(p1);
-       if (ABS(isolevel-valp2) < 0.00001)
-               return(p2);
-       if (ABS(valp1-valp2) < 0.00001)
-               return(p1);
-       mu = (isolevel - valp1) / (valp2 - valp1);
-       p.x = p1.x + mu * (p2.x - p1.x);
-       p.y = p1.y + mu * (p2.y - p1.y);
-       p.z = p1.z + mu * (p2.z - p1.z);
-
-       return(p);
-}
-
-
-/* Given a grid cell and an isolevel, calculate the triangular
- * facets required to represent the isosurface through the cell.
- * Return the number of triangular facets.
- * `triangles' will be loaded up with the vertices at most 5 triangular facets.
- * 0 will be returned if the grid cell is either totally above
- * of totally below the isolevel.
- *
- * By Paul Bourke <pbourke@swin.edu.au>
- */
-int march_one_cube (GRIDCELL grid, double isolevel, TRIANGLE *triangles)
-{
-       int i, ntriang;
-       int cubeindex;
-       XYZ vertlist[12];
-
-       /*
-        * Determine the index into the edge table which
-        * tells us which vertices are inside of the surface
-        */
-       cubeindex = 0;
-       if (grid.val[0] < isolevel) cubeindex |= 1;
-       if (grid.val[1] < isolevel) cubeindex |= 2;
-       if (grid.val[2] < isolevel) cubeindex |= 4;
-       if (grid.val[3] < isolevel) cubeindex |= 8;
-       if (grid.val[4] < isolevel) cubeindex |= 16;
-       if (grid.val[5] < isolevel) cubeindex |= 32;
-       if (grid.val[6] < isolevel) cubeindex |= 64;
-       if (grid.val[7] < isolevel) cubeindex |= 128;
-
-       /* Cube is entirely in/out of the surface */
-       if (edgeTable[cubeindex] == 0)
-               return(0);
-
-       /* Find the vertices where the surface intersects the cube */
-       if (edgeTable[cubeindex] & 1)
-               vertlist[0] =
-                       interp_vertex (isolevel,grid.p[0],grid.p[1],grid.val[0],grid.val[1]);
-       if (edgeTable[cubeindex] & 2)
-               vertlist[1] =
-                       interp_vertex (isolevel,grid.p[1],grid.p[2],grid.val[1],grid.val[2]);
-       if (edgeTable[cubeindex] & 4)
-               vertlist[2] =
-                       interp_vertex (isolevel,grid.p[2],grid.p[3],grid.val[2],grid.val[3]);
-       if (edgeTable[cubeindex] & 8)
-               vertlist[3] =
-                       interp_vertex (isolevel,grid.p[3],grid.p[0],grid.val[3],grid.val[0]);
-       if (edgeTable[cubeindex] & 16)
-               vertlist[4] =
-                       interp_vertex (isolevel,grid.p[4],grid.p[5],grid.val[4],grid.val[5]);
-       if (edgeTable[cubeindex] & 32)
-               vertlist[5] =
-                       interp_vertex (isolevel,grid.p[5],grid.p[6],grid.val[5],grid.val[6]);
-       if (edgeTable[cubeindex] & 64)
-               vertlist[6] =
-                       interp_vertex (isolevel,grid.p[6],grid.p[7],grid.val[6],grid.val[7]);
-       if (edgeTable[cubeindex] & 128)
-               vertlist[7] =
-                       interp_vertex (isolevel,grid.p[7],grid.p[4],grid.val[7],grid.val[4]);
-       if (edgeTable[cubeindex] & 256)
-               vertlist[8] =
-                       interp_vertex (isolevel,grid.p[0],grid.p[4],grid.val[0],grid.val[4]);
-       if (edgeTable[cubeindex] & 512)
-               vertlist[9] =
-                       interp_vertex (isolevel,grid.p[1],grid.p[5],grid.val[1],grid.val[5]);
-       if (edgeTable[cubeindex] & 1024)
-               vertlist[10] =
-                       interp_vertex (isolevel,grid.p[2],grid.p[6],grid.val[2],grid.val[6]);
-       if (edgeTable[cubeindex] & 2048)
-               vertlist[11] =
-                       interp_vertex (isolevel,grid.p[3],grid.p[7],grid.val[3],grid.val[7]);
-
-       /* Create the triangle */
-       ntriang = 0;
-       for (i=0; triTable[cubeindex][i] != -1; i+=3)
-       {
-               triangles[ntriang].p[0] = vertlist[triTable[cubeindex][i  ]];
-               triangles[ntriang].p[1] = vertlist[triTable[cubeindex][i+1]];
-               triangles[ntriang].p[2] = vertlist[triTable[cubeindex][i+2]];
-               ntriang++;
-       }
-
-       return(ntriang);
-}
-
-
-/* Walking the grid.  By jwz.
- */
-
-
-/* Computes the normal of the scalar field at the given point,
- * for vertex normals (as opposed to face normals.)
- */
-void do_function_normal (double x, double y, double z,
-               double (*compute_fn) (double x, double y, double z,
-                       void *closure),
-               void *c)
-{
-       XYZ n;
-       double off = 0.5;
-       n.x = compute_fn (x-off, y, z, c) - compute_fn (x+off, y, z, c);
-       n.y = compute_fn (x, y-off, z, c) - compute_fn (x, y+off, z, c);
-       n.z = compute_fn (x, y, z-off, c) - compute_fn (x, y, z+off, c);
-       /* normalize (&n); */
-       glNormal3f (n.x, n.y, n.z);
-}
-
-
-/* Given a function capable of generating a value at any XYZ position,
- * creates OpenGL faces for the solids defined.
- *
- * init_fn is called at the beginning for initial, and returns an object.
- * free_fn is called at the end.
- *
- * compute_fn is called for each XYZ in the specified grid, and returns
- * the double value of that coordinate.  If smoothing is on, then
- * compute_fn will also be called twice more for each emitted vertex,
- * in order to calculate vertex normals (so don't assume it will only
- * be called with values falling on the grid boundaries.)
- *
- * Points are inside an object if the are less than `isolevel', and
- * outside otherwise.
- */
-void
-marching_cubes (int grid_size,     /* density of the mesh */
-               double isolevel,   /* cutoff point for "in" versus "out" */
-               int wireframe_p,   /* wireframe, or solid */
-               int smooth_p,      /* smooth, or faceted */
-
-               void * (*init_fn)    (double grid_size, void *closure1),
-               double (*compute_fn) (double x, double y, double z,
-                       void *closure2),
-               void   (*free_fn)    (void *closure2),
-               void *closure1,
-
-               unsigned long *polygon_count)
-{
-       int planesize = grid_size * grid_size;
-       int x, y, z;
-       void *closure2 = 0;
-       unsigned long polys = 0;
-       double *layers;
-
-       layers = (double *) g_malloc0(sizeof (*layers) * planesize * 2);
-       if (!layers)
-       {
-               g_error("out of memory for %dx%dx%d grid\n",
-                               grid_size, grid_size, 2);
-       }
-
-       if (init_fn)
-               closure2 = init_fn (grid_size, closure1);
-
-       glFrontFace(GL_CCW);
-       if (!wireframe_p)
-               glBegin (GL_TRIANGLES);
-
-       for (z = 0; z < grid_size; z++)
-       {
-               double *layer0 = (z & 1 ? layers+planesize : layers);
-               double *layer1 = (z & 1 ? layers           : layers+planesize);
-               double *row;
-
-               /* Fill in the XY grid on the currently-bottommost layer. */
-               row = layer1;
-               for (y = 0; y < grid_size; y++, row += grid_size)
-               {
-                       double *cell = row;
-                       for (x = 0; x < grid_size; x++, cell++)
-                               *cell = compute_fn (x, y, z, closure2);
-               }
-
-               /* Now we've completed one layer (an XY slice of Z.)  Now we can
-                  generate the polygons that fill the space between this layer
-                  and the previous one (unless this is the first layer.)
-                */
-               if (z == 0) continue;
-
-               for (y = 1; y < grid_size; y += 1)
-                       for (x = 1; x < grid_size; x += 1)
-                       {
-                               TRIANGLE tri[6];
-                               int i, ntri;
-                               GRIDCELL cell;
-
-                               /* This is kinda hokey, there ought to be a more efficient
-                                  way to do this... */
-                               cell.p[0].x = x-1; cell.p[0].y = y-1; cell.p[0].z = z-1;
-                               cell.p[1].x = x  ; cell.p[1].y = y-1; cell.p[1].z = z-1;
-                               cell.p[2].x = x  ; cell.p[2].y = y  ; cell.p[2].z = z-1;
-                               cell.p[3].x = x-1; cell.p[3].y = y  ; cell.p[3].z = z-1;
-                               cell.p[4].x = x-1; cell.p[4].y = y-1; cell.p[4].z = z  ;
-                               cell.p[5].x = x  ; cell.p[5].y = y-1; cell.p[5].z = z  ;
-                               cell.p[6].x = x  ; cell.p[6].y = y  ; cell.p[6].z = z  ;
-                               cell.p[7].x = x-1; cell.p[7].y = y  ; cell.p[7].z = z  ;
-
-# define GRID(X,Y,WHICH) ((WHICH) \
-               ? layer1[((Y)*grid_size) + ((X))] \
-               : layer0[((Y)*grid_size) + ((X))])
-
-                               cell.val[0] = GRID (x-1, y-1, 0);
-                               cell.val[1] = GRID (x  , y-1, 0);
-                               cell.val[2] = GRID (x  , y  , 0);
-                               cell.val[3] = GRID (x-1, y  , 0);
-                               cell.val[4] = GRID (x-1, y-1, 1);
-                               cell.val[5] = GRID (x  , y-1, 1);
-                               cell.val[6] = GRID (x  , y  , 1);
-                               cell.val[7] = GRID (x-1, y  , 1);
-# undef GRID
-
-                               /* Now generate the triangles for this cubic segment,
-                                  and emit the GL faces.
-                                */
-                               ntri = march_one_cube (cell, isolevel, tri);
-                               polys += ntri;
-                               for (i = 0; i < ntri; i++)
-                               {
-                                       if (wireframe_p) glBegin (GL_LINE_LOOP);
-
-                                       /* If we're smoothing, we need to call the field function
-                                          again for each vertex (via function_normal().)  If we're
-                                          not smoothing, then we can just compute the normal from
-                                          this triangle.
-                                        */
-                                       if (!smooth_p)
-                                               do_normal (tri[i].p[0].x, tri[i].p[0].y, tri[i].p[0].z,
-                                                               tri[i].p[1].x, tri[i].p[1].y, tri[i].p[1].z,
-                                                               tri[i].p[2].x, tri[i].p[2].y, tri[i].p[2].z);
-
-# define VERT(X,Y,Z) \
-                                       if (smooth_p) \
-                                       do_function_normal ((X), (Y), (Z), compute_fn, closure2); \
-                                       glVertex3f ((X), (Y), (Z))
-
-                                       VERT (tri[i].p[0].x, tri[i].p[0].y, tri[i].p[0].z);
-                                       VERT (tri[i].p[1].x, tri[i].p[1].y, tri[i].p[1].z);
-                                       VERT (tri[i].p[2].x, tri[i].p[2].y, tri[i].p[2].z);
-# undef VERT
-                                       if (wireframe_p) glEnd ();
-                               }
-                       }
-       }
-
-       if (!wireframe_p)
-               glEnd ();
-
-       g_free(layers);
-
-       if (free_fn)
-               free_fn (closure2);
-
-       if (polygon_count)
-               *polygon_count = polys;
-}
diff --git a/src/plugins/marching.h b/src/plugins/marching.h
deleted file mode 100644 (file)
index b1186f5..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Copyright (c) 2002 Jamie Zawinski <jwz@jwz.org>
- * Copyright (c) 2009 Andy Spencer <andy753421@gmail.com>
- *
- * Utility functions to create "marching cubes" meshes from 3d fields.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation.  No representations are made about the suitability of this
- * software for any purpose.  It is provided "as is" without express or 
- * implied warranty.
- */
-
-#ifndef __MARCHING_H__
-#define __MARCHING_H__
-
-typedef struct {
-       double x;
-       double y;
-       double z;
-} XYZ;
-
-typedef struct {
-   XYZ p[3];
-} TRIANGLE;
-
-typedef struct {
-   XYZ p[8];
-   double val[8];
-} GRIDCELL;
-
-int march_one_cube(GRIDCELL grid, double isolevel, TRIANGLE *triangles);
-
-void do_function_normal (double x, double y, double z,
-               double (*compute_fn) (double x, double y, double z,
-                       void *closure),
-               void *c);
-
-XYZ calc_normal (XYZ p, XYZ p1, XYZ p2);
-
-void do_normal(float x1, float y1, float z1,
-               float x2, float y2, float z2,
-               float x3, float y3, float z3);
-
-
-/* Given a function capable of generating a value at any XYZ position,
-   creates OpenGL faces for the solids defined.
-
-   init_fn is called at the beginning for initial, and returns an object.
-   free_fn is called at the end.
-
-   compute_fn is called for each XYZ in the specified grid, and returns
-   the double value of that coordinate.  If smoothing is on, then
-   compute_fn will also be called twice more for each emitted vertex,
-   in order to calculate vertex normals (so don't assume it will only
-   be called with values falling on the grid boundaries.)
-
-   Points are inside an object if the are less than `isolevel', and
-   outside otherwise.
-
-   If polygon_count is specified, the number of faces generated will be
-   returned there.
-*/
-extern void
-marching_cubes (int grid_size,     /* density of the mesh */
-                double isolevel,   /* cutoff point for "in" versus "out" */
-                int wireframe_p,   /* wireframe, or solid */
-                int smooth_p,      /* smooth, or faceted */
-
-                void * (*init_fn)    (double grid_size, void *closure1),
-                double (*compute_fn) (double x, double y, double z,
-                                      void *closure2),
-                void   (*free_fn)    (void *closure2),
-                void *closure1,
-
-                unsigned long *polygon_count);
-
-#endif /* __MARCHING_H__ */
diff --git a/src/plugins/radar-colormap.c b/src/plugins/radar-colormap.c
deleted file mode 100644 (file)
index 03b2f32..0000000
+++ /dev/null
@@ -1,785 +0,0 @@
-#include <glib.h>
-#include "radar.h"
-
-         //{0xcc,0xff,0xff,0xff},{0xcc,0xff,0xff,0xff}, {0xcc,0xff,0xff,0xff},
-         //{0xcc,0x99,0xcc,0xff},{0xcc,0x99,0xcc,0xff}, {0xcc,0x99,0xcc,0xff},
-         //{0x99,0x66,0x99,0xff},{0x99,0x66,0x99,0xff}, {0x99,0x66,0x99,0xff},
-         //{0x66,0x33,0x66,0xff},{0x66,0x33,0x66,0xff}, {0x66,0x33,0x66,0xff},
-         //{0xcc,0xcc,0x99,0xff},{0xcc,0xcc,0x99,0xff}, {0xcc,0xcc,0x99,0xff},
-         //{0x99,0x99,0x66,0xff},{0x99,0x99,0x66,0xff}, {0x99,0x99,0x66,0xff},
-colormap_t colormaps[] = {
-       {"Reflectivity",
-        {{0x00,0x00,0x00,0x00}, //  0 dBZ
-          {0x00,0x00,0x00,0x00}, //  1 dBZ
-          {0x00,0x00,0x00,0x00}, //  2 dBZ
-          {0x00,0x00,0x00,0x00}, //  3 dBZ
-          {0x04,0xe9,0xe7,0x00}, //  4 dBZ
-          {0x04,0xe9,0xe7,0x00}, //  5 dBZ
-          {0x04,0xe9,0xe7,0x10}, //  6 dBZ
-          {0x04,0xe9,0xe7,0x20}, //  7 dBZ
-          {0x04,0xe9,0xe7,0x30}, //  8 dBZ
-          {0x01,0x9f,0xf4,0x40}, //  9 dBZ
-          {0x01,0x9f,0xf4,0x50}, // 10 dBZ
-          {0x01,0x9f,0xf4,0x60}, // 11 dBZ
-          {0x01,0x9f,0xf4,0x70}, // 12 dBZ
-          {0x01,0x9f,0xf4,0x80}, // 13 dBZ
-          {0x03,0x00,0xf4,0x90}, // 14 dBZ
-          {0x03,0x00,0xf4,0xa0}, // 15 dBZ
-          {0x03,0x00,0xf4,0xb0}, // 16 dBZ
-          {0x03,0x00,0xf4,0xc0}, // 17 dBZ
-          {0x03,0x00,0xf4,0xd0}, // 18 dBZ
-          {0x02,0xfd,0x02,0xe0}, // 19 dBZ
-          {0x02,0xfd,0x02,0xf0}, // 20 dBZ
-          {0x02,0xfd,0x02,0xff}, // 21 dBZ
-          {0x02,0xfd,0x02,0xff}, // 22 dBZ
-          {0x02,0xfd,0x02,0xff}, // 23 dBZ
-          {0x01,0xc5,0x01,0xff}, // 24 dBZ
-          {0x01,0xc5,0x01,0xff}, // 25 dBZ
-          {0x01,0xc5,0x01,0xff}, // 26 dBZ
-          {0x01,0xc5,0x01,0xff}, // 27 dBZ
-          {0x01,0xc5,0x01,0xff}, // 28 dBZ
-          {0x00,0x8e,0x00,0xff}, // 29 dBZ
-          {0x00,0x8e,0x00,0xff}, // 30 dBZ
-          {0x00,0x8e,0x00,0xff}, // 31 dBZ
-          {0x00,0x8e,0x00,0xff}, // 32 dBZ
-          {0x00,0x8e,0x00,0xff}, // 33 dBZ
-          {0xfd,0xf8,0x02,0xff}, // 34 dBZ
-          {0xfd,0xf8,0x02,0xff}, // 35 dBZ
-          {0xfd,0xf8,0x02,0xff}, // 36 dBZ
-          {0xfd,0xf8,0x02,0xff}, // 37 dBZ
-          {0xfd,0xf8,0x02,0xff}, // 38 dBZ
-          {0xe5,0xbc,0x00,0xff}, // 39 dBZ
-          {0xe5,0xbc,0x00,0xff}, // 40 dBZ
-          {0xe5,0xbc,0x00,0xff}, // 41 dBZ
-          {0xe5,0xbc,0x00,0xff}, // 42 dBZ
-          {0xe5,0xbc,0x00,0xff}, // 43 dBZ
-          {0xfd,0x95,0x00,0xff}, // 44 dBZ
-          {0xfd,0x95,0x00,0xff}, // 45 dBZ
-          {0xfd,0x95,0x00,0xff}, // 46 dBZ
-          {0xfd,0x95,0x00,0xff}, // 47 dBZ
-          {0xfd,0x95,0x00,0xff}, // 48 dBZ
-          {0xfd,0x00,0x00,0xff}, // 49 dBZ
-          {0xfd,0x00,0x00,0xff}, // 50 dBZ
-          {0xfd,0x00,0x00,0xff}, // 51 dBZ
-          {0xfd,0x00,0x00,0xff}, // 52 dBZ
-          {0xfd,0x00,0x00,0xff}, // 53 dBZ
-          {0xd4,0x00,0x00,0xff}, // 54 dBZ
-          {0xd4,0x00,0x00,0xff}, // 55 dBZ
-          {0xd4,0x00,0x00,0xff}, // 56 dBZ
-          {0xd4,0x00,0x00,0xff}, // 57 dBZ
-          {0xd4,0x00,0x00,0xff}, // 58 dBZ
-          {0xbc,0x00,0x00,0xff}, // 59 dBZ
-          {0xbc,0x00,0x00,0xff}, // 60 dBZ
-          {0xbc,0x00,0x00,0xff}, // 61 dBZ
-          {0xbc,0x00,0x00,0xff}, // 62 dBZ
-          {0xbc,0x00,0x00,0xff}, // 63 dBZ
-          {0xf8,0x00,0xfd,0xff}, // 64 dBZ
-          {0xf8,0x00,0xfd,0xff}, // 65 dBZ
-          {0xf8,0x00,0xfd,0xff}, // 66 dBZ
-          {0xf8,0x00,0xfd,0xff}, // 67 dBZ
-          {0xf8,0x00,0xfd,0xff}, // 68 dBZ
-          {0x98,0x54,0xc6,0xff}, // 69 dBZ
-          {0x98,0x54,0xc6,0xff}, // 70 dBZ
-          {0x98,0x54,0xc6,0xff}, // 71 dBZ
-          {0x98,0x54,0xc6,0xff}, // 72 dBZ
-          {0x98,0x54,0xc6,0xff}, // 73 dBZ
-          {0xfd,0xfd,0xfd,0xff}, // 74 dBZ
-         {0xfd,0xfd,0xfd,0xff}, // 75 dBZ
-         {0xfd,0xfd,0xfd,0xff}, // 76 dBZ
-         {0xfd,0xfd,0xfd,0xff}, // 77 dBZ
-         {0xfd,0xfd,0xfd,0xff}, // 78 dBZ
-         {0xfd,0xfd,0xfd,0xff}, // 79 dBZ
-         {0xfd,0xfd,0xfd,0xff}, // 80 dBZ
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00}}},
-       {"Velocity",
-        {
-         {0x88,0x88,0x88,0x00}, //  0  
-         {0x98,0x77,0x77,0xff}, //  1  
-         {0x98,0x77,0x77,0xff}, //  2  
-         {0x98,0x77,0x77,0xff}, //  3  
-         {0x98,0x77,0x77,0xff}, //  4  
-          {0x89,0x00,0x00,0xff}, //  5  
-          {0xa2,0x00,0x00,0xff}, //  6  
-          {0xa2,0x00,0x00,0xff}, //  7  
-          {0xa2,0x00,0x00,0xff}, //  8  
-          {0xa2,0x00,0x00,0xff}, //  9  
-          {0xa2,0x00,0x00,0xff}, //  10 
-          {0xb9,0x00,0x00,0xff}, //  11 
-          {0xb9,0x00,0x00,0xff}, //  12 
-          {0xb9,0x00,0x00,0xff}, //  13 
-          {0xb9,0x00,0x00,0xff}, //  14 
-          {0xb9,0x00,0x00,0xff}, //  15 
-          {0xb9,0x00,0x00,0xff}, //  16 
-          {0xb9,0x00,0x00,0xff}, //  17 
-          {0xb9,0x00,0x00,0xff}, //  18 
-          {0xb9,0x00,0x00,0xff}, //  19 
-          {0xb9,0x00,0x00,0xff}, //  20 
-          {0xb9,0x00,0x00,0xff}, //  21 
-          {0xb9,0x00,0x00,0xff}, //  22 
-          {0xd8,0x00,0x00,0xff}, //  23 
-          {0xd8,0x00,0x00,0xff}, //  24 
-          {0xd8,0x00,0x00,0xff}, //  25 
-          {0xd8,0x00,0x00,0xff}, //  26 
-          {0xd8,0x00,0x00,0xff}, //  27 
-          {0xd8,0x00,0x00,0xff}, //  28 
-          {0xd8,0x00,0x00,0xff}, //  29 
-          {0xd8,0x00,0x00,0xff}, //  30 
-          {0xef,0x00,0x00,0xff}, //  31 
-          {0xef,0x00,0x00,0xff}, //  32 
-          {0xef,0x00,0x00,0xff}, //  33 
-          {0xef,0x00,0x00,0xff}, //  34 
-          {0xef,0x00,0x00,0xff}, //  35 
-          {0xef,0x00,0x00,0xff}, //  36 
-          {0xef,0x00,0x00,0xff}, //  37 
-          {0xef,0x00,0x00,0xff}, //  38 
-          {0xef,0x00,0x00,0xff}, //  39 
-          {0xef,0x00,0x00,0xff}, //  40 
-          {0xfe,0x00,0x00,0xff}, //  41 
-          {0xfe,0x00,0x00,0xff}, //  42 
-          {0xfe,0x00,0x00,0xff}, //  43 
-          {0xfe,0x00,0x00,0xff}, //  44 
-          {0xfe,0x00,0x00,0xff}, //  45 
-          {0xfe,0x00,0x00,0xff}, //  46 
-          {0xfe,0x00,0x00,0xff}, //  47 
-          {0xfe,0x00,0x00,0xff}, //  48 
-          {0xfe,0x00,0x00,0xff}, //  49 
-          {0xfe,0x00,0x00,0xff}, //  50 
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-          {0x02,0xfc,0x02,0xff}, // -50
-          {0x02,0xfc,0x02,0xff}, // -49
-          {0x02,0xfc,0x02,0xff}, // -48
-          {0x02,0xfc,0x02,0xff}, // -47
-          {0x02,0xfc,0x02,0xff}, // -46
-          {0x02,0xfc,0x02,0xff}, // -45
-          {0x02,0xfc,0x02,0xff}, // -44
-          {0x02,0xfc,0x02,0xff}, // -43
-          {0x02,0xfc,0x02,0xff}, // -42
-          {0x02,0xfc,0x02,0xff}, // -41
-          {0x01,0xe4,0x01,0xff}, // -40
-          {0x01,0xe4,0x01,0xff}, // -39
-          {0x01,0xe4,0x01,0xff}, // -38
-          {0x01,0xe4,0x01,0xff}, // -37
-          {0x01,0xe4,0x01,0xff}, // -36
-          {0x01,0xe4,0x01,0xff}, // -35
-          {0x01,0xe4,0x01,0xff}, // -34
-          {0x01,0xe4,0x01,0xff}, // -33
-          {0x01,0xe4,0x01,0xff}, // -32
-          {0x01,0xe4,0x01,0xff}, // -31
-          {0x01,0xc5,0x01,0xff}, // -30
-          {0x01,0xc5,0x01,0xff}, // -29
-          {0x01,0xc5,0x01,0xff}, // -28
-          {0x01,0xc5,0x01,0xff}, // -27
-          {0x01,0xc5,0x01,0xff}, // -26
-          {0x01,0xc5,0x01,0xff}, // -25
-          {0x01,0xc5,0x01,0xff}, // -24
-          {0x01,0xc5,0x01,0xff}, // -23
-          {0x07,0xac,0x04,0xff}, // -22
-          {0x07,0xac,0x04,0xff}, // -21
-          {0x07,0xac,0x04,0xff}, // -20
-          {0x07,0xac,0x04,0xff}, // -19
-          {0x07,0xac,0x04,0xff}, // -18
-          {0x07,0xac,0x04,0xff}, // -17
-          {0x07,0xac,0x04,0xff}, // -16
-          {0x07,0xac,0x04,0xff}, // -15
-          {0x07,0xac,0x04,0xff}, // -14
-          {0x07,0xac,0x04,0xff}, // -13
-          {0x07,0xac,0x04,0xff}, // -12
-          {0x07,0xac,0x04,0xff}, // -11
-          {0x06,0x8f,0x03,0xff}, // -10
-          {0x06,0x8f,0x03,0xff}, // -9 
-          {0x06,0x8f,0x03,0xff}, // -8 
-          {0x06,0x8f,0x03,0xff}, // -7 
-          {0x06,0x8f,0x03,0xff}, // -6 
-          {0x04,0x72,0x02,0xff}, // -5 
-          {0x7c,0x97,0x7b,0xff}, // -4 
-          {0x7c,0x97,0x7b,0xff}, // -3 
-          {0x7c,0x97,0x7b,0xff}, // -2 
-          {0x7c,0x97,0x7b,0xff}, // -1 
-         }},
-       {"Spectrum width",
-        {{0x00,0x00,0x00,0x00},
-         {0x00,0x00,0xa0,0xff},
-         {0x00,0x00,0xd0,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x20,0x20,0xff,0xff},
-         {0x40,0x40,0xff,0xff},
-         {0x70,0x70,0xff,0xff},
-         {0xa0,0xa0,0xff,0xff},
-         {0xd0,0xd0,0xff,0xff},
-         {0xff,0xff,0xff,0xff},
-         {0xff,0xb0,0xa0,0xff},
-         {0xff,0xd0,0x60,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff}}},
-       {NULL, {{}}},
-};
diff --git a/src/plugins/radar.c b/src/plugins/radar.c
deleted file mode 100644 (file)
index 9c76a57..0000000
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
- * 
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkgl.h>
-#include <gio/gio.h>
-#include <GL/gl.h>
-#include <math.h>
-#include <rsl.h>
-
-#include <gis/gis.h>
-
-#include "radar.h"
-#include "marching.h"
-
-
-/**************************
- * Data loading functions *
- **************************/
-/* Convert a sweep to an 2d array of data points */
-static void bscan_sweep(GisPluginRadar *self, Sweep *sweep, colormap_t *colormap,
-               guint8 **data, int *width, int *height)
-{
-       /* Calculate max number of bins */
-       int max_bins = 0;
-       for (int i = 0; i < sweep->h.nrays; i++)
-               max_bins = MAX(max_bins, sweep->ray[i]->h.nbins);
-
-       /* Allocate buffer using max number of bins for each ray */
-       guint8 *buf = g_malloc0(sweep->h.nrays * max_bins * 4);
-
-       /* Fill the data */
-       for (int ri = 0; ri < sweep->h.nrays; ri++) {
-               Ray *ray  = sweep->ray[ri];
-               for (int bi = 0; bi < ray->h.nbins; bi++) {
-                       /* copy RGBA into buffer */
-                       //guint val   = dz_f(ray->range[bi]);
-                       guint8 val   = (guint8)ray->h.f(ray->range[bi]);
-                       guint  buf_i = (ri*max_bins+bi)*4;
-                       buf[buf_i+0] = colormap->data[val][0];
-                       buf[buf_i+1] = colormap->data[val][1];
-                       buf[buf_i+2] = colormap->data[val][2];
-                       buf[buf_i+3] = colormap->data[val][3]; // TESTING
-                       if (val == BADVAL     || val == RFVAL      || val == APFLAG ||
-                           val == NOTFOUND_H || val == NOTFOUND_V || val == NOECHO) {
-                               buf[buf_i+3] = 0x00; // transparent
-                       }
-               }
-       }
-
-       /* set output */
-       *width  = max_bins;
-       *height = sweep->h.nrays;
-       *data   = buf;
-}
-
-/* Load a sweep as the active texture */
-static void load_sweep(GisPluginRadar *self, Sweep *sweep)
-{
-       GisOpenGL *opengl = self->opengl;
-       gis_opengl_begin(opengl);
-       self->cur_sweep = sweep;
-       int height, width;
-       guint8 *data;
-       bscan_sweep(self, sweep, self->cur_colormap, &data, &width, &height);
-       glDeleteTextures(1, &self->cur_sweep_tex);
-       glGenTextures(1, &self->cur_sweep_tex);
-       glBindTexture(GL_TEXTURE_2D, self->cur_sweep_tex);
-       glPixelStorei(GL_PACK_ALIGNMENT, 1);
-       glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-       glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0,
-                       GL_RGBA, GL_UNSIGNED_BYTE, data);
-       g_free(data);
-       gis_opengl_redraw(opengl);
-       gis_opengl_end(opengl);
-}
-
-static void load_colormap(GisPluginRadar *self, gchar *table)
-{
-       /* Set colormap so we can draw it on expose */
-       for (int i = 0; colormaps[i].name; i++)
-               if (g_str_equal(colormaps[i].name, table))
-                       self->cur_colormap = &colormaps[i];
-}
-
-/* Add selectors to the config area for the sweeps */
-static void on_sweep_clicked(GtkRadioButton *button, gpointer _self);
-static void load_radar_gui(GisPluginRadar *self, Radar *radar)
-{
-       /* Clear existing items */
-       GtkWidget *child = gtk_bin_get_child(GTK_BIN(self->config_body));
-       if (child)
-               gtk_widget_destroy(child);
-
-       gdouble elev;
-       guint rows = 1, cols = 1, cur_cols;
-       gchar row_label_str[64], col_label_str[64], button_str[64];
-       GtkWidget *row_label, *col_label, *button = NULL, *elev_box = NULL;
-       GtkWidget *table = gtk_table_new(rows, cols, FALSE);
-
-       for (guint vi = 0; vi < radar->h.nvolumes; vi++) {
-               Volume *vol = radar->v[vi];
-               if (vol == NULL) continue;
-               rows++; cols = 1; elev = 0;
-
-               /* Row label */
-               g_snprintf(row_label_str, 64, "<b>%s:</b>", vol->h.type_str);
-               row_label = gtk_label_new(row_label_str);
-               gtk_label_set_use_markup(GTK_LABEL(row_label), TRUE);
-               gtk_misc_set_alignment(GTK_MISC(row_label), 1, 0.5);
-               gtk_table_attach(GTK_TABLE(table), row_label,
-                               0,1, rows-1,rows, GTK_FILL,GTK_FILL, 5,0);
-
-               for (guint si = 0; si < vol->h.nsweeps; si++) {
-                       Sweep *sweep = vol->sweep[si];
-                       if (sweep == NULL || sweep->h.elev == 0) continue;
-                       if (sweep->h.elev != elev) {
-                               cols++;
-                               elev = sweep->h.elev;
-
-                               /* Column label */
-                               g_object_get(table, "n-columns", &cur_cols, NULL);
-                               if (cols >  cur_cols) {
-                                       g_snprintf(col_label_str, 64, "<b>%.2f°</b>", elev);
-                                       col_label = gtk_label_new(col_label_str);
-                                       gtk_label_set_use_markup(GTK_LABEL(col_label), TRUE);
-                                       gtk_widget_set_size_request(col_label, 50, -1);
-                                       gtk_table_attach(GTK_TABLE(table), col_label,
-                                                       cols-1,cols, 0,1, GTK_FILL,GTK_FILL, 0,0);
-                               }
-
-                               elev_box = gtk_hbox_new(TRUE, 0);
-                               gtk_table_attach(GTK_TABLE(table), elev_box,
-                                               cols-1,cols, rows-1,rows, GTK_FILL,GTK_FILL, 0,0);
-                       }
-
-
-                       /* Button */
-                       g_snprintf(button_str, 64, "%3.2f", elev);
-                       button = gtk_radio_button_new_with_label_from_widget(
-                                       GTK_RADIO_BUTTON(button), button_str);
-                       gtk_widget_set_size_request(button, -1, 26);
-                       //button = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(button));
-                       //gtk_widget_set_size_request(button, -1, 22);
-                       g_object_set(button, "draw-indicator", FALSE, NULL);
-                       gtk_box_pack_end(GTK_BOX(elev_box), button, TRUE, TRUE, 0);
-
-                       g_object_set_data(G_OBJECT(button), "type",  vol->h.type_str);
-                       g_object_set_data(G_OBJECT(button), "sweep", sweep);
-                       g_signal_connect(button, "clicked", G_CALLBACK(on_sweep_clicked), self);
-               }
-       }
-       gtk_container_add(GTK_CONTAINER(self->config_body), table);
-       gtk_widget_show_all(table);
-}
-
-static void _gis_plugin_radar_grid_set(GRIDCELL *grid, int gi, Ray *ray, int bi)
-{
-       Range range = ray->range[bi];
-
-       double angle = deg2rad(ray->h.azimuth);
-       double tilt  = deg2rad(ray->h.elev);
-
-       double lx    = sin(angle);
-       double ly    = cos(angle);
-       double lz    = sin(tilt);
-
-       double dist   = bi*ray->h.gate_size + ray->h.range_bin1;
-               
-       grid->p[gi].x = lx*dist;
-       grid->p[gi].y = ly*dist;
-       grid->p[gi].z = lz*dist;
-
-       guint8 val = (guint8)ray->h.f(ray->range[bi]);
-       if (val == BADVAL     || val == RFVAL      || val == APFLAG ||
-           val == NOTFOUND_H || val == NOTFOUND_V || val == NOECHO ||
-           val > 80)
-               val = 0;
-       grid->val[gi] = (float)val;
-       //g_debug("(%.2f,%.2f,%.2f) - (%.0f,%.0f,%.0f) = %d", 
-       //      angle, tilt, dist,
-       //      grid->p[gi].x,
-       //      grid->p[gi].y,
-       //      grid->p[gi].z,
-       //      val);
-}
-
-/* Load a radar from a decompressed file */
-static void load_radar(GisPluginRadar *self, gchar *radar_file)
-{
-       char *dir  = g_path_get_dirname(radar_file);
-       char *site = g_path_get_basename(dir);
-       g_free(dir);
-       g_debug("GisPluginRadar: load_radar - Loading new radar");
-       RSL_read_these_sweeps("all", NULL);
-       Radar *radar = self->cur_radar = RSL_wsr88d_to_radar(radar_file, site);
-       if (radar == NULL) {
-               g_warning("fail to load radar: path=%s, site=%s", radar_file, site);
-               g_free(site);
-               return;
-       }
-       g_free(site);
-
-#ifdef MARCHING
-       /* Load the surface */
-       if (self->cur_triangles) {
-               g_free(self->cur_triangles);
-               self->cur_triangles = NULL;
-       }
-       self->cur_num_triangles = 0;
-       int x = 1;
-       for (guint vi = 0; vi < radar->h.nvolumes; vi++) {
-               if (radar->v[vi] == NULL) continue;
-
-               for (guint si = 0; si+1 < radar->v[vi]->h.nsweeps; si++) {
-                       Sweep *sweep0 = radar->v[vi]->sweep[si+0];
-                       Sweep *sweep1 = radar->v[vi]->sweep[si+1];
-
-                       //g_debug("_gis_plugin_radar_expose: sweep[%3d-%3d] -- nrays = %d, %d",
-                       //      si, si+1,sweep0->h.nrays, sweep1->h.nrays);
-
-                       /* Skip super->regular resolution switch for now */
-                       if (sweep0 == NULL || sweep0->h.elev == 0 ||
-                           sweep1 == NULL || sweep1->h.elev == 0 ||
-                           sweep0->h.nrays != sweep1->h.nrays)
-                               continue;
-
-                       /* We repack the arrays so that raysX[0] is always north, etc */
-                       Ray **rays0 = g_malloc0(sizeof(Ray*)*sweep0->h.nrays);
-                       Ray **rays1 = g_malloc0(sizeof(Ray*)*sweep1->h.nrays);
-
-                       for (guint ri = 0; ri < sweep0->h.nrays; ri++)
-                               rays0[(guint)(sweep0->ray[ri]->h.azimuth * sweep0->h.nrays / 360)] =
-                                       sweep0->ray[ri];
-                       for (guint ri = 0; ri < sweep1->h.nrays; ri++)
-                               rays1[(guint)(sweep1->ray[ri]->h.azimuth * sweep1->h.nrays / 360)] =
-                                       sweep1->ray[ri];
-
-                       for (guint ri = 0; ri+x < sweep0->h.nrays; ri+=x) {
-                               //g_debug("_gis_plugin_radar_expose: ray[%3d-%3d] -- nbins = %d, %d, %d, %d",
-                               //      ri, ri+x,
-                               //      rays0[ri  ]->h.nbins, 
-                               //      rays0[ri+1]->h.nbins, 
-                               //      rays1[ri  ]->h.nbins, 
-                               //      rays1[ri+1]->h.nbins);
-
-                               for (guint bi = 0; bi+x < rays1[ri]->h.nbins; bi+=x) {
-                                       GRIDCELL grid = {};
-                                       _gis_plugin_radar_grid_set(&grid, 7, rays0[(ri  )%sweep0->h.nrays], bi+x);
-                                       _gis_plugin_radar_grid_set(&grid, 6, rays0[(ri+x)%sweep0->h.nrays], bi+x);
-                                       _gis_plugin_radar_grid_set(&grid, 5, rays0[(ri+x)%sweep0->h.nrays], bi  );
-                                       _gis_plugin_radar_grid_set(&grid, 4, rays0[(ri  )%sweep0->h.nrays], bi  );
-                                       _gis_plugin_radar_grid_set(&grid, 3, rays1[(ri  )%sweep0->h.nrays], bi+x);
-                                       _gis_plugin_radar_grid_set(&grid, 2, rays1[(ri+x)%sweep0->h.nrays], bi+x);
-                                       _gis_plugin_radar_grid_set(&grid, 1, rays1[(ri+x)%sweep0->h.nrays], bi  );
-                                       _gis_plugin_radar_grid_set(&grid, 0, rays1[(ri  )%sweep0->h.nrays], bi  );
-                                       
-                                       TRIANGLE tris[10];
-                                       int n = march_one_cube(grid, 40, tris);
-
-                                       self->cur_triangles = g_realloc(self->cur_triangles,
-                                               (self->cur_num_triangles+n)*sizeof(TRIANGLE));
-                                       for (int i = 0; i < n; i++) {
-                                               //g_debug("triangle: ");
-                                               //g_debug("\t(%f,%f,%f)", tris[i].p[0].x, tris[i].p[0].y, tris[i].p[0].z);
-                                               //g_debug("\t(%f,%f,%f)", tris[i].p[1].x, tris[i].p[1].y, tris[i].p[1].z);
-                                               //g_debug("\t(%f,%f,%f)", tris[i].p[2].x, tris[i].p[2].y, tris[i].p[2].z);
-                                               self->cur_triangles[self->cur_num_triangles+i] = tris[i];
-                                       }
-                                       self->cur_num_triangles += n;
-                                       //g_debug(" ");
-                               }
-                       }
-               }
-               break; // Exit after first volume (reflectivity)
-       }
-#endif
-
-       /* Load the first sweep by default */
-       if (radar->h.nvolumes < 1 || radar->v[0]->h.nsweeps < 1) {
-               g_warning("No sweeps found\n");
-       } else {
-               /* load first available sweep */
-               for (int vi = 0; vi < radar->h.nvolumes; vi++) {
-                       if (radar->v[vi]== NULL) continue;
-                       for (int si = 0; si < radar->v[vi]->h.nsweeps; si++) {
-                               if (radar->v[vi]->sweep[si]== NULL) continue;
-                               load_colormap(self, radar->v[vi]->h.type_str);
-                               load_sweep(self, radar->v[vi]->sweep[si]);
-                               break;
-                       }
-                       break;
-               }
-       }
-
-       load_radar_gui(self, radar);
-}
-
-
-/*****************
- * ASync helpers *
- *****************/
-typedef struct {
-       GisPluginRadar *self;
-       gchar *radar_file;
-} decompressed_t;
-
-static void decompressed_cb(GPid pid, gint status, gpointer _udata)
-{
-       g_debug("GisPluginRadar: decompressed_cb");
-       decompressed_t *udata = _udata;
-       if (status != 0) {
-               g_warning("wsr88ddec exited with status %d", status);
-               return;
-       }
-       load_radar(udata->self, udata->radar_file);
-       g_spawn_close_pid(pid);
-       g_free(udata->radar_file);
-       g_free(udata);
-}
-
-static void cache_chunk_cb(char *path, goffset cur, goffset total, gpointer _self)
-{
-       GisPluginRadar *self = GIS_PLUGIN_RADAR(_self);
-       double percent = (double)cur/total;
-
-       //g_message("GisPluginRadar: cache_chunk_cb - %lld/%lld = %.2f%%",
-       //              cur, total, percent*100);
-
-       gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(self->progress_bar), MIN(percent, 1.0));
-
-       gchar *msg = g_strdup_printf("Loading radar... %5.1f%% (%.2f/%.2f MB)",
-                       percent*100, (double)cur/1000000, (double)total/1000000);
-       gtk_label_set_text(GTK_LABEL(self->progress_label), msg);
-       g_free(msg);
-}
-
-static void cache_done_cb(char *path, gboolean updated, gpointer _self)
-{
-       g_debug("GisPluginRadar: cache_done_cb - updated = %d", updated);
-       GisPluginRadar *self = GIS_PLUGIN_RADAR(_self);
-       char *decompressed = g_strconcat(path, ".raw", NULL);
-       if (!updated && g_file_test(decompressed, G_FILE_TEST_EXISTS)) {
-               load_radar(self, decompressed);
-               return;
-       }
-
-       decompressed_t *udata = g_malloc(sizeof(decompressed_t));
-       udata->self       = self;
-       udata->radar_file = decompressed;
-       g_debug("GisPluginRadar: cache_done_cb - File updated, decompressing..");
-       char *argv[] = {"wsr88ddec", path, decompressed, NULL};
-       GPid pid;
-       GError *error = NULL;
-       g_spawn_async(
-               NULL,    // const gchar *working_directory,
-               argv,    // gchar **argv,
-               NULL,    // gchar **envp,
-               G_SPAWN_SEARCH_PATH|
-               G_SPAWN_DO_NOT_REAP_CHILD, 
-                        // GSpawnFlags flags,
-               NULL,    // GSpawnChildSetupFunc child_setup,
-               NULL,    // gpointer user_data,
-               &pid,    // GPid *child_pid,
-               &error); // GError **error
-       if (error) {
-               g_warning("failed to decompress WSR88D data: %s",
-                               error->message);
-               g_error_free(error);
-       }
-       g_child_watch_add(pid, decompressed_cb, udata);
-       self->soup = NULL;
-}
-
-
-/*************
- * Callbacks *
- *************/
-static void on_sweep_clicked(GtkRadioButton *button, gpointer _self)
-{
-       GisPluginRadar *self = GIS_PLUGIN_RADAR(_self);
-       load_colormap(self, g_object_get_data(G_OBJECT(button), "type" ));
-       load_sweep   (self, g_object_get_data(G_OBJECT(button), "sweep"));
-}
-
-static void on_time_changed(GisView *view, const char *time, gpointer _self)
-{
-       GisPluginRadar *self = GIS_PLUGIN_RADAR(_self);
-       g_debug("GisPluginRadar: on_time_changed - setting time=%s", time);
-       // format: http://mesonet.agron.iastate.edu/data/nexrd2/raw/KABR/KABR_20090510_0323
-       char *site = gis_view_get_site(view);
-       char *path = g_strdup_printf("nexrd2/raw/%s/%s_%s", site, site, time);
-
-       /* Set up progress bar */
-       GtkWidget *child = gtk_bin_get_child(GTK_BIN(self->config_body));
-       if (child) gtk_widget_destroy(child);
-
-       GtkWidget *vbox = gtk_vbox_new(FALSE, 10);
-       gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
-       self->progress_bar   = gtk_progress_bar_new();
-       self->progress_label = gtk_label_new("Loading radar...");
-       gtk_box_pack_start(GTK_BOX(vbox), self->progress_bar,   FALSE, FALSE, 0);
-       gtk_box_pack_start(GTK_BOX(vbox), self->progress_label, FALSE, FALSE, 0);
-       gtk_container_add(GTK_CONTAINER(self->config_body), vbox);
-       gtk_widget_show_all(self->config_body);
-
-       /* Clear radar */
-       if (self->cur_radar)
-               RSL_free_radar(self->cur_radar);
-       self->cur_radar = NULL;
-       self->cur_sweep = NULL;
-       gis_opengl_redraw(self->opengl);
-
-       /* Start loading the new radar */
-       if (self->soup) {
-               soup_session_abort(self->soup);
-               self->soup = NULL;
-       }
-       gchar *base = gis_prefs_get_string(self->prefs, "aweather/nexrad_url");
-       if (gis_world_get_offline(self->world)) 
-               self->soup = cache_file(base, path, GIS_ONCE,
-                               cache_chunk_cb, cache_done_cb, self);
-       else 
-               self->soup = cache_file(base, path, GIS_UPDATE,
-                               cache_chunk_cb, cache_done_cb, self);
-       g_free(path);
-}
-
-
-/***********
- * Methods *
- ***********/
-GisPluginRadar *gis_plugin_radar_new(GisWorld *world, GisView *view, GisOpenGL *opengl, GisPrefs *prefs)
-{
-       /* TODO: move to constructor if possible */
-       g_debug("GisPluginRadar: new");
-       GisPluginRadar *self = g_object_new(GIS_TYPE_PLUGIN_RADAR, NULL);
-       self->world  = world;
-       self->view   = view;
-       self->opengl = opengl;
-       self->prefs  = prefs;
-       self->time_changed_id = g_signal_connect(view, "time-changed",
-                       G_CALLBACK(on_time_changed), self);
-       return self;
-}
-
-static GtkWidget *gis_plugin_radar_get_config(GisPlugin *_self)
-{
-       GisPluginRadar *self = GIS_PLUGIN_RADAR(_self);
-       return self->config_body;
-}
-
-static void gis_plugin_radar_expose(GisPlugin *_self)
-{
-       GisPluginRadar *self = GIS_PLUGIN_RADAR(_self);
-       g_debug("GisPluginRadar: expose");
-       if (self->cur_sweep == NULL)
-               return;
-       Sweep *sweep = self->cur_sweep;
-
-#ifdef MARCHING
-       /* Draw the surface */
-       glMatrixMode(GL_MODELVIEW);
-       glPushMatrix();
-       glDisable(GL_TEXTURE_2D);
-       float light_ambient[]  = {0.1f, 0.1f, 0.0f};
-       float light_diffuse[]  = {0.9f, 0.9f, 0.9f};
-       float light_position[] = {-300000.0f, 500000.0f, 400000.0f, 1.0f};
-       glLightfv(GL_LIGHT0, GL_AMBIENT,  light_ambient);
-       glLightfv(GL_LIGHT0, GL_DIFFUSE,  light_diffuse);
-       glLightfv(GL_LIGHT0, GL_POSITION, light_position);
-       glEnable(GL_LIGHT0);
-       glEnable(GL_LIGHTING);
-       glEnable(GL_COLOR_MATERIAL);
-       glColor4f(1,1,1,0.75);
-       g_debug("ntri=%d", self->cur_num_triangles);
-       glBegin(GL_TRIANGLES);
-       for (int i = 0; i < self->cur_num_triangles; i++) {
-               TRIANGLE t = self->cur_triangles[i];
-               do_normal(t.p[0].x, t.p[0].y, t.p[0].z,
-                         t.p[1].x, t.p[1].y, t.p[1].z,
-                         t.p[2].x, t.p[2].y, t.p[2].z);
-               glVertex3f(t.p[0].x, t.p[0].y, t.p[0].z);
-               glVertex3f(t.p[1].x, t.p[1].y, t.p[1].z);
-               glVertex3f(t.p[2].x, t.p[2].y, t.p[2].z);
-       }
-       glEnd();
-       glPopMatrix();
-#endif
-
-       g_message("set camera");
-       Radar_header *h = &self->cur_radar->h;
-       gdouble lat  = (double)h->latd + (double)h->latm/60 + (double)h->lats/(60*60);
-       gdouble lon  = (double)h->lond + (double)h->lonm/60 + (double)h->lons/(60*60);
-       gdouble elev = h->height;
-       gis_opengl_center_position(self->opengl, lat, lon, elev);
-
-       glDisable(GL_ALPHA_TEST);
-       glDisable(GL_CULL_FACE);
-       glDisable(GL_DEPTH_TEST);
-       glDisable(GL_LIGHTING);
-       glEnable(GL_TEXTURE_2D);
-       glColor4f(1,1,1,1);
-
-       /* Draw the rays */
-       glBindTexture(GL_TEXTURE_2D, self->cur_sweep_tex);
-       glBegin(GL_QUAD_STRIP);
-       for (int ri = 0; ri <= sweep->h.nrays; ri++) {
-               Ray  *ray = NULL;
-               double angle = 0;
-               if (ri < sweep->h.nrays) {
-                       ray = sweep->ray[ri];
-                       angle = deg2rad(ray->h.azimuth - ((double)ray->h.beam_width/2.));
-               } else {
-                       /* Do the right side of the last sweep */
-                       ray = sweep->ray[ri-1];
-                       angle = deg2rad(ray->h.azimuth + ((double)ray->h.beam_width/2.));
-               }
-
-               double lx = sin(angle);
-               double ly = cos(angle);
-
-               double near_dist = ray->h.range_bin1;
-               double far_dist  = ray->h.nbins*ray->h.gate_size + ray->h.range_bin1;
-
-               /* (find middle of bin) / scale for opengl */
-               // near left
-               glTexCoord2f(0.0, (double)ri/sweep->h.nrays-0.01);
-               glVertex3f(lx*near_dist, ly*near_dist, 2.0);
-
-               // far  left
-               // todo: correct range-height function
-               double height = sin(deg2rad(ray->h.elev)) * far_dist;
-               glTexCoord2f(1.0, (double)ri/sweep->h.nrays-0.01);
-               glVertex3f(lx*far_dist,  ly*far_dist, height);
-       }
-       glEnd();
-       //g_print("ri=%d, nr=%d, bw=%f\n", _ri, sweep->h.nrays, sweep->h.beam_width);
-
-       /* Texture debug */
-       //glBegin(GL_QUADS);
-       //glTexCoord2d( 0.,  0.); glVertex3f(-500.,   0., 0.); // bot left
-       //glTexCoord2d( 0.,  1.); glVertex3f(-500., 500., 0.); // top left
-       //glTexCoord2d( 1.,  1.); glVertex3f( 0.,   500., 3.); // top right
-       //glTexCoord2d( 1.,  0.); glVertex3f( 0.,     0., 3.); // bot right
-       //glEnd();
-
-       /* Print the color table */
-       glMatrixMode(GL_MODELVIEW ); glLoadIdentity();
-       glMatrixMode(GL_PROJECTION); glLoadIdentity();
-       glDisable(GL_TEXTURE_2D);
-       glEnable(GL_COLOR_MATERIAL);
-       glBegin(GL_QUADS);
-       int i;
-       for (i = 0; i < 256; i++) {
-               glColor4ubv(self->cur_colormap->data[i]);
-               glVertex3f(-1.0, (float)((i  ) - 256/2)/(256/2), 0.0); // bot left
-               glVertex3f(-1.0, (float)((i+1) - 256/2)/(256/2), 0.0); // top left
-               glVertex3f(-0.9, (float)((i+1) - 256/2)/(256/2), 0.0); // top right
-               glVertex3f(-0.9, (float)((i  ) - 256/2)/(256/2), 0.0); // bot right
-       }
-       glEnd();
-}
-
-
-/****************
- * GObject code *
- ****************/
-/* Plugin init */
-static void gis_plugin_radar_plugin_init(GisPluginInterface *iface);
-G_DEFINE_TYPE_WITH_CODE(GisPluginRadar, gis_plugin_radar, G_TYPE_OBJECT,
-               G_IMPLEMENT_INTERFACE(GIS_TYPE_PLUGIN,
-                       gis_plugin_radar_plugin_init));
-static void gis_plugin_radar_plugin_init(GisPluginInterface *iface)
-{
-       g_debug("GisPluginRadar: plugin_init");
-       /* Add methods to the interface */
-       iface->expose     = gis_plugin_radar_expose;
-       iface->get_config = gis_plugin_radar_get_config;
-}
-/* Class/Object init */
-static void gis_plugin_radar_init(GisPluginRadar *self)
-{
-       g_debug("GisPluginRadar: class_init");
-       /* Set defaults */
-       self->soup          = NULL;
-       self->cur_triangles = NULL;
-       self->cur_num_triangles = 0;
-
-       self->config_body = gtk_alignment_new(0, 0, 1, 1);
-       gtk_container_set_border_width(GTK_CONTAINER(self->config_body), 5);
-       gtk_container_add(GTK_CONTAINER(self->config_body), gtk_label_new("No radar loaded"));
-}
-static void gis_plugin_radar_dispose(GObject *gobject)
-{
-       g_debug("GisPluginRadar: dispose");
-       GisPluginRadar *self = GIS_PLUGIN_RADAR(gobject);
-       g_signal_handler_disconnect(self->view, self->time_changed_id);
-       /* Drop references */
-       G_OBJECT_CLASS(gis_plugin_radar_parent_class)->dispose(gobject);
-}
-static void gis_plugin_radar_finalize(GObject *gobject)
-{
-       g_debug("GisPluginRadar: finalize");
-       GisPluginRadar *self = GIS_PLUGIN_RADAR(gobject);
-       /* Free data */
-       G_OBJECT_CLASS(gis_plugin_radar_parent_class)->finalize(gobject);
-
-}
-static void gis_plugin_radar_class_init(GisPluginRadarClass *klass)
-{
-       g_debug("GisPluginRadar: class_init");
-       GObjectClass *gobject_class = (GObjectClass*)klass;
-       gobject_class->dispose  = gis_plugin_radar_dispose;
-       gobject_class->finalize = gis_plugin_radar_finalize;
-}
-
diff --git a/src/plugins/radar.h b/src/plugins/radar.h
deleted file mode 100644 (file)
index 34a2607..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
- * 
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __RADAR_H__
-#define __RADAR_H__
-
-#include <glib-object.h>
-#include <libsoup/soup.h>
-#include <rsl.h>
-
-#include <gis/gis.h>
-
-#include "marching.h"
-
-/* TODO: convert */
-typedef struct {
-       char *name;
-       guint8 data[256][4];
-} colormap_t;
-extern colormap_t colormaps[];
-
-#define GIS_TYPE_PLUGIN_RADAR            (gis_plugin_radar_get_type ())
-#define GIS_PLUGIN_RADAR(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),   GIS_TYPE_PLUGIN_RADAR, GisPluginRadar))
-#define GIS_IS_PLUGIN_RADAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),   GIS_TYPE_PLUGIN_RADAR))
-#define GIS_PLUGIN_RADAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST   ((klass), GIS_TYPE_PLUGIN_RADAR, GisPluginRadarClass))
-#define GIS_IS_PLUGIN_RADAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE   ((klass), GIS_TYPE_PLUGIN_RADAR))
-#define GIS_PLUGIN_RADAR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),   GIS_TYPE_PLUGIN_RADAR, GisPluginRadarClass))
-
-typedef struct _GisPluginRadar        GisPluginRadar;
-typedef struct _GisPluginRadarClass   GisPluginRadarClass;
-
-struct _GisPluginRadar {
-       GObject parent_instance;
-
-       /* instance members */
-       GisWorld    *world;
-       GisView     *view;
-       GisOpenGL   *opengl;
-       GisPrefs    *prefs;
-       GtkWidget   *config_body;
-       GtkWidget   *progress_bar;
-       GtkWidget   *progress_label;
-       SoupSession *soup;
-       guint        time_changed_id;
-
-       /* Private data for loading radars */
-       Radar       *cur_radar;
-       Sweep       *cur_sweep;
-       colormap_t  *cur_colormap;
-       guint        cur_sweep_tex;
-       TRIANGLE    *cur_triangles;
-       guint        cur_num_triangles;
-};
-
-struct _GisPluginRadarClass {
-       GObjectClass parent_class;
-};
-
-GType gis_plugin_radar_get_type();
-
-/* Methods */
-GisPluginRadar *gis_plugin_radar_new(GisWorld *world, GisView *view, GisOpenGL *opengl, GisPrefs *prefs);
-
-/* Misc. RSL helpers */
-#define RSL_FOREACH_VOL(radar, volume, count, index) \
-       guint count = 0; \
-       for (guint index = 0; index < radar->h.nvolumes; index++) { \
-               Volume *volume = radar->v[index]; \
-               if (volume == NULL) continue; \
-               count++;
-
-#define RSL_FOREACH_SWEEP(volume, sweep, count, index) \
-       guint count = 0; \
-       for (guint index = 0; index < volume->h.nsweeps; index++) { \
-               Sweep *sweep = volume->sweep[index]; \
-               if (sweep == NULL || sweep->h.elev == 0) continue; \
-               count++;
-
-#define RSL_FOREACH_RAY(sweep, ray, count, index) \
-       guint count = 0; \
-       for (guint index = 0; index < sweep->h.nrays; index++) { \
-               Ray *ray = sweep->ray[index]; \
-               if (ray == NULL) continue; \
-               count++;
-
-#define RSL_FOREACH_BIN(ray, bin, count, index) \
-       guint count = 0; \
-       for (guint index = 0; index < ray->h.nbins; index++) { \
-               Range bin = ray->range[index]; \
-               count++;
-
-#define RSL_FOREACH_END }
-
-#endif
similarity index 100%
rename from src/gis/roam.c
rename to src/roam.c
similarity index 100%
rename from src/gis/roam.h
rename to src/roam.h
similarity index 100%
rename from src/gis/wms.c
rename to src/wms.c
similarity index 100%
rename from src/gis/wms.h
rename to src/wms.h
similarity index 100%
rename from src/gis/wms_test.c
rename to src/wms_test.c
diff --git a/src/wsr88ddec.c b/src/wsr88ddec.c
deleted file mode 100644 (file)
index 5015272..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
- * 
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <err.h>
-#include <arpa/inet.h>
-#include <bzlib.h>
-
-#define debug(...) fprintf(stderr, __VA_ARGS__);
-
-char *bunzip2(char *input, int input_len, int *output_len)
-{
-       bz_stream *stream = calloc(1, sizeof(bz_stream));
-
-       switch (BZ2_bzDecompressInit(stream, 0, 0)) {
-       case BZ_CONFIG_ERROR: err(1, "the library has been mis-compiled");
-       case BZ_PARAM_ERROR:  err(1, "Parameter error");
-       case BZ_MEM_ERROR:    err(1, "insufficient memory is available");
-       //case BZ_OK:           debug("success\n"); break;
-       //default:              debug("unknown\n"); break;
-       }
-
-       int   status;
-       int   output_size = 512;
-       char *output      = NULL;
-
-       do {
-               stream->next_in   = input       + stream->total_in_lo32;
-               stream->avail_in  = input_len   - stream->total_in_lo32;
-               output_size *= 2;
-               output       = realloc(output, output_size);
-               //debug("alloc %d\n", output_size);
-               stream->next_out  = output      + stream->total_out_lo32;
-               stream->avail_out = output_size - stream->total_out_lo32;
-               //debug("decompressing..\n"
-               //      "  next_in   = %p\n"
-               //      "  avail_in  = %u\n"
-               //      "  next_out  = %p\n"
-               //      "  avail_out = %u\n",
-               //      stream->next_in,
-               //      stream->avail_in,
-               //      stream->next_out,
-               //      stream->avail_out);
-       } while ((status = BZ2_bzDecompress(stream)) == BZ_OK && output_size < 1024*1024);
-
-       // debug("done with status %d = %d\n", status, BZ_STREAM_END);
-
-       *output_len = stream->total_out_lo32;
-       BZ2_bzDecompressEnd(stream);
-       return output;
-}
-
-int main(int argc, char **argv)
-{
-       if (argc != 3) {
-               printf("usage: %s <input> <output>\n", argv[0]);
-               return 0;
-       }
-
-       FILE *input  = fopen(argv[1], "r");
-       FILE *output = fopen(argv[2], "w+");
-       if (!input)  err(1, "error opening input");
-       if (!output) err(1, "error opening output");
-
-       int st;
-       int size = 0;
-       char *buf = malloc(24);
-
-       /* Clear header */
-       //debug("reading header\n");
-       if (!fread (buf, 24, 1, input))
-               err(1, "error reading header");
-       if (!fwrite(buf, 24, 1, output))
-               err(1, "error writing header");
-
-       //debug("reading body\n");
-       while ((st = fread(&size, 1, 4, input))) {
-               //debug("size=%08x\n", size);
-               //debug("read %u bytes\n", st);
-               //fwrite(&size, 1, 4, output); // DEBUG
-               size = abs(ntohl(size));
-               if (size < 0)
-                       return 0;
-               //debug("size = %x\n", size);
-               if (size > 20*1024*1024)
-                       err(1, "sanity check failed, buf is to big: %d", size);
-               buf = realloc(buf, size);
-               if (!fread(buf, size, 1, input))
-                       err(1, "error reading data");
-               //fwrite(buf, 1, size, output); // DEBUG
-
-               int dec_len;
-               char *dec = bunzip2(buf, size, &dec_len);
-               // debug("decompressed %u bytes\n", dec_len);
-               if (!fwrite(dec, 1, dec_len, output))
-                       err(1, "error writing data");
-               free(dec);
-       }
-
-       return 0;
-}