/*! * * 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. * * \file vview.h * \author (last) Behrouz NematiPour * \date (last) 13-Aug-2020 * \author (original) Behrouz NematiPour * \date (original) 10-Mar-2020 * */ #pragma once /*! * \page MessageView Denali Message View usage instruction in QML * \details This comment explains how to use a Denali Message populated data in Denali UI Application \verbatim 1 - Look at the message structure in the "message list.xlsx" 2 - View Implementation : Implement a view like VDGPressures by copy/paste the closest model .h/.cpp file and adding it to project and modify to fit the new model. 3 - Register View : - Add the required lines like the other models in the VView.h file. - Also add the #include in the GuiGlobals.cpp 4 - Usage in UI : Import : import VDGPressures 0.1; Instantiate : VDGPressures { id: vDGPressures } Access : value: vDGPressures.drainInletPSI \endverbatim */ //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// // The child declaration in header #define VIEW_DEC_CLASS(vCLASS) \ private: \ /*! \brief Connection Initializer \details All the class signal/slot connections are defined here. */\ void initConnections(); \ public: \ /*! \brief Class Constructor \details Only calls initConnections to initialize the signal/slot connection(s). \param parent - The QObject parent pointer which is passed as nullptr and is not set. */\ explicit vCLASS(QObject *parent = nullptr); \ //--------------------------------------------------------------------------------// #define VIEW_DEC_SLOT(vDATATYPE) \ private Q_SLOTS: \ /*! \brief Model data received message handler. \details When signal received this method is called to update the view properties. \param vData - Model data */\ void onActionReceive (const vDATATYPE &vData); \ //--------------------------------------------------------------------------------// #define VIEW_DEC(vCLASS, vDATATYPE) \ VIEW_DEC_CLASS(vCLASS) \ VIEW_DEC_SLOT(vDATATYPE) \ //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// // The child definition in cpp #define VIEW_DEF_CLASS(vCLASS) \ using namespace View; \ vCLASS::vCLASS(QObject *parent) : QObject(parent) { \ initConnections(); \ } \ //--------------------------------------------------------------------------------// #define VIEW_DEF_CONNECTION(vCLASS, vDATATYPE) \ void vCLASS::initConnections() { \ ACTION_RECEIVE_BRIDGE_CONNECTION( \ Gui::_GuiController, vDATATYPE); \ } \ //--------------------------------------------------------------------------------// #define VIEW_DEF(vCLASS, vDATATYPE) \ VIEW_DEF_CLASS(vCLASS) \ VIEW_DEF_CONNECTION(vCLASS, vDATATYPE) \ //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// // The Adjustment child definition in cpp #define VIEW_DEC_CLASS_ADJUSTMENT(vCLASS, vDATATYPE)\ VIEW_DEC_CLASS(vCLASS) \ VIEW_DEC_SLOT(vDATATYPE) \ //--------------------------------------------------------------------------------// #define VIEW_DEF_CLASS_ADJUSTMENT(vCLASS, vDATATYPE) \ using namespace View; \ vCLASS::vCLASS(QObject *parent) : VTreatmentAdjustmentResponseBase(parent) { \ initConnections(); \ } \ //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// //--------- Please add the view type to the lists below to register them ---------// //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// #define REGISTER_VIEW_TYPES \ using namespace View; \ \ REGISTER_TYPE( VAlarmStatus ) \ REGISTER_TYPE( VPowerOff ) \ \ REGISTER_TYPE( VTreatmentBloodFlow ) \ REGISTER_TYPE( VTreatmentDialysateFlow ) \ REGISTER_TYPE( VTreatmentUltrafiltration ) \ REGISTER_TYPE( VTreatmentPressureOcclusion ) \ REGISTER_TYPE( VTreatmentTime ) \ REGISTER_TYPE( VTreatmentRanges ) \ REGISTER_TYPE( VTreatmentSaline ) \ REGISTER_TYPE( VHDOperationMode ) \ REGISTER_TYPE( VHDTreatmentStates ) \ \ REGISTER_TYPE( VDGDrainPump ) \ REGISTER_TYPE( VDGHeaters ) \ REGISTER_TYPE( VDGLoadCellReadings ) \ REGISTER_TYPE( VDGOperationMode ) \ REGISTER_TYPE( VDGPressures ) \ REGISTER_TYPE( VDGROPump ) \ REGISTER_TYPE( VDGReservoir ) \ REGISTER_TYPE( VDGTemperatures ) \ REGISTER_TYPE( VDGValvesStates ) \ \ REGISTER_TYPE( VTreatmentAdjustmentDuration ) \ REGISTER_TYPE( VTreatmentAdjustmentFlows ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationState ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationEdit ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationConfirm ) \ REGISTER_TYPE( VTreatmentCreate ) \ REGISTER_TYPE( VPriming ) \ REGISTER_TYPE( VTreatmentBegin ) \ REGISTER_TYPE( VTreatmentEnd ) \ REGISTER_TYPE( VTreatmentAdjustmentSaline ) //--------------------------------------------------------------------------------//