kopia lustrzana https://github.com/Hamlib/Hamlib
Move amp_state definition to include/hamlib/amp_state.h
rodzic
f03fefe1cd
commit
cc4b1ce7db
|
@ -24,6 +24,46 @@
|
|||
#define _AMP_STATE_H 1
|
||||
|
||||
__BEGIN_DECLS
|
||||
/**
|
||||
* \brief Amplifier state structure.
|
||||
*
|
||||
* \struct amp_state
|
||||
*
|
||||
* This structure contains live data, as well as a copy of capability fields
|
||||
* that may be updated, i.e. customized while the #AMP handle is instantiated.
|
||||
*
|
||||
* It is fine to move fields around, as this kind of struct should not be
|
||||
* initialized like amp_caps are.
|
||||
*/
|
||||
struct amp_state
|
||||
{
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
//---Start cut here---
|
||||
hamlib_port_t_deprecated ampport_deprecated; /*!< Amplifier port (internal use). Deprecated */
|
||||
//---End cut here---
|
||||
|
||||
int comm_state; /*!< Comm port state, opened/closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private amplifier state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
setting_t has_get_level; /*!< List of get levels. */
|
||||
setting_t has_set_level; /*!< List of set levels. */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
|
||||
hamlib_port_t ampport; /*!< Amplifier port (internal use). */
|
||||
};
|
||||
|
||||
#if defined(IN_HAMLIB)
|
||||
#define AMPSTATE(a) (&(a)->state)
|
||||
#endif
|
||||
#define HAMLIB_AMPSTATE(a) ((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE))
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
|
|
@ -264,42 +264,20 @@ struct amp_caps
|
|||
const char *macro_name; /*!< Amplifier model macro name. */
|
||||
};
|
||||
|
||||
//---Start cut here---
|
||||
// Amp state structure definition moved to include/hamlib/amp_state.h
|
||||
// Temporary include until 5.0
|
||||
#ifndef NO_OLD_INCLUDES
|
||||
|
||||
/**
|
||||
* \brief Amplifier state structure.
|
||||
*
|
||||
* \struct amp_state
|
||||
*
|
||||
* This structure contains live data, as well as a copy of capability fields
|
||||
* that may be updated, i.e. customized while the #AMP handle is instantiated.
|
||||
*
|
||||
* It is fine to move fields around, as this kind of struct should not be
|
||||
* initialized like amp_caps are.
|
||||
*/
|
||||
struct amp_state
|
||||
{
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
hamlib_port_t_deprecated ampport_deprecated; /*!< Amplifier port (internal use). Deprecated */
|
||||
#include <hamlib/amp_state.h>
|
||||
|
||||
int comm_state; /*!< Comm port state, opened/closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private amplifier state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
setting_t has_get_level; /*!< List of get levels. */
|
||||
setting_t has_set_level; /*!< List of set levels. */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
|
||||
hamlib_port_t ampport; /*!< Amplifier port (internal use). */
|
||||
};
|
||||
__BEGIN_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
//---End cut here---
|
||||
/**
|
||||
* \brief Master amplifier structure.
|
||||
*
|
||||
|
|
|
@ -2393,7 +2393,7 @@ __BEGIN_DECLS
|
|||
// " " " #define ROTPORT(r) (&r->state.rotport)
|
||||
// " " " #define ROTPORT2(r) (&r->state.rotport2)
|
||||
//Moved to include/hamlib/rig_state.h #define STATE(r) (&r->state)
|
||||
#define AMPSTATE(a) (&(a)->state)
|
||||
//Moved to include/hamlib/amp_state.h #define AMPSTATE(a) (&(a)->state)
|
||||
#define ROTSTATE(r) (&(r)->state)
|
||||
/* Then when the rigport address is stored as a pointer somewhere else(say,
|
||||
* in the rig structure itself), the definition could be changed to
|
||||
|
@ -2410,7 +2410,7 @@ __BEGIN_DECLS
|
|||
//#define HAMLIB_ROTPORT(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT))
|
||||
//#define HAMLIB_ROTPORT2(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT2))
|
||||
//#define HAMLIB_STATE(r) ((struct rig_state *)rig_data_pointer(r, RIG_PTRX_STATE))
|
||||
#define HAMLIB_AMPSTATE(a) ((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE))
|
||||
//#define HAMLIB_AMPSTATE(a) ((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE))
|
||||
#define HAMLIB_ROTSTATE(r) ((struct rot_state *)rot_data_pointer(r, RIG_PTRX_ROTSTATE))
|
||||
#endif
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue