Index: sources/ApplicationController.cpp =================================================================== diff -u -rf1c4d7f7c9cd4422f6190a5b31c8f1e74e520c04 -r4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision f1c4d7f7c9cd4422f6190a5b31c8f1e74e520c04) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac) @@ -89,7 +89,6 @@ */ void ApplicationController::initConnections() { - connect(&_post , SIGNAL( didEthernet (bool)), this , SLOT(onPOSTEthernet (bool))); connect(&_post , SIGNAL( didWiFi (bool)), @@ -112,6 +111,8 @@ this , SLOT( onActionTransmit(GuiActionType, const QVariantList &))); connect(&_GuiController , SIGNAL(didQuitApplication()), this , SLOT( onQuitApplication())); + connect(&_GuiController , SIGNAL(didTreatmentRangesIncorrect()), + this , SLOT(onTreatmentRangesIncorrect())); // From HD/DG connect(&_MessageDispatcher, SIGNAL(didActionReceive(GuiActionType, const QVariantList &)), @@ -159,7 +160,6 @@ connect(&_settingsWatcher, SIGNAL(finished ()), this , SLOT(onSettingsUpdate())); - // Device Signal/Slots DEVICE_APP_INIT_CONNECTIONS_LIST Index: sources/gui/GuiController.cpp =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac --- sources/gui/GuiController.cpp (.../GuiController.cpp) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/gui/GuiController.cpp (.../GuiController.cpp) (revision 4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac) @@ -390,3 +390,12 @@ { emit didQuitApplication(); } + +/*! + * \brief GuiController::doNotifyTreatmentRangeInvalid + * \details emit the didTreatmentRangesIncorrect signal to ask ApplicationController to emit alarm that settings are bad + */ +void GuiController::doNotifyTreatmentRangeInvalid() +{ + emit didTreatmentRangesIncorrect(); +} Index: sources/gui/GuiController.h =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac --- sources/gui/GuiController.h (.../GuiController.h) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/gui/GuiController.h (.../GuiController.h) (revision 4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac) @@ -75,6 +75,7 @@ void doExportService (const GuiStringIndexMap &vExportList); // UI => OS void doExportTreatment (const GuiStringIndexMap &vExportList); // UI => OS void doQuitApplication (); + void doNotifyTreatmentRangeInvalid(); private slots: // Should be private for thread safety and is connected internally. void onActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG @@ -116,6 +117,8 @@ void didQuitApplication (); + void didTreatmentRangesIncorrect(); + // Device controller signal slots connection DEVICE_GUI_BRIDGE_DEFINITION_LIST Index: sources/storage/Settings.cpp =================================================================== diff -u -rf1c4d7f7c9cd4422f6190a5b31c8f1e74e520c04 -r4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac --- sources/storage/Settings.cpp (.../Settings.cpp) (revision f1c4d7f7c9cd4422f6190a5b31c8f1e74e520c04) +++ sources/storage/Settings.cpp (.../Settings.cpp) (revision 4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac) @@ -87,18 +87,17 @@ if (! isValid(settingFile.absoluteFilePath())) continue; QFile file(settingFile.absoluteFilePath()); - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { - Detail detail; - detail.content = file.readAll().trimmed(); - if (detail.content.isEmpty()) continue; - detail.location = settingFile.absolutePath() + "/"; - detail.category = QString(detail.location + settingFile.baseName()).remove(Storage::Settings_Path()); - details += detail; - } else { + if (! file.open(QIODevice::ReadOnly | QIODevice::Text)) { err = Settings::Settings_Error::eError_ConfigFileReadFail; LOG_DEBUG(errorMessage(err).arg(Storage::Settings_Path())); return err; } + Detail detail; + detail.content = file.readAll().trimmed(); + if (detail.content.isEmpty()) continue; + detail.location = settingFile.absolutePath() + "/"; + detail.category = QString(detail.location + settingFile.baseName()).remove(Storage::Settings_Path()); + details += detail; } for (const auto &detail : details) { Index: sources/view/hd/data/VTreatmentRanges.cpp =================================================================== diff -u -rf1c4d7f7c9cd4422f6190a5b31c8f1e74e520c04 -r4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac --- sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision f1c4d7f7c9cd4422f6190a5b31c8f1e74e520c04) +++ sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 4fd6a7d7801d91ffbce9e8d4b54900224f6a0fac) @@ -26,8 +26,13 @@ ACTION_VIEW_CONNECTION(TreatmentRangesData); ACTION_VIEW_CONNECTION(SettingsData); - connect(this , SIGNAL(didTreatmentRangesIncorrect()), - &_ApplicationController , SLOT(onTreatmentRangesIncorrect())); + // since we do not have access to this object because it is created in QML. + // Connection to the GuiController made here + // It should be defined in the class which wants to connect to signal. + // VTreatmentRanges -> GUIController -> ApplicationController to handle + connect(this , SIGNAL( didTreatmentRangesIncorrect()), + &_GuiController, SLOT(doNotifyTreatmentRangeInvalid())); + } void View::VTreatmentRanges::onActionReceive(const TreatmentRangesData &vData) @@ -52,7 +57,9 @@ void View::VTreatmentRanges::onActionReceive(const SettingsData &) { QString mCategory = Storage::Settings_Category_ConfigurationsDataList; + bool isConfigsOk = true; // assume configurations are valid + FROMVARIANT_WITHRETURN ( bloodFlowRateMin , "Blood Flow Rate Ranges" , "Blood_Flow_Rate_Min" , UInt , isConfigsOk ); FROMVARIANT_WITHRETURN ( bloodFlowRateMax , "Blood Flow Rate Ranges" , "Blood_Flow_Rate_Max" , UInt , isConfigsOk ); FROMVARIANT_WITHRETURN ( bloodFlowRateRes , "Blood Flow Rate Ranges" , "Blood_Flow_Rate_Res" , UInt , isConfigsOk ); @@ -93,6 +100,11 @@ bicarbonateConcentrateOptions ( _Settings.keys(mCategory , "Bicarbonate Concentrate Options" )); dialyzerTypeOptions ( _Settings.keys(mCategory , "Dialyzer Type Options" )); + isConfigsOk = isConfigsOk && !_heparinTypeOptions .isEmpty(); + isConfigsOk = isConfigsOk && !_acidConcentrateOptions .isEmpty(); + isConfigsOk = isConfigsOk && !_bicarbonateConcentrateOptions.isEmpty(); + isConfigsOk = isConfigsOk && !_dialyzerTypeOptions .isEmpty(); + FROMVARIANT_WITHRETURN ( dialysateTempMin , "Dialysate Temperature" , "Dialysate_Temperature_Min" , Float , isConfigsOk ); FROMVARIANT_WITHRETURN ( dialysateTempMax , "Dialysate Temperature" , "Dialysate_Temperature_Max" , Float , isConfigsOk ); FROMVARIANT_WITHRETURN ( dialysateTempRes , "Dialysate Temperature" , "Dialysate_Temperature_Res" , Float , isConfigsOk );