MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / feed_in_analog

Method feed_in_analog

DSView/pv/sigsession.cpp:1341–1378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339 }
1340
1341 void SigSession::feed_in_analog(const sr_datafeed_analog &o)
1342 {
1343 if (_capture_data->get_analog()->memory_failed())
1344 {
1345 dsv_err("Unexpected analog packet");
1346 return; // This analog packet was not expected.
1347 }
1348
1349 if (_capture_data->get_analog()->last_ended())
1350 {
1351 // reset scale of analog signal
1352 for (auto s : _signals)
1353 {
1354 if (s->signal_type() == SR_CHANNEL_ANALOG){
1355 view::AnalogSignal *analogSig = (view::AnalogSignal*)s;
1356 analogSig->set_scale(analogSig->get_totalHeight());
1357 }
1358 }
1359
1360 // first payload
1361 _capture_data->get_analog()->first_payload(o, _device_agent.get_sample_limit(), _device_agent.get_channels());
1362 }
1363 else
1364 {
1365 // Append to the existing data snapshot
1366 _capture_data->get_analog()->append_payload(o);
1367 }
1368
1369 if (_capture_data->get_analog()->memory_failed())
1370 {
1371 _error = Malloc_err;
1372 _callback->session_error();
1373 return;
1374 }
1375
1376 set_receive_data_len(o.num_samples);
1377 _data_updated = true;
1378 }
1379
1380 void SigSession::data_feed_in(const struct sr_dev_inst *sdi,
1381 const struct sr_datafeed_packet *packet)

Callers

nothing calls this directly

Calls 11

memory_failedMethod · 0.80
get_analogMethod · 0.80
last_endedMethod · 0.80
signal_typeMethod · 0.80
get_totalHeightMethod · 0.80
get_sample_limitMethod · 0.80
get_channelsMethod · 0.80
session_errorMethod · 0.80
set_scaleMethod · 0.45
first_payloadMethod · 0.45
append_payloadMethod · 0.45

Tested by

no test coverage detected