/*! * * 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::mPosName | * | #4:(S16) | \ref Data::mPosCount | * | #5:(S16) | \ref Data::mNextPos | * * \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 mPosName ; Types::S16 mPosCount ; Types::S16 mNextPos ; } _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; ///< Valve ID quint32 mState = 0; ///< Valve State quint32 mPosName = 0; ///< Position Name qint16 mPosCount = 0; ///< Position Count qint16 mNextPos = 0; ///< Next Position }; MTDValvesData () { } bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; Data data ( ) const ; }; } typedef Model::MTDValvesData::Data TDValvesData;