Index: cppcheck.err =================================================================== diff -u -re5bfc98faab0d165beb1d6f1eda32cceb06dbe20 -ra7d80f7c90cf8c8b2ed123e79403183152d74f5a --- cppcheck.err (.../cppcheck.err) (revision e5bfc98faab0d165beb1d6f1eda32cceb06dbe20) +++ cppcheck.err (.../cppcheck.err) (revision a7d80f7c90cf8c8b2ed123e79403183152d74f5a) @@ -1,4 +1,4 @@ -02/08/2023 20:54 +02/09/2023 15:33 Behrouz NematiPour sources/storage/Logger.h:91:5: error: There is an unknown macro here somewhere. Configuration is required. If Q_ENUM is a macro then please configure it. [unknownMacro] Q_ENUM(LogType) Index: cppcheck.log =================================================================== diff -u -re5bfc98faab0d165beb1d6f1eda32cceb06dbe20 -ra7d80f7c90cf8c8b2ed123e79403183152d74f5a --- cppcheck.log (.../cppcheck.log) (revision e5bfc98faab0d165beb1d6f1eda32cceb06dbe20) +++ cppcheck.log (.../cppcheck.log) (revision a7d80f7c90cf8c8b2ed123e79403183152d74f5a) @@ -1,4 +1,4 @@ -02/08/2023 20:54 +02/09/2023 15:33 Behrouz NematiPour Checking main.cpp ... Defines: @@ -216,7 +216,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -35/214 files checked 31% done +35/214 files checked 30% done Checking sources/model/dg/data/MDGOperationModeData.cpp ... Defines: Undefines: @@ -258,7 +258,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -42/214 files checked 32% done +42/214 files checked 31% done Checking sources/model/dg/data/post/MDGPostSingleResultData.cpp ... Defines: Undefines: @@ -354,7 +354,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -58/214 files checked 35% done +58/214 files checked 34% done Checking sources/model/hd/adjustment/settings/MAdjustHDAlarmVolumeResponse.cpp ... Defines: Undefines: @@ -402,7 +402,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -66/214 files checked 36% done +66/214 files checked 35% done Checking sources/model/hd/adjustment/treatment/MTreatmentAdjustDurationResponse.cpp ... Defines: Undefines: @@ -486,7 +486,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -80/214 files checked 45% done +80/214 files checked 44% done Checking sources/model/hd/alarm/MAlarmStatusData.cpp ... Defines: Undefines: @@ -564,7 +564,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -93/214 files checked 47% done +93/214 files checked 46% done Checking sources/model/hd/data/post/MUIPostFinalResultHDRequest.cpp ... Defines: Undefines: @@ -606,7 +606,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -100/214 files checked 48% done +100/214 files checked 47% done Checking sources/model/hd/data/treatment/MTreatmentBloodPrimeData.cpp ... Defines: Undefines: @@ -648,7 +648,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -107/214 files checked 49% done +107/214 files checked 48% done Checking sources/model/hd/data/treatment/MTreatmentSalineData.cpp ... Defines: Undefines: @@ -690,7 +690,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -114/214 files checked 50% done +114/214 files checked 49% done Checking sources/model/settings/MBluetooth.cpp ... Defines: Undefines: @@ -734,7 +734,7 @@ Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native Checking sources/storage/StorageGlobals.cpp: BUILD_FOR_TARGET... -121/214 files checked 55% done +121/214 files checked 54% done Checking sources/storage/TreatmentLog.cpp ... Defines: Undefines: @@ -772,7 +772,7 @@ Platform:Native Checking sources/view/VEventSpy.cpp: DEBUG_BCUFF_MIMIC... Checking sources/view/VEventSpy.cpp: SPY_MOUSE_EVENT... -127/214 files checked 58% done +127/214 files checked 57% done Checking sources/view/VGeneralEvent.cpp ... Defines: Undefines: @@ -826,7 +826,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -136/214 files checked 62% done +136/214 files checked 61% done Checking sources/view/dg/data/VDGOperationModeData.cpp ... Defines: Undefines: @@ -970,7 +970,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -160/214 files checked 66% done +160/214 files checked 65% done Checking sources/view/hd/adjustment/treatment/VTreatmentAdjustmentFlows.cpp ... Defines: Undefines: @@ -1102,7 +1102,7 @@ Undefines: Includes: -I.//sources/ -I.//sources/bluetooth/ -I.//sources/canbus/ -I.//sources/cloudsync/ -I.//sources/device/ -I.//sources/gui/ -I.//sources/model/ -I.//sources/storage/ -I.//sources/utility/ -I.//sources/view/ -I.//sources/wifi/ -I.//unittests/ Platform:Native -182/214 files checked 70% done +182/214 files checked 71% done Checking sources/view/hd/data/pretreatment/VPreTreatmentSelfTestNoCartridgeData.cpp ... Defines: Undefines: Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -re5bfc98faab0d165beb1d6f1eda32cceb06dbe20 -ra7d80f7c90cf8c8b2ed123e79403183152d74f5a --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision e5bfc98faab0d165beb1d6f1eda32cceb06dbe20) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision a7d80f7c90cf8c8b2ed123e79403183152d74f5a) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 08-Feb-2023 + * \date (last) 09-Feb-2023 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * Index: sources/view/hd/alarm/VAlarmActiveList.cpp =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -ra7d80f7c90cf8c8b2ed123e79403183152d74f5a --- sources/view/hd/alarm/VAlarmActiveList.cpp (.../VAlarmActiveList.cpp) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/view/hd/alarm/VAlarmActiveList.cpp (.../VAlarmActiveList.cpp) (revision a7d80f7c90cf8c8b2ed123e79403183152d74f5a) @@ -16,8 +16,8 @@ // Project #include "GuiController.h" +#include "Settings.h" -VIEW_DEF_CLASS_ADJUSTMENT(VAlarmActiveList) #define PROPERTY_ALARM_SET(vIndex) \ a##vIndex##ID ( vData.mAlarmID##vIndex ) ; \ @@ -32,12 +32,16 @@ a##vIndex##ID ( 0 ) ; \ a##vIndex##Text ( "" ); \ + +VIEW_DEF_CLASS_ADJUSTMENT(VAlarmActiveList) + /*! \brief Connection Initializer \details All the class signal/slot connections are defined here. */ void View::VAlarmActiveList::initConnections() { - ADJUST_VIEW_CONNECTION(AlarmActiveListRequestData ); - ACTION_VIEW_CONNECTION(AlarmActiveListResponseData); + ADJUST_VIEW_CONNECTION(AlarmActiveListRequestData ); + ACTION_VIEW_CONNECTION(AlarmActiveListResponseData ); + ACTION_VIEW_CONNECTION(SettingsData ); } /*! @@ -96,10 +100,35 @@ */ QString View::VAlarmActiveList::alarmIDText(quint32 vID) { + if ( _alarmTitles.contains(vID) ) { + return _alarmTitles[vID]; + } return Model::MAlarmStatus::toText(static_cast(vID)); } /*! + * \brief View::VAlarmActiveList::onActionReceive + * \details This function updates the list of titles for each AlarmID to be used as the text in activeAlarmList screen, + * when the settings controller is done reading the Alarms.conf and signaling this class. + * \todo This function with the same one in VAlarmStatus needs to be moved to a Controller Model structure, for a better performance and memory management. + */ +void View::VAlarmActiveList::onActionReceive(const SettingsData &) { + QString category = Storage::Settings_Category_Alarms; + QStringList groups = _Settings.groups(category); + for (const auto &group : groups) { + bool ok = true; + quint32 id = group.toInt( &ok ); + if ( ! ok ) { LOG_DEBUG(QString("Not an alarm ID number [%1]").arg(group)); continue; } + + for (const QString &key : _Settings.keys(category, group)) { + if (Storage::Settings::isKeyTitle ( key ) ) { + _alarmTitles[id] = _Settings.value(category, group, key).toString(); + } + } + } +} + +/*! * \brief View::VAlarmActiveList::doRequest * \details Sends the request to get the list of active alarms */ Index: sources/view/hd/alarm/VAlarmActiveList.h =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -ra7d80f7c90cf8c8b2ed123e79403183152d74f5a --- sources/view/hd/alarm/VAlarmActiveList.h (.../VAlarmActiveList.h) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/view/hd/alarm/VAlarmActiveList.h (.../VAlarmActiveList.h) (revision a7d80f7c90cf8c8b2ed123e79403183152d74f5a) @@ -21,6 +21,7 @@ #include "main.h" // Doxygen : do not remove #include "VAdjustmentResponseBase.h" #include "MAlarmActiveList.h" +#include "MSettings.h" namespace View { @@ -38,6 +39,8 @@ // friends friend class ::tst_views; + QMap _alarmTitles; + // disabled coco begin validated: // The property adjustment_Triggered has to be always true // and to always trigger the change event to work as a notifier for GUI @@ -72,7 +75,9 @@ PROPERTY(QString , status , "") - VIEW_DEC_CLASS_ADJUSTMENT(VAlarmActiveList, AlarmActiveListResponseData) + VIEW_DEC_CLASS ( VAlarmActiveList ) + VIEW_DEC_SLOT ( AlarmActiveListResponseData ) + VIEW_DEC_SLOT ( SettingsData ) QString alarmIDText(quint32 vID); Index: sources/view/hd/alarm/VAlarmStatus.cpp =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -ra7d80f7c90cf8c8b2ed123e79403183152d74f5a --- sources/view/hd/alarm/VAlarmStatus.cpp (.../VAlarmStatus.cpp) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/view/hd/alarm/VAlarmStatus.cpp (.../VAlarmStatus.cpp) (revision a7d80f7c90cf8c8b2ed123e79403183152d74f5a) @@ -200,6 +200,12 @@ QStringList VAlarmStatus::instructionKeys () { if ( ! _alarm_AlarmID ) return {}; return _alarms[_alarm_AlarmID].instructions.keys () ; } QStringList VAlarmStatus::instructionValues () { if ( ! _alarm_AlarmID ) return {}; return _alarms[_alarm_AlarmID].instructions.values () ; } +/*! + * \brief View::VAlarmStatus::onActionReceive + * \details This function updates the alarm structure defined here to be used on the AlarmDialogs, + * when the settings controller is done reading the Alarms.conf and signaling this class. + * \todo This function with the same one in VActiveAlarmList needs to be moved to a Controller Model structure, for a better performance and memory management. + */ void VAlarmStatus::onActionReceive(const SettingsData &) { QString category = Storage::Settings_Category_Alarms; QStringList groups = _Settings.groups(category); Index: sources/view/hd/alarm/VAlarmStatus.h =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -ra7d80f7c90cf8c8b2ed123e79403183152d74f5a --- sources/view/hd/alarm/VAlarmStatus.h (.../VAlarmStatus.h) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/view/hd/alarm/VAlarmStatus.h (.../VAlarmStatus.h) (revision a7d80f7c90cf8c8b2ed123e79403183152d74f5a) @@ -59,7 +59,7 @@ bool hasInstruction() { return instructions.count(); } }; - QMap _alarms; + QMap _alarms; // ********** DYNAMIC PROPERTIES: The properties which need to be updated by each alarm message received. ********** // READONLY( bool , hasAlarm , false)