User Tools

Site Tools


code:telescope_driver

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
code:telescope_driver [2008/12/29 22:03] – created pkubanekcode:telescope_driver [2010/01/17 02:41] pkubanek
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::Telescope]] abstract class. This class provides pure virtual methods, which you must overwrite. The method names should be self explanatory and are well documented.
  
 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://rts-2.svn.sf.net/viewvc/rts-2/trunk/rts-2/src/teld/gemini.cpp|src/teld/gemini.cpp]], which uses Rts2ConnSerial for serial port communication. 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://rts-2.svn.sf.net/viewvc/rts-2/trunk/rts-2/src/teld/gemini.cpp|src/teld/gemini.cpp]], which uses Rts2ConnSerial for serial port communication.
Line 8: Line 8:
  
 <code c++> <code c++>
-#include "telescope.h"+#include "teld.h"
  
-class Rts2DevMyTelescope: public Rts2DevTelescope+using namespace rts2teld; 
 + 
 +class MyTelescope: public Telescope
 { {
   protected:   protected:
Line 18: Line 20:
     virtual int stopPark ();     virtual int stopPark ();
   public:   public:
-    Rts2DevMyTelescope (int argc, char ** argv);+    MyTelescope (int argc, char ** argv);
 }; };
  
-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 (int argc, char ** argv): Rts2DevTelescope (argc, argv)+MyTelescope::MyTelescope (int argc, char ** argv): Telescope (argc, argv)
 { {
  
Line 64: Line 62:
  
 <code c++> <code c++>
-int + 
-main (int argc, char **argv)+int main (int argc, char **argv)
 { {
-  Rts2DevMyTelescope device = Rts2DevMyTelescope (argc, argv);+  MyTelescope device = MyTelescope (argc, argv);
   return device.run ();   return device.run ();
 } }
code/telescope_driver.txt · Last modified: 2010/01/17 00:00 (external edit)