Instrument Neutral Distributed Interface INDI
1.9.5
|
Go to the documentation of this file.
34 #define STEPMODE_FULL 1
35 #define STEPMODE_HALF 2
36 #define STEPMODE_QUARTER 4
37 #define STEPMODE_EIGHTH 8
38 #define STEPMODE_SIXTEENTH 16
39 #define STEPMODE_THIRTYSECOND 32
40 #define STEPMODE_SIXTYFOUR 64
41 #define STEPMODE_ONEHUNDREDTWENTYEIGHT 128
42 #define STEPMODE_TWOHUNDREDFIFTYSIX 256
44 #define CDRIVER_VERSION_MAJOR 1
45 #define CDRIVER_VERSION_MINOR 0
68 virtual bool ISNewNumber(
const char * dev,
const char *
name,
double values[],
char * names[],
int n)
override;
69 virtual bool ISNewSwitch(
const char * dev,
const char *
name,
ISState * states,
char * names[],
int n)
override;
126 bool sendCommand(
const char *
cmd,
char * res =
nullptr);
129 void getStartupValues();
135 bool readTemperature();
138 bool readTempCompensateEnable();
141 bool readTemperatureCoefficient();
155 bool readCoilPowerState();
157 bool readReverseDirection();
159 bool readDisplayVisible();
161 bool readBacklashInEnabled();
162 bool readBacklashOutEnabled();
164 bool readBacklashInSteps();
165 bool readBacklashOutSteps();
167 bool setBacklashInSteps(int16_t steps);
168 bool setBacklashOutSteps(int16_t steps);
170 bool setBacklashInEnabled(
bool enabled);
171 bool setBacklashOutEnabled(
bool enabled);
177 bool setSpeed(uint16_t speed);
183 bool setCoilPowerState(
CoilPower enable);
185 bool setTemperatureCelsius();
187 bool setTemperatureCalibration(
double calibration);
189 bool setTemperatureCoefficient(
double coefficient);
191 bool setTemperatureCompensation(
bool enable);
193 void timedMoveCallback();
195 double targetPos { 0 }, lastPos { 0 }, lastTemperature { 0 };
197 int msleep(
long milliseconds);
199 void clearbufferonerror();
218 INumber TemperatureSettingN[1];
222 ISwitch TemperatureCompensateS[2];
249 static const uint8_t ML_RES { 32 };
252 static const char ML_DEL {
'#' };
255 pthread_mutex_t cmdlock;
258 static const uint8_t MYFOCUSERPRO2_SERIAL_TIMEOUT { 5 };
259 static const uint8_t MYFOCUSERPRO2_TCPIP_TIMEOUT { 10 };
260 static const long MYFOCUSERPRO2_SMALL_DELAY { 50 };
261 static const long MYFOCUSERPRO2_RECOVER_DELAY { 200 };
264 static constexpr
const uint8_t GET_TEMPERATURE_FREQ{ 10 };
265 uint16_t Temperature_Counter { 0 };
268 static constexpr
const uint8_t GET_POSITION_FREQ{ 1 };
269 uint16_t Position_Counter { 0 };
271 static constexpr
const char *SETTINGS_TAB {
"Settings"};
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveAbsFocuser Move to an absolute target position.
static void timedMoveHelper(void *context)
const char * getDefaultName() override
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
@ TWOHUNDREDFIFTYSIX_STEP
virtual bool Handshake() override
Handshake Try to communicate with Focuser and see if there is a valid response.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Saves the Device Port and Focuser Presets in the configuration file
Number vector property descriptor.
virtual bool SetFocuserSpeed(int speed) override
SetFocuserSpeed Set Focuser speed.
virtual ~MyFocuserPro2() override=default
@ ONEHUNDREDTWENTYEIGHT_STEP
@ TEMP_COMPENSATE_DISABLE
virtual IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override
MoveFocuser Move focuser in a specific direction and speed for period of time.
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool ReverseFocuser(bool enabled) override
ReverseFocuser Reverse focuser motion direction.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool SyncFocuser(uint32_t ticks) override
SyncFocuser Set the supplied position as the current focuser position.
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveRelFocuser Move focuser for a relative amount of ticks in a specific direction.
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
virtual void TimerHit() override
Callback function to be called once SetTimer duration elapses.
Switch vector property descriptor.
virtual bool SetFocuserMaxPosition(uint32_t ticks) override
SetFocuserMaxPosition Update focuser maximum position. It only updates the PresetNP property limits.