Instrument Neutral Distributed Interface INDI 2.2.5
lx200classic.cpp
Go to the documentation of this file.
1/*
2 LX200 Classoc
3 Copyright (C) 2003 Jasem Mutlaq ([email protected])
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
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,
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,
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,
99
102
103 return true;
104}
105
107{
109
110 if (isConnected())
111 {
112 defineProperty(&ElevationLimitNP);
113 defineProperty(&ObjectInfoTP);
114 defineProperty(&SolarSP);
115 defineProperty(&StarCatalogSP);
116 defineProperty(&DeepSkyCatalogSP);
117 defineProperty(&ObjectNoNP);
118 defineProperty(&MaxSlewRateNP);
119 defineProperty(&UnparkAlignmentSP);
120
121 if (InitPark())
122 {
123 // If loading parking data is successful, we just set the default parking values.
124 // Default values are poinitng to North or South Pole in AltAz coordinates.
125 SetAxis1ParkDefault(LocationNP[LOCATION_LATITUDE].getValue() >= 0 ? 0 : 180);
127 }
128 else
129 {
130 // Otherwise, we set all parking data to default in case no parking data is found.
131 SetAxis1Park(LocationNP[LOCATION_LATITUDE].getValue() >= 0 ? 0 : 180);
133
134 SetAxis1ParkDefault(LocationNP[LOCATION_LATITUDE].getValue() >= 0 ? 0 : 180);
136 }
137
138 return true;
139 }
140 else
141 {
142 deleteProperty(ElevationLimitNP.name);
143 deleteProperty(ObjectInfoTP.name);
144 deleteProperty(SolarSP.name);
145 deleteProperty(StarCatalogSP.name);
146 deleteProperty(DeepSkyCatalogSP.name);
147 deleteProperty(ObjectNoNP.name);
148 deleteProperty(MaxSlewRateNP.name);
149 deleteProperty(UnparkAlignmentSP.name);
150
151 return true;
152 }
153}
154
155bool LX200Classic::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
156{
157 if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
158 {
159 if (!strcmp(name, ObjectNoNP.name))
160 {
161 char object_name[256] = {0};
162
163 if (selectCatalogObject(PortFD, currentCatalog, (int)values[0]) < 0)
164 {
165 ObjectNoNP.s = IPS_ALERT;
166 IDSetNumber(&ObjectNoNP, "Failed to select catalog object.");
167 return false;
168 }
169
172
173 ObjectNoNP.s = IPS_OK;
174 IDSetNumber(&ObjectNoNP, "Object updated.");
175
176 if (getObjectInfo(PortFD, object_name) < 0)
177 IDMessage(getDeviceName(), "Getting object info failed.");
178 else
179 {
180 IUSaveText(&ObjectInfoTP.tp[0], object_name);
181 IDSetText(&ObjectInfoTP, nullptr);
182 }
183
185 return true;
186 }
187
188 if (!strcmp(name, MaxSlewRateNP.name))
189 {
190 if (setMaxSlewRate(PortFD, (int)values[0]) < 0)
191 {
192 MaxSlewRateNP.s = IPS_ALERT;
193 IDSetNumber(&MaxSlewRateNP, "Error setting maximum slew rate.");
194 return false;
195 }
196
197 MaxSlewRateNP.s = IPS_OK;
198 MaxSlewRateNP.np[0].value = values[0];
199 IDSetNumber(&MaxSlewRateNP, nullptr);
200 return true;
201 }
202
203 if (!strcmp(name, ElevationLimitNP.name))
204 {
205 // new elevation limits
206 double minAlt = 0, maxAlt = 0;
207 int i, nset;
208
209 for (nset = i = 0; i < n; i++)
210 {
211 INumber *altp = IUFindNumber(&ElevationLimitNP, names[i]);
212 if (altp == &ElevationLimitN[0])
213 {
214 minAlt = values[i];
215 nset += minAlt >= -90.0 && minAlt <= 90.0;
216 }
217 else if (altp == &ElevationLimitN[1])
218 {
219 maxAlt = values[i];
220 nset += maxAlt >= -90.0 && maxAlt <= 90.0;
221 }
222 }
223 if (nset == 2)
224 {
225 if (setMinElevationLimit(PortFD, (int)minAlt) < 0)
226 {
227 ElevationLimitNP.s = IPS_ALERT;
228 IDSetNumber(&ElevationLimitNP, "Error setting elevation limit.");
229 return false;
230 }
231
232 setMaxElevationLimit(PortFD, (int)maxAlt);
233 ElevationLimitNP.np[0].value = minAlt;
234 ElevationLimitNP.np[1].value = maxAlt;
235 ElevationLimitNP.s = IPS_OK;
236 IDSetNumber(&ElevationLimitNP, nullptr);
237 return true;
238 }
239 else
240 {
241 ElevationLimitNP.s = IPS_IDLE;
242 IDSetNumber(&ElevationLimitNP, "elevation limit missing or invalid.");
243 return false;
244 }
245 }
246 }
247
248 return LX200Generic::ISNewNumber(dev, name, values, names, n);
249}
250
251bool LX200Classic::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
252{
253 int index = 0;
254
255 if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
256 {
257 // Star Catalog
258 if (!strcmp(name, StarCatalogSP.name))
259 {
260 IUResetSwitch(&StarCatalogSP);
261 IUUpdateSwitch(&StarCatalogSP, states, names, n);
262 index = IUFindOnSwitchIndex(&StarCatalogSP);
263
264 currentCatalog = LX200_STAR_C;
265
266 if (selectSubCatalog(PortFD, currentCatalog, index))
267 {
268 currentSubCatalog = index;
269 StarCatalogSP.s = IPS_OK;
270 IDSetSwitch(&StarCatalogSP, nullptr);
271 return true;
272 }
273 else
274 {
275 StarCatalogSP.s = IPS_IDLE;
276 IDSetSwitch(&StarCatalogSP, "Catalog unavailable.");
277 return false;
278 }
279 }
280
281 // Deep sky catalog
282 if (!strcmp(name, DeepSkyCatalogSP.name))
283 {
284 IUResetSwitch(&DeepSkyCatalogSP);
285 IUUpdateSwitch(&DeepSkyCatalogSP, states, names, n);
286 index = IUFindOnSwitchIndex(&DeepSkyCatalogSP);
287
288 if (index == LX200_MESSIER_C)
289 {
290 currentCatalog = index;
291 DeepSkyCatalogSP.s = IPS_OK;
292 IDSetSwitch(&DeepSkyCatalogSP, nullptr);
293 }
294 else
295 currentCatalog = LX200_DEEPSKY_C;
296
297 if (selectSubCatalog(PortFD, currentCatalog, index))
298 {
299 currentSubCatalog = index;
300 DeepSkyCatalogSP.s = IPS_OK;
301 IDSetSwitch(&DeepSkyCatalogSP, nullptr);
302 }
303 else
304 {
305 DeepSkyCatalogSP.s = IPS_IDLE;
306 IDSetSwitch(&DeepSkyCatalogSP, "Catalog unavailable");
307 return false;
308 }
309
310 return true;
311 }
312
313 // Solar system
314 if (!strcmp(name, SolarSP.name))
315 {
316 if (IUUpdateSwitch(&SolarSP, states, names, n) < 0)
317 return false;
318
319 index = IUFindOnSwitchIndex(&SolarSP);
320
321 // We ignore the first option : "Select item"
322 if (index == 0)
323 {
324 SolarSP.s = IPS_IDLE;
325 IDSetSwitch(&SolarSP, nullptr);
326 return true;
327 }
328
331
332 ObjectNoNP.s = IPS_OK;
333 SolarSP.s = IPS_OK;
334
335 getObjectInfo(PortFD, ObjectInfoTP.tp[0].text);
336 IDSetNumber(&ObjectNoNP, "Object updated.");
337 IDSetSwitch(&SolarSP, nullptr);
338
339 if (currentCatalog == LX200_STAR_C || currentCatalog == LX200_DEEPSKY_C)
340 selectSubCatalog(PortFD, currentCatalog, currentSubCatalog);
341
344
346
347 return true;
348 }
349
350 // Unpark Alignment Mode
351 if (!strcmp(name, UnparkAlignmentSP.name))
352 {
353 IUUpdateSwitch(&UnparkAlignmentSP, states, names, n);
354 UnparkAlignmentSP.s = IPS_OK;
355 IDSetSwitch(&UnparkAlignmentSP, nullptr);
356
357 return true;
358 }
359
360 }
361
362 return LX200Generic::ISNewSwitch(dev, name, states, names, n);
363}
364
366{
368
369 IUSaveConfigNumber(fp, &MaxSlewRateNP);
370 IUSaveConfigNumber(fp, &ElevationLimitNP);
371
372 IUSaveConfigSwitch(fp, &UnparkAlignmentSP);
373
374 return true;
375}
376
377//Parking
379{
380 double parkAz = GetAxis1Park();
381 double parkAlt = GetAxis2Park();
382
383 char AzStr[16], AltStr[16];
384 fs_sexa(AzStr, parkAz, 2, 3600);
385 fs_sexa(AltStr, parkAlt, 2, 3600);
386 LOGF_DEBUG("Parking to Az (%s) Alt (%s)...", AzStr, AltStr);
387
388 INDI::IEquatorialCoordinates equatorialCoords {0, 0};
389 INDI::IHorizontalCoordinates horizontalCoords {parkAz, parkAlt};
390 INDI::HorizontalToEquatorial(&horizontalCoords, &m_Location, ln_get_julian_from_sys(), &equatorialCoords);
391
392 //save the current AlignmentMode to UnparkAlignment
394 int curAlignment = IUFindOnSwitchIndex(&AlignmentSP);
395 IUResetSwitch(&UnparkAlignmentSP);
396 UnparkAlignmentS[curAlignment].s = ISS_ON;
397 UnparkAlignmentSP.s = IPS_OK;
398 IDSetSwitch(&UnparkAlignmentSP, nullptr);
399 saveConfig(true, UnparkAlignmentSP.name);
400
401 if (!Goto(equatorialCoords.rightascension, equatorialCoords.declination))
402 {
404 LOG_ERROR("Parking Failed.");
405 ParkSP.apply();
406 return false;
407 }
408
411 LOG_INFO("Parking is in progress...");
412
413 return true;
414}
415
417{
418 if (isSimulation() == false)
419 {
420 // Parked in Land alignment. Restore previous mode.
421 if (setAlignmentMode(PortFD, IUFindOnSwitchIndex(&UnparkAlignmentSP)) < 0)
422 {
423 LOG_ERROR("UnParking Failed.");
425 IDSetSwitch(&AlignmentSP, "Error setting alignment mode.");
426 return false;
427 }
428 //Update the UI
430 }
431
432 // Then we sync with to our last stored position
433 double parkAz = GetAxis1Park();
434 double parkAlt = GetAxis2Park();
435
436 char AzStr[16], AltStr[16];
437 fs_sexa(AzStr, parkAz, 2, 3600);
438 fs_sexa(AltStr, parkAlt, 2, 3600);
439 LOGF_DEBUG("Syncing to parked coordinates Az (%s) Alt (%s)...", AzStr, AltStr);
440
441 double parkRA = 0.0;
442 double parkDEC = 0.0;
443 //azAltToRaDecNow(parkAz, parkAlt, parkRA, parkDEC);
444 INDI::IEquatorialCoordinates equatorialCoords {parkRA, parkDEC};
445 INDI::IHorizontalCoordinates horizontalCoords {parkAz, parkAlt};
446 INDI::HorizontalToEquatorial(&horizontalCoords, &m_Location, ln_get_julian_from_sys(), &equatorialCoords);
447
448 if (isSimulation())
449 {
450 currentRA = parkRA;
451 currentDEC = parkDEC;
452 }
453 else
454 {
455 if ((setObjectRA(PortFD, parkRA) < 0) || (setObjectDEC(PortFD, parkDEC) < 0))
456 {
457 LOG_ERROR("Error setting Unpark RA/Dec.");
458 return false;
459 }
460
461 char syncString[256];
462 if (::Sync(PortFD, syncString) < 0)
463 {
464 LOG_WARN("Unpark Sync failed.");
465 return false;
466 }
467 }
468
469 SetParked(false);
470 return true;
471}
472
474{
476 INDI::IHorizontalCoordinates horizontalCoords {0, 0};
477 INDI::EquatorialToHorizontal(&equatorialCoords, &m_Location, ln_get_julian_from_sys(), &horizontalCoords);
478
479 char AzStr[16], AltStr[16];
480 fs_sexa(AzStr, horizontalCoords.azimuth, 2, 3600);
481 fs_sexa(AltStr, horizontalCoords.altitude, 2, 3600);
482 LOGF_DEBUG("Setting current parking position to coordinates Az (%s) Alt (%s)...", AzStr, AltStr);
483
484 SetAxis1Park(horizontalCoords.azimuth);
485 SetAxis2Park(horizontalCoords.altitude);
486
487 return true;
488}
489
491{
492 // Az = 0 for North hemisphere
493 SetAxis1Park(LocationNP[LOCATION_LATITUDE].getValue() > 0 ? 0 : 180);
494
495 // Alt = Latitude
497
498 return true;
499}
500
502{
503 int curTrackState = TrackState;
504 static int settling = -1;
505
506 if (settling >= 0) settling--;
507
508 if ((TrackState == SCOPE_PARKED) && (settling == 0) && !isSimulation())
509 {
510 settling = -1;
512 {
513 LOG_ERROR("Parking Failed.");
515 IDSetSwitch(&AlignmentSP, "Error setting alignment mode.");
516 return false;
517 }
518 //Update the UI
520 LOG_DEBUG("Mount Land mode set. Parking completed.");
521 }
522
524 {
525 if ((TrackState == SCOPE_PARKED) && (curTrackState == SCOPE_PARKING) && !isSimulation())
526 {
527 //allow scope to make internal state change to settled on target.
528 //otherwise changing to landmode slews the scope to same
529 //coordinates interpreted in landmode.
530 //Between isSlewComplete() and the beep there is nearly 3 seconds!
531 settling = 3; //n iterations of default 1000ms
532 }
533 }
534
535 return true;
536}
537
bool isConnected() const
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
void setState(IPState state)
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
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....
IGeographicCoordinates m_Location
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.
INDI::PropertySwitch ParkSP
INDI::PropertyNumber EqNP
INDI::PropertySwitch MountTypeSP
INDI::PropertyNumber LocationNP
ISState
Switch state.
Definition indiapi.h:148
@ ISS_OFF
Definition indiapi.h:149
@ ISS_ON
Definition indiapi.h:150
@ IP_RW
Definition indiapi.h:184
@ IP_RO
Definition indiapi.h:182
@ IPS_BUSY
Definition indiapi.h:161
@ IPS_ALERT
Definition indiapi.h:162
@ IPS_IDLE
Definition indiapi.h:159
@ IPS_OK
Definition indiapi.h:160
@ ISR_1OFMANY
Definition indiapi.h:171
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:130
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:33
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:490
int IUFindOnSwitchIndex(const ISwitchVectorProperty *svp)
Returns the index of first ON switch it finds in the vector switch property.
Definition indidevapi.c:337
void IUResetSwitch(ISwitchVectorProperty *svp)
Reset all switches in a switch vector property to OFF.
Definition indidevapi.c:366
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:509
INumber * IUFindNumber(const INumberVectorProperty *nvp, const char *name)
Find an INumber member in a number text property.
Definition indidevapi.c:275
void IUSaveText(IText *tp, const char *newtext)
Function to reliably save new text in a IText.
Definition indidevapi.c:44
void IUSaveConfigNumber(FILE *fp, const INumberVectorProperty *nvp)
Add a number vector property value to the configuration file.
Definition indidevapi.c:23
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:376
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:416
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:398
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:453
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
void IDSetSwitch(const ISwitchVectorProperty *svp, const char *fmt,...)
void IDMessage(const char *dev, const char *fmt,...)
Definition indidriver.c:983
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
#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 getDeviceName
#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)
@ LX200_ALIGN_LAND
Definition lx200driver.h:36
#define getObjectInfo(fd, x)
#define getLX200DEC(fd, x)
@ LX200_DEEPSKY_C
Definition lx200driver.h:84
@ LX200_STAR_C
Definition lx200driver.h:83
#define getLX200RA(fd, x)
@ LX200_MESSIER_C
#define getObjectRA(fd, x)
@ 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:141
void HorizontalToEquatorial(IHorizontalCoordinates *object, IGeographicCoordinates *observer, double JD, IEquatorialCoordinates *position)
HorizontalToEquatorial Calculate Equatorial EOD Coordinates from horizontal coordinates.
Definition libastro.cpp:161
One number descriptor.
char name[MAXINDINAME]
Definition indiapi.h:321
double value
Definition indiapi.h:288
char name[MAXINDINAME]
Definition indiapi.h:369
char name[MAXINDINAME]
Definition indiapi.h:248
char * text
Definition indiapi.h:230