MCPcopy Create free account
hub / github.com/analogdevicesinc/scopy / setRawSamplesPtr

Method setRawSamplesPtr

tmp/grutil/src/grtimeplotaddon.cpp:277–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void 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
328void GRTimePlotAddon::replot()
329{

Callers

nothing calls this directly

Calls 11

signalPathMethod · 0.80
plotChMethod · 0.80
enabledMethod · 0.45
valueMethod · 0.45
nameMethod · 0.45
curveMethod · 0.45
dataMethod · 0.45
onNewDataMethod · 0.45
setSamplesMethod · 0.45
freqMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected