/*! * * 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 MDGDrainPumpData.cpp * \date 7/2/2020 * \author Behrouz NematiPour * */ #include "MDGDrainPumpData.h" using namespace Model; QVariantList MDGDrainPump::parameters() const { return { _data.mRPM .value, _data.mDAC .value }; } bool MDGDrainPump::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position if (GetValue(vByteArray, index, _data.mRPM )) if (GetValue(vByteArray, index, _data.mDAC )) return true ; else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } } MDGDrainPump::Data MDGDrainPump::data() const { Data data; data.mRPM = _data.mRPM .value; data.mDAC = _data.mDAC .value; return data; }