Thread: [Gpredict-svn] SF.net SVN: gpredict:[89] trunk/src/gtk-sat-module.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2008-09-06 13:18:22
|
Revision: 89
http://gpredict.svn.sourceforge.net/gpredict/?rev=89&view=rev
Author: csete
Date: 2008-09-06 13:18:31 +0000 (Sat, 06 Sep 2008)
Log Message:
-----------
Include radio controller into module controller cycle.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2008-09-06 12:22:17 UTC (rev 88)
+++ trunk/src/gtk-sat-module.c 2008-09-06 13:18:31 UTC (rev 89)
@@ -64,6 +64,7 @@
#include "gtk-polar-view.h"
#include "gtk-single-sat.h"
#include "gtk-met.h"
+#include "gtk-rig-ctrl.h"
#include "gtk-rot-ctrl.h"
//#ifdef G_OS_WIN32
@@ -869,6 +870,8 @@
update_child (mod->child_3, mod->tmgCdnum);
/* send notice to radio and rotator controller */
+ if (mod->rigctrl)
+ gtk_rig_ctrl_update (GTK_RIG_CTRL (mod->rigctrl), mod->tmgCdnum);
if (mod->rotctrl)
gtk_rot_ctrl_update (GTK_ROT_CTRL (mod->rotctrl), mod->tmgCdnum);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-25 22:22:11
|
Revision: 158
http://gpredict.svn.sourceforge.net/gpredict/?rev=158&view=rev
Author: csete
Date: 2008-10-25 21:44:36 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
Use real or simulated time for pass predictions.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2008-10-25 21:20:54 UTC (rev 157)
+++ trunk/src/gtk-sat-module.c 2008-10-25 21:44:36 UTC (rev 158)
@@ -506,8 +506,9 @@
module->satellites,
module->qth,
0);
- break;
+ break;
+
default:
sat_log_log (SAT_LOG_LEVEL_BUG,
_("%s:%d: Invalid child type (%d)\nUsing GtkSatList..."),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-05-01 17:55:37
|
Revision: 281
http://gpredict.svn.sourceforge.net/gpredict/?rev=281&view=rev
Author: csete
Date: 2009-05-01 17:55:29 +0000 (Fri, 01 May 2009)
Log Message:
-----------
Fixed indent.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2009-05-01 16:41:45 UTC (rev 280)
+++ trunk/src/gtk-sat-module.c 2009-05-01 17:55:29 UTC (rev 281)
@@ -75,17 +75,17 @@
static void gtk_sat_module_init (GtkSatModule *module);
static void gtk_sat_module_destroy (GtkObject *object);
static void gtk_sat_module_read_cfg_data (GtkSatModule *module,
- const gchar *cfgfile);
+ const gchar *cfgfile);
static void gtk_sat_module_load_sats (GtkSatModule *module);
/* static gboolean gtk_sat_module_sats_are_equal (gconstpointer a, */
-/* gconstpointer b); */
+/* gconstpointer b); */
static gboolean gtk_sat_module_timeout_cb (gpointer module);
static void gtk_sat_module_update_sat (gpointer key,
- gpointer val,
- gpointer data);
+ gpointer val,
+ gpointer data);
static void gtk_sat_module_popup_cb (GtkWidget *button,
- gpointer data);
+ gpointer data);
static void update_header (GtkSatModule *module);
static void update_child (GtkWidget *child, gdouble tstamp);
@@ -105,47 +105,47 @@
GType
gtk_sat_module_get_type ()
{
- static GType gtk_sat_module_type = 0;
+ static GType gtk_sat_module_type = 0;
- if (!gtk_sat_module_type) {
- static const GTypeInfo gtk_sat_module_info = {
- sizeof (GtkSatModuleClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gtk_sat_module_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GtkSatModule),
- 5, /* n_preallocs */
- (GInstanceInitFunc) gtk_sat_module_init,
- };
+ if (!gtk_sat_module_type) {
+ static const GTypeInfo gtk_sat_module_info = {
+ sizeof (GtkSatModuleClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) gtk_sat_module_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GtkSatModule),
+ 5, /* n_preallocs */
+ (GInstanceInitFunc) gtk_sat_module_init,
+ };
- gtk_sat_module_type = g_type_register_static (GTK_TYPE_VBOX,
- "GtkSatModule",
- >k_sat_module_info,
- 0);
- }
+ gtk_sat_module_type = g_type_register_static (GTK_TYPE_VBOX,
+ "GtkSatModule",
+ >k_sat_module_info,
+ 0);
+ }
- return gtk_sat_module_type;
+ return gtk_sat_module_type;
}
static void
gtk_sat_module_class_init (GtkSatModuleClass *class)
{
- GObjectClass *gobject_class;
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
+ GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
+ GtkWidgetClass *widget_class;
+ GtkContainerClass *container_class;
- gobject_class = G_OBJECT_CLASS (class);
- object_class = (GtkObjectClass*) class;
- widget_class = (GtkWidgetClass*) class;
- container_class = (GtkContainerClass*) class;
+ gobject_class = G_OBJECT_CLASS (class);
+ object_class = (GtkObjectClass*) class;
+ widget_class = (GtkWidgetClass*) class;
+ container_class = (GtkContainerClass*) class;
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (class);
- object_class->destroy = gtk_sat_module_destroy;
+ object_class->destroy = gtk_sat_module_destroy;
}
@@ -155,43 +155,43 @@
gtk_sat_module_init (GtkSatModule *module)
{
- /* initialise data structures */
- module->win = NULL;
+ /* initialise data structures */
+ module->win = NULL;
- module->qth = g_try_new0 (qth_t, 1);
- module->qth->lat = 0.0;
- module->qth->lon = 0.0;
- module->qth->alt = 0;
+ module->qth = g_try_new0 (qth_t, 1);
+ module->qth->lat = 0.0;
+ module->qth->lon = 0.0;
+ module->qth->alt = 0;
- module->satellites = g_hash_table_new_full (g_int_hash,
- g_int_equal,
- g_free,
- g_free);
-
+ module->satellites = g_hash_table_new_full (g_int_hash,
+ g_int_equal,
+ g_free,
+ g_free);
+
module->rotctrlwin = NULL;
module->rotctrl = NULL;
module->rigctrlwin = NULL;
- module->state = GTK_SAT_MOD_STATE_DOCKED;
- module->busy = FALSE;
+ module->state = GTK_SAT_MOD_STATE_DOCKED;
+ module->busy = FALSE;
- module->layout = GTK_SAT_MOD_LAYOUT_1;
- module->view_1 = GTK_SAT_MOD_VIEW_MAP;
- module->view_2 = GTK_SAT_MOD_VIEW_POLAR;
- module->view_3 = GTK_SAT_MOD_VIEW_SINGLE;
+ module->layout = GTK_SAT_MOD_LAYOUT_1;
+ module->view_1 = GTK_SAT_MOD_VIEW_MAP;
+ module->view_2 = GTK_SAT_MOD_VIEW_POLAR;
+ module->view_3 = GTK_SAT_MOD_VIEW_SINGLE;
- module->vpanedpos = -1;
- module->hpanedpos = -1;
+ module->vpanedpos = -1;
+ module->hpanedpos = -1;
module->timerid = 0;
- module->throttle = 1;
- module->rtNow = 0.0;
- module->rtPrev = 0.0;
- module->tmgActive = FALSE;
- module->tmgPdnum = 0.0;
- module->tmgCdnum = 0.0;
- module->tmgReset = FALSE;
+ module->throttle = 1;
+ module->rtNow = 0.0;
+ module->rtPrev = 0.0;
+ module->tmgActive = FALSE;
+ module->tmgPdnum = 0.0;
+ module->tmgCdnum = 0.0;
+ module->tmgReset = FALSE;
}
@@ -199,18 +199,18 @@
static void
gtk_sat_module_destroy (GtkObject *object)
{
- GtkSatModule *module = GTK_SAT_MODULE (object);
+ GtkSatModule *module = GTK_SAT_MODULE (object);
- /* stop timeout */
- if (module->timerid > 0)
- g_source_remove (module->timerid);
+ /* stop timeout */
+ if (module->timerid > 0)
+ g_source_remove (module->timerid);
- /* destroy time controller */
- if (module->tmgActive) {
- gtk_widget_destroy (module->tmgWin);
- module->tmgActive = FALSE;
- }
+ /* destroy time controller */
+ if (module->tmgActive) {
+ gtk_widget_destroy (module->tmgWin);
+ module->tmgActive = FALSE;
+ }
/* destroy radio and rotator controllers */
if (module->rigctrlwin) {
@@ -221,31 +221,31 @@
}
/* clean up QTH */
- if (module->qth) {
- gtk_sat_data_free_qth (module->qth);
- module->qth = NULL;
- }
+ if (module->qth) {
+ gtk_sat_data_free_qth (module->qth);
+ module->qth = NULL;
+ }
/* clean up satellites */
- if (module->satellites) {
- g_hash_table_destroy (module->satellites);
- module->satellites = NULL;
- }
+ if (module->satellites) {
+ g_hash_table_destroy (module->satellites);
+ module->satellites = NULL;
+ }
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/* static void dump_data(gpointer key, */
-/* gpointer value, */
-/* gpointer user_data) */
+/* gpointer value, */
+/* gpointer user_data) */
/* { */
-/* gint *catnum = key; */
+/* gint *catnum = key; */
-/* g_print ("SATELLITE: %5d\t%s\t%d\n", */
-/* *catnum, */
-/* SAT(value)->tle.sat_name, */
-/* SAT(value)->flags); */
+/* g_print ("SATELLITE: %5d\t%s\t%d\n", */
+/* *catnum, */
+/* SAT(value)->tle.sat_name, */
+/* SAT(value)->flags); */
/* } */
/**** FIXME: Program goes into infinite loop when there is something
@@ -253,115 +253,115 @@
GtkWidget *
gtk_sat_module_new (const gchar *cfgfile)
{
- GtkWidget *widget;
- GtkWidget *butbox;
+ GtkWidget *widget;
+ GtkWidget *butbox;
- /* Read configuration data.
- If cfgfile is not existing or is NULL, start the wizard
- in order to create a new configuration.
- */
- if ((cfgfile == NULL) || !g_file_test (cfgfile, G_FILE_TEST_EXISTS)) {
+ /* Read configuration data.
+ If cfgfile is not existing or is NULL, start the wizard
+ in order to create a new configuration.
+ */
+ if ((cfgfile == NULL) || !g_file_test (cfgfile, G_FILE_TEST_EXISTS)) {
- sat_log_log (SAT_LOG_LEVEL_BUG,
- _("%s: Module %s is not valid."),
- __FUNCTION__, cfgfile);
+ sat_log_log (SAT_LOG_LEVEL_BUG,
+ _("%s: Module %s is not valid."),
+ __FUNCTION__, cfgfile);
- return NULL;
- }
+ return NULL;
+ }
- /* create module widget */
- widget = g_object_new (GTK_TYPE_SAT_MODULE, NULL);
+ /* create module widget */
+ widget = g_object_new (GTK_TYPE_SAT_MODULE, NULL);
- g_signal_connect (widget, "realize",
- G_CALLBACK (fix_child_allocations), NULL);
+ g_signal_connect (widget, "realize",
+ G_CALLBACK (fix_child_allocations), NULL);
- /* load configuration; note that this will also set the module name */
- gtk_sat_module_read_cfg_data (GTK_SAT_MODULE (widget), cfgfile);
+ /* load configuration; note that this will also set the module name */
+ gtk_sat_module_read_cfg_data (GTK_SAT_MODULE (widget), cfgfile);
- /* module state */
- if ((g_key_file_has_key (GTK_SAT_MODULE (widget)->cfgdata,
- MOD_CFG_GLOBAL_SECTION,
- MOD_CFG_STATE, NULL)) &&
- sat_cfg_get_bool (SAT_CFG_BOOL_MOD_STATE)) {
+ /* module state */
+ if ((g_key_file_has_key (GTK_SAT_MODULE (widget)->cfgdata,
+ MOD_CFG_GLOBAL_SECTION,
+ MOD_CFG_STATE, NULL)) &&
+ sat_cfg_get_bool (SAT_CFG_BOOL_MOD_STATE)) {
- GTK_SAT_MODULE (widget)->state =
- g_key_file_get_integer (GTK_SAT_MODULE (widget)->cfgdata,
- MOD_CFG_GLOBAL_SECTION,
- MOD_CFG_STATE, NULL);
- }
- else {
- GTK_SAT_MODULE (widget)->state = GTK_SAT_MOD_STATE_DOCKED;
- }
+ GTK_SAT_MODULE (widget)->state =
+ g_key_file_get_integer (GTK_SAT_MODULE (widget)->cfgdata,
+ MOD_CFG_GLOBAL_SECTION,
+ MOD_CFG_STATE, NULL);
+ }
+ else {
+ GTK_SAT_MODULE (widget)->state = GTK_SAT_MOD_STATE_DOCKED;
+ }
- /* initialise time keeping vars to current time */
- GTK_SAT_MODULE (widget)->rtNow = get_current_daynum ();
- GTK_SAT_MODULE (widget)->rtPrev = get_current_daynum ();
- GTK_SAT_MODULE (widget)->tmgPdnum = get_current_daynum ();
- GTK_SAT_MODULE (widget)->tmgCdnum = get_current_daynum ();
+ /* initialise time keeping vars to current time */
+ GTK_SAT_MODULE (widget)->rtNow = get_current_daynum ();
+ GTK_SAT_MODULE (widget)->rtPrev = get_current_daynum ();
+ GTK_SAT_MODULE (widget)->tmgPdnum = get_current_daynum ();
+ GTK_SAT_MODULE (widget)->tmgCdnum = get_current_daynum ();
- /* load satellites */
- gtk_sat_module_load_sats (GTK_SAT_MODULE (widget));
-
- /* create buttons */
- GTK_SAT_MODULE (widget)->popup_button =
- gpredict_mini_mod_button ("gpredict-mod-popup.png",
- _("Module options / shortcuts"));
- g_signal_connect (GTK_SAT_MODULE (widget)->popup_button, "clicked",
- G_CALLBACK (gtk_sat_module_popup_cb), widget);
+ /* load satellites */
+ gtk_sat_module_load_sats (GTK_SAT_MODULE (widget));
+
+ /* create buttons */
+ GTK_SAT_MODULE (widget)->popup_button =
+ gpredict_mini_mod_button ("gpredict-mod-popup.png",
+ _("Module options / shortcuts"));
+ g_signal_connect (GTK_SAT_MODULE (widget)->popup_button, "clicked",
+ G_CALLBACK (gtk_sat_module_popup_cb), widget);
- GTK_SAT_MODULE (widget)->close_button =
- gpredict_mini_mod_button ("gpredict-mod-close.png",
- _("Close this module."));
- g_signal_connect (GTK_SAT_MODULE (widget)->close_button, "clicked",
- G_CALLBACK (gtk_sat_module_close_cb), widget);
+ GTK_SAT_MODULE (widget)->close_button =
+ gpredict_mini_mod_button ("gpredict-mod-close.png",
+ _("Close this module."));
+ g_signal_connect (GTK_SAT_MODULE (widget)->close_button, "clicked",
+ G_CALLBACK (gtk_sat_module_close_cb), widget);
- /* create header; header should not be updated more than
- once pr. second.
- */
- GTK_SAT_MODULE (widget)->header = gtk_label_new (NULL);
- GTK_SAT_MODULE (widget)->head_count = 0;
- GTK_SAT_MODULE (widget)->head_timeout =
- (GTK_SAT_MODULE(widget)->timeout > 1000 ? 1 :
- (guint) floor (1000/GTK_SAT_MODULE(widget)->timeout));
+ /* create header; header should not be updated more than
+ once pr. second.
+ */
+ GTK_SAT_MODULE (widget)->header = gtk_label_new (NULL);
+ GTK_SAT_MODULE (widget)->head_count = 0;
+ GTK_SAT_MODULE (widget)->head_timeout =
+ (GTK_SAT_MODULE(widget)->timeout > 1000 ? 1 :
+ (guint) floor (1000/GTK_SAT_MODULE(widget)->timeout));
- /* Event timeout
- Update every minute FIXME: user configurable
- */
- GTK_SAT_MODULE (widget)->event_timeout =
- (GTK_SAT_MODULE(widget)->timeout > 60000 ? 1 :
- (guint) floor (60000/GTK_SAT_MODULE(widget)->timeout));
- /* force update the first time */
- GTK_SAT_MODULE (widget)->event_count = GTK_SAT_MODULE (widget)->event_timeout;
+ /* Event timeout
+ Update every minute FIXME: user configurable
+ */
+ GTK_SAT_MODULE (widget)->event_timeout =
+ (GTK_SAT_MODULE(widget)->timeout > 60000 ? 1 :
+ (guint) floor (60000/GTK_SAT_MODULE(widget)->timeout));
+ /* force update the first time */
+ GTK_SAT_MODULE (widget)->event_count = GTK_SAT_MODULE (widget)->event_timeout;
- butbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (butbox),
- GTK_SAT_MODULE (widget)->header,
- FALSE, FALSE, 10);
- gtk_box_pack_end (GTK_BOX (butbox),
- GTK_SAT_MODULE (widget)->close_button,
- FALSE, FALSE, 0);
- gtk_box_pack_end (GTK_BOX (butbox),
- GTK_SAT_MODULE (widget)->popup_button,
- FALSE, FALSE, 0);
+ butbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (butbox),
+ GTK_SAT_MODULE (widget)->header,
+ FALSE, FALSE, 10);
+ gtk_box_pack_end (GTK_BOX (butbox),
+ GTK_SAT_MODULE (widget)->close_button,
+ FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (butbox),
+ GTK_SAT_MODULE (widget)->popup_button,
+ FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (widget), butbox, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (widget), gtk_hseparator_new (), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (widget), butbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (widget), gtk_hseparator_new (), FALSE, FALSE, 0);
- create_module_layout (GTK_SAT_MODULE (widget));
+ create_module_layout (GTK_SAT_MODULE (widget));
- gtk_widget_show_all (widget);
+ gtk_widget_show_all (widget);
- /* start timeout */
- GTK_SAT_MODULE(widget)->timerid = g_timeout_add (GTK_SAT_MODULE(widget)->timeout,
- gtk_sat_module_timeout_cb,
- widget);
-
+ /* start timeout */
+ GTK_SAT_MODULE(widget)->timerid = g_timeout_add (GTK_SAT_MODULE(widget)->timeout,
+ gtk_sat_module_timeout_cb,
+ widget);
+
- return widget;
+ return widget;
}
@@ -374,156 +374,156 @@
create_module_layout (GtkSatModule *module)
{
- switch (module->layout) {
-
- /* one child, no setup needed here */
- case GTK_SAT_MOD_LAYOUT_1:
- module->child_1 = create_view (module, 1);
- module->child_2 = NULL;
- module->child_3 = NULL;
- gtk_container_add (GTK_CONTAINER (module), module->child_1);
- break;
+ switch (module->layout) {
+
+ /* one child, no setup needed here */
+ case GTK_SAT_MOD_LAYOUT_1:
+ module->child_1 = create_view (module, 1);
+ module->child_2 = NULL;
+ module->child_3 = NULL;
+ gtk_container_add (GTK_CONTAINER (module), module->child_1);
+ break;
- /* two children, we need a vpaned
- child_1 on top */
- case GTK_SAT_MOD_LAYOUT_2:
- module->vpaned = gtk_vpaned_new ();
- gtk_container_add (GTK_CONTAINER (module), module->vpaned);
+ /* two children, we need a vpaned
+ child_1 on top */
+ case GTK_SAT_MOD_LAYOUT_2:
+ module->vpaned = gtk_vpaned_new ();
+ gtk_container_add (GTK_CONTAINER (module), module->vpaned);
- module->child_1 = create_view (module, 1);
- module->child_2 = create_view (module, 2);
- module->child_3 = NULL;
+ module->child_1 = create_view (module, 1);
+ module->child_2 = create_view (module, 2);
+ module->child_3 = NULL;
- gtk_paned_pack1 (GTK_PANED (module->vpaned),
- module->child_1, TRUE, TRUE);
- gtk_paned_pack2 (GTK_PANED (module->vpaned),
- module->child_2, TRUE, TRUE);
+ gtk_paned_pack1 (GTK_PANED (module->vpaned),
+ module->child_1, TRUE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (module->vpaned),
+ module->child_2, TRUE, TRUE);
- break;
+ break;
- /* one child on top, two at the bottom */
- case GTK_SAT_MOD_LAYOUT_3:
- module->vpaned = gtk_vpaned_new ();
- module->hpaned = gtk_hpaned_new ();
- gtk_container_add (GTK_CONTAINER (module), module->vpaned);
- gtk_paned_pack2 (GTK_PANED (module->vpaned),
- module->hpaned,
- TRUE, TRUE);
+ /* one child on top, two at the bottom */
+ case GTK_SAT_MOD_LAYOUT_3:
+ module->vpaned = gtk_vpaned_new ();
+ module->hpaned = gtk_hpaned_new ();
+ gtk_container_add (GTK_CONTAINER (module), module->vpaned);
+ gtk_paned_pack2 (GTK_PANED (module->vpaned),
+ module->hpaned,
+ TRUE, TRUE);
- module->child_1 = create_view (module, 1);
- module->child_2 = create_view (module, 2);
- module->child_3 = create_view (module, 3);
+ module->child_1 = create_view (module, 1);
+ module->child_2 = create_view (module, 2);
+ module->child_3 = create_view (module, 3);
- gtk_paned_pack1 (GTK_PANED (module->vpaned),
- module->child_1, TRUE, TRUE);
- gtk_paned_pack1 (GTK_PANED (module->hpaned),
- module->child_2, TRUE, TRUE);
- gtk_paned_pack2 (GTK_PANED (module->hpaned),
- module->child_3, TRUE, TRUE);
+ gtk_paned_pack1 (GTK_PANED (module->vpaned),
+ module->child_1, TRUE, TRUE);
+ gtk_paned_pack1 (GTK_PANED (module->hpaned),
+ module->child_2, TRUE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (module->hpaned),
+ module->child_3, TRUE, TRUE);
- break;
+ break;
- /* two childre on top, on at the bottom */
- case GTK_SAT_MOD_LAYOUT_4:
- module->vpaned = gtk_vpaned_new ();
- module->hpaned = gtk_hpaned_new ();
- gtk_container_add (GTK_CONTAINER (module), module->vpaned);
- gtk_paned_pack1 (GTK_PANED (module->vpaned),
- module->hpaned,
- TRUE, TRUE);
+ /* two childre on top, on at the bottom */
+ case GTK_SAT_MOD_LAYOUT_4:
+ module->vpaned = gtk_vpaned_new ();
+ module->hpaned = gtk_hpaned_new ();
+ gtk_container_add (GTK_CONTAINER (module), module->vpaned);
+ gtk_paned_pack1 (GTK_PANED (module->vpaned),
+ module->hpaned,
+ TRUE, TRUE);
- module->child_1 = create_view (module, 1);
- module->child_2 = create_view (module, 2);
- module->child_3 = create_view (module, 3);
+ module->child_1 = create_view (module, 1);
+ module->child_2 = create_view (module, 2);
+ module->child_3 = create_view (module, 3);
- gtk_paned_pack1 (GTK_PANED (module->hpaned),
- module->child_1, TRUE, TRUE);
- gtk_paned_pack2 (GTK_PANED (module->hpaned),
- module->child_2, TRUE, TRUE);
- gtk_paned_pack2 (GTK_PANED (module->vpaned),
- module->child_3, TRUE, TRUE);
+ gtk_paned_pack1 (GTK_PANED (module->hpaned),
+ module->child_1, TRUE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (module->hpaned),
+ module->child_2, TRUE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (module->vpaned),
+ module->child_3, TRUE, TRUE);
- break;
+ break;
- default:
- sat_log_log (SAT_LOG_LEVEL_BUG,
- _("%s:%d: Invalid module layout (%d)"),
- __FILE__, __LINE__, module->layout);
- break;
+ default:
+ sat_log_log (SAT_LOG_LEVEL_BUG,
+ _("%s:%d: Invalid module layout (%d)"),
+ __FILE__, __LINE__, module->layout);
+ break;
- }
+ }
}
static GtkWidget *
create_view (GtkSatModule *module, guint num)
{
- GtkWidget *view;
- gtk_sat_mod_view_t viewt = GTK_SAT_MOD_VIEW_LIST;
+ GtkWidget *view;
+ gtk_sat_mod_view_t viewt = GTK_SAT_MOD_VIEW_LIST;
- /* get view type */
- switch (num) {
- case 1:
- viewt = module->view_1;
- break;
- case 2:
- viewt = module->view_2;
- break;
- case 3:
- viewt = module->view_3;
- break;
- default:
- sat_log_log (SAT_LOG_LEVEL_BUG,
- _("%s:%d: Invalid child number (%d)"),
- __FILE__, __LINE__, num);
- break;
- }
+ /* get view type */
+ switch (num) {
+ case 1:
+ viewt = module->view_1;
+ break;
+ case 2:
+ viewt = module->view_2;
+ break;
+ case 3:
+ viewt = module->view_3;
+ break;
+ default:
+ sat_log_log (SAT_LOG_LEVEL_BUG,
+ _("%s:%d: Invalid child number (%d)"),
+ __FILE__, __LINE__, num);
+ break;
+ }
- /* create the corresponding child widget */
- switch (viewt) {
+ /* create the corresponding child widget */
+ switch (viewt) {
- case GTK_SAT_MOD_VIEW_LIST:
- view = gtk_sat_list_new (module->cfgdata,
- module->satellites,
- module->qth,
- 0);
- break;
+ case GTK_SAT_MOD_VIEW_LIST:
+ view = gtk_sat_list_new (module->cfgdata,
+ module->satellites,
+ module->qth,
+ 0);
+ break;
- case GTK_SAT_MOD_VIEW_MAP:
- view = gtk_sat_map_new (module->cfgdata,
- module->satellites,
- module->qth);
- break;
+ case GTK_SAT_MOD_VIEW_MAP:
+ view = gtk_sat_map_new (module->cfgdata,
+ module->satellites,
+ module->qth);
+ break;
- case GTK_SAT_MOD_VIEW_POLAR:
- view = gtk_polar_view_new (module->cfgdata,
- module->satellites,
- module->qth);
- break;
+ case GTK_SAT_MOD_VIEW_POLAR:
+ view = gtk_polar_view_new (module->cfgdata,
+ module->satellites,
+ module->qth);
+ break;
- case GTK_SAT_MOD_VIEW_SINGLE:
- view = gtk_single_sat_new (module->cfgdata,
- module->satellites,
- module->qth,
- 0);
+ case GTK_SAT_MOD_VIEW_SINGLE:
+ view = gtk_single_sat_new (module->cfgdata,
+ module->satellites,
+ module->qth,
+ 0);
break;
- default:
- sat_log_log (SAT_LOG_LEVEL_BUG,
- _("%s:%d: Invalid child type (%d)\nUsing GtkSatList..."),
- __FILE__, __LINE__, num);
+ default:
+ sat_log_log (SAT_LOG_LEVEL_BUG,
+ _("%s:%d: Invalid child type (%d)\nUsing GtkSatList..."),
+ __FILE__, __LINE__, num);
- view = gtk_sat_list_new (module->cfgdata,
- module->satellites,
- module->qth,
- 0);
- break;
+ view = gtk_sat_list_new (module->cfgdata,
+ module->satellites,
+ module->qth,
+ 0);
+ break;
- }
+ }
- return view;
+ return view;
}
@@ -535,120 +535,120 @@
static void
gtk_sat_module_read_cfg_data (GtkSatModule *module, const gchar *cfgfile)
{
- gchar *buffer = NULL;
- gchar *qthfile;
- gchar **buffv;
- GError *error = NULL;
+ gchar *buffer = NULL;
+ gchar *qthfile;
+ gchar **buffv;
+ GError *error = NULL;
- module->cfgdata = g_key_file_new ();
- g_key_file_set_list_separator (module->cfgdata, ';');
+ module->cfgdata = g_key_file_new ();
+ g_key_file_set_list_separator (module->cfgdata, ';');
- /* Bail out with error message if data can not be read */
- if (!g_key_file_load_from_file (module->cfgdata, cfgfile,
- G_KEY_FILE_KEEP_COMMENTS, &error)) {
+ /* Bail out with error message if data can not be read */
+ if (!g_key_file_load_from_file (module->cfgdata, cfgfile,
+ G_KEY_FILE_KEEP_COMMENTS, &error)) {
- g_key_file_free (module->cfgdata);
+ g_key_file_free (module->cfgdata);
- sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("%s: Could not load config data from %s (%s)."),
- __FUNCTION__, cfgfile, error->message);
-
- g_clear_error (&error);
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s: Could not load config data from %s (%s)."),
+ __FUNCTION__, cfgfile, error->message);
+
+ g_clear_error (&error);
- return;
- }
+ return;
+ }
- /* debug message */
- sat_log_log (SAT_LOG_LEVEL_DEBUG,
- _("%s: Reading configuration from %s"),
- __FUNCTION__, cfgfile);
+ /* debug message */
+ sat_log_log (SAT_LOG_LEVEL_DEBUG,
+ _("%s: Reading configuration from %s"),
+ __FUNCTION__, cfgfile);
- /* set module name */
- buffer = g_path_get_basename (cfgfile);
- buffv = g_strsplit (buffer, ".mod", 0);
- module->name = g_strdup (buffv[0]);
- g_free (buffer);
- g_strfreev(buffv);
+ /* set module name */
+ buffer = g_path_get_basename (cfgfile);
+ buffv = g_strsplit (buffer, ".mod", 0);
+ module->name = g_strdup (buffv[0]);
+ g_free (buffer);
+ g_strfreev(buffv);
- /* get qth file */
- buffer = mod_cfg_get_str (module->cfgdata,
- MOD_CFG_GLOBAL_SECTION,
- MOD_CFG_QTH_FILE_KEY,
- SAT_CFG_STR_DEF_QTH);
+ /* get qth file */
+ buffer = mod_cfg_get_str (module->cfgdata,
+ MOD_CFG_GLOBAL_SECTION,
+ MOD_CFG_QTH_FILE_KEY,
+ SAT_CFG_STR_DEF_QTH);
- qthfile = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S,
- ".gpredict2", G_DIR_SEPARATOR_S,
- buffer, NULL);
- /* load QTH data */
- if (!gtk_sat_data_read_qth (qthfile, module->qth)) {
+ qthfile = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S,
+ ".gpredict2", G_DIR_SEPARATOR_S,
+ buffer, NULL);
+ /* load QTH data */
+ if (!gtk_sat_data_read_qth (qthfile, module->qth)) {
- /* QTH file was not found for some reason */
- g_free (buffer);
- g_free (qthfile);
+ /* QTH file was not found for some reason */
+ g_free (buffer);
+ g_free (qthfile);
- /* remove cfg key */
- g_key_file_remove_key (module->cfgdata,
- MOD_CFG_GLOBAL_SECTION,
- MOD_CFG_QTH_FILE_KEY,
- NULL);
+ /* remove cfg key */
+ g_key_file_remove_key (module->cfgdata,
+ MOD_CFG_GLOBAL_SECTION,
+ MOD_CFG_QTH_FILE_KEY,
+ NULL);
- /* save modified cfg data to file */
- mod_cfg_save (module->name, module->cfgdata);
+ /* save modified cfg data to file */
+ mod_cfg_save (module->name, module->cfgdata);
- /* try SAT_CFG_STR_DEF_QTH */
- buffer = sat_cfg_get_str (SAT_CFG_STR_DEF_QTH);
- qthfile = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S,
- ".gpredict2", G_DIR_SEPARATOR_S,
- buffer, NULL);
+ /* try SAT_CFG_STR_DEF_QTH */
+ buffer = sat_cfg_get_str (SAT_CFG_STR_DEF_QTH);
+ qthfile = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S,
+ ".gpredict2", G_DIR_SEPARATOR_S,
+ buffer, NULL);
- if (!gtk_sat_data_read_qth (qthfile, module->qth)) {
+ if (!gtk_sat_data_read_qth (qthfile, module->qth)) {
- sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("%s: Can not load default QTH file %s; using built-in defaults"),
- __FUNCTION__, buffer);
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s: Can not load default QTH file %s; using built-in defaults"),
+ __FUNCTION__, buffer);
- /* settings are really screwed up; we need some safe values here */
- module->qth->name = g_strdup (_("Error"));
- module->qth->loc = g_strdup (_("Error"));
- module->qth->lat = 0.0;
- module->qth->lon = 0.0;
- module->qth->alt = 0;
- }
- }
+ /* settings are really screwed up; we need some safe values here */
+ module->qth->name = g_strdup (_("Error"));
+ module->qth->loc = g_strdup (_("Error"));
+ module->qth->lat = 0.0;
+ module->qth->lon = 0.0;
+ module->qth->alt = 0;
+ }
+ }
- g_free (buffer);
- g_free (qthfile);
+ g_free (buffer);
+ g_free (qthfile);
- /* get timeout value */
- module->timeout = mod_cfg_get_int (module->cfgdata,
- MOD_CFG_GLOBAL_SECTION,
- MOD_CFG_TIMEOUT_KEY,
- SAT_CFG_INT_MODULE_TIMEOUT);
+ /* get timeout value */
+ module->timeout = mod_cfg_get_int (module->cfgdata,
+ MOD_CFG_GLOBAL_SECTION,
+ MO...
[truncated message content] |
|
From: <cs...@us...> - 2009-08-06 13:25:00
|
Revision: 370
http://gpredict.svn.sourceforge.net/gpredict/?rev=370&view=rev
Author: csete
Date: 2009-08-06 13:24:48 +0000 (Thu, 06 Aug 2009)
Log Message:
-----------
Migrated to new user configuration.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2009-08-06 12:32:31 UTC (rev 369)
+++ trunk/src/gtk-sat-module.c 2009-08-06 13:24:48 UTC (rev 370)
@@ -537,6 +537,7 @@
{
gchar *buffer = NULL;
gchar *qthfile;
+ gchar *confdir;
gchar **buffv;
GError *error = NULL;
@@ -576,9 +577,9 @@
MOD_CFG_QTH_FILE_KEY,
SAT_CFG_STR_DEF_QTH);
- qthfile = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S,
- ".gpredict2", G_DIR_SEPARATOR_S,
- buffer, NULL);
+ confdir = get_user_conf_dir ();
+ qthfile = g_strconcat (confdir, G_DIR_SEPARATOR_S, buffer, NULL);
+
/* load QTH data */
if (!qth_data_read (qthfile, module->qth)) {
@@ -597,9 +598,7 @@
/* try SAT_CFG_STR_DEF_QTH */
buffer = sat_cfg_get_str (SAT_CFG_STR_DEF_QTH);
- qthfile = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S,
- ".gpredict2", G_DIR_SEPARATOR_S,
- buffer, NULL);
+ qthfile = g_strconcat (confdir, G_DIR_SEPARATOR_S, buffer, NULL);
if (!qth_data_read (qthfile, module->qth)) {
@@ -617,6 +616,7 @@
}
g_free (buffer);
+ g_free (confdir);
g_free (qthfile);
@@ -1261,14 +1261,9 @@
gtk_sat_module_close_cb (NULL, module);
- cfgfile = g_strconcat (g_get_home_dir (),
- G_DIR_SEPARATOR_S,
- ".gpredict2",
- G_DIR_SEPARATOR_S,
- "modules",
- G_DIR_SEPARATOR_S,
- name, ".mod",
- NULL);
+ gchar *confdir = get_modules_dir ();
+ cfgfile = g_strconcat (confdir, G_DIR_SEPARATOR_S, name, ".mod", NULL);
+ g_free (confdir);
module = GTK_SAT_MODULE (gtk_sat_module_new (cfgfile));
module->state = laststate;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-08-06 13:29:47
|
Revision: 371
http://gpredict.svn.sourceforge.net/gpredict/?rev=371&view=rev
Author: csete
Date: 2009-08-06 13:29:37 +0000 (Thu, 06 Aug 2009)
Log Message:
-----------
Fix implicit declaration warning.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2009-08-06 13:24:48 UTC (rev 370)
+++ trunk/src/gtk-sat-module.c 2009-08-06 13:29:37 UTC (rev 371)
@@ -65,6 +65,7 @@
#include "gtk-single-sat.h"
#include "gtk-rig-ctrl.h"
#include "gtk-rot-ctrl.h"
+#include "compat.h"
//#ifdef G_OS_WIN32
//# include "libc_internal.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-11-30 14:31:58
|
Revision: 533
http://gpredict.svn.sourceforge.net/gpredict/?rev=533&view=rev
Author: csete
Date: 2009-11-30 14:31:50 +0000 (Mon, 30 Nov 2009)
Log Message:
-----------
Include new GtkEventList widget.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2009-11-30 14:24:21 UTC (rev 532)
+++ trunk/src/gtk-sat-module.c 2009-11-30 14:31:50 UTC (rev 533)
@@ -63,6 +63,7 @@
#include "gtk-sat-map.h"
#include "gtk-polar-view.h"
#include "gtk-single-sat.h"
+#include "gtk-event-list.h"
#include "gtk-rig-ctrl.h"
#include "gtk-rot-ctrl.h"
#include "compat.h"
@@ -434,6 +435,13 @@
0);
break;
+ case GTK_SAT_MOD_VIEW_EVENT:
+ view = gtk_event_list_new (module->cfgdata,
+ module->satellites,
+ module->qth,
+ 0);
+ break;
+
default:
sat_log_log (SAT_LOG_LEVEL_BUG,
_("%s:%d: Invalid child type (%d). Using GtkSatList."),
@@ -846,6 +854,11 @@
gtk_single_sat_update (child);
}
+ else if (IS_GTK_EVENT_LIST(child)) {
+ GTK_EVENT_LIST (child)->tstamp = tstamp;
+ gtk_event_list_update (child);
+ }
+
else {
sat_log_log (SAT_LOG_LEVEL_BUG,
_("%f:%d: Unknown child type"),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa...@us...> - 2011-03-24 23:39:00
|
Revision: 791
http://gpredict.svn.sourceforge.net/gpredict/?rev=791&view=rev
Author: aa1vs
Date: 2011-03-24 23:38:54 +0000 (Thu, 24 Mar 2011)
Log Message:
-----------
Update Copyright
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2011-03-23 00:53:02 UTC (rev 790)
+++ trunk/src/gtk-sat-module.c 2011-03-24 23:38:54 UTC (rev 791)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2010 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2011 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa...@us...> - 2011-05-26 21:54:19
|
Revision: 826
http://gpredict.svn.sourceforge.net/gpredict/?rev=826&view=rev
Author: aa1vs
Date: 2011-05-26 21:54:12 +0000 (Thu, 26 May 2011)
Log Message:
-----------
Clarify comment.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2011-05-26 13:00:50 UTC (rev 825)
+++ trunk/src/gtk-sat-module.c 2011-05-26 21:54:12 UTC (rev 826)
@@ -980,12 +980,47 @@
sat->los = find_los (sat, module->qth, daynum, maxdt);
}
- /*update aos if it was known and is stale*/
+ /*
+ Update AOS and LOS for this satellite if it was known and is before
+ the current time.
+
+ daynum is the current time in the module.
+
+ The conditional aos < daynum is merely saying that aos occured
+ in the past. Therefore it cannot be the next event or aos/los
+ for that satellite.
+
+ The conditional aos > 0.0 is a short hand for saying that the
+ aos was successfully computed before. find_aos returns 0.0 when it
+ cannot find an AOS.
+
+ This code should not execute find_aos(los) if the conditional before
+ is triggered as the newly computed aos(los) should either be in
+ the future (aos > daynum) or (aos == 0 ).
+
+ Single sat/list/event/map views all use these values and they
+ should be up to date.
+
+ The above code is still required for dealing with circumstances
+ where the qth moves from someplace where the qth can have an AOS and
+ where qth does not and for satellites in parking orbits where the
+ AOS may be further than maxdt out results in aos==0.0 until the
+ next aos is closer than maxdt. It also prevents the aos from
+ being computed every pass through the module for the parking orbits.
+
+ To be completely correct, when time can move forward and backwards
+ as it can with the time controller, the time the aos/los was
+ computed should be stored and associated with aos/los. That way
+ if daynum <time_computed, the aos can be recomputed as there is
+ no assurance that the current stored aos is the next aos. As a
+ practical matter the above code handles time reversing acceptably
+ for most circumstances.
+
+ */
if (sat->aos > 0 && sat->aos < daynum) {
maxdt = (gdouble) sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD);
sat->aos = find_aos (sat, module->qth, daynum, maxdt);
}
- /*update los if it was known is stale*/
if (sat->los > 0 && sat->los < daynum) {
maxdt = (gdouble) sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD);
sat->los = find_los (sat, module->qth, daynum, maxdt);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa...@us...> - 2011-07-15 22:38:30
|
Revision: 871
http://gpredict.svn.sourceforge.net/gpredict/?rev=871&view=rev
Author: aa1vs
Date: 2011-07-15 22:38:24 +0000 (Fri, 15 Jul 2011)
Log Message:
-----------
Clean pendantic compiler warning.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2011-07-15 22:37:10 UTC (rev 870)
+++ trunk/src/gtk-sat-module.c 2011-07-15 22:38:24 UTC (rev 871)
@@ -121,6 +121,7 @@
sizeof (GtkSatModule),
5, /* n_preallocs */
(GInstanceInitFunc) gtk_sat_module_init,
+ NULL
};
gtk_sat_module_type = g_type_register_static (GTK_TYPE_VBOX,
@@ -618,7 +619,7 @@
/* number of views: we have five numbers per view (type,left,right,top,bottom) */
module->nviews = length / 5;
- module->grid = g_try_new0 (gint, length);
+ module->grid = g_try_new0 (guint, length);
/* if we cannot allocate memory for the grid zero the views out and log */
if ( module->grid != NULL ) {
@@ -959,6 +960,8 @@
geodetic_t obs_geodetic = {0,0,0,0};
gdouble maxdt;
+ (void) key; /* prevent unused parameter compiler warning */
+
g_return_if_fail ((val != NULL) && (data != NULL));
sat = SAT(val);
@@ -1100,6 +1103,7 @@
static void
gtk_sat_module_popup_cb (GtkWidget *button, gpointer data)
{
+ (void) button; /* prevent unused parameter compiler warning */
gtk_sat_module_popup (GTK_SAT_MODULE (data));
}
@@ -1125,6 +1129,8 @@
gchar *name;
gint retcode;
+ (void) button; /* prevent unused parameter compiler warning */
+
name = g_strdup (module->name);
sat_log_log (SAT_LOG_LEVEL_DEBUG,
@@ -1252,7 +1258,8 @@
gtk_sat_mod_state_t laststate;
gint w,h;
-
+ (void) button; /* prevent unused parameter compiler warning */
+
if (module->win != NULL)
toplevel = module->win;
else
@@ -1426,6 +1433,9 @@
static gboolean empty (gpointer key, gpointer val, gpointer data)
{
+ (void) key; /* prevent unused parameter compiler warning */
+ (void) val; /* prevent unused parameter compiler warning */
+ (void) data; /* prevent unused parameter compiler warning */
/* TRUE => sat removed from hash table */
return TRUE;
}
@@ -1517,7 +1527,7 @@
void gtk_sat_module_select_sat (GtkSatModule *module, gint catnum)
{
GtkWidget *child;
- gint i;
+ guint i;
/* select satellite in each child */
@@ -1557,6 +1567,8 @@
*/
void gtk_sat_module_reconf (GtkSatModule *module, gboolean local)
{
+ (void) module; /* prevent unused parameter compiler warning */
+ (void) local; /* prevent unused parameter compiler warning */
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|