kstars
Functions Drivers call to perform handy utility functions.
These do not communicate with the Client in any way. More...
Functions | |
void | fillNumber (INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value) |
void | fillNumberVector (INumberVectorProperty *nvp, INumber *np, int nnp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s) |
void | fillSwitch (ISwitch *sp, const char *name, const char *label, ISState s) |
void | fillSwitchVector (ISwitchVectorProperty *svp, ISwitch *sp, int nsp, const char *dev, const char *name, const char *label, const char *group, IPerm p, ISRule r, double timeout, IPState s) |
void | fillText (IText *tp, const char *name, const char *label, const char *initialText) |
void | fillTextVector (ITextVectorProperty *tvp, IText *tp, int ntp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s) |
INumber * | IUFindNumber (const INumberVectorProperty *tp, const char *name) |
ISwitch * | IUFindOnSwitch (const ISwitchVectorProperty *tp) |
ISwitch * | IUFindSwitch (const ISwitchVectorProperty *tp, const char *name) |
IText * | IUFindText (const ITextVectorProperty *tp, const char *name) |
void | IUResetSwitches (const ISwitchVectorProperty *svp) |
void | IUSaveText (IText *tp, const char *newtext) |
void | IUUpdateMinMax (INumberVectorProperty *nvp) |
int | IUUpdateNumbers (INumberVectorProperty *nvp, double values[], char *names[], int n) |
int | IUUpdateSwitches (ISwitchVectorProperty *svp, ISState *states, char *names[], int n) |
Detailed Description
These do not communicate with the Client in any way.Function Documentation
void fillNumber | ( | INumber * | np, | |
const char * | name, | |||
const char * | label, | |||
const char * | format, | |||
double | min, | |||
double | max, | |||
double | step, | |||
double | value | |||
) |
Assign attributes for a number property.
The number's auxilary elements will be set to NULL.
- Parameters:
-
np pointer a number property to fill name the number name label the number label format the number format in printf style (e.g. "%02d") min the minimum possible value max the maximum possible value step the step used to climb from minimum value to maximum value value the number's current value
void fillNumberVector | ( | INumberVectorProperty * | nvp, | |
INumber * | np, | |||
int | nnp, | |||
const char * | dev, | |||
const char * | name, | |||
const char * | label, | |||
const char * | group, | |||
IPerm | p, | |||
double | timeout, | |||
IPState | s | |||
) |
Assign attributes for a number vector property.
The vector's auxilary elements will be set to NULL.
- Parameters:
-
nvp pointer a number vector property to fill np pointer to an array of numbers nnp the dimension of np dev the device name this vector property belongs to name the vector property name label the vector property label group the vector property group p the vector property permission timeout vector property timeout in seconds s the vector property initial state.
Assign attributes for a switch property.
The switch's auxilary elements will be set to NULL.
- Parameters:
-
sp pointer a switch property to fill name the switch name label the switch label s the switch state (ISS_ON or ISS_OFF)
void fillSwitchVector | ( | ISwitchVectorProperty * | svp, | |
ISwitch * | sp, | |||
int | nsp, | |||
const char * | dev, | |||
const char * | name, | |||
const char * | label, | |||
const char * | group, | |||
IPerm | p, | |||
ISRule | r, | |||
double | timeout, | |||
IPState | s | |||
) |
Assign attributes for a switch vector property.
The vector's auxilary elements will be set to NULL.
- Parameters:
-
svp pointer a switch vector property to fill sp pointer to an array of switches nsp the dimension of sp dev the device name this vector property belongs to name the vector property name label the vector property label group the vector property group p the vector property permission r the switches behavior timeout vector property timeout in seconds s the vector property initial state.
void fillText | ( | IText * | tp, | |
const char * | name, | |||
const char * | label, | |||
const char * | initialText | |||
) |
Assign attributes for a text property.
The text's auxilary elements will be set to NULL.
- Parameters:
-
tp pointer a text property to fill name the text name label the text label initialText the initial text
void fillTextVector | ( | ITextVectorProperty * | tvp, | |
IText * | tp, | |||
int | ntp, | |||
const char * | dev, | |||
const char * | name, | |||
const char * | label, | |||
const char * | group, | |||
IPerm | p, | |||
double | timeout, | |||
IPState | s | |||
) |
Assign attributes for a text vector property.
The vector's auxilary elements will be set to NULL.
- Parameters:
-
tvp pointer a text vector property to fill tp pointer to an array of texts ntp the dimension of tp dev the device name this vector property belongs to name the vector property name label the vector property label group the vector property group p the vector property permission timeout vector property timeout in seconds s the vector property initial state.
INumber* IUFindNumber | ( | const INumberVectorProperty * | tp, | |
const char * | name | |||
) |
ISwitch* IUFindOnSwitch | ( | const ISwitchVectorProperty * | tp | ) |
Returns the first ON switch it finds in the vector switch property.
- Note:
- This is only valid for ISR_1OFMANY mode. That is, when only one switch out of many is allowed to be ON. Do not use this function if you can have multiple ON switches in the same vector property.
- Parameters:
-
tp a pointer to a switch vector property.
- Returns:
- a pointer to the first ON ISwitch member if found. If all switches are off, NULL is returned.
ISwitch* IUFindSwitch | ( | const ISwitchVectorProperty * | tp, | |
const char * | name | |||
) |
IText* IUFindText | ( | const ITextVectorProperty * | tp, | |
const char * | name | |||
) |
void IUResetSwitches | ( | const ISwitchVectorProperty * | svp | ) |
Reset all switches in a switch vector property to OFF.
- Parameters:
-
svp a pointer to a switch vector property.
void IUSaveText | ( | IText * | tp, | |
const char * | newtext | |||
) |
void IUUpdateMinMax | ( | INumberVectorProperty * | nvp | ) |
Function to update the min and max elements of a number in the client.
- Parameters:
-
nvp pointer to an INumberVectorProperty.
int IUUpdateNumbers | ( | INumberVectorProperty * | nvp, | |
double | values[], | |||
char * | names[], | |||
int | n | |||
) |
Update all numbers in a number vector property.
- Parameters:
-
nvp a pointer to a number vector property. values the states of the new INumber members. names the names of the INumber members to update. n the number of INumber members to update.
- Returns:
- 0 if update successful, -1 otherwise. Update will fail if values are out of scope, or in case of property name mismatch.
int IUUpdateSwitches | ( | ISwitchVectorProperty * | svp, | |
ISState * | states, | |||
char * | names[], | |||
int | n | |||
) |