<commit_before>#include "canconmanager.h"


CANConManager* CANConManager::mInstance = NULL;

CANConManager* CANConManager::getInstance()
{
    if(!mInstance)
        mInstance = new CANConManager();

    return mInstance;
}


CANConManager::CANConManager(QObject *parent): QObject(parent)
{
    connect(&mTimer, SIGNAL(timeout()), this, SLOT(refreshCanList()));
    mTimer.setInterval(500); /*tick twice a second */
    mTimer.setSingleShot(false);
    mTimer.start();
}


CANConManager::~CANConManager()
{
    mTimer.stop();
    mInstance = NULL;
}


void CANConManager::add(CANConnection* pConn_p)
{
    connect(pConn_p, SIGNAL(notify()), this, SLOT(refreshCanList()));
    mConns.append(pConn_p);
}


void CANConManager::remove(CANConnection* pConn_p)
{
    disconnect(pConn_p, 0, this, 0);
    mConns.removeOne(pConn_p);
}


void CANConManager::refreshCanList()
{
    QObject* sender_p = QObject::sender();
<commit_msg>change refresh rate to 250ms<commit_after>#include "canconmanager.h"


CANConManager* CANConManager::mInstance = NULL;

CANConManager* CANConManager::getInstance()
{
    if(!mInstance)
        mInstance = new CANConManager();

    return mInstance;
}


CANConManager::CANConManager(QObject *parent): QObject(parent)
{
    connect(&mTimer, SIGNAL(timeout()), this, SLOT(refreshCanList()));
    mTimer.setInterval(250); /*tick 4 times a second */
    mTimer.setSingleShot(false);
    mTimer.start();
}


CANConManager::~CANConManager()
{
    mTimer.stop();
    mInstance = NULL;
}


void CANConManager::add(CANConnection* pConn_p)
{
    connect(pConn_p, SIGNAL(notify()), this, SLOT(refreshCanList()));
    mConns.append(pConn_p);
}


void CANConManager::remove(CANConnection* pConn_p)
{
    disconnect(pConn_p, 0, this, 0);
    mConns.removeOne(pConn_p);
}


void CANConManager::refreshCanList()
{
    QObject* sender_p = QObject::sender();

{'fraction_non_alphanumeric': 0.14492753623188406, 'fraction_numerical': 0.007514761137949544, 'mean_word_length': 5.0519480519480515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5298191', 'n_tokens_mistral': 667, 'n_tokens_neox': 638, 'n_words': 109}