/*! * * Copyright (c) 2022-2025 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 MTDValvesData.h * \author (original) Tiffany Mejia * \date (original) 07-May-2025 * */ #pragma once // Qt #include // Project #include "MAbstract.h" #include "types.h" // forward declarations class tst_models; namespace Model { /*! * \brief The MTDValvesData class * \details The TD Valves data model * * | MSG | CAN ID | Type | Ack | Src | Dst | Description | * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------: | * |0x2B00| 0x100 | 1 Hz | N | TD | All | TD Valves Data | * * | Payload || * | || * | #1:(U32) | \ref Data::mValveId | * | #2:(U32) | \ref Data::mState | * | #3:(U32) | \ref Data::mCurrPosID | * | #4:(S16) | \ref Data::mCurrPos | * | #5:(S16) | \ref Data::mCmdPos | * | #6:(S16) | \ref Data::mPosA | * | #7:(S16) | \ref Data::mPosB | * | #8:(S16) | \ref Data::mPosC | * | #9:(S16) | \ref Data::mPosD | * |#10:(S16) | \ref Data::mMaxHomingPos | * * \sa Data * *

Logging info

* | || * | || * | typeText | Datum | * | unitText | TD | * | infoText | Valves | * */ class MTDValvesData : public MAbstract { // friends friend class ::tst_models; QVariantList parameters() const override; struct { Types::U32 mValveId ; Types::U32 mState ; Types::U32 mCurrPosID ; Types::S16 mCurrPos ; Types::S16 mCmdPos ; Types::S16 mPosA ; Types::S16 mPosB ; Types::S16 mPosC ; Types::S16 mPosD ; Types::S16 mMaxHomingPos ; } _data; public: Type_Enum typeText() const override { return Type_Enum::eDatum ; } Unit_Enum unitText() const override { return Unit_Enum::eTD ; } QString infoText() const override { return QString("Valves") ; } struct Data { quint32 mValveId = 0; quint32 mState = 0; quint32 mCurrPosID = 0; qint16 mCurrPos = 0; qint16 mCmdPos = 0; qint16 mPosA = 0; qint16 mPosB = 0; qint16 mPosC = 0; qint16 mPosD = 0; qint16 mMaxHomingPos = 0; }; MTDValvesData () { } bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; Data data ( ) const ; }; } typedef Model::MTDValvesData::Data TDValvesData;