[Gpredict-svn] SF.net SVN: gpredict:[700] trunk/src/gtk-polar-view.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
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. |