9#include "indiconcretedevice.h"
10#include "clientmanager.h"
15uint8_t ConcreteDevice::m_ID = 1;
17ConcreteDevice::ConcreteDevice(
ISD::GenericDevice *parent) : GDInterface(parent), m_Parent(parent),
18 m_Name(parent->getDeviceName())
21 connect(parent, &GenericDevice::Connected,
this, [
this]()
23 m_ReadyTimer.reset(
new QTimer(
this));
24 m_ReadyTimer->setInterval(250);
25 m_ReadyTimer->setSingleShot(
true);
29 connect(parent, &GenericDevice::Disconnected,
this, &ConcreteDevice::Disconnected);
32 connect(parent, &GenericDevice::propertyDefined,
this, &ConcreteDevice::propertyDefined);
33 connect(parent, &GenericDevice::propertyDeleted,
this, &ConcreteDevice::propertyDeleted);
34 connect(parent, &GenericDevice::propertyUpdated,
this, &ConcreteDevice::propertyUpdated);
37 connect(parent, &GenericDevice::propertyDefined,
this, [
this](INDI::Property value)
40 m_ReadyTimer->start();
41 registerProperty(value);
43 connect(parent, &GenericDevice::propertyDeleted,
this, &ConcreteDevice::removeProperty);
44 connect(parent, &GenericDevice::propertyUpdated,
this, &ConcreteDevice::updateProperty);
47void ConcreteDevice::registeProperties()
54void ConcreteDevice::updateProperty(INDI::Property
prop)
56 switch (
prop.getType())
77void ConcreteDevice::processProperties()
105INDI::PropertyView<INumber> *ConcreteDevice::getNumber(
const QString &name)
const
110INDI::PropertyView<IText> *ConcreteDevice::getText(
const QString &name)
const
115INDI::PropertyView<ISwitch> *ConcreteDevice::getSwitch(
const QString &name)
const
120INDI::PropertyView<ILight> *ConcreteDevice::getLight(
const QString &name)
const
125INDI::PropertyView<IBLOB> *ConcreteDevice::getBLOB(
const QString &name)
const
130void ConcreteDevice::sendNewProperty(INDI::Property
prop)
132 m_Parent->sendNewProperty(
prop);
135QString ConcreteDevice::getMessage(
int id)
const
140INDI::Property ConcreteDevice::getProperty(
const QString &name)
const
142 return m_Parent->getProperty(name);
147 return m_Parent->getDriverInfo();
150bool ConcreteDevice::setConfig(INDIConfig
tConfig)
152 return m_Parent->setConfig(
tConfig);
155Properties ConcreteDevice::getProperties()
const
157 return m_Parent->getProperties();
163 return m_Parent->getMinMaxStep(propName,
elementName, min, max, step);
166IPState ConcreteDevice::getState(
const QString &propName)
const
168 return m_Parent->getState(propName);
171IPerm ConcreteDevice::getPermission(
const QString &propName)
const
173 return m_Parent->getPermission(propName);
GenericDevice is the Generic Device for INDI devices.
ISD is a collection of INDI Standard Devices.
const char * constData() const const
QString fromStdString(const std::string &str)
QByteArray toLatin1() const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)