Instrument Neutral Distributed Interface INDI  2.0.2
lx200classic.cpp
Go to the documentation of this file.
1 /*
2  LX200 Classoc
3  Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 */
20 
21 #include "lx200classic.h"
22 #include "lx200driver.h"
23 #include "indicom.h"
24 
25 #include <cstring>
26 
27 #include <libnova/transform.h>
28 
29 #define LIBRARY_TAB "Library"
30 
32 {
34 
35  setVersion(1, 1);
36 }
37 
39 {
40  return "LX200 Classic";
41 }
42 
44 {
47 
48  IUFillText(&ObjectInfoT[0], "Info", "", "");
49  IUFillTextVector(&ObjectInfoTP, ObjectInfoT, 1, getDeviceName(), "Object Info", "", MAIN_CONTROL_TAB, IP_RO, 0,
50  IPS_IDLE);
51 
52  IUFillSwitch(&StarCatalogS[0], "Star", "", ISS_ON);
53  IUFillSwitch(&StarCatalogS[1], "SAO", "", ISS_OFF);
54  IUFillSwitch(&StarCatalogS[2], "GCVS", "", ISS_OFF);
55  IUFillSwitchVector(&StarCatalogSP, StarCatalogS, 3, getDeviceName(), "Star Catalogs", "", LIBRARY_TAB, IP_RW,
56  ISR_1OFMANY, 0, IPS_IDLE);
57 
58  IUFillSwitch(&DeepSkyCatalogS[0], "NGC", "", ISS_ON);
59  IUFillSwitch(&DeepSkyCatalogS[1], "IC", "", ISS_OFF);
60  IUFillSwitch(&DeepSkyCatalogS[2], "UGC", "", ISS_OFF);
61  IUFillSwitch(&DeepSkyCatalogS[3], "Caldwell", "", ISS_OFF);
62  IUFillSwitch(&DeepSkyCatalogS[4], "Arp", "", ISS_OFF);
63  IUFillSwitch(&DeepSkyCatalogS[5], "Abell", "", ISS_OFF);
64  IUFillSwitch(&DeepSkyCatalogS[6], "Messier", "", ISS_OFF);
65  IUFillSwitchVector(&DeepSkyCatalogSP, DeepSkyCatalogS, 7, getDeviceName(), "Deep Sky Catalogs", "", LIBRARY_TAB,
67 
68  IUFillSwitch(&SolarS[0], "Select", "Select item", ISS_ON);
69  IUFillSwitch(&SolarS[1], "1", "Mercury", ISS_OFF);
70  IUFillSwitch(&SolarS[2], "2", "Venus", ISS_OFF);
71  IUFillSwitch(&SolarS[3], "3", "Moon", ISS_OFF);
72  IUFillSwitch(&SolarS[4], "4", "Mars", ISS_OFF);
73  IUFillSwitch(&SolarS[5], "5", "Jupiter", ISS_OFF);
74  IUFillSwitch(&SolarS[6], "6", "Saturn", ISS_OFF);
75  IUFillSwitch(&SolarS[7], "7", "Uranus", ISS_OFF);
76  IUFillSwitch(&SolarS[8], "8", "Neptune", ISS_OFF);
77  IUFillSwitch(&SolarS[9], "9", "Pluto", ISS_OFF);
78  IUFillSwitchVector(&SolarSP, SolarS, 10, getDeviceName(), "SOLAR_SYSTEM", "Solar System", LIBRARY_TAB, IP_RW,
79  ISR_1OFMANY, 0, IPS_IDLE);
80 
81  IUFillNumber(&ObjectNoN[0], "ObjectN", "Number", "%+03f", 1.0, 1000.0, 1.0, 0);
82  IUFillNumberVector(&ObjectNoNP, ObjectNoN, 1, getDeviceName(), "Object Number", "", LIBRARY_TAB, IP_RW, 0,
83  IPS_IDLE);
84 
85  IUFillNumber(&MaxSlewRateN[0], "RATE", "Rate", "%.2f", 2.0, 9.0, 1.0, 9.0);
86  IUFillNumberVector(&MaxSlewRateNP, MaxSlewRateN, 1, getDeviceName(), "TELESCOPE_MAX_SLEW_RATE", "Slew Rate", MOTION_TAB,
87  IP_RW, 0, IPS_IDLE);
88 
89  IUFillNumber(&ElevationLimitN[0], "MIN_ALT", "Min Alt.", "%+.2f", -90.0, 90.0, 0.0, 0.0);
90  IUFillNumber(&ElevationLimitN[1], "MAX_ALT", "Max Alt", "%+.2f", -90.0, 90.0, 0.0, 0.0);
91  IUFillNumberVector(&ElevationLimitNP, ElevationLimitN, 2, getDeviceName(), "TELESCOPE_ELEVATION_SLEW_LIMIT",
92  "Slew elevation Limit", MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE);
93 
94  IUFillSwitch(&UnparkAlignmentS[0], "Polar", "", ISS_ON);
95  IUFillSwitch(&UnparkAlignmentS[1], "AltAz", "", ISS_OFF);
96  IUFillSwitch(&UnparkAlignmentS[2], "Land", "", ISS_OFF);
97  IUFillSwitchVector(&UnparkAlignmentSP, UnparkAlignmentS, 3, getDeviceName(), "Unpark Mode", "", SITE_TAB, IP_RW,
98  ISR_1OFMANY, 0, IPS_IDLE);
99 
100  return true;
101 }
102 
104 {
106 
107  if (isConnected())
108  {
109  defineProperty(&ElevationLimitNP);
110  defineProperty(&ObjectInfoTP);
111  defineProperty(&SolarSP);
112  defineProperty(&StarCatalogSP);
113  defineProperty(&DeepSkyCatalogSP);
114  defineProperty(&ObjectNoNP);
115  defineProperty(&MaxSlewRateNP);
116  defineProperty(&UnparkAlignmentSP);
117 
118  if (InitPark())
119  {
120  // If loading parking data is successful, we just set the default parking values.
121  // Default values are poinitng to North or South Pole in AltAz coordinates.
122  SetAxis1ParkDefault(LocationN[LOCATION_LATITUDE].value >= 0 ? 0 : 180);
124  }
125  else
126  {
127  // Otherwise, we set all parking data to default in case no parking data is found.
128  SetAxis1Park(LocationN[LOCATION_LATITUDE].value >= 0 ? 0 : 180);
130 
131  SetAxis1ParkDefault(LocationN[LOCATION_LATITUDE].value >= 0 ? 0 : 180);
133  }
134 
135  return true;
136  }
137  else
138  {
139  deleteProperty(ElevationLimitNP.name);
140  deleteProperty(ObjectInfoTP.name);
141  deleteProperty(SolarSP.name);
142  deleteProperty(StarCatalogSP.name);
143  deleteProperty(DeepSkyCatalogSP.name);
144  deleteProperty(ObjectNoNP.name);
145  deleteProperty(MaxSlewRateNP.name);
146  deleteProperty(UnparkAlignmentSP.name);
147 
148  return true;
149  }
150 }
151 
152 bool LX200Classic::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
153 {
154  if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
155  {
156  if (!strcmp(name, ObjectNoNP.name))
157  {
158  char object_name[256] = {0};
159 
160  if (selectCatalogObject(PortFD, currentCatalog, (int)values[0]) < 0)
161  {
162  ObjectNoNP.s = IPS_ALERT;
163  IDSetNumber(&ObjectNoNP, "Failed to select catalog object.");
164  return false;
165  }
166 
169 
170  ObjectNoNP.s = IPS_OK;
171  IDSetNumber(&ObjectNoNP, "Object updated.");
172 
173  if (getObjectInfo(PortFD, object_name) < 0)
174  IDMessage(getDeviceName(), "Getting object info failed.");
175  else
176  {
177  IUSaveText(&ObjectInfoTP.tp[0], object_name);
178  IDSetText(&ObjectInfoTP, nullptr);
179  }
180 
182  return true;
183  }
184 
185  if (!strcmp(name, MaxSlewRateNP.name))
186  {
187  if (setMaxSlewRate(PortFD, (int)values[0]) < 0)
188  {
189  MaxSlewRateNP.s = IPS_ALERT;
190  IDSetNumber(&MaxSlewRateNP, "Error setting maximum slew rate.");
191  return false;
192  }
193 
194  MaxSlewRateNP.s = IPS_OK;
195  MaxSlewRateNP.np[0].value = values[0];
196  IDSetNumber(&MaxSlewRateNP, nullptr);
197  return true;
198  }
199 
200  if (!strcmp(name, ElevationLimitNP.name))
201  {
202  // new elevation limits
203  double minAlt = 0, maxAlt = 0;
204  int i, nset;
205 
206  for (nset = i = 0; i < n; i++)
207  {
208  INumber *altp = IUFindNumber(&ElevationLimitNP, names[i]);
209  if (altp == &ElevationLimitN[0])
210  {
211  minAlt = values[i];
212  nset += minAlt >= -90.0 && minAlt <= 90.0;
213  }
214  else if (altp == &ElevationLimitN[1])
215  {
216  maxAlt = values[i];
217  nset += maxAlt >= -90.0 && maxAlt <= 90.0;
218  }
219  }
220  if (nset == 2)
221  {
222  if (setMinElevationLimit(PortFD, (int)minAlt) < 0)
223  {
224  ElevationLimitNP.s = IPS_ALERT;
225  IDSetNumber(&ElevationLimitNP, "Error setting elevation limit.");
226  return false;
227  }
228 
229  setMaxElevationLimit(PortFD, (int)maxAlt);
230  ElevationLimitNP.np[0].value = minAlt;
231  ElevationLimitNP.np[1].value = maxAlt;
232  ElevationLimitNP.s = IPS_OK;
233  IDSetNumber(&ElevationLimitNP, nullptr);
234  return true;
235  }
236  else
237  {
238  ElevationLimitNP.s = IPS_IDLE;
239  IDSetNumber(&ElevationLimitNP, "elevation limit missing or invalid.");
240  return false;
241  }
242  }
243  }
244 
245  return LX200Generic::ISNewNumber(dev, name, values, names, n);
246 }
247 
248 bool LX200Classic::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
249 {
250  int index = 0;
251 
252  if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
253  {
254  // Star Catalog
255  if (!strcmp(name, StarCatalogSP.name))
256  {
257  IUResetSwitch(&StarCatalogSP);
258  IUUpdateSwitch(&StarCatalogSP, states, names, n);
259  index = IUFindOnSwitchIndex(&StarCatalogSP);
260 
261  currentCatalog = LX200_STAR_C;
262 
263  if (selectSubCatalog(PortFD, currentCatalog, index))
264  {
265  currentSubCatalog = index;
266  StarCatalogSP.s = IPS_OK;
267  IDSetSwitch(&StarCatalogSP, nullptr);
268  return true;
269  }
270  else
271  {
272  StarCatalogSP.s = IPS_IDLE;
273  IDSetSwitch(&StarCatalogSP, "Catalog unavailable.");
274  return false;
275  }
276  }
277 
278  // Deep sky catalog
279  if (!strcmp(name, DeepSkyCatalogSP.name))
280  {
281  IUResetSwitch(&DeepSkyCatalogSP);
282  IUUpdateSwitch(&DeepSkyCatalogSP, states, names, n);
283  index = IUFindOnSwitchIndex(&DeepSkyCatalogSP);
284 
285  if (index == LX200_MESSIER_C)
286  {
287  currentCatalog = index;
288  DeepSkyCatalogSP.s = IPS_OK;
289  IDSetSwitch(&DeepSkyCatalogSP, nullptr);
290  }
291  else
292  currentCatalog = LX200_DEEPSKY_C;
293 
294  if (selectSubCatalog(PortFD, currentCatalog, index))
295  {
296  currentSubCatalog = index;
297  DeepSkyCatalogSP.s = IPS_OK;
298  IDSetSwitch(&DeepSkyCatalogSP, nullptr);
299  }
300  else
301  {
302  DeepSkyCatalogSP.s = IPS_IDLE;
303  IDSetSwitch(&DeepSkyCatalogSP, "Catalog unavailable");
304  return false;
305  }
306 
307  return true;
308  }
309 
310  // Solar system
311  if (!strcmp(name, SolarSP.name))
312  {
313  if (IUUpdateSwitch(&SolarSP, states, names, n) < 0)
314  return false;
315 
316  index = IUFindOnSwitchIndex(&SolarSP);
317 
318  // We ignore the first option : "Select item"
319  if (index == 0)
320  {
321  SolarSP.s = IPS_IDLE;
322  IDSetSwitch(&SolarSP, nullptr);
323  return true;
324  }
325 
327  selectCatalogObject(PortFD, LX200_STAR_C, index + 900);
328 
329  ObjectNoNP.s = IPS_OK;
330  SolarSP.s = IPS_OK;
331 
332  getObjectInfo(PortFD, ObjectInfoTP.tp[0].text);
333  IDSetNumber(&ObjectNoNP, "Object updated.");
334  IDSetSwitch(&SolarSP, nullptr);
335 
336  if (currentCatalog == LX200_STAR_C || currentCatalog == LX200_DEEPSKY_C)
337  selectSubCatalog(PortFD, currentCatalog, currentSubCatalog);
338 
341 
343 
344  return true;
345  }
346 
347  // Unpark Alignment Mode
348  if (!strcmp(name, UnparkAlignmentSP.name))
349  {
350  IUUpdateSwitch(&UnparkAlignmentSP, states, names, n);
351  UnparkAlignmentSP.s = IPS_OK;
352  IDSetSwitch(&UnparkAlignmentSP, nullptr);
353 
354  return true;
355  }
356 
357  }
358 
359  return LX200Generic::ISNewSwitch(dev, name, states, names, n);
360 }
361 
363 {
365 
366  IUSaveConfigNumber(fp, &MaxSlewRateNP);
367  IUSaveConfigNumber(fp, &ElevationLimitNP);
368 
369  IUSaveConfigSwitch(fp, &UnparkAlignmentSP);
370 
371  return true;
372 }
373 
374 //Parking
376 {
377  double parkAz = GetAxis1Park();
378  double parkAlt = GetAxis2Park();
379 
380  char AzStr[16], AltStr[16];
381  fs_sexa(AzStr, parkAz, 2, 3600);
382  fs_sexa(AltStr, parkAlt, 2, 3600);
383  LOGF_DEBUG("Parking to Az (%s) Alt (%s)...", AzStr, AltStr);
384 
385  INDI::IEquatorialCoordinates equatorialCoords {0, 0};
386  INDI::IHorizontalCoordinates horizontalCoords {parkAz, parkAlt};
387  INDI::HorizontalToEquatorial(&horizontalCoords, &m_Location, ln_get_julian_from_sys(), &equatorialCoords);
388 
389  //save the current AlignmentMode to UnparkAlignment
391  int curAlignment = IUFindOnSwitchIndex(&AlignmentSP);
392  IUResetSwitch(&UnparkAlignmentSP);
393  UnparkAlignmentS[curAlignment].s = ISS_ON;
394  UnparkAlignmentSP.s = IPS_OK;
395  IDSetSwitch(&UnparkAlignmentSP, nullptr);
396  saveConfig(true, UnparkAlignmentSP.name);
397 
398  if (!Goto(equatorialCoords.rightascension, equatorialCoords.declination))
399  {
400  ParkSP.s = IPS_ALERT;
401  IDSetSwitch(&ParkSP, "Parking Failed.");
402  return false;
403  }
404 
405  EqNP.s = IPS_BUSY;
407  LOG_INFO("Parking is in progress...");
408 
409  return true;
410 }
411 
413 {
414  if (isSimulation() == false)
415  {
416  // Parked in Land alignment. Restore previous mode.
417  if (setAlignmentMode(PortFD, IUFindOnSwitchIndex(&UnparkAlignmentSP)) < 0)
418  {
419  LOG_ERROR("UnParking Failed.");
421  IDSetSwitch(&AlignmentSP, "Error setting alignment mode.");
422  return false;
423  }
424  //Update the UI
426  }
427 
428  // Then we sync with to our last stored position
429  double parkAz = GetAxis1Park();
430  double parkAlt = GetAxis2Park();
431 
432  char AzStr[16], AltStr[16];
433  fs_sexa(AzStr, parkAz, 2, 3600);
434  fs_sexa(AltStr, parkAlt, 2, 3600);
435  LOGF_DEBUG("Syncing to parked coordinates Az (%s) Alt (%s)...", AzStr, AltStr);
436 
437  double parkRA = 0.0;
438  double parkDEC = 0.0;
439  //azAltToRaDecNow(parkAz, parkAlt, parkRA, parkDEC);
440  INDI::IEquatorialCoordinates equatorialCoords {parkRA, parkDEC};
441  INDI::IHorizontalCoordinates horizontalCoords {parkAz, parkAlt};
442  INDI::HorizontalToEquatorial(&horizontalCoords, &m_Location, ln_get_julian_from_sys(), &equatorialCoords);
443 
444  if (isSimulation())
445  {
446  currentRA = parkRA;
447  currentDEC = parkDEC;
448  }
449  else
450  {
451  if ((setObjectRA(PortFD, parkRA) < 0) || (setObjectDEC(PortFD, parkDEC) < 0))
452  {
453  LOG_ERROR("Error setting Unpark RA/Dec.");
454  return false;
455  }
456 
457  char syncString[256];
458  if (::Sync(PortFD, syncString) < 0)
459  {
460  LOG_WARN("Unpark Sync failed.");
461  return false;
462  }
463  }
464 
465  SetParked(false);
466  return true;
467 }
468 
470 {
472  INDI::IHorizontalCoordinates horizontalCoords {0, 0};
473  INDI::EquatorialToHorizontal(&equatorialCoords, &m_Location, ln_get_julian_from_sys(), &horizontalCoords);
474 
475  char AzStr[16], AltStr[16];
476  fs_sexa(AzStr, horizontalCoords.azimuth, 2, 3600);
477  fs_sexa(AltStr, horizontalCoords.altitude, 2, 3600);
478  LOGF_DEBUG("Setting current parking position to coordinates Az (%s) Alt (%s)...", AzStr, AltStr);
479 
480  SetAxis1Park(horizontalCoords.azimuth);
481  SetAxis2Park(horizontalCoords.altitude);
482 
483  return true;
484 }
485 
487 {
488  // Az = 0 for North hemisphere
489  SetAxis1Park(LocationN[LOCATION_LATITUDE].value > 0 ? 0 : 180);
490 
491  // Alt = Latitude
493 
494  return true;
495 }
496 
498 {
499  int curTrackState = TrackState;
500  static int settling = -1;
501 
502  if (settling >= 0) settling--;
503 
504  if ((TrackState == SCOPE_PARKED) && (settling == 0) && !isSimulation())
505  {
506  settling = -1;
508  {
509  LOG_ERROR("Parking Failed.");
511  IDSetSwitch(&AlignmentSP, "Error setting alignment mode.");
512  return false;
513  }
514  //Update the UI
516  LOG_DEBUG("Mount Land mode set. Parking completed.");
517  }
518 
520  {
521  if ((TrackState == SCOPE_PARKED) && (curTrackState == SCOPE_PARKING) && !isSimulation())
522  {
523  //allow scope to make internal state change to settled on target.
524  //otherwise changing to landmode slews the scope to same
525  //coordinates intepreted in landmode.
526  //Between isSlewComplete() and the beep there is nearly 3 seconds!
527  settling = 3; //n iterations of default 1000ms
528  }
529  }
530 
531  return true;
532 }
533 
bool isConnected() const
Definition: basedevice.cpp:520
const char * getDeviceName() const
Definition: basedevice.cpp:821
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
bool isSimulation() const
TelescopeStatus TrackState
void SetAxis1Park(double value)
SetRAPark Set current RA/AZ parking position. The data park file (stored in ~/.indi/ParkData....
void SetAxis1ParkDefault(double steps)
SetRAPark Set default RA/AZ parking position.
double GetAxis1Park() const
double GetAxis2Park() const
virtual void SetParked(bool isparked)
SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData....
INumberVectorProperty EqNP
ISwitchVectorProperty ParkSP
IGeographicCoordinates m_Location
INumber LocationN[3]
bool InitPark()
InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking...
void SetAxis2Park(double steps)
SetDEPark Set current DEC/ALT parking position. The data park file (stored in ~/.indi/ParkData....
void SetParkDataType(TelescopeParkData type)
setParkDataType Sets the type of parking data stored in the park data file and presented to the user.
void SetAxis2ParkDefault(double steps)
SetDEParkDefault Set default DEC/ALT parking position.
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool Park() override
Park the telescope to its home position.
bool initProperties() override
Called to initialize basic properties required all the time.
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
const char * getDefaultName() override
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
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 ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
ISwitchVectorProperty AlignmentSP
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
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...
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool Goto(double ra, double dec) override
Move the scope to the supplied RA and DEC coordinates.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
const char * MOTION_TAB
MOTION_TAB Where all the motion control properties of the device are located.
const char * SITE_TAB
SITE_TAB Where all site information setting are located.
ISState
Switch state.
Definition: indiapi.h:150
@ ISS_OFF
Definition: indiapi.h:151
@ ISS_ON
Definition: indiapi.h:152
@ IP_RW
Definition: indiapi.h:186
@ IP_RO
Definition: indiapi.h:184
@ IPS_BUSY
Definition: indiapi.h:163
@ IPS_ALERT
Definition: indiapi.h:164
@ IPS_IDLE
Definition: indiapi.h:161
@ IPS_OK
Definition: indiapi.h:162
@ ISR_1OFMANY
Definition: indiapi.h:173
int fs_sexa(char *out, double a, int w, int fracbase)
Converts a sexagesimal number to a string. sprint the variable a in sexagesimal format into out[].
Definition: indicom.c:141
Implementations for common driver routines.
void IUSaveConfigSwitch(FILE *fp, const ISwitchVectorProperty *svp)
Add a switch vector property value to the configuration file.
Definition: indidevapi.c:25
void IUFillNumberVector(INumberVectorProperty *nvp, INumber *np, int nnp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a number vector property. The vector's auxiliary elements will be set to NULL.
Definition: indidevapi.c:272
INumber * IUFindNumber(const INumberVectorProperty *nvp, const char *name)
Find an INumber member in a number text property.
Definition: indidevapi.c:66
int IUFindOnSwitchIndex(const ISwitchVectorProperty *svp)
Returns the index of first ON switch it finds in the vector switch property.
Definition: indidevapi.c:128
void IUResetSwitch(ISwitchVectorProperty *svp)
Reset all switches in a switch vector property to OFF.
Definition: indidevapi.c:148
void IUFillTextVector(ITextVectorProperty *tvp, IText *tp, int ntp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a text vector property. The vector's auxiliary elements will be set to NULL.
Definition: indidevapi.c:291
void IUSaveText(IText *tp, const char *newtext)
Function to reliably save new text in a IText.
Definition: indidevapi.c:36
void IUSaveConfigNumber(FILE *fp, const INumberVectorProperty *nvp)
Add a number vector property value to the configuration file.
Definition: indidevapi.c:15
void IUFillSwitch(ISwitch *sp, const char *name, const char *label, ISState s)
Assign attributes for a switch property. The switch's auxiliary elements will be set to NULL.
Definition: indidevapi.c:158
void IUFillText(IText *tp, const char *name, const char *label, const char *initialText)
Assign attributes for a text property. The text's auxiliary elements will be set to NULL.
Definition: indidevapi.c:198
void IUFillNumber(INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value)
Assign attributes for a number property. The number's auxiliary elements will be set to NULL.
Definition: indidevapi.c:180
void IUFillSwitchVector(ISwitchVectorProperty *svp, ISwitch *sp, int nsp, const char *dev, const char *name, const char *label, const char *group, IPerm p, ISRule r, double timeout, IPState s)
Assign attributes for a switch vector property. The vector's auxiliary elements will be set to NULL.
Definition: indidevapi.c:235
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
Definition: indidriver.c:1308
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
Definition: indidriver.c:1211
void IDSetSwitch(const ISwitchVectorProperty *svp, const char *fmt,...)
Definition: indidriver.c:1231
void IDMessage(const char *dev, const char *fmt,...)
Definition: indidriver.c:960
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
Definition: indidriver.c:1191
#define LOG_DEBUG(txt)
Definition: indilogger.h:75
#define LOG_WARN(txt)
Definition: indilogger.h:73
#define LOGF_DEBUG(fmt,...)
Definition: indilogger.h:83
#define LOG_ERROR(txt)
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must...
Definition: indilogger.h:72
#define LOG_INFO(txt)
Definition: indilogger.h:74
#define LIBRARY_TAB
int setAlignmentMode(int fd, unsigned int alignMode)
int setMinElevationLimit(int fd, int min)
int setMaxSlewRate(int fd, int slewRate)
int setMaxElevationLimit(int fd, int max)
int setObjectRA(int fd, double ra, bool addSpace)
int selectSubCatalog(int fd, int catalog, int subCatalog)
int setObjectDEC(int fd, double dec, bool addSpace)
int selectCatalogObject(int fd, int catalog, int NNNN)
#define getObjectDEC(fd, x)
Definition: lx200driver.h:120
@ LX200_ALIGN_LAND
Definition: lx200driver.h:36
#define getObjectInfo(fd, x)
Definition: lx200driver.h:128
#define getLX200DEC(fd, x)
Definition: lx200driver.h:118
@ LX200_DEEPSKY_C
Definition: lx200driver.h:84
@ LX200_STAR_C
Definition: lx200driver.h:83
#define getLX200RA(fd, x)
Definition: lx200driver.h:117
@ LX200_MESSIER_C
Definition: lx200driver.h:102
#define getObjectRA(fd, x)
Definition: lx200driver.h:119
@ LX200_STAR
Definition: lx200driver.h:89
void EquatorialToHorizontal(IEquatorialCoordinates *object, IGeographicCoordinates *observer, double JD, IHorizontalCoordinates *position)
EquatorialToHorizontal Calculate horizontal coordinates from equatorial coordinates.
Definition: libastro.cpp:140
void HorizontalToEquatorial(IHorizontalCoordinates *object, IGeographicCoordinates *observer, double JD, IEquatorialCoordinates *position)
HorizontalToEquatorial Calculate Equatorial EOD Coordinates from horizontal coordinates.
Definition: libastro.cpp:156
One number descriptor.
char name[MAXINDINAME]
Definition: indiapi.h:323
char name[MAXINDINAME]
Definition: indiapi.h:371
char name[MAXINDINAME]
Definition: indiapi.h:250