Instrument Neutral Distributed Interface INDI  2.0.2
lx200gotonova.h
Go to the documentation of this file.
1 /*
2  GotoNova INDI driver
3 
4  Copyright (C) 2017 Jasem Mutlaq
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #pragma once
22 
23 #include "lx200generic.h"
24 
26 {
27  public:
28  LX200GotoNova();
30 
31  virtual bool updateProperties() override;
32  virtual bool initProperties() override;
33 
34  virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
35 
36  protected:
37  virtual const char *getDefaultName() override;
38 
39  virtual void getBasicData() override;
40  virtual bool checkConnection() override;
41  virtual bool isSlewComplete() override;
42 
43  virtual bool ReadScopeStatus() override;
44 
45  virtual bool SetSlewRate(int index) override;
46  virtual bool SetTrackMode(uint8_t mode) override;
47  virtual bool Goto(double, double) override;
48  virtual bool Sync(double ra, double dec) override;
49  virtual bool updateTime(ln_date *utc, double utc_offset) override;
50  virtual bool updateLocation(double latitude, double longitude, double elevation) override;
51 
52  virtual bool saveConfigItems(FILE *fp) override;
53 
54  virtual bool Park() override;
55  virtual bool UnPark() override;
56 
57  private:
58  int setGotoNovaStandardProcedure(int fd, const char *data);
59  void setGuidingEnabled(bool enable);
60  int GotonovaSyncCMR(char *matchedObject);
61 
62  // Settings
63  int setGotoNovaLatitude(double Lat);
64  int setGotoNovaLongitude(double Long);
65  int setGotoNovaUTCOffset(double hours);
66  int setCalenderDate(int fd, int dd, int mm, int yy);
67 
68  // Motion
69  int slewGotoNova();
70 
71  // Park
72  int setGotoNovaParkPosition(int position);
73 
74  // Track Mode
75  int setGotoNovaTrackMode(int mode);
76  int getGotoNovaTrackMode(int *mode);
77 
78  // Guide Rate
79  int setGotoNovaGuideRate(int rate);
80  int getGotoNovaGuideRate(int *rate);
81 
82  // Pier Side
83  void syncSideOfPier();
84 
85  // Simulation
86  void mountSim();
87 
88  // Custom Parking Position
89  ISwitch ParkPositionS[5];
90  ISwitchVectorProperty ParkPositionSP;
91  enum { PS_NORTH_POLE, PS_LEFT_VERTICAL, PS_LEFT_HORIZON, PS_RIGHT_VERTICAL, PS_RIGHT_HORIZON };
92 
93  // Sync type
94  ISwitch SyncCMRS[2];
95  ISwitchVectorProperty SyncCMRSP;
96  enum { USE_REGULAR_SYNC, USE_CMR_SYNC };
97 
98 
99  /* Guide Rate */
100  ISwitch GuideRateS[4];
101  ISwitchVectorProperty GuideRateSP;
102 
103  bool isGuiding = false;
104 };
virtual bool isSlewComplete() override
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool SetSlewRate(int index) override
SetSlewRate Set desired slew rate index.
virtual bool checkConnection() override
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool Park() override
Park the telescope to its home position.
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool ReadScopeStatus() override
Read telescope status.
virtual void getBasicData() override
virtual const char * getDefaultName() override
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
double ra
double dec
ISState
Switch state.
Definition: indiapi.h:150
int fd
Definition: intelliscope.c:43
One switch descriptor.
Switch vector property descriptor.
Definition: indiapi.h:367