/*! * * 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 MAdjustHDRequests.h * \author (last) Behrouz NematiPour * \date (last) 16-Apr-2021 * \author (original) Behrouz NematiPour * \date (original) 16-Apr-2021 * */ #pragma once // Qt // FW #include "Compatible.h" // project #include "MAdjustRequestsBase.h" using namespace Gui; namespace Model { /*! * Simple request models * These are models to send the request for the doAdjustment * The the only reason thy have been defined to help overloading the adjustment methods * Otherwise the parameters are so tiny models. */ /*! * \brief The MAdjustHDDateTime class * \details The model to request starting a treatment * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:----:|:------:|:----:|:---:|:---:|:----:|:-----------:| * | 109 | 0x100 | Req | Y | UI | HD | Set RTC Date and Time | * * | Payload || * | || * | #1:(U32) mEpoch | \ref mEpoch | * */ class MAdjustHDDateTimeReq : public MModel { public: quint32 mEpoch; // coco begin validated : Has been validated manually. QString toString() { return toString({mEpoch}); } // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustHDDateTime", vParameters); } }; /*! * \brief The MAdjustAlarmVolumeReq class * \details The HD alarm volume request model * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------:| * | 0x4E00 | 0x100 | Req | Y | UI | HD | HD Set Alarm Volume Request | * * | Payload || * | || * | #1:(U32) volume | \ref MAdjustHDAlarmVolumeResponse | * */ class MAdjustHDAlarmVolumeReq : public MModel { public: quint32 volume; // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { return toString( { volume } ); } // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustHDAlarmVolume", vParameters); } }; /*! * \brief The MAdjustVersionsReq class * \details The DG/HD versions request model * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------:| * | 0x1C00 | 0x200 | Req | Y | UI | All | DG/HD Versions/SN Request | * * | Payload || * | || * | #1:(U08) | major | * | #2:(U08) | minor | * | #3:(U08) | micro | * | #4:(U16) | revision(build) | * | #5:(U32) | compatibility | * */ class MAdjustVersionsReq : public MModel { public: quint8 ver_major = QString("%1").arg(VER_MAJOR ).toUInt(); quint8 ver_minor = QString("%1").arg(VER_MINOR ).toUInt(); quint8 ver_micro = QString("%1").arg(VER_MICRO ).toUInt(); quint16 ver_revis = QString("%1").arg(VER_REVIS ).toUInt(); quint32 ver_comp = QString("%1").arg(SW_COMPATIBILITY_REV).toUInt(); // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({ ver_major , ver_minor , ver_micro , ver_revis , ver_comp , }); } // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("VersionReq", vParameters); } static Can::Can_Id canid () { return Can::eChlid_UI_Sync; } }; /*! * \brief The MAdjustVersionsRsp class * \details The UI versions response model * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------:| * | 0x9F00 | 0x200 | Rsp | Y | UI | HD | UI Versions/SN Response | * * | Payload || * | || * | #1:(U08) | major | * | #2:(U08) | minor | * | #3:(U08) | micro | * | #4:(U16) | revision(build) | * | #5:(U32) | compatibility | * */ class MAdjustVersionsRsp : public MAdjustVersionsReq { public: static QString toString(const QVariantList &vParameters) { return MModel::toString("VersionRsp", vParameters); } static Can::Can_Id canid () { return Can::Can_Id::eChlid_UI_HD; } }; /*! * \brief The MAdjustServiceReq class * \details The DG/HD versions request model * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:------:|:------:|:----:|:---:|:---:|:----:|:---------------------------:| * | 0x8900 | 0x200 | Req | Y | UI | All | DG/HD Service Dates Request | * * | Payload || * | || * | (N/A) || * */ class MAdjustServiceReq : public MModel { public: // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({}); } // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("ServiceDates", vParameters); } static Can::Can_Id canid () { return Can::eChlid_UI_Sync; } }; /*! * \brief The MAdjustUIPostFinalResultRequest class * \details The UI power on self test result model * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------:| * | 0x9200 | 0x100 | Req | Y | UI | HD | Report UI POST result | * * | Payload || * | || * | #1:(U32) mResult | \ref mResult | * */ class MAdjustUIPostFinalResultReq : public MModel { public: quint32 mResult; // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { return toString( { mResult } ); } // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("UIPOSTDone", vParameters); } }; } typedef Model:: MAdjustVersionsReq AdjustVersionsRequestData; typedef Model:: MAdjustVersionsRsp AdjustVersionsResponseData; typedef Model:: MAdjustServiceReq AdjustServiceRequestData; typedef Model:: MAdjustHDDateTimeReq AdjustHDDateTimeRequestData; typedef Model:: MAdjustHDAlarmVolumeReq AdjustHDAlarmVolumeRequestData; typedef Model::MAdjustUIPostFinalResultReq AdjustUIPostFinalResultRequestData;