/*! * * Copyright (c) 2020-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 MHDBloodLeakData.cpp * \author (last) Michael Gathwaite * \date (last) 23-Feb-2022 * \author (original) Michael Garthwaite * \date (original) 23-Feb-2022 * */ #include "MHDBloodLeakData.h" using namespace Model; QVariantList MHDBloodLeakData::parameters() const { return { _data.mBloodLeakStatus .value, _data.mBloodLeakState .value, _data.mBloodLeakZeroStatusCounter.value, _data.mBloodLeakCounter .value, _data.mBloodLeakZeroedStatus .value, _data.mBloodLeakDetectSetPoint .value, _data.mBloodLeakDetectLevel .value, _data.mBloodLeakStatusCount .value, _data.mBloodLeakLEDIntensity .value, _data.mBloodLeakRegisterCounter .value, }; } bool MHDBloodLeakData::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position if (GetValue(vByteArray, index, _data.mBloodLeakStatus )) if (GetValue(vByteArray, index, _data.mBloodLeakState )) if (GetValue(vByteArray, index, _data.mBloodLeakZeroStatusCounter )) if (GetValue(vByteArray, index, _data.mBloodLeakCounter )) if (GetValue(vByteArray, index, _data.mBloodLeakZeroedStatus )) if (GetValue(vByteArray, index, _data.mBloodLeakDetectSetPoint )) if (GetValue(vByteArray, index, _data.mBloodLeakDetectLevel )) if (GetValue(vByteArray, index, _data.mBloodLeakStatusCount )) if (GetValue(vByteArray, index, _data.mBloodLeakLEDIntensity )) if (GetValue(vByteArray, index, _data.mBloodLeakRegisterCounter )) return true ; else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } } /*! * \brief MHDBloodLeakData::Data * \details Provides model's Data from the received messages data values * \return Data */ MHDBloodLeakData::Data MHDBloodLeakData::data() const{ Data data; data.mBloodLeakStatus = _data.mBloodLeakStatus .value; data.mBloodLeakState = _data.mBloodLeakState .value; data.mBloodLeakZeroStatusCounter= _data.mBloodLeakZeroStatusCounter.value; data.mBloodLeakCounter = _data.mBloodLeakCounter .value; data.mBloodLeakZeroedStatus = _data.mBloodLeakZeroedStatus .value; data.mBloodLeakDetectSetPoint = _data.mBloodLeakDetectSetPoint .value; data.mBloodLeakDetectLevel = _data.mBloodLeakDetectLevel .value; data.mBloodLeakStatusCount = _data.mBloodLeakStatusCount .value; data.mBloodLeakLEDIntensity = _data.mBloodLeakLEDIntensity .value; data.mBloodLeakRegisterCounter = _data.mBloodLeakRegisterCounter .value; return data; }