Index: sources/gui/qml/components/InformationSubTable.qml =================================================================== diff -u -r21e68ccf5594b0ca3e0a8c7986e405260d273899 -rc3bf2cd135f9351e16eb0f4237f71a7be38a4ce4 --- sources/gui/qml/components/InformationSubTable.qml (.../InformationSubTable.qml) (revision 21e68ccf5594b0ca3e0a8c7986e405260d273899) +++ sources/gui/qml/components/InformationSubTable.qml (.../InformationSubTable.qml) (revision c3bf2cd135f9351e16eb0f4237f71a7be38a4ce4) @@ -26,6 +26,9 @@ property var leftColumnValues : [] property var rightColumnKeys : [] property var rightColumnValues : [] + property var leftColumnWidth : _root.width / 2 + property var rightColumnWidth : _root.width / 2 + property var valueLeftMargin : 3*Variables.informationTableMargin objectName: "InformationSubTable" color: Colors.transparent @@ -34,12 +37,13 @@ top: parent.top topMargin: Variables.sliderTextMargin } - width: _root.width / 2 + width: leftColumnWidth Repeater { id: _leftColumnRepeater model: leftColumnKeys InformationTableEntry { key : leftColumnKeys[index] value : leftColumnValues[index] + valueLeftMargin: _root.valueLeftMargin } } } @@ -50,12 +54,13 @@ topMargin : Variables.sliderTextMargin left : _leftColumn.right } - width: _root.width / 2 + width: rightColumnWidth Repeater { id: _operating_repeater model: rightColumnKeys InformationTableEntry { key : rightColumnKeys[index] value: rightColumnValues[index] + valueLeftMargin: _root.valueLeftMargin } } } Index: sources/gui/qml/components/InformationTableEntry.qml =================================================================== diff -u -r21e68ccf5594b0ca3e0a8c7986e405260d273899 -rc3bf2cd135f9351e16eb0f4237f71a7be38a4ce4 --- sources/gui/qml/components/InformationTableEntry.qml (.../InformationTableEntry.qml) (revision 21e68ccf5594b0ca3e0a8c7986e405260d273899) +++ sources/gui/qml/components/InformationTableEntry.qml (.../InformationTableEntry.qml) (revision c3bf2cd135f9351e16eb0f4237f71a7be38a4ce4) @@ -32,6 +32,7 @@ property var value: "Value" height: Variables.informationSubTableHeight width: Variables.informationSubTableWidth + property var valueLeftMargin : 3*Variables.informationTableMargin color: "transparent" Line { @@ -59,9 +60,12 @@ objectName: value + index color: Colors.textMain text: value + clip: true + elide: Text.ElideRight + width: Variables.informationTableWidth / 5 anchors.left: _line.horizontalCenter anchors.verticalCenter: _root.verticalCenter - anchors.leftMargin: 3*Variables.informationTableMargin + anchors.leftMargin: _root.valueLeftMargin font.pixelSize: Fonts.fontInformationTablePixel } } Index: sources/gui/qml/pages/SettingsDeviceInformation.qml =================================================================== diff -u -r21e68ccf5594b0ca3e0a8c7986e405260d273899 -rc3bf2cd135f9351e16eb0f4237f71a7be38a4ce4 --- sources/gui/qml/pages/SettingsDeviceInformation.qml (.../SettingsDeviceInformation.qml) (revision 21e68ccf5594b0ca3e0a8c7986e405260d273899) +++ sources/gui/qml/pages/SettingsDeviceInformation.qml (.../SettingsDeviceInformation.qml) (revision c3bf2cd135f9351e16eb0f4237f71a7be38a4ce4) @@ -59,6 +59,7 @@ height: 500 width: Variables.informationTableWidth headerVisible: false + subTable.valueLeftMargin: Variables.informationTableMargin onVisibleChanged: { if (visible) { subTable.leftColumnKeys = vDeviceInformation.doGetVersionKeys() 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 )); +} Index: sources/view/VDeviceInformation.h =================================================================== diff -u -r21e68ccf5594b0ca3e0a8c7986e405260d273899 -rc3bf2cd135f9351e16eb0f4237f71a7be38a4ce4 --- sources/view/VDeviceInformation.h (.../VDeviceInformation.h) (revision 21e68ccf5594b0ca3e0a8c7986e405260d273899) +++ sources/view/VDeviceInformation.h (.../VDeviceInformation.h) (revision c3bf2cd135f9351e16eb0f4237f71a7be38a4ce4) @@ -10,6 +10,7 @@ #include "VView.h" #include "main.h" #include "GuiController.h" +#include "MTreatmentAdjustHDVersionsResponse.h" // forward declarations class tst_views; @@ -29,6 +30,8 @@ friend class ::tst_views; VIEW_DEC_CLASS(VDeviceInformation) +VIEW_DEC_SLOT(AdjustHDVersionsResponseData) +VIEW_DEC_SLOT(AdjustDGVersionsResponseData) protected: PROPERTY(QString, mUIVersion, "") @@ -46,12 +49,21 @@ PROPERTY(quint32, mTreatments, 0) PROPERTY(quint32, mDialysateLiters, 0) +private: + void init(); public slots: QStringList doGetVersionKeys(); QStringList doGetVersionValues(); QStringList doGetSystemUsageKeys(); QStringList doGetSystemUsageValues(); + void doRequestHDDGVersions() { + AdjustVersionsRequestData data; + emit didAdjustment(data); + } +signals: + void didAdjustment(const AdjustVersionsRequestData &vData); + }; }