Instrument Neutral Distributed Interface INDI  1.9.2
celestron.cpp
Go to the documentation of this file.
1 /*
2  Celestron Focuser for SCT and EDGEHD
3 
4  Copyright (C) 2019 Jasem Mutlaq (mutlaqja@ikarustech.com)
5  Copyright (C) 2019 Chris Rowland
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21 */
22 
23 #include "celestron.h"
25 #include "indicom.h"
26 
27 #include <cmath>
28 #include <cstring>
29 #include <memory>
30 
31 #include <termios.h>
32 #include <unistd.h>
33 
34 static std::unique_ptr<CelestronSCT> celestronSCT(new CelestronSCT());
35 
37 {
38  // Can move in Absolute & Relative motions, can AbortFocuser motion.
39  // CR variable speed and sync removed
41 
42  communicator.source = Aux::Target::APP;
43 }
44 
46 {
48 
49  // Focuser backlash
50  // CR this is a value, positive or negative to define the direction. It will need to be implemented
51  // in the driver.
52  FocusBacklashN[0].min = -500;
53  FocusBacklashN[0].max = 500;
54  FocusBacklashN[0].step = 1;
55  FocusBacklashN[0].value = 0;
56 
57  // IUFillNumber(&FocusBacklashN[0], "STEPS", "Steps", "%.f", -500., 500., 1., 0.);
58  // IUFillNumberVector(&FocusBacklashNP, FocusBacklashN, 1, getDeviceName(), "FOCUS_BACKLASH", "Backlash",
59  // MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE);
60 
61  // Focuser min limit
62  IUFillNumber(&FocusMinPosN[0], "FOCUS_MIN_VALUE", "Steps", "%.f", 0, 40000., 1., 0.);
63  IUFillNumberVector(&FocusMinPosNP, FocusMinPosN, 1, getDeviceName(), "FOCUS_MIN", "Min. Position",
65 
66  // focuser calibration
67  IUFillSwitch(&CalibrateS[0], "START", "Start Calibration", ISS_OFF);
68  IUFillSwitch(&CalibrateS[1], "STOP", "Stop Calibration", ISS_OFF);
69  IUFillSwitchVector(&CalibrateSP, CalibrateS, 2, getDeviceName(), "CALIBRATE", "Calibrate control",
71 
72  IUFillText(&CalibrateStateT[0], "CALIBRATE_STATE", "Calibrate state", "");
73  IUFillTextVector(&CalibrateStateTP, CalibrateStateT, 1, getDeviceName(), "CALIBRATE_STATE", "Calibrate State",
75 
76  // Speed range
77  // CR no need to have adjustable speed, how to remove?
78  FocusSpeedN[0].min = 1;
79  FocusSpeedN[0].max = 3;
80  FocusSpeedN[0].value = 1;
81 
82  // From online screenshots, seems maximum value is 60,000 steps
83  // max and min positions can be read from a calibrated focuser
84 
85  // Relative Position Range
86  FocusRelPosN[0].min = 0.;
87  FocusRelPosN[0].max = 30000.;
88  FocusRelPosN[0].value = 0;
89  FocusRelPosN[0].step = 1000;
90 
91  // Absolute Postition Range
92  FocusAbsPosN[0].min = 0.;
93  FocusAbsPosN[0].max = 60000.;
94  FocusAbsPosN[0].value = 0;
95  FocusAbsPosN[0].step = 1000;
96 
97  // Maximum Position Settings
98  FocusMaxPosN[0].max = 60000;
99  FocusMaxPosN[0].min = 1000;
100  FocusMaxPosN[0].value = 60000;
102 
103  // Poll every 500ms
105 
106  // Add debugging support
107  addDebugControl();
108 
109  // Set default baud rate to 19200
111 
112  communicator.setDeviceName(getDeviceName());
113 
114  // Defualt port to /dev/ttyACM0
115  //serialConnection->setDefaultPort("/dev/ttyACM0");
116 
117  //LOG_INFO("initProperties end");
118  return true;
119 }
120 
122 {
124 
125  if (isConnected())
126  {
127  //defineProperty(&FocusBacklashNP);
128 
129  defineProperty(&FocusMinPosNP);
130 
131  defineProperty(&CalibrateSP);
132  defineProperty(&CalibrateStateTP);
133 
134  if (getStartupParameters())
135  LOG_INFO("Celestron SCT focuser parameters updated, focuser ready for use.");
136  else
137  LOG_WARN("Failed to retrieve some focuser parameters. Check logs.");
138 
139  }
140  else
141  {
142  //deleteProperty(FocusBacklashNP.name);
143  deleteProperty(FocusMinPosNP.name);
144  deleteProperty(CalibrateSP.name);
145  deleteProperty(CalibrateStateTP.name);
146  }
147 
148  return true;
149 }
150 
152 {
153  if (Ack())
154  {
155  LOG_INFO("Celestron SCT Focuser is online. Getting focus parameters...");
156  return true;
157  }
158 
159  LOG_INFO("Error retrieving data from Celestron SCT, please ensure Celestron SCT controller is powered and the port is correct.");
160  return false;
161 }
162 
164 {
165  return "Celestron SCT";
166 }
167 
168 bool CelestronSCT::Ack()
169 {
170  // send simple command to focuser and check response to make sure
171  // it is online and responding
172  // use get firmware version command
173  Aux::buffer reply;
174  if (!communicator.sendCommand(PortFD, Aux::Target::FOCUSER, Aux::Command::GET_VER, reply))
175  return false;
176 
177  if (reply.size() == 4)
178  {
179  LOGF_INFO("Firmware Version %i.%i.%i", reply[0], reply [1], (reply[2] << 8) + reply[3]);
180  }
181  else
182  LOGF_INFO("Firmware Version %i.%i", reply[0], reply [1]);
183  return true;
184 }
185 
186 bool CelestronSCT::readPosition()
187 {
188  Aux::buffer reply;
190  return false;
191 
192  int position = (reply[0] << 16) + (reply[1] << 8) + reply[2];
193  LOGF_DEBUG("Position %i", position);
194  FocusAbsPosN[0].value = position;
195  return true;
196 }
197 
198 bool CelestronSCT::isMoving()
199 {
200  Aux::buffer reply(1);
202  return false;
203  return reply[0] != static_cast<uint8_t>(0xFF);
204 }
205 
206 // read the focuser limits from the hardware
207 bool CelestronSCT::readLimits()
208 {
209  Aux::buffer reply(8);
211  return false;
212 
213  int lo = (reply[0] << 24) + (reply[1] << 16) + (reply[2] << 8) + reply[3];
214  int hi = (reply[4] << 24) + (reply[5] << 16) + (reply[6] << 8) + reply[7];
215 
216  FocusAbsPosN[0].max = hi;
217  FocusAbsPosN[0].min = lo;
220 
221  FocusMaxPosN[0].value = hi;
223  IDSetNumber(&FocusMaxPosNP, nullptr);
224 
225  FocusMinPosN[0].value = lo;
226  FocusMinPosNP.s = IPS_OK;
227  IDSetNumber(&FocusMinPosNP, nullptr);
228 
229  // check on integrity of values, they must be sensible and the range must be more than 2 turns
230  if (hi > 0 && lo > 0 && hi - lo > 2000 && hi <= 60000 && lo < 50000)
231  {
232  focuserIsCalibrated = true;
233  LOGF_INFO("Focus range %i to %i valid", hi, lo);
234  }
235  else
236  {
237  focuserIsCalibrated = false;
238  LOGF_INFO("Focus range %i to %i invalid", hi, lo);
239  return false;
240  }
241 
242  return true;
243 }
244 
245 //bool CelestronSCT::ISNewNumber(const char * dev, const char * name, double values[], char * names[], int n)
246 //{
247 // if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
248 // {
249 // // Backlash
250 // if (!strcmp(name, FocusBacklashNP.name))
251 // {
252 // // just update the number
253 // IUUpdateNumber(&FocusBacklashNP, values, names, n);
254 // FocusBacklashNP.s = IPS_OK;
255 // IDSetNumber(&FocusBacklashNP, nullptr);
256 // return true;
257 // }
258 // }
259 // return INDI::Focuser::ISNewNumber(dev, name, values, names, n);
260 //}
261 
262 bool CelestronSCT::ISNewSwitch(const char * dev, const char * name, ISState *states, char * names[], int n)
263 {
264  if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
265  {
266  if (!strcmp(name, CalibrateSP.name))
267  {
268  IUUpdateSwitch(&CalibrateSP, states, names, n);
269  int index = IUFindOnSwitchIndex(&CalibrateSP);
270  Aux::buffer data = {1};
271  switch(index)
272  {
273  case 0:
274  // start calibrate
275  LOG_INFO("Focuser Calibrate start");
276  calibrateInProgress = true;
277  calibrateState = -1;
278  break;
279  case 1:
280  // abort calibrate
281  LOG_INFO("Focuser Calibrate abort");
282  data[0] = 0;
283  break;
284  default:
285  return false;
286  }
288  usleep(500000);
289  CalibrateSP.s = IPS_BUSY;
290  IDSetSwitch(&CalibrateSP, nullptr);
291  return true;
292  }
293  }
294  return INDI::Focuser::ISNewSwitch(dev, name, states, names, n);
295 }
296 
297 bool CelestronSCT::getStartupParameters()
298 {
299  bool rc1 = false, rc2 = false;
300 
301  if ( (rc1 = readPosition()))
302  IDSetNumber(&FocusAbsPosNP, nullptr);
303 
304  if ( !(rc2 = readLimits()))
305  {
306  LOG_WARN("Focuser not calibrated, You MUST calibrate before moves are allowed.");
307  }
308 
309  return (rc1 && rc2);
310 }
311 
313 {
314  // Send command to focuser
315  // If OK and moving, return IPS_BUSY (CR don't see this, it seems to just start a new move)
316  // If OK and motion already done (was very small), return IPS_OK
317  // If error, return IPS_ALERT
318 
319  if (!focuserIsCalibrated)
320  {
321  LOG_ERROR("Move not allowed because focuser is not calibrated.");
322  return IPS_ALERT;
323  }
324  if (calibrateInProgress)
325  {
326  LOG_WARN("Move not allowed because a calibration is in progress");
327  return IPS_ALERT;
328  }
329 
330  // the focuser seems happy to move 500 steps past the soft limit so don't check backlash
331  if (targetTicks > FocusMaxPosN[0].value ||
332  targetTicks < FocusMinPosN[0].value)
333  {
334  LOGF_ERROR("Move to %i not allowed because it is out of range", targetTicks);
335  return IPS_ALERT;
336  }
337 
338  uint32_t position = targetTicks;
339 
340  // implement backlash
341  int delta = targetTicks - FocusAbsPosN[0].value;
342  if ((FocusBacklashN[0].value < 0 && delta > 0) ||
343  (FocusBacklashN[0].value > 0 && delta < 0))
344  {
345  backlashMove = true;
346  finalPosition = position;
347  position -= FocusBacklashN[0].value;
348  }
349 
350  if (!startMove(position))
351  return IPS_ALERT;
352 
353  return IPS_BUSY;
354 }
355 
356 bool CelestronSCT::startMove(uint32_t position)
357 {
358  Aux::buffer data =
359  {
360  static_cast<uint8_t>((position >> 16) & 0xFF),
361  static_cast<uint8_t>((position >> 8) & 0xFF),
362  static_cast<uint8_t>(position & 0xFF)
363  };
364 
365  LOGF_DEBUG("startMove %i, %x %x %x", position, data[0], data[1], data[2]);
366 
368 }
369 
371 {
372  int32_t newPosition = 0;
373 
374  if (dir == FOCUS_INWARD)
375  newPosition = FocusAbsPosN[0].value - ticks;
376  else
377  newPosition = FocusAbsPosN[0].value + ticks;
378 
379  // Clamp
380  newPosition = std::max(0, std::min(static_cast<int32_t>(FocusAbsPosN[0].max), newPosition));
381  return MoveAbsFocuser(newPosition);
382 }
383 
385 {
386  if (!isConnected())
387  {
389  return;
390  }
391 
392  // Check position
393  double lastPosition = FocusAbsPosN[0].value;
394  bool rc = readPosition();
395  if (rc)
396  {
397  // Only update if there is actual change
398  if (fabs(lastPosition - FocusAbsPosN[0].value) > 1)
399  IDSetNumber(&FocusAbsPosNP, nullptr);
400  }
401 
403  {
404  // CR The backlash handling will probably have to be done here, if the move state
405  // shows that a backlash move has been done then the final move needs to be started
406  // and the states left at IPS_BUSY
407 
408  // There are two ways to know when focuser motion is over
409  // define class variable uint32_t m_TargetPosition and set it in MoveAbsFocuser(..) function
410  // then compare current value to m_TargetPosition
411  // The other way is to have a function that calls a focuser specific function about motion
412  if (!isMoving())
413  {
414  if (backlashMove)
415  {
416  backlashMove = false;
417  if (startMove(finalPosition))
418  LOGF_INFO("Backlash move to %i", finalPosition);
419  else
420  LOG_INFO("Backlash move failed");
421  }
422  else
423  {
426  IDSetNumber(&FocusAbsPosNP, nullptr);
427  IDSetNumber(&FocusRelPosNP, nullptr);
428  LOG_INFO("Focuser reached requested position.");
429  }
430  }
431  }
432 
433  if (calibrateInProgress)
434  {
435  usleep(500000); // slowing things down while calibrating seems to help
436  // check the calibration state
437  Aux::buffer reply;
439  bool complete = reply[0] > 0;
440  int state = reply[1];
441 
442  if (complete || state == 0)
443  {
444  // a completed calibration returns complete as true, an aborted calibration sets the status to zero
445 
446  const char *msg = complete ? "Calibrate complete" : "Calibrate aborted";
447  LOG_INFO(msg);
448  calibrateInProgress = false;
449  CalibrateS[1].s = ISS_OFF;
450  CalibrateSP.s = IPS_OK;
451  //CalibrateStateT[0].text = (char *)msg;
452  IUSaveText(&CalibrateStateT[0], msg);
453  IDSetSwitch(&CalibrateSP, nullptr);
454  IDSetText(&CalibrateStateTP, nullptr);
455  // read the new limits
456  if (complete && readLimits())
457  {
459  IDSetNumber(&FocusMaxPosNP, nullptr);
460  IDSetNumber(&FocusMinPosNP, nullptr);
461  }
462  }
463  else
464  {
465  if (state != calibrateState)
466  {
467  calibrateState = state;
468  char str[20];
469  snprintf(str, 20, "Calibrate state %i", state);
470  CalibrateStateT[0].text = str;
471  IDSetText(&CalibrateStateTP, nullptr);
472  }
473  }
474  }
475 
477 }
478 
480 {
481  if (calibrateInProgress)
482  {
483  LOG_WARN("Abort move not allowed when calibrating, use abort calibration to stop");
484  return false;
485  }
486  // send a command to move at rate 0
487  Aux::buffer data = {0};
489 }
490 
492 {
493  INDI_UNUSED(steps);
494  return true;
495 }
496 
IP_RO
@ IP_RO
Definition: indiapi.h:183
FOC_CALIB_DONE
#define FOC_CALIB_DONE
Definition: celestrondriver.h:91
GET_VER
#define GET_VER
Definition: celestrondriver.h:95
INDI::FocuserInterface::FocusAbsPosNP
INumberVectorProperty FocusAbsPosNP
Definition: indifocuserinterface.h:282
INDI::FocuserInterface::FOCUSER_CAN_REL_MOVE
@ FOCUSER_CAN_REL_MOVE
Definition: indifocuserinterface.h:75
FOC_CALIB_ENABLE
#define FOC_CALIB_ENABLE
Definition: celestrondriver.h:90
MC_GOTO_FAST
#define MC_GOTO_FAST
Definition: celestrondriver.h:55
INDI::FocuserInterface::FocusMaxPosNP
INumberVectorProperty FocusMaxPosNP
Definition: indifocuserinterface.h:290
IUUpdateMinMax
void IUUpdateMinMax(const INumberVectorProperty *nvp)
Function to update the min and max elements of a number in the client.
Definition: indidriver.c:1849
IPState
IPState
Property state.
Definition: indiapi.h:158
MC_SLEW_DONE
#define MC_SLEW_DONE
Definition: celestrondriver.h:65
INDI::FocuserInterface::FocusBacklashN
INumber FocusBacklashN[1]
Definition: indifocuserinterface.h:311
CelestronSCT::getDefaultName
const char * getDefaultName() override
Definition: celestron.cpp:163
LOGF_ERROR
#define LOGF_ERROR(fmt,...)
Definition: indilogger.h:80
IPS_OK
@ IPS_OK
Definition: indiapi.h:161
_INumberVectorProperty::s
IPState s
Definition: indiapi.h:332
min
double min(void)
ISS_OFF
@ ISS_OFF
Definition: indiapi.h:150
indicom.h
Implementations for common driver routines.
IDSetText
void IDSetText(const ITextVectorProperty *t, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing text vector property.
IPS_ALERT
@ IPS_ALERT
Definition: indiapi.h:163
MC_MOVE_POS
#define MC_MOVE_POS
Definition: celestrondriver.h:73
IUFillNumber
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.
Definition: indidriver.c:348
INDI::DefaultDevice::defineProperty
void defineProperty(INumberVectorProperty *property)
Definition: defaultdevice.cpp:997
MAIN_CONTROL_TAB
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
Definition: defaultdevice.cpp:34
INDI::FocuserInterface::FOCUSER_CAN_ABS_MOVE
@ FOCUSER_CAN_ABS_MOVE
Definition: indifocuserinterface.h:74
IUFillTextVector
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.
Definition: indidriver.c:477
INDI::DefaultDevice::setDefaultPollingPeriod
void setDefaultPollingPeriod(uint32_t msec)
setDefaultPollingPeriod Change the default polling period to call TimerHit() function in the driver.
Definition: defaultdevice.cpp:1157
INDI_UNUSED
#define INDI_UNUSED(x)
Definition: indidevapi.h:799
Aux::APP
@ APP
Definition: celestronauxpacket.h:93
INDI::BaseDevice::getDeviceName
const char * getDeviceName() const
Definition: basedevice.cpp:799
Aux::Communicator::commandBlind
bool commandBlind(int port, Target dest, Command cmd, buffer data)
Definition: celestronauxpacket.cpp:244
INDI::Focuser::serialConnection
Connection::Serial * serialConnection
Definition: indifocuser.h:113
CelestronSCT::MoveAbsFocuser
virtual IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveAbsFocuser Move to an absolute target position.
Definition: celestron.cpp:312
INDI::FocuserInterface::FOCUSER_HAS_BACKLASH
@ FOCUSER_HAS_BACKLASH
Definition: indifocuserinterface.h:80
Connection::Serial::B_19200
@ B_19200
Definition: connectionserial.h:82
IUFillText
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.
Definition: indidriver.c:369
LOG_INFO
#define LOG_INFO(txt)
Definition: indilogger.h:74
FOC_GET_HS_POSITIONS
#define FOC_GET_HS_POSITIONS
Definition: celestrondriver.h:92
max
double max(void)
Aux::Communicator::sendCommand
bool sendCommand(int port, Target dest, Command cmd, buffer data, buffer &reply)
Definition: celestronauxpacket.cpp:209
INDI::DefaultDevice::getCurrentPollingPeriod
uint32_t getCurrentPollingPeriod() const
getCurrentPollingPeriod Return the current polling period.
Definition: defaultdevice.cpp:1139
CelestronSCT::AbortFocuser
virtual bool AbortFocuser() override
AbortFocuser Abort Focuser motion.
Definition: celestron.cpp:479
CelestronSCT::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: celestron.cpp:262
LOGF_DEBUG
#define LOGF_DEBUG(fmt,...)
Definition: indilogger.h:83
CelestronSCT::TimerHit
virtual void TimerHit() override
TimerHit Primary Loop called every POLLMS milliseconds (set in Options) to check on the focuser statu...
Definition: celestron.cpp:384
Connection::Serial::setDefaultBaudRate
void setDefaultBaudRate(BaudRate newRate)
setDefaultBaudRate Set default baud rate. The default baud rate is 9600 unless otherwise changed by t...
Definition: connectionserial.cpp:375
INDI::DefaultDevice::SetTimer
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
Definition: defaultdevice.cpp:865
INDI::Focuser::PortFD
int PortFD
Definition: indifocuser.h:116
CelestronSCT::Handshake
virtual bool Handshake() override
Handshake Try to communicate with Focuser and see if there is a valid response.
Definition: celestron.cpp:151
CelestronSCT::updateProperties
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: celestron.cpp:121
Aux::FOCUSER
@ FOCUSER
focuser motor
Definition: celestronauxpacket.h:92
INDI::FocuserInterface::FOCUS_INWARD
@ FOCUS_INWARD
Definition: indifocuserinterface.h:68
IUFillSwitchVector
void IUFillSwitchVector(ISwitchVectorProperty *svp, ISwitch *sp, int nsp, const char *dev, const char *name, const char *label, const char *group, IPerm p, ISRule r, double timeout, IPState s)
Assign attributes for a switch vector property. The vector's auxiliary elements will be set to NULL.
Definition: indidriver.c:412
Aux::Communicator::setDeviceName
static void setDeviceName(const std::string &device)
Definition: celestronauxpacket.h:146
IUFillNumberVector
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.
Definition: indidriver.c:455
IPS_BUSY
@ IPS_BUSY
Definition: indiapi.h:162
connectionserial.h
IPS_IDLE
@ IPS_IDLE
Definition: indiapi.h:160
INDI::FocuserInterface::FocusRelPosN
INumber FocusRelPosN[1]
Definition: indifocuserinterface.h:287
ISR_ATMOST1
@ ISR_ATMOST1
Definition: indiapi.h:173
INDI::Focuser::updateProperties
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
Definition: indifocuser.cpp:120
_INumberVectorProperty::name
char name[MAXINDINAME]
Definition: indiapi.h:322
IUUpdateSwitch
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
Definition: indidriver.c:171
INDI::FocuserInterface::FocusRelPosNP
INumberVectorProperty FocusRelPosNP
Definition: indifocuserinterface.h:286
_ITextVectorProperty::name
char name[MAXINDINAME]
Definition: indiapi.h:249
INDI::BaseDevice::isConnected
bool isConnected() const
Definition: basedevice.cpp:518
CelestronSCT::MoveRelFocuser
virtual IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveRelFocuser Move focuser for a relative amount of ticks in a specific direction.
Definition: celestron.cpp:370
LOGF_INFO
#define LOGF_INFO(fmt,...)
Definition: indilogger.h:82
LOG_ERROR
#define LOG_ERROR(txt)
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must...
Definition: indilogger.h:72
INDI::FocuserInterface::SetCapability
void SetCapability(uint32_t cap)
FI::SetCapability sets the focuser capabilities. All capabilities must be initialized.
Definition: indifocuserinterface.h:95
IUSaveText
void IUSaveText(IText *tp, const char *newtext)
Function to reliably save new text in a IText.
Definition: indicom.c:1428
CelestronSCT::CelestronSCT
CelestronSCT()
Definition: celestron.cpp:36
_ISwitchVectorProperty::s
IPState s
Definition: indiapi.h:382
CelestronSCT
Definition: celestron.h:30
CelestronSCT::SetFocuserBacklash
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
Definition: celestron.cpp:491
INDI::FocuserInterface::FocusMaxPosN
INumber FocusMaxPosN[1]
Definition: indifocuserinterface.h:291
INDI::FocuserInterface::FOCUSER_CAN_ABORT
@ FOCUSER_CAN_ABORT
Definition: indifocuserinterface.h:76
_INumberVectorProperty::p
IPerm p
Definition: indiapi.h:328
Aux::Communicator::source
Target source
Definition: celestronauxpacket.h:143
INDI::FocuserInterface::FocusDirection
FocusDirection
Definition: indifocuserinterface.h:66
celestron.h
IP_RW
@ IP_RW
Definition: indiapi.h:185
LOG_WARN
#define LOG_WARN(txt)
Definition: indilogger.h:73
MC_GET_POSITION
#define MC_GET_POSITION
Definition: celestrondriver.h:54
ISState
ISState
Switch state.
Definition: indiapi.h:148
IUFindOnSwitchIndex
int IUFindOnSwitchIndex(const ISwitchVectorProperty *sp)
Returns the index of first ON switch it finds in the vector switch property.
Definition: indicom.c:1403
CelestronSCT::initProperties
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: celestron.cpp:45
INDI::DefaultDevice::addDebugControl
void addDebugControl()
Add Debug control to the driver.
Definition: defaultdevice.cpp:639
INDI::Focuser::initProperties
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
Definition: indifocuser.cpp:58
INDI::DefaultDevice::deleteProperty
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
Definition: defaultdevice.cpp:965
INDI::Focuser::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: indifocuser.cpp:168
INDI::FocuserInterface::FocusAbsPosN
INumber FocusAbsPosN[1]
Definition: indifocuserinterface.h:283
IDSetNumber
void void void IDSetNumber(const INumberVectorProperty *n, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing number vector property.
IDSetSwitch
void void void void void IDSetSwitch(const ISwitchVectorProperty *s, const char *msg,...) ATTRIBUTE_FORMAT_PRINTF(2
Tell client to update an existing switch vector property.
IUFillSwitch
void IUFillSwitch(ISwitch *sp, const char *name, const char *label, ISState s)
Assign attributes for a switch property. The switch's auxiliary elements will be set to NULL.
Definition: indidriver.c:320
Aux::buffer
std::vector< uint8_t > buffer
Definition: celestronauxpacket.h:38
INDI::FocuserInterface::FocusSpeedN
INumber FocusSpeedN[1]
Definition: indifocuserinterface.h:269
_ISwitchVectorProperty::name
char name[MAXINDINAME]
Definition: indiapi.h:370