Index: sources/model/hd/adjustment/settings/MAdjustHDRequests.h =================================================================== diff -u -r4a67c01045f365be38f1a12a8572c0070d343e1e -r38ae7b93679d05a54fc460dac68891562d7da72d --- sources/model/hd/adjustment/settings/MAdjustHDRequests.h (.../MAdjustHDRequests.h) (revision 4a67c01045f365be38f1a12a8572c0070d343e1e) +++ sources/model/hd/adjustment/settings/MAdjustHDRequests.h (.../MAdjustHDRequests.h) (revision 38ae7b93679d05a54fc460dac68891562d7da72d) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2021-2022 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2024 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) 10-Aug-2021 + * \author (last) Dara Navaei + * \date (last) 06-May-2024 * \author (original) Behrouz NematiPour * \date (original) 16-Apr-2021 * @@ -38,9 +38,9 @@ * \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 | + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * | 0x6d00 | 0x100 | Req | Y | UI | HD | Set RTC Date and Time | * * | Payload || * | || @@ -74,14 +74,27 @@ * */ class MAdjustHDAlarmVolumeReq : public MModel { + + const int hw2ui = 1; // HD vol range is [1-5]; set to 20 if we show [20%-100%] to user (100 / 5). + quint32 _volume = 5; // HD vol range is [1-5]; set to 100 if we show [20%-100%] since values in range of [20, 40, 60, 80, 100] or [1..5]*20 + public: - quint32 volume; + quint32 volume2HD() const { + return _volume / hw2ui; + } + quint32 volume() { + return _volume; + } + void volume(quint32 vVolume) { + _volume = vVolume; + } + // disabled 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 } ); + return toString( { _volume } ); } // disabled coco end static QString toString(const QVariantList &vParameters) { @@ -127,7 +140,7 @@ } // disabled coco end static QString toString(const QVariantList &vParameters) { - return MModel::toString("VersionReq", vParameters); + return MModel::toString("POSTInfReq", vParameters); } static Can::Can_Id canid () { return Can::eChlid_UI_Sync; } @@ -159,8 +172,9 @@ static Can::Can_Id canid () { return Can::Can_Id::eChlid_UI_HD; } }; + /*! - * \brief The MAdjustServiceReq class + * \brief The MAdjustServiceDatesReq class * \details The DG/HD versions request model * * | MSG | CAN ID | Type | Ack | Src | Dest | Description | @@ -172,7 +186,7 @@ * | (N/A) || * */ -class MAdjustServiceReq : public MModel { +class MAdjustServiceDatesReq : public MModel { public: // disabled coco begin validated : Has been validated manually. @@ -190,6 +204,36 @@ /*! + * \brief The MAdjustServiceModeReq class + * \details The HD Service Mode request model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * | 0xB000 | 0x100 | Req | Y | UI | HD | Service Mode Request | + * + * | Payload || + * | || + * | (N/A) || + * + */ +class MAdjustServiceModeReq : public MModel { +public: + + // disabled coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString({}); + } + // disabled coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("ServiceMode", vParameters); + } + + static Can::Can_Id canid () { return Can::eChlid_UI_HD; } +}; + + +/*! * \brief The MAdjustUIPostFinalResultReq class * \details The UI power on self test result model * @@ -217,11 +261,102 @@ return MModel::toString("UIPOSTDone", vParameters); } }; + +/*! + * \brief The MHDUsageInfoRequest class + * \details The HD usage info request model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:----:|:---:|:---:|:----:|:---------------------------:| + * | 0xA000 | 0x040 | Req | Y | HD | UI | HD Request for Usage Info | + * + * | Payload || + * | || + * | (N/A) || + * + */ +class MHDUsageInfoReq : public MModel { +public: + + // disabled coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString({}); + } + // disabled coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("HDUsageInfoReq", vParameters); + } + + static Can::Can_Id canid () { return Can::eChlid_UI_Sync; } +}; + +/*! + * \brief The MAdjustInstitutionalReqclass + * \details The HD Service Mode request model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:----:|:---:|:---:|:----:|:-----------:| + * | 0x8900 | 0x100 | Req | Y | UI | HD | Institutional Record Request | + * + * | Payload || + * | || + * | (N/A) || + * + */ +class MAdjustInstitutionalRecordReq : public MModel { +public: + + // disabled coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString({}); + } + // disabled coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("InstitutionalRecord", vParameters); + } + + static Can::Can_Id canid () { return Can::eChlid_UI_HD; } +}; + +/*! + * \brief The MAdjustHDResetReq class + * \details The DG/HD versions request model + * + * | MSG | CAN ID | Type | Ack | Src | Dest | Description | + * |:------:|:------:|:----:|:---:|:---:|:----:|:---------------------------:| + * | 0xB900 | 0x200 | Req | Y | UI | All | HD reset request | + * + * | Payload || + * | || + * | (N/A) || + * + */ +class MAdjustHDResetInSrvceModeReq : public MModel { +public: + + // disabled coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString({}); + } + // disabled coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("HDResetInServiceMode", vParameters); + } + + static Can::Can_Id canid () { return Can::eChlid_UI_HD; } +}; } -typedef Model:: MAdjustVersionsReq AdjustVersionsRequestData; -typedef Model:: MAdjustVersionsRsp AdjustVersionsResponseData; -typedef Model:: MAdjustServiceReq AdjustServiceRequestData; -typedef Model:: MAdjustHDDateTimeReq AdjustHDDateTimeRequestData; -typedef Model:: MAdjustHDAlarmVolumeReq AdjustHDAlarmVolumeRequestData; -typedef Model::MAdjustUIPostFinalResultReq AdjustUIPostFinalResultRequestData; +typedef Model:: MAdjustServiceModeReq AdjustServiceModeRequestData; +typedef Model:: MAdjustVersionsReq AdjustVersionsRequestData; +typedef Model:: MAdjustVersionsRsp AdjustVersionsResponseData; +typedef Model:: MAdjustServiceDatesReq AdjustServiceDatesRequestData; +typedef Model:: MAdjustHDDateTimeReq AdjustHDDateTimeRequestData; +typedef Model:: MAdjustHDAlarmVolumeReq AdjustHDAlarmVolumeRequestData; +typedef Model:: MAdjustUIPostFinalResultReq AdjustUIPostFinalResultRequestData; +typedef Model:: MHDUsageInfoReq HDUsageInfoRequestData; +typedef Model::MAdjustInstitutionalRecordReq AdjustInstitutionalRequestData; +typedef Model:: MAdjustHDResetInSrvceModeReq AdjustHDResetInSrvcRequestData;