/*! * * 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 maintimer.cpp * \author (last) Behrouz NematiPour * \date (last) 13-Apr-2020 * \author (original) Behrouz NematiPour * \date (original) 24-Sep-2019 * */ #include "maintimer.h" //Qt //Project #include "logger.h" #include "filehandler.h" /*! * \brief MainTimer::MainTimer * \details Constructor * \param parent - QObject parent owner object. * Qt handles the children destruction by their parent objects life-cycle. */ MainTimer::MainTimer(QObject *parent) : QObject(parent) { } /*! * \brief MainTimer::init * \details starts the timer ans sets the timer interval * \return */ bool MainTimer::init() { // coco begin validated: This is a fake data generator for CANBus missing/swapped frames Testing // will never be executed on the product // has been tested manually if (gFakeInterval) { startTimer(gFakeInterval); } // coco end else { startTimer(_interval); } LOG_EVENT(QObject::tr("Main Timer Initialized")); return true; } /*! * \brief MainTimer::quit * \details Does nothing for now */ void MainTimer::quit() { } /*! * \brief MainTimer::timerEvent * \details This event handler has been re-implemented in here * to receive timer events for the object * for the timer which has been set to _checkInterval * Emits the didTimeout signal on each interval. */ void MainTimer::timerEvent(QTimerEvent *) { emit didTimeout(); }