[Gpredict-svn] SF.net SVN: gpredict:[288] trunk/src
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2009-05-09 23:53:33
|
Revision: 288
http://gpredict.svn.sourceforge.net/gpredict/?rev=288&view=rev
Author: csete
Date: 2009-05-09 23:53:19 +0000 (Sat, 09 May 2009)
Log Message:
-----------
Added parameter to store uplink and downlink VFOs for full-duplex capable radios.
Modified Paths:
--------------
trunk/src/radio-conf.c
trunk/src/radio-conf.h
Modified: trunk/src/radio-conf.c
===================================================================
--- trunk/src/radio-conf.c 2009-05-09 14:57:34 UTC (rev 287)
+++ trunk/src/radio-conf.c 2009-05-09 23:53:19 UTC (rev 288)
@@ -41,6 +41,8 @@
#define KEY_LOUP "LO_UP"
#define KEY_TYPE "Type"
#define KEY_PTT "PTT"
+#define KEY_VFO_DOWN "VFO_DOWN"
+#define KEY_VFO_UP "VFO_UP"
/** \brief Read radio configuration.
@@ -142,6 +144,7 @@
conf->loup = 0.0;
}
+ /* Radio type */
conf->type = g_key_file_get_integer (cfg, GROUP, KEY_TYPE, &error);
if (error != NULL) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
@@ -152,6 +155,7 @@
return FALSE;
}
+ /* PTT Type */
conf->ptt = g_key_file_get_integer (cfg, GROUP, KEY_PTT, &error);
if (error != NULL) {
sat_log_log (SAT_LOG_LEVEL_ERROR,
@@ -161,6 +165,35 @@
g_key_file_free (cfg);
return FALSE;
}
+
+ /* VFO up and down, only if radio is full-duplex */
+ if (conf->type == RIG_TYPE_DUPLEX) {
+
+ /* downlink */
+ if (g_key_file_has_key (cfg, GROUP, KEY_VFO_DOWN, NULL)) {
+ conf->vfoDown = g_key_file_get_integer (cfg, GROUP, KEY_VFO_DOWN, &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);
+ conf->vfoDown = VFO_SUB;
+ }
+ }
+
+ /* uplink */
+ if (g_key_file_has_key (cfg, GROUP, KEY_VFO_UP, NULL)) {
+ conf->vfoUp = g_key_file_get_integer (cfg, GROUP, KEY_VFO_UP, &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);
+ conf->vfoUp = VFO_MAIN;
+ }
+ }
+
+ }
g_key_file_free (cfg);
@@ -204,6 +237,11 @@
g_key_file_set_integer (cfg, GROUP, KEY_TYPE, conf->type);
g_key_file_set_integer (cfg, GROUP, KEY_PTT, conf->ptt);
+ if (conf->type == RIG_TYPE_DUPLEX) {
+ g_key_file_set_integer (cfg, GROUP, KEY_VFO_UP, conf->vfoUp);
+ g_key_file_set_integer (cfg, GROUP, KEY_VFO_DOWN, conf->vfoDown);
+ }
+
/* convert to text sdata */
data = g_key_file_to_data (cfg, &len, NULL);
Modified: trunk/src/radio-conf.h
===================================================================
--- trunk/src/radio-conf.h 2009-05-09 14:57:34 UTC (rev 287)
+++ trunk/src/radio-conf.h 2009-05-09 23:53:19 UTC (rev 288)
@@ -47,6 +47,13 @@
PTT_TYPE_DCD /*!< Read PTT using get_dcd */
} ptt_type_t;
+typedef enum {
+ VFO_A = 0,
+ VFO_B,
+ VFO_MAIN,
+ VFO_SUB
+} vfo_t;
+
/** \brief Radio configuration. */
typedef struct {
gchar *name; /*!< Configuration file name, without .rig. */
@@ -57,6 +64,8 @@
gdouble loup; /*!< local oscillator freq in Hz for uplink. */
rig_type_t type; /*!< Radio type */
ptt_type_t ptt; /*!< PTT type (needed for RX, TX, and TRX) */
+ vfo_t vfoDown; /*!< Downlink VFO for full-duplex radios */
+ vfo_t vfoUp; /*!< Uplink VFO for full-duplex radios */
} radio_conf_t;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|