Index: sources/view/VDeviceInformation.cpp =================================================================== diff -u -r21e68ccf5594b0ca3e0a8c7986e405260d273899 -rc3bf2cd135f9351e16eb0f4237f71a7be38a4ce4 --- sources/view/VDeviceInformation.cpp (.../VDeviceInformation.cpp) (revision 21e68ccf5594b0ca3e0a8c7986e405260d273899) +++ sources/view/VDeviceInformation.cpp (.../VDeviceInformation.cpp) (revision c3bf2cd135f9351e16eb0f4237f71a7be38a4ce4) @@ -1,23 +1,40 @@ #include "VDeviceInformation.h" // Qt - +#include // Project #include "Logger.h" using namespace View; using namespace Gui; -//using namespace Storage; +using namespace Storage; VIEW_DEF_CLASS(VDeviceInformation) /*! * \brief VDeviceInformation::initConnections * Makes the necessary connections. Called inside VIEW_DEF_CLASS */ -void VDeviceInformation::initConnections() {} +void VDeviceInformation::initConnections() +{ + ACTION_VIEW_CONNECTION(AdjustHDVersionsResponseData); + ACTION_VIEW_CONNECTION(AdjustDGVersionsResponseData); + ADJUST_VIEW_CONNECTION(AdjustVersionsRequestData); + init(); +} + /*! + * \brief VDeviceInformation::setup + * Request information needed to populate the device information page + */ +void VDeviceInformation::init() +{ + doRequestHDDGVersions(); + mUIVersion(qApp->applicationVersion()); +} + +/*! * \brief VDeviceInformation::doGetVersionKeys * Gets the version key names * \return (QStringList) the version key names @@ -80,3 +97,44 @@ << QString("%1").arg(mTreatments()) << QString("%1 L").arg(mDialysateLiters()); } + +/*! + * \brief VDeviceInformation::onActionReceive + * Called when the HD version response is received + * \param vData - (AdjustHDVersionsResponseData) the version response + */ +void VDeviceInformation::onActionReceive(const AdjustHDVersionsResponseData &vData) +{ + + mHDVersion(QString("v%1.%2.%3-%4") + .arg(vData.mMajor ) + .arg(vData.mMinor ) + .arg(vData.mMicro ) + .arg(vData.mBuild )); + + mHDFPGAVersion(QString("%1 v%2.%3 %4") + .arg(vData.mFPGAId ) + .arg(vData.mFPGAMajor) + .arg(vData.mFPGAMinor) + .arg(vData.mFPGALab )); +} + +/*! + * \brief VDeviceInformation::onActionReceive + * When the DG Version response is received + * \param vData - (AdjustDGVersionsResponseData) the version response + */ +void VDeviceInformation::onActionReceive(const AdjustDGVersionsResponseData &vData) +{ + mDGVersion(QString("v%1.%2.%3-%4") + .arg(vData.mMajor ) + .arg(vData.mMinor ) + .arg(vData.mMicro ) + .arg(vData.mBuild )); + + mDGFPGAVersion(QString("%1 v%2.%3 %4") + .arg(vData.mFPGAId ) + .arg(vData.mFPGAMajor) + .arg(vData.mFPGAMinor) + .arg(vData.mFPGALab )); +}