#include "readthread.h" ReadThread::ReadThread(InputManager* input, const QList &channels, quint64 interval, QObject *parent) : QThread(parent) , m_input(input) , m_channels(channels) , m_interval(interval) { qRegisterMetaType("InputValues"); } void ReadThread::run() { while (true) { InputValues values; foreach (auto channel, m_channels) values.append(QPair(channel, m_input->read(channel))); emit newValues(values, getTime()); usleep(m_interval); } }