Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -r7e503c5459ec77a2816d6c7789da9b206cedbe8a --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) @@ -22,6 +22,7 @@ #include "FileHandler.h" #include "Logger.h" #include "MSettings.h" +#include "CloudSyncController.h" #include "GuiGlobals.h" #include "MAlarmStatusData.h" @@ -43,6 +44,7 @@ logPath(Logger::eLogTrtmt, _Logger.logPath(Logger::eLogTrtmt)); } + /*! \brief Connection Initializer \details All the class signal/slot connections are defined here. */ @@ -55,6 +57,10 @@ connect(&_saveWatcher , SIGNAL(finished()), this , SLOT(onSave ())); + + connect(&_CloudSyncController , SIGNAL(didTxCodeReceive(const QString &)), + this , SLOT( onTxCodeReceive(const QString &))); + } /*! @@ -70,8 +76,8 @@ // SRSUI910 : PRS178 : Clinical - Data - Order - QString mTreatmentDurationFmt = QTime (0, 0).addSecs(vData.mTreatmentDuration ).toString(_timeFormat); - QString mActualTreatmentDurationFmt = QTime (0, 0).addSecs(vData.mActualTreatmentDuration ).toString(_timeFormat); + QString mTreatmentDurationFmt = QTime (0, 0).addSecs(int(vData.mTreatmentDuration )).toString(_timeFormat); + QString mActualTreatmentDurationFmt = QTime (0, 0).addSecs(int(vData.mActualTreatmentDuration )).toString(_timeFormat); QString mTreatmentDuration = QString::number(vData.mTreatmentDuration / 60 ); // Converted seconds to minutes. QString mActualTreatmentDuration = QString::number(vData.mActualTreatmentDuration / 60 ); // Converted seconds to minutes. QString mTreatmentStartDateTime = Format::fromEpoch( vData.mTreatmentStartEpoch , _datetimeFormat); @@ -94,7 +100,6 @@ _deviceID = mStrText.arg(vData.mDeviceID ); _values[ePatientID ] = vPatientID.trimmed() ; -// _values[eDeviceID ] = mStrText.arg(vData.mDeviceID ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. _values[eBloodFlowRate ] = mStrText.arg(vData.mBloodFlowRate ); _values[eDialysateFlowRate ] = mStrText.arg(vData.mDialysateFlowRate ); _values[eTreatmentDuration ] = mTreatmentDuration ; @@ -124,11 +129,8 @@ _values[eTargetUFRate ] = mStrText.arg(vData.mTargetUFRate ,FLOAT3 ); _values[eActualUFRate ] = mStrText.arg(vData.mActualUFRate ,FLOAT3 ); _values[eSalineBolusVolume ] = mStrText.arg(vData.mSalineBolusVolume ); -// _values[eAverageBloodFlow ] = mStrText.arg(vData.mAverageBloodFlow ,FLOAT3 ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. -// _values[eAverageDialysateFlow ] = mStrText.arg(vData.mAverageDialysateFlow ,FLOAT3 ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. -// _values[eAverageDialysateTemp ] = mStrText.arg(vData.mAverageDialysateTemp ,FLOAT3 ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. -// _values[eAverageArterialPressure ] = mStrText.arg(vData.mAverageArterialPressure ,FLOAT3 ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. -// _values[eAverageVenousPressure ] = mStrText.arg(vData.mAverageVenousPressure ,FLOAT3 ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. + + emit didTxCodeReceive("..."); /* put ... just to notify user about the wait for data */ } /*! @@ -217,7 +219,6 @@ ADDTITLE("Title"); ADDTOLOG( ePatientID ); -// ADDTOLOG( eDeviceID ); PRS 180: will be used only for the name not in the content. ADDTITLE("Treatment Parameters" ); ADDTOLOG( eTreatmentDuration ); @@ -255,11 +256,6 @@ ADDTITLE("Extra" ); ADDTOLOG( eWaterSampleTestResult ); -// ADDTOLOG( eAverageBloodFlow ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. -// ADDTOLOG( eAverageDialysateFlow ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. -// ADDTOLOG( eAverageArterialPressure ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. -// ADDTOLOG( eAverageVenousPressure ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. -// ADDTOLOG( eAverageDialysateTemp ); // removed during our meeting with Sean and Jahnavi 04/11/2022@16:00. ADDTITLE("Treatment Data" ); for ( const TreatmentLogAvrgeData &item : _treatmentLogAvrgeData ) { @@ -360,9 +356,9 @@ } /*! - * \brief TreatmentLog::exportLog - * The actual treatment log export function which does the export of the treatment log into the USB drive. - * \return + * \brief TreatmentLog::exportLog + * \details The actual treatment log export function which does the export of the treatment log into the USB drive. + * \return true on successful export. */ bool TreatmentLog::exportLog() { @@ -382,3 +378,15 @@ LOG_DEBUG(QString("Export Treatment Log Ended: %1").arg(_exportWatcher.result())); isIdle(true); } + +/*! + * \brief TreatmentLog::onTxCodeReceive + * \details this slot will update the treatment code sent by CS. + * \param vTxCode - The treatment code sent by CS. + * \note there should not be a getter for this, for thread safety, and who needs the data needs to connect to the signal. + */ +void TreatmentLog::onTxCodeReceive(const QString &vTxCode) +{ + _txCode = vTxCode; + emit didTxCodeReceive(_txCode); +}