From 721c55f22af98cf2fcc247169836e9b355a47104 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 11 May 2009 11:05:26 +0000 Subject: [PATCH] Adding copyright statements and a few bug fixes (hacks) for shading radar data --- TODO | 9 +++++++-- configure.ac | 6 ++++-- src/Makefile.am | 4 +--- src/aweather-gui.c | 17 +++++++++++++++++ src/aweather-gui.h | 17 +++++++++++++++++ src/aweather-plugin.c | 18 ++++++++++++++++++ src/aweather-plugin.h | 18 ++++++++++++++++++ src/aweather-view.c | 17 +++++++++++++++++ src/aweather-view.h | 17 +++++++++++++++++ src/data.c | 17 +++++++++++++++++ src/data.h | 17 +++++++++++++++++ src/location.c | 17 +++++++++++++++++ src/location.h | 17 +++++++++++++++++ src/main.c | 17 +++++++++++++++++ src/plugin-example.c | 17 +++++++++++++++++ src/plugin-example.h | 17 +++++++++++++++++ src/plugin-radar.c | 33 ++++++++++++++++++++++++++++----- src/plugin-radar.h | 17 +++++++++++++++++ src/plugin-ridge.c | 17 +++++++++++++++++ src/plugin-ridge.h | 17 +++++++++++++++++ src/wsr88ddec.c | 17 +++++++++++++++++ 21 files changed, 331 insertions(+), 12 deletions(-) diff --git a/TODO b/TODO index 2fb9e79..899fc6f 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,8 @@ -Fix Z-Ordering +See also: wiki -- Need to draw objects from lowest to highest when using transparency +Depth sorting + - Need to draw objects from lowest to highest when using transparency + +Fix memory leaks + +Add better color charts diff --git a/configure.ac b/configure.ac index 6f9aedf..8d5d34b 100644 --- a/configure.ac +++ b/configure.ac @@ -13,8 +13,10 @@ PKG_CHECK_MODULES(GTK, gtk+-2.0 gtkglext-1.0 gmodule-export-2.0 gobject-2.0) PKG_CHECK_MODULES(CURL, libcurl) # Define odd RSL install location -AC_SUBST(RSL_CFLAGS, "-I/usr/local/trmm/GVBOX/include/") -AC_SUBST(RSL_LIBS, "-L/usr/local/trmm/GVBOX/lib/ -lrsl") +#AC_SUBST(RSL_CFLAGS, "-I/usr/local/trmm/GVBOX/include/") +#AC_SUBST(RSL_LIBS, "-L/usr/local/trmm/GVBOX/lib/ -lrsl") +AC_SUBST(RSL_CFLAGS, "") +AC_SUBST(RSL_LIBS, "-lrsl") # Output AC_CONFIG_FILES([ diff --git a/src/Makefile.am b/src/Makefile.am index a206864..6736622 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,15 +16,13 @@ aweather_LDADD = $(RSL_LIBS) $(GTK_LIBS) $(CURL_LIBS) wsr88ddec = wsr88ddec.c wsr88ddec_LDADD = -lbz2 +# LD_LIBRARY_PATH=/usr/local/trmm/GVBOX/lib/ test: all - LD_LIBRARY_PATH=/usr/local/trmm/GVBOX/lib/ \ ./aweather gdb: all - LD_LIBRARY_PATH=/usr/local/trmm/GVBOX/lib/ \ gdb ./aweather ddd: all - LD_LIBRARY_PATH=/usr/local/trmm/GVBOX/lib/ \ ddd ./aweather diff --git a/src/aweather-gui.c b/src/aweather-gui.c index 1030492..d02443e 100644 --- a/src/aweather-gui.c +++ b/src/aweather-gui.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include #include diff --git a/src/aweather-gui.h b/src/aweather-gui.h index efb1679..2a1a855 100644 --- a/src/aweather-gui.h +++ b/src/aweather-gui.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef __AWEATHER_GUI_H__ #define __AWEATHER_GUI_H__ diff --git a/src/aweather-plugin.c b/src/aweather-plugin.c index e69de29..8546f76 100644 --- a/src/aweather-plugin.c +++ b/src/aweather-plugin.c @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + + diff --git a/src/aweather-plugin.h b/src/aweather-plugin.h index e69de29..8546f76 100644 --- a/src/aweather-plugin.h +++ b/src/aweather-plugin.h @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + + diff --git a/src/aweather-view.c b/src/aweather-view.c index 8857bc5..af83c4b 100644 --- a/src/aweather-view.c +++ b/src/aweather-view.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include "aweather-view.h" diff --git a/src/aweather-view.h b/src/aweather-view.h index 2278eae..9d3ee8d 100644 --- a/src/aweather-view.h +++ b/src/aweather-view.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef __AWEATHER_VIEW_H__ #define __AWEATHER_VIEW_H__ diff --git a/src/data.c b/src/data.c index 7c43138..fa11ea8 100644 --- a/src/data.c +++ b/src/data.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include #include diff --git a/src/data.h b/src/data.h index 9885fd0..994384b 100644 --- a/src/data.h +++ b/src/data.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef __DATA_H__ #define __DATA_H__ diff --git a/src/location.c b/src/location.c index 14634dc..8d25adb 100644 --- a/src/location.c +++ b/src/location.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include diff --git a/src/location.h b/src/location.h index 0dde55c..e105de8 100644 --- a/src/location.h +++ b/src/location.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef SITE_H #define SITE_H diff --git a/src/main.c b/src/main.c index f65d5b8..9bd7332 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include #include diff --git a/src/plugin-example.c b/src/plugin-example.c index a2fb366..8b6361d 100644 --- a/src/plugin-example.c +++ b/src/plugin-example.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include #include diff --git a/src/plugin-example.h b/src/plugin-example.h index 85aa2d2..66c1cbf 100644 --- a/src/plugin-example.h +++ b/src/plugin-example.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef EXAMPLE_H #define EXAMPLE_H diff --git a/src/plugin-radar.c b/src/plugin-radar.c index 1fe30f6..1000b6e 100644 --- a/src/plugin-radar.c +++ b/src/plugin-radar.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include #include @@ -31,9 +48,9 @@ static guint8 get_alpha(guint8 db) if (db == APFLAG) return 0; if (db == NOECHO) return 0; if (db == 0 ) return 0; - //if (db > 60) return 0; - //else if (db < 10) return 0; - //else if (db < 25) return (db-10)*(255.0/15); + if (db > 60) return 0; + else if (db < 10) return 0; + else if (db < 25) return (db-10)*(255.0/15); else return 255; } @@ -173,14 +190,16 @@ static void load_radar(char *path, gpointer user_data) if (g_file_test(raw, G_FILE_TEST_EXISTS)) { load_radar_rsl(0, 0, raw); } else { - char *argv[] = {"./wsr88ddec", path, raw, NULL}; + char *argv[] = {"wsr88ddec", path, raw, NULL}; GPid pid; GError *error = NULL; g_spawn_async( NULL, // const gchar *working_directory, argv, // gchar **argv, NULL, // gchar **envp, - G_SPAWN_DO_NOT_REAP_CHILD, // GSpawnFlags flags, + G_SPAWN_SEARCH_PATH| + G_SPAWN_DO_NOT_REAP_CHILD, + // GSpawnFlags flags, NULL, // GSpawnChildSetupFunc child_setup, NULL, // gpointer user_data, &pid, // GPid *child_pid, @@ -207,6 +226,7 @@ static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data) glPushMatrix(); glBindTexture(GL_TEXTURE_2D, sweep_tex); glEnable(GL_TEXTURE_2D); + glDisable(GL_ALPHA_TEST); glColor4f(1,1,1,1); glBegin(GL_QUAD_STRIP); for (int ri = 0; ri <= sweep->h.nrays+1; ri++) { @@ -246,6 +266,7 @@ static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data) /* Print the color table */ glDisable(GL_TEXTURE_2D); + glDisable(GL_DEPTH_TEST); glMatrixMode(GL_MODELVIEW ); glPushMatrix(); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glBegin(GL_QUADS); @@ -258,6 +279,8 @@ static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data) glVertex3f(-0.9, (float)((i ) - nred/2)/(nred/2), 0.0); // bot right } glEnd(); + glEnable(GL_DEPTH_TEST); + glEnable(GL_ALPHA_TEST); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW ); glPopMatrix(); return FALSE; diff --git a/src/plugin-radar.h b/src/plugin-radar.h index 9e293ec..baf0dcd 100644 --- a/src/plugin-radar.h +++ b/src/plugin-radar.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef RADAR_H #define RADAR_H diff --git a/src/plugin-ridge.c b/src/plugin-ridge.c index 525dc9b..cd8c447 100644 --- a/src/plugin-ridge.c +++ b/src/plugin-ridge.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include #include diff --git a/src/plugin-ridge.h b/src/plugin-ridge.h index 46f611b..00fed65 100644 --- a/src/plugin-ridge.h +++ b/src/plugin-ridge.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef RIDGE_H #define RIDGE_H diff --git a/src/wsr88ddec.c b/src/wsr88ddec.c index d253e12..107f279 100644 --- a/src/wsr88ddec.c +++ b/src/wsr88ddec.c @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2009 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 + * 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 . + */ + #include #include #include -- 2.43.2