Index: denali.pro.user =================================================================== diff -u -ra302861c33cdda0f0a95ade9b7c6a02b5593a9f2 -r2bc6542cebc264eb343f791f75223a1ca151465e --- denali.pro.user (.../denali.pro.user) (revision a302861c33cdda0f0a95ade9b7c6a02b5593a9f2) +++ denali.pro.user (.../denali.pro.user) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -1,6 +1,6 @@ - + EnvironmentId Index: main.cpp =================================================================== diff -u -r2f0d1d22a15f0ddb459c6527b4746439f66bfe1b -r2bc6542cebc264eb343f791f75223a1ca151465e --- main.cpp (.../main.cpp) (revision 2f0d1d22a15f0ddb459c6527b4746439f66bfe1b) +++ main.cpp (.../main.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -364,6 +364,7 @@ LOG_DEBUG("UI Initializing"); if ( startGui() ) { LOG_DEBUG("UI Initialized"); + _ApplicationController.startPOST(); app_exec = app.exec(); } Index: sources/AlarmGenerator.cpp =================================================================== diff -u -r911882aaf10ee02ef646013914a2ddd6225224ca -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/AlarmGenerator.cpp (.../AlarmGenerator.cpp) (revision 911882aaf10ee02ef646013914a2ddd6225224ca) +++ sources/AlarmGenerator.cpp (.../AlarmGenerator.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -48,7 +48,6 @@ return mFlags; } - /*! * \brief AlarmGenerator::ALARM_ID_HD_COMM_TIMEOUT * \details generates the ALARM_ID_HD_COMM_TIMEOUT alarm. @@ -74,3 +73,4 @@ return data; } // coco end + Index: sources/ApplicationController.cpp =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -18,6 +18,7 @@ #include // Project +#include "ApplicationPost.h" #include "MainTimer.h" #include "MessageDispatcher.h" #include "Logger.h" @@ -34,10 +35,7 @@ * \param parent - QObject parent owner object. * Qt handles the children destruction by their parent objects life-cycle. */ -ApplicationController::ApplicationController(QObject *parent) : QObject(parent) -{ - _applicationPost = new ApplicationPost(this); -} +ApplicationController::ApplicationController(QObject *parent) : QObject(parent) { } /*! * \brief ApplicationController initializer @@ -48,9 +46,6 @@ _init = true; initConnections(); - // coco begin validated: The class ApplicationPost has not been implemented Yet. - if (!_applicationPost->init()) return false; - // coco end LOG_DEBUG("UI," + tr("%1 Initialized").arg(metaObject()->className())); return true; @@ -125,10 +120,10 @@ connect(&_Logger , SIGNAL(didExportLogs()), this , SLOT( onExport ())); + // Settings - move to application thread connect(this, SIGNAL(didSettingsInit()), this, SLOT( onSettingsInit())); - connect(&_settingsWatcher, SIGNAL(finished ()), this , SLOT(onSettingsUpdate())); @@ -505,3 +500,13 @@ Storage::Settings settings; settings.read(); } + +void ApplicationController::onstartPOST() { + ApplicationPost post; + connect(&post, &ApplicationPost::didPOSTFailed, [=] (const Gui::GuiAlarmID &vAlarmID) { + emit didActionTransmit(GuiActionType::ID_AlarmTriggered, { vAlarmID }); + }); + AdjustUIPostFinalResultRequestData data; + data.mResult = post.start(); + emit didAdjustment(data); +} Index: sources/ApplicationController.h =================================================================== diff -u -r97d593e2e7adb36f2f9f97f9bb9958dcef740bc1 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/ApplicationController.h (.../ApplicationController.h) (revision 97d593e2e7adb36f2f9f97f9bb9958dcef740bc1) +++ sources/ApplicationController.h (.../ApplicationController.h) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -23,7 +23,6 @@ #include "GuiGlobals.h" #include "MessageGlobals.h" #include "DeviceGlobals.h" -#include "ApplicationPost.h" // define #define _ApplicationController ApplicationController::I() @@ -52,8 +51,6 @@ // friends friend class ::tst_initializations; - ApplicationPost *_applicationPost = nullptr; - QThread *_thread = nullptr; bool _init = false; @@ -132,4 +129,7 @@ // ---- Signal/Slots ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + + // TODO: do the same for Settings. + SAFE_CALL(startPOST) }; Index: sources/ApplicationPost.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -13,36 +13,27 @@ * */ #include "ApplicationPost.h" +// Qt +// Project + /*! * \brief ApplicationPost::ApplicationPost * \details Constructor * \param parent - QObject parent owner object. * Qt handles the children destruction by their parent objects life-cycle. */ -ApplicationPost::ApplicationPost(QObject *parent) : QObject(parent) -{ +ApplicationPost::ApplicationPost(QObject *parent) : QObject(parent) { } -} - /*! - * \brief ApplicationPost::init - * \details Initialization - * \return true - */ -bool ApplicationPost::init() -{ - return true; -} - -/*! * \brief ApplicationPost::start * \details Starting the post application initialization * \return */ bool ApplicationPost::start() { - // coco begin validated: Is a placeholder and has not been implemented yet - return true; + // TEST Code + emit didPOSTFailed(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_TOUCH); + emit didPOSTFailed(Gui::GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CAN); + return false; } -// coco end Index: sources/ApplicationPost.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/ApplicationPost.h (.../ApplicationPost.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/ApplicationPost.h (.../ApplicationPost.h) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -14,17 +14,29 @@ */ #pragma once +// Qt #include +// Project +#include "GuiGlobals.h" + class ApplicationPost : public QObject { Q_OBJECT public: explicit ApplicationPost(QObject *parent = nullptr); - bool init(); bool start(); signals: + void didPOSTFailed(const Gui::GuiAlarmID &vAlarmID); public slots: }; + + + + + + +// if the touch is not connected this message in dmesg +// [ 5.152555] ft5x06-ts 3-0038: Could not detect touch screen -19. Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -rebc82b5efe26c1081606fab06a1c99bb4f9c0098 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision ebc82b5efe26c1081606fab06a1c99bb4f9c0098) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -286,6 +286,7 @@ // coco begin validated: Manually tested. This model class is a placeholder for the message 63(0x3F00) and there is no use case for this now. case Gui::GuiActionType::ID_AlarmClearedConditionReq : INTERPRET_TRANSMIT_MESSAGE(AlarmClearedConditionRequestData ); break; case Gui::GuiActionType::ID_AlarmActiveListReq : INTERPRET_TRSMT_MT_MESSAGE(AlarmActiveListRequestData ); break; + case Gui::GuiActionType::ID_AlarmTriggered : INTERPRET_TRANSMIT_MESSAGE(AlarmTriggeredRequestData ); break; // coco end default: QString mActionIdHexString = Format::toHexString(vActionId); Index: sources/gui/GuiGlobals.h =================================================================== diff -u -rebc82b5efe26c1081606fab06a1c99bb4f9c0098 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision ebc82b5efe26c1081606fab06a1c99bb4f9c0098) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -329,11 +329,11 @@ // Pre-Treatment Recirculate Q_ENUM(HD_Pre_Treatment_Recirc_States) // Disinfection - Q_ENUM(DG_Disinfect_States) #include "DGDefs.h" Q_ENUM(DG_POST_States) Q_ENUM(DG_Op_Modes) + Q_ENUM(DG_Disinfect_States) Q_ENUM(DG_Flush_UI_States) Q_ENUM(DG_Heat_UI_States) Q_ENUM(DG_Chem_UI_States) Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -rebc82b5efe26c1081606fab06a1c99bb4f9c0098 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision ebc82b5efe26c1081606fab06a1c99bb4f9c0098) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -120,13 +120,7 @@ Connections { target: vHDOperationMode // onFaultChanged : { page( _faultModeScreen , vfault )} // may needed later. onServiceChanged : { page( _serviceModeScreen , vservice )} - onInitChanged : { page( _initialModeScreen , vinit ) - if (vinit) { - // FIXMW : This is a temporary code for now to make the FW work. - // later needs to be moved to the correct place. - vAdjustmentVersions.doUIPOSTFinal() - } - } + onInitChanged : { page( _initialModeScreen , vinit )} onHomeChanged : { page( _mainHome , vhome )} onStandbyChanged : { /* It depends on the subModes of the standBy. Handled by onHome. */ } Index: sources/main.h =================================================================== diff -u -r7a1509a80fed2dd51aa28b460acbf0227d0c96d7 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/main.h (.../main.h) (revision 7a1509a80fed2dd51aa28b460acbf0227d0c96d7) +++ sources/main.h (.../main.h) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -313,8 +313,15 @@ \ ADJUST_TRANSMT_PUBLIC_SLOT (vTYPE) \ ADJUST_TRANSMT_SIGNAL (vTYPE) \ - //--------------------------------------------------------------------------------// +#define SAFE_CALL( vMETHOD) \ +public : void vMETHOD() { \ + connect(this, SIGNAL(did##vMETHOD()), \ + this, SLOT( on##vMETHOD())); \ + emit did##vMETHOD();} \ +Q_SIGNALS : void did##vMETHOD(); \ +private Q_SLOTS : void on##vMETHOD(); +//--------------------------------------------------------------------------------// #define REGISTER_METATYPE(vTYPE) \ qRegisterMetaType < vTYPE > (#vTYPE); //--------------------------------------------------------------------------------// Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -ra1fdb6d955a07f87e0352c41cee61106eb97e59f -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision a1fdb6d955a07f87e0352c41cee61106eb97e59f) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 28-Jul-2021 + * \date (last) 31-Jul-2021 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * @@ -284,7 +284,16 @@ /*0254*/case GuiAlarmID::ALARM_ID_DG_INVALID_SERVICE_RECORD : { result = QObject::tr("DG invalid service record." ); break; } /* 254*/ /*0255*/case GuiAlarmID::ALARM_ID_HD_UI_COMPATIBILITY_ERROR : { result = QObject::tr("HD and UI software builds are not compatible." ); break; } /* 255*/ /*0256*/case GuiAlarmID::ALARM_ID_HD_DG_COMPATIBILITY_ERROR : { result = QObject::tr("HD and DG software builds are not compatible." ); break; } /* 256*/ -/*0257*/case GuiAlarmID::NUM_OF_ALARM_IDS : { result = QObject::tr("Total number of alarms." ); break; } /* 257*/ +/*0257*/case GuiAlarmID::ALARM_ID_DG_FPGA_POWER_OUT_TIMEOUT : { result = QObject::tr("DG FPGA power out timeout." ); break; } /* 257*/ +/*0258*/case GuiAlarmID::ALARM_ID_HD_FPGA_POWER_OUT_TIMEOUT : { result = QObject::tr("HD FPGA power out timeout." ); break; } /* 258*/ +/*0259*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CAN : { result = QObject::tr("UI POST CANBus failure." ); break; } /* 259*/ +/*0260*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_TOUCH : { result = QObject::tr("UI POST Touch failure." ); break; } /* 260*/ +/*0261*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_SDCARD : { result = QObject::tr("UI POST SD-Card failure." ); break; } /* 261*/ +/*0262*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_CRC : { result = QObject::tr("UI POST CRC failure." ); break; } /* 262*/ +/*0263*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_WIFI : { result = QObject::tr("UI POST WiFi failure." ); break; } /* 263*/ +/*0264*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_BLUETOOTH : { result = QObject::tr("UI POST Bluetooth failure." ); break; } /* 264*/ +/*0265*/case GuiAlarmID::ALARM_ID_UI_POST_FAILURE_ETHERNET : { result = QObject::tr("UI POST Ethernet failure." ); break; } /* 265*/ +/*0266*/case GuiAlarmID::NUM_OF_ALARM_IDS : { result = QObject::tr("Total number of alarms." ); break; } /* 266*/ default: result = QObject::tr("ALARM_ID_UNDEFINED [%1]").arg(int(vAlarmID)); Index: sources/model/hd/alarm/MAlarmTriggered.cpp =================================================================== diff -u -re8ffaa51e4eb9b55efebebc13899f79d9a5ca946 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/model/hd/alarm/MAlarmTriggered.cpp (.../MAlarmTriggered.cpp) (revision e8ffaa51e4eb9b55efebebc13899f79d9a5ca946) +++ sources/model/hd/alarm/MAlarmTriggered.cpp (.../MAlarmTriggered.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -13,7 +13,11 @@ * */ #include "MAlarmTriggered.h" +// Qt + +// Project #include "GuiGlobals.h" +#include "MAlarmStatusData.h" using namespace Model; @@ -171,3 +175,19 @@ data.mDataFieldB2 = _data.mDataFieldB2 .value ? true : false; return data; } + +QString MAlarmTriggeredReq::toString() { + return toString({}); +} + +QString MAlarmTriggeredReq::toString(const QVariantList &vParameters) { + QString alarmText = ""; + if (vParameters.count()) { + bool ok; + GuiAlarmID alarmID = static_cast(vParameters[0].toInt(&ok)); + alarmText = Model::MAlarmStatus::toText(alarmID); + } + return MModel::toString("AlarmTriggered", alarmText); +} + +Can::Can_Id MAlarmTriggeredReq::canid() { return Can::Can_Id::eChlid_UI_Sync; } Index: sources/model/hd/alarm/MAlarmTriggered.h =================================================================== diff -u -re8ffaa51e4eb9b55efebebc13899f79d9a5ca946 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/model/hd/alarm/MAlarmTriggered.h (.../MAlarmTriggered.h) (revision e8ffaa51e4eb9b55efebebc13899f79d9a5ca946) +++ sources/model/hd/alarm/MAlarmTriggered.h (.../MAlarmTriggered.h) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -5,11 +5,11 @@ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file MAlarmTriggered.h - * \author (last) Behrouz NematiPour - * \date (last) 16-Oct-2020 - * \author (original) Behrouz NemaiPour - * \date (original) 02-Jul-2020 + * \file MAlarmTriggered.h + * \author (last) Behrouz NematiPour + * \author (original) Behrouz NematiPour + * \date (last) 16-Oct-2020 + * \date (original) 02-Jul-2020 * */ #pragma once @@ -19,6 +19,7 @@ // Project #include "MAbstract.h" +#include "MAdjustRequestsBase.h" #include "types.h" // forward declarations @@ -101,6 +102,31 @@ bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; Data data ( ) const ; }; + + +/*! + * \brief The MAlarmTriggeredReq class + * \details The model to transmit AlarmTrigger (mainly being used for post for now) + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * |0x0300| 0x200 | Req | Y | UI | All | Alarm Triggered | + * + * | Payload || + * | || + * + */ +class MAlarmTriggeredReq : public MModel { +public: + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString(); + // coco end + static QString toString(const QVariantList &vParameters); + static Can::Can_Id canid (); +}; + } typedef Model::MAlarmTriggered::Data AlarmTriggeredData; +typedef Model::MAlarmTriggeredReq AlarmTriggeredRequestData; Index: sources/view/settings/VAdjustmentVersions.cpp =================================================================== diff -u -rebc82b5efe26c1081606fab06a1c99bb4f9c0098 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/view/settings/VAdjustmentVersions.cpp (.../VAdjustmentVersions.cpp) (revision ebc82b5efe26c1081606fab06a1c99bb4f9c0098) +++ sources/view/settings/VAdjustmentVersions.cpp (.../VAdjustmentVersions.cpp) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -20,8 +20,6 @@ VIEW_DEF_CLASS_ADJUSTMENT(VAdjustmentVersions) void VAdjustmentVersions::initConnections() { - ADJUST_VIEW_CONNECTION( AdjustUIPostFinalResultRequestData); // this is only a test in here and later need to be removed - ADJUST_VIEW_CONNECTION( AdjustVersionsRequestData); ADJUST_VIEW_CONNECTION( AdjustVersionsResponseData); Index: sources/view/settings/VAdjustmentVersions.h =================================================================== diff -u -rebc82b5efe26c1081606fab06a1c99bb4f9c0098 -r2bc6542cebc264eb343f791f75223a1ca151465e --- sources/view/settings/VAdjustmentVersions.h (.../VAdjustmentVersions.h) (revision ebc82b5efe26c1081606fab06a1c99bb4f9c0098) +++ sources/view/settings/VAdjustmentVersions.h (.../VAdjustmentVersions.h) (revision 2bc6542cebc264eb343f791f75223a1ca151465e) @@ -91,12 +91,6 @@ // ---------- Version public slots: - void doUIPOSTFinal() { // this is only a test in here and later need to be removed - AdjustUIPostFinalResultRequestData data; - data.mResult = true; - emit didAdjustment(data); - } - void doAdjustment() { AdjustVersionsRequestData data; emit didAdjustment(data); @@ -105,6 +99,5 @@ signals: void didAdjustment(const AdjustVersionsRequestData &vData); void didAdjustment(const AdjustVersionsResponseData &vData); - void didAdjustment(const AdjustUIPostFinalResultRequestData &vData); // this is only a test in here and later need to be removed }; }