/*! * * 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 VDGOperationModeData.cpp * \author (last) Behrouz NematiPour * \date (last) 08-Sep-2020 * \author (original) Behrouz NemaiPour * \date (original) 02-Jul-2020 * */ #include "VDGOperationModeData.h" // Project #include "GuiController.h" VIEW_DEF(VDGOperationMode, DGOperationModeData) void VDGOperationMode::onActionReceive(const DGOperationModeData &vData) { opMode ( vData.mOpMode ); } QString VDGOperationMode::opModeText(GuiDGOpModes 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)); const char *key = mo->enumerator(enumIdx).valueToKey(vEnum); if (key) return qPrintable(key); else return QString("UNDEFINED [%1]").arg(vEnum); } QString View::VDGOperationMode::text() { QString text = opModeText(static_cast(opMode())); return text; }