[Gpredict-svn] SF.net SVN: gpredict:[633] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2010-07-11 11:27:22
|
Revision: 633
http://gpredict.svn.sourceforge.net/gpredict/?rev=633&view=rev
Author: csete
Date: 2010-07-11 11:27:16 +0000 (Sun, 11 Jul 2010)
Log Message:
-----------
Updated RIG_TYPE_TOGGLE_AUTO controller to perform TX frequency update only once every 10 seconds.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/gtk-rig-ctrl.c
trunk/src/gtk-rig-ctrl.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-11 11:07:23 UTC (rev 632)
+++ trunk/ChangeLog 2010-07-11 11:27:16 UTC (rev 633)
@@ -10,7 +10,12 @@
Added function to set_ptt().
Implemented controller for RIG_TYPE_ROGGLE_MAN (FT-817/857/897 manual TX).
+ * src/gtk-rig-ctrl.c:
+ * src/gtk-rig-ctrl.h:
+ Updated RIG_TYPE_TOGGLE_AUTO controller to perform TX frequency update only
+ once every 10 seconds.
+
2010-07-09 Alexandru Csete <oz9aec at gmail.com>
* src/radio-conf.h:
Modified: trunk/src/gtk-rig-ctrl.c
===================================================================
--- trunk/src/gtk-rig-ctrl.c 2010-07-11 11:07:23 UTC (rev 632)
+++ trunk/src/gtk-rig-ctrl.c 2010-07-11 11:27:16 UTC (rev 633)
@@ -204,6 +204,7 @@
ctrl->errcnt = 0;
ctrl->lastrxf = 0.0;
ctrl->lasttxf = 0.0;
+ ctrl->last_toggle_tx = -1;
}
static void gtk_rig_ctrl_destroy (GtkObject *object)
@@ -1217,6 +1218,7 @@
case RIG_TYPE_TOGGLE_AUTO:
case RIG_TYPE_TOGGLE_MAN:
set_toggle (ctrl,ctrl->conf);
+ ctrl->last_toggle_tx = -1;
exec_toggle_cycle (ctrl);
break;
@@ -1589,10 +1591,24 @@
exec_rx_cycle (ctrl);
/* TX cycle is executed only if user selected RIG_TYPE_TOGGLE_AUTO
- * In manual mode the TX freq update is performed only when TX isactivated
+ * In manual mode the TX freq update is performed only when TX is activated.
+ * Even in auto mode, the toggling is performed only once every 10 seconds.
*/
- if (ctrl->conf->type == RIG_TYPE_TOGGLE_AUTO)
- exec_toggle_tx_cycle (ctrl);
+ if (ctrl->conf->type == RIG_TYPE_TOGGLE_AUTO) {
+
+ GTimeVal current_time;
+
+ /* get the current time */
+ g_get_current_time (¤t_time);
+
+ if ((ctrl->last_toggle_tx == -1) || ((current_time.tv_sec - ctrl->last_toggle_tx) >= 10)) {
+ /* it's time to update TX freq */
+ exec_toggle_tx_cycle (ctrl);
+
+ /* store current time */
+ ctrl->last_toggle_tx = current_time.tv_sec;
+ }
+ }
}
/** \brief Execute TX mode cycle.
Modified: trunk/src/gtk-rig-ctrl.h
===================================================================
--- trunk/src/gtk-rig-ctrl.h 2010-07-11 11:07:23 UTC (rev 632)
+++ trunk/src/gtk-rig-ctrl.h 2010-07-11 11:27:16 UTC (rev 633)
@@ -106,6 +106,9 @@
gdouble lasttxf; /*!< Last frequency sent to tranmitter. */
gdouble du,dd; /*!< Last computed up/down Doppler shift; computed in update() */
+ glong last_toggle_tx; /*!< Last time when exec_toggle_tx_cycle() was executed (seconds)
+ -1 indicates that an update should be performed ASAP */
+
/* debug related */
guint wrops;
guint rdops;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|