summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-18 11:19:34 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-18 11:21:00 +0200
commitc4b79a524dab6a40a5de13952f6e6083d0efe682 (patch)
treeda5deaf0b74abaaddbc8099238cdc61724d75e26
parentad3901e4d4974117929560e4cc5eef4c679b073a (diff)
tracker/hatire: fix runtime qt threading warn in replay mode
-rw-r--r--tracker-hatire/thread.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tracker-hatire/thread.cpp b/tracker-hatire/thread.cpp
index 31779d17..85e3f772 100644
--- a/tracker-hatire/thread.cpp
+++ b/tracker-hatire/thread.cpp
@@ -132,12 +132,14 @@ void hatire_thread::run()
com_port.setFileName(HATIRE_DEBUG_LOGFILE);
com_port.open(QIODevice::ReadOnly);
- connect(&read_timer, &QTimer::timeout, this, &hatire_thread::on_serial_read);
read_timer.start(10);
+ connect(&read_timer, &QTimer::timeout, this, &hatire_thread::on_serial_read, Qt::DirectConnection);
#else
connect(&com_port, &serial_t::readyRead, this, &hatire_thread::on_serial_read);
#endif
(void) exec();
+
+ read_timer.stop();
}
serial_result hatire_thread::init_serial_port_impl()
@@ -291,7 +293,7 @@ void hatire_thread::on_serial_read()
#else
QByteArray tmp = com_port.read(30);
data_read += tmp;
- if (tmp.length() == 0)
+ if (tmp.length() == 0 && read_timer.isActive())
{
qDebug() << "eof";
read_timer.stop();
@@ -302,7 +304,7 @@ void hatire_thread::on_serial_read()
stat.input(timer.elapsed_ms());
timer.start();
- if (throttle_timer.elapsed_ms() >= 1000)
+ if (throttle_timer.elapsed_ms() >= 3000)
{
throttle_timer.start();
qDebug() << "stat:" << "avg" << stat.avg() << "stddev" << stat.stddev();