Index: sources/canbus/MessageDispatcher.h =================================================================== diff -u -rebc82b5efe26c1081606fab06a1c99bb4f9c0098 -r38ae7b93679d05a54fc460dac68891562d7da72d --- sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision ebc82b5efe26c1081606fab06a1c99bb4f9c0098) +++ sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 38ae7b93679d05a54fc460dac68891562d7da72d) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * \copyright * 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 MessageDispatcher.h - * \author (last) Behrouz NematiPour - * \date (last) 08-Sep-2020 - * \author (original) Behrouz NematiPour - * \date (original) 26-Aug-2020 + * \file MessageDispatcher.h + * \author (last) Dara Navaei + * \date (last) 06-May-2024 + * \author (original) Behrouz NematiPour + * \date (original) 26-Aug-2020 * */ #pragma once @@ -18,7 +18,7 @@ #include // Project -#include "main.h" // Doxygen : don't remove +#include "main.h" // Doxygen : do not remove #include "MessageBuilder.h" #include "MessageInterpreter.h" @@ -107,6 +107,10 @@ // List of the transmit(request) only, messages which require acknowledge back(AckBack). QList _needsAcknow { + // FIXME: check this on device first. It is not working with dialin. + GuiActionType::ID_KeepAlive , + // CONFIRM + GuiActionType::ID_DuetConfirmUIr , // POST GuiActionType::ID_UIPostFinalResultData , // Alarm @@ -140,29 +144,36 @@ GuiActionType::ID_AdjustRecirculateReq , GuiActionType::ID_AdjustTreatmentEndReq , // Post-Treatment - GuiActionType::ID_AdjustPatientDisconnectionConfirmReq , + GuiActionType::ID_AdjustPatientDisconnectNotifyReq , + GuiActionType::ID_AdjustPatientDisconnectConfirmReq , GuiActionType::ID_AdjustDisposablesRemovalConfirmReq , // Disinfect - GuiActionType::ID_AdjustDisinfectReq , - GuiActionType::ID_AdjustChemicalConfirmReq , + GuiActionType::ID_AdjustDisinfectModeReq , + GuiActionType::ID_AdjustDisinfectStartReq , + // DG Cleaning + GuiActionType::ID_AdjustDGCleaningUsageReq , // Settings + GuiActionType::ID_AdjustServiceModeReq , GuiActionType::ID_AdjustVersionsUIReq , GuiActionType::ID_AdjustVersionsUIRsp , - GuiActionType::ID_AdjustServiceReq , + GuiActionType::ID_AdjustServiceDatesReq , GuiActionType::ID_AdjustHDDateTimeReq , GuiActionType::ID_AdjustDGDateTimeReq , + GuiActionType::ID_HDUsageInfoReq , + GuiActionType::ID_AdjustInstitutionalRecordReq , // Treatment Log GuiActionType::ID_AdjustTreatmentLogReq , GuiActionType::ID_TreatmentLogAvrgeData , GuiActionType::ID_TreatmentLogAlarmData , GuiActionType::ID_TreatmentLogEventData , + + // HD reset request in service mode + GuiActionType::ID_ResetHDInServiceModeReq , }; public slots: bool init(); bool init(QThread &vThread); - -private slots: void quit(); public: @@ -174,28 +185,29 @@ void initThread(QThread &vThread); void quitThread(); - void actionTransmit (GuiActionType vActionId, const QVariantList &vData, Sequence vSequence = 0); + void actionTransmit (GuiActionType vActionId, const QVariantList &vData, Sequence vSequence = 0, Can_Id vCanId = Can::Can_Id::eChlid_UI_HD); void framesTransmit (Can_Id vCan_Id, const FrameList &vFrameList); bool needsAcknow (GuiActionType vActionId); + bool needsAcknow (Can_Id vCan_Id); bool buildMessage (Can_Id vCan_Id, const QByteArray &vPayload); bool interpretMessage(const Message &vMessage); Sequence txCount(); Sequence rxCount(); - bool checkAcknowReceived(const Message &vMessage, const char *src); - bool checkAcknowTransmit(const Message &vMessage, const char *src); + bool checkAcknowReceived(const Message &vMessage, const QString &vSrcText); + bool checkAcknowTransmit(const Message &vMessage, const QString &vSrcText); signals: /*! * \brief didActionReceive - * \details When a message received over the CANBUS this signal is emitted + * \details When a message received over the CANBus this signal is emitted * on successful collecting all required payloads from different frames if any * and successfully has been built into a message and can be interpreted - * \param vAction - The action has been extracted from CANBUS message header to be done - * \param vData - The data has been collected from CANBUS frame(s) + * \param vAction - The action has been extracted from CANBus message header to be done + * \param vData - The data has been collected from CANBus frame(s) */ void didActionReceive (GuiActionType vAction , const QVariantList &vData); @@ -227,7 +239,7 @@ * \brief didFrameTransmit * \details When a message is requested to be transmitted this signal is emitted * on successful interpretation and building the message into frames - * \param vCan_Id - Target channel of the CANBUS message + * \param vCan_Id - Target channel of the CANBus message * \param vPayload - The payload of the message to be sent */ void didFrameTransmit (Can_Id vCan_Id, const QByteArray &vPayload); @@ -250,8 +262,13 @@ // An Action has been requested to be transmitted. void onActionTransmit (GuiActionType vActionId, const QVariantList &vData); + void onSettingsDone (); + // ---- Signal/Slots ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_NOEMIT ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS + + ACTION_RECEIVE_PRIVATE_SLOT(UIPostFinalResultHDRequestData) + }; }