/*! * * 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 MHDSyringePumpData.cpp * \author (last) Behrouz NematiPour * \author (original) Behrouz NematiPour * \date (last) 29-Jul-2021 * \date (original) 29-Jul-2021 * */ #include "MHDSyringePumpData.h" using namespace Model; QVariantList MHDSyringePump::parameters() const { return { _data.mSyringePumpState .value, _data.mHeparinState .value, _data.mSetRate .value, _data.mMeasuredRate .value, _data.mSyringePumpPosition .value, _data.mVolumeDelivered .value, _data.mMeasuredHome .value, _data.mMeasuredSwitch .value, _data.mMeasuredForce .value, _data.mSafetyVol .value, _data.mStatus .value, }; } bool MHDSyringePump::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position if (GetValue(vByteArray, index, _data.mSyringePumpState )) if (GetValue(vByteArray, index, _data.mHeparinState )) if (GetValue(vByteArray, index, _data.mSetRate )) if (GetValue(vByteArray, index, _data.mMeasuredRate )) if (GetValue(vByteArray, index, _data.mSyringePumpPosition )) if (GetValue(vByteArray, index, _data.mVolumeDelivered )) if (GetValue(vByteArray, index, _data.mMeasuredHome )) if (GetValue(vByteArray, index, _data.mMeasuredSwitch )) if (GetValue(vByteArray, index, _data.mMeasuredForce )) if (GetValue(vByteArray, index, _data.mSafetyVol )) if (GetValue(vByteArray, index, _data.mStatus )) 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; } else { if(vIndex) *vIndex = index; return false; } } MHDSyringePump::Data MHDSyringePump::data() const { Data data; data.mSyringePumpState = _data.mSyringePumpState .value; data.mHeparinState = _data.mHeparinState .value; data.mSetRate = _data.mSetRate .value; data.mMeasuredRate = _data.mMeasuredRate .value; data.mSyringePumpPosition = _data.mSyringePumpPosition.value; data.mVolumeDelivered = _data.mVolumeDelivered .value; data.mMeasuredHome = _data.mMeasuredHome .value; data.mMeasuredSwitch = _data.mMeasuredSwitch .value; data.mMeasuredForce = _data.mMeasuredForce .value; data.mSafetyVol = _data.mSafetyVol .value; data.mStatus = _data.mStatus .value; return data; }