11#include "clientmanager.h"
12#include "driverinfo.h"
13#include "deviceinfo.h"
14#include "imageviewer.h"
15#include "indi_debug.h"
17#include "kstarsdata.h"
22#include "indicamera.h"
23#include "indiguider.h"
24#include "indifocuser.h"
25#include "indifilterwheel.h"
28#include "indiweather.h"
29#include "indiadaptiveoptics.h"
30#include "indidustcap.h"
31#include "indilightbox.h"
32#include "indidetector.h"
33#include "indirotator.h"
34#include "indispectrograph.h"
35#include "indicorrelator.h"
36#include "indiauxiliary.h"
38#include "genericdeviceadaptor.h"
40#include <QImageReader>
52uint8_t GenericDevice::m_ID = 1;
60 m_DriverInfo =
idv.getDriverInfo();
61 m_BaseDevice =
idv.getBaseDevice();
67 m_Name = m_BaseDevice.getDeviceName();
69 setObjectName(m_Name);
71 m_DriverInterface = m_BaseDevice.getDriverInterface();
72 m_DriverVersion = m_BaseDevice.getDriverVersion();
79 if (Options::useTimeUpdate() && Options::useKStarsSource())
83 auto tvp = m_BaseDevice.getText(
"TIME_UTC");
90 m_ReadyTimer =
new QTimer(
this);
91 m_ReadyTimer->setInterval(250);
92 m_ReadyTimer->setSingleShot(
true);
95 m_TimeUpdateTimer =
new QTimer(
this);
96 m_TimeUpdateTimer->setInterval(5000);
97 m_TimeUpdateTimer->setSingleShot(
true);
100 m_LocationUpdateTimer =
new QTimer(
this);
101 m_LocationUpdateTimer->setInterval(5000);
102 m_LocationUpdateTimer->setSingleShot(
true);
107GenericDevice::~GenericDevice()
109 for (
auto &metadata : streamFileMetadata)
110 metadata.file->
close();
113void GenericDevice::handleTimeout()
126void GenericDevice::checkTimeUpdate()
139void GenericDevice::checkLocationUpdate()
151void GenericDevice::registerDBusType()
154 static bool isRegistered =
false;
156 if (isRegistered ==
false)
165const QString &GenericDevice::getDeviceName()
const
170void GenericDevice::registerProperty(INDI::Property
prop)
172 if (!
prop.getRegistered())
175 m_ReadyTimer->start();
180 if (name ==
"CONNECTION")
188 auto conSP =
svp->findWidgetByName(
"CONNECT");
207 else if (name ==
"DRIVER_INFO")
212 auto tp =
tvp->findWidgetByName(
"DRIVER_INTERFACE");
215 m_DriverInterface =
static_cast<uint32_t
>(
atoi(tp->getText()));
216 emit interfaceDefined();
219 tp =
tvp->findWidgetByName(
"DRIVER_VERSION");
222 m_DriverVersion =
QString(tp->getText());
226 else if (name ==
"SYSTEM_PORTS")
231 auto port = m_BaseDevice.getText(
"DEVICE_PORT");
234 for (
const auto &
it : *
svp)
236 if (
it.isNameMatch(port.at(0)->getText()))
238 emit systemPortDetected();
244 else if (name ==
"TIME_UTC" && Options::useTimeUpdate())
246 const auto &
tvp =
prop.getText();
250 if (Options::useKStarsSource() &&
tvp->getPermission() !=
IP_RO)
253 m_TimeUpdateTimer->start();
256 else if (name ==
"GEOGRAPHIC_COORD" && Options::useGeographicUpdate())
258 if (Options::useKStarsSource() &&
prop.getPermission() !=
IP_RO)
261 m_LocationUpdateTimer->start();
263 else if (name ==
"WATCHDOG_HEARTBEAT")
265 if (watchDogTimer ==
nullptr)
267 watchDogTimer =
new QTimer(
this);
271 if (m_Connected &&
prop.getNumber()->at(0)->getValue() > 0)
274 m_ClientManager->sendNewProperty(
prop);
281void GenericDevice::updateProperty(INDI::Property
prop)
283 switch (
prop.getType())
305void GenericDevice::removeProperty(INDI::Property
prop)
310void GenericDevice::processSwitch(INDI::Property
prop)
312 if (
prop.isNameMatch(
"CONNECTION"))
328 if (watchDogTimer !=
nullptr)
330 auto nvp = m_BaseDevice.getNumber(
"WATCHDOG_HEARTBEAT");
331 if (
nvp &&
nvp.at(0)->getValue() > 0)
334 m_ClientManager->sendNewProperty(
nvp);
338 m_ReadyTimer->start();
342 disconnect(m_ReadyTimer, &
QTimer::timeout,
this, &GenericDevice::handleTimeout);
354void GenericDevice::processNumber(INDI::Property
prop)
356 QString deviceName = getDeviceName();
359 if (
prop.isNameMatch(
"GEOGRAPHIC_COORD") &&
prop.getState() ==
IPS_OK &&
360 ( (Options::useMountSource() && (getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE)) ||
361 (Options::useGPSSource() && (getDriverInterface() & INDI::BaseDevice::GPS_INTERFACE))))
367 auto np =
nvp->findWidgetByName(
"LONG");
375 lng.
setD(np->value - 360.0);
377 np =
nvp->findWidgetByName(
"LAT");
386 qCWarning(
KSTARS_INDI) <<
"Ignoring invalid device coordinates.";
390 np =
nvp->findWidgetByName(
"ELEV");
395 std::unique_ptr<GeoLocation>
tempGeo;
398 if (getDriverInterface() & INDI::BaseDevice::GPS_INTERFACE)
405 double TZ0 =
geo->TZ0();
416 qCInfo(
KSTARS_INDI) <<
"Setting location from device:" << deviceName <<
"Longitude:" << lng.
toDMSString() <<
"Latitude:" <<
421 else if (
nvp->isNameMatch(
"WATCHDOG_HEARTBEAT"))
423 if (watchDogTimer ==
nullptr)
425 watchDogTimer =
new QTimer(
this);
429 auto value =
nvp->at(0)->getValue();
430 if (m_Connected && value > 0)
434 double nextMS =
qMax(100.0, (value - 5) * 1000);
435 watchDogTimer->start(
nextMS);
438 watchDogTimer->stop();
444void GenericDevice::processText(INDI::Property
prop)
448 if (
tvp->isNameMatch(
"DRIVER_INFO"))
450 auto tp =
tvp->findWidgetByName(
"DRIVER_INTERFACE");
453 m_DriverInterface =
static_cast<uint32_t
>(
atoi(tp->getText()));
454 emit interfaceDefined();
458 if (m_ConcreteDevices.isEmpty() ==
false)
461 if (generateDevices())
466 tp =
tvp->findWidgetByName(
"DRIVER_VERSION");
469 m_DriverVersion =
QString(tp->text);
474 else if (
tvp->isNameMatch(
"TIME_UTC") &&
tvp->s ==
IPS_OK &&
475 ( (Options::useMountSource() && (getDriverInterface() & INDI::BaseDevice::TELESCOPE_INTERFACE)) ||
476 (Options::useGPSSource() && (getDriverInterface() & INDI::BaseDevice::GPS_INTERFACE))))
478 int d,
m, y, min,
sec, hour;
483 auto tp =
tvp->findWidgetByName(
"UTC");
487 qCWarning(
KSTARS_INDI) <<
"UTC property missing from TIME_UTC";
491 sscanf(tp->getText(),
"%d%*[^0-9]%d%*[^0-9]%dT%d%*[^0-9]%d%*[^0-9]%d", &y, &
m, &d, &hour, &min, &
sec);
497 tp =
tvp->findWidgetByName(
"OFFSET");
501 qCWarning(
KSTARS_INDI) <<
"Offset property missing from TIME_UTC";
524void GenericDevice::processLight(INDI::Property
prop)
529void GenericDevice::processMessage(
int messageID)
531 emit messageUpdated(messageID);
534bool GenericDevice::processBLOB(INDI::Property
prop)
541 auto bp =
bvp->at(0);
550 INDIDataTypes dataType;
552 if (!
strcmp(bp->getFormat(),
".ascii"))
553 dataType = DATA_ASCII;
555 dataType = DATA_OTHER;
557 QString currentDir = Options::fitsDir();
561 currentDir.
truncate(
sizeof(currentDir) - 1);
563 QString filename(currentDir +
'/');
570 if (dataType == DATA_ASCII)
574 auto it = std::find_if(streamFileMetadata.begin(), streamFileMetadata.end(), [
bvp, bp](
const StreamFileMetadata & data)
576 return (bvp->getDeviceName() == data.device && bvp->getName() == data.property && bp->getName() == data.element);
582 if (
it == streamFileMetadata.end())
584 StreamFileMetadata metadata;
585 metadata.device =
bvp->getDeviceName();
586 metadata.property =
bvp->getName();
587 metadata.element = bp->getName();
594 streamFileMetadata.append(metadata);
602 for (
nr = 0;
nr < bp->getSize();
nr += n)
603 n =
out.writeRawData(
static_cast<char *
>(bp->getBlob()) +
nr, bp->getSize() -
nr);
605 out.writeRawData((
const char *)
"\n", 1);
620 for (
nr = 0;
nr < bp->getSize();
nr += n)
621 n =
out.writeRawData(
static_cast<char *
>(bp->getBlob()) +
nr, bp->getSize() -
nr);
637 if (dataType == DATA_OTHER)
644bool GenericDevice::setConfig(INDIConfig
tConfig)
646 auto svp = m_BaseDevice.getSwitch(
"CONFIG_PROCESS");
655 case LOAD_LAST_CONFIG:
663 case LOAD_DEFAULT_CONFIG:
681 m_ClientManager->sendNewProperty(
svp);
686void GenericDevice::createDeviceInit()
688 if (Options::showINDIMessages())
697void GenericDevice::updateTime()
711 auto timeUTC = m_BaseDevice.getText(
"TIME_UTC");
725 qCInfo(
KSTARS_INDI) <<
"Updating" << getDeviceName() <<
"Time UTC:" <<
isoTS <<
"Offset:" << offset;
726 m_ClientManager->sendNewProperty(
timeUTC);
734void GenericDevice::updateLocation()
739 if (
geo->lng()->Degrees() >= 0)
744 auto nvp = m_BaseDevice.getNumber(
"GEOGRAPHIC_COORD");
749 auto np =
nvp.findWidgetByName(
"LONG");
756 np =
nvp.findWidgetByName(
"LAT");
760 np->setValue(
geo->lat()->Degrees());
762 np =
nvp.findWidgetByName(
"ELEV");
766 np->setValue(
geo->elevation());
768 qCInfo(
KSTARS_INDI) <<
"Updating" << getDeviceName() <<
"Location Longitude:" <<
longNP <<
"Latitude:" <<
geo->lat()->Degrees() <<
"Elevation:" <<
geo->elevation();
770 m_ClientManager->sendNewProperty(
nvp);
773void GenericDevice::Connect()
775 m_ClientManager->connectDevice(m_Name.toLatin1().constData());
778void GenericDevice::Disconnect()
780 m_ClientManager->disconnectDevice(m_Name.toLatin1().constData());
789 auto prop = m_BaseDevice.getProperty(
indiCommand->indiProperty.toLatin1().constData());
803 auto sp =
svp->findWidgetByName(
indiCommand->indiElement.toLatin1().constData());
814 m_ClientManager->sendNewProperty(
svp);
826 auto np =
nvp->findWidgetByName(
indiCommand->indiElement.toLatin1().constData());
831 double value =
indiCommand->elementValue.toDouble();
833 if (value == np->getValue())
839 m_ClientManager->sendNewProperty(
nvp);
853 auto nvp = m_BaseDevice.getNumber(propName.
toLatin1());
865 *step = np->getStep();
870IPState GenericDevice::getState(
const QString &propName)
875IPerm GenericDevice::getPermission(
const QString &propName)
880INDI::Property GenericDevice::getProperty(
const QString &propName)
909 m_ClientManager->sendNewProperty(
svp);
931 m_ClientManager->sendNewProperty(
nvp);
946 m_ClientManager->sendNewProperty(
tvp);
967 if (propName ==
oneProp.getName())
1022void GenericDevice::resetWatchdog()
1024 auto nvp = m_BaseDevice.getNumber(
"WATCHDOG_HEARTBEAT");
1028 m_ClientManager->sendNewProperty(
nvp);
1033 if (m_ConcreteDevices.contains(interface))
1035 device = m_ConcreteDevices[interface];
1043 if (m_ConcreteDevices.contains(INDI::BaseDevice::TELESCOPE_INTERFACE))
1044 return dynamic_cast<ISD::Mount*
>(m_ConcreteDevices[INDI::BaseDevice::TELESCOPE_INTERFACE].get());
1050 if (m_ConcreteDevices.contains(INDI::BaseDevice::CCD_INTERFACE))
1051 return dynamic_cast<ISD::Camera*
>(m_ConcreteDevices[INDI::BaseDevice::CCD_INTERFACE].get());
1055ISD::Guider *GenericDevice::getGuider()
1057 if (m_ConcreteDevices.contains(INDI::BaseDevice::GUIDER_INTERFACE))
1058 return dynamic_cast<ISD::Guider*
>(m_ConcreteDevices[INDI::BaseDevice::GUIDER_INTERFACE].get());
1064 if (m_ConcreteDevices.contains(INDI::BaseDevice::FOCUSER_INTERFACE))
1065 return dynamic_cast<ISD::Focuser*
>(m_ConcreteDevices[INDI::BaseDevice::FOCUSER_INTERFACE].get());
1069ISD::FilterWheel *GenericDevice::getFilterWheel()
1071 if (m_ConcreteDevices.contains(INDI::BaseDevice::FILTER_INTERFACE))
1072 return dynamic_cast<ISD::FilterWheel*
>(m_ConcreteDevices[INDI::BaseDevice::FILTER_INTERFACE].get());
1078 if (m_ConcreteDevices.contains(INDI::BaseDevice::DOME_INTERFACE))
1079 return dynamic_cast<ISD::Dome*
>(m_ConcreteDevices[INDI::BaseDevice::DOME_INTERFACE].get());
1083ISD::GPS *GenericDevice::getGPS()
1085 if (m_ConcreteDevices.contains(INDI::BaseDevice::GPS_INTERFACE))
1086 return dynamic_cast<ISD::GPS*
>(m_ConcreteDevices[INDI::BaseDevice::GPS_INTERFACE].get());
1092 if (m_ConcreteDevices.contains(INDI::BaseDevice::WEATHER_INTERFACE))
1093 return dynamic_cast<ISD::Weather*
>(m_ConcreteDevices[INDI::BaseDevice::WEATHER_INTERFACE].get());
1099 if (m_ConcreteDevices.contains(INDI::BaseDevice::AO_INTERFACE))
1100 return dynamic_cast<ISD::AdaptiveOptics*
>(m_ConcreteDevices[INDI::BaseDevice::AO_INTERFACE].get());
1106 if (m_ConcreteDevices.contains(INDI::BaseDevice::DUSTCAP_INTERFACE))
1107 return dynamic_cast<ISD::DustCap*
>(m_ConcreteDevices[INDI::BaseDevice::DUSTCAP_INTERFACE].get());
1113 if (m_ConcreteDevices.contains(INDI::BaseDevice::LIGHTBOX_INTERFACE))
1114 return dynamic_cast<ISD::LightBox*
>(m_ConcreteDevices[INDI::BaseDevice::LIGHTBOX_INTERFACE].get());
1120 if (m_ConcreteDevices.contains(INDI::BaseDevice::DETECTOR_INTERFACE))
1121 return dynamic_cast<ISD::Detector*
>(m_ConcreteDevices[INDI::BaseDevice::DETECTOR_INTERFACE].get());
1127 if (m_ConcreteDevices.contains(INDI::BaseDevice::ROTATOR_INTERFACE))
1128 return dynamic_cast<ISD::Rotator*
>(m_ConcreteDevices[INDI::BaseDevice::ROTATOR_INTERFACE].get());
1134 if (m_ConcreteDevices.contains(INDI::BaseDevice::SPECTROGRAPH_INTERFACE))
1135 return dynamic_cast<ISD::Spectrograph*
>(m_ConcreteDevices[INDI::BaseDevice::SPECTROGRAPH_INTERFACE].get());
1141 if (m_ConcreteDevices.contains(INDI::BaseDevice::CORRELATOR_INTERFACE))
1142 return dynamic_cast<ISD::Correlator*
>(m_ConcreteDevices[INDI::BaseDevice::CORRELATOR_INTERFACE].get());
1148 if (m_ConcreteDevices.contains(INDI::BaseDevice::AUX_INTERFACE))
1149 return dynamic_cast<ISD::Auxiliary*
>(m_ConcreteDevices[INDI::BaseDevice::AUX_INTERFACE].get());
1153bool GenericDevice::generateDevices()
1157 if (m_DriverInterface & INDI::BaseDevice::TELESCOPE_INTERFACE &&
1158 m_ConcreteDevices[INDI::BaseDevice::TELESCOPE_INTERFACE].isNull())
1161 mount->setObjectName(
"Mount:" + objectName());
1163 m_ConcreteDevices[INDI::BaseDevice::TELESCOPE_INTERFACE].reset(mount);
1164 mount->registeProperties();
1167 mount->processProperties();
1168 emit newMount(mount);
1172 connect(mount, &ISD::ConcreteDevice::ready,
this, [
this, mount]()
1174 emit newMount(mount);
1180 if (m_DriverInterface & INDI::BaseDevice::CCD_INTERFACE &&
1181 m_ConcreteDevices[INDI::BaseDevice::CCD_INTERFACE].isNull())
1184 camera->setObjectName(
"Camera:" + objectName());
1186 m_ConcreteDevices[INDI::BaseDevice::CCD_INTERFACE].reset(camera);
1187 camera->registeProperties();
1190 camera->processProperties();
1191 emit newCamera(camera);
1196 connect(camera, &ISD::ConcreteDevice::ready,
this, [
this, camera]()
1198 emit newCamera(camera);
1204 if (m_DriverInterface & INDI::BaseDevice::GUIDER_INTERFACE &&
1205 m_ConcreteDevices[INDI::BaseDevice::GUIDER_INTERFACE].isNull())
1207 auto guider =
new ISD::Guider(
this);
1208 guider->setObjectName(
"Guider:" + objectName());
1210 m_ConcreteDevices[INDI::BaseDevice::GUIDER_INTERFACE].reset(guider);
1211 guider->registeProperties();
1214 guider->processProperties();
1215 emit newGuider(guider);
1219 connect(guider, &ISD::ConcreteDevice::ready,
this, [
this, guider]()
1221 emit newGuider(guider);
1227 if (m_DriverInterface & INDI::BaseDevice::FOCUSER_INTERFACE &&
1228 m_ConcreteDevices[INDI::BaseDevice::FOCUSER_INTERFACE].isNull())
1231 focuser->setObjectName(
"Focuser:" + objectName());
1233 m_ConcreteDevices[INDI::BaseDevice::FOCUSER_INTERFACE].reset(focuser);
1234 focuser->registeProperties();
1237 focuser->processProperties();
1238 emit newFocuser(focuser);
1242 connect(focuser, &ISD::ConcreteDevice::ready,
this, [
this, focuser]()
1244 emit newFocuser(focuser);
1250 if (m_DriverInterface & INDI::BaseDevice::FILTER_INTERFACE &&
1251 m_ConcreteDevices[INDI::BaseDevice::FILTER_INTERFACE].isNull())
1253 auto filterWheel =
new ISD::FilterWheel(
this);
1254 filterWheel->setObjectName(
"FilterWheel:" + objectName());
1256 m_ConcreteDevices[INDI::BaseDevice::FILTER_INTERFACE].reset(filterWheel);
1257 filterWheel->registeProperties();
1260 filterWheel->processProperties();
1261 emit newFilterWheel(filterWheel);
1265 connect(filterWheel, &ISD::ConcreteDevice::ready,
this, [
this, filterWheel]()
1267 emit newFilterWheel(filterWheel);
1273 if (m_DriverInterface & INDI::BaseDevice::DOME_INTERFACE &&
1274 m_ConcreteDevices[INDI::BaseDevice::DOME_INTERFACE].isNull())
1277 dome->setObjectName(
"Dome:" + objectName());
1279 m_ConcreteDevices[INDI::BaseDevice::DOME_INTERFACE].reset(dome);
1280 dome->registeProperties();
1283 dome->processProperties();
1288 connect(dome, &ISD::ConcreteDevice::ready,
this, [
this, dome]()
1296 if (m_DriverInterface & INDI::BaseDevice::GPS_INTERFACE &&
1297 m_ConcreteDevices[INDI::BaseDevice::GPS_INTERFACE].isNull())
1299 auto gps =
new ISD::GPS(
this);
1300 gps->setObjectName(
"GPS:" + objectName());
1302 m_ConcreteDevices[INDI::BaseDevice::GPS_INTERFACE].reset(
gps);
1303 gps->registeProperties();
1306 gps->processProperties();
1311 connect(
gps, &ISD::ConcreteDevice::ready,
this, [
this,
gps]()
1319 if (m_DriverInterface & INDI::BaseDevice::WEATHER_INTERFACE &&
1320 m_ConcreteDevices[INDI::BaseDevice::WEATHER_INTERFACE].isNull())
1323 weather->setObjectName(
"Weather:" + objectName());
1325 m_ConcreteDevices[INDI::BaseDevice::WEATHER_INTERFACE].reset(weather);
1326 weather->registeProperties();
1329 weather->processProperties();
1330 emit newWeather(weather);
1334 connect(weather, &ISD::ConcreteDevice::ready,
this, [
this, weather]()
1336 emit newWeather(weather);
1342 if (m_DriverInterface & INDI::BaseDevice::AO_INTERFACE &&
1343 m_ConcreteDevices[INDI::BaseDevice::AO_INTERFACE].isNull())
1346 ao->setObjectName(
"AdaptiveOptics:" + objectName());
1348 m_ConcreteDevices[INDI::BaseDevice::AO_INTERFACE].reset(ao);
1349 ao->registeProperties();
1352 ao->processProperties();
1353 emit newAdaptiveOptics(ao);
1357 connect(ao, &ISD::ConcreteDevice::ready,
this, [
this, ao]()
1359 emit newAdaptiveOptics(ao);
1365 if (m_DriverInterface & INDI::BaseDevice::DUSTCAP_INTERFACE &&
1366 m_ConcreteDevices[INDI::BaseDevice::DUSTCAP_INTERFACE].isNull())
1369 dustCap->setObjectName(
"DustCap:" + objectName());
1371 m_ConcreteDevices[INDI::BaseDevice::DUSTCAP_INTERFACE].reset(dustCap);
1372 dustCap->registeProperties();
1375 dustCap->processProperties();
1376 emit newDustCap(dustCap);
1380 connect(dustCap, &ISD::ConcreteDevice::ready,
this, [
this, dustCap]()
1382 emit newDustCap(dustCap);
1388 if (m_DriverInterface & INDI::BaseDevice::LIGHTBOX_INTERFACE &&
1389 m_ConcreteDevices[INDI::BaseDevice::LIGHTBOX_INTERFACE].isNull())
1392 lightBox->setObjectName(
"LightBox:" + objectName());
1394 m_ConcreteDevices[INDI::BaseDevice::LIGHTBOX_INTERFACE].reset(lightBox);
1395 lightBox->registeProperties();
1398 lightBox->processProperties();
1399 emit newLightBox(lightBox);
1403 connect(lightBox, &ISD::ConcreteDevice::ready,
this, [
this, lightBox]()
1405 emit newLightBox(lightBox);
1411 if (m_DriverInterface & INDI::BaseDevice::ROTATOR_INTERFACE &&
1412 m_ConcreteDevices[INDI::BaseDevice::ROTATOR_INTERFACE].isNull())
1415 rotator->setObjectName(
"Rotator:" + objectName());
1417 m_ConcreteDevices[INDI::BaseDevice::ROTATOR_INTERFACE].reset(rotator);
1418 rotator->registeProperties();
1421 rotator->processProperties();
1422 emit newRotator(rotator);
1426 connect(rotator, &ISD::ConcreteDevice::ready,
this, [
this, rotator]()
1428 emit newRotator(rotator);
1434 if (m_DriverInterface & INDI::BaseDevice::DETECTOR_INTERFACE &&
1435 m_ConcreteDevices[INDI::BaseDevice::DETECTOR_INTERFACE].isNull())
1438 detector->setObjectName(
"Detector:" + objectName());
1440 m_ConcreteDevices[INDI::BaseDevice::DETECTOR_INTERFACE].reset(
detector);
1457 if (m_DriverInterface & INDI::BaseDevice::SPECTROGRAPH_INTERFACE &&
1458 m_ConcreteDevices[INDI::BaseDevice::SPECTROGRAPH_INTERFACE].isNull())
1461 spectrograph->setObjectName(
"Spectrograph:" + objectName());
1463 m_ConcreteDevices[INDI::BaseDevice::SPECTROGRAPH_INTERFACE].reset(
spectrograph);
1480 if (m_DriverInterface & INDI::BaseDevice::CORRELATOR_INTERFACE &&
1481 m_ConcreteDevices[INDI::BaseDevice::CORRELATOR_INTERFACE].isNull())
1484 correlator->setObjectName(
"Correlator:" + objectName());
1486 m_ConcreteDevices[INDI::BaseDevice::CORRELATOR_INTERFACE].reset(
correlator);
1503 if (m_DriverInterface & INDI::BaseDevice::AUX_INTERFACE &&
1504 m_ConcreteDevices[INDI::BaseDevice::AUX_INTERFACE].isNull())
1507 aux->setObjectName(
"Auxiliary:" + objectName());
1509 m_ConcreteDevices[INDI::BaseDevice::AUX_INTERFACE].reset(
aux);
1510 aux->registeProperties();
1513 aux->processProperties();
1518 connect(
aux, &ISD::ConcreteDevice::ready,
this, [
this,
aux]()
1528void GenericDevice::sendNewProperty(INDI::Property
prop)
1530 m_ClientManager->sendNewProperty(
prop);
1537 for (
int i = 0; i <
svp->count(); i++)
1559 for (
int i = 0; i <
nvp->count(); i++)
1586 for (
int i = 0; i <
tvp->count(); i++)
1591 oneText.insert(
"label",
tvp->at(i)->getLabel());
1596 propObject = {{
"device",
tvp->getDeviceName()}, {
"name",
tvp->getName()}, {
"state",
tvp->getState()}, {
"texts",
Texts}};
1609 for (
int i = 0; i <
lvp->count(); i++)
1619 propObject = {{
"device",
lvp->getDeviceName()}, {
"name",
lvp->getName()}, {
"state",
lvp->getState()}, {
"lights",
Lights}};
1629 switch (
prop.getType())
1664 dest =
static_cast<ISD::ParkStatus
>(a);
ClientManager manages connection to INDI server, creation of devices, and receiving/sending propertie...
DeviceInfo is simple class to hold DriverInfo and INDI::BaseDevice associated with a particular devic...
Contains all relevant information for specifying a location on Earth: City Name, State/Province name,...
AdaptiveOptics class handles control of INDI AdaptiveOptics devices.
Auxiliary class handles control of INDI Auxiliary devices.
Camera class controls an INDI Camera device.
Correlator class handles control of INDI Correlator devices.
Detector class handles control of INDI Detector devices.
Class handles control of INDI dome devices.
Handles operation of a remotely controlled dust cover cap.
Focuser class handles control of INDI focuser devices.
Handles operation of a remotely controlled light box.
device handle controlling Mounts.
Rotator class handles control of INDI Rotator devices.
Spectrograph class handles control of INDI Spectrograph devices.
Focuser class handles control of INDI Weather devices.
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
static KStars * Instance()
void timeChanged()
The time has changed (emitted by setUTC() )
This class provides the information needed to determine whether Daylight Savings Time (DST; a....
An angle, stored as degrees, but expressible in many ways.
const QString toDMSString(const bool forceSign=false, const bool machineReadable=false, const bool highPrecision=false) const
virtual void setD(const double &x)
Sets floating-point value of angle, in degrees.
const double & Degrees() const
QString i18n(const char *text, const TYPE &arg...)
char * toString(const EngineQuery &query)
ISD is a collection of INDI Standard Devices.
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
KDB_EXPORT void getProperties(const KDbLookupFieldSchema *lookup, QMap< QByteArray, QVariant > *values)
GeoCoordinates geo(const QVariant &location)
const QList< QKeySequence > & close()
QString name(StandardShortcut id)
QCA_EXPORT QVariant getProperty(const QString &name)
const char * constData() const const
QByteArray fromRawData(const char *data, qsizetype size)
QByteArray toBase64(Base64Options options) const const
QDateTime currentDateTime()
QString toString(QStringView format, QCalendar cal) const const
bool registerObject(const QString &path, QObject *object, RegisterOptions options)
QDBusConnection sessionBus()
QString arg(Args &&... args) const const
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
QString & setNum(double n, char format, int precision)
qsizetype size() const const
QByteArray toLatin1() const const
QString toLower() const const
QByteArray toUtf8() const const
QString trimmed() const const
void truncate(qsizetype position)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void setScheme(const QString &scheme)