| 1 | /******************************************************************************* |
| 2 | Driver type: TitanTCS for HOBYM CRUX Mount INDI Driver |
| 3 | |
| 4 | Copyright(c) 2020 Park Suyoung <[email protected]>. All rights reserved. |
| 5 | |
| 6 | This library is free software; you can redistribute it and/or |
| 7 | modify it under the terms of the GNU Library General Public |
| 8 | License version 2 as published by the Free Software Foundation. |
| 9 | . |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Library General Public License for more details. |
| 14 | . |
| 15 | You should have received a copy of the GNU Library General Public License |
| 16 | along with this library; see the file COPYING.LIB. If not, write to |
| 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | Boston, MA 02110-1301, USA. |
| 19 | *******************************************************************************/ |
| 20 | |
| 21 | #pragma once |
| 22 | |
| 23 | #include "inditelescope.h"cxx . . $ `<file>/libs/indibase/inditelescope.h`/ |
| 24 | #include "indiguiderinterface.h"cxx . . $ `<file>/libs/indibase/indiguiderinterface.h`/ |
| 25 | |
| 26 | #define RESPONSE_TIMEOUTcxx . . $ `drivers/telescope/crux_mount.h:26:9`! 3 |
| 27 | #define USE_PECcxx . . $ `drivers/telescope/crux_mount.h:27:9`! 1 |
| 28 | |
| 29 | typedef structcxx . . $ $anonymous_type_4e56eacca14deae5_0# |
| 30 | { |
| 31 | double racxx . . $ $anonymous_type_4e56eacca14deae5_0#ra.; |
| 32 | double deccxx . . $ $anonymous_type_4e56eacca14deae5_0#dec.; |
| 33 | // |
| 34 | int Parkingcxx . . $ $anonymous_type_4e56eacca14deae5_0#Parking.; |
| 35 | #if USE_PECcxx . . $ `drivers/telescope/crux_mount.h:27:9`! |
| 36 | int PECStatuscxx . . $ $anonymous_type_4e56eacca14deae5_0#PECStatus.; |
| 37 | #endif |
| 38 | int Landscapecxx . . $ $anonymous_type_4e56eacca14deae5_0#Landscape.; |
| 39 | int TrackingRatecxx . . $ $anonymous_type_4e56eacca14deae5_0#TrackingRate.; |
| 40 | int TrackingStatuscxx . . $ $anonymous_type_4e56eacca14deae5_0#TrackingStatus.; |
| 41 | } stTitanTCScxx . . $ stTitanTCS#; |
| 42 | |
| 43 | class TitanTCScxx . . $ TitanTCS# : public INDIcxx . . $ INDI/::Telescopecxx . . $ INDI/Telescope#, public INDIcxx . . $ INDI/::GuiderInterfacecxx . . $ INDI/GuiderInterface# |
| 44 | { |
| 45 | public: |
| 46 | TitanTCScxx . . $ TitanTCS#TitanTCS(49f6e7a06ebc5aa8).(); |
| 47 | |
| 48 | private: |
| 49 | int m_Connectcxx . . $ TitanTCS#m_Connect.; |
| 50 | |
| 51 | public: |
| 52 | virtual const char *getDefaultNamecxx . . $ TitanTCS#getDefaultName(33a1f659e94feb42).() override; |
| 53 | virtual bool Connectcxx . . $ TitanTCS#Connect(c9857a73d68e59ba).() override; |
| 54 | virtual bool Disconnectcxx . . $ TitanTCS#Disconnect(c9857a73d68e59ba).() override; |
| 55 | virtual bool Handshakecxx . . $ TitanTCS#Handshake(c9857a73d68e59ba).() override; |
| 56 | virtual bool ReadScopeStatuscxx . . $ TitanTCS#ReadScopeStatus(c9857a73d68e59ba).() override; |
| 57 | |
| 58 | //virtual void ISGetProperties(const char *dev) override; |
| 59 | virtual bool ISNewNumbercxx . . $ TitanTCS#ISNewNumber(b910d3521abb33fb).(const char *dev, const char *name, double values[], char *names[], int n) override; |
| 60 | virtual bool ISNewSwitchcxx . . $ TitanTCS#ISNewSwitch(e439c05866add404).(const char *dev, const char *name, ISStatecxx . . $ ISState# *states, char *names[], int n) override; |
| 61 | virtual bool initPropertiescxx . . $ TitanTCS#initProperties(c9857a73d68e59ba).() override; |
| 62 | virtual bool updatePropertiescxx . . $ TitanTCS#updateProperties(c9857a73d68e59ba).() override; |
| 63 | |
| 64 | virtual bool ISNewTextcxx . . $ TitanTCS#ISNewText(1f3dbebc116ed926).(const char *dev, const char *name, char **texts, char **names, int n) override; |
| 65 | |
| 66 | private: |
| 67 | // Mount Info. |
| 68 | ITextVectorPropertycxx . . $ ITextVectorProperty# MountInfoTPcxx . . $ TitanTCS#MountInfoTP.; |
| 69 | ITextcxx . . $ IText# MountInfoTcxx . . $ TitanTCS#MountInfoT.[2] {}; |
| 70 | int GuideNSTIDcxx . . $ TitanTCS#GuideNSTID. { -1 }; |
| 71 | int GuideWETIDcxx . . $ TitanTCS#GuideWETID. { -1 }; |
| 72 | |
| 73 | stTitanTCScxx . . $ stTitanTCS# infocxx . . $ TitanTCS#info.; |
| 74 | #if USE_PECcxx . . $ `drivers/telescope/crux_mount.h:27:9`! |
| 75 | // PECStatus |
| 76 | int _PECStatuscxx . . $ TitanTCS#_PECStatus. {0}; |
| 77 | |
| 78 | // PEC Training |
| 79 | ISwitchcxx . . $ ISwitch# PECTrainingScxx . . $ TitanTCS#PECTrainingS.[2]; |
| 80 | ISwitchVectorPropertycxx . . $ ISwitchVectorProperty# PECTrainingSPcxx . . $ TitanTCS#PECTrainingSP.; |
| 81 | // PEC Info. |
| 82 | ITextVectorPropertycxx . . $ ITextVectorProperty# PECInfoTPcxx . . $ TitanTCS#PECInfoTP.; |
| 83 | ITextcxx . . $ IText# PECInfoTcxx . . $ TitanTCS#PECInfoT.[2] {}; |
| 84 | #endif |
| 85 | |
| 86 | protected: |
| 87 | // Goto, Sync, and Motion |
| 88 | virtual bool Gotocxx . . $ TitanTCS#Goto(828b76dce88fac).(double ra, double dec) override; |
| 89 | //bool GotoAzAlt(double az, double alt); |
| 90 | virtual bool Synccxx . . $ TitanTCS#Sync(828b76dce88fac).(double ra, double dec) override; |
| 91 | virtual bool MoveNScxx . . $ TitanTCS#MoveNS(ffb1bb92c4b05851).(INDI_DIR_NScxx . . $ INDI_DIR_NS# dir, TelescopeMotionCommandcxx . . $ INDI/Telescope#TelescopeMotionCommand# command) override; |
| 92 | virtual bool MoveWEcxx . . $ TitanTCS#MoveWE(a98f225cdad633ca).(INDI_DIR_WEcxx . . $ INDI_DIR_WE# dir, TelescopeMotionCommandcxx . . $ INDI/Telescope#TelescopeMotionCommand# command) override; |
| 93 | virtual bool Abortcxx . . $ TitanTCS#Abort(c9857a73d68e59ba).() override; |
| 94 | virtual bool SetSlewRatecxx . . $ TitanTCS#SetSlewRate(83c267b20bac841a).(int index) override; |
| 95 | |
| 96 | // Time and Location |
| 97 | virtual bool updateLocationcxx . . $ TitanTCS#updateLocation(c3c51e0645da350e).(double latitude, double longitude, double elevation) override; |
| 98 | virtual bool updateTimecxx . . $ TitanTCS#updateTime(8f5ba5a5ba688cb1).(ln_datecxx . . $ ln_date# *utc, double utc_offset) override; |
| 99 | |
| 100 | //GUIDE: guiding functions |
| 101 | virtual IPStatecxx . . $ IPState# GuideNorthcxx . . $ TitanTCS#GuideNorth(e933ec4323fbb8bc).(uint32_tcxx . . $ uint32_t# ms) override; |
| 102 | virtual IPStatecxx . . $ IPState# GuideSouthcxx . . $ TitanTCS#GuideSouth(e933ec4323fbb8bc).(uint32_tcxx . . $ uint32_t# ms) override; |
| 103 | virtual IPStatecxx . . $ IPState# GuideEastcxx . . $ TitanTCS#GuideEast(e933ec4323fbb8bc).(uint32_tcxx . . $ uint32_t# ms) override; |
| 104 | virtual IPStatecxx . . $ IPState# GuideWestcxx . . $ TitanTCS#GuideWest(e933ec4323fbb8bc).(uint32_tcxx . . $ uint32_t# ms) override; |
| 105 | // Tracking |
| 106 | virtual bool SetTrackModecxx . . $ TitanTCS#SetTrackMode(cef82f9be00a201a).(uint8_tcxx . . $ uint8_t# mode) override; |
| 107 | virtual bool SetTrackEnabledcxx . . $ TitanTCS#SetTrackEnabled(efaadfb7dc14930a).(bool enabled) override; |
| 108 | |
| 109 | // Parking |
| 110 | virtual bool Parkcxx . . $ TitanTCS#Park(c9857a73d68e59ba).() override; |
| 111 | virtual bool UnParkcxx . . $ TitanTCS#UnPark(c9857a73d68e59ba).() override; |
| 112 | virtual bool SetCurrentParkcxx . . $ TitanTCS#SetCurrentPark(c9857a73d68e59ba).() override; |
| 113 | virtual bool SetDefaultParkcxx . . $ TitanTCS#SetDefaultPark(c9857a73d68e59ba).() override; |
| 114 | virtual bool SetParkPositioncxx . . $ TitanTCS#SetParkPosition(828b76dce88fac).(double Axis1Value, double Axis2Value) override; |
| 115 | |
| 116 | private: |
| 117 | bool SendCommandcxx . . $ TitanTCS#SendCommand(c5f7da30cbc0f4e9).(const char *cmd_org); |
| 118 | bool SendCommandcxx . . $ TitanTCS#SendCommand(2551bed5d6fc04f6).(const char *cmd, int val); |
| 119 | bool SendCommandcxx . . $ TitanTCS#SendCommand(fbabcc4b81353ae).(const char *cmd, double val); |
| 120 | |
| 121 | bool CommandResponsecxx . . $ TitanTCS#CommandResponse(da7d31a7f586176b).(const char* pCommand, const char* pResponse, char delimeter, double *pDouble, int *pInteger = nullptr); |
| 122 | bool CommandResponseHourcxx . . $ TitanTCS#CommandResponseHour(9acae44707d6df5b).(const char* pCommand, const char* pResponse, char delimeter, double* Hour); |
| 123 | bool CommandResponseStrcxx . . $ TitanTCS#CommandResponseStr(5752322952863319).(const char* pCommand, const char* pResponse, char delimeter, char* pReturn, int len = 0); |
| 124 | bool CommandResponseCharcxx . . $ TitanTCS#CommandResponseChar(dfb34736e99ce5d).(const char* pCommand, const char* pResponse, char* pReturn); |
| 125 | |
| 126 | bool GetMountParamscxx . . $ TitanTCS#GetMountParams(efaadfb7dc14930a).(bool bAll = false); |
| 127 | |
| 128 | bool GetParamStrcxx . . $ TitanTCS#GetParamStr(a8645324ac57a48d).(const char* pInStr, char* pOutStr, int len, const char* pResponse, char delimeter); |
| 129 | bool GetParamNumbercxx . . $ TitanTCS#GetParamNumber(343e723c03b6cffc).(const char* pInStr, char* pOutStr, int len, const char* pResponse, char delimeter, double *pDouble, |
| 130 | int *pInteger = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 131 | bool GetParamHourcxx . . $ TitanTCS#GetParamHour(352ed76c96c8ec5d).(const char* pInStr, char* pOutStr, int len, const char* pResponse, char delimeter, double *pHour); |
| 132 | |
| 133 | bool GetEqPositioncxx . . $ TitanTCS#GetEqPosition(ce93fceeffccf0ef).(INDI_EQ_AXIScxx . . $ INDI_EQ_AXIS# axis, double *value); |
| 134 | bool GetEqPositioncxx . . $ TitanTCS#GetEqPosition(d4b2eeea6769c73a).(double *ra, double *dec); |
| 135 | |
| 136 | void ReadFlushcxx . . $ TitanTCS#ReadFlush(49f6e7a06ebc5aa8).(); |
| 137 | int ReadResponsecxx . . $ TitanTCS#ReadResponse(f3fbc4f21453136).(char *buf, int len, char delimeter, int timeout = RESPONSE_TIMEOUTcxx . . $ `drivers/telescope/crux_mount.h:26:9`!); |
| 138 | |
| 139 | bool SetTargetcxx . . $ TitanTCS#SetTarget(828b76dce88fac).(double ra, double dec); |
| 140 | |
| 141 | void guideTimeoutNScxx . . $ TitanTCS#guideTimeoutNS(49f6e7a06ebc5aa8).(); |
| 142 | void guideTimeoutWEcxx . . $ TitanTCS#guideTimeoutWE(49f6e7a06ebc5aa8).(); |
| 143 | |
| 144 | static void guideTimeoutHelperNScxx . . $ TitanTCS#guideTimeoutHelperNS(5d22bdacc48458e8).(void * p); |
| 145 | static void guideTimeoutHelperWEcxx . . $ TitanTCS#guideTimeoutHelperWE(5d22bdacc48458e8).(void * p); |
| 146 | #if USE_PECcxx . . $ `drivers/telescope/crux_mount.h:27:9`! |
| 147 | void _setPECStatecxx . . $ TitanTCS#_setPECState(d4f767463ce0a6b3).(int pec_status); |
| 148 | #endif |
| 149 | }; |
| 150 | |
| 151 |