Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -rcde103b58b55aa638697152111d3fa5325afd2e7 -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision cde103b58b55aa638697152111d3fa5325afd2e7) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -142,15 +142,15 @@ * \param vShowID - flag indicting whether to include the alarm ID in the returned title or not * \return the alarm title */ -QString TreatmentLog::alarmTitle(quint32 vID, const bool vShowID) { +QString TreatmentLog::alarmTitle(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 vShowID ? str.arg(vID, 3).arg(title) : title; + return str.arg(vID, 3).arg(title); } /*! @@ -160,19 +160,53 @@ * \param vShowID - flag indicting whether to include the alarm ID in the returned title or not * \return the event title */ -QString TreatmentLog::eventTitle(quint32 vID, const bool vShowID) { +QString TreatmentLog::eventTitle(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 vShowID ? str.arg(vID, 3).arg(title) : title; + 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. */