gii_phystype, gii_valrange, gii_cmddata_getvalinfo — GII valuators description
#include <ggi/events.h>
typedef struct gii_valrange { sint32 min, center, max; } gii_valrange;
typedef enum { GII_PT_UNKNOWN, /* unknown */ GII_PT_TIME, /* base unit s */ GII_PT_FREQUENCY, /* base unit 1/s (Hz) */ GII_PT_LENGTH, /* base unit m */ GII_PT_VELOCITY, /* base unit m/s */ GII_PT_ACCELERATION, /* base unit m/s^2 */ GII_PT_ANGLE, /* base unit radian */ GII_PT_ANGVELOCITY, /* base unit radian/s */ GII_PT_ANGACCELERATION, /* base unit radian/s^2 */ GII_PT_AREA, /* base unit m^2 */ GII_PT_VOLUME, /* base unit m^3 */ GII_PT_MASS, /* base unit kg */ GII_PT_FORCE, /* base unit N (kg*m/s^2) */ GII_PT_PRESSURE, /* base unit N/m^2 (Pa) */ GII_PT_TORQUE, /* base unit Nm */ GII_PT_ENERGY, /* base unit Nm, VAs, J */ GII_PT_POWER, /* base unit Nm/s, VA, W */ GII_PT_TEMPERATURE, /* base unit K */ GII_PT_CURRENT, /* base unit A */ GII_PT_VOLTAGE, /* base unit V (kg*m^2/(As^3)) */ GII_PT_RESISTANCE, /* base unit V/A (Ohm) */ GII_PT_CAPACITY, /* base unit As/V (Farad) */ GII_PT_INDUCTIVITY, /* base unit Vs/A (Henry) */ GGI_PT_LAST } gii_phystype;
typedef struct { char longname[75]; char shortname[5]; gii_valrange range; gii_phystype phystype; sint32 SI_add,SI_mul,SI_div,SI_shift; } gii_cmddata_getvalinfo;
A human-redable NULL terminated string identifying the valuator.
A 4 chars(+null) identifier for the valuator.
???
This field states what kind of physical value (if any) this valuator is reporting.
The data reported in valuator events are given as integer. The corresponding floating point quantity, expressed in the unit given in phystype, can be computed from these values by the following formula:
float SI; SI = (float)(SI_add + value) * (float)SI_mul / (float)SI_div * pow(2.0, SI_shift);