// ************************************************************************** // // @RDE_HEADER@ // // ************************************************************************** // // $HeadURL$ // $LastChangedBy$ // $LastChangedDate$ // $LastChangedRevision$ // // Implementation of the Class PrtCnvRadioTrafficThread // ************************************************************************** #pragma once #include "PrtCnvThread.hpp" #include "PrtCnvRadioThread.hpp" #include #include namespace PrtCnv { /** * This class handles the traffic counting for the * incoming radio data */ class PrtCnvRadioTrafficThread final : public PrtCnvThread { Q_OBJECT public: explicit PrtCnvRadioTrafficThread(PrtCnvThreadStarter* a_parent); /** * A new telegram arrived. */ void newTelegramArrived(unsigned int size); /** * Start the thread handling */ int32_t start() override; protected Q_SLOTS: /** * Timeout to recalculate traffic load */ void onCalculateTrafficLoad(); /** * Timeout to throw away old data */ void onCleanupTimeout(); protected: /** * The current traffic load */ PrtCnvRadioThread::E_TrafficLoad m_receiveLoad; /** * Full load */ unsigned int m_fullLoad; /** * High load */ unsigned int m_highLoad; /** * Hysterese */ unsigned int m_hystLoad; /** * Timeout for recalculation */ int m_calcTimeout; /** * Timeout until data is thrown away */ int m_cleanupTimeout; /** * Data access mutex */ QMutex m_mutex; /** * map */ QMap m_data; QMap m_telegrams; }; } // namespace PrtCnv