Changeset 200 in pacpusframework


Ignore:
Timestamp:
Oct 28, 2013, 2:39:22 PM (11 years ago)
Author:
Marek Kurdej
Message:

Fixed: unnecessary QThread dependency.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/kernel/InputOutputBase.h

    r199 r200  
    77#include <Pacpus/kernel/PacpusLibConfig.h>
    88
    9 #include <QApplication>
    109#include <QList>
     10#include <QString>
    1111#include <QStringList>
    1212#include <typeinfo>
     13
     14class QByteArray;
    1315
    1416namespace pacpus {
  • trunk/include/Pacpus/kernel/InputOutputInterface.h

    r199 r200  
    55#include <Pacpus/kernel/Log.h>
    66
     7#include <QApplication>
    78#include <QByteArray>
    8 //#include <QThread>
     9#include <QCoreApplication>
    910#include <typeinfo>
    1011
     
    5455            PacpusTypedEvent<T> * typedEvent = dynamic_cast<PacpusTypedEvent<T> *> (event);
    5556
    56             LOG_DEBUG("Receiver " << getSignature() << " thread " << QThread::currentThread());
     57            LOG_DEBUG("Receiver: " << getSignature());
    5758
    5859            if (typedEvent->timerange() < 500 && readingMode() == TimeBounded) {
     
    6566
    6667                if (road_time() - typedEvent->time() > typedEvent->timerange()) {
    67                     LOG_DEBUG("Data skip " << this->getSignature());
     68                    LOG_DEBUG("Data skipped, receiver: " << this->getSignature());
    6869                    break;
    6970                }
     
    145146    //QSharedPointer<T> sharedPointer = new T(data);
    146147
    147     for (QList<ConnectionBase>::iterator it = connections().begin(); it != connections().end(); ++it) {
    148         QApplication::postEvent(it->getInterface(),new PacpusTypedEvent<T>(TYPED_EVENT,data,t,tr),it->getPriority()); // Event is delete by the event loop handler
    149         //qDebug() << "sender " << it->getInterface()->getSignature() <<  " thread " << QThread::currentThread() << " Data & " << &data << " ";
     148    for (QList<ConnectionBase>::iterator it = connections().begin(), itend = connections().end(); it != itend; ++it) {
     149        // Event is deleted by the event loop handler
     150        QApplication::postEvent(it->getInterface(), new PacpusTypedEvent<T>(TYPED_EVENT,data,t,tr),it->getPriority());
     151        //qDebug() << "sender " << it->getInterface()->getSignature() << " Data & " << &data << " ";
    150152    }
    151153}
  • trunk/src/PacpusLib/InputOutputBase.cpp

    r197 r200  
    55#include <Pacpus/kernel/InputOutputInterface.h>
    66#include <Pacpus/kernel/Log.h>
     7
     8#include <QApplication>
    79
    810using namespace pacpus;
Note: See TracChangeset for help on using the changeset viewer.