138 for (
int i = 0; i < n; i++)
140 snprintf(filterName,
MAXINDINAME,
"FILTER_SLOT_NAME_%d", i + 1);
141 snprintf(filterLabel,
MAXINDILABEL,
"Filter#%d", i + 1);
197 const char *filterDesignation[8] = {
"Red",
"Green",
"Blue",
"H_Alpha",
"SII",
"OIII",
"LPR",
"Luminance" };
209 for (
int i = 0; i < MaxFilter; i++)
211 snprintf(filterName,
MAXINDINAME,
"FILTER_SLOT_NAME_%d", i + 1);
212 snprintf(filterLabel,
MAXINDILABEL,
"Filter#%d", i + 1);
245 bool FilterInterface::loadFilterNames()
251 XMLEle *root =
nullptr, *fproot =
nullptr;
267 if (fproot ==
nullptr)
277 if (
crackDN(root, &rdev, &rname, errmsg) < 0)
289 if (!strcmp(
"FILTER_NAME", rname))
295 XMLEle *oneText =
nullptr;
301 snprintf(filterName,
MAXINDINAME,
"FILTER_SLOT_NAME_%d", counter + 1);
const char * getDeviceName() const
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
virtual const char * getDefaultName()=0
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
FilterInterface(DefaultDevice *defaultDevice)
FilterInterface Initiailize Filter Interface.
virtual bool SelectFilter(int position)=0
Select a new filter position.
bool processText(const char *dev, const char *name, char *texts[], char *names[], int n)
Process text properties.
DefaultDevice * m_defaultDevice
virtual bool SetFilterNames()
Set filter names as defined by the client for each filter position. The desired filter names are stor...
ITextVectorProperty * FilterNameTP
INumberVectorProperty FilterSlotNP
bool updateProperties()
updateProperties Defines or Delete proprties based on default device connection status
void generateSampleFilters()
generateSampleFilters Generate sample 8-filter wheel and fill it sample filters
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process number properties.
void SelectFilterDone(int newpos)
The child class calls this function when the hardware successfully finished selecting a new filter wh...
virtual bool GetFilterNames()
Obtains a list of filter names from the hardware and initializes the FilterNameTP property....
void initProperties(const char *groupName)
Initilize filter wheel properties. It is recommended to call this function within initProperties() of...
bool saveConfigItems(FILE *fp)
saveConfigItems save Filter Names in config file
struct _ITextVectorProperty ITextVectorProperty
void IUFillNumberVector(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 auxiliary elements will be set to NULL.
INumber * IUFindNumber(const INumberVectorProperty *nvp, const char *name)
Find an INumber member in a number text property.
void IUFillTextVector(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 auxiliary elements will be set to NULL.
int crackDN(XMLEle *root, char **dev, char **name, char msg[])
Extract dev and name attributes from an XML element.
void IUSaveConfigNumber(FILE *fp, const INumberVectorProperty *nvp)
Add a number vector property value to the configuration file.
void IUFillText(IText *tp, const char *name, const char *label, const char *initialText)
Assign attributes for a text property. The text's auxiliary elements will be set to NULL.
void IUFillNumber(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 auxiliary elements will be set to NULL.
void IUSaveConfigText(FILE *fp, const ITextVectorProperty *tvp)
Add a text vector property value to the configuration file.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
int IUUpdateText(ITextVectorProperty *tvp, char *texts[], char *names[], int n)
Update all text members in a text vector property.
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
FILE * IUGetConfigFP(const char *filename, const char *dev, const char *mode, char errmsg[])
Open a configuration file for writing and return a configuration file FILE pointer.
#define DEBUGDEVICE(device, priority, msg)
#define DEBUGFDEVICE(device, priority, msg,...)
int nXMLEle(XMLEle *ep)
Return the number of nested XML elements in a parent XML element.
LilXML * newLilXML()
Create a new lilxml parser.
char * pcdataXMLEle(XMLEle *ep)
Return the pcdata of an XML element.
XMLEle * readXMLFile(FILE *fp, LilXML *lp, char ynot[])
Handy wrapper to read one xml file.
XMLEle * nextXMLEle(XMLEle *ep, int init)
Iterate an XML element for a list of nesetd XML elements.
void delXMLEle(XMLEle *ep)
delXMLEle Delete XML element.
void delLilXML(LilXML *lp)
Delete a lilxml parser.
Namespace to encapsulate INDI client, drivers, and mediator classes.