[Gpredict-svn] SF.net SVN: gpredict:[180] trunk/src
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2008-12-27 23:57:52
|
Revision: 180
http://gpredict.svn.sourceforge.net/gpredict/?rev=180&view=rev
Author: csete
Date: 2008-12-27 23:57:42 +0000 (Sat, 27 Dec 2008)
Log Message:
-----------
Added parameters for rig type and PTT.
Modified Paths:
--------------
trunk/src/radio-conf.c
trunk/src/radio-conf.h
Modified: trunk/src/radio-conf.c
===================================================================
--- trunk/src/radio-conf.c 2008-12-27 21:43:37 UTC (rev 179)
+++ trunk/src/radio-conf.c 2008-12-27 23:57:42 UTC (rev 180)
@@ -38,6 +38,8 @@
#define KEY_HOST "Host"
#define KEY_PORT "Port"
#define KEY_LO "LO"
+#define KEY_TYPE "Type"
+#define KEY_PTT "READ_PTT"
/** \brief Read radio configuration.
@@ -117,6 +119,26 @@
return FALSE;
}
+ conf->type = g_key_file_get_integer (cfg, GROUP, KEY_TYPE, &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->ptt = g_key_file_get_boolean (cfg, GROUP, KEY_PTT, &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;
+ }
+
g_key_file_free (cfg);
sat_log_log (SAT_LOG_LEVEL_MSG,
@@ -155,6 +177,8 @@
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_integer (cfg, GROUP, KEY_TYPE, conf->type);
+ g_key_file_set_boolean (cfg, GROUP, KEY_PTT, conf->ptt);
/* convert to text sdata */
data = g_key_file_to_data (cfg, &len, NULL);
Modified: trunk/src/radio-conf.h
===================================================================
--- trunk/src/radio-conf.h 2008-12-27 21:43:37 UTC (rev 179)
+++ trunk/src/radio-conf.h 2008-12-27 23:57:42 UTC (rev 180)
@@ -33,7 +33,15 @@
#include <glib.h>
+/** \brief Radio types. */
+typedef enum {
+ RIG_TYPE_RX = 0, /*!< Rig can only be used as receiver */
+ RIG_TYPE_TX, /*!< Rig can only be used as transmitter */
+ RIG_TYPE_TRX, /*!< Rig can be used as RX/TX (simplex only) */
+ RIG_TYPE_DUPLEX /*!< Rig is a full duplex radio, e.g. IC910 */
+} rig_type_t;
+
/** \brief Radio configuration. */
typedef struct {
gchar *name; /*!< Configuration file name, without .rig. */
@@ -41,6 +49,8 @@
gint port; /*!< port number */
gdouble lo; /*!< local oscillator freq in Hz (using double for
compatibility with rest of code) */
+ 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.
|