code:telescope_driver
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| code:telescope_driver [2008/12/29 21:03] – created pkubanek | code:telescope_driver [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Tasks in implementing driver ====== | ====== Tasks in implementing driver ====== | ||
| - | To implement an RTS2 telescope driver, you need to create a child class inherited from [[Rts2DevTelescope]] abstract class. This class provides pure virtual methods, which you must overwrite. The method names should be self explanatory and are well documented. | + | To implement an RTS2 telescope driver, you need to create a child class inherited from [[rts2teld:: |
| If you are using a serial port to communicate with your telescope, you can consider using [[Rts2ConnSerial]] class to handle for you communication over serial port. For example how to use this class refer to [[http:// | If you are using a serial port to communicate with your telescope, you can consider using [[Rts2ConnSerial]] class to handle for you communication over serial port. For example how to use this class refer to [[http:// | ||
| Line 8: | Line 8: | ||
| <code c++> | <code c++> | ||
| - | #include "telescope.h" | + | #include "teld.h" |
| - | class Rts2DevMyTelescope: public | + | using namespace rts2teld; |
| + | |||
| + | class MyTelescope: public | ||
| { | { | ||
| protected: | protected: | ||
| Line 18: | Line 20: | ||
| virtual int stopPark (); | virtual int stopPark (); | ||
| public: | public: | ||
| - | | + | |
| }; | }; | ||
| - | int | + | int Telescope::startMove () |
| - | Rts2DevMyTelescope::startMove () | + | |
| { | { | ||
| struct ln_equ_struct tar; | struct ln_equ_struct tar; | ||
| Line 32: | Line 33: | ||
| } | } | ||
| - | int | + | int MyTelescope::stopMove () |
| - | Rts2DevMyTelescope::stopMove () | + | |
| { | { | ||
| return 0; // success | return 0; // success | ||
| } | } | ||
| - | int | + | int MyTelescope::startPark () |
| - | Rts2DevMyTelescope::startPark () | + | |
| { | { | ||
| // do all what is needed to move telescope to park position | // do all what is needed to move telescope to park position | ||
| Line 46: | Line 45: | ||
| } | } | ||
| - | int | + | int MyTelescope::endPark () |
| - | Rts2DevMyTelescope::endPark () | + | |
| { | { | ||
| return 0; | return 0; | ||
| } | } | ||
| - | Rts2DevMyTelescope::Rts2DevMyTelescope | + | MyTelescope::MyTelescope |
| { | { | ||
| Line 64: | Line 62: | ||
| <code c++> | <code c++> | ||
| - | int | + | |
| - | main (int argc, char **argv) | + | int main (int argc, char **argv) |
| { | { | ||
| - | | + | |
| return device.run (); | return device.run (); | ||
| } | } | ||
code/telescope_driver.1230584624.txt.gz · Last modified: 2008/12/28 23:00 (external edit)