26 #define OPTEC_TIMEOUT 5
27 #define OPTEC_TIMEOUT_MOVE 10
28 #define OPTEC_TIMEOUT_WHOME 40
29 #define OPTEC_TIMEOUT_FIRMWARE 1
31 #define OPTEC_MAX_FILTER 9
32 #define OPTEC_LEN_FLTNAME 8
33 #define OPTEC_MAXLEN_CMD ((OPTEC_MAX_FILTER)*OPTEC_LEN_FLTNAME) + 10
34 #define OPTEC_MAXLEN_RESP OPTEC_MAX_FILTER *OPTEC_LEN_FLTNAME
35 #define OPTEC_MAXLEN_NAMES OPTEC_MAX_FILTER *OPTEC_LEN_FLTNAME
37 #define OPTEC_WAIT_DATA_OK 5
39 #define filterSim5 "RED GREEN BLUE H-ALPHA LIGHT "
40 #define filterSim6 "RED GREEN BLUE H-ALPHA LIGHT OIII "
41 #define filterSim8 "RED GREEN BLUE H-ALPHA LIGHT OIII IR-CUT SII "
42 #define filterSim9 "RED GREEN BLUE H-ALPHA LIGHT OIII IR-CUT SII ORANGE "
47 #define MER1 "the number of steps to find position 1 is excessive"
48 #define MER2 "the SBIG pulse does not have the proper width for the IFW"
49 #define MER3 "the filter ID is not found/send successfully"
50 #define MER4 "the wheel is stuck in a position"
51 #define MER5 "the filter number is not in the set (1, 2, 3, 4, 5)"
52 #define MER6 "the wheel is slipping and takes too many steps to the next position"
53 #define MERO "Unknown error received from IFW"
55 #define PRINT_ER(error) \
56 if (!strcmp(error, "ER=1")) \
57 LOGF_ERROR("%s -> %s", error, MER1); \
58 else if (!strcmp(error, "ER=2")) \
59 LOGF_ERROR("%s -> %s", error, MER2); \
60 else if (!strcmp(error, "ER=3")) \
61 LOGF_ERROR("%s -> %s", error, MER3); \
62 else if (!strcmp(error, "ER=4")) \
63 LOGF_ERROR("%s -> %s", error, MER4); \
64 else if (!strcmp(error, "ER=5")) \
65 LOGF_ERROR("%s -> %s", error, MER5); \
66 else if (!strcmp(error, "ER=6")) \
67 LOGF_ERROR("%s -> %s", error, MER6); \
68 else if (!strcmp(error, "ER=0")) \
69 LOGF_ERROR("%s -> %s", error, MERO);
71 #define DEBUGTAG() DEBUGF(INDI::Logger::DBG_EXTRA_1, "DEBUG -> Function %s() is executing", __FUNCTION__);
84 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
85 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
92 bool ReadTTY(
char *resp,
char *simulation,
int timeout);
99 virtual bool loadConfig(
bool silent =
false,
const char *property =
nullptr)
override;
virtual ~FilterIFW()=default
ITextVectorProperty WheelIDTP
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool loadConfig(bool silent=false, const char *property=nullptr) override
Load the last saved configuration file.
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
virtual void simulationTriggered(bool enable) override
Inform driver that the simulation option was triggered. This function is called after setSimulation i...
virtual bool GetFilterNames() override
Obtains a list of filter names from the hardware and initializes the FilterNameTP property....
bool WriteTTY(char *command)
virtual bool Disconnect() override
Disconnect from device.
bool ReadTTY(char *resp, char *simulation, int timeout)
ISwitchVectorProperty CharSetSP
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
ISwitchVectorProperty HomeSP
ITextVectorProperty FirmwareTP
ISwitchVectorProperty FilterNbrSP
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool SetFilterNames() override
Set filter names as defined by the client for each filter position. The desired filter names are stor...
char filterSim[OPTEC_MAXLEN_NAMES+1]
virtual const char * getDefaultName() override
virtual bool SelectFilter(int) override
Select a new filter position.
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
#define OPTEC_MAXLEN_NAMES
Switch vector property descriptor.
Text vector property descriptor.