Instrument Neutral Distributed Interface INDI  2.0.2
telescope_script.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2016 CloudMakers, s. r. o.. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7  .
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12  .
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17  *******************************************************************************/
18 
19 #pragma once
20 
21 #include "inditelescope.h"
22 
24 {
25  public:
26  ScopeScript();
27  virtual ~ScopeScript() = default;
28 
29  virtual const char *getDefaultName() override;
30  virtual bool initProperties() override;
31  virtual bool saveConfigItems(FILE *fp) override;
32 
33  void ISGetProperties(const char *dev) override;
34  bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
35  virtual bool Connect() override;
36  virtual bool Disconnect() override;
37  virtual bool Handshake() override;
38 
39  protected:
40  virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override;
41  virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override;
42  virtual bool Abort() override;
43 
44  virtual bool ReadScopeStatus() override;
45  virtual bool Goto(double, double) override;
46  virtual bool Sync(double ra, double dec) override;
47  virtual bool Park() override;
48  virtual bool UnPark() override;
49 
50  private:
51  bool RunScript(int script, ...);
52 
53  ITextVectorProperty ScriptsTP;
54  IText ScriptsT[15] {};
55 };
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
virtual ~ScopeScript()=default
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
virtual const char * getDefaultName() override
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
virtual bool Park() override
Park the telescope to its home position.
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
virtual bool Disconnect() override
Disconnect from device.
double ra
double dec
INDI_DIR_WE
Definition: indibasetypes.h:55
INDI_DIR_NS
Definition: indibasetypes.h:48
One text descriptor.
Text vector property descriptor.
Definition: indiapi.h:246