mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-03-15 19:41:24 +00:00
Add some Manager Methods that were missing.
This commit is contained in:
parent
bf27e02bd7
commit
dbe644e29a
5 changed files with 278 additions and 4 deletions
|
@ -120,6 +120,26 @@ public:
|
|||
|
||||
QString getCommandClassString(quint8 const _cc);
|
||||
|
||||
QString getVersionAsString();
|
||||
QString getVersionLongAsString();
|
||||
quint8 getControllerNodeId();
|
||||
quint8 getSucNodeId();
|
||||
bool isPrimaryController();
|
||||
bool isStaticUpdateController();
|
||||
bool isBridgeController();
|
||||
bool hasExtendedTXStatus();
|
||||
QString getLibraryVersion();
|
||||
QString getLibraryTypeName();
|
||||
quint32 getSendQueueCount();
|
||||
QString getControllerPath();
|
||||
|
||||
qint32 getPollInterval();
|
||||
|
||||
void setPollInterval(qint32 interval, bool intervalBetweenPolls);
|
||||
|
||||
void syncroniseNodeNeighbors(quint8 node);
|
||||
|
||||
|
||||
/* Property Methods */
|
||||
QDir OZWDatabasePath() { return this->m_ozwdatabasepath; }
|
||||
QDir OZWUserPath() { return this->m_ozwuserpath; }
|
||||
|
|
|
@ -133,4 +133,23 @@ class QTOZWManager {
|
|||
SLOT(bool downloadLatestConfigFileRevision(quint8 const _node))
|
||||
SLOT(bool downloadLatestMFSRevision())
|
||||
SLOT(QString getCommandClassString(quint8 const _cc))
|
||||
|
||||
SLOT(QString getVersionAsString())
|
||||
SLOT(QString getVersionLongAsString())
|
||||
SLOT(quint8 getControllerNodeId())
|
||||
SLOT(quint8 getSucNodeId())
|
||||
SLOT(bool isPrimaryController())
|
||||
SLOT(bool isStaticUpdateController())
|
||||
SLOT(bool isBridgeController())
|
||||
SLOT(bool hasExtendedTXStatus())
|
||||
SLOT(QString getLibraryVersion())
|
||||
SLOT(QString getLibraryTypeName())
|
||||
SLOT(quint32 getSendQueueCount())
|
||||
SLOT(QString getControllerPath())
|
||||
|
||||
SLOT(qint32 getPollInterval())
|
||||
SLOT(void setPollInterval(qint32 interval, bool intervalBetweenPolls))
|
||||
|
||||
SLOT(void syncroniseNodeNeighbors(quint8 node))
|
||||
|
||||
}
|
|
@ -115,6 +115,23 @@ public Q_SLOTS:
|
|||
|
||||
QString getCommandClassString(quint8 const _cc);
|
||||
|
||||
QString getVersionAsString();
|
||||
QString getVersionLongAsString();
|
||||
quint8 getControllerNodeId();
|
||||
quint8 getSucNodeId();
|
||||
bool isPrimaryController();
|
||||
bool isStaticUpdateController();
|
||||
bool isBridgeController();
|
||||
bool hasExtendedTXStatus();
|
||||
QString getLibraryVersion();
|
||||
QString getLibraryTypeName();
|
||||
quint32 getSendQueueCount();
|
||||
QString getControllerPath();
|
||||
|
||||
qint32 getPollInterval();
|
||||
|
||||
void setPollInterval(qint32 interval, bool intervalBetweenPolls);
|
||||
void syncroniseNodeNeighbors(quint8 node);
|
||||
|
||||
/* these slots are called from our OZWNotification Class. Applications should not call them */
|
||||
void pvt_valueAdded(quint64 vidKey);
|
||||
|
|
|
@ -404,8 +404,51 @@ bool QTOZWManager::downloadLatestMFSRevision() {
|
|||
QString QTOZWManager::getCommandClassString(quint8 const _cc) {
|
||||
CALL_DPTR_RTN(getCommandClassString(_cc), QString);
|
||||
}
|
||||
|
||||
|
||||
QString QTOZWManager::getVersionAsString() {
|
||||
CALL_DPTR_RTN(getVersionAsString(), QString);
|
||||
}
|
||||
QString QTOZWManager::getVersionLongAsString() {
|
||||
CALL_DPTR_RTN(getVersionLongAsString(), QString);
|
||||
}
|
||||
quint8 QTOZWManager::getControllerNodeId() {
|
||||
CALL_DPTR_RTN(getControllerNodeId(), quint8);
|
||||
}
|
||||
quint8 QTOZWManager::getSucNodeId() {
|
||||
CALL_DPTR_RTN(getSucNodeId(), quint8);
|
||||
}
|
||||
bool QTOZWManager::isPrimaryController() {
|
||||
CALL_DPTR_RTN(isPrimaryController(), bool);
|
||||
}
|
||||
bool QTOZWManager::isStaticUpdateController() {
|
||||
CALL_DPTR_RTN(isStaticUpdateController(), bool);
|
||||
}
|
||||
bool QTOZWManager::isBridgeController() {
|
||||
CALL_DPTR_RTN(isBridgeController(), bool);
|
||||
}
|
||||
bool QTOZWManager::hasExtendedTXStatus() {
|
||||
CALL_DPTR_RTN(hasExtendedTXStatus(), bool);
|
||||
}
|
||||
QString QTOZWManager::getLibraryVersion() {
|
||||
CALL_DPTR_RTN(getLibraryVersion(), QString);
|
||||
}
|
||||
QString QTOZWManager::getLibraryTypeName() {
|
||||
CALL_DPTR_RTN(getLibraryTypeName(), QString);
|
||||
}
|
||||
quint32 QTOZWManager::getSendQueueCount() {
|
||||
CALL_DPTR_RTN(getSendQueueCount(), quint32);
|
||||
}
|
||||
QString QTOZWManager::getControllerPath() {
|
||||
CALL_DPTR_RTN(getControllerPath(), QString);
|
||||
}
|
||||
qint32 QTOZWManager::getPollInterval() {
|
||||
CALL_DPTR_RTN(getPollInterval(), qint32);
|
||||
}
|
||||
void QTOZWManager::setPollInterval(qint32 interval, bool intervalBetweenPolls) {
|
||||
CALL_DPTR(setPollInterval(interval, intervalBetweenPolls))
|
||||
}
|
||||
void QTOZWManager::syncroniseNodeNeighbors(quint8 node) {
|
||||
CALL_DPTR(syncroniseNodeNeighbors(node));
|
||||
}
|
||||
|
||||
void QTOZWManager::setOZWDatabasePath(QDir path) {
|
||||
if (path.exists())
|
||||
|
|
|
@ -653,8 +653,6 @@ bool QTOZWManager_Internal::downloadLatestMFSRevision() {
|
|||
}
|
||||
|
||||
QString QTOZWManager_Internal::getCommandClassString(quint8 const _cc) {
|
||||
if (!this->checkHomeId())
|
||||
return QString();
|
||||
try {
|
||||
return this->m_manager->GetCommandClassName(_cc).c_str();
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
|
@ -664,6 +662,169 @@ QString QTOZWManager_Internal::getCommandClassString(quint8 const _cc) {
|
|||
return QString();
|
||||
}
|
||||
|
||||
QString QTOZWManager_Internal::getVersionAsString() {
|
||||
try {
|
||||
return this->m_manager->getVersionAsString().c_str();
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
QString QTOZWManager_Internal::getVersionLongAsString() {
|
||||
try {
|
||||
return this->m_manager->getVersionLongAsString().c_str();
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
quint8 QTOZWManager_Internal::getControllerNodeId() {
|
||||
if (!this->checkHomeId())
|
||||
return 0;
|
||||
try {
|
||||
return this->m_manager->GetControllerNodeId(this->homeId());
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
quint8 QTOZWManager_Internal::getSucNodeId() {
|
||||
if (!this->checkHomeId())
|
||||
return 0;
|
||||
try {
|
||||
return this->m_manager->GetSUCNodeId(this->homeId());
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
bool QTOZWManager_Internal::isPrimaryController() {
|
||||
if (!this->checkHomeId())
|
||||
return false;
|
||||
try {
|
||||
return this->m_manager->IsPrimaryController(this->homeId());
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool QTOZWManager_Internal::isStaticUpdateController() {
|
||||
if (!this->checkHomeId())
|
||||
return false;
|
||||
try {
|
||||
return this->m_manager->IsStaticUpdateController(this->homeId());
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool QTOZWManager_Internal::isBridgeController() {
|
||||
if (!this->checkHomeId())
|
||||
return false;
|
||||
try {
|
||||
return this->m_manager->IsBridgeController(this->homeId());
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool QTOZWManager_Internal::hasExtendedTXStatus() {
|
||||
if (!this->checkHomeId())
|
||||
return false;
|
||||
try {
|
||||
return this->m_manager->HasExtendedTxStatus(this->homeId());
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
QString QTOZWManager_Internal::getLibraryVersion() {
|
||||
if (!this->checkHomeId())
|
||||
return QString();
|
||||
try {
|
||||
return this->m_manager->GetLibraryVersion(this->homeId()).c_str();
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
QString QTOZWManager_Internal::getLibraryTypeName() {
|
||||
if (!this->checkHomeId())
|
||||
return QString();
|
||||
try {
|
||||
return this->m_manager->GetLibraryTypeName(this->homeId()).c_str();
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
quint32 QTOZWManager_Internal::getSendQueueCount() {
|
||||
if (!this->checkHomeId())
|
||||
return 0;
|
||||
try {
|
||||
return this->m_manager->GetSendQueueCount(this->homeId());
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
QString QTOZWManager_Internal::getControllerPath() {
|
||||
if (!this->checkHomeId())
|
||||
return QString();
|
||||
try {
|
||||
return this->m_manager->GetControllerPath(this->homeId()).c_str();
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
qint32 QTOZWManager_Internal::getPollInterval() {
|
||||
try {
|
||||
return this->m_manager->GetPollInterval();
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
void QTOZWManager_Internal::setPollInterval(qint32 interval, bool intervalBetweenPolls) {
|
||||
if (!this->checkHomeId())
|
||||
return;
|
||||
try {
|
||||
this->m_manager->SetPollInterval(interval, intervalBetweenPolls);
|
||||
return;
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return;
|
||||
}
|
||||
void QTOZWManager_Internal::syncroniseNodeNeighbors(quint8 node) {
|
||||
if (!this->checkHomeId())
|
||||
return;
|
||||
if (!this->checkNodeId(node))
|
||||
return;
|
||||
try {
|
||||
this->m_manager->SyncronizeNodeNeighbors(this->homeId(), node);
|
||||
return;
|
||||
} catch (OpenZWave::OZWException &e) {
|
||||
emit this->error(QTOZWManagerErrorCodes::OZWException);
|
||||
this->setErrorString(e.GetMsg().c_str());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QTOZW_Nodes *QTOZWManager_Internal::getNodeModel() {
|
||||
|
@ -866,7 +1027,21 @@ void QTOZWManager_Internal::pvt_valueAdded(quint64 vidKey)
|
|||
this->m_validValues.push_back(vidKey);
|
||||
|
||||
this->m_valueModel->addValue(vidKey);
|
||||
#if 0
|
||||
/* XXX TODO: Need to check/implement these functions on ValueModel */
|
||||
bool enablePoll(quint64 vidKey, uint8 intensity);
|
||||
bool disablePoll(quint64 vidKey);
|
||||
bool isPolled(quint64 vidKey);
|
||||
bool setPollIntensity(quint64 vidKey, quint8 intensity);
|
||||
quint8 getPollIntensity(quint64 vidKey);
|
||||
|
||||
QString getInstanceLabel(quint64 vidKey);
|
||||
QString getInstanceLabel(quint8 node, quint8 cc, quint8 instance);
|
||||
|
||||
bool refreshValue(quint64 vidKey);
|
||||
bool setChangedVerified(quint64 vidKey);
|
||||
bool getChangedVerified(quint64 vidKey);
|
||||
#endif
|
||||
try {
|
||||
OpenZWave::ValueID vid(this->homeId(), vidKey);
|
||||
this->m_valueModel->setValueData(vidKey, QTOZW_ValueIds::ValueIdColumns::Label, this->m_manager->GetValueLabel(vid).c_str(), true);
|
||||
|
|
Loading…
Add table
Reference in a new issue