[Gpredict-svn] SF.net SVN: gpredict:[829] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2011-06-04 23:37:27
|
Revision: 829
http://gpredict.svn.sourceforge.net/gpredict/?rev=829&view=rev
Author: csete
Date: 2011-06-04 23:37:21 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
Attempt to fix bug #3272993: Issue controlling Yaesu FT-847.
Coding style clean up.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/gtk-rig-ctrl.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2011-06-04 21:23:11 UTC (rev 828)
+++ trunk/ChangeLog 2011-06-04 23:37:21 UTC (rev 829)
@@ -1,3 +1,10 @@
+2011-06-04 Alexandru Csete <oz9aec at gmail.com>
+
+ * src/gtk-rig-ctrl.c:
+ Attempt to fix bug #3272993: Issue controlling Yaesu FT-847.
+ Coding style clean up.
+
+
2011-06-04 Charles Suprin <hamaa1vs at gmail.com>
* src/gtk-sat-map.c
@@ -4,6 +11,7 @@
* src/gtk-polar-view.c
Reset satellite when reseting NAOS in sat-map and polar views.
+
2011-05-31 Charles Suprin <hamaa1vs at gmail.com>
* src/sgpsdp/sgp_time.c
@@ -14,6 +22,7 @@
Fixes Bug 3309110: 100% on manual time adjustment.
Fixes part of Ubuntu Bug #789691.
+
2011-05-26 Charles Suprin <hamaa1vs at gmail.com>
* src/gtk-single-sat.c
@@ -25,6 +34,7 @@
Save selected satellite in single sat view.
Part of Feature Request: 3179738
+
2011-05-14 Charles Suprin <hamaa1vs at gmail.com>
* data/trsp/25338.trsp
@@ -32,6 +42,7 @@
* data/trsp/27543.trsp
Update NOAA-15,-16,-17 transponder frequencies.
+
2011-05-01 Alexandru Csete <oz9aec at gmail.com>
* src/gtk-sat-module-popup.c
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2011-06-04 21:23:11 UTC (rev 828)
+++ trunk/src/gtk-rig-ctrl.c 2011-06-04 23:37:21 UTC (rev 829)
@@ -118,6 +118,7 @@
static gboolean get_ptt (GtkRigCtrl *ctrl, gint sock);
static gboolean set_ptt (GtkRigCtrl *ctrl, gint sock, gboolean ptt);
static gboolean set_vfo (GtkRigCtrl *ctrl, vfo_t vfo);
+static gboolean setup_split(GtkRigCtrl *ctrl);
static void update_count_down (GtkRigCtrl *ctrl, gdouble t);
static gboolean open_rigctld_socket(radio_conf_t *conf, gint *sock);
static gboolean close_rigctld_socket(gint *sock);
@@ -1248,6 +1249,8 @@
break;
case RIG_TYPE_DUPLEX:
+ /* set rig into SAT mode (hamlib needs it even if rig already in SAT) */
+ setup_split(ctrl);
exec_duplex_cycle (ctrl);
break;
@@ -1269,6 +1272,53 @@
}
+/** \brief Setup VFOs for split operation (simplex or duplex)
+ * \param ctrl Pointer to the GtkRigCtrl structure.
+ * \return TRUE if the operation was succesful, FALSE if an error occurred.
+ *
+ * This function is used to setup the VFOs for split operation. For full
+ * duplex radios this will enable the SAT mode (True for FT847 but TBC for others).
+ * See bug #3272993
+ */
+static gboolean setup_split(GtkRigCtrl *ctrl)
+{
+ gchar *buff;
+ gchar buffback[128];
+ gboolean retcode;
+
+ /* select TX VFO */
+ switch (ctrl->conf->vfoUp) {
+ case VFO_A:
+ buff = g_strdup("S 1 A\x0a");
+ break;
+
+ case VFO_B:
+ buff = g_strdup("S 1 B\x0a");
+ break;
+
+ case VFO_MAIN:
+ buff = g_strdup("S 1 Main\x0a");
+ break;
+
+ case VFO_SUB:
+ buff = g_strdup("S 1 Sub\x0a");
+ break;
+
+ default:
+ sat_log_log(SAT_LOG_LEVEL_ERROR,
+ _("%s called but TX VFO is %d."), __FUNCTION__, ctrl->conf->vfoUp);
+ return FALSE;
+ }
+
+ retcode=send_rigctld_command(ctrl, ctrl->sock, buff, buffback, 128);
+
+ g_free(buff);
+
+ return(check_set_response(buffback, retcode, __FUNCTION__));
+
+}
+
+
/** \brief Manage downlink frequency change callbacks.
* \param knob Pointer to the GtkFreqKnob widget that received the signal.
* \param data Pointer to the GtkRigCtrl structure.
@@ -1709,22 +1759,20 @@
* \param ctrl Pointer to the GtkRigCtrl widget.
*
* This function executes a controller cycle when the device is of RIG_TYPE_DUPLEX.
+ * The RIG should already be in SAT mode.
*/
static void exec_duplex_cycle (GtkRigCtrl *ctrl)
-{
+{
if (ctrl->engaged) {
- /* Downlink */
- set_vfo (ctrl, ctrl->conf->vfoDown);
exec_rx_cycle (ctrl);
-
- /* Uplink */
- set_vfo (ctrl, ctrl->conf->vfoUp);
- exec_tx_cycle (ctrl);
+ exec_toggle_tx_cycle (ctrl);
}
else {
/* still execute cycles to update UI widgets
- no data will be sent to RIG */
+ * no data will be sent to RIG */
exec_rx_cycle (ctrl);
+ /* toggle_tx does nothing when not engaged
+ * (was originally written for FT-817-like rigs) */
exec_tx_cycle (ctrl);
}
}
@@ -2732,16 +2780,28 @@
return TRUE;
}
-/*simple function to sort the list of satellites in the combo box.*/
-static gint sat_name_compare (sat_t* a,sat_t*b){
+/** \brief Simple function to sort the list of satellites in the combo box.
+ * \return TBC
+ */
+static gint sat_name_compare (sat_t *a, sat_t *b)
+{
return (gpredict_strcmp(a->nickname,b->nickname));
}
-static gint rig_name_compare (const gchar* a,const gchar *b){
+/** \brief Simple function to sort the list of rigs in the combo box.
+ * \return TBC
+ */
+static gint rig_name_compare (const gchar *a, const gchar *b){
return (gpredict_strcmp(a,b));
}
-static inline gboolean check_set_response (gchar *buffback,gboolean retcode,const gchar *function){
+/** \brief Check hamlib rigctld response
+ * \param buffback
+ * \param retcode
+ * \param function
+ * \return TRUE if the check was successful?
+ */
+static inline gboolean check_set_response (gchar *buffback, gboolean retcode, const gchar *function){
if (retcode==TRUE)
if (strncmp(buffback,"RPRT 0",6)!=0) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
@@ -2753,6 +2813,12 @@
return retcode;
}
+/** \brief Check hamlib rigctld response
+ * \param buffback
+ * \param retcode
+ * \param function
+ * \return TRUE if the check was successful?
+ */
static inline gboolean check_get_response (gchar *buffback,gboolean retcode,const gchar *function){
if (retcode==TRUE)
if (strncmp(buffback,"RPRT",4)==0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|