Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -raf9b5ee3e759ca45c4e55488f46601f30143edae -r0681b6cf3d718e1129388115de19f57dac5e32cf --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision af9b5ee3e759ca45c4e55488f46601f30143edae) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 0681b6cf3d718e1129388115de19f57dac5e32cf) @@ -138,7 +138,7 @@ /*! * \brief TreatmentLog::alarmTitle * \details prepares the alarm title and returns. - * \param vID - the alarm ID + * \param vID - the alarm ID * \return the alarm title */ QString TreatmentLog::alarmTitle(quint32 vID) { @@ -155,7 +155,7 @@ /*! * \brief TreatmentLog::eventTitle * \details prepares the event title and returns. - * \param vID - the event ID + * \param vID - the event ID * \return the event title */ QString TreatmentLog::eventTitle(quint32 vID) { @@ -169,8 +169,42 @@ return str.arg(vID, 3).arg(title); } +/*! + * \brief TreatmentLog::trendsAlarmTitle + * \details prepares the trends alarm title and returns. + * \param vID - the alarm ID + * \return the alarm title + */ +QString TreatmentLog::trendsAlarmTitle(quint32 vID) { + QString str = "%1-%2"; + QString title = "undefined"; + if ( _treatmentLogAlarmTitles.contains(vID) ) { + title = _treatmentLogAlarmTitles[vID] + .replace("," , "-") // the Txr is a csv file and any ',' in the title will break it. + .replace("\n" , "-"); // removing any new line since this will break the Txr as well. + } + return title; +} /*! + * \brief TreatmentLog::trendsEventTitle + * \details prepares the trends event title and returns. + * \param vID - the event ID + * \return the event title + */ +QString TreatmentLog::trendsEventTitle(quint32 vID) { + QString str = "%1 - %2"; + QString title = "undefined"; + if ( _treatmentLogEventTitles.contains(vID) ) { + title = _treatmentLogEventTitles[vID] + .replace("," , "-") // the Txr is a csv file and any ',' in the title will break it. + .replace("\n" , "-"); // removing any new line since this will break the Txr as well. + } + return title; +} + + +/*! * \brief TreatmentLog::timerEvent * \details The overloaded method of the main class to capture the QObject timer. */