10#include "servermanager.h"
12#include <basedevice.h>
16DriverInfo::DriverInfo(
const QString &inName)
21 m_Manufacturer =
"Others";
22 hostname =
"localhost";
29 name = driver->getName();
30 label = driver->getLabel();
31 uniqueLabel = driver->getUniqueLabel();
32 exec = driver->getExecutable();
33 version = driver->getVersion();
34 m_Manufacturer = driver->manufacturer();
35 userPort = driver->getUserPort();
36 skelFile = driver->getSkeletonFile();
37 port = driver->getPort();
38 hostname = driver->getHost();
39 remotePort = driver->getRemotePort();
40 remoteHostname = driver->getRemoteHost();
41 type = driver->getType();
42 serverState = driver->getServerState();
43 clientState = driver->getClientState();
44 driverSource = driver->getDriverSource();
45 serverManager = driver->getServerManager();
46 clientManager = driver->getClientManager();
47 auxInfo = driver->getAuxInfo();
48 devices = driver->getDevices();
57 clone->resetDevices();
62DriverInfo::~DriverInfo()
67void DriverInfo::reset()
71 serverManager =
nullptr;
72 clientManager =
nullptr;
75QString DriverInfo::getServerBuffer()
const
77 if (serverManager !=
nullptr)
78 return serverManager->getLogBuffer();
83void DriverInfo::setServerState(
bool inState)
85 if (inState == serverState)
88 serverState = inState;
90 if (serverState ==
false)
91 serverManager =
nullptr;
93 emit deviceStateChanged();
96void DriverInfo::setClientState(
bool inState)
98 if (inState == clientState)
101 clientState = inState;
103 if (clientState ==
false)
104 clientManager =
nullptr;
106 emit deviceStateChanged();
124 if (idv->getDeviceName() == deviceName)
130QVariantMap DriverInfo::getAuxInfo()
const
135void DriverInfo::setAuxInfo(
const QVariantMap &value)
142 auxInfo[key] = value;
145QString DriverInfo::manufacturer()
const
147 return m_Manufacturer;
150void DriverInfo::setManufacturer(
const QString &Manufacturer)
155void DriverInfo::setUniqueLabel(
const QString &inUniqueLabel)
158 if (auxInfo.value(
"mdpd",
false).toBool() ==
true || driverSource >= HOST_SOURCE)
161 uniqueLabel = inUniqueLabel;
166 return m_StartupRule;
169void DriverInfo::setStartupRule(
const QJsonObject &value)
171 m_StartupRule = value;
DeviceInfo is simple class to hold DriverInfo and INDI::BaseDevice associated with a particular devic...
DriverInfo holds all metadata associated with a particular INDI driver.
void append(QList< T > &&value)
bool removeOne(const AT &t)