File indexing completed on 2024-04-21 14:46:08

0001 /*
0002     SPDX-FileCopyrightText: 2012 Jasem Mutlaq <mutlaqja@ikarustech.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "indiconcretedevice.h"
0010 
0011 namespace ISD
0012 {
0013 /**
0014  * @class Focuser
0015  * Focuser class handles control of INDI focuser devices. Both relative and absolute focusers can be controlled.
0016  *
0017  * @author Jasem Mutlaq
0018  */
0019 
0020 class Focuser : public ConcreteDevice
0021 {
0022         Q_OBJECT
0023 
0024     public:
0025         enum FocusDirection
0026         {
0027             FOCUS_INWARD,
0028             FOCUS_OUTWARD
0029         };
0030         enum FocusDeviation
0031         {
0032             NIKONZ6
0033         };
0034 
0035         explicit Focuser(GenericDevice *parent) : ConcreteDevice(parent) {}
0036 
0037         void registerProperty(INDI::Property prop) override;
0038         void processNumber(INDI::Property prop) override;
0039 
0040         bool focusIn();
0041         bool focusOut();
0042         bool stop();
0043         bool moveByTimer(int msecs);
0044         bool moveAbs(int steps);
0045         bool moveRel(int steps);
0046 
0047         bool canAbsMove();
0048         bool canRelMove();
0049         bool canTimerMove();
0050         bool canManualFocusDriveMove();
0051         double getLastManualFocusDriveValue();
0052 
0053         bool hasBacklash();
0054         bool hasDeviation();
0055         bool setBacklash(int32_t steps);
0056         int32_t getBacklash();
0057 
0058         bool getFocusDirection(FocusDirection *dir);
0059 
0060         // Max Travel
0061         uint32_t getmaxPosition()
0062         {
0063             return m_maxPosition;
0064         }
0065         bool setMaxPosition(uint32_t steps);
0066 
0067     private:
0068         uint32_t m_maxPosition {0};
0069         int deviation = -1;
0070 
0071 };
0072 }