26 #define CMD_GET_STATUS 0x80
27 #define CMD_RESET_POSITION 0x81
28 #define CMD_IS_MOVING 0x82
30 #define CMD_GET_TEMPERATURE 0x84
31 #define CMD_SET_COEFF 0x85
32 #define CMD_GET_COEFF 0x86
33 #define CMD_TEMPCOMP_ON 0x87
34 #define CMD_TEMPCOMP_OFF 0x88
35 #define CMD_UPDATE_POSITION 0x8c
36 #define CMD_GET_POSITION 0x8d
37 #define CMD_SET_MOTOR_SPEED 0x9d
38 #define CMD_GET_MOTOR_SPEED 0x9e
39 #define CMD_SET_TEMP_OFFSET 0x9f
41 #define FOCUS_MOTORSPEED_NORMAL 8
42 #define FOCUS_MOTORSPEED_FAST 4
54 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
55 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
65 void GetFocusParams();
68 bool updateMotorSpeed();
69 bool updateTemperature();
70 bool updatePosition();
76 bool setMotorSpeed(
char speed);
77 bool setSpeed(
unsigned short speed);
78 bool setTemperatureCalibration(
double calibration);
79 bool setTemperatureCoefficient(
double coefficient);
80 bool setTemperatureCompensation(
bool enable);
81 float CalcTimeLeft(timeval,
float);
82 bool WriteCmd(
char cmd);
83 bool WriteCmdGetResponse(
char cmd,
char *readbuffer,
char numbytes);
84 char WriteCmdGetByte(
char cmd);
85 bool WriteCmdSetByte(
char cmd,
char val);
86 bool WriteCmdSetShortInt(
char cmd,
short int val);
87 int WriteCmdGetInt(
char cmd);
88 bool WriteCmdSetInt(
char cmd,
int val);
89 bool WriteCmdSetIntAsDigits(
char cmd,
int val);
91 double targetPos { 0 };
93 double lastTemperature { 0 };
94 unsigned int currentSpeed { 0 };
96 struct timeval focusMoveStart
100 float focusMoveRequest { 0 };
111 INumber TemperatureSettingN[2];
114 ISwitch TemperatureCompensateS[2];
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
virtual ~Microtouch() override=default
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
const char * getDefaultName() override
virtual IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override
MoveFocuser the focuser in a particular direction with a specific speed for a finite duration.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool SetFocuserSpeed(int speed) override
SetFocuserSpeed Set Focuser speed.
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
virtual bool SyncFocuser(uint32_t ticks) override
SyncFocuser Set current position to ticks without moving the focuser.
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Number vector property descriptor.
Switch vector property descriptor.