/*! * * 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 vtreatmentadjustmentresponsebase.cpp * \date 3/29/2020 * \author Behrouz NematiPour * */ #include "vtreatmentadjustmentresponsebase.h" // Project #include "guicontroller.h" VIEW_DEF_CLASS(VTreatmentAdjustmentResponseBase) void VTreatmentAdjustmentResponseBase::initConnections() { } /*! * \brief VTreatmentAdjustmentResponseBase::reasonText * \details this code is the place holder for the alarms description mapping * since it is another feature * it returns the enum name for now * \param vEnum - The Rejection Reason enum * \return String representation of the Rejection Reason enum name */ QString VTreatmentAdjustmentResponseBase::reasonText(GuiRequestReasons vEnum) { // TEST : this code is the place holder for the alarms description mapping // since it is another feature // it returns the enum name for now const QMetaObject *mo = qt_getEnumMetaObject(vEnum); int enumIdx = mo->indexOfEnumerator(qt_getEnumName(vEnum)); QString mText = mo->enumerator(enumIdx).valueToKey(vEnum); if ( ! mText.isEmpty() ) { return mText; } return QString("[%1] Unknown Error").arg(vEnum); } /*! * \brief View::VTreatmentAdjustmentResponseBase::text * \details The slot to ge the Reason Description * \return Reason description as string */ QString View::VTreatmentAdjustmentResponseBase::text() { QString text; if (_adjustment_Reason != GuiRequestReasons::REQUEST_REJECT_REASON_NONE) text = reasonText(static_cast(_adjustment_Reason)); return text; }