16 for (
int i = 0; i < 150; i++)
18 auto str = QString(
"data_vect/%1").arg(i).toStdString();
20 param.
A = 6 * ((double)qrand() / (double)RAND_MAX) - 3;
21 param.
B = 3 * ((double)qrand() / (double)RAND_MAX);
22 param.
C = 3 * ((double)qrand() / (double)RAND_MAX);
23 param.
D = 20 * ((double)qrand() / (double)RAND_MAX);
24 _parameters.insert({str, param});
25 dataMap().addNumeric(str);
33 _thread = std::thread([
this]() { this->loop(); });
40 if (_thread.joinable())
66 std::lock_guard<std::mutex> lock(mutex());
68 using namespace std::chrono;
69 static auto initial_time = high_resolution_clock::now();
70 const double offset = duration_cast<duration<double>>(initial_time.time_since_epoch()).count();
72 auto now = high_resolution_clock::now();
73 for (
auto& it : dataMap().
numeric)
75 auto& plot = it.second;
76 const double t = duration_cast<duration<double>>(now - initial_time).count();
79 double val = param.
A*sin( param.
B*t + param.
C ) + param.
D;
89 auto prev = std::chrono::high_resolution_clock::now();
92 std::this_thread::sleep_until(prev + std::chrono::milliseconds(20));
virtual bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
virtual ~DataStreamSample() override
virtual bool start(QStringList *) override
virtual void shutdown() override
virtual bool isRunning() const override
virtual bool xmlLoadState(const QDomElement &parent_element) override
typename PlotDataBase< Value >::Point Point