28 #define UFOCREADPARAM "SGETAL"
29 #define UFOCDEVID "SWHOIS"
30 #define UFOCREADPOS "FPOSRO"
31 #define UFOCREADTEMP "FTMPRO"
32 #define UFOCMOVEOUT "O%05u"
33 #define UFOCMOVEIN "I%05u"
34 #define UFOCABORT "FQUITx"
35 #define UFOCSETMAX "M%05u"
36 #define UFOCSETSPEED "SMO%03u"
37 #define UFOCSETTCTHR "SMA%03u"
38 #define UFOCSETSDIR "SMROTH"
39 #define UFOCSETRDIR "SMROTT"
40 #define UFOCSETFSTEPS "SMSTPF"
41 #define UFOCSETHSTEPS "SMSTPD"
42 #define UFOCSETSTDEG "FLA%03u"
43 #define UFOCGETSIGN "FTAXXA"
44 #define UFOCSETSIGN "FZAXX%1u"
45 #define UFOCSETAUTO "FAMODE"
46 #define UFOCSETMANU "FMMODE"
47 #define UFOCRESET "SEERAZ"
54 #define UFORSAUTO "AP"
55 #define UFORSDONE "DONE"
56 #define UFORSERR "ER=1"
57 #define UFORSRESET "EEPROM RESET"
93 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
94 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
105 bool sendCommand(
const char *
cmd,
char *response);
106 bool sendCommandSpecial(
const char *
cmd,
char *response);
108 pthread_mutex_t cmdlock;
110 void GetFocusParams();
112 bool updateStepMode();
114 bool updateTemperature();
115 bool updatePosition();
117 bool updateTempCompSettings();
118 bool updateTempCompSign();
120 bool updateFWversion();
127 bool setRotDir(
unsigned int dir);
128 bool setMaxPos(
unsigned int maxp);
129 bool setSpeed(
unsigned short drvspeed);
130 bool setAutoTempCompThreshold(
unsigned int thr);
131 bool setTemperatureCoefficient(
unsigned int coefficient);
132 bool setTempCompSign(
unsigned int sign);
133 bool setTemperatureCompensation(
bool enable);
134 float CalcTimeLeft(timeval,
float);
136 unsigned int direction{ 0 };
137 unsigned int stepmode{ 0 };
138 unsigned int speed{ 0 };
139 unsigned int stepsdeg{ 0 };
140 unsigned int tcomp_thr{ 0 };
141 unsigned int firmware{ 0 };
142 unsigned int maxpos{ 0 };
144 double targetPos{ 0 };
145 double backlashTargetPos{ 0 };
147 int backlashSteps{ 0 };
148 bool backlashIn{
false };
149 bool backlashMove{
false };
150 bool moving{
false };
152 double lastTemperature{ 0 };
153 unsigned int currentSpeed{ 0 };
155 struct timeval focusMoveStart
159 float focusMoveRequest{ 0 };
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
bool getControllerStatus()
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
virtual ~USBFocusV3()=default
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
virtual const char * getDefaultName() override
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool SetFocuserSpeed(int speed) override
SetFocuserSpeed Set Focuser speed.