mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-15 05:22:53 +08:00
Use queued signals/slots for widgets
This commit is contained in:
parent
16a1b4b284
commit
8ff38efca4
@ -98,9 +98,10 @@ Console::Console()
|
||||
// Read received data automatically
|
||||
const auto dm = Manager::getInstance();
|
||||
const auto te = Misc::TimerEvents::getInstance();
|
||||
connect(te, SIGNAL(highFreqTimeout()), this, SLOT(displayData()));
|
||||
connect(dm, &Manager::dataSent, this, &Console::onDataSent);
|
||||
connect(dm, &Manager::dataReceived, this, &Console::onDataReceived);
|
||||
connect(te, SIGNAL(highFreqTimeout()), this, SLOT(displayData()),
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,8 @@ Server::Server()
|
||||
const auto ge = JSON::Generator::getInstance();
|
||||
const auto te = Misc::TimerEvents::getInstance();
|
||||
connect(ge, &JSON::Generator::jsonChanged, this, &Server::registerFrame);
|
||||
connect(te, &Misc::TimerEvents::highFreqTimeout, this, &Server::sendProcessedData);
|
||||
connect(te, &Misc::TimerEvents::highFreqTimeout, this, &Server::sendProcessedData,
|
||||
Qt::QueuedConnection);
|
||||
|
||||
// Send I/O "raw" data directly
|
||||
const auto io = IO::Manager::getInstance();
|
||||
|
@ -48,10 +48,13 @@ Dashboard::Dashboard()
|
||||
const auto io = IO::Manager::getInstance();
|
||||
const auto ge = JSON::Generator::getInstance();
|
||||
const auto te = Misc::TimerEvents::getInstance();
|
||||
connect(cp, SIGNAL(openChanged()), this, SLOT(resetData()));
|
||||
connect(te, SIGNAL(highFreqTimeout()), this, SLOT(updateData()));
|
||||
connect(io, SIGNAL(connectedChanged()), this, SLOT(resetData()));
|
||||
connect(ge, SIGNAL(jsonFileMapChanged()), this, SLOT(resetData()));
|
||||
connect(cp, SIGNAL(openChanged()), this, SLOT(resetData()), Qt::QueuedConnection);
|
||||
connect(te, SIGNAL(highFreqTimeout()), this, SLOT(updateData()),
|
||||
Qt::QueuedConnection);
|
||||
connect(io, SIGNAL(connectedChanged()), this, SLOT(resetData()),
|
||||
Qt::QueuedConnection);
|
||||
connect(ge, SIGNAL(jsonFileMapChanged()), this, SLOT(resetData()),
|
||||
Qt::QueuedConnection);
|
||||
connect(ge, &JSON::Generator::jsonChanged, this, &Dashboard::processLatestJSON);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ Accelerometer::Accelerometer(const int index)
|
||||
setWidget(&m_gauge);
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -82,8 +82,8 @@ Bar::Bar(const int index)
|
||||
setWidget(&m_thermo, Qt::AlignHCenter, false);
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(this, SIGNAL(resized()), this, SLOT(onResized()));
|
||||
connect(this, SIGNAL(resized()), this, SLOT(onResized()), Qt::QueuedConnection);
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,7 +70,7 @@ Compass::Compass(const int index)
|
||||
setWidget(&m_compass);
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(update()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(update()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -152,7 +152,7 @@ DataGroup::DataGroup(const int index)
|
||||
setLayout(m_mainLayout);
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -131,7 +131,7 @@ FFTPlot::FFTPlot(const int index)
|
||||
}
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -102,7 +102,7 @@ GPS::GPS(const int index)
|
||||
setLayout(&m_layout);
|
||||
|
||||
// React to Qt signals
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,7 +73,7 @@ Gauge::Gauge(const int index)
|
||||
setWidget(&m_gauge);
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,7 +59,7 @@ Gyroscope::Gyroscope(const int index)
|
||||
m_timer.start();
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -125,7 +125,7 @@ LEDPanel::LEDPanel(const int index)
|
||||
setLayout(m_mainLayout);
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,8 +118,9 @@ MultiPlot::MultiPlot(const int index)
|
||||
m_plot.show();
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(pointsChanged()), this, SLOT(updateRange()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
connect(dash, SIGNAL(pointsChanged()), this, SLOT(updateRange()),
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -117,8 +117,9 @@ Plot::Plot(const int index)
|
||||
}
|
||||
|
||||
// React to dashboard events
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()));
|
||||
connect(dash, SIGNAL(pointsChanged()), this, SLOT(updateRange()));
|
||||
connect(dash, SIGNAL(updated()), this, SLOT(updateData()), Qt::QueuedConnection);
|
||||
connect(dash, SIGNAL(pointsChanged()), this, SLOT(updateRange()),
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user