~daggerstab/stellarium/telescope-control-0-4-0

« back to all changes in this revision

Viewing changes to plugins/TelescopeControl/src/clients/TelescopeClientAscom.hpp

  • Committer: Bogdan Marinov
  • Date: 2012-11-21 18:05:30 UTC
  • Revision ID: bogdan.marinov84@gmail.com-20121121180530-q2o1dg339m0hg5j2
cleanup and extension of TelescopeClientAscom

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
//! Telescope client that uses an ASCOM driver.
30
30
//! The ASCOM platform is a driver interface standard based on Microsoft's
31
31
//! Component Object Model (COM). ASCOM drivers are COM objects, so this class
32
 
//! has to use Qt's AxContainer module. In this class, the selected driver is
 
32
//! has to use Qt's AxContainer module. The selected driver is
33
33
//! loaded by a QAxObject object, and communication with it (the driver) is
34
34
//! possible only via QAxObject::dynamicCall() and similar functions.
 
35
//! \ingroup telescope-markers
35
36
class TelescopeClientAscom : public TelescopeClient
36
37
{
37
38
        Q_OBJECT
48
49
        bool prepareCommunication();
49
50
        void performCommunication();
50
51
        void telescopeGoto(const Vec3d &j2000Pos);
 
52
        
 
53
        //! @name ASCOM property testing wrappers
 
54
        //@{
 
55
        bool canPark();
 
56
        //! Actually tests asynchronos slewing.
 
57
        bool canSlew();
 
58
        bool canSync();
 
59
        bool canUnpark();
 
60
        //@}
 
61
        
 
62
public slots:
 
63
        //! @name ASCOM command wrappers
 
64
        //@{
 
65
        //! Stop the current movement.
 
66
        void abortMovement();
 
67
        //! Set the driver's coordinates from Stellarium's coodinates.
 
68
        void synch(double ra, double dec);
 
69
        //@}
 
70
        
51
71
 
52
72
signals:
53
73
        void ascomError(QString);
71
91
        QAxObject* driver;
72
92
        //! String identifier of the ASCOM driver object.
73
93
        QString driverId;
 
94
        
 
95
        //! Helper function for testing boolean properties.
 
96
        bool testAbility(const char* name);
74
97
 
75
98
        //! Deletes the internal driver object, putting the client into
76
99
        //! a deinitialized state.
86
109
        //! ASCOM driver description extracted from the driver object.
87
110
        QString ascomDescription;
88
111
 
89
 
        //ASCOM named properties and functions
 
112
        //! @name ASCOM named properties
 
113
        //! @todo Is there a point? Most are used only once.
 
114
        //@{
90
115
        static const char* P_CONNECTED;
91
116
        static const char* P_PARKED;
92
117
        static const char* P_TRACKING;
97
122
        static const char* P_RA;
98
123
        static const char* P_DEC;
99
124
        static const char* P_EQUATORIAL_SYSTEM;
 
125
        //@}
 
126
        
 
127
        //! @name ASCOM named methods
 
128
        //@{
 
129
        static const char* M_SLEW;
100
130
        static const char* M_UNPARK;
101
 
        static const char* M_SLEW;
102
 
        static const char* M_SLEW_ASYNCHRONOUSLY;
 
131
        //@}
103
132
};
104
133
 
 
134
typedef QSharedPointer<TelescopeClientAscom> TelescopeClientAscomP;
 
135
 
105
136
#endif //_TELESCOPE_CLIENT_ASCOM_HPP_