Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -rc4bd7072571428744e11dd24d5da1d1a3e1d1686 -r51a16e937898f4aec639e9dc5ff33bd0d67bf4ab --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision c4bd7072571428744e11dd24d5da1d1a3e1d1686) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 51a16e937898f4aec639e9dc5ff33bd0d67bf4ab) @@ -197,6 +197,7 @@ */ bool TreatmentLog::saveLog() { + _lastTxInfo.clear(); bool ok = (unsigned)_values.count() >= eTreatmentLogIndexCount; if (!ok) return false; @@ -288,23 +289,26 @@ } ADDALINE(""); - QString mDateTime = _values[eTreatmentStartDateTime]; - mDateTime.replace("/", "" ); // remove date separator - mDateTime.replace(":", "" ); // remove time separator - mDateTime.replace(" ", "_"); // replace spaces + _lastTxInfo.mDateTime = _values[eTreatmentStartDateTime]; + _lastTxInfo.mDateTime.replace("/", "" ); // remove date separator + _lastTxInfo.mDateTime.replace(":", "" ); // remove time separator + _lastTxInfo.mDateTime.replace(" ", "_"); // replace spaces - QString mDeviceID = _values[eDeviceID]; - QString mFileName = QString("%1_%2.log") - .arg(mDateTime) - .arg(mDeviceID); + _lastTxInfo.mDeviceID = _values[eDeviceID]; + _lastTxInfo.mPatientID = _values[ePatientID]; + _lastTxInfo.mFileName = QString("%1%2_%3.log") + .arg(_treatmentLogPath) + .arg(_lastTxInfo.mDateTime) + .arg(_lastTxInfo.mDeviceID); ok = Storage::FileHandler::makeFolder(_treatmentLogPath); if ( ! ok ) { LOG_DEBUG(QString("Cannot create folder %1").arg(_treatmentLogPath)); return ok; } - ok = Storage::FileHandler::write(mFileName.prepend(_treatmentLogPath), logContent, false); - if ( ! ok ) { LOG_DEBUG(QString("Cannot write to file %1").arg(mFileName )); return ok; } + ok = Storage::FileHandler::write(_lastTxInfo.mFileName, logContent, false); + if ( ! ok ) { LOG_DEBUG(QString("Cannot write to file %1").arg(_lastTxInfo.mFileName)); return ok; } _treatmentLogAvrgeData.clear(); _treatmentLogAlarmData.clear(); _treatmentLogEventData.clear(); + _lastTxInfo.mStatus = ok; return ok; } @@ -316,6 +320,10 @@ { LOG_DEBUG(QString("Save Treatment Log Ended: %1").arg(_saveWatcher.result())); isIdle(true); + if ( _lastTxInfo.mStatus ) + emit didTreatmentLogSave( _lastTxInfo.mDeviceID , + _lastTxInfo.mPatientID , + _lastTxInfo.mFileName ); } // ----- Export