| 275 | } |
| 276 | |
| 277 | void GRTimePlotAddon::setRawSamplesPtr() |
| 278 | { |
| 279 | int xy_xindex = -1; |
| 280 | int xy_yindex = -1; |
| 281 | int fft_iindex = -1; |
| 282 | int fft_qindex = -1; |
| 283 | |
| 284 | for(GRTimeChannelAddon *gr : qAsConst(grChannels)) { |
| 285 | if(gr->signalPath()->enabled()) { |
| 286 | |
| 287 | int index = time_channel_map.value(gr->signalPath()->name(), -1); |
| 288 | if(index != -1) { |
| 289 | |
| 290 | gr->plotCh()->curve()->setRawSamples(time_sink->time().data(), |
| 291 | time_sink->data()[index].data(), |
| 292 | time_sink->data()[index].size()); |
| 293 | |
| 294 | gr->onNewData(time_sink->time().data(), time_sink->data()[index].data(), |
| 295 | time_sink->data()[index].size()); |
| 296 | |
| 297 | if(gr == m_xy_source[0]) |
| 298 | xy_xindex = index; |
| 299 | if(gr == m_xy_source[1]) |
| 300 | xy_yindex = index; |
| 301 | if(gr == m_fft_source[0]) |
| 302 | fft_iindex = index; |
| 303 | if(gr == m_fft_source[1]) |
| 304 | fft_qindex = index; |
| 305 | |
| 306 | } else { |
| 307 | // gr->plotCh()->curve()->setRawSamples( |
| 308 | // {}); // assign no data curve |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | if(xy_xindex != -1 && xy_yindex != -1) { |
| 313 | m_xy_channel->curve()->setRawSamples(time_sink->data()[xy_xindex].data(), |
| 314 | time_sink->data()[xy_yindex].data(), |
| 315 | time_sink->data()[xy_yindex].size()); |
| 316 | |
| 317 | } else { |
| 318 | // m_xy_channel->curve()->setSamples(0,0,0); |
| 319 | } |
| 320 | if(vector_sink->data().size() > m_currentSamplingInfo.bufferSize) { |
| 321 | m_fft_channel->curve()->setSamples(time_sink->freq().data(), vector_sink->data().data(), |
| 322 | m_currentSamplingInfo.bufferSize); |
| 323 | vector_sink->reset(); |
| 324 | } |
| 325 | Q_EMIT newData(); |
| 326 | } |
| 327 | |
| 328 | void GRTimePlotAddon::replot() |
| 329 | { |