Index: sources/canbus/messageinterpreter.h =================================================================== diff -u -r0bcf15697b32bd20e8f9c2cd780b2eef739a4ee8 -r846a9ebc350e33be4affab3cc4c136248900015d --- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 0bcf15697b32bd20e8f9c2cd780b2eef739a4ee8) +++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 846a9ebc350e33be4affab3cc4c136248900015d) @@ -2,13 +2,14 @@ * * Copyright (c) 2019-2020 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. + * 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 messageinterpreter.h - * \date 12/11/2019 - * \author Behrouz NematiPour + * \file messageinterpreter.h + * \author (last) Behrouz NematiPour + * \date (last) 03-Aug-2020 + * \author (original) Behrouz NematiPour + * \date (original) 13-Dec-2019 * */ #pragma once @@ -18,7 +19,7 @@ // Project #include "messageglobals.h" -#include "mmodel.h" +#include "MModel.h" // forward declaration class tst_messaging; @@ -41,57 +42,41 @@ friend class ::tst_messaging; friend class ::tst_logging; - bool isType(const Message &vMessage, Gui::GuiActionType vType) const; - bool isPayloadLenValid(const Message &vMessage, Gui::GuiActionType vType) const; + bool isType (const Message &vMessage, Gui::GuiActionType vType) const; + bool isPayloadLenValid (const Message &vMessage, Gui::GuiActionType vType) const; + bool isValidMessage (const Message &vMessage, Gui::GuiActionType vType) const; - void printUnhandled(const Message &vMessage); + void logInvalidLength (const Gui::GuiActionType &vActionId); - bool interpretMessage_HD(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - bool interpretMessage_DG(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + void printUnhandled (const Message &vMessage ) const; + void logReceivedMessage (const Model::MAbstract &vModel); - // ---- PowerOff - bool getPowerOffData(const Message &vMessage, Model::MPowerOff &vData) __attribute_warn_unused_result__; - bool powerOffData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool interpretMessage_HD (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool interpretMessage_DG (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - // ---- BloodFlowData - bool getBloodFlowData(const Message &vMessage, Model::MBloodFlow &vData) __attribute_warn_unused_result__; - bool bloodFlowData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ----- Debug + bool canbusFaultCountData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - // ---- Dialysate Inlet FlowData - bool getDialysateInletFlowData(const Message &vMessage, Model::MDialysateFlow &vData) __attribute_warn_unused_result__; - bool dialysateInletFlowData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ----- Events + // ----- - HD + bool alarmStatus (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool alarmTriggered (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool alarmCleared (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - // ---- Dialysate Outlet FlowData - bool getDialysateOutletFlowData(const Message &vMessage, Model::MOutletFlow &vData) __attribute_warn_unused_result__; - bool dialysateOutletFlowData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ----- - DG - // ---- AlarmStatus - bool getAlarmStatus(const Message &vMessage, Model::MAlarmStatus &vData) __attribute_warn_unused_result__; - bool alarmStatus(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ----- Adjustments + bool adjustUltrafiltrationState (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool adjustUltrafiltrationEdit (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool adjustUltrafiltrationConfirm (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - // ---- Treatment Time - bool getTreatmentTime(const Message &vMessage, Model::MTreatmentTime &vData) __attribute_warn_unused_result__; - bool treatmentTime(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + template + bool notify (const Message &vMessage, QVariantList &vData, Gui::GuiActionType vIdCheck) __attribute_warn_unused_result__; - // ---- Treatment Pressure/Occlusion - bool getPressureOcclusionData(const Message &vMessage, Model::MPressureOcclusion &vData) __attribute_warn_unused_result__; - bool pressureOcclusionData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - // ---- Treatment Ranges - bool treatmentRangesData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ---- Create Treatment Response Data + bool createTreatmentRespData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - // ---- Treatment Adjust response for Blood/Dialysate Flow Rate - bool adjustBloodDialysateData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - - // ---- Treatment Adjust response for Treatment Duration - bool adjustDurationData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - - // ---- Treatment Adjust response for Treatment Ultrafiltration - bool adjustUltrafiltrationData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - - // ---- Treatment Adjust response for Treatment Ultrafiltration state (Pause / Resume) change - bool ultrafiltrationState (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - public: explicit MessageInterpreter(QObject *parent = nullptr); @@ -102,7 +87,6 @@ signals: ACTION_RECEIVE_SIGNALS -public slots: }; }