Name
gscope_interface -- Interface data structures for the gscope package.
Description
The data structures below allow applications to specify their signals and
parameters to gscope.
Details
enum GscopeSignalDataType
typedef enum {
INTEGER, SHORT, FLOAT, FUNC, NONE
} GscopeSignalDataType; |
Data type of a signal or a parameter. This data type determines how a signal is
read from the application and how a parameter is read from or written to the
application.
enum gscope_rw_flag
typedef enum {
GSCOPE_READ_DATA, GSCOPE_WRITE_DATA
} gscope_rw_flag; |
When a signal is specified as a function of type GSCOPE_RW_FUNC (see
GscopeSignalDataType), this flag is passed as the first parameter to the
function.
GSCOPE_RW_FUNC ()
void (*GSCOPE_RW_FUNC) (gscope_rw_flag read_write_flag,
void *arg1,
void *arg2,
float *value); |
This is a function type. Functions of this type allow gscope signals and
parameters to be read and write arbitrary data.
GscopeSignalData
typedef struct {
GscopeSignalDataType type;
void *obj;
void *arg1;
void *arg2;
} GscopeSignalData; |
Gscope signal data is encapsulated in this structure. Depending on the type
(see GscopeSignalDataType), obj is a pointer to an integer, short, float or a
function. arg1 and arg2 are used when obj is a function of type
GSCOPE_RW_FUNC and the arg1 and arg2 values are passed to the function when
the obj function is invoked.
enum GscopeSignalLine
typedef enum {
STEP_SIGNAL = 0x0, LINE_SIGNAL = 0x1, POINT_SIGNAL = 0x2,
VERTICAL_SIGNAL = 0x3, NO_LINE_SIGNAL = 0x4
} GscopeSignalLine; |
Different types of lines drawn by the scope.
GscopeSignal
typedef struct {
char *title;
GscopeSignalData signal;
gchar *color;
gfloat min;
gfloat max;
GscopeSignalLine line;
gboolean hidden;
gfloat filter;
} GscopeSignal; |
Signal data type passed to the scope. Title is the name of the signal. signal
allows reading and writing signal data. color is the signal color. When color
is not specified, the system chooses an arbitrary color for the signal. Min and
max are minimum and maximum values that will be plotted on the scope by default
(when yzoom is 1 and ybias is 0). line is the signal line type. hidden
determines whether is signal is hidden (it is visible by default). filter is a
value between 0 and 1. When it is 0 (the default), the signal is not low-pass
filtered.
GscopeParameter
typedef struct {
char *title;
GscopeSignalData parameter;
gfloat lower; /* The lower and upper values are not enforced when
lower == upper */
gfloat upper;
} GscopeParameter; |
Parameter data type passed to the scope. Its fields are similar to the fields in
GscopeSignal. Title is the name of the parameter. Lower and upper ensure
that a parameter value is never set below or above these values. Parameters can
be placed hierarchically. For hierarchical parameters, make the title have
slashes. For instance, two parameters with titles "ipv4/ip_forward" and
"ipv4/tcp_keepalive_time" will be grouped under the name "ipv4" in the
preferences menu.