Index: denali.pro.user =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- denali.pro.user (.../denali.pro.user) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ denali.pro.user (.../denali.pro.user) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -1221,7 +1221,7 @@ denali Qt4ProjectManager.Qt4RunConfiguration:/home/denali/Projects/application/denali.pro - --disable-timeout --disable-alarm-no-minimize --disable-unhandled-report --disable-check-in-log + --disable-timeout --disable-alarm-no-minimize --disable-unhandled-report --disable-check-in-log --disable-dialin-unhandled --disable-acknow-log 3768 false true Index: main.cpp =================================================================== diff -u -rfd79fadd4f42518f80e2cf3c19eec5a516ed75d4 -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- main.cpp (.../main.cpp) (revision fd79fadd4f42518f80e2cf3c19eec5a516ed75d4) +++ main.cpp (.../main.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -55,7 +55,6 @@ #include "CloudSyncController.h" #include "Threads.h" -// #include "FileHandler.h" // kernel #include @@ -85,10 +84,11 @@ bool gSendEmptyKeepAwake = false ; bool gFakeSeqAtBegin = false ; bool gDisableUnhandledReport = false ; -bool gEnableDialinUnhandled = false ; +bool gDisableDialinUnhandled = false ; bool gDisableTimeout = false ; bool gDisableAlarmNoMinimize = false ; bool gDisableCheckInLog = false ; +bool gDisableAcknowLog = false ; bool gConsoleoutLogs = false ; bool gConsoleoutFrameInterface = false ; @@ -119,8 +119,11 @@ * of the frame * -u, --disable-unhandled-report Disable unhandled messages report as an * error in the log + * -d, --disable-dialin-unhandled Disable the Dialin messages logged as + * unhandled * -q, --disable-timeout Disables HD communication timeout - * + * -a, --disable-alarm-no-minimize Disables alarm no minimize + * -k, --disable-check-in-log Disables Check-In Log * * \endverbatim */ /*! @@ -186,10 +189,10 @@ parser.addOption(optionDisableUnhandledReport); // --- -d : enable-dialin-unhandled - QCommandLineOption optionEnableDialinUnhandled( - QStringList() << "d" << "enable-dialin-unhandled", - QCoreApplication::translate("main", "Enable the Dialin messages logged as unhandled")); - parser.addOption(optionEnableDialinUnhandled); + QCommandLineOption optionDisableDialinUnhandled( + QStringList() << "d" << "disable-dialin-unhandled", + QCoreApplication::translate("main", "Disable the Dialin messages logged as unhandled")); + parser.addOption(optionDisableDialinUnhandled); // --- -q : disable-timeout QCommandLineOption optionDisableTimeout( @@ -207,17 +210,23 @@ QCoreApplication::translate("main", "Disables Check-In Log")); parser.addOption(optionDisableCheckInLog); + // --- -K : disable-acknow-log (Acknowledge) + QCommandLineOption optionDisableAcknowLog(QStringList() << "K" << "disable-acknow-log", + QCoreApplication::translate("main", "Disables Acknowledgment Log")); + parser.addOption(optionDisableAcknowLog); + // --- parse command lines parser.process(*qApp); gConsoleoutCanInterface = parser.isSet(optionConsoleoutCanInterface ); gConsoleoutFrameInterface = parser.isSet(optionConsoleoutFrameInterface ); gConsoleoutLogs = parser.isSet(optionConsoleoutLogs ); gDisableUnhandledReport = parser.isSet(optionDisableUnhandledReport ); - gEnableDialinUnhandled = parser.isSet(optionEnableDialinUnhandled ); + gDisableDialinUnhandled = parser.isSet(optionDisableDialinUnhandled ); gDisableTimeout = parser.isSet(optionDisableTimeout ); gDisableAlarmNoMinimize = parser.isSet(optionDisableAlarmMoMinimize ); gDisableCheckInLog = parser.isSet(optionDisableCheckInLog ); + gDisableAcknowLog = parser.isSet(optionDisableAcknowLog ); if (parser.isSet(optionSendEmptyKeepAwake)) gSendEmptyKeepAwake = true; bool ok = false; Index: scripts/run.sh =================================================================== diff -u -r86e9dfbff50cb7e16fd94c16c1c818cef3b47eac -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- scripts/run.sh (.../run.sh) (revision 86e9dfbff50cb7e16fd94c16c1c818cef3b47eac) +++ scripts/run.sh (.../run.sh) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -172,8 +172,7 @@ # ---------------------------------------- Denali #launching denali application -#TODO: -d(--enable-dialin-unhandled) added for the development phase and has to be removed later -$HOME/denali -u -d & # -a has to be removed and is only for debugging to bypass the nonminimizable alarms. +$HOME/denali -u & # ---------------------------------------- END Index: sources/MainTimer.cpp =================================================================== diff -u -rec7f919fdb70ff29a8de627937e4ad7008e59c1c -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/MainTimer.cpp (.../MainTimer.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) +++ sources/MainTimer.cpp (.../MainTimer.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -115,7 +115,7 @@ */ void MainTimer::timerEvent(QTimerEvent *) { -#ifndef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG +#ifndef DISABLE_KEEP_ALIVE emit didTimeout(); #endif // I'm not sure how often we need to check for this. Index: sources/canbus/FrameInterface.cpp =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -178,13 +178,13 @@ case eDG_Dialin: case eDialin_UI: case eUI_Dialin: - if ( gEnableDialinUnhandled ) { - channelGroup = ChannelGroup::eChannel_Listens; - } else { + if ( gDisableDialinUnhandled ) { channelGroup = ChannelGroup::eChannel_Ignores; + } else { + channelGroup = ChannelGroup::eChannel_Listens; } - debugChannel = ! gEnableDialinUnhandled; // if debug channel is true, the raw can message in logged in the service log. - ok = gEnableDialinUnhandled; // if ok is true then it will be interpreted as unhandled messages. + debugChannel = gDisableDialinUnhandled; // if debug channel is true, the raw can message in logged in the service log. + ok = ! gDisableDialinUnhandled; // if ok is true then it will be interpreted as unhandled messages. break; case eChlid_HD_DG : Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -802,9 +802,9 @@ bool mNeedsAcknow = needsAcknow(vActionId); if (mNeedsAcknow) { mSequence = -mSequence; - #ifndef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG - LOG_EVENT(tr("UI,Ack Req, Sq:%1, ID:%2").arg(mSequence).arg(Format::toHexString(vActionId))); - #endif + if ( ! gDisableAcknowLog ) { + LOG_EVENT(tr("UI,Ack Req, Sq:%1, ID:%2").arg(mSequence).arg(Format::toHexString(vActionId))); + } #ifdef DEBUG_ACKBACK_HD_TO_UI qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UI AckReq : %1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence); #endif @@ -876,9 +876,9 @@ bool ok = false; if ( mActionId == GuiActionType::ID_Acknow ) { ok = true; - #ifndef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG + if ( ! gDisableAcknowLog ) { LOG_EVENT(tr("%1,Ack Bak, Sq:%2").arg(vSrcText).arg(mSequence)); - #endif + } #ifdef DEBUG_ACKBACK_HD_TO_UI qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HD AckBak : %1 %2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence).arg(vMessage.actionId); #endif @@ -905,19 +905,19 @@ if (mSequence < 0) { ok = true; - #ifndef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG + if ( ! gDisableAcknowLog ) { LOG_EVENT(tr("%1,Ack Req, Sq:%2, ID:%3").arg(vSrcText).arg(mSequence).arg(Format::toHexString(mActionId))); - #endif + } #ifdef DEBUG_ACKBACK_HD_TO_UI qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HD AckReq : %1 %2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence).arg(vMessage.actionId); #endif // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UI AckBak is immediately handled at the same place. QString dstText; Can_Id dstID = MessageInterpreter::identifyDestination(vMessage.can_id, &dstText); actionTransmit(GuiActionType::ID_Acknow, {}, -mSequence, dstID); - #ifndef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG + if ( ! gDisableAcknowLog ) { LOG_EVENT(tr("UI,Ack Bak, Sq:%1, Dst:%2").arg(-mSequence).arg(dstText)); - #endif + } #ifdef DEBUG_ACKBACK_HD_TO_UI qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UI AckBak : %1 %2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(-mSequence).arg(vMessage.actionId); #endif Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r2d0bacfbe1b70055247eb40743405a5f9acb15e3 -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 2d0bacfbe1b70055247eb40743405a5f9acb15e3) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -761,7 +761,9 @@ LOG_DATUM(logString); } else { - LOG_DEBUG(QString("Undefined unhandled message [%1]").arg(id, 0, 16)); + if ( gDisableUnhandledReport ) { // if the unhandled message error has been disabled, return. + LOG_DEBUG(QString("Undefined unhandled message [%1]").arg(id, 0, 16)); + } } return ok; } Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -ra82ee4f326b26c4369f1306f867edc1bca6dabbe -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision a82ee4f326b26c4369f1306f867edc1bca6dabbe) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -36,7 +36,7 @@ StackItem { id : _root // DEBUG: this property can mostly be used for debugging to get pass the initial screen - property var initialItem: _postModeScreen // _mainHome + property var initialItem: vSettings.noCANBus ? _mainHome : _postModeScreen stackView.initialItem : _root.initialItem @@ -118,7 +118,7 @@ onStartTreatment : { page( _treatmentStack )} onCreateTreatment : { vPreTreatmentAdjustmentInitTreatment.doInitiate() // DEBUG: console.debug(vSettings.categorys) - if ( parseInt(vSettings.data["Development/NoCANBus"]["Navigation"]["Create Treatment To Patient ID"]) === 1 ) + if ( vSettings.noCANBus ) vHDOperationMode.validateParametersChanged(true) } onVisibleChanged: { Index: sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml (.../SettingsVolumeBrightness.qml) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml (.../SettingsVolumeBrightness.qml) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -79,7 +79,7 @@ text: qsTr("Alarm Volume") } Slider { id : _alarmVolume - property bool adjustment: false + property bool postInit: true anchors.verticalCenter: parent.verticalCenter width : 500 step : 20 // no zero @@ -89,22 +89,22 @@ ticks : true unit : qsTr("%") onReleased : { - _alarmVolume.adjustment = true vAdjustmentAlarmVolume.doAdjustment( _alarmVolume.value ) } Connections { target: vSettings onAlarmVolumeChanged: { - if ( ! _alarmVolume.adjustment ) { + if ( _alarmVolume.postInit ) { vAdjustmentAlarmVolume.doAdjustment( vSettings.alarmVolume ) } + _alarmVolume.postInit = false _alarmVolume.value = vSettings.alarmVolume } } Connections { target: vAdjustmentAlarmVolume // in case the value is rejecte it will be set to the previous value // also the init value shall be set when navigate to the screen onAdjustmentTriggered : { - _alarmVolume.adjustment = false + _alarmVolume.postInit = false if ( vAdjustmentAlarmVolume.adjustment_Accepted ) { vSettings.alarmVolume = vAdjustmentAlarmVolume.hdAlarmVolume _root.notificationText = "" @@ -114,6 +114,7 @@ } } onHdAlarmVolumeChanged : { + _alarmVolume.postInit = false _alarmVolume.value = vAdjustmentAlarmVolume.hdAlarmVolume } } Index: sources/main.h =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/main.h (.../main.h) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ sources/main.h (.../main.h) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -59,10 +59,12 @@ extern bool gSendEmptyKeepAwake ; extern bool gFakeSeqAtBegin ; extern bool gDisableUnhandledReport ; -extern bool gEnableDialinUnhandled ; +extern bool gDisableDialinUnhandled ; extern bool gDisableTimeout ; extern bool gDisableAlarmNoMinimize ; extern bool gDisableCheckInLog ; +extern bool gDisableAcknowLog ; + extern bool gConsoleoutLogs ; extern bool gConsoleoutFrameInterface ; extern bool gConsoleoutCanInterface ; Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 25-Jul-2022 + * \date (last) 26-Jul-2022 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * Index: sources/storage/Logger.h =================================================================== diff -u -r3a528c6f3fce8132de2791b55d3227e715d68898 -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/storage/Logger.h (.../Logger.h) (revision 3a528c6f3fce8132de2791b55d3227e715d68898) +++ sources/storage/Logger.h (.../Logger.h) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -38,8 +38,6 @@ #define MIXED_EVENT_DATUM -#undef DISABLE_ACKNOW_CHECKIN_MESSAGE_LOG - // forward declarations class tst_logging; Index: sources/storage/Settings.cpp =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/storage/Settings.cpp (.../Settings.cpp) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ sources/storage/Settings.cpp (.../Settings.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -158,7 +158,7 @@ } for ( const auto &group : _Settings.groups(vCategory) ) { - mContent += QString("[%1]\n").arg(group); + mContent += QString("\n[%1]\n").arg(group); for ( const auto &key : _Settings.keys(group) ) { mContent += QString("%1 = %2\n").arg(key).arg(_Settings.value(group, key).toString()); } Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -25,8 +25,9 @@ void VSettings::initConnections() { ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, SettingsData); - PROPERTY_POST_CONNECTION(VSettings, servicePass); - PROPERTY_POST_CONNECTION(VSettings, alarmVolume); + PROPERTY_POST_CONNECTION(VSettings, servicePass ); + PROPERTY_POST_CONNECTION(VSettings, alarmVolume ); + PROPERTY_POST_CONNECTION(VSettings, noCANBus ); } void VSettings::servicePass_post(const QString &vservicePass) { @@ -39,6 +40,11 @@ settings.save(alarmVolumeCategory(), alarmVolumeGroup(), alarmVolumeKey(), QString::number(valarmVolume)); } +void VSettings::noCANBus_post(const bool &vnoCANBus) { + Storage::Settings settings; + settings.save(noCANBusCategory(), noCANBusGroup(), noCANBusKey(), QString::number(vnoCANBus)); +} + void VSettings::onActionReceive(const SettingsData &) { // TODO: this function needs to be moved to the controller, to execute in settings thread not the main thread. @@ -66,18 +72,24 @@ mSettings[group] = details; for (const auto &key : keys) { QVariantMap keyValue; - if ( isservicePass(category, group, key) ) { + if ( isservicePass (category, group, key) ) { QString mServicePass; - mServicePass = _Settings.value(group, key).toString(); + mServicePass = _Settings.value(group, key).toString (); keyValue[key] = mServicePass ; - servicePass (mServicePass); + servicePass ( mServicePass); } - else if ( isalarmVolume(category, group, key) ) { + else if ( isalarmVolume (category, group, key) ) { quint8 mAlarmVolume; - mAlarmVolume = _Settings.value(group, key).toInt(); // returns 0 if fails, so no error checking needed. - keyValue[key] = mAlarmVolume ; - alarmVolume (mAlarmVolume); + mAlarmVolume = _Settings.value(group, key).toInt (); // returns 0 if fails, so no error checking needed. + keyValue[key] = mAlarmVolume ; + alarmVolume ( mAlarmVolume); } + else if ( isnoCANBus (category, group, key) ) { + bool mNoCANBus; + mNoCANBus = _Settings.value(group, key).toBool (); // returns 0/false if fails, so no error checking needed. + keyValue[key] = mNoCANBus ; + noCANBus ( mNoCANBus); + } else { keyValue[key] = _Settings.value(group, key); } @@ -96,6 +108,7 @@ // otherwise will use the default value and will notify the update. servicePass( _servicePass ); alarmVolume( _alarmVolume ); + // noCANBus ( _noCANBus ); // This line has been put here to remind developers that it is intentionally removed, to not to add a default value. adjustment(true); } Index: sources/view/settings/VSettings.h =================================================================== diff -u -ra04fd119778f0483cba5139a11e3c6bad7f2324a -r627b97843f87f5ca8fbd731c6c4a6d9fae4352ce --- sources/view/settings/VSettings.h (.../VSettings.h) (revision a04fd119778f0483cba5139a11e3c6bad7f2324a) +++ sources/view/settings/VSettings.h (.../VSettings.h) (revision 627b97843f87f5ca8fbd731c6c4a6d9fae4352ce) @@ -39,8 +39,9 @@ PROPERTY(QVariantMap , settings , {} ) PROPERTY(QVariantMap , data , {} ) - SETTINGS(QString , servicePass ,"123", "Settings/System", "Service", "Password") - SETTINGS(quint8 , alarmVolume , 100 , "Settings/System", "Alarm" , "Volume" ) + SETTINGS(QString , servicePass ,"123" , "Settings/System" , "Service" , "Password" ) + SETTINGS(quint8 , alarmVolume , 100 , "Settings/System" , "Alarm" , "Volume" ) + SETTINGS(bool , noCANBus , false , "Development/NoCANBus", "Navigation" , "Create Treatment To Patient ID" ) VIEW_DEC(VSettings, SettingsData)