Expanded ROT_TYPE definitions in rotator.h

Set dummy rotor to ROT_TYPE_AZEL
Set rotorez rotor type to ROT_TYPE_AZ and added get_info()



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2830 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.11
Nate Bargmann, N0NB 2010-02-14 22:06:40 +00:00
rodzic 6763e8e750
commit 786e53ce50
4 zmienionych plików z 49 dodań i 21 usunięć

Wyświetl plik

@ -100,7 +100,7 @@ static int dummy_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv;
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %.2f %.2f\n", __func__,
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %.2f %.2f\n", __func__,
az, el);
priv->target_az = az;
@ -214,6 +214,7 @@ static int dummy_rot_move(ROT *rot, int direction, int speed)
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_debug(RIG_DEBUG_TRACE, "%s: Direction = %d, Speed = %d\n", __func__, direction, speed);
switch(direction) {
case ROT_MOVE_UP:
@ -255,7 +256,7 @@ const struct rot_caps dummy_rot_caps = {
.version = "0.2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rot_type = ROT_TYPE_OTHER,
.rot_type = ROT_TYPE_AZEL,
.port_type = RIG_PORT_NONE,
.min_az = -180.,

Wyświetl plik

@ -90,16 +90,18 @@ typedef float azimuth_t;
typedef int rot_reset_t;
/*! \def ROT_FLAG_AZIMUTH
* \brief A macro that returns the azimuth flag.
*/
/*! \def ROT_FLAG_ELEVATION
* \brief A macro that returns the elevation flag.
*/
#define ROT_FLAG_AZIMUTH (1<<1)
#define ROT_FLAG_ELEVATION (1<<2)
/** \brief Rotator type flags */
typedef enum {
ROT_FLAG_AZIMUTH = (1<<1), /*!< Azimuth */
ROT_FLAG_ELEVATION = (1<<2) /*!< Elevation */
} rot_type_t;
#define ROT_TYPE_OTHER 0
#define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
#define ROT_TYPE_OTHER 0
#define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
#define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
#define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
/*! \def ROT_MOVE_UP
@ -250,7 +252,7 @@ struct rot_caps {
};
/*!
/*!
* Rotator state
* \struct rot_state
* \brief Live data and customized fields.
@ -267,7 +269,7 @@ struct rot_state {
*/
azimuth_t min_az; /*!< Lower limit for azimuth (overridable). */
azimuth_t max_az; /*!< Upper limit for azimuth (overridable). */
elevation_t min_el; /*!< Lower limit for elevation (overridable). */
elevation_t min_el; /*!< Lower limit for elevation (overridable). */
elevation_t max_el; /*!< Upper limit for elevation (overridable). */
/*
@ -285,7 +287,7 @@ struct rot_state {
/**
* Rotator structure
* \struct rot
* \brief This is the master data structure,
* \brief This is the master data structure,
* acting as a handle for the controlled rotator.
*
* This is the master data structure, acting as a handle for the controlled
@ -334,15 +336,15 @@ extern HAMLIB_EXPORT(token_t) rot_token_lookup HAMLIB_PARAMS((ROT *rot, const ch
extern HAMLIB_EXPORT(const struct rot_caps *) rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int) qrb HAMLIB_PARAMS((double lon1, double lat1,
double lon2, double lat2,
extern HAMLIB_EXPORT(int) qrb HAMLIB_PARAMS((double lon1, double lat1,
double lon2, double lat2,
double *distance, double *azimuth));
extern HAMLIB_EXPORT(double) distance_long_path HAMLIB_PARAMS((double distance));
extern HAMLIB_EXPORT(double) azimuth_long_path HAMLIB_PARAMS((double azimuth));
extern HAMLIB_EXPORT(int) longlat2locator HAMLIB_PARAMS((double longitude,
double latitude, char *locator_res, int pair_count));
extern HAMLIB_EXPORT(int) locator2longlat HAMLIB_PARAMS((double *longitude,
extern HAMLIB_EXPORT(int) locator2longlat HAMLIB_PARAMS((double *longitude,
double *latitude, const char *locator));
extern HAMLIB_EXPORT(double) dms2dec HAMLIB_PARAMS((int degrees, int minutes,

Wyświetl plik

@ -87,7 +87,7 @@ static const struct confparams rotorez_cfg_params[] = {
/* *************************************
*
* Seperate model capabilities
* Separate model capabilities
*
* *************************************
*/
@ -132,6 +132,7 @@ const struct rot_caps rotorez_rot_caps = {
.get_position = rotorez_rot_get_position,
.stop = rotorez_rot_stop,
.set_conf = rotorez_rot_set_conf,
.get_info = rotorez_rot_get_info,
};
@ -175,6 +176,8 @@ const struct rot_caps rotorcard_rot_caps = {
.get_position = rotorez_rot_get_position,
.stop = rotorez_rot_stop,
.set_conf = rotorez_rot_set_conf,
.get_info = rotorez_rot_get_info,
};
@ -213,6 +216,7 @@ const struct rot_caps dcu_rot_caps = {
.rot_init = rotorez_rot_init,
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rotorez_rot_set_position,
.get_info = rotorez_rot_get_info,
};
@ -236,12 +240,12 @@ static int rotorez_rot_init(ROT *rot) {
if (!rot)
return -RIG_EINVAL;
priv = (struct rotorez_rot_priv_data*)
priv = (struct rotorez_rot_priv_data *)
malloc(sizeof(struct rotorez_rot_priv_data));
if (!priv)
return -RIG_ENOMEM;
rot->state.priv = (void*)priv;
rot->state.priv = (void *)priv;
rot->state.rotport.type.rig = RIG_PORT_SERIAL;
@ -468,6 +472,25 @@ static int rotorez_rot_set_conf(ROT *rot, token_t token, const char *val) {
}
/*
* Get Info
* returns the model name string
*/
static const char *rotorez_rot_get_info(ROT *rot)
{
const struct rot_caps *rc;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (!rot)
return (const char *)-RIG_EINVAL;
rc = rot->caps;
return rc->model_name;
}
/*
* Send command string to rotor
*/

Wyświetl plik

@ -49,7 +49,7 @@ extern const struct rot_caps dcu_rot_caps;
#define TOK_OVRSHT TOKEN_BACKEND(3)
#define TOK_UNSTICK TOKEN_BACKEND(4)
/*
/*
* API local implementation
*
*/
@ -64,5 +64,7 @@ static int rotorez_rot_stop(ROT *rot);
static int rotorez_rot_set_conf(ROT *rot, token_t token, const char *val);
static const char *rotorez_rot_get_info(ROT *rot);
#endif /* _ROT_ROTOREZ_H */