14 QStringList words_list;
15 words_list <<
"siam" <<
"tre" <<
"piccoli" <<
"porcellin" 16 <<
"mai" <<
"nessun" <<
"ci" <<
"dividera" <<
"_sin" <<
"_cos";
18 int N = words_list.size();
20 foreach(
const QString&
name, words_list)
29 else if (name ==
"_cos"){
36 param.
A = qrand()/(double)RAND_MAX * 6 - 3;
37 param.
B = qrand()/(double)RAND_MAX *3;
38 param.
C = qrand()/(double)RAND_MAX *3;
39 param.
D = qrand()/(double)RAND_MAX *2 -1;
42 const std::string name_str = name.toStdString();
45 _parameters.insert( std::make_pair( name_str, param) );
83 std::lock_guard<std::mutex> lock(
mutex() );
85 using namespace std::chrono;
86 static std::chrono::high_resolution_clock::time_point initial_time = high_resolution_clock::now();
87 const double offset = duration_cast< duration<double>>( initial_time.time_since_epoch() ).count() ;
89 auto now = high_resolution_clock::now();
92 if( it.first ==
"empty")
continue;
95 auto& plot = it.second;
96 const double t = duration_cast< duration<double>>( now - initial_time ).count() ;
97 double y = par.A*sin(par.B*t + par.C) + par.D*t*0.05;
99 plot.pushBack( PlotData::Point( t + offset, y ) );
109 std::this_thread::sleep_for ( std::chrono::milliseconds(10) );
std::map< std::string, Parameters > _parameters
virtual bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
PlotDataMapRef & dataMap()
virtual bool start(QStringList *) override
TFSIMD_FORCE_INLINE const tfScalar & y() const
virtual const char * name() const override
virtual void shutdown() override
virtual bool isRunning() const override
virtual bool xmlLoadState(const QDomElement &parent_element) override
std::unordered_map< std::string, PlotData >::iterator addNumeric(const std::string &name)
virtual ~DataStreamSample()