Index: sources/storage/RxProfilesController.cpp =================================================================== diff -u -rb862e0cc8bfe322da4aa10ba5e56f9a386e6a00f -rb532926372ae9d55831088c7c2ff3d4c95fc552a --- sources/storage/RxProfilesController.cpp (.../RxProfilesController.cpp) (revision b862e0cc8bfe322da4aa10ba5e56f9a386e6a00f) +++ sources/storage/RxProfilesController.cpp (.../RxProfilesController.cpp) (revision b532926372ae9d55831088c7c2ff3d4c95fc552a) @@ -36,7 +36,7 @@ //#define ADDTOLOG( vINDEX ) index = vINDEX; logContent += title(index) + _sep + value(index) + _sep + unit(index) + "\n"; #define ADDTOLOG_MT(vINDEX, vVALUE, vTITLES ) \ logContent += vTITLES[vINDEX] + _equal + \ - "\"" + ( vVALUE[vINDEX] ) + "\"\n"; + "\"" + ( vVALUE[vINDEX].toString() ) + "\"\n"; /*! * \brief RxProfiles::RxProfiles @@ -71,11 +71,6 @@ emit didFilesList(rxProfilesPath(), { QString("*.%1").arg(_rxProfiles) }); } -//void RxProfiles::doValidateRxProfiles() -//{ -// emit didFilesList(rxProfilesPath(), { QString("*.%1").arg(_rxProfiles) }); -//} - QString RxProfiles::rxProfilesPath() { if(_rxProfilesPath.trimmed().isEmpty()){ @@ -116,21 +111,21 @@ * \brief RxProfiles::doSave * The save slot to be exposed to the UI to be able to request for save */ -void RxProfiles::doSave(const QStringList &RxModel) +void RxProfiles::doSave() { if (_saveWatcher.isRunning()) return; isIdle(false); - saveLogConcurrent(RxModel); + saveLogConcurrent(); } /*! * \brief RxProfiles::saveLogConcurrent * The treatment log save which is using a thread pool to run the save process. */ -void RxProfiles::saveLogConcurrent(const QStringList &RxModel) +void RxProfiles::saveLogConcurrent() { LOG_DEBUG("Save Treatment Log Started"); - QFuture mFuture = QtConcurrent::run(this, &RxProfiles::saveLog, RxModel); + QFuture mFuture = QtConcurrent::run(this, &RxProfiles::saveLog); _saveWatcher.setFuture(mFuture); } @@ -139,38 +134,39 @@ * The actual treatment log save function which does the save into the Prescription log * \return true on successful save and false otherwise. */ -bool RxProfiles::saveLog(const QStringList &RxModel) +bool RxProfiles::saveLog() { - bool ok = RxModel.size() >= Model::RxProfilesIndex::eRxProfilesIndexCount - 1; - if (!ok) return false; + bool ok ; +// if (!ok) return false; QString logContent ; QString fileName = QString("%1%2.%3").arg(_rxProfilesPath, - RxModel[Model::RxProfilesIndex::eRxContentIndexCount], + vRxProfileHash[Model::RxProfilesIndex::eProfileName].toString(), _rxProfiles); fileName.replace(" ", _underscore); - ADDTOLOG_MT( Model::RxProfilesIndex::eBloodFlowRate , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eDialysateFlowRate , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eTreatmentDuration , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eAcidConcentrateType , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eBicarbonateConcentrateType , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eDialysateTemperature , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eDialyzerType , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eHeparinConcentration , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eHeparinBolusVolume , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eHeparinDispenseRate , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eHeparinStop , RxModel , Model::MRxProfilesData::titles() ); - ADDTOLOG_MT( Model::RxProfilesIndex::eVitalSigns , RxModel , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eBloodFlowRate , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eDialysateFlowRate , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eTreatmentDuration , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eAcidConcentrateType , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eBicarbonateConcentrateType , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eDialysateTemperature , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eDialyzerType , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eHeparinConcentration , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eHeparinBolusVolume , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eHeparinDispenseRate , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eHeparinStop , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eSalineVolume , vRxProfileHash , Model::MRxProfilesData::titles() ); + ADDTOLOG_MT( Model::RxProfilesIndex::eVitalSigns , vRxProfileHash , Model::MRxProfilesData::titles() ); // qDebug() << "WRITING FILE: " <