[Gpredict-svn] SF.net SVN: gpredict: [3] trunk/src
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2008-01-12 13:15:07
|
Revision: 3 http://gpredict.svn.sourceforge.net/gpredict/?rev=3&view=rev Author: csete Date: 2008-01-12 05:15:12 -0800 (Sat, 12 Jan 2008) Log Message: ----------- Added parameter for radio type (RX, TX, TRX, FULL_DUP). Modified Paths: -------------- trunk/src/radio-conf.c trunk/src/radio-conf.h Modified: trunk/src/radio-conf.c =================================================================== --- trunk/src/radio-conf.c 2008-01-08 22:51:02 UTC (rev 2) +++ trunk/src/radio-conf.c 2008-01-12 13:15:12 UTC (rev 3) @@ -38,6 +38,7 @@ #define KEY_MFG "Company" #define KEY_MODEL "Model" #define KEY_ID "ID" +#define KEY_TYPE "Type" #define KEY_PORT "Port" #define KEY_SPEED "Speed" #define KEY_CIV "CIV" @@ -45,12 +46,13 @@ #define KEY_RTS "RTS" -/** \brief REad radio configuration. +/** \brief Read radio configuration. * \param conf Pointer to a radio_conf_t structure where the data will be * stored. * + * This function reads a radio configuration from a .rig file into conf. * conf->name must contain the file name of the configuration (no path, just - * file). + * file name). */ gboolean radio_conf_read (radio_conf_t *conf) { @@ -87,6 +89,7 @@ conf->company = g_key_file_get_string (cfg, GROUP, KEY_MFG, NULL); 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); @@ -99,6 +102,13 @@ } +/** \brief Save radio configuration. + * \param conf Pointer to the radio configuration. + * + * This function saves the radio configuration stored in conf to a + * .rig file. conf->name must contain the file name of the configuration + * (no path, just file name). + */ void radio_conf_save (radio_conf_t *conf) { GKeyFile *cfg = NULL; @@ -115,7 +125,8 @@ g_key_file_set_string (cfg, GROUP, KEY_MFG, conf->company); g_key_file_set_string (cfg, GROUP, KEY_MODEL, conf->model); - g_key_file_set_integer (cfg, GROUP, KEY_MFG, conf->id); + 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); Modified: trunk/src/radio-conf.h =================================================================== --- trunk/src/radio-conf.h 2008-01-08 22:51:02 UTC (rev 2) +++ trunk/src/radio-conf.h 2008-01-12 13:15:12 UTC (rev 3) @@ -34,24 +34,35 @@ - +/** \brief RS232 control line usage definitions. */ typedef enum { - LINE_OFF = 0, - LINE_ON, - LINE_PTT, - LINE_CW + LINE_OFF = 0, /*!< 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; - gchar *company; - gchar *model; - guint id; - gchar *port; - guint speed; - guint civ; - ctrl_stat_t dtr; - ctrl_stat_t rts; + gchar *name; /*!< Configuration file name. */ + gchar *company; /*!< Manufacturer, e.g. ICOM. */ + gchar *model; /*!< Radio model, e.g. 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. */ + ctrl_stat_t dtr; /*!< DTR line usage. */ + ctrl_stat_t rts; /*!< PTT line usage. */ } radio_conf_t; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |