gpredict-svn Mailing List for Gpredict (Page 2)
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
You can subscribe to this list here.
2008 |
Jan
(24) |
Feb
|
Mar
(6) |
Apr
(14) |
May
(9) |
Jun
|
Jul
|
Aug
(25) |
Sep
(60) |
Oct
(26) |
Nov
|
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
(2) |
Mar
(22) |
Apr
(61) |
May
(57) |
Jun
|
Jul
(3) |
Aug
(83) |
Sep
(35) |
Oct
(50) |
Nov
(28) |
Dec
(34) |
2010 |
Jan
(29) |
Feb
(15) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(2) |
Jul
(24) |
Aug
(2) |
Sep
(9) |
Oct
(43) |
Nov
(22) |
Dec
(6) |
2011 |
Jan
(24) |
Feb
(22) |
Mar
(31) |
Apr
(13) |
May
(10) |
Jun
(10) |
Jul
(43) |
Aug
(12) |
Sep
(18) |
Oct
(33) |
Nov
(18) |
Dec
(4) |
From: <aa...@us...> - 2011-10-29 02:17:40
|
Revision: 940 http://gpredict.svn.sourceforge.net/gpredict/?rev=940&view=rev Author: aa1vs Date: 2011-10-29 02:17:34 +0000 (Sat, 29 Oct 2011) Log Message: ----------- Attempt to resolve "Show next pass shows the current pass". Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-map-popup.c trunk/src/gtk-sat-popup-common.c trunk/src/gtk-sat-popup-common.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-27 22:13:31 UTC (rev 939) +++ trunk/ChangeLog 2011-10-29 02:17:34 UTC (rev 940) @@ -1,5 +1,12 @@ 2011-10-27 Charles Suprin <hamaa1vs at gmail.com> + * src/gtk-sat-popup-common.c + * src/gtk-sat-popup-common.h + * src/gtk-sat-map-popup.c + Attempt to resolve "Show next pass shows the current pass". + +2011-10-27 Charles Suprin <hamaa1vs at gmail.com> + * src/gtk-event-list-popup.c * src/gtk-sat-list-popup.c * src/gtk-sat-map-popup.c Modified: trunk/src/gtk-sat-map-popup.c =================================================================== --- trunk/src/gtk-sat-map-popup.c 2011-10-27 22:13:31 UTC (rev 939) +++ trunk/src/gtk-sat-map-popup.c 2011-10-29 02:17:34 UTC (rev 940) @@ -99,8 +99,20 @@ /* separator */ menuitem = gtk_separator_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); - +#if 1 + add_pass_menu_items(menu,sat,qth,&satmap->tstamp,GTK_WIDGET(satmap)); +#else /* next pass and predict passes */ + if (sat->el > 0.0) { + menuitem = gtk_image_menu_item_new_with_label (_("Show current pass")); + image = gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_FILL, GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); + g_object_set_data (G_OBJECT (menuitem), "sat", sat); + g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(satmap->tstamp)); + g_signal_connect (menuitem, "activate", G_CALLBACK (show_current_pass_cb), satmap); + gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); + } menuitem = gtk_image_menu_item_new_with_label (_("Show next pass")); image = gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_FILL, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); @@ -118,7 +130,7 @@ g_object_set_data (G_OBJECT (menuitem), "tstamp", &(satmap->tstamp)); g_signal_connect (menuitem, "activate", G_CALLBACK (show_future_passes_cb), satmap); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); - +#endif /* separator */ menuitem = gtk_separator_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); Modified: trunk/src/gtk-sat-popup-common.c =================================================================== --- trunk/src/gtk-sat-popup-common.c 2011-10-27 22:13:31 UTC (rev 939) +++ trunk/src/gtk-sat-popup-common.c 2011-10-29 02:17:34 UTC (rev 940) @@ -39,7 +39,46 @@ #include "gtk-sat-popup-common.h" #include "sat-pass-dialogs.h" -void show_next_pass_cb (GtkWidget *menuitem, gpointer data) +void add_pass_menu_items (GtkWidget *menu, sat_t *sat, qth_t *qth, gdouble *tstamp, GtkWidget *widget) { + GtkWidget *menuitem; + GtkWidget *image; + + /* next pass and predict passes */ + if (sat->el > 0.0) { + menuitem = gtk_image_menu_item_new_with_label (_("Show current pass")); + image = gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_FILL, GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); + g_object_set_data (G_OBJECT (menuitem), "sat", sat); + g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", tstamp); + g_signal_connect (menuitem, "activate", G_CALLBACK (show_current_pass_cb), widget); + gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); + } + + /* the next pass menu item */ + menuitem = gtk_image_menu_item_new_with_label (_("Show next pass")); + image = gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_FILL, GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); + g_object_set_data (G_OBJECT (menuitem), "sat", sat); + g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", tstamp); + g_signal_connect (menuitem, "activate", G_CALLBACK (show_next_pass_cb), widget); + gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); + + /* finally the future pass menu item */ + menuitem = gtk_image_menu_item_new_with_label (_("Future passes")); + image = gtk_image_new_from_stock (GTK_STOCK_INDEX, GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); + g_object_set_data (G_OBJECT (menuitem), "sat", sat); + g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", tstamp); + g_signal_connect (menuitem, "activate", G_CALLBACK (show_future_passes_cb), widget); + gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); + + +} + +void show_current_pass_cb (GtkWidget *menuitem, gpointer data) { sat_t *sat; qth_t *qth; @@ -50,10 +89,30 @@ qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); tstamp = (gdouble *) (g_object_get_data (G_OBJECT (menuitem), "tstamp")); - show_next_pass_dialog (sat,qth,*tstamp,toplevel); + if (sat->el>0.0) + show_next_pass_dialog (sat,qth,*tstamp,toplevel); } +void show_next_pass_cb (GtkWidget *menuitem, gpointer data) +{ + sat_t *sat; + qth_t *qth; + GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); + gdouble *tstamp; + sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); + qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); + tstamp = (gdouble *) (g_object_get_data (G_OBJECT (menuitem), "tstamp")); + + if (sat->el <0) + show_next_pass_dialog (sat,qth,*tstamp,toplevel); + else + /*if the satellite is currently visible + go to end of pass and then add 10 minutes*/ + show_next_pass_dialog (sat,qth,sat->los+0.007,toplevel); +} + + void show_future_passes_cb (GtkWidget *menuitem, gpointer data) { GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); Modified: trunk/src/gtk-sat-popup-common.h =================================================================== --- trunk/src/gtk-sat-popup-common.h 2011-10-27 22:13:31 UTC (rev 939) +++ trunk/src/gtk-sat-popup-common.h 2011-10-29 02:17:34 UTC (rev 940) @@ -32,7 +32,8 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ - +void add_pass_menu_items (GtkWidget *menu, sat_t *sat, qth_t *qth, gdouble *tstamp, GtkWidget *widget); +void show_current_pass_cb (GtkWidget *menuitem, gpointer data); void show_next_pass_cb (GtkWidget *menuitem, gpointer data); void show_future_passes_cb (GtkWidget *menuitem, gpointer data); void show_next_pass_dialog (sat_t *sat, qth_t *qth, gdouble tstamp, GtkWindow *toplevel); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-27 22:13:40
|
Revision: 939 http://gpredict.svn.sourceforge.net/gpredict/?rev=939&view=rev Author: aa1vs Date: 2011-10-27 22:13:31 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Consolidate popup callback functions into single file. Modified Paths: -------------- trunk/ChangeLog trunk/src/Makefile.am trunk/src/gtk-event-list-popup.c trunk/src/gtk-polar-view-popup.c trunk/src/gtk-sat-list-popup.c trunk/src/gtk-sat-map-popup.c trunk/src/gtk-single-sat.c Added Paths: ----------- trunk/src/gtk-sat-popup-common.c trunk/src/gtk-sat-popup-common.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-26 18:30:16 UTC (rev 938) +++ trunk/ChangeLog 2011-10-27 22:13:31 UTC (rev 939) @@ -1,3 +1,16 @@ +2011-10-27 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-event-list-popup.c + * src/gtk-sat-list-popup.c + * src/gtk-sat-map-popup.c + * src/gtk-polar-view-popup.c + * src/gtk-sat-popup-common.c + * src/gtk-sat-popup-common.h + * src/gtk-single-sat.c + * src/Makefile.am + Consolidate popup callback functions into single function and file. + + 2011-10-26 Charles Suprin <hamaa1vs at gmail.com> * src/tle-update.c Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2011-10-26 18:30:16 UTC (rev 938) +++ trunk/src/Makefile.am 2011-10-27 22:13:31 UTC (rev 939) @@ -52,6 +52,7 @@ gtk-sat-module.c gtk-sat-module.h \ gtk-sat-module-popup.c gtk-sat-module-popup.h \ gtk-sat-module-tmg.c gtk-sat-module-tmg.h \ + gtk-sat-popup-common.c gtk-sat-popup-common.h \ gtk-sat-selector.c gtk-sat-selector.h \ gtk-single-sat.c gtk-single-sat.h \ gtk-sky-glance.c gtk-sky-glance.h \ Modified: trunk/src/gtk-event-list-popup.c =================================================================== --- trunk/src/gtk-event-list-popup.c 2011-10-26 18:30:16 UTC (rev 938) +++ trunk/src/gtk-event-list-popup.c 2011-10-27 22:13:31 UTC (rev 939) @@ -41,14 +41,8 @@ #include "sat-pass-dialogs.h" #include "gtk-event-list-popup.h" #include "sat-info.h" +#include "gtk-sat-popup-common.h" - - - -static void show_next_pass_cb (GtkWidget *menuitem, gpointer data); -static void show_future_passes_cb (GtkWidget *menuitem, gpointer data); - - /** \brief Show satellite popup menu. * \param sat Pointer to the satellite data. * \param qth The current location. @@ -99,6 +93,7 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(list->tstamp)); g_signal_connect (menuitem, "activate", G_CALLBACK (show_next_pass_cb), list); @@ -110,6 +105,7 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(list->tstamp)); g_signal_connect (menuitem, "activate", G_CALLBACK (show_future_passes_cb), list); @@ -127,144 +123,3 @@ } - - - - -/** \brief Show details of the next pass. - * - */ -static void show_next_pass_cb (GtkWidget *menuitem, gpointer data) -{ - sat_t *sat; - qth_t *qth; - pass_t *pass; - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - GtkEventList *list = GTK_EVENT_LIST (data); - - - /* get next pass */ - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - - if (sat_cfg_get_bool (SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - pass = get_next_pass (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - else { - pass = get_pass (sat, qth, list->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - - if (pass != NULL) { - show_pass (sat->nickname, qth, pass, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - } - else { - /* show dialog telling that this sat never reaches AOS*/ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!\n\n"\ - "This can be because the satellite\n"\ - "is geostationary, decayed or simply\n"\ - "never comes above the horizon"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - -} - - -static void show_future_passes_cb (GtkWidget *menuitem, gpointer data) -{ - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - GtkEventList *list = GTK_EVENT_LIST (data); - GSList *passes = NULL; - sat_t *sat; - qth_t *qth; - - - - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - - if (sat_cfg_get_bool (SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - passes = get_next_passes (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - } - else { - passes = get_passes (sat, qth, list->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - } - - if (passes != NULL) { - show_passes (sat->nickname, qth, passes, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - - } - else { - /* show dialog */ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } -} - - - Modified: trunk/src/gtk-polar-view-popup.c =================================================================== --- trunk/src/gtk-polar-view-popup.c 2011-10-26 18:30:16 UTC (rev 938) +++ trunk/src/gtk-polar-view-popup.c 2011-10-27 22:13:31 UTC (rev 939) @@ -45,13 +45,11 @@ #include "sat-pass-dialogs.h" #include "sat-info.h" #include "gtk-polar-view-popup.h" +#include "gtk-sat-popup-common.h" - static void track_toggled (GtkCheckMenuItem *item, gpointer data); /* static void target_toggled (GtkCheckMenuItem *item, gpointer data); */ static GooCanvasItemModel *create_time_tick (GtkPolarView *pv, gdouble time, gfloat x, gfloat y); -static void show_next_pass_cb (GtkWidget *menuitem, gpointer data); -static void show_next_passes_cb (GtkWidget *menuitem, gpointer data); /** \brief Show satellite popup menu. @@ -109,6 +107,7 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(pview->tstamp)); g_signal_connect (menuitem, "activate", G_CALLBACK (show_next_pass_cb), pview); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); @@ -117,7 +116,8 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", qth); - g_signal_connect (menuitem, "activate", G_CALLBACK (show_next_passes_cb), pview); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(pview->tstamp)); + g_signal_connect (menuitem, "activate", G_CALLBACK (show_future_passes_cb), pview); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); /* separator */ @@ -380,139 +380,3 @@ return item; } - - - -static void - show_next_pass_cb (GtkWidget *menuitem, gpointer data) -{ - GtkPolarView *pv = GTK_POLAR_VIEW (data); - sat_t *sat; - qth_t *qth; - pass_t *pass; - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - - - /* get next pass */ - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - if (sat_cfg_get_bool(SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - pass = get_next_pass (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - else { - pass = get_pass (sat, qth, pv->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - - if (pass != NULL) { - show_pass (sat->nickname, qth, pass, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - } - else { - /* show dialog telling that this sat never reaches AOS*/ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!\n\n"\ - "This can be because the satellite\n"\ - "is geostationary, decayed or simply\n"\ - "never comes above the horizon"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - -} - - -static void show_next_passes_cb (GtkWidget *menuitem, gpointer data) -{ - GtkPolarView *pv = GTK_POLAR_VIEW (data); - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - GSList *passes = NULL; - sat_t *sat; - qth_t *qth; - - - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - - if (sat_cfg_get_bool(SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - passes = get_next_passes (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - } - else { - passes = get_passes (sat, qth, pv->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - - } - - - if (passes != NULL) { - show_passes (sat->nickname, qth, passes, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - - } - else { - /* show dialog */ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - -} Modified: trunk/src/gtk-sat-list-popup.c =================================================================== --- trunk/src/gtk-sat-list-popup.c 2011-10-26 18:30:16 UTC (rev 938) +++ trunk/src/gtk-sat-list-popup.c 2011-10-27 22:13:31 UTC (rev 939) @@ -41,14 +41,8 @@ #include "sat-pass-dialogs.h" #include "gtk-sat-list-popup.h" #include "sat-info.h" +#include "gtk-sat-popup-common.h" - - - -void show_next_pass_cb (GtkWidget *menuitem, gpointer data); -void show_future_passes_cb (GtkWidget *menuitem, gpointer data); - - /** \brief Show satellite popup menu. * \param sat Pointer to the satellite data. * \param qth The current location. @@ -100,6 +94,7 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(list->tstamp)); g_signal_connect (menuitem, "activate", G_CALLBACK (show_next_pass_cb), list); @@ -111,6 +106,7 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(list->tstamp)); g_signal_connect (menuitem, "activate", G_CALLBACK (show_future_passes_cb), list); @@ -128,146 +124,3 @@ } - - - - -/** \brief Show details of the next pass. - * - */ -void -show_next_pass_cb (GtkWidget *menuitem, gpointer data) -{ - sat_t *sat; - qth_t *qth; - pass_t *pass; - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - GtkSatList *list = GTK_SAT_LIST (data); - - - /* get next pass */ - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - - if (sat_cfg_get_bool (SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - pass = get_next_pass (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - else { - pass = get_pass (sat, qth, list->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - - if (pass != NULL) { - show_pass (sat->nickname, qth, pass, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - } - else { - /* show dialog telling that this sat never reaches AOS*/ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!\n\n"\ - "This can be because the satellite\n"\ - "is geostationary, decayed or simply\n"\ - "never comes above the horizon"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - -} - - -void -show_future_passes_cb (GtkWidget *menuitem, gpointer data) -{ - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - GtkSatList *list = GTK_SAT_LIST (data); - GSList *passes = NULL; - sat_t *sat; - qth_t *qth; - - - - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - - if (sat_cfg_get_bool (SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - passes = get_next_passes (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - } - else { - passes = get_passes (sat, qth, list->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - } - - if (passes != NULL) { - show_passes (sat->nickname, qth, passes, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - - } - else { - /* show dialog */ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } -} - - - Modified: trunk/src/gtk-sat-map-popup.c =================================================================== --- trunk/src/gtk-sat-map-popup.c 2011-10-26 18:30:16 UTC (rev 938) +++ trunk/src/gtk-sat-map-popup.c 2011-10-27 22:13:31 UTC (rev 939) @@ -45,14 +45,12 @@ #include "gtk-sat-map-popup.h" #include "gtk-sat-data.h" #include "gtk-sat-map-ground-track.h" +#include "gtk-sat-popup-common.h" - static void coverage_toggled (GtkCheckMenuItem *item, gpointer data); static void track_toggled (GtkCheckMenuItem *item, gpointer data); /* static void target_toggled (GtkCheckMenuItem *item, gpointer data); */ -static void show_next_pass_cb (GtkWidget *menuitem, gpointer data); -static void show_next_passes_cb (GtkWidget *menuitem, gpointer data); /** \brief Show satellite popup menu. @@ -108,6 +106,7 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(satmap->tstamp)); g_signal_connect (menuitem, "activate", G_CALLBACK (show_next_pass_cb), satmap); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); @@ -116,7 +115,8 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", qth); - g_signal_connect (menuitem, "activate", G_CALLBACK (show_next_passes_cb), satmap); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(satmap->tstamp)); + g_signal_connect (menuitem, "activate", G_CALLBACK (show_future_passes_cb), satmap); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); /* separator */ @@ -288,142 +288,6 @@ } - -static void show_next_pass_cb (GtkWidget *menuitem, gpointer data) -{ - GtkSatMap *satmap = GTK_SAT_MAP (data); - sat_t *sat; - qth_t *qth; - pass_t *pass; - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - - - /* get next pass */ - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - if (sat_cfg_get_bool(SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - pass = get_next_pass (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - else { - pass = get_pass (sat, qth, satmap->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - - if (pass != NULL) { - show_pass (sat->nickname, qth, pass, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - } - else { - /* show dialog telling that this sat never reaches AOS*/ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!\n\n"\ - "This can be because the satellite\n"\ - "is geostationary, decayed or simply\n"\ - "never comes above the horizon"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - -} - - -static void show_next_passes_cb (GtkWidget *menuitem, gpointer data) -{ - GtkSatMap *satmap = GTK_SAT_MAP (data); - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - GSList *passes = NULL; - sat_t *sat; - qth_t *qth; - - - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check whether sat actually has AOS */ - if (has_aos (sat, qth)) { - - if (sat_cfg_get_bool(SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - passes = get_next_passes (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - } - else { - passes = get_passes (sat, qth, satmap->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - - } - - - if (passes != NULL) { - show_passes (sat->nickname, qth, passes, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - - } - else { - /* show dialog */ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - -} - - - #if 0 /** \brief Manage toggling of Set Target. * \param item The menu item that was toggled. Added: trunk/src/gtk-sat-popup-common.c =================================================================== --- trunk/src/gtk-sat-popup-common.c (rev 0) +++ trunk/src/gtk-sat-popup-common.c 2011-10-27 22:13:31 UTC (rev 939) @@ -0,0 +1,186 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2011 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + Charles Suprin <ham...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/gpredict/ + More details can be found at the project home page: + + http://gpredict.oz9aec.net/ + + 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 2 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, visit http://www.fsf.org/ +*/ +/** \brief Functions common to popup menus of all modules. + * + * + */ +#include <gtk/gtk.h> +#include "sgpsdp/sgp4sdp4.h" +#include "qth-data.h" +#include "predict-tools.h" +#include "orbit-tools.h" +#include "sat-cfg.h" +#include "gtk-sat-popup-common.h" +#include "sat-pass-dialogs.h" + +void show_next_pass_cb (GtkWidget *menuitem, gpointer data) +{ + sat_t *sat; + qth_t *qth; + GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); + gdouble *tstamp; + + sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); + qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); + tstamp = (gdouble *) (g_object_get_data (G_OBJECT (menuitem), "tstamp")); + + show_next_pass_dialog (sat,qth,*tstamp,toplevel); +} + + +void show_future_passes_cb (GtkWidget *menuitem, gpointer data) +{ + GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); + sat_t *sat; + qth_t *qth; + gdouble *tstamp; + + sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); + qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); + tstamp = (gdouble *) (g_object_get_data (G_OBJECT (menuitem), "tstamp")); + + show_future_passes_dialog (sat,qth,*tstamp,toplevel); +} + + +void show_next_pass_dialog (sat_t *sat, qth_t *qth, gdouble tstamp, GtkWindow *toplevel){ + + GtkWidget *dialog; + pass_t *pass; + + /* check whether sat actually has AOS */ + if (has_aos (sat, qth)) { + if (sat_cfg_get_bool(SAT_CFG_BOOL_PRED_USE_REAL_T0)) { + pass = get_next_pass (sat, qth, + sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); + } + else { + pass = get_pass (sat, qth, tstamp, + sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); + } + + if (pass != NULL) { + show_pass (sat->nickname, qth, pass, GTK_WIDGET (toplevel)); + } + else { + /* show dialog that there are no passes within time frame */ + dialog = gtk_message_dialog_new (toplevel, + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + _("Satellite %s has no passes\n"\ + "within the next %d days"), + sat->nickname, + sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + } + } + else { + /* show dialog telling that this sat never reaches AOS*/ + dialog = gtk_message_dialog_new (toplevel, + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Satellite %s has no passes for\n"\ + "the current ground station!\n\n"\ + "This can be because the satellite\n"\ + "is geostationary, decayed or simply\n"\ + "never comes above the horizon"), + sat->nickname); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + } + +} + + +void show_future_passes_dialog (sat_t *sat, qth_t *qth, gdouble tstamp, GtkWindow *toplevel){ + GSList *passes = NULL; + GtkWidget *dialog; + + /* check wheather sat actially has AOS */ + if (has_aos (sat, qth)) { + + if (sat_cfg_get_bool(SAT_CFG_BOOL_PRED_USE_REAL_T0)) { + passes = get_next_passes (sat, qth, + sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), + sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); + } + else { + passes = get_passes (sat, qth, tstamp, + sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), + sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); + + } + + + if (passes != NULL) { + show_passes (sat->nickname, qth, passes, GTK_WIDGET (toplevel)); + } + else { + /* show dialog that there are no passes within time frame */ + dialog = gtk_message_dialog_new (toplevel, + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + _("Satellite %s has no passes\n"\ + "within the next %d days"), + sat->nickname, + sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + } + + } + else { + /* show dialog */ + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (toplevel, + GTK_DIALOG_MODAL | + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Satellite %s has no passes for\n"\ + "the current ground station!"), + sat->nickname); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + } + + +} Added: trunk/src/gtk-sat-popup-common.h =================================================================== --- trunk/src/gtk-sat-popup-common.h (rev 0) +++ trunk/src/gtk-sat-popup-common.h 2011-10-27 22:13:31 UTC (rev 939) @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2011 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + Charles Suprin <ham...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/gpredict/ + More details can be found at the project home page: + + http://gpredict.oz9aec.net/ + + 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 2 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, visit http://www.fsf.org/ +*/ +#ifndef __GTK_SAT_POPUP_COMMON_H__ +#define __GTK_SAT_POPUP_COMMON_H__ 1 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +void show_next_pass_cb (GtkWidget *menuitem, gpointer data); +void show_future_passes_cb (GtkWidget *menuitem, gpointer data); +void show_next_pass_dialog (sat_t *sat, qth_t *qth, gdouble tstamp, GtkWindow *toplevel); +void show_future_passes_dialog (sat_t *sat, qth_t *qth, gdouble tstamp, GtkWindow *toplevel); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GTK_SAT_POPUP_COMMON_H__ */ Modified: trunk/src/gtk-single-sat.c =================================================================== --- trunk/src/gtk-single-sat.c 2011-10-26 18:30:16 UTC (rev 938) +++ trunk/src/gtk-single-sat.c 2011-10-27 22:13:31 UTC (rev 939) @@ -50,6 +50,7 @@ #include "predict-tools.h" #include "sat-pass-dialogs.h" #include "time-tools.h" +#include "gtk-sat-popup-common.h" /** \brief Column titles indexed with column symb. refs. */ const gchar *SINGLE_SAT_FIELD_TITLE[SINGLE_SAT_FIELD_NUMBER] = { @@ -116,8 +117,6 @@ static void Calculate_RADec (sat_t *sat, qth_t *qth, obs_astro_t *obs_set); static void gtk_single_sat_popup_cb (GtkWidget *button, gpointer data); static void select_satellite (GtkWidget *menuitem, gpointer data); -static void show_next_pass_cb (GtkWidget *menuitem, gpointer data); -static void show_next_passes_cb (GtkWidget *menuitem, gpointer data); static gint sat_name_compare (sat_t *a,sat_t *b); static GtkVBoxClass *parent_class = NULL; @@ -855,6 +854,7 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", single_sat->qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(single_sat->tstamp)); /* g_signal_connect (menuitem, "activate", G_CALLBACK (show_next_pass), gtk_widget_get_toplevel (button));*/ @@ -870,11 +870,12 @@ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); g_object_set_data (G_OBJECT (menuitem), "sat", sat); g_object_set_data (G_OBJECT (menuitem), "qth", single_sat->qth); + g_object_set_data (G_OBJECT (menuitem), "tstamp", &(single_sat->tstamp)); /* g_signal_connect (menuitem, "activate", G_CALLBACK (show_future_passes), gtk_widget_get_toplevel (button));*/ g_signal_connect (menuitem, "activate", - G_CALLBACK (show_next_passes_cb), data); + G_CALLBACK (show_future_passes_cb), data); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); /* separator */ @@ -1023,143 +1024,6 @@ GTK_SINGLE_SAT (widget)->counter = 1; } - - -static void -show_next_pass_cb (GtkWidget *menuitem, gpointer data) -{ - GtkSingleSat *ssat = GTK_SINGLE_SAT (data); - sat_t *sat; - qth_t *qth; - pass_t *pass; - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - - - /* get next pass */ - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - if (sat_cfg_get_bool(SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - pass = get_next_pass (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - else { - pass = get_pass (sat, qth, ssat->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - } - - if (pass != NULL) { - show_pass (sat->nickname, qth, pass, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - } - else { - /* show dialog telling that this sat never reaches AOS*/ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!\n\n"\ - "This can be because the satellite\n"\ - "is geostationary, decayed or simply\n"\ - "never comes above the horizon"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - -} - - -static void -show_next_passes_cb (GtkWidget *menuitem, gpointer data) -{ - GtkSingleSat *ssat = GTK_SINGLE_SAT (data); - GtkWidget *dialog; - GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (data))); - GSList *passes = NULL; - sat_t *sat; - qth_t *qth; - - - sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat")); - qth = (qth_t *) (g_object_get_data (G_OBJECT (menuitem), "qth")); - - /* check wheather sat actially has AOS */ - if (has_aos (sat, qth)) { - - if (sat_cfg_get_bool(SAT_CFG_BOOL_PRED_USE_REAL_T0)) { - passes = get_next_passes (sat, qth, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - } - else { - passes = get_passes (sat, qth, ssat->tstamp, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD), - sat_cfg_get_int (SAT_CFG_INT_PRED_NUM_PASS)); - - } - - - if (passes != NULL) { - show_passes (sat->nickname, qth, passes, GTK_WIDGET (toplevel)); - } - else { - /* show dialog that there are no passes within time frame */ - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Satellite %s has no passes\n"\ - "within the next %d days"), - sat->nickname, - sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - - } - else { - /* show dialog */ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (toplevel, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Satellite %s has no passes for\n"\ - "the current ground station!"), - sat->nickname); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - -} - static gint sat_name_compare (sat_t *a,sat_t *b) { return gpredict_strcmp(a->nickname,b->nickname); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-26 18:30:22
|
Revision: 938 http://gpredict.svn.sourceforge.net/gpredict/?rev=938&view=rev Author: aa1vs Date: 2011-10-26 18:30:16 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Restructure satellite name test and add "OBJECT A" name type to list for replacement. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-26 18:25:30 UTC (rev 937) +++ trunk/ChangeLog 2011-10-26 18:30:16 UTC (rev 938) @@ -3,7 +3,10 @@ * src/tle-update.c Read .sat files only when there is data to compare. + * src/tle-update.c + Restructure satellite name test and add "OBJECT A" name type to list for replacement. + 2011-10-23 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-sat-map-groundtrack.c Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-10-26 18:25:30 UTC (rev 937) +++ trunk/src/tle-update.c 2011-10-26 18:30:16 UTC (rev 938) @@ -67,9 +67,9 @@ guint *sat_tot); static guint add_new_sats (GHashTable *data); +static gboolean is_computer_generated_name (gchar *satname); - /** \bief Free a new_tle_t structure. */ static void free_new_tle (gpointer data) { @@ -1056,8 +1056,8 @@ } /* merge based on name */ - if ((g_regex_match_simple ("\\d{4,}-\\d{3,}",ntle->satname,0,0)) && - (!g_regex_match_simple ("\\d{4,}-\\d{3,}",tle_str[0],0,0))) { + if (is_computer_generated_name (ntle->satname) && + !is_computer_generated_name(tle_str[0])) { g_free (ntle->satname); ntle->satname = g_strdup (g_strchomp(tle_str[0])); } @@ -1224,9 +1224,9 @@ if (ntle->satname != NULL) { /* when a satellite first appears in the elements it is sometimes refered to by the international designator which is awkward after it is given a name */ - if (!g_regex_match_simple ("\\d{4,}-\\d{3,}",ntle->satname,0,0)) { + if (!is_computer_generated_name(ntle->satname)) { - if (g_regex_match_simple ("\\d{4,}-\\d{3,}",satname,0,0)) { + if (is_computer_generated_name (satname)) { sat_log_log (SAT_LOG_LEVEL_MSG, _("%s: Data for %d updated for name."), __FUNCTION__, catnr); @@ -1238,7 +1238,7 @@ /* clobber with name */ /* clobber if nickname and name were same before */ /* clobber if international designator */ - if (g_regex_match_simple ("\\d{4,}-\\d{3,}",satnickname,0,0)) { + if ( is_computer_generated_name (satnickname) ) { sat_log_log (SAT_LOG_LEVEL_MSG, _("%s: Data for %d updated for nickname."), __FUNCTION__, catnr); @@ -1322,3 +1322,23 @@ return _(freq_to_str[freq]); } + +/** \brief Determine if name is generic. + * \param satname The satellite name that might be old. + * + * This function determines if the satellite name is generic. Examples of this are the names YYYY-NNNAAA + * international ID names used by Celestrak. Also space-track.org will give items names of OBJECT A as + * well until the name is advertised. + * + */ +static gboolean is_computer_generated_name (gchar *satname) { + /* celestrak generic satellite name */ + if (g_regex_match_simple ("\\d{4,}-\\d{3,}",satname,0,0)){ + return (TRUE); + } + /* space-track generic satellite name */ + if (g_regex_match_simple ("OBJECT",satname,0,0)){ + return (TRUE); + } + return (FALSE); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-26 18:25:37
|
Revision: 937 http://gpredict.svn.sourceforge.net/gpredict/?rev=937&view=rev Author: aa1vs Date: 2011-10-26 18:25:30 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Read .sat files only when there is data to compare. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-23 16:43:23 UTC (rev 936) +++ trunk/ChangeLog 2011-10-26 18:25:30 UTC (rev 937) @@ -1,3 +1,9 @@ +2011-10-26 Charles Suprin <hamaa1vs at gmail.com> + + * src/tle-update.c + Read .sat files only when there is data to compare. + + 2011-10-23 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-sat-map-groundtrack.c Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-10-23 16:43:23 UTC (rev 936) +++ trunk/src/tle-update.c 2011-10-26 18:25:30 UTC (rev 937) @@ -1136,44 +1136,42 @@ GKeyFile *satdata; gchar *tlestr1, *tlestr2, *rawtle, *satname, *satnickname; gboolean updateddata; + + /* get catalog number for this satellite */ + catstr = g_strsplit (fname, ".sat", 0); + catnr = (guint) g_ascii_strtod (catstr[0], NULL); + + /* see if we have new data for this satellite */ + key = g_try_new0 (guint, 1); + *key = catnr; + ntle = (new_tle_t *) g_hash_table_lookup (data, key); + g_free (key); - /* open input file (file containing old tle) */ - path = g_strconcat (ldname, G_DIR_SEPARATOR_S, fname, NULL); - satdata = g_key_file_new (); - if (!g_key_file_load_from_file (satdata, path, G_KEY_FILE_KEEP_COMMENTS, &error)) { + if (ntle == NULL) { + /* no new data found for this sat => obsolete */ + nodata++; + + /* check if obsolete sats should be deleted */ + /**** FIXME: This is dangereous, so we omit it */ sat_log_log (SAT_LOG_LEVEL_ERROR, - _("%s: Error loading %s (%s)"), - __FUNCTION__, path, error->message); - g_clear_error (&error); - - skipped++; - + _("%s: No new TLE data found for %d. Satellite might be obsolete."), + __FUNCTION__, catnr); } - - else { - - /* get catalog number for this satellite */ - catstr = g_strsplit (fname, ".sat", 0); - catnr = (guint) g_ascii_strtod (catstr[0], NULL); - - /* see if we have new data for this satellite */ - key = g_try_new0 (guint, 1); - *key = catnr; - ntle = (new_tle_t *) g_hash_table_lookup (data, key); - g_free (key); - - if (ntle == NULL) { - /* no new data found for this sat => obsolete */ - nodata++; - - /* check if obsolete sats should be deleted */ - /**** FIXME: This is dangereous, so we omit it */ + else { + /* open input file (file containing old tle) */ + path = g_strconcat (ldname, G_DIR_SEPARATOR_S, fname, NULL); + satdata = g_key_file_new (); + if (!g_key_file_load_from_file (satdata, path, G_KEY_FILE_KEEP_COMMENTS, &error)) { sat_log_log (SAT_LOG_LEVEL_ERROR, - _("%s: No new TLE data found for %d. Satellite might be obsolete."), - __FUNCTION__, catnr); - } - else { + _("%s: Error loading %s (%s)"), + __FUNCTION__, path, error->message); + g_clear_error (&error); + + skipped++; + + } else { + /* This satellite is not new */ ntle->isnew = FALSE; @@ -1286,10 +1284,12 @@ skipped++; } } - g_strfreev (catstr); + + g_key_file_free (satdata); + g_free (path); + } - g_key_file_free (satdata); - g_free (path); + g_strfreev (catstr); /* update out parameters */ *sat_upd = updated; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-23 16:43:29
|
Revision: 936 http://gpredict.svn.sourceforge.net/gpredict/?rev=936&view=rev Author: aa1vs Date: 2011-10-23 16:43:23 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Replace part of satellite update with call to predict_calc. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-module.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-23 13:58:57 UTC (rev 935) +++ trunk/ChangeLog 2011-10-23 16:43:23 UTC (rev 936) @@ -21,6 +21,10 @@ * data/trsp/5580.trsp Add transponder data for Prospero and SRMVU satellites. + * src/gtk-sat-module.c + Replace part of satellite update with call to predict_calc. + + 2011-10-13 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-sat-module.c =================================================================== --- trunk/src/gtk-sat-module.c 2011-10-23 13:58:57 UTC (rev 935) +++ trunk/src/gtk-sat-module.c 2011-10-23 16:43:23 UTC (rev 936) @@ -1035,63 +1035,8 @@ sat->los = find_los (sat, module->qth, daynum, maxdt); } - /*data may have been updated by gpsd*/ - obs_geodetic.lon = module->qth->lon * de2ra; - obs_geodetic.lat = module->qth->lat * de2ra; - obs_geodetic.alt = module->qth->alt / 1000.0; - obs_geodetic.theta = 0; + predict_calc( sat, module->qth, daynum); - - sat->jul_utc = daynum; - sat->tsince = (sat->jul_utc - sat->jul_epoch) * xmnpda; - - - - /* call the norad routines according to the deep-space flag */ - if (sat->flags & DEEP_SPACE_EPHEM_FLAG) - SDP4 (sat, sat->tsince); - else - SGP4 (sat, sat->tsince); - - /* scale position and velocity to km and km/sec */ - Convert_Sat_State (&sat->pos, &sat->vel); - - /* get the velocity of the satellite */ - Magnitude (&sat->vel); - sat->velo = sat->vel.w; - Calculate_Obs (sat->jul_utc, &sat->pos, &sat->vel, &obs_geodetic, &obs_set); - Calculate_LatLonAlt (sat->jul_utc, &sat->pos, &sat_geodetic); - - /*** FIXME: should we ensure sat_geodetic.lon stays between -pi and pi? */ - while (sat_geodetic.lon < -pi) - sat_geodetic.lon += twopi; - - while (sat_geodetic.lon > (pi)) - sat_geodetic.lon -= twopi; - - sat->az = Degrees (obs_set.az); - sat->el = Degrees (obs_set.el); - sat->range = obs_set.range; - sat->range_rate = obs_set.range_rate; - sat->ssplat = Degrees (sat_geodetic.lat); - sat->ssplon = Degrees (sat_geodetic.lon); - sat->alt = sat_geodetic.alt; - sat->ma = Degrees (sat->phase); - sat->ma *= 256.0/360.0; - sat->phase = Degrees (sat->phase); - - /* same formulas, but the one from predict is nicer */ - //sat->footprint = 2.0 * xkmper * acos (xkmper/sat->pos.w); - sat->footprint = 12756.33 * acos (xkmper / (xkmper+sat->alt)); - age = sat->jul_utc - sat->jul_epoch; - sat->orbit = (long) floor((sat->tle.xno * xmnpda/twopi + - age * sat->tle.bstar * ae) * age + - sat->tle.xmo/twopi) + sat->tle.revnum - 1; - - - /*** FIXME: Squint + AOS / LOS code */ - - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-23 13:59:03
|
Revision: 935 http://gpredict.svn.sourceforge.net/gpredict/?rev=935&view=rev Author: aa1vs Date: 2011-10-23 13:58:57 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Add transponder data for Prospero and SRMVU satellites. Modified Paths: -------------- trunk/ChangeLog Added Paths: ----------- trunk/data/trsp/37839.trsp trunk/data/trsp/5580.trsp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-23 12:33:34 UTC (rev 934) +++ trunk/ChangeLog 2011-10-23 13:58:57 UTC (rev 935) @@ -17,6 +17,9 @@ * src/gtk-polar-view.c Migrate satellite map and polar view to single mod-cfg functions for getting lists of integers. + * data/trsp/37839.trsp + * data/trsp/5580.trsp + Add transponder data for Prospero and SRMVU satellites. 2011-10-13 Charles Suprin <hamaa1vs at gmail.com> Added: trunk/data/trsp/37839.trsp =================================================================== --- trunk/data/trsp/37839.trsp (rev 0) +++ trunk/data/trsp/37839.trsp 2011-10-23 13:58:57 UTC (rev 935) @@ -0,0 +1,2 @@ +[CW Beacon] +DOWN_LOW = 437425000 Added: trunk/data/trsp/5580.trsp =================================================================== --- trunk/data/trsp/5580.trsp (rev 0) +++ trunk/data/trsp/5580.trsp 2011-10-23 13:58:57 UTC (rev 935) @@ -0,0 +1,2 @@ +[PCM Transponder] +DOWN_LOW=137560000 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-23 12:33:40
|
Revision: 934 http://gpredict.svn.sourceforge.net/gpredict/?rev=934&view=rev Author: aa1vs Date: 2011-10-23 12:33:34 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Migrate satellite map and polar view to single mod-cfg functions for getting lists of integers. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-polar-view.c trunk/src/gtk-sat-map.c trunk/src/mod-cfg-get-param.c trunk/src/mod-cfg-get-param.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-23 12:25:13 UTC (rev 933) +++ trunk/ChangeLog 2011-10-23 12:33:34 UTC (rev 934) @@ -11,7 +11,13 @@ * src/loc-tree.c Eliminate calls to deprecated gtk_box_pack_start_defaults. + * src/mod-cfg-get-param.c + * src/mod-cfg-get-param.h + * src/gtk-sat-map.c + * src/gtk-polar-view.c + Migrate satellite map and polar view to single mod-cfg functions for getting lists of integers. + 2011-10-13 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2011-10-23 12:25:13 UTC (rev 933) +++ trunk/src/gtk-polar-view.c 2011-10-23 12:33:34 UTC (rev 934) @@ -94,8 +94,6 @@ static gchar *los_time_to_str (GtkPolarView *polv, sat_t *sat); static void gtk_polar_view_store_showtracks (GtkPolarView *pv); static void gtk_polar_view_load_showtracks (GtkPolarView *pv); -static void store_binary_hash_cfgdata (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey) ; -static void load_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest); static GtkVBoxClass *parent_class = NULL; @@ -1766,11 +1764,11 @@ static void gtk_polar_view_store_showtracks (GtkPolarView *pv) { - store_binary_hash_cfgdata(pv->cfgdata, + mod_cfg_set_integer_list_boolean(pv->cfgdata, pv->showtracks_on, MOD_CFG_POLAR_SECTION, MOD_CFG_POLAR_SHOWTRACKS); - store_binary_hash_cfgdata(pv->cfgdata, + mod_cfg_set_integer_list_boolean(pv->cfgdata, pv->showtracks_off, MOD_CFG_POLAR_SECTION, MOD_CFG_POLAR_HIDETRACKS); @@ -1780,95 +1778,15 @@ static void gtk_polar_view_load_showtracks (GtkPolarView *pv) { - load_integer_list_boolean(pv->cfgdata, + mod_cfg_get_integer_list_boolean(pv->cfgdata, MOD_CFG_POLAR_SECTION, MOD_CFG_POLAR_HIDETRACKS, pv->showtracks_off); - load_integer_list_boolean(pv->cfgdata, + mod_cfg_get_integer_list_boolean(pv->cfgdata, MOD_CFG_POLAR_SECTION, MOD_CFG_POLAR_SHOWTRACKS, pv->showtracks_on); } -/** \brief Load an integer list into a hash table that uses the - existinence of datain the hash as a boolean. - It loads NULL's into the hash table. -*/ -static void load_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest) { - gint *sats = NULL; - gsize length; - GError *error = NULL; - guint i; - guint *tkey; - - sats = g_key_file_get_integer_list (cfgdata, - section, - key, - &length, - &error); - if (error != NULL) { - sat_log_log (SAT_LOG_LEVEL_ERROR, - _("%s: Failed to get list of satellites (%s)"), - __FUNCTION__, error->message); - - g_clear_error (&error); - - /* GLib API says nothing about the contents in case of error */ - if (sats) { - g_free (sats); - } - - return; - } - - /* read each satellite into hash table */ - for (i = 0; i < length; i++) { - tkey = g_new0 (guint, 1); - *tkey = sats[i]; - //printf("loading sat %d\n",sats[i]); - if (!(g_hash_table_lookup_extended (dest, tkey, NULL, NULL))) { - /* just add a one to the value so there is presence indicator */ - g_hash_table_insert (dest, - tkey, - NULL); - } - } - g_free(sats); -} - -/** \brief Convert the "boolean" hash back into an integer list and - save it to the cfgdata. */ -static void -store_binary_hash_cfgdata (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey) -{ - gint *showtrack; - gint *something; - gint i,length; - GList *keys = g_hash_table_get_keys(hash); - - length = g_list_length(keys); - if (g_list_length(keys)>0) { - - showtrack = g_try_new0(gint,g_list_length(keys)); - for (i=0;i<length;i++) { - something=g_list_nth_data(keys,i); - showtrack[i]=*something; - } - g_key_file_set_integer_list (cfgdata, - cfgsection, - cfgkey, - showtrack, - g_list_length(keys) - ); - - } else { - g_key_file_remove_key(cfgdata, - cfgsection, - cfgkey, - NULL); - } - - g_list_free (keys); -} Modified: trunk/src/gtk-sat-map.c =================================================================== --- trunk/src/gtk-sat-map.c 2011-10-23 12:25:13 UTC (rev 933) +++ trunk/src/gtk-sat-map.c 2011-10-23 12:33:34 UTC (rev 934) @@ -111,8 +111,6 @@ static void gtk_sat_map_store_showtracks (GtkSatMap *satmap); static void gtk_sat_map_load_hide_coverages (GtkSatMap *map); static void gtk_sat_map_store_hidecovs (GtkSatMap *satmap); -static void load_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest); -static void store_binary_hash_cfgdata (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey); static GtkVBoxClass *parent_class = NULL; @@ -2603,115 +2601,34 @@ static void gtk_sat_map_load_showtracks (GtkSatMap *satmap) { - load_integer_list_boolean(satmap->cfgdata, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SHOWTRACKS, - satmap->showtracks); + mod_cfg_get_integer_list_boolean(satmap->cfgdata, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHOWTRACKS, + satmap->showtracks); } static void gtk_sat_map_store_showtracks (GtkSatMap *satmap) { - store_binary_hash_cfgdata(satmap->cfgdata, - satmap->showtracks, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SHOWTRACKS); + mod_cfg_set_integer_list_boolean(satmap->cfgdata, + satmap->showtracks, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHOWTRACKS); } static void gtk_sat_map_store_hidecovs (GtkSatMap *satmap) { - store_binary_hash_cfgdata(satmap->cfgdata, - satmap->hidecovs, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_HIDECOVS); + mod_cfg_set_integer_list_boolean(satmap->cfgdata, + satmap->hidecovs, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_HIDECOVS); } /** \brief Load the satellites that we should not highlight coverage */ static void gtk_sat_map_load_hide_coverages (GtkSatMap *satmap) { - load_integer_list_boolean(satmap->cfgdata, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_HIDECOVS, - satmap->hidecovs); + mod_cfg_get_integer_list_boolean(satmap->cfgdata, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_HIDECOVS, + satmap->hidecovs); } - -/** \brief Load an integer list into a hash table that uses the - existinence of datain the hash as a boolean. - It loads NULL's into the hash table. -*/ -static void load_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest) { - gint *sats = NULL; - gsize length; - GError *error = NULL; - guint i; - guint *tkey; - - sats = g_key_file_get_integer_list (cfgdata, - section, - key, - &length, - &error); - if (error != NULL) { - sat_log_log (SAT_LOG_LEVEL_ERROR, - _("%s: Failed to get list of satellites (%s)"), - __FUNCTION__, error->message); - - g_clear_error (&error); - - /* GLib API says nothing about the contents in case of error */ - if (sats) { - g_free (sats); - } - - return; - } - - /* read each satellite into hash table */ - for (i = 0; i < length; i++) { - tkey = g_new0 (guint, 1); - *tkey = sats[i]; - //printf("loading sat %d\n",sats[i]); - if (!(g_hash_table_lookup_extended (dest, tkey, NULL, NULL))) { - /* just add a one to the value so there is presence indicator */ - g_hash_table_insert (dest, - tkey, - NULL); - } - } - g_free(sats); -} - -/** \brief Convert the "boolean" hash back into an integer list and - save it to the cfgdata. */ -static void -store_binary_hash_cfgdata (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey) -{ - gint *showtrack; - gint *something; - gint i,length; - GList *keys = g_hash_table_get_keys(hash); - - length = g_list_length(keys); - if (g_list_length(keys)>0) { - - showtrack = g_try_new0(gint,g_list_length(keys)); - for (i=0;i<length;i++) { - something=g_list_nth_data(keys,i); - showtrack[i]=*something; - } - g_key_file_set_integer_list (cfgdata, - cfgsection, - cfgkey, - showtrack, - g_list_length(keys) - ); - - } else { - g_key_file_remove_key(cfgdata, - cfgsection, - cfgkey, - NULL); - } - - g_list_free (keys); -} Modified: trunk/src/mod-cfg-get-param.c =================================================================== --- trunk/src/mod-cfg-get-param.c 2011-10-23 12:25:13 UTC (rev 933) +++ trunk/src/mod-cfg-get-param.c 2011-10-23 12:33:34 UTC (rev 934) @@ -161,3 +161,83 @@ return param; } + +/** \brief Load an integer list into a hash table that uses the + existinence of datain the hash as a boolean. + It loads NULL's into the hash table. +*/ +void mod_cfg_get_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest) { + gint *sats = NULL; + gsize length; + GError *error = NULL; + guint i; + guint *tkey; + + sats = g_key_file_get_integer_list (cfgdata, + section, + key, + &length, + &error); + if (error != NULL) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Failed to get list of satellites (%s)"), + __FUNCTION__, error->message); + + g_clear_error (&error); + + /* GLib API says nothing about the contents in case of error */ + if (sats) { + g_free (sats); + } + + return; + } + + /* read each satellite into hash table */ + for (i = 0; i < length; i++) { + tkey = g_new0 (guint, 1); + *tkey = sats[i]; + //printf("loading sat %d\n",sats[i]); + if (!(g_hash_table_lookup_extended (dest, tkey, NULL, NULL))) { + /* just add a one to the value so there is presence indicator */ + g_hash_table_insert (dest, + tkey, + NULL); + } + } + g_free(sats); +} + +/** \brief Convert the "boolean" hash back into an integer list and + save it to the cfgdata. */ +void mod_cfg_set_integer_list_boolean (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey) +{ + gint *showtrack; + gint *something; + gint i,length; + GList *keys = g_hash_table_get_keys(hash); + + length = g_list_length(keys); + if (g_list_length(keys)>0) { + + showtrack = g_try_new0(gint,g_list_length(keys)); + for (i=0;i<length;i++) { + something=g_list_nth_data(keys,i); + showtrack[i]=*something; + } + g_key_file_set_integer_list (cfgdata, + cfgsection, + cfgkey, + showtrack, + g_list_length(keys) + ); + + } else { + g_key_file_remove_key(cfgdata, + cfgsection, + cfgkey, + NULL); + } + + g_list_free (keys); +} Modified: trunk/src/mod-cfg-get-param.h =================================================================== --- trunk/src/mod-cfg-get-param.h 2011-10-23 12:25:13 UTC (rev 933) +++ trunk/src/mod-cfg-get-param.h 2011-10-23 12:33:34 UTC (rev 934) @@ -33,6 +33,9 @@ gboolean mod_cfg_get_bool (GKeyFile *f, const gchar *sec, const gchar *key, sat_cfg_bool_e p); gint mod_cfg_get_int (GKeyFile *f, const gchar *sec, const gchar *key, sat_cfg_int_e p); gchar *mod_cfg_get_str (GKeyFile *f, const gchar *sec, const gchar *key, sat_cfg_str_e p); +void mod_cfg_get_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest); +void mod_cfg_set_integer_list_boolean (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey); + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-23 12:25:19
|
Revision: 933 http://gpredict.svn.sourceforge.net/gpredict/?rev=933&view=rev Author: aa1vs Date: 2011-10-23 12:25:13 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Fix typo. Modified Paths: -------------- trunk/src/gtk-sat-map-ground-track.c Modified: trunk/src/gtk-sat-map-ground-track.c =================================================================== --- trunk/src/gtk-sat-map-ground-track.c 2011-10-23 11:39:07 UTC (rev 932) +++ trunk/src/gtk-sat-map-ground-track.c 2011-10-23 12:25:13 UTC (rev 933) @@ -118,7 +118,7 @@ /* set it so that we are in the same orbit as this_orbit and not a different one */ - t += 0.0007; + t += 2*0.0007; t0 = t; predict_calc (sat, qth, t0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-23 11:39:13
|
Revision: 932 http://gpredict.svn.sourceforge.net/gpredict/?rev=932&view=rev Author: aa1vs Date: 2011-10-23 11:39:07 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Eliminate calls to deprecated gtk_box_pack_start_defaults. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-rig-ctrl.c trunk/src/loc-tree.c trunk/src/mod-cfg.c trunk/src/sat-debugger.c trunk/src/sat-log-browser.c trunk/src/sat-pref.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-23 11:32:12 UTC (rev 931) +++ trunk/ChangeLog 2011-10-23 11:39:07 UTC (rev 932) @@ -3,7 +3,15 @@ * src/gtk-sat-map-groundtrack.c Use more robust check on orbit change time. + * src/gtk-rig-ctrl.c + * src/sat-debugger.c + * src/sat-pref.c + * src/sat-log-browser.c + * src/mod-cfg.c + * src/loc-tree.c + Eliminate calls to deprecated gtk_box_pack_start_defaults. + 2011-10-13 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-rig-ctrl.c =================================================================== --- trunk/src/gtk-rig-ctrl.c 2011-10-23 11:32:12 UTC (rev 931) +++ trunk/src/gtk-rig-ctrl.c 2011-10-23 11:39:07 UTC (rev 932) @@ -428,7 +428,7 @@ /* satellite downlink frequency */ ctrl->SatFreqDown = gtk_freq_knob_new (145890000.0, TRUE); g_signal_connect (ctrl->SatFreqDown, "freq-changed", G_CALLBACK (downlink_changed_cb), ctrl); - gtk_box_pack_start_defaults (GTK_BOX (vbox), ctrl->SatFreqDown); + gtk_box_pack_start (GTK_BOX (vbox), ctrl->SatFreqDown, TRUE, TRUE, 0); /* Downlink doppler */ label = gtk_label_new (_("Doppler:")); @@ -453,13 +453,13 @@ label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label),"<span size='large'><b>Radio:</b></span>"); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_box_pack_start_defaults (GTK_BOX (hbox2), label); + gtk_box_pack_start (GTK_BOX (hbox2), label, TRUE, TRUE, 0); ctrl->RigFreqDown = gtk_freq_knob_new (145890000.0, FALSE); - gtk_box_pack_start_defaults (GTK_BOX (hbox2), ctrl->RigFreqDown); + gtk_box_pack_start (GTK_BOX (hbox2), ctrl->RigFreqDown, TRUE, TRUE, 0); /* finish packing ... */ - gtk_box_pack_start_defaults (GTK_BOX (vbox), hbox1); - gtk_box_pack_start_defaults (GTK_BOX (vbox), hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox1, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (frame), vbox); return frame; @@ -492,7 +492,7 @@ /* satellite uplink frequency */ ctrl->SatFreqUp = gtk_freq_knob_new (145890000.0, TRUE); g_signal_connect (ctrl->SatFreqUp, "freq-changed", G_CALLBACK (uplink_changed_cb), ctrl); - gtk_box_pack_start_defaults (GTK_BOX (vbox), ctrl->SatFreqUp); + gtk_box_pack_start (GTK_BOX (vbox), ctrl->SatFreqUp, TRUE, TRUE, 0); /* Uplink doppler */ label = gtk_label_new (_("Doppler:")); @@ -517,13 +517,13 @@ label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label),"<span size='large'><b>Radio:</b></span>"); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_box_pack_start_defaults (GTK_BOX (hbox2), label); + gtk_box_pack_start (GTK_BOX (hbox2), label, TRUE, TRUE, 0); ctrl->RigFreqUp = gtk_freq_knob_new (145890000.0, FALSE); - gtk_box_pack_start_defaults (GTK_BOX (hbox2), ctrl->RigFreqUp); + gtk_box_pack_start (GTK_BOX (hbox2), ctrl->RigFreqUp, TRUE, TRUE, 0); - gtk_box_pack_start_defaults (GTK_BOX (vbox), hbox1); - gtk_box_pack_start_defaults (GTK_BOX (vbox), hbox2); + gtk_box_pack_start (GTK_BOX (vbox), hbox1, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox2, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (frame), vbox); Modified: trunk/src/loc-tree.c =================================================================== --- trunk/src/loc-tree.c 2011-10-23 11:32:12 UTC (rev 931) +++ trunk/src/loc-tree.c 2011-10-23 11:39:07 UTC (rev 932) @@ -270,7 +270,7 @@ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, FALSE); - gtk_box_pack_start_defaults (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(dialog))), swin); + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(dialog))), swin, TRUE, TRUE, 0); /* connect selection checker for the tree-view; we have waited so far, because we want to pass the dialog as Modified: trunk/src/mod-cfg.c =================================================================== --- trunk/src/mod-cfg.c 2011-10-23 11:32:12 UTC (rev 931) +++ trunk/src/mod-cfg.c 2011-10-23 11:39:07 UTC (rev 932) @@ -1001,7 +1001,7 @@ contents = sat_pref_modules_create (cfgdata); gtk_widget_show_all (contents); - gtk_box_pack_start_defaults (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), contents); + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG (dialog))), contents, TRUE, TRUE, 0); /* execute dialog */ switch (gtk_dialog_run (GTK_DIALOG (dialog))) { Modified: trunk/src/sat-debugger.c =================================================================== --- trunk/src/sat-debugger.c 2011-10-23 11:32:12 UTC (rev 931) +++ trunk/src/sat-debugger.c 2011-10-23 11:39:07 UTC (rev 932) @@ -32,10 +32,10 @@ hbox = gtk_hbox_new (TRUE,5); - gtk_box_pack_start_defaults (GTK_BOX (hbox), gtk_label_new ("LON:")); - gtk_box_pack_start_defaults (GTK_BOX (hbox), lonsp); - gtk_box_pack_start_defaults (GTK_BOX (hbox), gtk_label_new ("LAT:")); - gtk_box_pack_start_defaults (GTK_BOX (hbox), latsp); + gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new ("LON:"), TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox), lonsp, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new ("LAT:"), TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox), latsp, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (window), hbox); gtk_container_set_border_width (GTK_CONTAINER (window), 20); Modified: trunk/src/sat-log-browser.c =================================================================== --- trunk/src/sat-log-browser.c 2011-10-23 11:32:12 UTC (rev 931) +++ trunk/src/sat-log-browser.c 2011-10-23 11:39:07 UTC (rev 932) @@ -143,8 +143,11 @@ hbox = gtk_hbox_new (FALSE, 10); - gtk_box_pack_start_defaults (GTK_BOX (hbox), - create_message_list ()); + gtk_box_pack_start (GTK_BOX (hbox), + create_message_list (), + TRUE, + TRUE, + 0); gtk_box_pack_start (GTK_BOX (hbox), create_message_summary (), Modified: trunk/src/sat-pref.c =================================================================== --- trunk/src/sat-pref.c 2011-10-23 11:32:12 UTC (rev 931) +++ trunk/src/sat-pref.c 2011-10-23 11:39:07 UTC (rev 932) @@ -174,7 +174,7 @@ NULL); g_free (iconfile); - gtk_box_pack_start_defaults (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(window))), hbox); + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(window))), hbox, TRUE, TRUE, 0); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area(GTK_DIALOG(window))), 10); gtk_button_clicked (GTK_BUTTON (genbut)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-23 11:32:18
|
Revision: 931 http://gpredict.svn.sourceforge.net/gpredict/?rev=931&view=rev Author: aa1vs Date: 2011-10-23 11:32:12 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Use more robust check on orbit change time. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-map-ground-track.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-13 11:01:45 UTC (rev 930) +++ trunk/ChangeLog 2011-10-23 11:32:12 UTC (rev 931) @@ -1,3 +1,9 @@ +2011-10-23 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-sat-map-groundtrack.c + Use more robust check on orbit change time. + + 2011-10-13 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-sat-map-ground-track.c =================================================================== --- trunk/src/gtk-sat-map-ground-track.c 2011-10-13 11:01:45 UTC (rev 930) +++ trunk/src/gtk-sat-map-ground-track.c 2011-10-23 11:32:12 UTC (rev 931) @@ -106,17 +106,21 @@ /* Iterate backwards in time until we reach sat->orbit < this_orbit. Use predict_calc from predict-tools.c as SGP/SDP driver. As a built-in safety, we stop iteration if the orbit crossing is - more than 12 hours back in time. + more than 24 hours back in time. */ t0 = satmap->tstamp;//get_current_daynum (); /* use == instead of >= as it is more robust */ - for (t = t0; (sat->orbit == this_orbit) && ((t+0.5) > t0); t -= 0.0007) { + for (t = t0; (sat->orbit == this_orbit) && ((t + 1.0) > t0); t -= 0.0007) { predict_calc (sat, qth, t); } - t0 = t; + /* set it so that we are in the same orbit as this_orbit + and not a different one */ + t += 0.0007; + t0 = t; + predict_calc (sat, qth, t0); sat_log_log (SAT_LOG_LEVEL_DEBUG, _("%s: T0: %f (%d)"), @@ -124,7 +128,9 @@ /* calculate (lat,lon) for the required orbits */ - while (sat->orbit <= max_orbit && !decayed(sat)) { + while ((sat->orbit <= max_orbit) && + (sat->orbit >= this_orbit) && + (!decayed(sat))) { /* We use 30 sec time steps. If resolution is too fine, the line drawing routine will filter out unnecessary points @@ -152,9 +158,17 @@ obj->track_data.latlon = g_slist_prepend (obj->track_data.latlon, this_ssp); } + /* log if there is a problem with the orbit calculation */ + if (sat->orbit != (max_orbit+1)) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Problem computing ground track for %s"), + __FUNCTION__, sat->nickname); + return; + } + - /* Reset satellite structure to eliminate glitches in single sat view and other places - when new ground track is layed out */ + /* Reset satellite structure to eliminate glitches in single sat + view and other places when new ground track is layed out */ predict_calc(sat, qth, satmap->tstamp); /* reverse GSList */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-13 11:01:55
|
Revision: 930 http://gpredict.svn.sourceforge.net/gpredict/?rev=930&view=rev Author: aa1vs Date: 2011-10-13 11:01:45 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Add currently shown file name in title. Modified Paths: -------------- trunk/ChangeLog trunk/src/sat-log-browser.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-13 10:46:24 UTC (rev 929) +++ trunk/ChangeLog 2011-10-13 11:01:45 UTC (rev 930) @@ -6,6 +6,10 @@ * src/gtk-polar-view-popup.c Eliminate unused variables to clean compiler output. + * ChangeLog + * src/sat-log-browser.c + Add currently shown file name in title. + 2011-10-12 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/sat-log-browser.c =================================================================== --- trunk/src/sat-log-browser.c 2011-10-13 10:46:24 UTC (rev 929) +++ trunk/src/sat-log-browser.c 2011-10-13 11:01:45 UTC (rev 930) @@ -134,6 +134,8 @@ GtkWidget *hbox; gchar *fname; gchar *confdir; + gchar *title; + gint error; /* error code returned by by read_debug_file */ if (!initialised) { @@ -185,12 +187,22 @@ "logs", G_DIR_SEPARATOR_S, "gpredict.log", NULL); - read_debug_file (fname); + error = read_debug_file (fname); + + if (error == 0) { + /* update window title if file read cleanly */ + title = g_strdup_printf ( _("Log Browser: %s"), fname); + gtk_window_set_title (GTK_WINDOW(window), title); + + g_free(title); + } else { + /* Remove filename if file not read */ + gtk_window_set_title (GTK_WINDOW(window), _("Log Browser")); + } + g_free (fname); g_free (confdir); - /*** FIXME: add currently shown file name in title; chech read_debug_file status */ - initialised = TRUE; } } @@ -376,6 +388,7 @@ { gchar *confdir; gchar *filename; + gchar *title; gint error; /* error code returned by by read_debug_file */ @@ -404,9 +417,16 @@ /* sanity check of filename will be performed in read_debug_file */ error = read_debug_file (filename); + if (error == 0){ + /* Update title with filename */ + title = g_strdup_printf ( _("Log Browser: %s"), filename); + gtk_window_set_title (GTK_WINDOW(window), title); + g_free(title); + } else { + /* clear filename from title if unable to read file */ + gtk_window_set_title (GTK_WINDOW(window), _("Log Browser")); + } - /*** FIXME: add currently shown file name in title; chech read_debug_file status */ - g_free (filename); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-13 10:46:36
|
Revision: 929 http://gpredict.svn.sourceforge.net/gpredict/?rev=929&view=rev Author: aa1vs Date: 2011-10-13 10:46:24 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Eliminate unused variables to clean compiler output. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-polar-view-popup.c trunk/src/qth-data.c trunk/src/save-pass.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-12 23:20:21 UTC (rev 928) +++ trunk/ChangeLog 2011-10-13 10:46:24 UTC (rev 929) @@ -1,3 +1,11 @@ +2011-10-13 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/qth-data.c + * src/save-pass.c + * src/gtk-polar-view-popup.c + Eliminate unused variables to clean compiler output. + 2011-10-12 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-polar-view-popup.c =================================================================== --- trunk/src/gtk-polar-view-popup.c 2011-10-12 23:20:21 UTC (rev 928) +++ trunk/src/gtk-polar-view-popup.c 2011-10-13 10:46:24 UTC (rev 929) @@ -176,7 +176,7 @@ GtkPolarView *pv = GTK_POLAR_VIEW (data); sat_obj_t *obj = NULL; sat_t *sat; - qth_t *qth; + /* qth_t *qth; Unused */ gint idx; guint i; GooCanvasItemModel *root; @@ -192,7 +192,7 @@ /* get satellite object */ obj = SAT_OBJ(g_object_get_data (G_OBJECT (item), "obj")); sat = SAT(g_object_get_data (G_OBJECT (item), "sat")); - qth = (qth_t *)(g_object_get_data (G_OBJECT (item), "qth")); + /*qth = (qth_t *)(g_object_get_data (G_OBJECT (item), "qth"));*/ if (obj == NULL) { sat_log_log (SAT_LOG_LEVEL_BUG, Modified: trunk/src/qth-data.c =================================================================== --- trunk/src/qth-data.c 2011-10-12 23:20:21 UTC (rev 928) +++ trunk/src/qth-data.c 2011-10-13 10:46:24 UTC (rev 929) @@ -549,7 +549,9 @@ *and other like services to update the qth position. */ gboolean qth_data_update_init(qth_t * qth) { +#ifdef HAS_LIBGPS char *port; +#endif gboolean retval=FALSE; switch (qth->type){ Modified: trunk/src/save-pass.c =================================================================== --- trunk/src/save-pass.c 2011-10-12 23:20:21 UTC (rev 928) +++ trunk/src/save-pass.c 2011-10-13 10:46:24 UTC (rev 929) @@ -95,7 +95,7 @@ GtkWidget *label; gint response; pass_t *pass; - gchar *sat; + //gchar *sat; qth_t *qth; gchar *savedir = NULL; gchar *savefile; @@ -104,7 +104,7 @@ /* get data attached to parent */ - sat = (gchar *) g_object_get_data (G_OBJECT (parent), "sat"); + //sat = (gchar *) g_object_get_data (G_OBJECT (parent), "sat"); qth = (qth_t *) g_object_get_data (G_OBJECT (parent), "qth"); pass = (pass_t *) g_object_get_data (G_OBJECT (parent), "pass"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-12 23:20:27
|
Revision: 928 http://gpredict.svn.sourceforge.net/gpredict/?rev=928&view=rev Author: aa1vs Date: 2011-10-12 23:20:21 +0000 (Wed, 12 Oct 2011) Log Message: ----------- Filter decayed satellites from event list. (Bug 3414666) Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-event-list.c trunk/src/gtk-event-list.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-12 23:16:48 UTC (rev 927) +++ trunk/ChangeLog 2011-10-12 23:20:21 UTC (rev 928) @@ -5,7 +5,12 @@ * src/gtk-sat-list.h Filter decayed satellites from satellite list. (Bug 3414666) + * ChangeLog + * src/gtk-event-list.c + * src/gtk-event-list.h + Filter decayed satellites from event list. (Bug 3414666) + 2011-10-10 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-event-list.c =================================================================== --- trunk/src/gtk-event-list.c 2011-10-12 23:16:48 UTC (rev 927) +++ trunk/src/gtk-event-list.c 2011-10-12 23:20:21 UTC (rev 928) @@ -43,6 +43,7 @@ #include "locator.h" #include "sat-vis.h" #include "sat-info.h" +#include "orbit-tools.h" #ifdef HAVE_CONFIG_H # include <build-config.h> #endif @@ -234,7 +235,7 @@ { GtkWidget *widget; GtkEventList *evlist; - GtkTreeModel *model; + GtkTreeModel *model, *filter, *sortable; guint i; GtkCellRenderer *renderer; GtkTreeViewColumn *column; @@ -326,20 +327,26 @@ /* create model and finalise treeview */ model = create_and_fill_model (evlist->satellites); - gtk_tree_view_set_model (GTK_TREE_VIEW (evlist->treeview), model); + filter = gtk_tree_model_filter_new (model, NULL); + sortable =gtk_tree_model_sort_new_with_model(filter); + evlist->sortable = sortable; + gtk_tree_model_filter_set_visible_column (GTK_TREE_MODEL_FILTER(filter), EVENT_LIST_COL_DECAY); + gtk_tree_view_set_model (GTK_TREE_VIEW (evlist->treeview), sortable); /* The time sort function needs to be special */ - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), + gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE(sortable), EVENT_LIST_COL_TIME, event_cell_compare_function, NULL, NULL); /* initial sorting criteria */ - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sortable), evlist->sort_column, - evlist->sort_order), + evlist->sort_order); g_object_unref (model); + g_object_unref (filter); + g_object_unref (sortable); g_signal_connect (evlist->treeview, "button-press-event", G_CALLBACK (button_press_cb), widget); @@ -374,7 +381,8 @@ G_TYPE_DOUBLE, // az G_TYPE_DOUBLE, // el G_TYPE_BOOLEAN, // TRUE if AOS, FALSE if LOS - G_TYPE_DOUBLE); // time + G_TYPE_DOUBLE, // time + G_TYPE_BOOLEAN); // decayed /* add each satellite from hash table */ g_hash_table_foreach (sats, event_list_add_satellites, liststore); @@ -407,6 +415,7 @@ EVENT_LIST_COL_EL, sat->el, EVENT_LIST_COL_EVT, (sat->el >= 0) ? TRUE : FALSE, EVENT_LIST_COL_TIME, 0.0, + EVENT_LIST_COL_DECAY, !decayed(sat), -1); } @@ -428,10 +437,12 @@ } /* get and tranverse the model */ - model = gtk_tree_view_get_model (GTK_TREE_VIEW (evlist->treeview)); + model = gtk_tree_model_filter_get_model( GTK_TREE_MODEL_FILTER( + gtk_tree_model_sort_get_model( GTK_TREE_MODEL_SORT ( + gtk_tree_view_get_model (GTK_TREE_VIEW (evlist->treeview)))))); /*save the sort information */ - gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model), + gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (evlist->sortable), &(evlist->sort_column), &(evlist->sort_order)); @@ -449,8 +460,9 @@ evlist->counter = 1; /* get and tranverse the model */ - model = gtk_tree_view_get_model (GTK_TREE_VIEW (evlist->treeview)); + model = gtk_tree_model_filter_get_model(gtk_tree_view_get_model (GTK_TREE_VIEW (evlist->treeview))); + /* update */ gtk_tree_model_foreach (model, event_list_update_sats, evlist); } @@ -518,6 +530,7 @@ EVENT_LIST_COL_EL, sat->el, EVENT_LIST_COL_EVT, (sat->el >= 0) ? TRUE : FALSE, EVENT_LIST_COL_TIME, number, + EVENT_LIST_COL_DECAY, !decayed(sat), -1); } @@ -712,17 +725,12 @@ { gint result; gdouble ta,tb; - gint sort_col; - GtkSortType sort_type; + gint sort_col = EVENT_LIST_COL_TIME; /* hard coded as it is the only option */ + /* extracting from models was not working */ + /* with filter and sorting */ (void) user_data; /* avoid unused warning compiler warning. */ - /* Since this function is used for both AOS and LOS columns, - we need to get the sort column */ - gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model), - &sort_col, - &sort_type); - /* get a and b */ gtk_tree_model_get (model, a, sort_col, &ta, -1); gtk_tree_model_get (model, b, sort_col, &tb, -1); Modified: trunk/src/gtk-event-list.h =================================================================== --- trunk/src/gtk-event-list.h 2011-10-12 23:16:48 UTC (rev 927) +++ trunk/src/gtk-event-list.h 2011-10-12 23:20:21 UTC (rev 928) @@ -72,8 +72,10 @@ GKeyFile *cfgdata; gint sort_column; GtkSortType sort_order; + GtkTreeModel *sortable; void (* update) (GtkWidget *widget); /*!< update function */ + }; struct _GtkEventListClass @@ -90,6 +92,7 @@ EVENT_LIST_COL_EL, /*!< Satellite Elevation. */ EVENT_LIST_COL_EVT, /*!< Next event (AOS or LOS). */ EVENT_LIST_COL_TIME, /*!< Time countdown. */ + EVENT_LIST_COL_DECAY, /*!< Whether satellite is decayed or not. */ EVENT_LIST_COL_NUMBER } event_list_col_t; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-12 23:16:54
|
Revision: 927 http://gpredict.svn.sourceforge.net/gpredict/?rev=927&view=rev Author: aa1vs Date: 2011-10-12 23:16:48 +0000 (Wed, 12 Oct 2011) Log Message: ----------- Filter decayed satellites from satellite list. (Bug 3414666) Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-list.c trunk/src/gtk-sat-list.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-10 00:38:52 UTC (rev 926) +++ trunk/ChangeLog 2011-10-12 23:16:48 UTC (rev 927) @@ -1,3 +1,11 @@ +2011-10-12 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/gtk-sat-list.c + * src/gtk-sat-list.h + Filter decayed satellites from satellite list. (Bug 3414666) + + 2011-10-10 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-sat-list.c =================================================================== --- trunk/src/gtk-sat-list.c 2011-10-10 00:38:52 UTC (rev 926) +++ trunk/src/gtk-sat-list.c 2011-10-12 23:16:48 UTC (rev 927) @@ -322,7 +322,7 @@ gtk_sat_list_new (GKeyFile *cfgdata, GHashTable *sats, qth_t *qth, guint32 columns) { GtkWidget *widget; - GtkTreeModel *model; + GtkTreeModel *model, *filter, *sortable; guint i; GtkCellRenderer *renderer; @@ -435,7 +435,11 @@ /* create model and finalise treeview */ model = create_and_fill_model (GTK_SAT_LIST (widget)->satellites); - gtk_tree_view_set_model (GTK_TREE_VIEW (GTK_SAT_LIST (widget)->treeview), model); + filter = gtk_tree_model_filter_new (model, NULL); + sortable = gtk_tree_model_sort_new_with_model(filter); + GTK_SAT_LIST(widget)->sortable = sortable; + gtk_tree_model_filter_set_visible_column (GTK_TREE_MODEL_FILTER(filter), SAT_LIST_COL_DECAY); + gtk_tree_view_set_model (GTK_TREE_VIEW (GTK_SAT_LIST (widget)->treeview), sortable); /* We need a special sort function for AOS/LOS events that works with all date and time formats (see bug #1861323) @@ -443,18 +447,20 @@ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), SAT_LIST_COL_AOS, event_cell_compare_function, - NULL, NULL); + widget, NULL); gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), SAT_LIST_COL_LOS, event_cell_compare_function, - NULL, NULL); + widget, NULL); /* satellite name should be initial sorting criteria */ - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sortable), GTK_SAT_LIST(widget)->sort_column, GTK_SAT_LIST(widget)->sort_order); g_object_unref (model); + g_object_unref (filter); + g_object_unref (sortable); g_signal_connect (GTK_SAT_LIST (widget)->treeview, "button-press-event", G_CALLBACK (button_press_cb), widget); @@ -512,7 +518,8 @@ G_TYPE_DOUBLE, // mean anomaly G_TYPE_DOUBLE, // phase G_TYPE_LONG, // orbit - G_TYPE_STRING); // visibility + G_TYPE_STRING, // visibility + G_TYPE_BOOLEAN); // decay g_hash_table_foreach (sats, sat_list_add_satellites, liststore); @@ -559,6 +566,7 @@ SAT_LIST_COL_MA, sat->ma, SAT_LIST_COL_PHASE, sat->phase, SAT_LIST_COL_ORBIT, sat->orbit, + SAT_LIST_COL_DECAY, !decayed(sat), -1); @@ -592,10 +600,12 @@ /* get and tranverse the model */ - model = gtk_tree_view_get_model (GTK_TREE_VIEW (satlist->treeview)); + model = gtk_tree_model_filter_get_model( GTK_TREE_MODEL_FILTER( + gtk_tree_model_sort_get_model( GTK_TREE_MODEL_SORT( + gtk_tree_view_get_model (GTK_TREE_VIEW (satlist->treeview)))))); /*save the sort information */ - gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model), + gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (satlist->sortable), &(satlist->sort_column), &(satlist->sort_order)); @@ -670,6 +680,7 @@ SAT_LIST_COL_MA, sat->ma, SAT_LIST_COL_PHASE, sat->phase, SAT_LIST_COL_ORBIT, sat->orbit, + SAT_LIST_COL_DECAY, !decayed(sat), -1); /* doppler shift @ 100 MHz */ @@ -1204,12 +1215,11 @@ gdouble ta,tb; gint sort_col; GtkSortType sort_type; + GtkSatList *satlist = GTK_SAT_LIST(user_data); - (void) user_data; /* avoid unusued parameter compiler warning */ - /* Since this function is used for both AOS and LOS columns, we need to get the sort column */ - gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model), + gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (satlist->sortable), &sort_col, &sort_type); Modified: trunk/src/gtk-sat-list.h =================================================================== --- trunk/src/gtk-sat-list.h 2011-10-10 00:38:52 UTC (rev 926) +++ trunk/src/gtk-sat-list.h 2011-10-12 23:16:48 UTC (rev 927) @@ -74,6 +74,7 @@ GKeyFile *cfgdata; gint sort_column; GtkSortType sort_order; + GtkTreeModel *sortable; /*!< a sortable version of the tree model for filtering */ void (* update) (GtkWidget *widget); /*!< update function */ }; @@ -111,6 +112,7 @@ SAT_LIST_COL_PHASE, /*!< Phase. */ SAT_LIST_COL_ORBIT, /*!< Orbit Number. */ SAT_LIST_COL_VISIBILITY, /*!< Visibility. */ + SAT_LIST_COL_DECAY, /*!< Whether the satellite is decayed or not. */ SAT_LIST_COL_NUMBER } sat_list_col_t; @@ -142,7 +144,8 @@ SAT_LIST_FLAG_MA = 1 << SAT_LIST_COL_MA, /*!< Mean Anomaly. */ SAT_LIST_FLAG_PHASE = 1 << SAT_LIST_COL_PHASE, /*!< Phase. */ SAT_LIST_FLAG_ORBIT = 1 << SAT_LIST_COL_ORBIT, /*!< Orbit Number. */ - SAT_LIST_FLAG_VISIBILITY = 1 << SAT_LIST_COL_VISIBILITY /*!< Visibility. */ + SAT_LIST_FLAG_VISIBILITY = 1 << SAT_LIST_COL_VISIBILITY, /*!< Visibility. */ + SAT_LIST_FLAG_DECAY = 1 << SAT_LIST_COL_DECAY /*!< Decayed. */ } sat_list_flag_t; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-10 00:38:59
|
Revision: 926 http://gpredict.svn.sourceforge.net/gpredict/?rev=926&view=rev Author: aa1vs Date: 2011-10-10 00:38:52 +0000 (Mon, 10 Oct 2011) Log Message: ----------- Add internationalization to several strings. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-module-popup.c trunk/src/menubar.c trunk/src/mod-mgr.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-09 13:48:21 UTC (rev 925) +++ trunk/ChangeLog 2011-10-10 00:38:52 UTC (rev 926) @@ -1,3 +1,11 @@ +2011-10-10 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/gtk-sat-module-popup.c + * src/menubar.c + * src/mod-mgr.c + Add internationalization to several strings. + 2011-10-09 Charles Suprin <hamaa1vs at gmail.com> * src/tle-update.c Modified: trunk/src/gtk-sat-module-popup.c =================================================================== --- trunk/src/gtk-sat-module-popup.c 2011-10-09 13:48:21 UTC (rev 925) +++ trunk/src/gtk-sat-module-popup.c 2011-10-10 00:38:52 UTC (rev 926) @@ -425,7 +425,7 @@ newmod->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (newmod->win), newmod->name); - title = g_strconcat ("GPREDICT: ", + title = g_strconcat (_("GPREDICT: "), newmod->name, " (", newmod->qth->name, ")", NULL); @@ -548,7 +548,7 @@ /* create window */ GTK_SAT_MODULE (module)->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); - title = g_strconcat ("GPREDICT: ", + title = g_strconcat (_("GPREDICT: "), GTK_SAT_MODULE (module)->name, " (", GTK_SAT_MODULE (module)->qth->name, ")", NULL); @@ -688,7 +688,7 @@ /* create window */ GTK_SAT_MODULE (module)->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); - title = g_strconcat ("GPREDICT: ", + title = g_strconcat (_("GPREDICT: "), GTK_SAT_MODULE (module)->name, " (", GTK_SAT_MODULE (module)->qth->name, ")", NULL); Modified: trunk/src/menubar.c =================================================================== --- trunk/src/menubar.c 2011-10-09 13:48:21 UTC (rev 925) +++ trunk/src/menubar.c 2011-10-10 00:38:52 UTC (rev 926) @@ -1058,7 +1058,7 @@ /* create window */ GTK_SAT_MODULE (module)->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); - title = g_strconcat ("GPREDICT: ", + title = g_strconcat (_("GPREDICT: "), GTK_SAT_MODULE (module)->name, " (", GTK_SAT_MODULE (module)->qth->name, ")", NULL); Modified: trunk/src/mod-mgr.c =================================================================== --- trunk/src/mod-mgr.c 2011-10-09 13:48:21 UTC (rev 925) +++ trunk/src/mod-mgr.c 2011-10-10 00:38:52 UTC (rev 926) @@ -681,7 +681,7 @@ /* create window */ GTK_SAT_MODULE (module)->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); - title = g_strconcat ("GPREDICT: ", + title = g_strconcat (_("GPREDICT: "), GTK_SAT_MODULE (module)->name, " (", GTK_SAT_MODULE (module)->qth->name, ")", NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-09 13:48:27
|
Revision: 925 http://gpredict.svn.sourceforge.net/gpredict/?rev=925&view=rev Author: aa1vs Date: 2011-10-09 13:48:21 +0000 (Sun, 09 Oct 2011) Log Message: ----------- Add transponder file for ARISSAT/Radioskaf-b from Michael Schulz, K5TRI. Modified Paths: -------------- trunk/ChangeLog Added Paths: ----------- trunk/data/trsp/37772.trsp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-09 13:37:23 UTC (rev 924) +++ trunk/ChangeLog 2011-10-09 13:48:21 UTC (rev 925) @@ -3,7 +3,10 @@ * src/tle-update.c Eliminate compiler warning. + * data/trsp/37772.trsp + Add transponder file for ARISSAT/Radioskaf-b from Michael Schulz, K5TRI. + 2011-10-08 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-sat-map-groundtrack.c Added: trunk/data/trsp/37772.trsp =================================================================== --- trunk/data/trsp/37772.trsp (rev 0) +++ trunk/data/trsp/37772.trsp 2011-10-09 13:48:21 UTC (rev 925) @@ -0,0 +1,19 @@ +[ARISSat U/V Lin] +UP_LOW=435742000 +UP_HIGH=435758000 +DOWN_LOW=145922000 +DOWN_HIGH=145938000 +INVERT=true + +[Digitalker/ SSTV FM] +DOWN_LOW=145950000 + +[Telemetry Mode v] +DOWN_LOW=145920000 + +[CW TLM Beacon BPSK-1000] +DOWN_LOW=145919000 + +[CW TLM Beacon BPSK-400] +DOWN_LOW=145939000 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-09 13:37:29
|
Revision: 924 http://gpredict.svn.sourceforge.net/gpredict/?rev=924&view=rev Author: aa1vs Date: 2011-10-09 13:37:23 +0000 (Sun, 09 Oct 2011) Log Message: ----------- Update ChangeLog Modified Paths: -------------- trunk/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-09 13:36:13 UTC (rev 923) +++ trunk/ChangeLog 2011-10-09 13:37:23 UTC (rev 924) @@ -1,3 +1,9 @@ +2011-10-09 Charles Suprin <hamaa1vs at gmail.com> + + * src/tle-update.c + Eliminate compiler warning. + + 2011-10-08 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-sat-map-groundtrack.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-09 13:36:19
|
Revision: 923 http://gpredict.svn.sourceforge.net/gpredict/?rev=923&view=rev Author: aa1vs Date: 2011-10-09 13:36:13 +0000 (Sun, 09 Oct 2011) Log Message: ----------- Eliminate compiler warning. Modified Paths: -------------- trunk/src/tle-update.c Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-10-09 13:34:42 UTC (rev 922) +++ trunk/src/tle-update.c 2011-10-09 13:36:13 UTC (rev 923) @@ -860,7 +860,7 @@ } /* set b to non-null as a flag */ - b = 1; + b = path; /* read lines from tle file */ while (fgets (linetmp, 80, fp)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-09 13:34:49
|
Revision: 922 http://gpredict.svn.sourceforge.net/gpredict/?rev=922&view=rev Author: aa1vs Date: 2011-10-09 13:34:42 +0000 (Sun, 09 Oct 2011) Log Message: ----------- Update ChangeLog Modified Paths: -------------- trunk/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-08 20:19:43 UTC (rev 921) +++ trunk/ChangeLog 2011-10-09 13:34:42 UTC (rev 922) @@ -1,3 +1,10 @@ +2011-10-08 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-sat-map-groundtrack.c + Use more robust check on orbit change time. + Reset satellite after computing ground track. + + 2011-10-07 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-polar-view.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-08 20:19:49
|
Revision: 921 http://gpredict.svn.sourceforge.net/gpredict/?rev=921&view=rev Author: aa1vs Date: 2011-10-08 20:19:43 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Reset satellite after computing ground track. Modified Paths: -------------- trunk/src/gtk-sat-map-ground-track.c Modified: trunk/src/gtk-sat-map-ground-track.c =================================================================== --- trunk/src/gtk-sat-map-ground-track.c 2011-10-08 20:08:40 UTC (rev 920) +++ trunk/src/gtk-sat-map-ground-track.c 2011-10-08 20:19:43 UTC (rev 921) @@ -153,6 +153,10 @@ } + /* Reset satellite structure to eliminate glitches in single sat view and other places + when new ground track is layed out */ + predict_calc(sat, qth, satmap->tstamp); + /* reverse GSList */ obj->track_data.latlon = g_slist_reverse (obj->track_data.latlon); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-08 20:08:46
|
Revision: 920 http://gpredict.svn.sourceforge.net/gpredict/?rev=920&view=rev Author: aa1vs Date: 2011-10-08 20:08:40 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Use more robust check on orbit change time. Modified Paths: -------------- trunk/src/gtk-sat-map-ground-track.c Modified: trunk/src/gtk-sat-map-ground-track.c =================================================================== --- trunk/src/gtk-sat-map-ground-track.c 2011-10-08 02:04:58 UTC (rev 919) +++ trunk/src/gtk-sat-map-ground-track.c 2011-10-08 20:08:40 UTC (rev 920) @@ -109,7 +109,8 @@ more than 12 hours back in time. */ t0 = satmap->tstamp;//get_current_daynum (); - for (t = t0; (sat->orbit >= this_orbit) && ((t+0.5) > t0); t -= 0.0007) { + /* use == instead of >= as it is more robust */ + for (t = t0; (sat->orbit == this_orbit) && ((t+0.5) > t0); t -= 0.0007) { predict_calc (sat, qth, t); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-08 02:05:05
|
Revision: 919 http://gpredict.svn.sourceforge.net/gpredict/?rev=919&view=rev Author: aa1vs Date: 2011-10-08 02:04:58 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Update label as part of satellite update. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS trunk/src/gtk-polar-view.c trunk/src/gtk-sat-map.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-05 00:46:02 UTC (rev 918) +++ trunk/ChangeLog 2011-10-08 02:04:58 UTC (rev 919) @@ -1,3 +1,10 @@ +2011-10-07 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-polar-view.c + * src/gtk-sat-map.c + Update label as part of satellite update. + + 2011-10-05 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-rot-ctrl.c Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2011-10-05 00:46:02 UTC (rev 918) +++ trunk/NEWS 2011-10-08 02:04:58 UTC (rev 919) @@ -18,6 +18,7 @@ - Fixed bug 3413571: UARS Ground Track not Updated on TLE update. - Fixed bug 3416451: No ground track for new satellites. - Fixed bug 3417553: Gpredict crashes +- Fixed bug 3419879: gpredict doesn't change the satellite names on world map. Changes in version 1.3 (1 Mar 2011) Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2011-10-05 00:46:02 UTC (rev 918) +++ trunk/src/gtk-polar-view.c 2011-10-08 02:04:58 UTC (rev 919) @@ -886,6 +886,9 @@ losstr = g_strdup_printf (_("%s\nAlways in range"), sat->nickname); } + /* update label */ + g_object_set (obj->label,"text",sat->nickname,NULL); + /* update tooltip */ tooltip = g_strdup_printf("<big><b>%s</b>\n</big>"\ "<tt>Az: %5.1f\302\260\n" \ Modified: trunk/src/gtk-sat-map.c =================================================================== --- trunk/src/gtk-sat-map.c 2011-10-05 00:46:02 UTC (rev 918) +++ trunk/src/gtk-sat-map.c 2011-10-08 02:04:58 UTC (rev 919) @@ -2061,6 +2061,10 @@ //sat->ssplon = ssplo; //sat->ssplat = sspla; + /* update the label */ + g_object_set (obj->label,"text",sat->nickname,NULL); + g_object_set (obj->shadowl,"text",sat->nickname,NULL); + /* we update tooltips every time */ aosstr = aoslos_time_to_str(satmap, sat); tooltip = g_strdup_printf("<big><b>%s</b>\n</big>"\ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-05 00:46:08
|
Revision: 918 http://gpredict.svn.sourceforge.net/gpredict/?rev=918&view=rev Author: aa1vs Date: 2011-10-05 00:46:02 +0000 (Wed, 05 Oct 2011) Log Message: ----------- Update ChangeLog and NEWS Modified Paths: -------------- trunk/ChangeLog trunk/NEWS Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-05 00:45:25 UTC (rev 917) +++ trunk/ChangeLog 2011-10-05 00:46:02 UTC (rev 918) @@ -1,3 +1,19 @@ +2011-10-05 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-rot-ctrl.c + Eliminate compiler warning. + + * src/gtk-sat-list.c + * src/gtk-single-sat.c + * src/gtk-sat-map.h + * src/predict-tools.h + Use signed 32 bit integers for orbit counts. + +2011-10-03 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-polar-view-popup.c + Fix segfault when turning on and off skytrack. Bug 3417553: Gpredict crashes. + 2011-10-02 Charles Suprin <hamaa1vs at gmail.com> * src/sgpsdp/sgp4sdp4.h Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2011-10-05 00:45:25 UTC (rev 917) +++ trunk/NEWS 2011-10-05 00:46:02 UTC (rev 918) @@ -17,6 +17,7 @@ - Fixed bug 3309111: Wrong icon in time controller. - Fixed bug 3413571: UARS Ground Track not Updated on TLE update. - Fixed bug 3416451: No ground track for new satellites. +- Fixed bug 3417553: Gpredict crashes Changes in version 1.3 (1 Mar 2011) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-05 00:45:31
|
Revision: 917 http://gpredict.svn.sourceforge.net/gpredict/?rev=917&view=rev Author: aa1vs Date: 2011-10-05 00:45:25 +0000 (Wed, 05 Oct 2011) Log Message: ----------- Use signed 32 bit integers for orbit counts. Modified Paths: -------------- trunk/src/gtk-sat-list.c trunk/src/gtk-sat-map.h trunk/src/gtk-single-sat.c trunk/src/predict-tools.h Modified: trunk/src/gtk-sat-list.c =================================================================== --- trunk/src/gtk-sat-list.c 2011-10-05 00:41:52 UTC (rev 916) +++ trunk/src/gtk-sat-list.c 2011-10-05 00:45:25 UTC (rev 917) @@ -511,7 +511,7 @@ G_TYPE_DOUBLE, // delay G_TYPE_DOUBLE, // mean anomaly G_TYPE_DOUBLE, // phase - G_TYPE_ULONG, // orbit + G_TYPE_LONG, // orbit G_TYPE_STRING); // visibility Modified: trunk/src/gtk-sat-map.h =================================================================== --- trunk/src/gtk-sat-map.h 2011-10-05 00:41:52 UTC (rev 916) +++ trunk/src/gtk-sat-map.h 2011-10-05 00:45:25 UTC (rev 917) @@ -101,7 +101,7 @@ guint newrcnum; /*!< Number of RC parts in this cycle. */ ground_track_t track_data; /*!< Ground track data. */ - unsigned long track_orbit; /*!< Orbit when the ground track has been updated. */ + long track_orbit; /*!< Orbit when the ground track has been updated. */ } sat_map_obj_t; Modified: trunk/src/gtk-single-sat.c =================================================================== --- trunk/src/gtk-single-sat.c 2011-10-05 00:41:52 UTC (rev 916) +++ trunk/src/gtk-single-sat.c 2011-10-05 00:45:25 UTC (rev 917) @@ -700,7 +700,7 @@ case SINGLE_SAT_FIELD_ORBIT: - buff = g_strdup_printf ("%lu", sat->orbit); + buff = g_strdup_printf ("%ld", sat->orbit); break; Modified: trunk/src/predict-tools.h =================================================================== --- trunk/src/predict-tools.h 2011-10-05 00:41:52 UTC (rev 916) +++ trunk/src/predict-tools.h 2011-10-05 00:45:25 UTC (rev 917) @@ -46,7 +46,7 @@ gdouble max_el; /*!< Maximum elevation during pass */ gdouble aos_az; /*!< Azimuth at AOS */ gdouble los_az; /*!< Azimuth at LOS */ - guint orbit; /*!< Orbit number */ + gint orbit; /*!< Orbit number */ gdouble maxel_az; /*!< Azimuth at maximum elevation */ gchar vis[4]; /*!< Visibility string, e.g. VSE, -S-, V-- */ GSList *details; /*!< List of pass_detail_t entries */ @@ -78,7 +78,7 @@ gdouble phase; gdouble footprint; sat_vis_t vis; - guint orbit; + gint orbit; } pass_detail_t; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-05 00:41:58
|
Revision: 916 http://gpredict.svn.sourceforge.net/gpredict/?rev=916&view=rev Author: aa1vs Date: 2011-10-05 00:41:52 +0000 (Wed, 05 Oct 2011) Log Message: ----------- Eliminate compiler warning. Modified Paths: -------------- trunk/src/gtk-rot-ctrl.c Modified: trunk/src/gtk-rot-ctrl.c =================================================================== --- trunk/src/gtk-rot-ctrl.c 2011-10-03 10:27:48 UTC (rev 915) +++ trunk/src/gtk-rot-ctrl.c 2011-10-05 00:41:52 UTC (rev 916) @@ -1444,7 +1444,7 @@ /** \brief Compute if a pass is flipped or not. this is a function of the rotator and the particular pass. */ static gboolean is_flipped_pass (pass_t * pass,rot_az_type_t type){ - gdouble max_az,min_az; + gdouble max_az = 0,min_az = 0; gdouble caz,last_az=pass->aos_az; guint num,i; pass_detail_t *detail; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |