]> Pileus Git - aweather/blobdiff - src/plugins/radar.h
Update Radar plugin to use callback objects
[aweather] / src / plugins / radar.h
index 95367b47c3c12f804155b2b47ac9a21f1e983868..1aa9cb3b9dc98fa6e591becc3b579a99f0922e12 100644 (file)
@@ -47,14 +47,13 @@ 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;
 
        /* Private data for loading radars */
        Radar       *cur_radar;
@@ -72,6 +71,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