Thread: [Gpredict-svn] SF.net SVN: gpredict:[186] trunk/src/gtk-polar-view.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2008-12-28 14:39:25
|
Revision: 186 http://gpredict.svn.sourceforge.net/gpredict/?rev=186&view=rev Author: csete Date: 2008-12-28 14:39:16 +0000 (Sun, 28 Dec 2008) Log Message: ----------- Don't set canvas bounds when creating canvas because that will limit the visible area to the bound size, i.e. we cannot make the canvas larger. Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2008-12-28 14:32:06 UTC (rev 185) +++ trunk/src/gtk-polar-view.c 2008-12-28 14:39:16 UTC (rev 186) @@ -232,8 +232,11 @@ gtk_widget_modify_base (GTK_POLAR_VIEW (polv)->canvas, GTK_STATE_NORMAL, &bg_color); gtk_widget_set_size_request (GTK_POLAR_VIEW (polv)->canvas, POLV_DEFAULT_SIZE, POLV_DEFAULT_SIZE); + /* if we set canvas bounds resize will cut the image to this size + discovered with GooCanvas 0.12 goo_canvas_set_bounds (GOO_CANVAS (GTK_POLAR_VIEW (polv)->canvas), 0, 0, POLV_DEFAULT_SIZE, POLV_DEFAULT_SIZE); + */ /* connect size-request signal */ g_signal_connect (GTK_POLAR_VIEW (polv)->canvas, "size-allocate", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2008-12-28 14:53:23
|
Revision: 188 http://gpredict.svn.sourceforge.net/gpredict/?rev=188&view=rev Author: csete Date: 2008-12-28 14:53:15 +0000 (Sun, 28 Dec 2008) Log Message: ----------- Update canvas bounds when resizing the canvas. Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2008-12-28 14:46:41 UTC (rev 187) +++ trunk/src/gtk-polar-view.c 2008-12-28 14:53:15 UTC (rev 188) @@ -232,12 +232,10 @@ gtk_widget_modify_base (GTK_POLAR_VIEW (polv)->canvas, GTK_STATE_NORMAL, &bg_color); gtk_widget_set_size_request (GTK_POLAR_VIEW (polv)->canvas, POLV_DEFAULT_SIZE, POLV_DEFAULT_SIZE); - /* if we set canvas bounds resize will cut the image to this size - discovered with GooCanvas 0.12 goo_canvas_set_bounds (GOO_CANVAS (GTK_POLAR_VIEW (polv)->canvas), 0, 0, POLV_DEFAULT_SIZE, POLV_DEFAULT_SIZE); - */ + /* connect size-request signal */ g_signal_connect (GTK_POLAR_VIEW (polv)->canvas, "size-allocate", G_CALLBACK (size_allocate_cb), polv); @@ -521,6 +519,11 @@ polv->cx = allocation->width / 2; polv->cy = allocation->height / 2; + /* update canvas bounds to match new size */ + goo_canvas_set_bounds (GOO_CANVAS (GTK_POLAR_VIEW (polv)->canvas), 0, 0, + allocation->width, allocation->height); + + /* update coordinate system */ g_object_set (polv->C00, "center-x", (gdouble) polv->cx, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-17 21:32:05
|
Revision: 591 http://gpredict.svn.sourceforge.net/gpredict/?rev=591&view=rev Author: csete Date: 2010-01-17 21:31:58 +0000 (Sun, 17 Jan 2010) Log Message: ----------- Applied patch 2930342 from Charles Suprin AA1VS. Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2010-01-17 21:26:17 UTC (rev 590) +++ trunk/src/gtk-polar-view.c 2010-01-17 21:31:58 UTC (rev 591) @@ -1009,7 +1009,13 @@ if (obj->showtrack) { - + if (obj->pass == NULL) { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%d: Failed to get satellite pass."), + __FILE__, __LINE__); + return; + } + /* create points */ num = g_slist_length (obj->pass->details); @@ -1139,6 +1145,13 @@ return; } + if (obj->pass == NULL) { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%d: Failed to get satellite pass."), + __FILE__, __LINE__); + return; + } + root = goo_canvas_get_root_item_model (GOO_CANVAS (pv->canvas)); /* add sky track */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fi...@us...> - 2010-03-12 15:25:57
|
Revision: 614 http://gpredict.svn.sourceforge.net/gpredict/?rev=614&view=rev Author: fillods Date: 2010-03-12 15:25:50 +0000 (Fri, 12 Mar 2010) Log Message: ----------- copy/paste mistake Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2010-03-12 15:21:56 UTC (rev 613) +++ trunk/src/gtk-polar-view.c 2010-03-12 15:25:50 UTC (rev 614) @@ -1397,7 +1397,7 @@ catpoint = g_try_new0 (gint, 1); *catpoint = catnum; - sat = SAT (g_hash_table_lookup (satmap->sats, catpoint)); + sat = SAT (g_hash_table_lookup (polv->sats, catpoint)); if (sat != NULL) { show_sat_info(sat, gtk_widget_get_toplevel (GTK_WIDGET (data))); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2010-10-31 23:37:31
|
Revision: 700 http://gpredict.svn.sourceforge.net/gpredict/?rev=700&view=rev Author: aa1vs Date: 2010-10-31 23:37:25 +0000 (Sun, 31 Oct 2010) Log Message: ----------- Catch if pass has no points before making polar view Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2010-10-31 15:06:50 UTC (rev 699) +++ trunk/src/gtk-polar-view.c 2010-10-31 23:37:25 UTC (rev 700) @@ -1005,6 +1005,12 @@ /* create points */ num = g_slist_length (obj->pass->details); + if (num == 0) { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%d: Pass had no points in it."), + __FILE__, __LINE__); + return; + } points = goo_canvas_points_new (num); @@ -1145,6 +1151,12 @@ /* create points */ num = g_slist_length (obj->pass->details); + if (num == 0) { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%d: Pass had no points in it."), + __FILE__, __LINE__); + return; + } /* time resolution for time ticks; we need 3 additional points to AOS and LOS ticks. @@ -1152,7 +1164,9 @@ tres = (num-2) / (TRACK_TICK_NUM-1); points = goo_canvas_points_new (num); + + /* first point should be (aos_az,0.0) */ azel_to_xy (pv, obj->pass->aos_az, 0.0, &x, &y); points->coords[0] = (double) x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-01-27 02:50:56
|
Revision: 749 http://gpredict.svn.sourceforge.net/gpredict/?rev=749&view=rev Author: aa1vs Date: 2011-01-27 02:50:50 +0000 (Thu, 27 Jan 2011) Log Message: ----------- Ensure the trtick buffer is not overflowed. Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2011-01-27 02:33:23 UTC (rev 748) +++ trunk/src/gtk-polar-view.c 2011-01-27 02:50:50 UTC (rev 749) @@ -1036,9 +1036,10 @@ if (!(i % tres)) { /* update time tick */ - g_object_set (obj->trtick[ttidx], - "x", (gdouble) x, "y", (gdouble) y, - NULL); + if (ttidx<TRACK_TICK_NUM) + g_object_set (obj->trtick[ttidx], + "x", (gdouble) x, "y", (gdouble) y, + NULL); ttidx++; } } @@ -1183,7 +1184,8 @@ if (!(i % tres)) { /* create a time tick */ - obj->trtick[ttidx] = create_time_tick (pv, detail->time, x, y); + if (ttidx<TRACK_TICK_NUM) + obj->trtick[ttidx] = create_time_tick (pv, detail->time, x, y); ttidx++; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-07-15 21:43:24
|
Revision: 864 http://gpredict.svn.sourceforge.net/gpredict/?rev=864&view=rev Author: aa1vs Date: 2011-07-15 21:43:18 +0000 (Fri, 15 Jul 2011) Log Message: ----------- Clean pendantic compiler warning. Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2011-07-15 21:37:03 UTC (rev 863) +++ trunk/src/gtk-polar-view.c 2011-07-15 21:43:18 UTC (rev 864) @@ -113,6 +113,7 @@ sizeof (GtkPolarView), 5, /* n_preallocs */ (GInstanceInitFunc) gtk_polar_view_init, + NULL }; gtk_polar_view_type = g_type_register_static (GTK_TYPE_VBOX, @@ -518,6 +519,9 @@ static void size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation, gpointer data) { + (void) widget; /* avoid unused parameter compiler warning */ + (void) allocation; /* avoid unused parameter compiler warning */ + (void) data; /* avoid unused parameter compiler warning */ GTK_POLAR_VIEW (data)->resize = TRUE; } @@ -781,6 +785,7 @@ gchar *tooltip; guint32 colour; + (void) key; /* avoid unused parameter compiler warning */ catnum = g_new0 (gint, 1); *catnum = sat->tle.catnr; @@ -1026,6 +1031,7 @@ pass_detail_t *detail; guint tres,ttidx; + (void) key; /* avoid unused parameter compiler warning */ if (obj->showtrack) { if (obj->pass == NULL) { @@ -1140,7 +1146,7 @@ */ static void create_track (GtkPolarView *pv, sat_obj_t *obj, sat_t *sat) { - gint i; + guint i; GooCanvasItemModel *root; pass_detail_t *detail; guint num; @@ -1149,6 +1155,7 @@ guint32 col; guint tres,ttidx; + (void) sat; /* avoid unused parameter compiler warning */ /* get satellite object */ /*obj = SAT_OBJ(g_object_get_data (G_OBJECT (item), "obj")); @@ -1347,6 +1354,9 @@ GtkPolarView *polv = GTK_POLAR_VIEW (data); gfloat az,el; gchar *text; + + (void) item; /* avoid unused parameter compiler warning */ + (void) target; /* avoid unused parameter compiler warning */ if (polv->cursinfo) { @@ -1382,6 +1392,9 @@ GooCanvasItemModel *model, gpointer data) { + + (void) canvas; /* avoid unused parameter compiler warning */ + if (!goo_canvas_item_model_get_parent (model)) { /* root item / canvas */ g_signal_connect (item, "motion_notify_event", @@ -1415,6 +1428,8 @@ gint *catpoint = NULL; sat_t *sat = NULL; + (void) target; /* avoid unused parameter compiler warning */ + switch (event->button) { /* double-left-click */ @@ -1489,6 +1504,8 @@ sat_obj_t *obj = NULL; guint32 color; + (void) target; /* avoid unused parameter compiler warning */ + catpoint = g_try_new0 (gint, 1); *catpoint = catnum; @@ -1580,6 +1597,8 @@ void gtk_polar_view_reconf (GtkWidget *widget, GKeyFile *cfgdat) { + (void) cfgdat; /* avoid unused parameter compiler warning */ + (void) widget; /* avoid unused parameter compiler warning */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-11-05 20:35:16
|
Revision: 945 http://gpredict.svn.sourceforge.net/gpredict/?rev=945&view=rev Author: aa1vs Date: 2011-11-05 20:35:09 +0000 (Sat, 05 Nov 2011) Log Message: ----------- Remove memory leak. Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2011-11-03 12:27:21 UTC (rev 944) +++ trunk/src/gtk-polar-view.c 2011-11-05 20:35:09 UTC (rev 945) @@ -845,7 +845,7 @@ } /* free pass info */ - //free_pass (obj->pass); + free_pass (obj->pass); obj->pass=NULL; /* if this was the selected satellite we need to @@ -855,7 +855,7 @@ g_object_set (polv->sel, "text", "", NULL); } - // g_free (obj); + g_free (obj); /* remove sat object from hash table */ g_hash_table_remove (polv->obj, catnum); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |