X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fplugins%2Fradar.h;h=ad8826bc0edd0b50fe73fb71dcd475acf1e501d0;hb=d4d52d011600b56587a088760b734fbb52f6a588;hp=95367b47c3c12f804155b2b47ac9a21f1e983868;hpb=ca898105ec4018b54ac2f6f1327200624169103e;p=aweather diff --git a/src/plugins/radar.h b/src/plugins/radar.h index 95367b4..ad8826b 100644 --- a/src/plugins/radar.h +++ b/src/plugins/radar.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Andy Spencer + * Copyright (C) 2009-2010 Andy Spencer * * 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 @@ -22,7 +22,7 @@ #include #include -#include +#include #include "marching.h" @@ -47,16 +47,18 @@ struct _GisPluginRadar { GObject parent_instance; /* instance members */ - GisWorld *world; - GisView *view; - GisOpenGL *opengl; + GisViewer *viewer; GisPrefs *prefs; GtkWidget *config_body; GtkWidget *progress_bar; GtkWidget *progress_label; SoupSession *soup; + guint time_changed_id; + guint location_changed_id; /* Private data for loading radars */ + char *cur_site; + char *cur_time; Radar *cur_radar; Sweep *cur_sweep; colormap_t *cur_colormap; @@ -72,6 +74,36 @@ struct _GisPluginRadarClass { GType gis_plugin_radar_get_type(); /* Methods */ -GisPluginRadar *gis_plugin_radar_new(GisWorld *world, GisView *view, GisOpenGL *opengl, GisPrefs *prefs); +GisPluginRadar *gis_plugin_radar_new(GisViewer *viewer, 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