[Gpredict-svn] SF.net SVN: gpredict:[56] trunk/src
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2008-08-20 14:03:26
|
Revision: 56 http://gpredict.svn.sourceforge.net/gpredict/?rev=56&view=rev Author: csete Date: 2008-08-20 14:03:35 +0000 (Wed, 20 Aug 2008) Log Message: ----------- Changed from hamlib C API to TCP based configuration. Modified Paths: -------------- trunk/src/radio-conf.c trunk/src/radio-conf.h trunk/src/rotor-conf.c trunk/src/rotor-conf.h Modified: trunk/src/radio-conf.c =================================================================== --- trunk/src/radio-conf.c 2008-08-20 13:03:23 UTC (rev 55) +++ trunk/src/radio-conf.c 2008-08-20 14:03:35 UTC (rev 56) @@ -35,15 +35,7 @@ #include "radio-conf.h" #define GROUP "Radio" -#define KEY_MODEL "Model" -#define KEY_ID "ID" -#define KEY_TYPE "Type" -#define KEY_PORT "Port" -#define KEY_SPEED "Speed" -#define KEY_CIV "CIV" -#define KEY_EXT "EXT" -#define KEY_DTR "DTR" -#define KEY_RTS "RTS" +#define KEY_HOST "Host" /** \brief Read radio configuration. @@ -86,15 +78,7 @@ g_free (fname); /* read parameters */ - conf->model = g_key_file_get_string (cfg, GROUP, KEY_MODEL, NULL); - conf->id = g_key_file_get_integer (cfg, GROUP, KEY_ID, NULL); - conf->type = g_key_file_get_integer (cfg, GROUP, KEY_TYPE, NULL); - conf->port = g_key_file_get_string (cfg, GROUP, KEY_PORT, NULL); - conf->speed = g_key_file_get_integer (cfg, GROUP, KEY_SPEED, NULL); - conf->civ = g_key_file_get_integer (cfg, GROUP, KEY_CIV, NULL); - conf->ext = g_key_file_get_boolean (cfg, GROUP, KEY_EXT, NULL); - conf->dtr = g_key_file_get_integer (cfg, GROUP, KEY_DTR, NULL); - conf->rts = g_key_file_get_integer (cfg, GROUP, KEY_RTS, NULL); + conf->host = g_key_file_get_string (cfg, GROUP, KEY_HOST, NULL); g_key_file_free (cfg); @@ -123,15 +107,7 @@ /* create a config structure */ cfg = g_key_file_new(); - g_key_file_set_string (cfg, GROUP, KEY_MODEL, conf->model); - g_key_file_set_integer (cfg, GROUP, KEY_ID, conf->id); - g_key_file_set_integer (cfg, GROUP, KEY_TYPE, conf->type); - g_key_file_set_string (cfg, GROUP, KEY_PORT, conf->port); - g_key_file_set_integer (cfg, GROUP, KEY_SPEED, conf->speed); - g_key_file_set_integer (cfg, GROUP, KEY_CIV, conf->civ); - g_key_file_set_boolean (cfg, GROUP, KEY_EXT, conf->ext); - g_key_file_set_integer (cfg, GROUP, KEY_DTR, conf->dtr); - g_key_file_set_integer (cfg, GROUP, KEY_RTS, conf->rts); + g_key_file_set_string (cfg, GROUP, KEY_HOST, conf->host); /* 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-08-20 13:03:23 UTC (rev 55) +++ trunk/src/radio-conf.h 2008-08-20 14:03:35 UTC (rev 56) @@ -34,40 +34,15 @@ -/** \brief RS232 control line usage definitions. */ -typedef enum { - LINE_UNDEF = 0, /*!< Undefined. */ - LINE_OFF, /*!< Line should be permanently OFF. */ - LINE_ON, /*!< Line should be permanently ON. */ - LINE_PTT, /*!< Line used for PTT control. */ - LINE_CW /*!< Line used for CW keying. */ -} ctrl_stat_t; - - -/** \brief Radio type definitions. */ -typedef enum { - RADIO_TYPE_RX = 0, /*!< Radio used as receiver only. */ - RADIO_TYPE_TX, /*!< Radio used as TX only. */ - RADIO_TYPE_TRX, /*!< Radio use as both TX and RX. */ - RADIO_TYPE_FULL_DUP /*!< Full duplex radio. */ -} radio_type_t; - /** \brief Radio configuration. */ typedef struct { - gchar *name; /*!< Configuration file name, less .rig. */ - gchar *model; /*!< Radio model, e.g. ICOM IC-910H. */ - guint id; /*!< Hamlib ID. */ - radio_type_t type; /*!< Radio type. */ - gchar *port; /*!< Device name, e.g. /dev/ttyS0. */ - guint speed; /*!< Serial speed. */ - guint civ; /*!< ICOM CI-V address. */ - gboolean ext; /*!< Use built in extensions if available. */ - ctrl_stat_t dtr; /*!< DTR line usage. */ - ctrl_stat_t rts; /*!< PTT line usage. */ + gchar *name; /*!< Configuration file name, without .rig. */ + gchar *host; /*!< hostname:port */ } radio_conf_t; gboolean radio_conf_read (radio_conf_t *conf); void radio_conf_save (radio_conf_t *conf); + #endif Modified: trunk/src/rotor-conf.c =================================================================== --- trunk/src/rotor-conf.c 2008-08-20 13:03:23 UTC (rev 55) +++ trunk/src/rotor-conf.c 2008-08-20 14:03:35 UTC (rev 56) @@ -35,11 +35,7 @@ #include "rotor-conf.h" #define GROUP "Rotator" -#define KEY_MODEL "Model" -#define KEY_ID "ID" -#define KEY_TYPE "Type" -#define KEY_PORT "Port" -#define KEY_SPEED "Speed" +#define KEY_HOST "Host" #define KEY_MINAZ "MinAz" #define KEY_MAXAZ "MaxAz" #define KEY_MINEL "MinEl" @@ -86,15 +82,11 @@ g_free (fname); /* read parameters */ - conf->model = g_key_file_get_string (cfg, GROUP, KEY_MODEL, NULL); - conf->id = g_key_file_get_integer (cfg, GROUP, KEY_ID, NULL); - conf->type = g_key_file_get_integer (cfg, GROUP, KEY_TYPE, NULL); - conf->port = g_key_file_get_string (cfg, GROUP, KEY_PORT, NULL); - conf->speed = g_key_file_get_integer (cfg, GROUP, KEY_SPEED, NULL); - conf->minaz = g_key_file_get_integer (cfg, GROUP, KEY_MINAZ, NULL); - conf->maxaz = g_key_file_get_integer (cfg, GROUP, KEY_MAXAZ, NULL); - conf->minel = g_key_file_get_integer (cfg, GROUP, KEY_MINEL, NULL); - conf->maxel = g_key_file_get_integer (cfg, GROUP, KEY_MAXEL, NULL); + conf->host = g_key_file_get_string (cfg, GROUP, KEY_HOST, NULL); + conf->minaz = g_key_file_get_double (cfg, GROUP, KEY_MINAZ, NULL); + conf->maxaz = g_key_file_get_double (cfg, GROUP, KEY_MAXAZ, NULL); + conf->minel = g_key_file_get_double (cfg, GROUP, KEY_MINEL, NULL); + conf->maxel = g_key_file_get_double (cfg, GROUP, KEY_MAXEL, NULL); g_key_file_free (cfg); @@ -123,15 +115,11 @@ /* create a config structure */ cfg = g_key_file_new(); - g_key_file_set_string (cfg, GROUP, KEY_MODEL, conf->model); - g_key_file_set_integer (cfg, GROUP, KEY_ID, conf->id); - g_key_file_set_integer (cfg, GROUP, KEY_TYPE, conf->type); - g_key_file_set_string (cfg, GROUP, KEY_PORT, conf->port); - g_key_file_set_integer (cfg, GROUP, KEY_SPEED, conf->speed); - g_key_file_set_integer (cfg, GROUP, KEY_MINAZ, conf->minaz); - g_key_file_set_integer (cfg, GROUP, KEY_MAXAZ, conf->maxaz); - g_key_file_set_integer (cfg, GROUP, KEY_MINEL, conf->minel); - g_key_file_set_integer (cfg, GROUP, KEY_MAXEL, conf->maxel); + g_key_file_set_string (cfg, GROUP, KEY_HOST, conf->host); + g_key_file_set_double (cfg, GROUP, KEY_MINAZ, conf->minaz); + g_key_file_set_double (cfg, GROUP, KEY_MAXAZ, conf->maxaz); + g_key_file_set_double (cfg, GROUP, KEY_MINEL, conf->minel); + g_key_file_set_double (cfg, GROUP, KEY_MAXEL, conf->maxel); /* convert to text sdata */ data = g_key_file_to_data (cfg, &len, NULL); Modified: trunk/src/rotor-conf.h =================================================================== --- trunk/src/rotor-conf.h 2008-08-20 13:03:23 UTC (rev 55) +++ trunk/src/rotor-conf.h 2008-08-20 14:03:35 UTC (rev 56) @@ -35,26 +35,14 @@ -/** \brief Rotator type definitions. */ -typedef enum { - ROTOR_TYPE_AZ = 1, /*!< Azimuth rotator. */ - ROTOR_TYPE_EL = 2, /*!< Elevation rotator. */ - ROTOR_TYPE_AZEL = 3 /*!< Both azimuth and elevation rotator. */ -} rotor_type_t; - - /** \brief Rotator configuration. */ typedef struct { gchar *name; /*!< Configuration file name, less .rot */ - gchar *model; /*!< Rotator model. */ - guint id; /*!< Hamlib ID. */ - rotor_type_t type; /*!< Rotator type. */ - gchar *port; /*!< Device name, e.g. /dev/ttyS0. */ - guint speed; /*!< Serial speed. */ - gint minaz; /*!< Lower azimuth limit */ - gint maxaz; /*!< Upper azimuth limit */ - gint minel; /*!< Lower elevation limit */ - gint maxel; /*!< Upper elevation limit */ + gchar *host; /*!< hostname:port */ + gdouble minaz; /*!< Lower azimuth limit */ + gdouble maxaz; /*!< Upper azimuth limit */ + gdouble minel; /*!< Lower elevation limit */ + gdouble maxel; /*!< Upper elevation limit */ } rotor_conf_t; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |