MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / do_decode_work

Method do_decode_work

DSView/pv/data/decoderstack.cpp:418–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418void DecoderStack::do_decode_work()
419{
420 //set the flag to exit from task thread
421 if (_stask_stauts){
422 _stask_stauts->_bStop = true;
423 }
424 _stask_stauts = new decode_task_status();
425 _stask_stauts->_bStop = false;
426 _stask_stauts->_decoder = this;
427 _decoder_status->clear(); //clear old items
428
429 if (!_options_changed)
430 {
431 dsv_err("ERROR:Decoder options have not changed.");
432 return;
433 }
434 _options_changed = false;
435
436 init();
437
438 _snapshot = NULL;
439
440 // Check that all decoders have the required channels
441 if (!check_required_probes()) {
442 _error_message = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DECODERSTACK_DECODE_WORK_ERROR),
443 "One or more required channels have not been specified");
444 dsv_err("ERROR:%s", _error_message.toStdString().c_str());
445 return;
446 }
447
448 // We get the logic data of the first channel in the list.
449 // This works because we are currently assuming all
450 // LogicSignals have the same data/snapshot
451 for (auto dec : _stack) {
452 if (dec->have_probes()) {
453 for(auto s : _session->get_signals()) {
454 if(s->get_index() == dec->first_probe_index() && s->signal_type() == SR_CHANNEL_LOGIC)
455 {
456 _snapshot = ((pv::view::LogicSignal*)s)->data();
457 if (_snapshot != NULL)
458 break;
459 }
460 }
461 if (_snapshot != NULL)
462 break;
463 }
464 }
465
466 if (_snapshot == NULL)
467 {
468 _error_message = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DECODERSTACK_DECODE_WORK_ERROR),
469 "One or more required channels have not been specified");
470 dsv_err("ERROR:%s", _error_message.toStdString().c_str());
471 return;
472 }
473
474 if (_session->is_realtime_refresh() == false && _snapshot->empty())
475 {

Callers

nothing calls this directly

Calls 10

have_probesMethod · 0.80
first_probe_indexMethod · 0.80
signal_typeMethod · 0.80
is_realtime_refreshMethod · 0.80
emptyMethod · 0.80
initFunction · 0.50
clearMethod · 0.45
get_indexMethod · 0.45
dataMethod · 0.45
samplerateMethod · 0.45

Tested by

no test coverage detected