Thread: [Gpredict-svn] SF.net SVN: gpredict:[120] trunk/src (Page 2)
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2008-09-17 18:08:14
|
Revision: 120
http://gpredict.svn.sourceforge.net/gpredict/?rev=120&view=rev
Author: csete
Date: 2008-09-17 18:08:24 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
Added markers for target, controller and rotator.
Modified Paths:
--------------
trunk/src/gtk-polar-plot.c
trunk/src/gtk-polar-plot.h
Modified: trunk/src/gtk-polar-plot.c
===================================================================
--- trunk/src/gtk-polar-plot.c 2008-09-17 10:59:23 UTC (rev 119)
+++ trunk/src/gtk-polar-plot.c 2008-09-17 18:08:24 UTC (rev 120)
@@ -155,6 +155,7 @@
polview->qthinfo = FALSE;
polview->cursinfo = FALSE;
polview->extratick = FALSE;
+ polview->target = NULL;
}
@@ -270,6 +271,275 @@
}
+
+/** \brief Set target object position
+ * \param plot Pointer to the GtkPolarPlot widget
+ * \param az Azimuth of the target object
+ * \param el Elevation of the target object
+ *
+ * If either az or el are negative the target object will be hidden
+ */
+void gtk_polar_plot_set_target_pos (GtkPolarPlot *plot, gdouble az, gdouble el)
+{
+ GooCanvasItemModel *root;
+ gint idx;
+ gfloat x,y;
+ guint32 col;
+
+
+ if (plot == NULL)
+ return;
+
+
+ root = goo_canvas_get_root_item_model (GOO_CANVAS (plot->canvas));
+
+ if ((az < 0.0) || (el < 0.0)) {
+ if (plot->target != NULL) {
+ /* the target object is visible; delete it */
+ idx = goo_canvas_item_model_find_child (root, plot->target);
+ if (idx != -1) {
+ goo_canvas_item_model_remove_child (root, idx);
+ }
+ plot->target = NULL;
+ }
+ /* else the target object is not visible; nothing to do */
+ }
+ else {
+ /* we need to either update or create the object */
+ azel_to_xy (plot, az, el, &x, &y);
+
+ if (plot->target != NULL) {
+ /* the target object already exists; move it */
+ g_object_set (plot->target,
+ "x", x - MARKER_SIZE_HALF,
+ "y", y - MARKER_SIZE_HALF,
+ NULL);
+ }
+ else {
+ /* the target object does not exist; create it */
+ col = sat_cfg_get_int (SAT_CFG_INT_POLAR_SAT_COL);
+ plot->target = goo_canvas_rect_model_new (root,
+ x - MARKER_SIZE_HALF,
+ y - MARKER_SIZE_HALF,
+ 2*MARKER_SIZE_HALF,
+ 2*MARKER_SIZE_HALF,
+ "fill-color-rgba", col,
+ "stroke-color-rgba", col,
+ NULL);
+ }
+ }
+}
+
+
+/** \brief Set controller object position
+ * \param plot Pointer to the GtkPolarPlot widget
+ * \param az Azimuth of the controller object
+ * \param el Elevation of the controller object
+ *
+ * If either az or el are negative the controller object will be hidden
+ */
+void gtk_polar_plot_set_ctrl_pos (GtkPolarPlot *plot, gdouble az, gdouble el)
+{
+ GooCanvasItemModel *root;
+ gint idx;
+ gfloat x,y;
+ guint32 col;
+
+
+ if (plot == NULL)
+ return;
+
+
+ root = goo_canvas_get_root_item_model (GOO_CANVAS (plot->canvas));
+
+ if ((az < 0.0) || (el < 0.0)) {
+ if (plot->ctrl != NULL) {
+ /* the target object is visible; delete it */
+ idx = goo_canvas_item_model_find_child (root, plot->ctrl);
+ if (idx != -1) {
+ goo_canvas_item_model_remove_child (root, idx);
+ }
+ plot->ctrl = NULL;
+ }
+ /* else the target object is not visible; nothing to do */
+ }
+ else {
+ /* we need to either update or create the object */
+ azel_to_xy (plot, az, el, &x, &y);
+
+ if (plot->ctrl != NULL) {
+ /* the target object already exists; move it */
+ g_object_set (plot->ctrl,
+ "center_x", x,
+ "center_y", y,
+ NULL);
+ }
+ else {
+ /* the target object does not exist; create it */
+ col = sat_cfg_get_int (SAT_CFG_INT_POLAR_SAT_COL);
+ plot->ctrl = goo_canvas_ellipse_model_new (root,
+ x, y, 7, 7,
+ "fill-color-rgba", 0xFF00000F,
+ "stroke-color-rgba", col,
+ "line-width", 0.8,
+ NULL);
+ }
+ }
+
+}
+
+
+/** \brief Set rotator object position
+ * \param plot Pointer to the GtkPolarPlot widget
+ * \param az Azimuth of the rotator object
+ * \param el Elevation of the rotator object
+ *
+ * If either az or el are negative the controller object will be hidden
+ */
+void gtk_polar_plot_set_rotor_pos (GtkPolarPlot *plot, gdouble az, gdouble el)
+{
+ GooCanvasItemModel *root;
+ GooCanvasPoints *prec;
+ gint idx;
+ gfloat x,y;
+ guint32 col;
+
+
+ if (plot == NULL)
+ return;
+
+
+ root = goo_canvas_get_root_item_model (GOO_CANVAS (plot->canvas));
+
+ if ((az < 0.0) || (el <= 0.0)) {
+ if (plot->rot1 != NULL) {
+ /* the target object is visible; delete it */
+ idx = goo_canvas_item_model_find_child (root, plot->rot1);
+ if (idx != -1) {
+ goo_canvas_item_model_remove_child (root, idx);
+ }
+ plot->rot1 = NULL;
+ }
+ if (plot->rot2 != NULL) {
+ /* the target object is visible; delete it */
+ idx = goo_canvas_item_model_find_child (root, plot->rot2);
+ if (idx != -1) {
+ goo_canvas_item_model_remove_child (root, idx);
+ }
+ plot->rot2 = NULL;
+ }
+ if (plot->rot3 != NULL) {
+ /* the target object is visible; delete it */
+ idx = goo_canvas_item_model_find_child (root, plot->rot3);
+ if (idx != -1) {
+ goo_canvas_item_model_remove_child (root, idx);
+ }
+ plot->rot3 = NULL;
+ }
+ if (plot->rot4 != NULL) {
+ /* the target object is visible; delete it */
+ idx = goo_canvas_item_model_find_child (root, plot->rot4);
+ if (idx != -1) {
+ goo_canvas_item_model_remove_child (root, idx);
+ }
+ plot->rot4 = NULL;
+ }
+ }
+ else {
+ /* we need to either update or create the object */
+ azel_to_xy (plot, az, el, &x, &y);
+ col = sat_cfg_get_int (SAT_CFG_INT_POLAR_SAT_COL);
+
+
+ if (plot->rot1 != NULL) {
+ /* the target object already exists; move it */
+ prec = goo_canvas_points_new (2);
+ prec->coords[0] = x;
+ prec->coords[1] = y-4;
+ prec->coords[2] = x;
+ prec->coords[3] = y-14;
+ g_object_set (plot->rot1,
+ "points", prec,
+ NULL);
+ goo_canvas_points_unref (prec);
+ }
+ else {
+ /* the target object does not exist; create it */
+ plot->rot1 = goo_canvas_polyline_model_new_line (root,
+ x, y-4, x, y-14,
+ "fill-color-rgba", col,
+ "stroke-color-rgba", col,
+ "line-width", 1.0,
+ NULL);
+ }
+ if (plot->rot2 != NULL) {
+ /* the target object already exists; move it */
+ prec = goo_canvas_points_new (2);
+ prec->coords[0] = x+4;
+ prec->coords[1] = y;
+ prec->coords[2] = x+14;
+ prec->coords[3] = y;
+ g_object_set (plot->rot2,
+ "points", prec,
+ NULL);
+ goo_canvas_points_unref (prec);
+ }
+ else {
+ /* the target object does not exist; create it */
+ plot->rot2 = goo_canvas_polyline_model_new_line (root,
+ x+4, y, x+14, y,
+ "fill-color-rgba", col,
+ "stroke-color-rgba", col,
+ "line-width", 1.0,
+ NULL);
+ }
+ if (plot->rot3 != NULL) {
+ /* the target object already exists; move it */
+ prec = goo_canvas_points_new (2);
+ prec->coords[0] = x;
+ prec->coords[1] = y+4;
+ prec->coords[2] = x;
+ prec->coords[3] = y+14;
+ g_object_set (plot->rot3,
+ "points", prec,
+ NULL);
+ goo_canvas_points_unref (prec);
+ }
+ else {
+ /* the target object does not exist; create it */
+ plot->rot3 = goo_canvas_polyline_model_new_line (root,
+ x, y+4, x, y+14,
+ "fill-color-rgba", col,
+ "stroke-color-rgba", col,
+ "line-width", 1.0,
+ NULL);
+ }
+ if (plot->rot4 != NULL) {
+ /* the target object already exists; move it */
+ prec = goo_canvas_points_new (2);
+ prec->coords[0] = x-4;
+ prec->coords[1] = y;
+ prec->coords[2] = x-14;
+ prec->coords[3] = y;
+ g_object_set (plot->rot4,
+ "points", prec,
+ NULL);
+ goo_canvas_points_unref (prec);
+ }
+ else {
+ /* the target object does not exist; create it */
+ plot->rot4 = goo_canvas_polyline_model_new_line (root,
+ x-4, y, x-14, y,
+ "fill-color-rgba", col,
+ "stroke-color-rgba", col,
+ "line-width", 1.0,
+ NULL);
+ }
+ }
+
+}
+
+
/** \brief Show/hide time tick
* \param plot Pointer to the GtkPolarPlot widget
* \param show TRUE => show tick. FALSE => don't show
@@ -599,7 +869,9 @@
/* sky track */
if (polv->pass != NULL)
update_track (polv);
+
+
}
}
Modified: trunk/src/gtk-polar-plot.h
===================================================================
--- trunk/src/gtk-polar-plot.h 2008-09-17 10:59:23 UTC (rev 119)
+++ trunk/src/gtk-polar-plot.h 2008-09-17 18:08:24 UTC (rev 120)
@@ -91,6 +91,9 @@
pass_t *pass;
GooCanvasItemModel *track; /*!< Sky track. */
+ GooCanvasItemModel *target; /*!< Target object marker */
+ GooCanvasItemModel *ctrl; /*!< Position marker for the controller */
+ GooCanvasItemModel *rot1,*rot2,*rot3,*rot4; /*!< Position marker for the rotor */
GooCanvasItemModel *trtick[TRACK_TICK_NUM]; /*!< Time ticks along the sky track */
qth_t *qth; /*!< Pointer to current location. */
@@ -121,7 +124,9 @@
GtkWidget* gtk_polar_plot_new (qth_t *qth, pass_t *pass);
void gtk_polar_plot_set_pass (GtkPolarPlot *plot, pass_t *pass);
-
+void gtk_polar_plot_set_target_pos (GtkPolarPlot *plot, gdouble az, gdouble el);
+void gtk_polar_plot_set_ctrl_pos (GtkPolarPlot *plot, gdouble az, gdouble el);
+void gtk_polar_plot_set_rotor_pos (GtkPolarPlot *plot, gdouble az, gdouble el);
void gtk_polar_plot_show_time_ticks (GtkPolarPlot *plot, gboolean show);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-09-17 18:09:54
|
Revision: 121
http://gpredict.svn.sourceforge.net/gpredict/?rev=121&view=rev
Author: csete
Date: 2008-09-17 18:10:05 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
Disable debug prints.
Modified Paths:
--------------
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-rig-ctrl.h
trunk/src/gtk-rot-ctrl.c
trunk/src/gtk-rot-ctrl.h
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2008-09-17 18:08:24 UTC (rev 120)
+++ trunk/src/gtk-rig-ctrl.c 2008-09-17 18:10:05 UTC (rev 121)
@@ -731,6 +731,7 @@
gtk_widget_set_sensitive (ctrl->DevSel, FALSE);
ctrl->engaged = TRUE;
+ ctrl->wrops = 0;
}
}
@@ -784,6 +785,8 @@
sat_log_log (SAT_LOG_LEVEL_ERROR,
_("%s: MAX_ERROR_COUNT (%d) reached. Disengaging device!"),
__FUNCTION__, MAX_ERROR_COUNT);
+
+ //g_print ("ERROR. WROPS = %d\n", ctrl->wrops);
}
else {
/* increment error counter */
@@ -792,6 +795,7 @@
}
}
+ //g_print (" WROPS = %d\n", ctrl->wrops);
ctrl->busy = FALSE;
@@ -871,6 +875,8 @@
shutdown (sock, SHUT_RDWR);
close (sock);
+ ctrl->wrops++;
+
return TRUE;
}
Modified: trunk/src/gtk-rig-ctrl.h
===================================================================
--- trunk/src/gtk-rig-ctrl.h 2008-09-17 18:08:24 UTC (rev 120)
+++ trunk/src/gtk-rig-ctrl.h 2008-09-17 18:10:05 UTC (rev 121)
@@ -89,6 +89,10 @@
gboolean busy; /*!< Flag set when control algorithm is busy. */
gboolean engaged; /*!< Flag indicating that rig device is engaged. */
gint errcnt; /*!< Error counter. */
+
+ /* debug related */
+ guint wrops;
+ guint rdops;
};
struct _GtkRigCtrlClass
Modified: trunk/src/gtk-rot-ctrl.c
===================================================================
--- trunk/src/gtk-rot-ctrl.c 2008-09-17 18:08:24 UTC (rev 120)
+++ trunk/src/gtk-rot-ctrl.c 2008-09-17 18:10:05 UTC (rev 121)
@@ -760,9 +760,11 @@
{
GtkRotCtrl *ctrl = GTK_ROT_CTRL (data);
- if (gtk_toggle_button_get_active (button)) {
- gtk_widget_set_sensitive (ctrl->DevSel, FALSE);
- ctrl->engaged = TRUE;
+ if (!gtk_toggle_button_get_active (button)) {
+ gtk_widget_set_sensitive (ctrl->DevSel, TRUE);
+ ctrl->engaged = FALSE;
+ gtk_label_set_text (GTK_LABEL (ctrl->AzRead), "---");
+ gtk_label_set_text (GTK_LABEL (ctrl->ElRead), "---");
}
else {
if (ctrl->conf == NULL) {
@@ -772,11 +774,11 @@
__FUNCTION__);
return;
}
- gtk_widget_set_sensitive (ctrl->DevSel, TRUE);
- ctrl->engaged = FALSE;
+ gtk_widget_set_sensitive (ctrl->DevSel, FALSE);
+ ctrl->engaged = TRUE;
- gtk_label_set_text (GTK_LABEL (ctrl->AzRead), "---");
- gtk_label_set_text (GTK_LABEL (ctrl->ElRead), "---");
+ ctrl->wrops = 0;
+ ctrl->rdops = 0;
}
}
@@ -838,11 +840,15 @@
text = g_strdup_printf ("%.2f\302\260", rotel);
gtk_label_set_text (GTK_LABEL (ctrl->ElRead), text);
g_free (text);
+
+ gtk_polar_plot_set_rotor_pos (GTK_POLAR_PLOT (ctrl->plot), rotaz, rotel);
}
else {
gtk_label_set_text (GTK_LABEL (ctrl->AzRead), _("ERROR"));
gtk_label_set_text (GTK_LABEL (ctrl->ElRead), _("ERROR"));
error = TRUE;
+
+ gtk_polar_plot_set_rotor_pos (GTK_POLAR_PLOT (ctrl->plot), -1.0, -1.0);
}
/* if tolerance exceeded */
@@ -870,17 +876,30 @@
_("%s: MAX_ERROR_COUNT (%d) reached. Disengaging device!"),
__FUNCTION__, MAX_ERROR_COUNT);
ctrl->errcnt = 0;
+ //g_print ("ERROR. WROPS: %d RDOPS: %d\n", ctrl->wrops, ctrl->rdops);
}
else {
/* increment error counter */
ctrl->errcnt++;
}
}
-
- /* TODO: update polar plot */
}
+ else {
+ /* ensure rotor pos is not visible on plot */
+ gtk_polar_plot_set_rotor_pos (GTK_POLAR_PLOT (ctrl->plot), -1.0, -1.0);
+ }
+ /* update target object on polar plot */
+ if (ctrl->target != NULL) {
+ gtk_polar_plot_set_target_pos (GTK_POLAR_PLOT (ctrl->plot), ctrl->target->az, ctrl->target->el);
+ }
+
+ /* update controller circle on polar plot */
+ gtk_polar_plot_set_ctrl_pos (GTK_POLAR_PLOT (ctrl->plot),
+ gtk_rot_knob_get_value (GTK_ROT_KNOB (ctrl->AzSet)),
+ gtk_rot_knob_get_value (GTK_ROT_KNOB (ctrl->ElSet)));
+
ctrl->busy = FALSE;
return TRUE;
@@ -997,6 +1016,9 @@
shutdown (sock, SHUT_RDWR);
close (sock);
+ ctrl->wrops++;
+ ctrl->rdops++;
+
return TRUE;
}
@@ -1074,12 +1096,14 @@
__FILE__, __LINE__, written, size);
}
- g_print ("SZ:%d WR:%d AZ:%s EL:%s STR:%s", size, written, azstr, elstr, buff);
+ //g_print ("SZ:%d WR:%d AZ:%s EL:%s STR:%s", size, written, azstr, elstr, buff);
g_free (buff);
shutdown (sock, SHUT_RDWR);
close (sock);
+
+ ctrl->wrops++;
return TRUE;
}
Modified: trunk/src/gtk-rot-ctrl.h
===================================================================
--- trunk/src/gtk-rot-ctrl.h 2008-09-17 18:08:24 UTC (rev 120)
+++ trunk/src/gtk-rot-ctrl.h 2008-09-17 18:10:05 UTC (rev 121)
@@ -93,6 +93,10 @@
gboolean engaged; /*!< Flag indicating that rotor device is engaged. */
gint errcnt; /*!< Error counter. */
+
+ /* debug related */
+ guint wrops;
+ guint rdops;
};
struct _GtkRotCtrlClass
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-09-17 18:41:44
|
Revision: 122
http://gpredict.svn.sourceforge.net/gpredict/?rev=122&view=rev
Author: csete
Date: 2008-09-17 18:41:40 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
Updated year.
Modified Paths:
--------------
trunk/src/about.c
trunk/src/about.h
trunk/src/compat.c
trunk/src/compat.h
trunk/src/config-keys.h
trunk/src/defaults.h
trunk/src/first-time.c
trunk/src/first-time.h
trunk/src/gpredict-help.c
trunk/src/gpredict-help.h
trunk/src/gpredict-url-hook.c
trunk/src/gpredict-url-hook.h
trunk/src/gpredict-utils.c
trunk/src/gpredict-utils.h
trunk/src/gtk-azel-plot.c
trunk/src/gtk-azel-plot.h
trunk/src/gtk-freq-knob.c
trunk/src/gtk-freq-knob.h
trunk/src/gtk-met.c
trunk/src/gtk-met.h
trunk/src/gtk-polar-plot.c
trunk/src/gtk-polar-plot.h
trunk/src/gtk-polar-view-popup.c
trunk/src/gtk-polar-view-popup.h
trunk/src/gtk-polar-view.c
trunk/src/gtk-polar-view.h
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-rig-ctrl.h
trunk/src/gtk-rot-ctrl.c
trunk/src/gtk-rot-ctrl.h
trunk/src/gtk-rot-knob.c
trunk/src/gtk-rot-knob.h
trunk/src/gtk-sat-data.c
trunk/src/gtk-sat-data.h
trunk/src/gtk-sat-list-col-sel.c
trunk/src/gtk-sat-list-col-sel.h
trunk/src/gtk-sat-list.c
trunk/src/gtk-sat-list.h
trunk/src/gtk-sat-map-ground-track.c
trunk/src/gtk-sat-map-ground-track.h
trunk/src/gtk-sat-map-popup.c
trunk/src/gtk-sat-map-popup.h
trunk/src/gtk-sat-map.c
trunk/src/gtk-sat-map.h
trunk/src/gtk-sat-module-popup.c
trunk/src/gtk-sat-module-popup.h
trunk/src/gtk-sat-module-tmg.c
trunk/src/gtk-sat-module-tmg.h
trunk/src/gtk-sat-module.c
trunk/src/gtk-sat-module.h
trunk/src/gtk-sat-tree.c
trunk/src/gtk-sat-tree.h
trunk/src/gtk-single-sat.c
trunk/src/gtk-single-sat.h
trunk/src/gtk-sky-glance.c
trunk/src/gtk-sky-glance.h
trunk/src/gui.c
trunk/src/gui.h
trunk/src/loc-tree.c
trunk/src/loc-tree.h
trunk/src/locator.c
trunk/src/locator.h
trunk/src/main.c
trunk/src/map-selector.c
trunk/src/map-selector.h
trunk/src/menubar.c
trunk/src/menubar.h
trunk/src/mod-cfg-get-param.c
trunk/src/mod-cfg-get-param.h
trunk/src/mod-cfg.c
trunk/src/mod-cfg.h
trunk/src/mod-mgr.c
trunk/src/mod-mgr.h
trunk/src/orbit-tools.c
trunk/src/orbit-tools.h
trunk/src/pass-popup-menu.c
trunk/src/pass-popup-menu.h
trunk/src/pass-to-txt.c
trunk/src/pass-to-txt.h
trunk/src/predict-tools.c
trunk/src/predict-tools.h
trunk/src/qth-editor.c
trunk/src/qth-editor.h
trunk/src/radio-conf.c
trunk/src/radio-conf.h
trunk/src/rdv.c
trunk/src/rdv.h
trunk/src/rig-io.c
trunk/src/rig-io.h
trunk/src/rotor-conf.c
trunk/src/rotor-conf.h
trunk/src/sat-cfg.c
trunk/src/sat-cfg.h
trunk/src/sat-log-browser.c
trunk/src/sat-log-browser.h
trunk/src/sat-log.c
trunk/src/sat-log.h
trunk/src/sat-monitor.c
trunk/src/sat-monitor.h
trunk/src/sat-pass-dialogs.c
trunk/src/sat-pass-dialogs.h
trunk/src/sat-popup-menu.c
trunk/src/sat-popup-menu.h
trunk/src/sat-pref-conditions.c
trunk/src/sat-pref-conditions.h
trunk/src/sat-pref-debug.c
trunk/src/sat-pref-debug.h
trunk/src/sat-pref-formats.c
trunk/src/sat-pref-formats.h
trunk/src/sat-pref-general.c
trunk/src/sat-pref-general.h
trunk/src/sat-pref-help.c
trunk/src/sat-pref-help.h
trunk/src/sat-pref-interfaces.c
trunk/src/sat-pref-interfaces.h
trunk/src/sat-pref-layout.c
trunk/src/sat-pref-layout.h
trunk/src/sat-pref-list-view.c
trunk/src/sat-pref-list-view.h
trunk/src/sat-pref-map-view.c
trunk/src/sat-pref-map-view.h
trunk/src/sat-pref-modules.c
trunk/src/sat-pref-modules.h
trunk/src/sat-pref-multi-pass.c
trunk/src/sat-pref-multi-pass.h
trunk/src/sat-pref-polar-view.c
trunk/src/sat-pref-polar-view.h
trunk/src/sat-pref-predict.c
trunk/src/sat-pref-predict.h
trunk/src/sat-pref-qth-data.h
trunk/src/sat-pref-qth-editor.c
trunk/src/sat-pref-qth-editor.h
trunk/src/sat-pref-qth.c
trunk/src/sat-pref-qth.h
trunk/src/sat-pref-refresh.c
trunk/src/sat-pref-refresh.h
trunk/src/sat-pref-rig-data.h
trunk/src/sat-pref-rig-editor.c
trunk/src/sat-pref-rig-editor.h
trunk/src/sat-pref-rig.c
trunk/src/sat-pref-rig.h
trunk/src/sat-pref-rot-data.h
trunk/src/sat-pref-rot-editor.c
trunk/src/sat-pref-rot-editor.h
trunk/src/sat-pref-rot.c
trunk/src/sat-pref-rot.h
trunk/src/sat-pref-single-pass.c
trunk/src/sat-pref-single-pass.h
trunk/src/sat-pref-single-sat.c
trunk/src/sat-pref-single-sat.h
trunk/src/sat-pref-sky-at-glance.c
trunk/src/sat-pref-sky-at-glance.h
trunk/src/sat-pref-tle.c
trunk/src/sat-pref-tle.h
trunk/src/sat-pref.c
trunk/src/sat-pref.h
trunk/src/sat-vis.c
trunk/src/sat-vis.h
trunk/src/save-pass.c
trunk/src/save-pass.h
trunk/src/sgpsdp/sgp4sdp4.c
trunk/src/sgpsdp/sgp_in.c
trunk/src/sgpsdp/test-001.c
trunk/src/sgpsdp/test-002.c
trunk/src/time-tools.c
trunk/src/time-tools.h
trunk/src/tle-lookup.c
trunk/src/tle-lookup.h
trunk/src/tle-tools.c
trunk/src/tle-tools.h
trunk/src/tle-update.c
trunk/src/tle-update.h
Modified: trunk/src/about.c
===================================================================
--- trunk/src/about.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/about.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -53,7 +53,7 @@
};
-const gchar license[] = N_("Copyright (C) 2001-2007 Alexandru Csete OZ9AEC\n"\
+const gchar license[] = N_("Copyright (C) 2001-2008 Alexandru Csete OZ9AEC\n"\
"Contact: oz9aec at googlemail.com\n\n"\
"Gpredict is free software; you can redistribute it and "\
"mofdify it under the terms of the GNU General Public License "\
Modified: trunk/src/about.h
===================================================================
--- trunk/src/about.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/about.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/compat.c
===================================================================
--- trunk/src/compat.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/compat.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/compat.h
===================================================================
--- trunk/src/compat.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/compat.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/config-keys.h
===================================================================
--- trunk/src/config-keys.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/config-keys.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/defaults.h
===================================================================
--- trunk/src/defaults.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/defaults.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/first-time.c
===================================================================
--- trunk/src/first-time.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/first-time.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/first-time.h
===================================================================
--- trunk/src/first-time.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/first-time.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gpredict-help.c
===================================================================
--- trunk/src/gpredict-help.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gpredict-help.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gpredict-help.h
===================================================================
--- trunk/src/gpredict-help.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gpredict-help.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gpredict-url-hook.c
===================================================================
--- trunk/src/gpredict-url-hook.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gpredict-url-hook.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gpredict-url-hook.h
===================================================================
--- trunk/src/gpredict-url-hook.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gpredict-url-hook.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gpredict-utils.c
===================================================================
--- trunk/src/gpredict-utils.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gpredict-utils.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gpredict-utils.h
===================================================================
--- trunk/src/gpredict-utils.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gpredict-utils.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-azel-plot.c
===================================================================
--- trunk/src/gtk-azel-plot.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-azel-plot.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-azel-plot.h
===================================================================
--- trunk/src/gtk-azel-plot.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-azel-plot.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-freq-knob.c
===================================================================
--- trunk/src/gtk-freq-knob.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-freq-knob.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-freq-knob.h
===================================================================
--- trunk/src/gtk-freq-knob.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-freq-knob.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-met.c
===================================================================
--- trunk/src/gtk-met.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-met.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-met.h
===================================================================
--- trunk/src/gtk-met.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-met.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-polar-plot.c
===================================================================
--- trunk/src/gtk-polar-plot.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-polar-plot.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-polar-plot.h
===================================================================
--- trunk/src/gtk-polar-plot.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-polar-plot.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-polar-view-popup.c
===================================================================
--- trunk/src/gtk-polar-view-popup.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-polar-view-popup.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-polar-view-popup.h
===================================================================
--- trunk/src/gtk-polar-view-popup.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-polar-view-popup.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-polar-view.c
===================================================================
--- trunk/src/gtk-polar-view.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-polar-view.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-polar-view.h
===================================================================
--- trunk/src/gtk-polar-view.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-polar-view.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-rig-ctrl.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-rig-ctrl.h
===================================================================
--- trunk/src/gtk-rig-ctrl.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-rig-ctrl.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-rot-ctrl.c
===================================================================
--- trunk/src/gtk-rot-ctrl.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-rot-ctrl.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-rot-ctrl.h
===================================================================
--- trunk/src/gtk-rot-ctrl.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-rot-ctrl.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-rot-knob.c
===================================================================
--- trunk/src/gtk-rot-knob.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-rot-knob.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-rot-knob.h
===================================================================
--- trunk/src/gtk-rot-knob.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-rot-knob.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-data.c
===================================================================
--- trunk/src/gtk-sat-data.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-data.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-data.h
===================================================================
--- trunk/src/gtk-sat-data.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-data.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-list-col-sel.c
===================================================================
--- trunk/src/gtk-sat-list-col-sel.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-list-col-sel.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-list-col-sel.h
===================================================================
--- trunk/src/gtk-sat-list-col-sel.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-list-col-sel.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-list.c
===================================================================
--- trunk/src/gtk-sat-list.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-list.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-list.h
===================================================================
--- trunk/src/gtk-sat-list.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-list.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-map-ground-track.c
===================================================================
--- trunk/src/gtk-sat-map-ground-track.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-map-ground-track.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-map-ground-track.h
===================================================================
--- trunk/src/gtk-sat-map-ground-track.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-map-ground-track.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-map-popup.c
===================================================================
--- trunk/src/gtk-sat-map-popup.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-map-popup.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-map-popup.h
===================================================================
--- trunk/src/gtk-sat-map-popup.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-map-popup.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-map.c
===================================================================
--- trunk/src/gtk-sat-map.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-map.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Copyright (C) 2006-2007 William J Beksi, KC2EXL.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-map.h
===================================================================
--- trunk/src/gtk-sat-map.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-map.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Copyright (C) 2006-2007 William J Beksi, KC2EXL.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-module-popup.c
===================================================================
--- trunk/src/gtk-sat-module-popup.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-module-popup.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-module-popup.h
===================================================================
--- trunk/src/gtk-sat-module-popup.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-module-popup.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-module-tmg.c
===================================================================
--- trunk/src/gtk-sat-module-tmg.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-module-tmg.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-module-tmg.h
===================================================================
--- trunk/src/gtk-sat-module-tmg.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-module-tmg.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-module.c 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-module.h
===================================================================
--- trunk/src/gtk-sat-module.h 2008-09-17 18:10:05 UTC (rev 121)
+++ trunk/src/gtk-sat-module.h 2008-09-17 18:41:40 UTC (rev 122)
@@ -2,7 +2,7 @@
/*
Gpredict: Real-time satellite tracking and orbit prediction program
- Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC.
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz...@gm...>
Modified: trunk/src/gtk-sat-tree.c
===================================================================
--- trunk/src/gtk-sat-tree.c 2008-09-17 18:10:05 UTC (rev 121)
+++...
[truncated message content] |
|
From: <cs...@us...> - 2008-09-17 21:02:20
|
Revision: 128
http://gpredict.svn.sourceforge.net/gpredict/?rev=128&view=rev
Author: csete
Date: 2008-09-17 21:02:29 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
Got rid og rdv and GtkMet dependency.
Modified Paths:
--------------
trunk/src/gtk-sat-module.c
trunk/src/menubar.c
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2008-09-17 20:30:05 UTC (rev 127)
+++ trunk/src/gtk-sat-module.c 2008-09-17 21:02:29 UTC (rev 128)
@@ -63,7 +63,6 @@
#include "gtk-sat-map.h"
#include "gtk-polar-view.h"
#include "gtk-single-sat.h"
-#include "gtk-met.h"
#include "gtk-rig-ctrl.h"
#include "gtk-rot-ctrl.h"
@@ -509,13 +508,6 @@
0);
break;
- case GTK_SAT_MOD_VIEW_MET:
- view = gtk_met_new (module->cfgdata,
- module->satellites,
- module->qth);
-
- break;
-
default:
sat_log_log (SAT_LOG_LEVEL_BUG,
_("%s:%d: Invalid child type (%d)\nUsing GtkSatList..."),
@@ -924,11 +916,6 @@
gtk_single_sat_update (child);
}
- else if (IS_GTK_MET(child)) {
- GTK_MET (child)->tstamp = tstamp;
- gtk_met_update (child);
- }
-
else {
sat_log_log (SAT_LOG_LEVEL_BUG,
_("%f:%d: Unknown child type"),
@@ -1002,18 +989,8 @@
*/
/* check that we have a GtkMet child */
/**** FIXME: GtkMet may not be child 2.... */
- if ((sat->tle.catnr == 99122) &&
- (IS_GTK_MET (module->child_2) &&
- (module->tmgCdnum - GTK_MET (module->child_2)->launch) < 0.002778)) {
+ if G_UNLIKELY(FALSE) {
- sat->ssplat = 28.51;
- sat->ssplon = -80.55;
- sat->alt = 0.0;
- sat->footprint = 500.0;
- sat->phase = 0.0;
- sat->orbit = 0;
- sat->range = obs_set.range;
- sat->range_rate = 0.0;
}
else {
@@ -1572,9 +1549,6 @@
else if (IS_GTK_SAT_LIST (widget)) {
}
- else if (IS_GTK_MET (widget)) {
- gtk_met_reload_sats (widget, module->satellites);
- }
else {
sat_log_log (SAT_LOG_LEVEL_BUG,
Modified: trunk/src/menubar.c
===================================================================
--- trunk/src/menubar.c 2008-09-17 20:30:05 UTC (rev 127)
+++ trunk/src/menubar.c 2008-09-17 21:02:29 UTC (rev 128)
@@ -50,7 +50,6 @@
#include "gpredict-help.h"
#include "tle-update.h"
#include "compat.h"
-#include "rdv.h"
#include "menubar.h"
#include "config-keys.h"
#ifdef HAVE_CONFIG_H
@@ -66,7 +65,6 @@
static void menubar_open_mod_cb (GtkWidget *widget, gpointer data);
static void menubar_message_log (GtkWidget *widget, gpointer data);
static void menubar_app_exit_cb (GtkWidget *widget, gpointer data);
-static void menubar_rdv_cb (GtkWidget *widget, gpointer data);
static void menubar_freq_edit_cb (GtkWidget *widget, gpointer data);
static void menubar_pref_cb (GtkWidget *widget, gpointer data);
static void menubar_tle_net_cb (GtkWidget *widget, gpointer data);
@@ -127,8 +125,6 @@
G_CALLBACK (menubar_window_cb)},
{ "Predict", GTK_STOCK_DND_MULTIPLE, N_("Advanced Predict"), NULL,
N_("Open advanced pass predictor"), G_CALLBACK (menubar_predict_cb)},
- { "Rdv", NULL, N_("_Space Shuttle Tool"), NULL,
- N_("Open the space shuttle tool window"), G_CALLBACK (menubar_rdv_cb)},
/* Help menu */
{ "GettingStarted", GTK_STOCK_EXECUTE, N_("Getting Started"), NULL,
@@ -172,8 +168,6 @@
" <menu action='ToolsMenu'>"
" <menuitem action='Window'/>"
" <menuitem action='Predict'/>"
-" <separator/>"
-" <menuitem action='Rdv'/>"
/* " <separator/>" */
/* " <menuitem action='Lab'/>" */
" </menu>"
@@ -740,13 +734,7 @@
-static void
-menubar_rdv_cb (GtkWidget *widget, gpointer data)
-{
- rdv_open ();
-}
-
static void
menubar_window_cb (GtkWidget *widget, gpointer data)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-09-17 23:23:35
|
Revision: 133
http://gpredict.svn.sourceforge.net/gpredict/?rev=133&view=rev
Author: csete
Date: 2008-09-17 23:23:46 +0000 (Wed, 17 Sep 2008)
Log Message:
-----------
Added supprot for azimuth type.
Modified Paths:
--------------
trunk/src/sat-pref-rot-data.h
trunk/src/sat-pref-rot.c
Modified: trunk/src/sat-pref-rot-data.h
===================================================================
--- trunk/src/sat-pref-rot-data.h 2008-09-17 22:39:36 UTC (rev 132)
+++ trunk/src/sat-pref-rot-data.h 2008-09-17 23:23:46 UTC (rev 133)
@@ -37,6 +37,7 @@
ROT_LIST_COL_MAXAZ, /*!< Upper Az limit. */
ROT_LIST_COL_MINEL, /*!< Lower El limit. */
ROT_LIST_COL_MAXEL, /*!< Upper El limit. */
+ ROT_LIST_COL_AZTYPE, /*!< Azimuth type. */
ROT_LIST_COL_NUM /*!< The number of fields in the list. */
} rotor_list_col_t;
Modified: trunk/src/sat-pref-rot.c
===================================================================
--- trunk/src/sat-pref-rot.c 2008-09-17 22:39:36 UTC (rev 132)
+++ trunk/src/sat-pref-rot.c 2008-09-17 23:23:46 UTC (rev 133)
@@ -61,6 +61,12 @@
GtkTreeIter *iter,
gpointer column);
+static void render_aztype (GtkTreeViewColumn *col,
+ GtkCellRenderer *renderer,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer column);
+
/* global objects */
static GtkWidget *addbutton;
static GtkWidget *editbutton;
@@ -101,6 +107,7 @@
rotlist = gtk_tree_view_new ();
+ gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (rotlist), TRUE);
model = create_and_fill_model ();
gtk_tree_view_set_model (GTK_TREE_VIEW (rotlist), model);
@@ -160,13 +167,24 @@
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Max El"), renderer,
- "text", ROT_LIST_COL_MAXAZ,
+ "text", ROT_LIST_COL_MAXEL,
NULL);
gtk_tree_view_column_set_cell_data_func (column, renderer,
render_angle,
GUINT_TO_POINTER(ROT_LIST_COL_MAXEL),
NULL);
gtk_tree_view_insert_column (GTK_TREE_VIEW (rotlist), column, -1);
+
+ /* Az type */
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (_("Azimuth Type"), renderer,
+ "text", ROT_LIST_COL_AZTYPE,
+ NULL);
+ gtk_tree_view_column_set_cell_data_func (column, renderer,
+ render_aztype,
+ GUINT_TO_POINTER(ROT_LIST_COL_AZTYPE),
+ NULL);
+ gtk_tree_view_insert_column (GTK_TREE_VIEW (rotlist), column, -1);
}
@@ -191,7 +209,8 @@
G_TYPE_DOUBLE, // Min Az
G_TYPE_DOUBLE, // Max Az
G_TYPE_DOUBLE, // Min El
- G_TYPE_DOUBLE // Max El
+ G_TYPE_DOUBLE, // Max El
+ G_TYPE_INT // Az type
);
/* open configuration directory */
@@ -221,6 +240,7 @@
ROT_LIST_COL_MAXAZ, conf.maxaz,
ROT_LIST_COL_MINEL, conf.minel,
ROT_LIST_COL_MAXEL, conf.maxel,
+ ROT_LIST_COL_AZTYPE, conf.aztype,
-1);
sat_log_log (SAT_LOG_LEVEL_DEBUG,
@@ -332,6 +352,7 @@
.maxaz = 360,
.minel = 0,
.maxel = 90,
+ .aztype = ROT_AZ_TYPE_360,
};
@@ -375,6 +396,7 @@
ROT_LIST_COL_MAXAZ, &conf.maxaz,
ROT_LIST_COL_MINEL, &conf.minel,
ROT_LIST_COL_MAXEL, &conf.maxel,
+ ROT_LIST_COL_AZTYPE, &conf.aztype,
-1);
rotor_conf_save (&conf);
@@ -415,6 +437,7 @@
.maxaz = 360,
.minel = 0,
.maxel = 90,
+ .aztype = ROT_AZ_TYPE_360,
};
/* run rot conf editor */
@@ -432,6 +455,7 @@
ROT_LIST_COL_MAXAZ, conf.maxaz,
ROT_LIST_COL_MINEL, conf.minel,
ROT_LIST_COL_MAXEL, conf.maxel,
+ ROT_LIST_COL_AZTYPE, conf.aztype,
-1);
g_free (conf.name);
@@ -465,6 +489,7 @@
.maxaz = 360,
.minel = 0,
.maxel = 90,
+ .aztype = ROT_AZ_TYPE_360,
};
@@ -493,6 +518,7 @@
ROT_LIST_COL_MAXAZ, &conf.maxaz,
ROT_LIST_COL_MINEL, &conf.minel,
ROT_LIST_COL_MAXEL, &conf.maxel,
+ ROT_LIST_COL_AZTYPE, &conf.aztype,
-1);
}
@@ -524,6 +550,7 @@
ROT_LIST_COL_MAXAZ, conf.maxaz,
ROT_LIST_COL_MINEL, conf.minel,
ROT_LIST_COL_MAXEL, conf.maxel,
+ ROT_LIST_COL_AZTYPE, conf.aztype,
-1);
}
@@ -609,7 +636,44 @@
}
+/** \brief Render the azimuth type.
+ * \param col Pointer to the tree view column.
+ * \param renderer Pointer to the renderer.
+ * \param model Pointer to the tree model.
+ * \param iter Pointer to the tree iterator.
+ * \param column The column number in the model.
+ *
+ */
+static void render_aztype (GtkTreeViewColumn *col,
+ GtkCellRenderer *renderer,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer column)
+{
+ gint number;
+ guint coli = GPOINTER_TO_UINT (column);
+ gchar *text;
+
+ gtk_tree_model_get (model, iter, coli, &number, -1);
+ switch (number) {
+ case ROT_AZ_TYPE_360:
+ text = g_strdup_printf ("0\302\260 \342\206\222 180\302\260 \342\206\222 360\302\260");
+ break;
+
+ case ROT_AZ_TYPE_180:
+ text = g_strdup_printf ("-180\302\260 \342\206\222 0\302\260 \342\206\222 +180\302\260");
+ break;
+
+ default:
+ text = g_strdup_printf (_("Uknown (%d)"), number);
+ break;
+ }
+
+ g_object_set (renderer, "text", text, NULL);
+ g_free (text);
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-09-20 23:54:08
|
Revision: 143
http://gpredict.svn.sourceforge.net/gpredict/?rev=143&view=rev
Author: csete
Date: 2008-09-20 23:54:02 +0000 (Sat, 20 Sep 2008)
Log Message:
-----------
Fixed bug that caused local oscillator frequency to be 0 when trying to edit a radio configuration.
Modified Paths:
--------------
trunk/src/sat-pref-rig-editor.c
trunk/src/sat-pref-rig.c
Modified: trunk/src/sat-pref-rig-editor.c
===================================================================
--- trunk/src/sat-pref-rig-editor.c 2008-09-20 23:38:50 UTC (rev 142)
+++ trunk/src/sat-pref-rig-editor.c 2008-09-20 23:54:02 UTC (rev 143)
@@ -231,7 +231,7 @@
gtk_spin_button_set_value (GTK_SPIN_BUTTON (port), 4532); /* hamlib default? */
/* lo in MHz */
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (lo), conf->lo / 1000000);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (lo), conf->lo / 1000000.0);
}
@@ -277,7 +277,7 @@
conf->port = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (port));
/* lo freq */
- conf->lo = 1000000*gtk_spin_button_get_value (GTK_SPIN_BUTTON (lo));
+ conf->lo = 1000000.0*gtk_spin_button_get_value (GTK_SPIN_BUTTON (lo));
return TRUE;
}
Modified: trunk/src/sat-pref-rig.c
===================================================================
--- trunk/src/sat-pref-rig.c 2008-09-20 23:38:50 UTC (rev 142)
+++ trunk/src/sat-pref-rig.c 2008-09-20 23:54:02 UTC (rev 143)
@@ -450,7 +450,7 @@
RIG_LIST_COL_NAME, &conf.name,
RIG_LIST_COL_HOST, &conf.host,
RIG_LIST_COL_PORT, &conf.port,
- RIG_LIST_COL_PORT, &conf.lo,
+ RIG_LIST_COL_LO, &conf.lo,
-1);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-11 21:05:15
|
Revision: 148
http://gpredict.svn.sourceforge.net/gpredict/?rev=148&view=rev
Author: csete
Date: 2008-10-11 21:05:07 +0000 (Sat, 11 Oct 2008)
Log Message:
-----------
Fixed bug 2139102 - rigctld port (minor)
Modified Paths:
--------------
trunk/src/sat-pref-rig-editor.c
trunk/src/sat-pref-rot-editor.c
Modified: trunk/src/sat-pref-rig-editor.c
===================================================================
--- trunk/src/sat-pref-rig-editor.c 2008-09-21 00:28:06 UTC (rev 147)
+++ trunk/src/sat-pref-rig-editor.c 2008-10-11 21:05:07 UTC (rev 148)
@@ -171,7 +171,8 @@
host = gtk_entry_new ();
gtk_entry_set_max_length (GTK_ENTRY (host), 50);
gtk_widget_set_tooltip_text (host,
- _("Enter the host and port where rigctld is running, e.g. 192.168.1.100:15123"));
+ _("Enter the host where rogctld is running. You can use both host name "\
+ " and IP address, e.g. 192.168.1.100"));
gtk_table_attach_defaults (GTK_TABLE (table), host, 1, 4, 1, 2);
/* port */
Modified: trunk/src/sat-pref-rot-editor.c
===================================================================
--- trunk/src/sat-pref-rot-editor.c 2008-09-21 00:28:06 UTC (rev 147)
+++ trunk/src/sat-pref-rot-editor.c 2008-10-11 21:05:07 UTC (rev 148)
@@ -176,7 +176,7 @@
gtk_entry_set_max_length (GTK_ENTRY (host), 50);
gtk_widget_set_tooltip_text (host,
_("Enter the host where rogctld is running. You can use both host name "\
- " and IP address."));
+ " and IP address, e.g. 192.168.1.100"));
gtk_table_attach_defaults (GTK_TABLE (table), host, 1, 4, 1, 2);
/* port */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-11 21:46:14
|
Revision: 149
http://gpredict.svn.sourceforge.net/gpredict/?rev=149&view=rev
Author: csete
Date: 2008-10-11 21:46:06 +0000 (Sat, 11 Oct 2008)
Log Message:
-----------
Fixed bug 2130912: Crash when no rig or no rotator are defined.
Modified Paths:
--------------
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-rot-ctrl.c
trunk/src/gtk-sat-module-popup.c
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2008-10-11 21:05:07 UTC (rev 148)
+++ trunk/src/gtk-rig-ctrl.c 2008-10-11 21:46:06 UTC (rev 149)
@@ -85,6 +85,7 @@
static gboolean get_freq (GtkRigCtrl *ctrl, gdouble *freq);
static void update_count_down (GtkRigCtrl *ctrl, gdouble t);
+static gboolean have_conf (void);
static GtkVBoxClass *parent_class = NULL;
@@ -191,6 +192,11 @@
{
GtkWidget *widget;
GtkWidget *table;
+
+ /* check that we have rot conf */
+ if (!have_conf()) {
+ return NULL;
+ }
widget = g_object_new (GTK_TYPE_RIG_CTRL, NULL);
@@ -1084,3 +1090,44 @@
g_free (cs);
}
+
+
+/** \brief Check that we have at least one .rig file */
+static gboolean have_conf ()
+{
+ GDir *dir = NULL; /* directory handle */
+ GError *error = NULL; /* error flag and info */
+ gchar *cfgdir;
+ gchar *dirname; /* directory name */
+ const gchar *filename; /* file name */
+ gint i = 0;
+
+
+ /* open configuration directory */
+ cfgdir = get_conf_dir ();
+ dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S,
+ "hwconf", NULL);
+ g_free (cfgdir);
+
+ dir = g_dir_open (dirname, 0, &error);
+ if (dir) {
+ /* read each .rig file */
+ while ((filename = g_dir_read_name (dir))) {
+
+ if (g_strrstr (filename, ".rig")) {
+ i++;
+ }
+ }
+ }
+ else {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%d: Failed to open hwconf dir (%s)"),
+ __FILE__, __LINE__, error->message);
+ g_clear_error (&error);
+ }
+
+ g_free (dirname);
+ g_dir_close (dir);
+
+ return (i > 0) ? TRUE : FALSE;
+}
Modified: trunk/src/gtk-rot-ctrl.c
===================================================================
--- trunk/src/gtk-rot-ctrl.c 2008-10-11 21:05:07 UTC (rev 148)
+++ trunk/src/gtk-rot-ctrl.c 2008-10-11 21:46:06 UTC (rev 149)
@@ -85,6 +85,8 @@
static gboolean get_pos (GtkRotCtrl *ctrl, gdouble *az, gdouble *el);
static gboolean set_pos (GtkRotCtrl *ctrl, gdouble az, gdouble el);
+static gboolean have_conf (void);
+
static GtkVBoxClass *parent_class = NULL;
static GdkColor ColBlack = { 0, 0, 0, 0};
@@ -194,6 +196,11 @@
GtkWidget *widget;
GtkWidget *table;
+ /* check that we have rot conf */
+ if (!have_conf()) {
+ return NULL;
+ }
+
widget = g_object_new (GTK_TYPE_ROT_CTRL, NULL);
/* store satellites */
@@ -490,7 +497,7 @@
dir = g_dir_open (dirname, 0, &error);
if (dir) {
- /* read each .rig file */
+ /* read each .rot file */
while ((filename = g_dir_read_name (dir))) {
if (g_strrstr (filename, ".rot")) {
@@ -1188,3 +1195,44 @@
g_free (cs);
}
+
+
+/** \brief Check that we have at least one .rot file */
+static gboolean have_conf ()
+{
+ GDir *dir = NULL; /* directory handle */
+ GError *error = NULL; /* error flag and info */
+ gchar *cfgdir;
+ gchar *dirname; /* directory name */
+ const gchar *filename; /* file name */
+ gint i = 0;
+
+
+ /* open configuration directory */
+ cfgdir = get_conf_dir ();
+ dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S,
+ "hwconf", NULL);
+ g_free (cfgdir);
+
+ dir = g_dir_open (dirname, 0, &error);
+ if (dir) {
+ /* read each .rot file */
+ while ((filename = g_dir_read_name (dir))) {
+
+ if (g_strrstr (filename, ".rot")) {
+ i++;
+ }
+ }
+ }
+ else {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%d: Failed to open hwconf dir (%s)"),
+ __FILE__, __LINE__, error->message);
+ g_clear_error (&error);
+ }
+
+ g_free (dirname);
+ g_dir_close (dir);
+
+ return (i > 0) ? TRUE : FALSE;
+}
Modified: trunk/src/gtk-sat-module-popup.c
===================================================================
--- trunk/src/gtk-sat-module-popup.c 2008-10-11 21:05:07 UTC (rev 148)
+++ trunk/src/gtk-sat-module-popup.c 2008-10-11 21:46:06 UTC (rev 149)
@@ -878,6 +878,23 @@
module->rigctrl = gtk_rig_ctrl_new (module);
+ if (module->rigctrl == NULL) {
+ /* gtk_rot_ctrl_new returned NULL becasue no rotators are configured */
+ GtkWidget *dialog;
+ dialog = gtk_message_dialog_new (GTK_WINDOW (app),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ _("You have no radio configuration!\n"\
+ "Please configure a radio first.")
+ );
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), dialog);
+ gtk_window_set_title (GTK_WINDOW (dialog), _("ERROR"));
+ gtk_widget_show_all (dialog);
+
+ return;
+ }
+
/* create a window */
module->rigctrlwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
buff = g_strdup_printf (_("Gpredict Radio Control: %s"), module->name);
@@ -934,6 +951,23 @@
module->rotctrl = gtk_rot_ctrl_new (module);
+ if (module->rotctrl == NULL) {
+ /* gtk_rot_ctrl_new returned NULL becasue no rotators are configured */
+ GtkWidget *dialog;
+ dialog = gtk_message_dialog_new (GTK_WINDOW (app),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ _("You have no rotator configuration!\n"\
+ "Please configure an antenna rotator first.")
+ );
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), dialog);
+ gtk_window_set_title (GTK_WINDOW (dialog), _("ERROR"));
+ gtk_widget_show_all (dialog);
+
+ return;
+ }
+
/* create a window */
module->rotctrlwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
buff = g_strdup_printf (_("Gpredict Rotator Control: %s"), module->name);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-24 18:10:24
|
Revision: 152
http://gpredict.svn.sourceforge.net/gpredict/?rev=152&view=rev
Author: csete
Date: 2008-10-24 18:10:19 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Added parameter for pass prediction T0.
Modified Paths:
--------------
trunk/src/sat-cfg.c
trunk/src/sat-cfg.h
Modified: trunk/src/sat-cfg.c
===================================================================
--- trunk/src/sat-cfg.c 2008-10-24 17:56:20 UTC (rev 151)
+++ trunk/src/sat-cfg.c 2008-10-24 18:10:19 UTC (rev 152)
@@ -132,7 +132,8 @@
{ "TLE", "SERVER_AUTH", FALSE},
{ "TLE", "PROXY_AUTH", FALSE},
{ "TLE", "ADD_NEW_SATS", TRUE},
- { "LOG", "KEEP_LOG_FILES", FALSE}
+ { "LOG", "KEEP_LOG_FILES", FALSE},
+ { "PREDICT", "USE_REAL_T0", FALSE}
};
Modified: trunk/src/sat-cfg.h
===================================================================
--- trunk/src/sat-cfg.h 2008-10-24 17:56:20 UTC (rev 151)
+++ trunk/src/sat-cfg.h 2008-10-24 18:10:19 UTC (rev 152)
@@ -54,7 +54,8 @@
SAT_CFG_BOOL_TLE_SERVER_AUTH, /*!< TLE server requires authentication. */
SAT_CFG_BOOL_TLE_PROXY_AUTH, /*!< Proxy requires authentication. */
SAT_CFG_BOOL_TLE_ADD_NEW, /*!< Add new satellites to database. */
- SAT_CFG_BOOL_KEEP_LOG_FILES, /*!< Whether to keep old log files */
+ SAT_CFG_BOOL_KEEP_LOG_FILES, /*!< Whether to keep old log files */
+ SAT_CFG_BOOL_PRED_USE_REAL_T0, /*!< Whether to use current time as T0 fro predictions */
SAT_CFG_BOOL_NUM /*!< Number of boolean parameters */
} sat_cfg_bool_e;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-25 17:55:09
|
Revision: 155
http://gpredict.svn.sourceforge.net/gpredict/?rev=155&view=rev
Author: csete
Date: 2008-10-25 17:55:05 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
Added start time as parameter.
Modified Paths:
--------------
trunk/src/gtk-sky-glance.c
trunk/src/gtk-sky-glance.h
Modified: trunk/src/gtk-sky-glance.c
===================================================================
--- trunk/src/gtk-sky-glance.c 2008-10-24 22:24:30 UTC (rev 154)
+++ trunk/src/gtk-sky-glance.c 2008-10-25 17:55:05 UTC (rev 155)
@@ -224,7 +224,7 @@
* \param qth Pointer to the ground station data.
*/
GtkWidget*
-gtk_sky_glance_new (GHashTable *sats, qth_t *qth)
+gtk_sky_glance_new (GHashTable *sats, qth_t *qth, gdouble ts)
{
GtkWidget *skg;
GooCanvasItemModel *root;
@@ -239,7 +239,15 @@
/* get settings */
GTK_SKY_GLANCE (skg)->numsat = g_hash_table_size (sats);
- GTK_SKY_GLANCE (skg)->ts = get_current_daynum ();
+
+ /* if ts = 0 use current time */
+ if (ts > 0.0) {
+ GTK_SKY_GLANCE (skg)->ts = ts;
+ }
+ else {
+ GTK_SKY_GLANCE (skg)->ts = get_current_daynum ();
+ }
+
GTK_SKY_GLANCE (skg)->te = GTK_SKY_GLANCE (skg)->ts +
sat_cfg_get_int (SAT_CFG_INT_SKYATGL_TIME)*(1.0/24.0);
Modified: trunk/src/gtk-sky-glance.h
===================================================================
--- trunk/src/gtk-sky-glance.h 2008-10-24 22:24:30 UTC (rev 154)
+++ trunk/src/gtk-sky-glance.h 2008-10-25 17:55:05 UTC (rev 155)
@@ -115,7 +115,7 @@
GtkType gtk_sky_glance_get_type (void);
-GtkWidget* gtk_sky_glance_new (GHashTable *sats, qth_t *qth);
+GtkWidget* gtk_sky_glance_new (GHashTable *sats, qth_t *qth, gdouble ts);
/*
void gtk_sky_glance_reconf (GtkWidget *skg);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-25 21:21:01
|
Revision: 157
http://gpredict.svn.sourceforge.net/gpredict/?rev=157&view=rev
Author: csete
Date: 2008-10-25 21:20:54 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
Use real or simulated time for pass predictions. Enabled tooltips for labels.
Modified Paths:
--------------
trunk/src/gtk-single-sat.c
trunk/src/gtk-single-sat.h
Modified: trunk/src/gtk-single-sat.c
===================================================================
--- trunk/src/gtk-single-sat.c 2008-10-25 17:55:36 UTC (rev 156)
+++ trunk/src/gtk-single-sat.c 2008-10-25 21:20:54 UTC (rev 157)
@@ -45,6 +45,9 @@
#ifdef HAVE_CONFIG_H
# include <build-config.h>
#endif
+#include "orbit-tools.h"
+#include "predict-tools.h"
+#include "sat-pass-dialogs.h"
@@ -95,7 +98,7 @@
N_("Altitude"),
N_("Velocity"),
N_("Doppler Shift @ 100MHz"),
- N_("Signal Loss @ 100MHz"),
+ N_("Signal loss @ 100MHz"),
N_("Signal Delay"),
N_("Mean Anomaly"),
N_("Orbit Phase"),
@@ -113,9 +116,10 @@
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 GtkVBoxClass *parent_class = NULL;
@@ -223,7 +227,7 @@
GTK_SINGLE_SAT (widget)->selected = 0;
GTK_SINGLE_SAT (widget)->qth = qth;
GTK_SINGLE_SAT (widget)->cfgdata = cfgdata;
-
+
/* initialise column flags */
if (fields > 0)
GTK_SINGLE_SAT (widget)->flags = fields;
@@ -281,17 +285,18 @@
gtk_table_attach (GTK_TABLE (GTK_SINGLE_SAT (widget)->table), label1,
0, 1, i, i+1,
GTK_FILL, GTK_SHRINK, 0, 0);
- /* FIXME: does not work
- tips = gtk_tooltips_new ();
- gtk_tooltips_set_tip (tips, label1, SINGLE_SAT_FIELD_HINT[i], NULL);
- */
+
label2 = gtk_label_new ("-");
gtk_misc_set_alignment (GTK_MISC (label2), 0.0, 0.5);
gtk_table_attach (GTK_TABLE (GTK_SINGLE_SAT (widget)->table), label2,
1, 2, i, i+1,
GTK_FILL, GTK_SHRINK, 0, 0);
+ /* add tooltips */
+ gtk_widget_set_tooltip_text (label1, SINGLE_SAT_FIELD_HINT[i]);
+ gtk_widget_set_tooltip_text (label2, SINGLE_SAT_FIELD_HINT[i]);
+
/* store reference */
GTK_SINGLE_SAT (widget)->labels[i] = label2;
}
@@ -341,6 +346,7 @@
ssat->counter++;
}
else {
+
/* we calculate here to avoid double calc */
if ((ssat->flags & SINGLE_SAT_FLAG_RA) ||
@@ -832,10 +838,13 @@
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_signal_connect (menuitem, "activate",
+/* g_signal_connect (menuitem, "activate",
G_CALLBACK (show_next_pass),
- gtk_widget_get_toplevel (button));
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+ gtk_widget_get_toplevel (button));*/
+ g_signal_connect (menuitem, "activate",
+ G_CALLBACK (show_next_pass_cb), data);
+
+ gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
menuitem = gtk_image_menu_item_new_with_label (_("Future passes"));
image = gtk_image_new_from_stock (GTK_STOCK_INDEX,
@@ -843,24 +852,26 @@
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_signal_connect (menuitem, "activate",
+/* g_signal_connect (menuitem, "activate",
G_CALLBACK (show_future_passes),
- gtk_widget_get_toplevel (button));
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+ gtk_widget_get_toplevel (button));*/
+ g_signal_connect (menuitem, "activate",
+ G_CALLBACK (show_next_passes_cb), data);
+ gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
/* separator */
- menuitem = gtk_separator_menu_item_new ();
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+// menuitem = gtk_separator_menu_item_new ();
+// gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
/* Alarm */
- menuitem = gtk_check_menu_item_new_with_label (_("Alarm"));
- gtk_widget_set_sensitive (menuitem, FALSE);
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+// menuitem = gtk_check_menu_item_new_with_label (_("Alarm"));
+// gtk_widget_set_sensitive (menuitem, FALSE);
+// gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
/* Announce */
- menuitem = gtk_check_menu_item_new_with_label (_("Announce"));
- gtk_widget_set_sensitive (menuitem, FALSE);
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+// menuitem = gtk_check_menu_item_new_with_label (_("Announce"));
+// gtk_widget_set_sensitive (menuitem, FALSE);
+// gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
/* separator */
menuitem = gtk_separator_menu_item_new ();
@@ -891,7 +902,7 @@
}
- /* seelct sat */
+ /* select sat */
menuitem = gtk_menu_item_new_with_label (_("Select satellite"));
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), select_menu);
gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
@@ -999,3 +1010,141 @@
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 ((sat->otype != ORBIT_TYPE_GEO) && (sat->otype != ORBIT_TYPE_DECAYED) &&
+ 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->tle.sat_name, 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->tle.sat_name,
+ 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->tle.sat_name);
+
+ 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 ((sat->otype != ORBIT_TYPE_GEO) && (sat->otype != ORBIT_TYPE_DECAYED) &&
+ 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->tle.sat_name, 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->tle.sat_name,
+ 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->tle.sat_name);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ }
+
+}
Modified: trunk/src/gtk-single-sat.h
===================================================================
--- trunk/src/gtk-single-sat.h 2008-10-25 17:55:36 UTC (rev 156)
+++ trunk/src/gtk-single-sat.h 2008-10-25 21:20:54 UTC (rev 157)
@@ -31,6 +31,7 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include "gtk-sat-module.h"
#include "gtk-sat-data.h"
@@ -117,6 +118,7 @@
struct _gtk_single_sat
{
GtkVBox vbox;
+
GtkWidget *header; /*!< Header label, ie. satellite name. */
@@ -126,10 +128,12 @@
GtkWidget *table; /*!< table. */
GtkWidget *popup_button; /*!< Popup button. */
+
GKeyFile *cfgdata; /*!< Configuration data. */
GSList *sats; /*!< Satellites. */
qth_t *qth; /*!< Pointer to current location. */
+
guint32 flags; /*!< Flags indicating which columns are visible. */
guint refresh; /*!< Refresh rate. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-26 17:12:20
|
Revision: 162
http://gpredict.svn.sourceforge.net/gpredict/?rev=162&view=rev
Author: csete
Date: 2008-10-26 17:12:13 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
Added files.
Added Paths:
-----------
trunk/src/gtk-sat-list-popup.c
trunk/src/gtk-sat-list-popup.h
Added: trunk/src/gtk-sat-list-popup.c
===================================================================
--- trunk/src/gtk-sat-list-popup.c (rev 0)
+++ trunk/src/gtk-sat-list-popup.c 2008-10-26 17:12:13 UTC (rev 162)
@@ -0,0 +1,275 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ Gpredict: Real-time satellite tracking and orbit prediction program
+
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
+
+ Authors: Alexandru Csete <oz...@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 Pop-up menu used by GtkSatList.
+ */
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include "sgpsdp/sgp4sdp4.h"
+#include "sat-log.h"
+#include "config-keys.h"
+#include "sat-cfg.h"
+#ifdef HAVE_CONFIG_H
+# include <build-config.h>
+#endif
+#include "orbit-tools.h"
+#include "predict-tools.h"
+#include "sat-pass-dialogs.h"
+#include "gtk-sat-list-popup.h"
+#include "sat-popup-menu.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.
+ * \param event The mouse-click related event info.
+ * \param toplevel The top level window.
+ */
+void
+sat_popup_menu_exec (sat_t *sat, qth_t *qth, GdkEventButton *event, GtkSatList *list)
+{
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+ GtkWidget *label;
+ GtkWidget *image;
+ gchar *buff;
+
+
+
+ menu = gtk_menu_new ();
+
+ /* first menu item is the satellite name, centered */
+ menuitem = gtk_image_menu_item_new ();
+ label = gtk_label_new (NULL);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
+ buff = g_strdup_printf ("<b>%s</b>", sat->tle.sat_name);
+ gtk_label_set_markup (GTK_LABEL (label), buff);
+ g_free (buff);
+ gtk_container_add (GTK_CONTAINER (menuitem), label);
+ image = gtk_image_new_from_stock (GTK_STOCK_INFO,
+ GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
+
+ /* attach data to menuitem and connect callback */
+ 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_sat_info),
+ gtk_widgeT_get_toplevel (GTK_WIDGET (list)));
+
+ gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+
+ /* separator */
+ menuitem = gtk_separator_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+
+ /* next pass and predict passes */
+ 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_signal_connect (menuitem, "activate",
+ G_CALLBACK (show_next_pass_cb),
+ list);
+ gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+
+ 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_signal_connect (menuitem, "activate",
+ G_CALLBACK (show_future_passes_cb),
+ list);
+ gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
+
+
+ gtk_widget_show_all (menu);
+
+ /* Note: event can be NULL here when called from view_onPopupMenu;
+ * gdk_event_get_time() accepts a NULL argument */
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
+ (event != NULL) ? event->button : 0,
+ gdk_event_get_time ((GdkEvent*) event));
+
+
+}
+
+
+
+
+
+/** \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_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 ((sat->otype != ORBIT_TYPE_GEO) && (sat->otype != ORBIT_TYPE_DECAYED) &&
+ 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->tle.sat_name, 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->tle.sat_name,
+ 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->tle.sat_name);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ }
+
+}
+
+
+void
+show_future_passes_cb (GtkWidget *menuitem, gpointer data)
+{
+ GtkWidget *dialog;
+ GtkWindow *toplevel = 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 ((sat->otype != ORBIT_TYPE_GEO) && (sat->otype != ORBIT_TYPE_DECAYED) &&
+ 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->tle.sat_name, 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->tle.sat_name,
+ 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->tle.sat_name);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ }
+}
+
+
+
Added: trunk/src/gtk-sat-list-popup.h
===================================================================
--- trunk/src/gtk-sat-list-popup.h (rev 0)
+++ trunk/src/gtk-sat-list-popup.h 2008-10-26 17:12:13 UTC (rev 162)
@@ -0,0 +1,42 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ Gpredict: Real-time satellite tracking and orbit prediction program
+
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
+
+ Authors: Alexandru Csete <oz...@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_LIST_POPUP_H
+#define GTK_SAT_LIST_POPUP_H 1
+
+#include <gtk/gtk.h>
+#include "sgpsdp/sgp4sdp4.h"
+#include "gtk-sat-data.h"
+#include "gtk-sat-list.h"
+
+
+void gtk_sat_list_popup_exec (sat_t *sat, qth_t *qth,
+ GdkEventButton *event,
+ GtkSatList *list);
+
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-26 17:24:30
|
Revision: 166
http://gpredict.svn.sourceforge.net/gpredict/?rev=166&view=rev
Author: csete
Date: 2008-10-26 17:24:21 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
Added files.
Added Paths:
-----------
trunk/src/sat-info.c
trunk/src/sat-info.h
Added: trunk/src/sat-info.c
===================================================================
--- trunk/src/sat-info.c (rev 0)
+++ trunk/src/sat-info.c 2008-10-26 17:24:21 UTC (rev 166)
@@ -0,0 +1,407 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ Gpredict: Real-time satellite tracking and orbit prediction program
+
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
+
+ Authors: Alexandru Csete <oz...@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 Satellite info
+ */
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include "sgpsdp/sgp4sdp4.h"
+#include "sat-log.h"
+#include "config-keys.h"
+#include "sat-cfg.h"
+#ifdef HAVE_CONFIG_H
+# include <build-config.h>
+#endif
+#include "orbit-tools.h"
+#include "predict-tools.h"
+#include "sat-pass-dialogs.h"
+#include "sat-info.h"
+
+
+
+
+
+
+static gchar *epoch_to_str (sat_t *sat);
+
+
+/** \brief Show satellite info in a dialog
+ * \param menuitem The menuitem from where the function is invoked.
+ * \param data Pointer to parent window or NULL.
+ *
+ * FIXME: see nice drawing at http://www.amsat.org/amsat-new/tools/keps_tutorial.php
+ *
+*/
+void
+show_sat_info (GtkWidget *menuitem, gpointer data)
+{
+ GtkWidget *dialog;
+ GtkWidget *table;
+ GtkWidget *label;
+ GtkWindow *toplevel = NULL;
+ sat_t *sat;
+ gchar *str;
+
+
+ sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat"));
+
+ if (data != NULL)
+ toplevel = GTK_WINDOW (data);
+
+ /* create table */
+ table = gtk_table_new (20, 4, FALSE);
+ gtk_table_set_col_spacings (GTK_TABLE (table), 5);
+ gtk_table_set_row_spacings (GTK_TABLE (table), 5);
+ gtk_container_set_border_width (GTK_CONTAINER (table), 10);
+
+ /* create table contents and add them to table */
+
+ /* satellite name */
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), _("<b>Satellite name:</b>"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
+
+ label = gtk_label_new (NULL);
+ str = g_strdup_printf (_("<b>%s</b>"), sat->tle.sat_name);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 0, 1);
+ g_free (str);
+
+ /* operational status */
+ label = gtk_label_new (_("Operational Status:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2);
+
+ switch (sat->tle.status) {
+
+ case OP_STAT_OPERATIONAL:
+ label = gtk_label_new (_("Operational"));
+ break;
+
+ case OP_STAT_NONOP:
+ label = gtk_label_new (_("Non-operational"));
+ break;
+
+ case OP_STAT_PARTIAL:
+ label = gtk_label_new (_("Partially operational"));
+ break;
+
+ case OP_STAT_STDBY:
+ label = gtk_label_new (_("Backup/Standby"));
+ break;
+
+ case OP_STAT_SPARE:
+ label = gtk_label_new (_("Spare"));
+ break;
+
+ case OP_STAT_EXTENDED:
+ label = gtk_label_new (_("Extended Mission"));
+ break;
+
+ default:
+ label = gtk_label_new (_("Unknown"));
+ break;
+
+ }
+
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 1, 2);
+
+ /* Catnum */
+ label = gtk_label_new (_("Catalogue number:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3);
+
+ str = g_strdup_printf ("%d", sat->tle.catnr);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 2, 3);
+ g_free (str);
+
+ /* international designator */
+ label = gtk_label_new (_("Internation designator:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4);
+
+ label = gtk_label_new (sat->tle.idesg);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 3, 4);
+
+ /* elset number */
+ label = gtk_label_new (_("Element set number:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 4, 5);
+
+ str = g_strdup_printf ("%d", sat->tle.elset);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 4, 5);
+ g_free (str);
+
+ /* elset epoch */
+ label = gtk_label_new (_("Epoch time:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 5, 6);
+
+ str = epoch_to_str (sat);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 5, 6);
+ g_free (str);
+
+ /* Revolution Number @ Epoch */
+ label = gtk_label_new (_("Orbit number @ epoch:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 6, 7);
+
+ str = g_strdup_printf ("%d", sat->tle.revnum);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 6, 7);
+ g_free (str);
+
+ /* ephermis type left out, since it is always 0 */
+
+ /* separator */
+ gtk_table_attach_defaults (GTK_TABLE (table),
+ gtk_hseparator_new (),
+ 0, 4, 7, 8);
+
+ /* Orbit inclination */
+ label = gtk_label_new (_("Inclination:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 8, 9);
+
+ str = g_strdup_printf ("%.4f\302\260", sat->tle.xincl/de2ra);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 8, 9);
+ g_free (str);
+
+ /* RAAN */
+ label = gtk_label_new (_("RAAN:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 9, 10);
+
+ str = g_strdup_printf ("%.4f\302\260", sat->tle.xnodeo/de2ra);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 9, 10);
+ g_free (str);
+
+ /* Eccentricity */
+ label = gtk_label_new (_("Eccentricity:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 10, 11);
+
+ str = g_strdup_printf ("%.7f", sat->tle.eo);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 10, 11);
+ g_free (str);
+
+ /* Argument of perigee */
+ label = gtk_label_new (_("Arg. of perigee:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 11, 12);
+
+ str = g_strdup_printf ("%.4f\302\260", sat->tle.omegao/de2ra);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 11, 12);
+ g_free (str);
+
+ /* Mean Anomaly */
+ label = gtk_label_new (_("Mean anomaly:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 12, 13);
+
+ str = g_strdup_printf ("%.4f\302\260", sat->tle.xmo/de2ra);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 12, 13);
+ g_free (str);
+
+ /* Mean Motion */
+ label = gtk_label_new (_("Mean motion:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 13, 14);
+
+ //str = g_strdup_printf ("%.4f [rev/day]", sat->tle.xno/(xmnpda*(twopi/xmnpda/xmnpda)));
+ str = g_strdup_printf ("%.8f [rev/day]", sat->meanmo);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 13, 14);
+ g_free (str);
+
+ /* one half of the first time derivative of mean motion */
+ label = gtk_label_new (_("\302\275 d/dt (mean motion):"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 14, 15);
+
+ str = g_strdup_printf ("%.5e [rev/day<sup>2</sup>]",
+ sat->tle.xndt2o/(twopi/xmnpda/xmnpda));
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 14, 15);
+ g_free (str);
+
+ /* one sixth of the second time derivative of mean motion */
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label),
+ _("1/6 d<sup>2</sup>/dt<sup>2</sup> (mean motion):"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 15, 16);
+
+ str = g_strdup_printf ("%.5e [rev/day<sup>3</sup>]",
+ sat->tle.xndd6o*xmnpda/(twopi/xmnpda/xmnpda));
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 15, 16);
+ g_free (str);
+
+ /* B* drag term */
+ label = gtk_label_new (_("B* drag term:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 16, 17);
+
+ str = g_strdup_printf ("%.5e [R<sub>E</sub><sup>-1</sup>]", sat->tle.bstar*ae);
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 16, 17);
+ g_free (str);
+
+ /* Orbit type */
+
+ /* Next Event */
+
+
+
+ gtk_widget_show_all (table);
+
+ /* create dialog window with NULL parent */
+ dialog = gtk_dialog_new_with_buttons (_("Satellite Info"),
+ toplevel,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_OK,
+ GTK_RESPONSE_ACCEPT,
+ NULL);
+
+ /* allow interaction with other windows */
+ gtk_window_set_modal (GTK_WINDOW (dialog), FALSE);
+
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "destroy",
+ G_CALLBACK (gtk_widget_destroyed), &dialog);
+
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
+
+ gtk_widget_show_all (dialog);
+
+
+}
+
+
+
+/* BBBBB.BBBBBBBB] - Epoch Time -- 2-digit year, followed by 3-digit sequential
+ day of the year, followed by the time represented as the
+ fractional portion of one day, but...
+
+ we now have the converted fields, tle->epoch_year, tle->epoch_day and tle->epoch_fod
+
+*/
+static gchar *
+epoch_to_str (sat_t *sat)
+{
+ GDate *epd;
+ guint h,m,s,sec;
+ gchar *buff;
+ gchar *fmt;
+ struct tm tms;
+ time_t t;
+ guint size;
+
+ /* http://celestrak.com/columns/v04n03/#FAQ02
+ ... While talking about the epoch, this is perhaps a good place to answer
+ the other time-related questions. First, how is the epoch time format
+ interpreted? This question is best answered by using an example. An epoch
+ of 98001.00000000 corresponds to 0000 UT on 1998 January 01st in other
+ words, midnight between 1997 December 31 and 1998 January 01. An epoch of
+ 98000.00000000 would actually correspond to the beginning of 1997 December
+ 31st strange as that might seem. Note that the epoch day starts at UT
+ midnight (not noon) and that all times are measured mean solar rather than
+ sidereal time units (the answer to our third question).
+ */
+ epd = g_date_new_dmy (1, 1, sat->tle.epoch_year);
+ g_date_add_days (epd, sat->tle.epoch_day-1);
+
+ /* convert date to struct tm */
+ g_date_to_struct_tm (epd, &tms);
+
+ /* add HMS */
+ sec = (guint) floor (sat->tle.epoch_fod * 86400); /* fraction of day in seconds */
+
+ /* hour */
+ h = (guint) floor (sec / 3600);
+ tms.tm_hour = h;
+
+ /* minutes */
+ m = (guint) floor ((sec - (h*3600)) / 60);
+ tms.tm_min = m;
+
+ s = (guint) floor (sec - (h*3600) - (m*60));
+ tms.tm_sec = s;
+
+ /* get format string */
+ fmt = sat_cfg_get_str (SAT_CFG_STR_TIME_FORMAT);
+
+ /* format either local time or UTC depending on check box */
+ t = mktime (&tms);
+ buff = g_try_malloc (51);
+
+ if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME))
+ size = strftime (buff, 50, fmt, localtime (&t));
+ else
+ size = strftime (buff, 50, fmt, gmtime (&t));
+
+ if (size < 50)
+ buff[size]='\0';
+ else
+ buff[50]='\0';
+
+ g_date_free (epd);
+ g_free (fmt);
+
+ return buff;
+}
+
Added: trunk/src/sat-info.h
===================================================================
--- trunk/src/sat-info.h (rev 0)
+++ trunk/src/sat-info.h 2008-10-26 17:24:21 UTC (rev 166)
@@ -0,0 +1,38 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ Gpredict: Real-time satellite tracking and orbit prediction program
+
+ Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
+
+ Authors: Alexandru Csete <oz...@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 SAT_INFO_H
+#define SAT_INFO_H 1
+
+#include <gtk/gtk.h>
+#include "sgpsdp/sgp4sdp4.h"
+#include "gtk-sat-data.h"
+
+
+void show_sat_info (GtkWidget *menuitem, gpointer data);
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-26 17:26:19
|
Revision: 167
http://gpredict.svn.sourceforge.net/gpredict/?rev=167&view=rev
Author: csete
Date: 2008-10-26 17:26:16 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
Clean unused files.
Modified Paths:
--------------
trunk/src/sat-popup-menu.c
trunk/src/sat-popup-menu.h
Modified: trunk/src/sat-popup-menu.c
===================================================================
--- trunk/src/sat-popup-menu.c 2008-10-26 17:24:21 UTC (rev 166)
+++ trunk/src/sat-popup-menu.c 2008-10-26 17:26:16 UTC (rev 167)
@@ -48,8 +48,8 @@
static gchar *epoch_to_str (sat_t *sat);
+#if 0
-
/** \brief Show satellite popup menu.
* \param sat Pointer to the satellite data.
* \param qth The current location.
@@ -128,9 +128,9 @@
}
+#endif
-
/** \brief Show satellite info in a dialog
* \param menuitem The menuitem from where the function is invoked.
* \param data Pointer to parent window or NULL.
@@ -487,7 +487,7 @@
return buff;
}
-
+#if 0
/** \brief Show details of the next pass.
*
*/
@@ -619,4 +619,4 @@
}
-
+#endif
Modified: trunk/src/sat-popup-menu.h
===================================================================
--- trunk/src/sat-popup-menu.h 2008-10-26 17:24:21 UTC (rev 166)
+++ trunk/src/sat-popup-menu.h 2008-10-26 17:26:16 UTC (rev 167)
@@ -32,12 +32,12 @@
#include "sgpsdp/sgp4sdp4.h"
#include "gtk-sat-data.h"
-void sat_popup_menu_exec (sat_t *sat, qth_t *qth,
- GdkEventButton *event,
- GtkWidget *toplevel);
+//void sat_popup_menu_exec (sat_t *sat, qth_t *qth,
+// GdkEventButton *event,
+// GtkWidget *toplevel);
void show_sat_info (GtkWidget *menuitem, gpointer data);
-void show_next_pass (GtkWidget *menuitem, gpointer data);
-void show_future_passes (GtkWidget *menuitem, gpointer data);
+//void show_next_pass (GtkWidget *menuitem, gpointer data);
+//void show_future_passes (GtkWidget *menuitem, gpointer data);
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-26 17:26:38
|
Revision: 168
http://gpredict.svn.sourceforge.net/gpredict/?rev=168&view=rev
Author: csete
Date: 2008-10-26 17:26:35 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
Deleted obsolete files.
Removed Paths:
-------------
trunk/src/sat-popup-menu.c
trunk/src/sat-popup-menu.h
Deleted: trunk/src/sat-popup-menu.c
===================================================================
--- trunk/src/sat-popup-menu.c 2008-10-26 17:26:16 UTC (rev 167)
+++ trunk/src/sat-popup-menu.c 2008-10-26 17:26:35 UTC (rev 168)
@@ -1,622 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- Gpredict: Real-time satellite tracking and orbit prediction program
-
- Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
-
- Authors: Alexandru Csete <oz...@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 Pop-up menu used by GtkSatList, GtkSatMap, etc.
- */
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include "sgpsdp/sgp4sdp4.h"
-#include "sat-log.h"
-#include "config-keys.h"
-#include "sat-cfg.h"
-#ifdef HAVE_CONFIG_H
-# include <build-config.h>
-#endif
-#include "orbit-tools.h"
-#include "predict-tools.h"
-#include "sat-pass-dialogs.h"
-#include "sat-popup-menu.h"
-
-
-
-
-
-
-static gchar *epoch_to_str (sat_t *sat);
-
-#if 0
-
-/** \brief Show satellite popup menu.
- * \param sat Pointer to the satellite data.
- * \param qth The current location.
- * \param event The mouse-click related event info.
- * \param toplevel The top level window.
- */
-void
-sat_popup_menu_exec (sat_t *sat, qth_t *qth, GdkEventButton *event, GtkWidget *toplevel)
-{
- GtkWidget *menu;
- GtkWidget *menuitem;
- GtkWidget *label;
- GtkWidget *image;
- gchar *buff;
-
-
-
- menu = gtk_menu_new ();
-
- /* first menu item is the satellite name, centered */
- menuitem = gtk_image_menu_item_new ();
- label = gtk_label_new (NULL);
- gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
- buff = g_strdup_printf ("<b>%s</b>", sat->tle.sat_name);
- gtk_label_set_markup (GTK_LABEL (label), buff);
- g_free (buff);
- gtk_container_add (GTK_CONTAINER (menuitem), label);
- image = gtk_image_new_from_stock (GTK_STOCK_INFO,
- GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
-
- /* attach data to menuitem and connect callback */
- 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_sat_info),
- toplevel);
-
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
-
- /* separator */
- menuitem = gtk_separator_menu_item_new ();
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
-
- /* next pass and predict passes */
- 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_signal_connect (menuitem, "activate",
- G_CALLBACK (show_next_pass),
- toplevel);
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
-
- 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_signal_connect (menuitem, "activate",
- G_CALLBACK (show_future_passes),
- toplevel);
- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
-
-
- gtk_widget_show_all (menu);
-
- /* Note: event can be NULL here when called from view_onPopupMenu;
- * gdk_event_get_time() accepts a NULL argument */
- gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
- (event != NULL) ? event->button : 0,
- gdk_event_get_time ((GdkEvent*) event));
-
-
-}
-#endif
-
-
-/** \brief Show satellite info in a dialog
- * \param menuitem The menuitem from where the function is invoked.
- * \param data Pointer to parent window or NULL.
- *
- * FIXME: see nice drawing at http://www.amsat.org/amsat-new/tools/keps_tutorial.php
- *
-*/
-void
-show_sat_info (GtkWidget *menuitem, gpointer data)
-{
- GtkWidget *dialog;
- GtkWidget *table;
- GtkWidget *label;
- GtkWindow *toplevel = NULL;
- sat_t *sat;
- gchar *str;
-
-
- sat = SAT(g_object_get_data (G_OBJECT (menuitem), "sat"));
-
- if (data != NULL)
- toplevel = GTK_WINDOW (data);
-
- /* create table */
- table = gtk_table_new (20, 4, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (table), 5);
- gtk_table_set_row_spacings (GTK_TABLE (table), 5);
- gtk_container_set_border_width (GTK_CONTAINER (table), 10);
-
- /* create table contents and add them to table */
-
- /* satellite name */
- label = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (label), _("<b>Satellite name:</b>"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
-
- label = gtk_label_new (NULL);
- str = g_strdup_printf (_("<b>%s</b>"), sat->tle.sat_name);
- gtk_label_set_markup (GTK_LABEL (label), str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 0, 1);
- g_free (str);
-
- /* operational status */
- label = gtk_label_new (_("Operational Status:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2);
-
- switch (sat->tle.status) {
-
- case OP_STAT_OPERATIONAL:
- label = gtk_label_new (_("Operational"));
- break;
-
- case OP_STAT_NONOP:
- label = gtk_label_new (_("Non-operational"));
- break;
-
- case OP_STAT_PARTIAL:
- label = gtk_label_new (_("Partially operational"));
- break;
-
- case OP_STAT_STDBY:
- label = gtk_label_new (_("Backup/Standby"));
- break;
-
- case OP_STAT_SPARE:
- label = gtk_label_new (_("Spare"));
- break;
-
- case OP_STAT_EXTENDED:
- label = gtk_label_new (_("Extended Mission"));
- break;
-
- default:
- label = gtk_label_new (_("Unknown"));
- break;
-
- }
-
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 1, 2);
-
- /* Catnum */
- label = gtk_label_new (_("Catalogue number:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3);
-
- str = g_strdup_printf ("%d", sat->tle.catnr);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 2, 3);
- g_free (str);
-
- /* international designator */
- label = gtk_label_new (_("Internation designator:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4);
-
- label = gtk_label_new (sat->tle.idesg);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 3, 4);
-
- /* elset number */
- label = gtk_label_new (_("Element set number:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 4, 5);
-
- str = g_strdup_printf ("%d", sat->tle.elset);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 4, 5);
- g_free (str);
-
- /* elset epoch */
- label = gtk_label_new (_("Epoch time:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 5, 6);
-
- str = epoch_to_str (sat);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 5, 6);
- g_free (str);
-
- /* Revolution Number @ Epoch */
- label = gtk_label_new (_("Orbit number @ epoch:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 6, 7);
-
- str = g_strdup_printf ("%d", sat->tle.revnum);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 6, 7);
- g_free (str);
-
- /* ephermis type left out, since it is always 0 */
-
- /* separator */
- gtk_table_attach_defaults (GTK_TABLE (table),
- gtk_hseparator_new (),
- 0, 4, 7, 8);
-
- /* Orbit inclination */
- label = gtk_label_new (_("Inclination:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 8, 9);
-
- str = g_strdup_printf ("%.4f\302\260", sat->tle.xincl/de2ra);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 8, 9);
- g_free (str);
-
- /* RAAN */
- label = gtk_label_new (_("RAAN:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 9, 10);
-
- str = g_strdup_printf ("%.4f\302\260", sat->tle.xnodeo/de2ra);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 9, 10);
- g_free (str);
-
- /* Eccentricity */
- label = gtk_label_new (_("Eccentricity:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 10, 11);
-
- str = g_strdup_printf ("%.7f", sat->tle.eo);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 10, 11);
- g_free (str);
-
- /* Argument of perigee */
- label = gtk_label_new (_("Arg. of perigee:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 11, 12);
-
- str = g_strdup_printf ("%.4f\302\260", sat->tle.omegao/de2ra);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 11, 12);
- g_free (str);
-
- /* Mean Anomaly */
- label = gtk_label_new (_("Mean anomaly:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 12, 13);
-
- str = g_strdup_printf ("%.4f\302\260", sat->tle.xmo/de2ra);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 12, 13);
- g_free (str);
-
- /* Mean Motion */
- label = gtk_label_new (_("Mean motion:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 13, 14);
-
- //str = g_strdup_printf ("%.4f [rev/day]", sat->tle.xno/(xmnpda*(twopi/xmnpda/xmnpda)));
- str = g_strdup_printf ("%.8f [rev/day]", sat->meanmo);
- label = gtk_label_new (str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 13, 14);
- g_free (str);
-
- /* one half of the first time derivative of mean motion */
- label = gtk_label_new (_("\302\275 d/dt (mean motion):"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 14, 15);
-
- str = g_strdup_printf ("%.5e [rev/day<sup>2</sup>]",
- sat->tle.xndt2o/(twopi/xmnpda/xmnpda));
- label = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (label), str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 14, 15);
- g_free (str);
-
- /* one sixth of the second time derivative of mean motion */
- label = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (label),
- _("1/6 d<sup>2</sup>/dt<sup>2</sup> (mean motion):"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 15, 16);
-
- str = g_strdup_printf ("%.5e [rev/day<sup>3</sup>]",
- sat->tle.xndd6o*xmnpda/(twopi/xmnpda/xmnpda));
- label = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (label), str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 15, 16);
- g_free (str);
-
- /* B* drag term */
- label = gtk_label_new (_("B* drag term:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 16, 17);
-
- str = g_strdup_printf ("%.5e [R<sub>E</sub><sup>-1</sup>]", sat->tle.bstar*ae);
- label = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (label), str);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 16, 17);
- g_free (str);
-
- /* Orbit type */
-
- /* Next Event */
-
-
-
- gtk_widget_show_all (table);
-
- /* create dialog window with NULL parent */
- dialog = gtk_dialog_new_with_buttons (_("Satellite Info"),
- toplevel,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_OK,
- GTK_RESPONSE_ACCEPT,
- NULL);
-
- /* allow interaction with other windows */
- gtk_window_set_modal (GTK_WINDOW (dialog), FALSE);
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
- g_signal_connect (dialog, "destroy",
- G_CALLBACK (gtk_widget_destroyed), &dialog);
-
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
-
- gtk_widget_show_all (dialog);
-
-
-}
-
-
-
-/* BBBBB.BBBBBBBB] - Epoch Time -- 2-digit year, followed by 3-digit sequential
- day of the year, followed by the time represented as the
- fractional portion of one day, but...
-
- we now have the converted fields, tle->epoch_year, tle->epoch_day and tle->epoch_fod
-
-*/
-static gchar *
-epoch_to_str (sat_t *sat)
-{
- GDate *epd;
- guint h,m,s,sec;
- gchar *buff;
- gchar *fmt;
- struct tm tms;
- time_t t;
- guint size;
-
- /* http://celestrak.com/columns/v04n03/#FAQ02
- ... While talking about the epoch, this is perhaps a good place to answer
- the other time-related questions. First, how is the epoch time format
- interpreted? This question is best answered by using an example. An epoch
- of 98001.00000000 corresponds to 0000 UT on 1998 January 01st in other
- words, midnight between 1997 December 31 and 1998 January 01. An epoch of
- 98000.00000000 would actually correspond to the beginning of 1997 December
- 31st strange as that might seem. Note that the epoch day starts at UT
- midnight (not noon) and that all times are measured mean solar rather than
- sidereal time units (the answer to our third question).
- */
- epd = g_date_new_dmy (1, 1, sat->tle.epoch_year);
- g_date_add_days (epd, sat->tle.epoch_day-1);
-
- /* convert date to struct tm */
- g_date_to_struct_tm (epd, &tms);
-
- /* add HMS */
- sec = (guint) floor (sat->tle.epoch_fod * 86400); /* fraction of day in seconds */
-
- /* hour */
- h = (guint) floor (sec / 3600);
- tms.tm_hour = h;
-
- /* minutes */
- m = (guint) floor ((sec - (h*3600)) / 60);
- tms.tm_min = m;
-
- s = (guint) floor (sec - (h*3600) - (m*60));
- tms.tm_sec = s;
-
- /* get format string */
- fmt = sat_cfg_get_str (SAT_CFG_STR_TIME_FORMAT);
-
- /* format either local time or UTC depending on check box */
- t = mktime (&tms);
- buff = g_try_malloc (51);
-
- if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME))
- size = strftime (buff, 50, fmt, localtime (&t));
- else
- size = strftime (buff, 50, fmt, gmtime (&t));
-
- if (size < 50)
- buff[size]='\0';
- else
- buff[50]='\0';
-
- g_date_free (epd);
- g_free (fmt);
-
- return buff;
-}
-
-#if 0
-/** \brief Show details of the next pass.
- *
- */
-void
-show_next_pass (GtkWidget *menuitem, gpointer data)
-{
- sat_t *sat;
- qth_t *qth;
- pass_t *pass;
- GtkWidget *dialog;
- GtkWindow *toplevel = NULL;
-
-
- if (data != NULL)
- toplevel = GTK_WINDOW (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 ((sat->otype != ORBIT_TYPE_GEO) && (sat->otype != ORBIT_TYPE_DECAYED) &&
- has_aos (sat, qth)) {
-
- pass = get_next_pass (sat, qth,
- sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD));
-
- if (pass != NULL) {
- show_pass (sat->tle.sat_name, 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->tle.sat_name,
- 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->tle.sat_name);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
-
-}
-
-
-void
-show_future_passes (GtkWidget *menuitem, gpointer data)
-{
- GtkWidget *dialog;
- GtkWindow *toplevel = NULL;
- GSList *passes = NULL;
- sat_t *sat;
- qth_t *qth;
-
-
- if (data != NULL)
- toplevel = GTK_WINDOW (data);
-
- 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 ((sat->otype != ORBIT_TYPE_GEO) && (sat->otype != ORBIT_TYPE_DECAYED) &&
- has_aos (sat, qth)) {
-
-
- 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));
-
- if (passes != NULL) {
- show_passes (sat->tle.sat_name, 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->tle.sat_name,
- 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->tle.sat_name);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
-}
-
-
-#endif
Deleted: trunk/src/sat-popup-menu.h
===================================================================
--- trunk/src/sat-popup-menu.h 2008-10-26 17:26:16 UTC (rev 167)
+++ trunk/src/sat-popup-menu.h 2008-10-26 17:26:35 UTC (rev 168)
@@ -1,43 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- Gpredict: Real-time satellite tracking and orbit prediction program
-
- Copyright (C) 2001-2008 Alexandru Csete, OZ9AEC.
-
- Authors: Alexandru Csete <oz...@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 SAT_POPUP_MENU_H
-#define SAT_POPUP_MENU_H 1
-
-#include <gtk/gtk.h>
-#include "sgpsdp/sgp4sdp4.h"
-#include "gtk-sat-data.h"
-
-//void sat_popup_menu_exec (sat_t *sat, qth_t *qth,
-// GdkEventButton *event,
-// GtkWidget *toplevel);
-
-void show_sat_info (GtkWidget *menuitem, gpointer data);
-//void show_next_pass (GtkWidget *menuitem, gpointer data);
-//void show_future_passes (GtkWidget *menuitem, gpointer data);
-
-#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-26 17:27:11
|
Revision: 169
http://gpredict.svn.sourceforge.net/gpredict/?rev=169&view=rev
Author: csete
Date: 2008-10-26 17:27:08 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
Use new sat-info module.
Modified Paths:
--------------
trunk/src/Makefile.am
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
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2008-10-26 17:26:35 UTC (rev 168)
+++ trunk/src/Makefile.am 2008-10-26 17:27:08 UTC (rev 169)
@@ -72,11 +72,11 @@
radio-conf.c radio-conf.h \
rotor-conf.c rotor-conf.h \
sat-cfg.c sat-cfg.h \
+ sat-info.c sat-info.h \
sat-log.c sat-log.h \
sat-log-browser.c sat-log-browser.h \
sat-monitor.c sat-monitor.h \
sat-pass-dialogs.c sat-pass-dialogs.h \
- sat-popup-menu.c sat-popup-menu.h \
sat-pref.c sat-pref.h \
sat-pref-general.c sat-pref-general.h \
sat-pref-formats.c sat-pref-formats.h \
Modified: trunk/src/gtk-polar-view-popup.c
===================================================================
--- trunk/src/gtk-polar-view-popup.c 2008-10-26 17:26:35 UTC (rev 168)
+++ trunk/src/gtk-polar-view-popup.c 2008-10-26 17:27:08 UTC (rev 169)
@@ -43,7 +43,7 @@
#include "orbit-tools.h"
#include "predict-tools.h"
#include "sat-pass-dialogs.h"
-#include "sat-popup-menu.h"
+#include "sat-info.h"
#include "gtk-polar-view-popup.h"
Modified: trunk/src/gtk-sat-list-popup.c
===================================================================
--- trunk/src/gtk-sat-list-popup.c 2008-10-26 17:26:35 UTC (rev 168)
+++ trunk/src/gtk-sat-list-popup.c 2008-10-26 17:27:08 UTC (rev 169)
@@ -40,7 +40,7 @@
#include "predict-tools.h"
#include "sat-pass-dialogs.h"
#include "gtk-sat-list-popup.h"
-#include "sat-popup-menu.h"
+#include "sat-info.h"
Modified: trunk/src/gtk-sat-map-popup.c
===================================================================
--- trunk/src/gtk-sat-map-popup.c 2008-10-26 17:26:35 UTC (rev 168)
+++ trunk/src/gtk-sat-map-popup.c 2008-10-26 17:27:08 UTC (rev 169)
@@ -41,7 +41,7 @@
#include "orbit-tools.h"
#include "predict-tools.h"
#include "sat-pass-dialogs.h"
-#include "sat-popup-menu.h"
+#include "sat-info.h"
#include "gtk-sat-map-popup.h"
#include "gtk-sat-data.h"
#include "gtk-sat-map-ground-track.h"
Modified: trunk/src/gtk-single-sat.c
===================================================================
--- trunk/src/gtk-single-sat.c 2008-10-26 17:26:35 UTC (rev 168)
+++ trunk/src/gtk-single-sat.c 2008-10-26 17:27:08 UTC (rev 169)
@@ -39,7 +39,7 @@
#include "mod-cfg-get-param.h"
#include "gtk-sat-data.h"
#include "gpredict-utils.h"
-#include "sat-popup-menu.h"
+#include "sat-info.h"
#include "locator.h"
#include "sat-vis.h"
#ifdef HAVE_CONFIG_H
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2008-10-26 17:33:12
|
Revision: 170
http://gpredict.svn.sourceforge.net/gpredict/?rev=170&view=rev
Author: csete
Date: 2008-10-26 17:33:09 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
Removed obsolete references to sat-popup-menu.
Modified Paths:
--------------
trunk/src/gtk-azel-plot.c
trunk/src/gtk-polar-plot.c
trunk/src/gtk-polar-view.c
trunk/src/gtk-sat-map.c
trunk/src/gtk-sky-glance.c
Modified: trunk/src/gtk-azel-plot.c
===================================================================
--- trunk/src/gtk-azel-plot.c 2008-10-26 17:27:08 UTC (rev 169)
+++ trunk/src/gtk-azel-plot.c 2008-10-26 17:33:09 UTC (rev 170)
@@ -36,7 +36,6 @@
#include "config-keys.h"
#include "sat-cfg.h"
#include "time-tools.h"
-#include "sat-popup-menu.h"
#include "gtk-sat-data.h"
#include "gpredict-utils.h"
#include "gtk-azel-plot.h"
Modified: trunk/src/gtk-polar-plot.c
===================================================================
--- trunk/src/gtk-polar-plot.c 2008-10-26 17:27:08 UTC (rev 169)
+++ trunk/src/gtk-polar-plot.c 2008-10-26 17:33:09 UTC (rev 170)
@@ -45,7 +45,6 @@
#include "config-keys.h"
#include "sat-cfg.h"
#include "time-tools.h"
-#include "sat-popup-menu.h"
#include "gtk-sat-data.h"
#include "gpredict-utils.h"
#include "gtk-polar-plot.h"
Modified: trunk/src/gtk-polar-view.c
===================================================================
--- trunk/src/gtk-polar-view.c 2008-10-26 17:27:08 UTC (rev 169)
+++ trunk/src/gtk-polar-view.c 2008-10-26 17:33:09 UTC (rev 170)
@@ -36,8 +36,6 @@
#include "config-keys.h"
#include "sat-cfg.h"
#include "mod-cfg-get-param.h"
-//#include "time-tools.h"
-#include "sat-popup-menu.h"
#include "gtk-sat-data.h"
#include "gpredict-utils.h"
#include "gtk-polar-view-popup.h"
Modified: trunk/src/gtk-sat-map.c
===================================================================
--- trunk/src/gtk-sat-map.c 2008-10-26 17:27:08 UTC (rev 169)
+++ trunk/src/gtk-sat-map.c 2008-10-26 17:33:09 UTC (rev 170)
@@ -45,8 +45,6 @@
#include "config-keys.h"
#include "sat-cfg.h"
#include "mod-cfg-get-param.h"
-//#include "time-tools.h"
-#include "sat-popup-menu.h"
#include "gtk-sat-data.h"
#include "gpredict-utils.h"
#include "compat.h"
Modified: trunk/src/gtk-sky-glance.c
===================================================================
--- trunk/src/gtk-sky-glance.c 2008-10-26 17:27:08 UTC (rev 169)
+++ trunk/src/gtk-sky-glance.c 2008-10-26 17:33:09 UTC (rev 170)
@@ -43,7 +43,6 @@
#include "sat-cfg.h"
#include "mod-cfg-get-param.h"
#include "time-tools.h"
-#include "sat-popup-menu.h"
#include "gtk-sat-data.h"
#include "gpredict-utils.h"
#include "predict-tools.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-03-21 10:06:24
|
Revision: 205
http://gpredict.svn.sourceforge.net/gpredict/?rev=205&view=rev
Author: csete
Date: 2009-03-21 10:06:23 +0000 (Sat, 21 Mar 2009)
Log Message:
-----------
Added config field for uplink transverterf LO.
Modified Paths:
--------------
trunk/src/radio-conf.c
trunk/src/radio-conf.h
Modified: trunk/src/radio-conf.c
===================================================================
--- trunk/src/radio-conf.c 2009-03-21 10:03:32 UTC (rev 204)
+++ trunk/src/radio-conf.c 2009-03-21 10:06:23 UTC (rev 205)
@@ -38,6 +38,7 @@
#define KEY_HOST "Host"
#define KEY_PORT "Port"
#define KEY_LO "LO"
+#define KEY_LOUP "LO_UP"
#define KEY_TYPE "Type"
#define KEY_PTT "READ_PTT"
@@ -118,6 +119,16 @@
g_key_file_free (cfg);
return FALSE;
}
+
+ conf->loup = g_key_file_get_double (cfg, GROUP, KEY_LOUP, &error);
+ if (error != NULL) {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s: Error reading radio conf from %s (%s)."),
+ __FUNCTION__, conf->name, error->message);
+ g_clear_error (&error);
+ g_key_file_free (cfg);
+ return FALSE;
+ }
conf->type = g_key_file_get_integer (cfg, GROUP, KEY_TYPE, &error);
if (error != NULL) {
@@ -177,6 +188,7 @@
g_key_file_set_string (cfg, GROUP, KEY_HOST, conf->host);
g_key_file_set_integer (cfg, GROUP, KEY_PORT, conf->port);
g_key_file_set_double (cfg, GROUP, KEY_LO, conf->lo);
+ g_key_file_set_double (cfg, GROUP, KEY_LO, conf->loup);
g_key_file_set_integer (cfg, GROUP, KEY_TYPE, conf->type);
g_key_file_set_boolean (cfg, GROUP, KEY_PTT, conf->ptt);
Modified: trunk/src/radio-conf.h
===================================================================
--- trunk/src/radio-conf.h 2009-03-21 10:03:32 UTC (rev 204)
+++ trunk/src/radio-conf.h 2009-03-21 10:06:23 UTC (rev 205)
@@ -48,7 +48,8 @@
gchar *host; /*!< hostname or IP */
gint port; /*!< port number */
gdouble lo; /*!< local oscillator freq in Hz (using double for
- compatibility with rest of code) */
+ compatibility with rest of code). Downlink. */
+ gdouble loup; /*!< local oscillator freq in Hz for uplink. */
rig_type_t type; /*!< Radio type */
gboolean ptt; /*!< Flag indicating that we should read PTT status (needed for RX, TX, and TRX) */
} radio_conf_t;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-03-22 11:48:40
|
Revision: 213
http://gpredict.svn.sourceforge.net/gpredict/?rev=213&view=rev
Author: csete
Date: 2009-03-22 11:48:22 +0000 (Sun, 22 Mar 2009)
Log Message:
-----------
Fixed a few spelling errors.
Modified Paths:
--------------
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-sat-module-popup.c
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2009-03-22 11:46:57 UTC (rev 212)
+++ trunk/src/gtk-rig-ctrl.c 2009-03-22 11:48:22 UTC (rev 213)
@@ -1082,12 +1082,12 @@
size = read (sock, buff, 127);
if (size == 0) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("%s:%s: Got 0 bytes from rotctld"),
+ _("%s:%s: Got 0 bytes from rigctld"),
__FILE__, __FUNCTION__);
}
else {
sat_log_log (SAT_LOG_LEVEL_DEBUG,
- _("%s:%s: Read %d bytes from rotctld"),
+ _("%s:%s: Read %d bytes from rigctld"),
__FILE__, __FUNCTION__, size);
buff[size] = 0;
Modified: trunk/src/gtk-sat-module-popup.c
===================================================================
--- trunk/src/gtk-sat-module-popup.c 2009-03-22 11:46:57 UTC (rev 212)
+++ trunk/src/gtk-sat-module-popup.c 2009-03-22 11:48:22 UTC (rev 213)
@@ -886,7 +886,7 @@
module->rigctrl = gtk_rig_ctrl_new (module);
if (module->rigctrl == NULL) {
- /* gtk_rot_ctrl_new returned NULL becasue no rotators are configured */
+ /* gtk_rot_ctrl_new returned NULL becasue no radios are configured */
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (app),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-03-29 21:35:03
|
Revision: 216
http://gpredict.svn.sourceforge.net/gpredict/?rev=216&view=rev
Author: csete
Date: 2009-03-29 21:34:58 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Implemented new controller (RX and TX). Pending transponder management.
Modified Paths:
--------------
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-rig-ctrl.h
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2009-03-29 21:33:48 UTC (rev 215)
+++ trunk/src/gtk-rig-ctrl.c 2009-03-29 21:34:58 UTC (rev 216)
@@ -74,21 +74,29 @@
static GtkWidget *create_conf_widgets (GtkRigCtrl *ctrl);
static GtkWidget *create_count_down_widgets (GtkRigCtrl *ctrl);
-
-static void store_sats (gpointer key, gpointer value, gpointer user_data);
-
+/* callback functions */
static void sat_selected_cb (GtkComboBox *satsel, gpointer data);
static void track_toggle_cb (GtkToggleButton *button, gpointer data);
static void delay_changed_cb (GtkSpinButton *spin, gpointer data);
static void rig_selected_cb (GtkComboBox *box, gpointer data);
static void rig_locked_cb (GtkToggleButton *button, gpointer data);
static gboolean rig_ctrl_timeout_cb (gpointer data);
+
+/* radio control functions */
+static void exec_rx_cycle (GtkRigCtrl *ctrl);
+static void exec_tx_cycle (GtkRigCtrl *ctrl);
+static void exec_trx_cycle (GtkRigCtrl *ctrl);
+static void exec_duplex_cycle (GtkRigCtrl *ctrl);
static gboolean set_freq_simplex (GtkRigCtrl *ctrl, gdouble freq);
static gboolean get_freq_simplex (GtkRigCtrl *ctrl, gdouble *freq);
+static gboolean get_ptt (GtkRigCtrl *ctrl);
static void update_count_down (GtkRigCtrl *ctrl, gdouble t);
+/* misc utility functions */
+static void store_sats (gpointer key, gpointer value, gpointer user_data);
static gboolean have_conf (void);
+
static GtkVBoxClass *parent_class = NULL;
static GdkColor ColBlack = { 0, 0, 0, 0};
@@ -161,6 +169,8 @@
ctrl->delay = 1000;
ctrl->timerid = 0;
ctrl->errcnt = 0;
+ ctrl->lastrxf = 0.0;
+ ctrl->lasttxf = 0.0;
}
static void
@@ -805,6 +815,8 @@
/* close socket */
gtk_widget_set_sensitive (ctrl->DevSel, TRUE);
ctrl->engaged = FALSE;
+ ctrl->lasttxf = 0.0;
+ ctrl->lastrxf = 0.0;
}
else {
if (ctrl->conf == NULL) {
@@ -818,6 +830,36 @@
gtk_widget_set_sensitive (ctrl->DevSel, FALSE);
ctrl->engaged = TRUE;
ctrl->wrops = 0;
+
+ /* set initial frequency */
+
+ switch (ctrl->conf->type) {
+ case RIG_TYPE_RX:
+ ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
+ set_freq_simplex (ctrl, ctrl->lastrxf);
+ break;
+ case RIG_TYPE_TX:
+ ctrl->lasttxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqUp));
+ set_freq_simplex (ctrl, ctrl->lasttxf);
+ break;
+ case RIG_TYPE_TRX:
+ case RIG_TYPE_DUPLEX:
+ if (get_ptt (ctrl)) {
+ ctrl->lasttxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqUp));
+ set_freq_simplex (ctrl, ctrl->lasttxf);
+ }
+ else {
+ ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
+ set_freq_simplex (ctrl, ctrl->lastrxf);
+ }
+ break;
+ default:
+ /* this is an error! */
+ ctrl->conf->type = RIG_TYPE_RX;
+ ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
+ set_freq_simplex (ctrl, ctrl->lastrxf);
+ break;
+ }
}
}
@@ -830,7 +872,6 @@
rig_ctrl_timeout_cb (gpointer data)
{
GtkRigCtrl *ctrl = GTK_RIG_CTRL (data);
- gdouble satfreq,doppler,lof,readfreq=0,lastfreq;
if (ctrl->busy) {
@@ -840,92 +881,395 @@
ctrl->busy = TRUE;
+ /* Execute controller cycle depending on radio type */
+ switch (ctrl->conf->type) {
+
+ case RIG_TYPE_RX:
+ exec_rx_cycle (ctrl);
+ break;
+
+ case RIG_TYPE_TX:
+ exec_tx_cycle (ctrl);
+ break;
+
+ case RIG_TYPE_TRX:
+ exec_trx_cycle (ctrl);
+ break;
+
+ case RIG_TYPE_DUPLEX:
+ exec_duplex_cycle (ctrl);
+ break;
+
+ default:
+ /* invalid mode */
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s: Invalid radio type %d. Setting type to RIG_TYPE_RX"),
+ __FUNCTION__, ctrl->conf->type);
+ ctrl->conf->type = RIG_TYPE_RX;
+
+ }
+ //g_print (" WROPS = %d\n", ctrl->wrops);
- // TODO
- lof = 0.0; //1.0e6*gtk_spin_button_get_value (GTK_SPIN_BUTTON (ctrl->LO));
+ ctrl->busy = FALSE;
+
+ return TRUE;
+}
+
+/** \brief Execute RX mode cycle.
+ * \param ctrl Pointer to the GtkRigCtrl widget.
+ *
+ * This function executes a controller cycle when the device is of RIG_TYPE_RX.
+ */
+static void exec_rx_cycle (GtkRigCtrl *ctrl)
+{
+ gdouble readfreq=0.0, tmpfreq, satfreqd, satfrequ, doppler;
+ gboolean ptt = FALSE;
+ gboolean dialchanged = FALSE;
+
+
/* Dial feedback:
If radio device is engaged read frequency from radio and compare it to the
last set frequency. If different, it means that user has changed frequency
on the radio dial => update transponder knob
*/
if (ctrl->engaged) {
- lastfreq = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->RigFreqDown));
+ // This is no good because it gets out of sync while PTT = ON
+ //lastfreq = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->RigFreqDown));
- /* get current frequency from rig */
- if (!get_freq_simplex (ctrl, &readfreq)) {
- /* error => use a passive value */
- readfreq = lastfreq;
+ /* check whether PTT is ON */
+ ptt = ctrl->conf->ptt ? get_ptt (ctrl) : FALSE;
+
+ if (ptt == FALSE) {
+ if (!get_freq_simplex (ctrl, &readfreq)) {
+ /* error => use a passive value */
+ readfreq = ctrl->lastrxf;
+ ctrl->errcnt++;
+ }
}
+ else {
+ readfreq = ctrl->lastrxf;
+ }
- if (fabs (readfreq - lastfreq) > 0.99) {
+ if (fabs (readfreq - ctrl->lastrxf) > 0.99) {
+ dialchanged = TRUE;
+
/* user might have altered radio frequency => update transponder knob */
gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown), readfreq);
/* doppler shift; only if we are tracking */
if (ctrl->tracking) {
- satfreq = (readfreq+lof) / (1 - (ctrl->target->range_rate/299792.4580));
+ satfreqd = (readfreq + ctrl->conf->lo) /
+ (1 - (ctrl->target->range_rate/299792.4580));
}
else {
- satfreq = readfreq + lof;
+ satfreqd = readfreq + ctrl->conf->lo;
}
- gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->SatFreqDown), satfreq);
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->SatFreqDown), satfreqd);
+
+ /* TODO Update uplink if locked to downlink */
}
}
-
+
+ /* TODO: Follow with uplink if transponder is locked */
+
/* now, forward tracking */
+ if (dialchanged) {
+ /* no need to forward track */
+ return;
+ }
/* If we are tracking, calculate the radio freq by applying both dopper shift
- and tranverter LO frequency.
- If we are not tracking, apply only LO frequency.
+ and tranverter LO frequency. If we are not tracking, apply only LO frequency.
*/
+ satfreqd = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->SatFreqDown));
+ satfrequ = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->SatFreqUp));
if (ctrl->tracking) {
- satfreq = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->SatFreqDown));
- doppler = -satfreq * (ctrl->target->range_rate / 299792.4580);
- gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown), satfreq+doppler-lof);
+ /* downlink */
+ doppler = -satfreqd * (ctrl->target->range_rate / 299792.4580);
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown),
+ satfreqd + doppler - ctrl->conf->lo);
+ /* uplink */
+ doppler = -satfrequ * (ctrl->target->range_rate / 299792.4580);
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp),
+ satfrequ + doppler - ctrl->conf->lo);
}
else {
- satfreq = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->SatFreqDown));
- gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown), satfreq-lof);
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown),
+ satfreqd - ctrl->conf->lo);
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp),
+ satfrequ - ctrl->conf->lo);
}
-
+ tmpfreq = gtk_freq_knob_get_value(GTK_FREQ_KNOB(ctrl->RigFreqDown));
+
/* if device is engaged, send freq command to radio */
- if ((ctrl->engaged) &&
- (fabs (readfreq-gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown))) > 0.99)) {
- if (set_freq_simplex (ctrl, gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown)))) {
+ if ((ctrl->engaged) && (ptt == FALSE) && (fabs(ctrl->lastrxf - tmpfreq) > 0.99)) {
+ if (set_freq_simplex (ctrl, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
+ ctrl->lastrxf = tmpfreq;
}
else {
- if (ctrl->errcnt >= MAX_ERROR_COUNT) {
- /* disengage device */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctrl->LockBut), FALSE);
- ctrl->engaged = FALSE;
- ctrl->errcnt = 0;
- sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("%s: MAX_ERROR_COUNT (%d) reached. Disengaging device!"),
- __FUNCTION__, MAX_ERROR_COUNT);
-
- //g_print ("ERROR. WROPS = %d\n", ctrl->wrops);
+ ctrl->errcnt++;
+ }
+ }
+
+ if (ctrl->errcnt >= MAX_ERROR_COUNT) {
+ /* disengage device */
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctrl->LockBut), FALSE);
+ ctrl->engaged = FALSE;
+ ctrl->errcnt = 0;
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s: MAX_ERROR_COUNT (%d) reached. Disengaging device!"),
+ __FUNCTION__, MAX_ERROR_COUNT);
+
+ //g_print ("ERROR. WROPS = %d\n", ctrl->wrops);
+ }
+}
+
+
+/** \brief Execute TX mode cycle.
+ * \param ctrl Pointer to the GtkRigCtrl widget.
+ *
+ * This function executes a controller cycle when the device is of RIG_TYPE_TX.
+ */
+static void exec_tx_cycle (GtkRigCtrl *ctrl)
+{
+ gdouble readfreq=0.0, tmpfreq, satfreqd, satfrequ, doppler;
+ gboolean ptt = FALSE;
+ gboolean dialchanged = FALSE;
+
+
+ /* Dial feedback:
+ If radio device is engaged read frequency from radio and compare it to the
+ last set frequency. If different, it means that user has changed frequency
+ on the radio dial => update transponder knob
+ */
+ if (ctrl->engaged) {
+ // This is no good because it gets out of sync while PTT = ON
+ //lastfreq = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->RigFreqDown));
+
+ /* check whether PTT is ON */
+ ptt = ctrl->conf->ptt ? get_ptt (ctrl) : FALSE;
+
+ if (ptt == TRUE) {
+ if (!get_freq_simplex (ctrl, &readfreq)) {
+ /* error => use a passive value */
+ readfreq = ctrl->lasttxf;
+ ctrl->errcnt++;
}
+ }
+ else {
+ readfreq = ctrl->lasttxf;
+ }
+
+ if (fabs (readfreq - ctrl->lasttxf) > 0.99) {
+ dialchanged = TRUE;
+
+ /* user might have altered radio frequency => update transponder knob */
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp), readfreq);
+
+ /* doppler shift; only if we are tracking */
+ if (ctrl->tracking) {
+ satfrequ = (readfreq + ctrl->conf->loup) /
+ (1 - (ctrl->target->range_rate/299792.4580));
+ }
else {
- /* increment error counter */
- ctrl->errcnt++;
+ satfrequ = readfreq + ctrl->conf->loup;
}
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->SatFreqUp), satfrequ);
+
+ /* TODO Update downlink if locked to uplink */
}
}
+
+ /* TODO: Follow with downlink if transponder is locked */
+
+ /* now, forward tracking */
+ if (dialchanged) {
+ /* no need to forward track */
+ return;
+ }
- //g_print (" WROPS = %d\n", ctrl->wrops);
+ /* If we are tracking, calculate the radio freq by applying both dopper shift
+ and tranverter LO frequency. If we are not tracking, apply only LO frequency.
+ */
+ satfreqd = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->SatFreqDown));
+ satfrequ = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->SatFreqUp));
+ if (ctrl->tracking) {
+ /* downlink */
+ doppler = -satfreqd * (ctrl->target->range_rate / 299792.4580);
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown),
+ satfreqd + doppler - ctrl->conf->lo);
+ /* uplink */
+ doppler = -satfrequ * (ctrl->target->range_rate / 299792.4580);
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp),
+ satfrequ + doppler - ctrl->conf->lo);
+ }
+ else {
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown),
+ satfreqd - ctrl->conf->lo);
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp),
+ satfrequ - ctrl->conf->lo);
+ }
+
+ tmpfreq = gtk_freq_knob_get_value(GTK_FREQ_KNOB(ctrl->RigFreqUp));
+
+ /* if device is engaged, send freq command to radio */
+ if ((ctrl->engaged) && (ptt == TRUE) && (fabs(ctrl->lasttxf - tmpfreq) > 0.99)) {
+ if (set_freq_simplex (ctrl, tmpfreq)) {
+ /* reset error counter */
+ ctrl->errcnt = 0;
+ ctrl->lasttxf = tmpfreq;
+ }
+ else {
+ ctrl->errcnt++;
+ }
+ }
- ctrl->busy = FALSE;
+ if (ctrl->errcnt >= MAX_ERROR_COUNT) {
+ /* disengage device */
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctrl->LockBut), FALSE);
+ ctrl->engaged = FALSE;
+ ctrl->errcnt = 0;
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s: MAX_ERROR_COUNT (%d) reached. Disengaging device!"),
+ __FUNCTION__, MAX_ERROR_COUNT);
+
+ //g_print ("ERROR. WROPS = %d\n", ctrl->wrops);
+ }
+
+}
+
+
+/** \brief Execute simplex mode cycle.
+ * \param ctrl Pointer to the GtkRigCtrl widget.
+ *
+ * This function executes a controller cycle when the device is of RIG_TYPE_TRX (simplex).
+ */
+static void exec_trx_cycle (GtkRigCtrl *ctrl)
+{
+
+}
+
+
+/** \brief Execute duplex mode cycle.
+ * \param ctrl Pointer to the GtkRigCtrl widget.
+ *
+ * This function executes a controller cycle when the device is of RIG_TYPE_DUPLEX.
+ */
+static void exec_duplex_cycle (GtkRigCtrl *ctrl)
+{
+ //FIXME implement
+ exec_trx_cycle (ctrl);
+}
+
+
+/** \brief Get PTT status
+ * \param ctrl Pointer to the GtkRigVtrl widget.
+ * \return TRUE if PTT is ON, FALSE if PTT is OFF or an error occurred.
+ *
+ */
+static gboolean get_ptt (GtkRigCtrl *ctrl)
+{
+ gchar *buff,**vbuff;
+ gint written,size;
+ gint status;
+ struct hostent *h;
+ struct sockaddr_in ServAddr;
+ gint sock; /*!< Network socket */
+ guint64 pttstat = 0;
+
- return TRUE;
+ /* create socket */
+ sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (sock < 0) {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%d: Failed to create socket"),
+ __FILE__, __LINE__);
+ return FALSE;
+ }
+ else {
+ sat_log_log (SAT_LOG_LEVEL_DEBUG,
+ _("%s:%d Network socket created successfully"),
+ __FILE__, __LINE__);
+ }
+
+ memset(&ServAddr, 0, sizeof(ServAddr)); /* Zero out structure */
+ ServAddr.sin_family = AF_INET; /* Internet address family */
+ h = gethostbyname(ctrl->conf->host);
+ memcpy((char *) &ServAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
+ ServAddr.sin_port = htons(ctrl->conf->port); /* Server port */
+
+ /* establish connection */
+ status = connect(sock, (struct sockaddr *) &ServAddr, sizeof(ServAddr));
+ if (status < 0) {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%d: Failed to connect to %s:%d"),
+ __FILE__, __LINE__, ctrl->conf->host, ctrl->conf->port);
+ return FALSE;
+ }
+ else {
+ sat_log_log (SAT_LOG_LEVEL_DEBUG,
+ _("%s:%d: Connection opened to %s:%d"),
+ __FILE__, __LINE__, ctrl->conf->host, ctrl->conf->port);
+ }
+
+ /* send command (get_ptt: t) */
+ buff = g_strdup_printf ("t");
+
+ size = 1;
+ written = send(sock, buff, size, 0);
+ if (written != size) {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%d: SIZE ERROR %d / %d"),
+ __FILE__, __LINE__, written, size);
+ }
+ g_free (buff);
+
+
+ /* try to read answer */
+ buff = g_try_malloc (128);
+ if (buff == NULL) {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%s: Failed to allocate 128 bytes (yes, this means trouble)"),
+ __FILE__, __FUNCTION__);
+ shutdown (sock, SHUT_RDWR);
+ close (sock);
+ return FALSE;
+ }
+
+ size = read (sock, buff, 127);
+ if (size == 0) {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%s: Got 0 bytes from rigctld"),
+ __FILE__, __FUNCTION__);
+ }
+ else {
+ sat_log_log (SAT_LOG_LEVEL_DEBUG,
+ _("%s:%s: Read %d bytes from rigctld"),
+ __FILE__, __FUNCTION__, size);
+
+ buff[size] = 0;
+ vbuff = g_strsplit (buff, "\n", 3);
+ pttstat = g_ascii_strtoull (vbuff[0], NULL, 0); //FIXME base = 0 ok?
+
+ g_free (buff);
+ g_strfreev (vbuff);
+ }
+
+ shutdown (sock, SHUT_RDWR);
+ close (sock);
+
+
+ return (pttstat == 1) ? TRUE : FALSE;
+
}
-/** \brief Set frequency in
+/** \brief Set frequency in simplex mode
* \param ctrl Pointer to the GtkRigCtrl structure.
* \param freq The new frequency.
* \return TRUE if the operation was successful, FALSE if a connection error
Modified: trunk/src/gtk-rig-ctrl.h
===================================================================
--- trunk/src/gtk-rig-ctrl.h 2009-03-29 21:33:48 UTC (rev 215)
+++ trunk/src/gtk-rig-ctrl.h 2009-03-29 21:34:58 UTC (rev 216)
@@ -94,7 +94,10 @@
gboolean busy; /*!< Flag set when control algorithm is busy. */
gboolean engaged; /*!< Flag indicating that rig device is engaged. */
gint errcnt; /*!< Error counter. */
-
+
+ gdouble lastrxf; /*!< Last frequency sent to receiver. */
+ gdouble lasttxf; /*!< Last frequency sent to tranmitter. */
+
/* debug related */
guint wrops;
guint rdops;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-04-04 22:19:07
|
Revision: 223
http://gpredict.svn.sourceforge.net/gpredict/?rev=223&view=rev
Author: csete
Date: 2009-04-04 22:19:03 +0000 (Sat, 04 Apr 2009)
Log Message:
-----------
Fixed another typo...
Modified Paths:
--------------
trunk/src/trsp-conf.c
trunk/src/trsp-conf.h
Modified: trunk/src/trsp-conf.c
===================================================================
--- trunk/src/trsp-conf.c 2009-04-03 21:03:23 UTC (rev 222)
+++ trunk/src/trsp-conf.c 2009-04-04 22:19:03 UTC (rev 223)
@@ -44,7 +44,7 @@
* \param catnum The catalog number of the satellite to read transponders for.
* \return The new transponder list.
*/
-GSList *read_tranponders (guint catnum)
+GSList *read_transponders (guint catnum)
{
GSList *trsplist = NULL;
trsp_t *trsp;
Modified: trunk/src/trsp-conf.h
===================================================================
--- trunk/src/trsp-conf.h 2009-04-03 21:03:23 UTC (rev 222)
+++ trunk/src/trsp-conf.h 2009-04-04 22:19:03 UTC (rev 223)
@@ -44,7 +44,7 @@
/* The actual data would then be a singly linked list with pointers to transponder_t structures */
-GSList *read_tranponders (guint catnum);
+GSList *read_transponders (guint catnum);
void write_transponders (guint catnum, GSList *trsplist);
void free_transponders (GSList *trsplist);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-04-04 22:38:52
|
Revision: 225
http://gpredict.svn.sourceforge.net/gpredict/?rev=225&view=rev
Author: csete
Date: 2009-04-04 22:38:48 +0000 (Sat, 04 Apr 2009)
Log Message:
-----------
Some more work on transponder management (segfaults from time to time).
Modified Paths:
--------------
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-rig-ctrl.h
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2009-04-04 22:21:38 UTC (rev 224)
+++ trunk/src/gtk-rig-ctrl.c 2009-04-04 22:38:48 UTC (rev 225)
@@ -81,6 +81,7 @@
static void delay_changed_cb (GtkSpinButton *spin, gpointer data);
static void rig_selected_cb (GtkComboBox *box, gpointer data);
static void rig_locked_cb (GtkToggleButton *button, gpointer data);
+static void trsp_selected_cb (GtkComboBox *box, gpointer data);
static gboolean rig_ctrl_timeout_cb (gpointer data);
/* radio control functions */
@@ -94,6 +95,7 @@
static void update_count_down (GtkRigCtrl *ctrl, gdouble t);
/* misc utility functions */
+static void load_trsp_list (GtkRigCtrl *ctrl);
static void store_sats (gpointer key, gpointer value, gpointer user_data);
static gboolean have_conf (void);
@@ -109,48 +111,48 @@
GType
gtk_rig_ctrl_get_type ()
{
- static GType gtk_rig_ctrl_type = 0;
+ static GType gtk_rig_ctrl_type = 0;
- if (!gtk_rig_ctrl_type) {
+ if (!gtk_rig_ctrl_type) {
- static const GTypeInfo gtk_rig_ctrl_info = {
- sizeof (GtkRigCtrlClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gtk_rig_ctrl_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GtkRigCtrl),
- 5, /* n_preallocs */
- (GInstanceInitFunc) gtk_rig_ctrl_init,
- };
+ static const GTypeInfo gtk_rig_ctrl_info = {
+ sizeof (GtkRigCtrlClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) gtk_rig_ctrl_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GtkRigCtrl),
+ 2, /* n_preallocs */
+ (GInstanceInitFunc) gtk_rig_ctrl_init,
+ };
- gtk_rig_ctrl_type = g_type_register_static (GTK_TYPE_VBOX,
- "GtkRigCtrl",
- >k_rig_ctrl_info,
- 0);
- }
+ gtk_rig_ctrl_type = g_type_register_static (GTK_TYPE_VBOX,
+ "GtkRigCtrl",
+ >k_rig_ctrl_info,
+ 0);
+ }
- return gtk_rig_ctrl_type;
+ return gtk_rig_ctrl_type;
}
static void
gtk_rig_ctrl_class_init (GtkRigCtrlClass *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_rig_ctrl_destroy;
+ object_class->destroy = gtk_rig_ctrl_destroy;
}
@@ -164,6 +166,8 @@
ctrl->pass = NULL;
ctrl->qth = NULL;
ctrl->conf = NULL;
+ ctrl->trsp = NULL;
+ ctrl->trsplist = NULL;
ctrl->tracking = FALSE;
ctrl->busy = FALSE;
ctrl->engaged = FALSE;
@@ -190,8 +194,13 @@
g_free (ctrl->conf);
ctrl->conf = NULL;
}
+
+ /* free transponder */
+ if (ctrl->trsplist != NULL) {
+ free_transponders (ctrl->trsplist);
+ }
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -211,7 +220,7 @@
return NULL;
}
- widget = g_object_new (GTK_TYPE_RIG_CTRL, NULL);
+ widget = g_object_new (GTK_TYPE_RIG_CTRL, NULL);
/* store satellites */
g_hash_table_foreach (module->satellites, store_sats, widget);
@@ -496,37 +505,45 @@
gtk_table_attach_defaults (GTK_TABLE (table), track, 3, 4, 0, 1);
g_signal_connect (track, "toggled", G_CALLBACK (track_toggle_cb), ctrl);
+ /* Transponder selector */
+ ctrl->TrspSel = gtk_combo_box_new_text ();
+ gtk_widget_set_tooltip_text (ctrl->TrspSel, _("Select a transponder"));
+ load_trsp_list (ctrl);
+ //gtk_combo_box_set_active (GTK_COMBO_BOX (ctrl->TrspSel), 0);
+ g_signal_connect (ctrl->TrspSel, "changed", G_CALLBACK (trsp_selected_cb), ctrl);
+ gtk_table_attach_defaults (GTK_TABLE (table), ctrl->TrspSel, 0, 3, 1, 2);
+
/* Azimuth */
label = gtk_label_new (_("Az:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3);
ctrl->SatAz = gtk_label_new (buff);
gtk_misc_set_alignment (GTK_MISC (ctrl->SatAz), 1.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), ctrl->SatAz, 1, 2, 1, 2);
+ gtk_table_attach_defaults (GTK_TABLE (table), ctrl->SatAz, 1, 2, 2, 3);
/* Elevation */
label = gtk_label_new (_("El:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4);
ctrl->SatEl = gtk_label_new (buff);
gtk_misc_set_alignment (GTK_MISC (ctrl->SatEl), 1.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), ctrl->SatEl, 1, 2, 2, 3);
+ gtk_table_attach_defaults (GTK_TABLE (table), ctrl->SatEl, 1, 2, 3, 4);
/* Range */
label = gtk_label_new (_(" Range:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 1, 2);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 2, 3);
ctrl->SatRng = gtk_label_new ("0 km");
gtk_misc_set_alignment (GTK_MISC (ctrl->SatRng), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), ctrl->SatRng, 3, 4, 1, 2);
+ gtk_table_attach_defaults (GTK_TABLE (table), ctrl->SatRng, 3, 4, 2, 3);
/* Range rate */
label = gtk_label_new (_(" Rate:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 2, 3);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 3, 4);
ctrl->SatRngRate = gtk_label_new ("0.0 km/s");
gtk_misc_set_alignment (GTK_MISC (ctrl->SatRngRate), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), ctrl->SatRngRate, 3, 4, 2, 3);
+ gtk_table_attach_defaults (GTK_TABLE (table), ctrl->SatRngRate, 3, 4, 3, 4);
frame = gtk_frame_new (_("Target"));
@@ -597,7 +614,7 @@
g_signal_connect (ctrl->DevSel, "changed", G_CALLBACK (rig_selected_cb), ctrl);
gtk_table_attach_defaults (GTK_TABLE (table), ctrl->DevSel, 1, 2, 0, 1);
/* config will be force-loaded after LO spin is created */
-
+
/* Engage button */
ctrl->LockBut = gtk_toggle_button_new_with_label (_("Engage"));
gtk_widget_set_tooltip_text (ctrl->LockBut, _("Engage the selcted radio device"));
@@ -605,7 +622,7 @@
gtk_table_attach_defaults (GTK_TABLE (table), ctrl->LockBut, 2, 3, 0, 1);
/* Now, load config*/
- rig_selected_cb (GTK_COMBO_BOX (ctrl->DevSel), ctrl);
+ rig_selected_cb (GTK_COMBO_BOX (ctrl->DevSel), ctrl);
/* Timeout */
label = gtk_label_new (_("Cycle:"));
@@ -677,7 +694,8 @@
{
GtkRigCtrl *ctrl = GTK_RIG_CTRL (data);
GSList *trsplist = NULL;
- gint i;
+ trsp_t *trsp;
+ gint i,n;
i = gtk_combo_box_get_active (satsel);
if (i >= 0) {
@@ -688,10 +706,27 @@
free_pass (ctrl->pass);
ctrl->pass = get_next_pass (ctrl->target, ctrl->qth, 3.0);
+ /* read transponders for new target */
+ load_trsp_list (ctrl);
+
+#if 0
/* get transponders */
- //trsplist = read_tranponders (ctrl->target->tle.catnr);
+ trsplist = read_transponders (ctrl->target->tle.catnr);
- //g_print ("**** %d \n", g_slist_length (trsplist));
+ n = g_slist_length (trsplist);
+ //g_print ("*** %d\n", n);
+ for (i = 0; i < n; i++) {
+ trsp = (trsp_t *) g_slist_nth_data (trsplist, i);
+ g_print ("%s: %.0f/%.0f/%.0f/%.0f/%s\n",
+ trsp->name,
+ trsp->uplow, trsp->uphigh,
+ trsp->downlow, trsp->downhigh,
+ trsp->invert ? "INV" : "NONINV");
+
+ }
+
+ free_transponders (trsplist);
+#endif
}
else {
sat_log_log (SAT_LOG_LEVEL_ERROR,
@@ -708,6 +743,35 @@
}
+/** \brief Manage transponder selections.
+ * \param box Pointer to the transponder selector widget.
+ * \param data Pointer to the GtkRigCtrl structure
+ *
+ * This function is called when the user selects a new transponder.
+ * It updates ctrl->trsp with the new selection.
+ */
+static void trsp_selected_cb (GtkComboBox *box, gpointer data)
+{
+ GtkRigCtrl *ctrl = GTK_RIG_CTRL (data);
+ gint i, n;
+
+ i = gtk_combo_box_get_active (box) - 1; /* 0th element is "Transponder" */
+ n = g_slist_length (ctrl->trsplist);
+
+ if (i == -1) {
+ /* clear transponder data */
+ ctrl->trsp = NULL;
+ }
+ else if (i < n) {
+ ctrl->trsp = (trsp_t *) g_slist_nth_data (ctrl->trsplist, i);
+ }
+ else {
+ sat_log_log (SAT_LOG_LEVEL_BUG,
+ _("%s: Inconsistency detected in internal transponder data (%d,%d)"),
+ __FUNCTION__, i, n);
+ }
+}
+
/** \brief Manage toggle signals (tracking)
* \param button Pointer to the GtkToggle button.
* \param data Pointer to the GtkRigCtrl widget.
@@ -1533,6 +1597,60 @@
}
+/** \brief Load the transponder list for the target satellite.
+ * \param ctrl Pointer to the GtkRigCtrl structure.
+ *
+ * This function loads the transponder list for the currently selected
+ * satellite. The transponder list is loaded into ctrl->trsplist and the
+ * transponder names are added to the ctrl->TrspSel combo box. If any of
+ * these already contain data, it is cleared. The combo box is also cleared
+ * if there are no transponders for the current target, or if there is no
+ * target.
+ */
+static void load_trsp_list (GtkRigCtrl *ctrl)
+{
+ trsp_t *trsp = NULL;
+ guint i,n;
+
+ if (ctrl->trsplist != NULL) {
+ /* clear combo box */
+ n = g_slist_length (ctrl->trsplist);
+ for (i = 0; i < n; i++) {
+ gtk_combo_box_remove_text (GTK_COMBO_BOX (ctrl->TrspSel), 0);
+ }
+
+ /* clear transponder list */
+ free_transponders (ctrl->trsplist);
+ }
+
+ /* check if there is a target satellite */
+ if G_UNLIKELY (ctrl->target == NULL) {
+ sat_log_log (SAT_LOG_LEVEL_MSG,
+ _("%s:%s: GtkSatModule has no target satellite."),
+ __FILE__, __FUNCTION__);
+ return;
+ }
+
+ /* read transponders for new target */
+ ctrl->trsplist = read_transponders (ctrl->target->tle.catnr);
+
+ /* append transponder names to combo box */
+ n = g_slist_length (ctrl->trsplist);
+
+ if (n == 0)
+ return;
+
+ for (i = 0; i < n; i++) {
+ trsp = (trsp_t *) g_slist_nth_data (ctrl->trsplist, i);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (ctrl->TrspSel), trsp->name);
+ }
+
+ /* make an initial selection */
+ ctrl->trsp = (trsp_t *) g_slist_nth_data (ctrl->trsplist, 0);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (ctrl->TrspSel), 0);
+}
+
+
/** \brief Check that we have at least one .rig file */
static gboolean have_conf ()
{
Modified: trunk/src/gtk-rig-ctrl.h
===================================================================
--- trunk/src/gtk-rig-ctrl.h 2009-04-04 22:21:38 UTC (rev 224)
+++ trunk/src/gtk-rig-ctrl.h 2009-04-04 22:38:48 UTC (rev 225)
@@ -34,6 +34,7 @@
#include "sgpsdp/sgp4sdp4.h"
#include "gtk-sat-module.h"
#include "radio-conf.h"
+#include "trsp-conf.h"
#ifdef __cplusplus
extern "C" {
@@ -44,12 +45,12 @@
#define GTK_TYPE_RIG_CTRL (gtk_rig_ctrl_get_type ())
#define GTK_RIG_CTRL(obj) GTK_CHECK_CAST (obj,\
- gtk_rig_ctrl_get_type (),\
- GtkRigCtrl)
+ gtk_rig_ctrl_get_type (),\
+ GtkRigCtrl)
#define GTK_RIG_CTRL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass,\
- gtk_rig_ctrl_get_type (),\
- GtkRigCtrlClass)
+ gtk_rig_ctrl_get_type (),\
+ GtkRigCtrlClass)
#define IS_GTK_RIG_CTRL(obj) GTK_CHECK_TYPE (obj, gtk_rig_ctrl_get_type ())
@@ -61,7 +62,7 @@
struct _gtk_rig_ctrl
{
- GtkVBox vbox;
+ GtkVBox vbox;
GtkWidget *SatFreqDown;
GtkWidget *RigFreqDown;
@@ -77,10 +78,13 @@
GtkWidget *SatRng,*SatRngRate,*SatDop;
/* other widgets */
+ GtkWidget *TrspSel; /*!< Transponder selector */
GtkWidget *DevSel; /*!< Device selector */
GtkWidget *LockBut;
radio_conf_t *conf; /*!< Radio configuration */
+ GSList *trsplist; /*!< List of available transponders */
+ trsp_t *trsp; /*!< Current transponder configuration */
GSList *sats; /*!< List of sats in parent module */
sat_t *target; /*!< Target satellite */
@@ -105,7 +109,7 @@
struct _GtkRigCtrlClass
{
- GtkVBoxClass parent_class;
+ GtkVBoxClass parent_class;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-04-10 13:24:46
|
Revision: 230
http://gpredict.svn.sourceforge.net/gpredict/?rev=230&view=rev
Author: csete
Date: 2009-04-10 13:24:35 +0000 (Fri, 10 Apr 2009)
Log Message:
-----------
Added controls and function for tuning and locking transponders.
Modified Paths:
--------------
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-rig-ctrl.h
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2009-04-10 11:40:03 UTC (rev 229)
+++ trunk/src/gtk-rig-ctrl.c 2009-04-10 13:24:35 UTC (rev 230)
@@ -82,6 +82,8 @@
static void rig_selected_cb (GtkComboBox *box, gpointer data);
static void rig_locked_cb (GtkToggleButton *button, gpointer data);
static void trsp_selected_cb (GtkComboBox *box, gpointer data);
+static void trsp_tune_cb (GtkButton *button, gpointer data);
+static void trsp_lock_cb (GtkToggleButton *button, gpointer data);
static gboolean rig_ctrl_timeout_cb (gpointer data);
/* radio control functions */
@@ -98,6 +100,8 @@
static void load_trsp_list (GtkRigCtrl *ctrl);
static void store_sats (gpointer key, gpointer value, gpointer user_data);
static gboolean have_conf (void);
+static void track_downlink (GtkRigCtrl *ctrl);
+static void track_uplink (GtkRigCtrl *ctrl);
static GtkVBoxClass *parent_class = NULL;
@@ -168,6 +172,7 @@
ctrl->conf = NULL;
ctrl->trsp = NULL;
ctrl->trsplist = NULL;
+ ctrl->trsplock = FALSE;
ctrl->tracking = FALSE;
ctrl->busy = FALSE;
ctrl->engaged = FALSE;
@@ -198,7 +203,7 @@
/* free transponder */
if (ctrl->trsplist != NULL) {
free_transponders (ctrl->trsplist);
- ctrl->trsplist = NULL; /* destroy might is called twice (?) so we need to NULL it */
+ ctrl->trsplist = NULL; /* destroy might be called twice (?) so we need to NULL it */
}
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -474,6 +479,7 @@
GtkWidget *create_target_widgets (GtkRigCtrl *ctrl)
{
GtkWidget *frame,*table,*label,*satsel,*track;
+ GtkWidget *tune,*trsplock,*hbox;
gchar *buff;
guint i, n;
sat_t *sat = NULL;
@@ -506,7 +512,7 @@
gtk_table_attach_defaults (GTK_TABLE (table), track, 3, 4, 0, 1);
g_signal_connect (track, "toggled", G_CALLBACK (track_toggle_cb), ctrl);
- /* Transponder selector */
+ /* Transponder selector, tune, and trsplock buttons */
ctrl->TrspSel = gtk_combo_box_new_text ();
gtk_widget_set_tooltip_text (ctrl->TrspSel, _("Select a transponder"));
load_trsp_list (ctrl);
@@ -514,6 +520,35 @@
g_signal_connect (ctrl->TrspSel, "changed", G_CALLBACK (trsp_selected_cb), ctrl);
gtk_table_attach_defaults (GTK_TABLE (table), ctrl->TrspSel, 0, 3, 1, 2);
+ /* buttons */
+ tune = gtk_button_new_with_label (_("T"));
+ gtk_widget_set_tooltip_text (tune,
+ _("Tune the radio to this transponder. "\
+ "The uplink and downlink will be set to the center of "\
+ "the transponder passband. In case of beacons, only the "\
+ "downlink will be tuned to the beacon frequency."));
+ g_signal_connect (tune, "clicked", G_CALLBACK (trsp_tune_cb), ctrl);
+
+ trsplock = gtk_toggle_button_new_with_label (_("L"));
+ gtk_widget_set_tooltip_text (trsplock,
+ _("Lock the uplink and the downlink to each other. "\
+ "Whenever you change the downlink (in the controller "\
+ "or on the dial, the uplink will track it according "\
+ "to whether the transponder is inverting or not. "\
+ "Similarly, if you change the uplink the downlink "\
+ "will track it automatically.\n\n"\
+ "If the downlink and uplink are initially out of sync "\
+ "when you enable this function, "\
+ "the current downlink frequency will be used as "\
+ "baseline for setting the new uplink frequency."));
+ g_signal_connect (trsplock, "toggled", G_CALLBACK (trsp_lock_cb), ctrl);
+
+ /* box for packing buttons */
+ hbox = gtk_hbox_new (FALSE, 5);
+ gtk_box_pack_start (GTK_BOX (hbox), tune, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), trsplock, TRUE, TRUE, 0);
+ gtk_table_attach_defaults (GTK_TABLE (table), hbox, 3, 4, 1, 2);
+
/* Azimuth */
label = gtk_label_new (_("Az:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
@@ -756,7 +791,7 @@
GtkRigCtrl *ctrl = GTK_RIG_CTRL (data);
gint i, n;
- i = gtk_combo_box_get_active (box) - 1; /* 0th element is "Transponder" */
+ i = gtk_combo_box_get_active (box);
n = g_slist_length (ctrl->trsplist);
if (i == -1) {
@@ -773,6 +808,76 @@
}
}
+
+/** \brief Manage "Tune" events
+ * \param button Pointer to the GtkButton that received the signal.
+ * \param data Pointer to the GtkRigCtrl structure.
+ *
+ * This function is called when the user clicks on the Tune button next to the
+ * transponder selector. When clicked, the radio controller will set the RX and TX
+ * frequencies to the middle of the transponder uplink/downlink bands.
+ *
+ * To avoid conflicts with manual frequency changes on the radio, the sync between
+ * RIG and GPREDICT is invalidated after the tuning operation is performed.
+ *
+ */
+static void trsp_tune_cb (GtkButton *button, gpointer data)
+{
+ GtkRigCtrl *ctrl = GTK_RIG_CTRL (data);
+ gdouble freq;
+
+ if (ctrl->trsp == NULL)
+ return;
+
+ /* tune downlink */
+ if ((ctrl->trsp->downlow > 0.0) && (ctrl->trsp->downhigh > 0.0)) {
+
+ freq = ctrl->trsp->downlow + fabs (ctrl->trsp->downhigh - ctrl->trsp->downlow) / 2;
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->SatFreqDown), freq);
+
+ /* invalidate RIG<->GPREDICT sync */
+ ctrl->lastrxf = 0.0;
+ }
+
+ /* tune uplink */
+ if ((ctrl->trsp->uplow > 0.0) && (ctrl->trsp->uphigh > 0.0)) {
+
+ freq = ctrl->trsp->uplow + fabs (ctrl->trsp->uphigh - ctrl->trsp->uplow) / 2;
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->SatFreqUp), freq);
+
+ /* invalidate RIG<->GPREDICT sync */
+ ctrl->lasttxf = 0.0;
+ }
+
+
+}
+
+
+/** \brief Manage lock transponder signals.
+ * \param button Pointer to the GtkToggleButton that received the signal.
+ * \param data Pointer to the GtkRigCtrl structure.
+ *
+ * This finction is called when the user toggles the "Lock Transponder" button.
+ * When ON, the uplink and downlink are locked according to the current transponder
+ * data, i.e. when user changes the downlink, the uplink will follow automatically
+ * taking into account whether the transponder is inverting or not.
+ */
+static void trsp_lock_cb (GtkToggleButton *button, gpointer data)
+{
+ GtkRigCtrl *ctrl = GTK_RIG_CTRL (data);
+ gdouble offset;
+
+ ctrl->trsplock = gtk_toggle_button_get_active (button);
+
+ /* set uplink according to downlink */
+ if (ctrl->trsplock) {
+ track_downlink (ctrl);
+ }
+}
+
+
+
+
/** \brief Manage toggle signals (tracking)
* \param button Pointer to the GtkToggle button.
* \param data Pointer to the GtkRigCtrl widget.
@@ -1005,10 +1110,11 @@
If radio device is engaged read frequency from radio and compare it to the
last set frequency. If different, it means that user has changed frequency
on the radio dial => update transponder knob
+
+ Note: If ctrl->lastrxf = 0.0 the sync has been invalidated (e.g. user pressed "tune")
+ and no need to execute the dial feedback.
*/
- if (ctrl->engaged) {
- // This is no good because it gets out of sync while PTT = ON
- //lastfreq = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->RigFreqDown));
+ if ((ctrl->engaged) && (ctrl->lastrxf > 0.0)) {
/* check whether PTT is ON */
ptt = ctrl->conf->ptt ? get_ptt (ctrl) : FALSE;
@@ -1118,8 +1224,11 @@
If radio device is engaged read frequency from radio and compare it to the
last set frequency. If different, it means that user has changed frequency
on the radio dial => update transponder knob
+
+ Note: If ctrl->lasttxf = 0.0 the sync has been invalidated (e.g. user pressed "tune")
+ and no need to execute the dial feedback.
*/
- if (ctrl->engaged) {
+ if ((ctrl->engaged) && (ctrl->lasttxf > 0.0)) {
// This is no good because it gets out of sync while PTT = ON
//lastfreq = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->RigFreqDown));
@@ -1223,7 +1332,7 @@
*/
static void exec_trx_cycle (GtkRigCtrl *ctrl)
{
-
+ // FIXME implement
}
@@ -1622,8 +1731,10 @@
/* clear transponder list */
free_transponders (ctrl->trsplist);
+
+ ctrl->trsp = NULL;
}
-
+
/* check if there is a target satellite */
if G_UNLIKELY (ctrl->target == NULL) {
sat_log_log (SAT_LOG_LEVEL_MSG,
@@ -1691,3 +1802,59 @@
return (i > 0) ? TRUE : FALSE;
}
+
+
+/** \brief Track the downlink frequency.
+ * \param ctrl Pointer to the GtkRigCtrl structure.
+ *
+ * This function tracks the downlink frequency by setting the uplink frequency
+ * according to the lower limit of the downlink passband.
+ */
+static void track_downlink (GtkRigCtrl *ctrl)
+{
+ gdouble delta,down,up;
+
+ if (ctrl->trsp == NULL) {
+ return;
+ }
+
+ down = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->SatFreqDown));
+ delta = down - ctrl->trsp->downlow;
+
+ if (ctrl->trsp->invert) {
+ up = ctrl->trsp->uphigh - delta;
+ }
+ else {
+ up = ctrl->trsp->uplow + delta;
+ }
+
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->SatFreqUp), up);
+}
+
+
+/** \brief Track the uplink frequency.
+ * \param ctrl Pointer to the GtkRigCtrl structure.
+ *
+ * This function tracks the uplink frequency by setting the downlink frequency
+ * according to the offset from the lower limit on the uplink passband.
+ */
+static void track_uplink (GtkRigCtrl *ctrl)
+{
+ gdouble delta,down,up;
+
+ if (ctrl->trsp == NULL) {
+ return;
+ }
+
+ up = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->SatFreqUp));
+ delta = up - ctrl->trsp->uplow;
+
+ if (ctrl->trsp->invert) {
+ down = ctrl->trsp->downhigh - delta;
+ }
+ else {
+ down = ctrl->trsp->downlow + delta;
+ }
+
+ gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->SatFreqDown), down);
+}
Modified: trunk/src/gtk-rig-ctrl.h
===================================================================
--- trunk/src/gtk-rig-ctrl.h 2009-04-10 11:40:03 UTC (rev 229)
+++ trunk/src/gtk-rig-ctrl.h 2009-04-10 13:24:35 UTC (rev 230)
@@ -82,9 +82,10 @@
GtkWidget *DevSel; /*!< Device selector */
GtkWidget *LockBut;
- radio_conf_t *conf; /*!< Radio configuration */
+ radio_conf_t *conf; /*!< Radio configuration */
GSList *trsplist; /*!< List of available transponders */
- trsp_t *trsp; /*!< Current transponder configuration */
+ trsp_t *trsp; /*!< Pointer to the current transponder configuration */
+ gboolean trsplock; /*!< Flag indicating whether uplink and downlink are lockled */
GSList *sats; /*!< List of sats in parent module */
sat_t *target; /*!< Target satellite */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-04-10 14:38:50
|
Revision: 233
http://gpredict.svn.sourceforge.net/gpredict/?rev=233&view=rev
Author: csete
Date: 2009-04-10 14:38:49 +0000 (Fri, 10 Apr 2009)
Log Message:
-----------
Changed signal name from freq_changed to freq-changed.
Modified Paths:
--------------
trunk/src/gtk-freq-knob.c
trunk/src/gtk-rig-ctrl.c
Modified: trunk/src/gtk-freq-knob.c
===================================================================
--- trunk/src/gtk-freq-knob.c 2009-04-10 14:36:50 UTC (rev 232)
+++ trunk/src/gtk-freq-knob.c 2009-04-10 14:38:49 UTC (rev 233)
@@ -118,7 +118,7 @@
object_class->destroy = gtk_freq_knob_destroy;
/* create freq changed signal */
- freq_changed_signal = g_signal_new ("freq_changed",
+ freq_changed_signal = g_signal_new ("freq-changed",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
0, //G_STRUCT_OFFSET (GtkFreqKnobClass, tictactoe),
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2009-04-10 14:36:50 UTC (rev 232)
+++ trunk/src/gtk-rig-ctrl.c 2009-04-10 14:38:49 UTC (rev 233)
@@ -379,7 +379,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);
+ g_signal_connect (ctrl->SatFreqDown, "freq-changed", G_CALLBACK (downlink_changed_cb), ctrl);
gtk_box_pack_start_defaults (GTK_BOX (vbox), ctrl->SatFreqDown);
/* Downlink doppler */
@@ -441,7 +441,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);
+ g_signal_connect (ctrl->SatFreqUp, "freq-changed", G_CALLBACK (uplink_changed_cb), ctrl);
gtk_box_pack_start_defaults (GTK_BOX (vbox), ctrl->SatFreqUp);
/* Uplink doppler */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2009-04-11 13:05:20
|
Revision: 237
http://gpredict.svn.sourceforge.net/gpredict/?rev=237&view=rev
Author: csete
Date: 2009-04-11 13:05:09 +0000 (Sat, 11 Apr 2009)
Log Message:
-----------
Check-in current code before test session.
Modified Paths:
--------------
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-rig-ctrl.h
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2009-04-11 12:02:25 UTC (rev 236)
+++ trunk/src/gtk-rig-ctrl.c 2009-04-11 13:05:09 UTC (rev 237)
@@ -33,6 +33,11 @@
* popup menu and each module can have several radio control windows
* attached to it. Note, however, that current implementation only
* allows one control window per module.
+ *
+ * TODO Simplex TRX
+ * TODO Duplex TRX
+ * TODO Separate uplink rig
+ * TODO Transponder passband display somewhere
*
*/
#include <gtk/gtk.h>
@@ -79,7 +84,8 @@
static void sat_selected_cb (GtkComboBox *satsel, gpointer data);
static void track_toggle_cb (GtkToggleButton *button, gpointer data);
static void delay_changed_cb (GtkSpinButton *spin, gpointer data);
-static void rig_selected_cb (GtkComboBox *box, gpointer data);
+static void primary_rig_selected_cb (GtkComboBox *box, gpointer data);
+static void secondary_rig_selected_cb (GtkComboBox *box, gpointer data);
static void rig_engaged_cb (GtkToggleButton *button, gpointer data);
static void trsp_selected_cb (GtkComboBox *box, gpointer data);
static void trsp_tune_cb (GtkButton *button, gpointer data);
@@ -94,9 +100,10 @@
static void exec_tx_cycle (GtkRigCtrl *ctrl);
static void exec_trx_cycle (GtkRigCtrl *ctrl);
static void exec_duplex_cycle (GtkRigCtrl *ctrl);
-static gboolean set_freq_simplex (GtkRigCtrl *ctrl, gdouble freq);
-static gboolean get_freq_simplex (GtkRigCtrl *ctrl, gdouble *freq);
-static gboolean get_ptt (GtkRigCtrl *ctrl);
+static void exec_dual_rig_cycle (GtkRigCtrl *ctrl);
+static gboolean set_freq_simplex (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble freq);
+static gboolean get_freq_simplex (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble *freq);
+static gboolean get_ptt (GtkRigCtrl *ctrl, radio_conf_t *conf);
static void update_count_down (GtkRigCtrl *ctrl, gdouble t);
/* misc utility functions */
@@ -173,6 +180,7 @@
ctrl->pass = NULL;
ctrl->qth = NULL;
ctrl->conf = NULL;
+ ctrl->conf2 = NULL;
ctrl->trsp = NULL;
ctrl->trsplist = NULL;
ctrl->trsplock = FALSE;
@@ -202,6 +210,12 @@
g_free (ctrl->conf);
ctrl->conf = NULL;
}
+ if (ctrl->conf2 != NULL) {
+ g_free (ctrl->conf2->name);
+ g_free (ctrl->conf2->host);
+ g_free (ctrl->conf2);
+ ctrl->conf2 = NULL;
+ }
/* free transponder */
if (ctrl->trsplist != NULL) {
@@ -609,18 +623,18 @@
- table = gtk_table_new (3, 3, FALSE);
+ table = gtk_table_new (4, 3, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
-
- label = gtk_label_new (_("Device:"));
+ /* Primary device */
+ label = gtk_label_new (_("1. Device:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
ctrl->DevSel = gtk_combo_box_new_text ();
- gtk_widget_set_tooltip_text (ctrl->DevSel, _("Select radio device"));
+ gtk_widget_set_tooltip_text (ctrl->DevSel, _("Select primary radio device."));
/* open configuration directory */
cfgdir = get_conf_dir ();
@@ -652,10 +666,30 @@
g_dir_close (dir);
gtk_combo_box_set_active (GTK_COMBO_BOX (ctrl->DevSel), 0);
- g_signal_connect (ctrl->DevSel, "changed", G_CALLBACK (rig_selected_cb), ctrl);
+ g_signal_connect (ctrl->DevSel, "changed", G_CALLBACK (primary_rig_selected_cb), ctrl);
gtk_table_attach_defaults (GTK_TABLE (table), ctrl->DevSel, 1, 2, 0, 1);
/* config will be force-loaded after LO spin is created */
+ /* Secondary device */
+ label = gtk_label_new (_("2. Device:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2);
+
+ ctrl->DevSel2 = gtk_combo_box_new_text ();
+ gtk_widget_set_tooltip_text (ctrl->DevSel2, _("Select secondary radio device, if you want "\
+ "to use a transmitter other than the primary "\
+ "device."));
+
+ /* load config */
+ gtk_combo_box_append_text (GTK_COMBO_BOX (ctrl->DevSel2), _("None"));
+ gtk_combo_box_set_active (GTK_COMBO_BOX (ctrl->DevSel2), 0);
+
+ //gtk_combo_box_set_active (GTK_COMBO_BOX (ctrl->DevSel), 0);
+ g_signal_connect (ctrl->DevSel2, "changed", G_CALLBACK (secondary_rig_selected_cb), ctrl);
+ gtk_table_attach_defaults (GTK_TABLE (table), ctrl->DevSel2, 1, 2, 1, 2);
+
+
+
/* Engage button */
ctrl->LockBut = gtk_toggle_button_new_with_label (_("Engage"));
gtk_widget_set_tooltip_text (ctrl->LockBut, _("Engage the selcted radio device"));
@@ -663,28 +697,27 @@
gtk_table_attach_defaults (GTK_TABLE (table), ctrl->LockBut, 2, 3, 0, 1);
/* Now, load config*/
- rig_selected_cb (GTK_COMBO_BOX (ctrl->DevSel), ctrl);
+ primary_rig_selected_cb (GTK_COMBO_BOX (ctrl->DevSel), ctrl);
/* Timeout */
label = gtk_label_new (_("Cycle:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 1, 2);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4);
timer = gtk_spin_button_new_with_range (100, 5000, 10);
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (timer), 0);
gtk_widget_set_tooltip_text (timer,
_("This parameter controls the delay between "\
- "commands sent to the rigator."));
+ "commands sent to the rig."));
gtk_spin_button_set_value (GTK_SPIN_BUTTON (timer), ctrl->delay);
g_signal_connect (timer, "value-changed", G_CALLBACK (delay_changed_cb), ctrl);
- gtk_table_attach (GTK_TABLE (table), timer, 1, 2, 1, 2,
+ gtk_table_attach (GTK_TABLE (table), timer, 1, 2, 3, 4,
GTK_FILL, GTK_FILL, 0, 0);
label = gtk_label_new (_("msec"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 1, 2);
+ gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 3, 4);
-
frame = gtk_frame_new (_("Settings"));
gtk_container_add (GTK_CONTAINER (frame), table);
@@ -919,7 +952,7 @@
-/** \brief New rig device selected.
+/** \brief New primary rig device selected.
* \param box Pointer to the rigor selector combo box.
* \param data Pointer to the GtkRigCtrl widget.
*
@@ -927,7 +960,7 @@
* device.
*/
static void
-rig_selected_cb (GtkComboBox *box, gpointer data)
+primary_rig_selected_cb (GtkComboBox *box, gpointer data)
{
GtkRigCtrl *ctrl = GTK_RIG_CTRL (data);
gchar *buff;
@@ -958,9 +991,12 @@
buff = g_strdup_printf (_("%.0f MHz"), ctrl->conf->lo/1.0e6);
gtk_label_set_text (GTK_LABEL (ctrl->LoDown), buff);
g_free (buff);
- buff = g_strdup_printf (_("%.0f MHz"), ctrl->conf->loup/1.0e6);
- gtk_label_set_text (GTK_LABEL (ctrl->LoUp), buff);
- g_free (buff);
+ /* uplink LO only if single device */
+ if (ctrl->conf2 == NULL) {
+ buff = g_strdup_printf (_("%.0f MHz"), ctrl->conf->loup/1.0e6);
+ gtk_label_set_text (GTK_LABEL (ctrl->LoUp), buff);
+ g_free (buff);
+ }
//gtk_spin_button_set_value (GTK_SPIN_BUTTON (ctrl->LO), ctrl->conf->lo/1.0e6);
}
@@ -979,7 +1015,83 @@
}
+/** \brief New secondary rig device selected.
+ * \param box Pointer to the rigor selector combo box.
+ * \param data Pointer to the GtkRigCtrl widget.
+ *
+ * This function is called when the user selects a new rig controller
+ * device for the secondary radio. This radio is used for uplink only.
+ */
+static void
+secondary_rig_selected_cb (GtkComboBox *box, gpointer data)
+{
+ GtkRigCtrl *ctrl = GTK_RIG_CTRL (data);
+ gchar *buff;
+
+
+ /* free previous configuration */
+ if (ctrl->conf2 != NULL) {
+ g_free (ctrl->conf2->name);
+ g_free (ctrl->conf2->host);
+ g_free (ctrl->conf2);
+ ctrl->conf2 = NULL;
+ }
+
+ if (gtk_combo_box_get_active (box) == 0) {
+ /* first entry is "None" */
+
+ /* reset uplink LO to what's in ctrl->conf */
+ if (ctrl->conf != NULL) {
+ buff = g_strdup_printf (_("%.0f MHz"), ctrl->conf->loup/1.0e6);
+ gtk_label_set_text (GTK_LABEL (ctrl->LoUp), buff);
+ g_free (buff);
+ }
+
+ return;
+ }
+
+ /* else load new device */
+ ctrl->conf2 = g_try_new (radio_conf_t, 1);
+ if (ctrl->conf2 == NULL) {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%d: Failed to allocate memory for radio config"),
+ __FILE__, __LINE__);
+ return;
+ }
+
+ /* load new configuration */
+ ctrl->conf2->name = gtk_combo_box_get_active_text (box);
+ if (radio_conf_read (ctrl->conf2)) {
+ sat_log_log (SAT_LOG_LEVEL_MSG,
+ _("Loaded new radio configuration %s"),
+ ctrl->conf2->name);
+ /* update LO widgets */
+ //buff = g_strdup_printf (_("%.0f MHz"), ctrl->conf2->lo/1.0e6);
+ //gtk_label_set_text (GTK_LABEL (ctrl->LoDown), buff);
+ //g_free (buff);
+ buff = g_strdup_printf (_("%.0f MHz"), ctrl->conf2->loup/1.0e6);
+ gtk_label_set_text (GTK_LABEL (ctrl->LoUp), buff);
+ g_free (buff);
+ //gtk_spin_button_set_value (GTK_SPIN_BUTTON (ctrl->LO), ctrl->conf->lo/1.0e6);
+ }
+ else {
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s:%d: Failed to load radio configuration %s"),
+ __FILE__, __LINE__, ctrl->conf->name);
+
+ g_free (ctrl->conf2->name);
+ if (ctrl->conf2->host)
+ g_free (ctrl->conf2->host);
+ g_free (ctrl->conf2);
+ ctrl->conf2 = NULL;
+ }
+
+}
+
+
+
+
/** \brief Manage Engage button signals.
* \param button Pointer to the "Engage" button.
* \param data Pointer to the GtkRigCtrl widget.
@@ -995,6 +1107,7 @@
if (!gtk_toggle_button_get_active (button)) {
/* close socket */
gtk_widget_set_sensitive (ctrl->DevSel, TRUE);
+ gtk_widget_set_sensitive (ctrl->DevSel2, TRUE);
ctrl->engaged = FALSE;
ctrl->lasttxf = 0.0;
ctrl->lastrxf = 0.0;
@@ -1009,37 +1122,46 @@
}
gtk_widget_set_sensitive (ctrl->DevSel, FALSE);
+ gtk_widget_set_sensitive (ctrl->DevSel2, FALSE);
ctrl->engaged = TRUE;
ctrl->wrops = 0;
/* set initial frequency */
-
- switch (ctrl->conf->type) {
- case RIG_TYPE_RX:
- ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
- set_freq_simplex (ctrl, ctrl->lastrxf);
- break;
- case RIG_TYPE_TX:
- ctrl->lasttxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqUp));
- set_freq_simplex (ctrl, ctrl->lasttxf);
- break;
- case RIG_TYPE_TRX:
- case RIG_TYPE_DUPLEX:
- if (get_ptt (ctrl)) {
+ if (ctrl->conf2 != NULL) {
+ /* set initial dual mode */
+ ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
+ set_freq_simplex (ctrl, ctrl->conf, ctrl->lastrxf);
+ ctrl->lasttxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqUp));
+ set_freq_simplex (ctrl, ctrl->conf2, ctrl->lasttxf);
+ }
+ else {
+ switch (ctrl->conf->type) {
+ case RIG_TYPE_RX:
+ ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
+ set_freq_simplex (ctrl, ctrl->conf, ctrl->lastrxf);
+ break;
+ case RIG_TYPE_TX:
ctrl->lasttxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqUp));
- set_freq_simplex (ctrl, ctrl->lasttxf);
- }
- else {
+ set_freq_simplex (ctrl, ctrl->conf, ctrl->lasttxf);
+ break;
+ case RIG_TYPE_TRX:
+ case RIG_TYPE_DUPLEX:
+ if (get_ptt (ctrl, ctrl->conf)) {
+ ctrl->lasttxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqUp));
+ set_freq_simplex (ctrl, ctrl->conf, ctrl->lasttxf);
+ }
+ else {
+ ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
+ set_freq_simplex (ctrl, ctrl->conf, ctrl->lastrxf);
+ }
+ break;
+ default:
+ /* this is an error! */
+ ctrl->conf->type = RIG_TYPE_RX;
ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
- set_freq_simplex (ctrl, ctrl->lastrxf);
- }
- break;
- default:
- /* this is an error! */
- ctrl->conf->type = RIG_TYPE_RX;
- ctrl->lastrxf = gtk_freq_knob_get_value (GTK_FREQ_KNOB(ctrl->RigFreqDown));
- set_freq_simplex (ctrl, ctrl->lastrxf);
- break;
+ set_freq_simplex (ctrl, ctrl->conf, ctrl->lastrxf);
+ break;
+ }
}
}
}
@@ -1096,32 +1218,37 @@
ctrl->busy = TRUE;
- /* Execute controller cycle depending on radio type */
- switch (ctrl->conf->type) {
+ if (ctrl->conf2 != NULL) {
+ exec_dual_rig_cycle (ctrl);
+ }
+ else {
+ /* Execute controller cycle depending on primary radio type */
+ switch (ctrl->conf->type) {
- case RIG_TYPE_RX:
- exec_rx_cycle (ctrl);
- break;
+ case RIG_TYPE_RX:
+ exec_rx_cycle (ctrl);
+ break;
- case RIG_TYPE_TX:
- exec_tx_cycle (ctrl);
- break;
+ case RIG_TYPE_TX:
+ exec_tx_cycle (ctrl);
+ break;
- case RIG_TYPE_TRX:
- exec_trx_cycle (ctrl);
- break;
+ case RIG_TYPE_TRX:
+ exec_trx_cycle (ctrl);
+ break;
- case RIG_TYPE_DUPLEX:
- exec_duplex_cycle (ctrl);
- break;
+ case RIG_TYPE_DUPLEX:
+ exec_duplex_cycle (ctrl);
+ break;
- default:
- /* invalid mode */
- sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("%s: Invalid radio type %d. Setting type to RIG_TYPE_RX"),
- __FUNCTION__, ctrl->conf->type);
- ctrl->conf->type = RIG_TYPE_RX;
+ default:
+ /* invalid mode */
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("%s: Invalid radio type %d. Setting type to RIG_TYPE_RX"),
+ __FUNCTION__, ctrl->conf->type);
+ ctrl->conf->type = RIG_TYPE_RX;
+ }
}
//g_print (" WROPS = %d\n", ctrl->wrops);
@@ -1136,6 +1263,7 @@
* \param ctrl Pointer to the GtkRigCtrl widget.
*
* This function executes a controller cycle when the device is of RIG_TYPE_RX.
+ * This function is not used dual-rig mode.
*/
static void exec_rx_cycle (GtkRigCtrl *ctrl)
{
@@ -1155,10 +1283,10 @@
if ((ctrl->engaged) && (ctrl->lastrxf > 0.0)) {
/* check whether PTT is ON */
- ptt = ctrl->conf->ptt ? get_ptt (ctrl) : FALSE;
+ ptt = ctrl->conf->ptt ? get_ptt (ctrl, ctrl->conf) : FALSE;
if (ptt == FALSE) {
- if (!get_freq_simplex (ctrl, &readfreq)) {
+ if (!get_freq_simplex (ctrl, ctrl->conf, &readfreq)) {
/* error => use a passive value */
readfreq = ctrl->lastrxf;
ctrl->errcnt++;
@@ -1210,20 +1338,20 @@
/* uplink */
doppler = -satfrequ * (ctrl->target->range_rate / 299792.4580);
gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp),
- satfrequ + doppler - ctrl->conf->lo);
+ satfrequ + doppler - ctrl->conf->loup);
}
else {
gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown),
satfreqd - ctrl->conf->lo);
gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp),
- satfrequ - ctrl->conf->lo);
+ satfrequ - ctrl->conf->loup );
}
tmpfreq = gtk_freq_knob_get_value(GTK_FREQ_KNOB(ctrl->RigFreqDown));
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (ptt == FALSE) && (fabs(ctrl->lastrxf - tmpfreq) > 0.99)) {
- if (set_freq_simplex (ctrl, tmpfreq)) {
+ if (set_freq_simplex (ctrl, ctrl->conf, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
ctrl->lastrxf = tmpfreq;
@@ -1250,7 +1378,8 @@
/** \brief Execute TX mode cycle.
* \param ctrl Pointer to the GtkRigCtrl widget.
*
- * This function executes a controller cycle when the device is of RIG_TYPE_TX.
+ * This function executes a controller cycle when the primary device is of RIG_TYPE_TX.
+ * This function is not used in dual-rig mode.
*/
static void exec_tx_cycle (GtkRigCtrl *ctrl)
{
@@ -1272,10 +1401,10 @@
//lastfreq = gtk_freq_knob_get_value (GTK_FREQ_KNOB (ctrl->RigFreqDown));
/* check whether PTT is ON */
- ptt = ctrl->conf->ptt ? get_ptt (ctrl) : FALSE;
+ ptt = ctrl->conf->ptt ? get_ptt (ctrl, ctrl->conf) : FALSE;
if (ptt == TRUE) {
- if (!get_freq_simplex (ctrl, &readfreq)) {
+ if (!get_freq_simplex (ctrl, ctrl->conf, &readfreq)) {
/* error => use a passive value */
readfreq = ctrl->lasttxf;
ctrl->errcnt++;
@@ -1327,20 +1456,20 @@
/* uplink */
doppler = -satfrequ * (ctrl->target->range_rate / 299792.4580);
gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp),
- satfrequ + doppler - ctrl->conf->lo);
+ satfrequ + doppler - ctrl->conf->loup);
}
else {
gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqDown),
satfreqd - ctrl->conf->lo);
gtk_freq_knob_set_value (GTK_FREQ_KNOB (ctrl->RigFreqUp),
- satfrequ - ctrl->conf->lo);
+ satfrequ - ctrl->conf->loup);
}
tmpfreq = gtk_freq_knob_get_value(GTK_FREQ_KNOB(ctrl->RigFreqUp));
/* if device is engaged, send freq command to radio */
if ((ctrl->engaged) && (ptt == TRUE) && (fabs(ctrl->lasttxf - tmpfreq) > 0.99)) {
- if (set_freq_simplex (ctrl, tmpfreq)) {
+ if (set_freq_simplex (ctrl, ctrl->conf, tmpfreq)) {
/* reset error counter */
ctrl->errcnt = 0;
ctrl->lasttxf = tmpfreq;
@@ -1369,10 +1498,17 @@
* \param ctrl Pointer to the GtkRigCtrl widget.
*
* This function executes a controller cycle when the device is of RIG_TYPE_TRX (simplex).
+ * Technically, the function simply checks the PTT status and executes either exec_tx_cycle()
+ * or exec_rx_cycle().
*/
static void exec_trx_cycle (GtkRigCtrl *ctrl)
{
- // FIXME implement
+ if (get_ptt (ctrl, ctrl->conf) == TRUE) {
+ exec_tx_cycle (ctrl);
+ }
+ else {
+ exec_rx_cycle (ctrl);
+ }
}
@@ -1387,13 +1523,29 @@
exec_trx_cycle (ctrl);
}
+/** \brief Execute dual-rig cycle.
+ * \param ctrl Pointer to the GtkRigCtrl widget.
+ *
+ * This function executes a controller cycle when we use a primary device for
+ * downlink and a secondary device for uplink.
+ */
+static void exec_dual_rig_cycle (GtkRigCtrl *ctrl)
+{
+ //FIXME implement
+
+ /* Execute downlink cycle using ctrl->conf */
+
+
+ /* Execute uplink cycle using ctrl->conf2 */
+}
+
/** \brief Get PTT status
* \param ctrl Pointer to the GtkRigVtrl widget.
* \return TRUE if PTT is ON, FALSE if PTT is OFF or an error occurred.
*
*/
-static gboolean get_ptt (GtkRigCtrl *ctrl)
+static gboolean get_ptt (GtkRigCtrl *ctrl, radio_conf_t *conf)
{
gchar *buff,**vbuff;
gint written,size;
@@ -1420,22 +1572,22 @@
memset(&ServAddr, 0, sizeof(ServAddr)); /* Zero out structure */
ServAddr.sin_family = AF_INET; /* Internet address family */
- h = gethostbyname(ctrl->conf->host);
+ h = gethostbyname(conf->host);
memcpy((char *) &ServAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
- ServAddr.sin_port = htons(ctrl->conf->port); /* Server port */
+ ServAddr.sin_port = htons(conf->port); /* Server port */
/* establish connection */
status = connect(sock, (struct sockaddr *) &ServAddr, sizeof(ServAddr));
if (status < 0) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
_("%s:%d: Failed to connect to %s:%d"),
- __FILE__, __LINE__, ctrl->conf->host, ctrl->conf->port);
+ __FILE__, __LINE__, conf->host, conf->port);
return FALSE;
}
else {
sat_log_log (SAT_LOG_LEVEL_DEBUG,
_("%s:%d: Connection opened to %s:%d"),
- __FILE__, __LINE__, ctrl->conf->host, ctrl->conf->port);
+ __FILE__, __LINE__, conf->host, conf->port);
}
/* send command (get_ptt: t) */
@@ -1500,7 +1652,7 @@
* gotten the current frequency from the ctrl; however, the param
* might become useful in the future.
*/
-static gboolean set_freq_simplex (GtkRigCtrl *ctrl, gdouble freq)
+static gboolean set_freq_simplex (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble freq)
{
gchar *buff;
gint written,size;
@@ -1525,22 +1677,22 @@
memset(&ServAddr, 0, sizeof(ServAddr)); /* Zero out structure */
ServAddr.sin_family = AF_INET; /* Internet address family */
- h = gethostbyname(ctrl->conf->host);
+ h = gethostbyname(conf->host);
memcpy((char *) &ServAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
- ServAddr.sin_port = htons(ctrl->conf->port); /* Server port */
+ ServAddr.sin_port = htons(conf->port); /* Server port */
/* establish connection */
status = connect(sock, (struct sockaddr *) &ServAddr, sizeof(ServAddr));
if (status < 0) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
_("%s: Failed to connect to %s:%d"),
- __FUNCTION__, ctrl->conf->host, ctrl->conf->port);
+ __FUNCTION__, conf->host, conf->port);
return FALSE;
}
else {
sat_log_log (SAT_LOG_LEVEL_DEBUG,
_("%s: Connection opened to %s:%d"),
- __FUNCTION__, ctrl->conf->host, ctrl->conf->port);
+ __FUNCTION__, conf->host, conf->port);
}
/* send command */
@@ -1569,7 +1721,7 @@
* \return TRUE if the operation was successful, FALSE if a connection error
* occurred.
*/
-static gboolean get_freq_simplex (GtkRigCtrl *ctrl, gdouble *freq)
+static gboolean get_freq_simplex (GtkRigCtrl *ctrl, radio_conf_t *conf, gdouble *freq)
{
gchar *buff,**vbuff;
gint written,size;
@@ -1578,7 +1730,7 @@
struct sockaddr_in ServAddr;
gint sock; /*!< Network socket */
-
+
if (freq == NULL) {
sat_log_log (SAT_LOG_LEVEL_BUG,
_("%s:%d: NULL storage."),
@@ -1602,22 +1754,22 @@
memset(&ServAddr, 0, sizeof(ServAddr)); /* Zero out structure */
ServAddr.sin_family = AF_INET; /* Internet address family */
- h = gethostbyname(ctrl->conf->host);
+ h = gethostbyname(conf->host);
memcpy((char *) &ServAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
- ServAddr.sin_port = htons(ctrl->conf->port); /* Server port */
+ ServAddr.sin_port = htons(conf->port); /* Server port */
/* establish connection */
status = connect(sock, (struct sockaddr *) &ServAddr, sizeof(ServAddr));
if (status < 0) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
_("%s:%d: Failed to connect to %s:%d"),
- __FILE__, __LINE__, ctrl->conf->host, ctrl->conf->port);
+ __FILE__, __LINE__, conf->host, conf->port);
return FALSE;
}
else {
sat_log_log (SAT_LOG_LEVEL_DEBUG,
_("%s:%d: Connection opened to %s:%d"),
- __FILE__, __LINE__, ctrl->conf->host, ctrl->conf->port);
+ __FILE__, __LINE__, conf->host, conf->port);
}
/* send command */
Modified: trunk/src/gtk-rig-ctrl.h
===================================================================
--- trunk/src/gtk-rig-ctrl.h 2009-04-11 12:02:25 UTC (rev 236)
+++ trunk/src/gtk-rig-ctrl.h 2009-04-11 13:05:09 UTC (rev 237)
@@ -80,9 +80,11 @@
/* other widgets */
GtkWidget *TrspSel; /*!< Transponder selector */
GtkWidget *DevSel; /*!< Device selector */
+ GtkWidget *DevSel2; /*!< Second device selector */
GtkWidget *LockBut;
radio_conf_t *conf; /*!< Radio configuration */
+ radio_conf_t *conf2; /*!< Secondary radio configuration */
GSList *trsplist; /*!< List of available transponders */
trsp_t *trsp; /*!< Pointer to the current transponder configuration */
gboolean trsplock; /*!< Flag indicating whether uplink and downlink are lockled */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|