PulseView  0.3.0
A Qt-based sigrok GUI
pv::data::DecoderStack Class Reference

#include <decoderstack.hpp>

Inheritance diagram for pv::data::DecoderStack:
Collaboration diagram for pv::data::DecoderStack:

Signals

void new_decode_data ()
 

Public Member Functions

 DecoderStack (pv::Session &session_, const srd_decoder *const decoder)
 
virtual ~DecoderStack ()
 
const std::list< std::shared_ptr< decode::Decoder > > & stack () const
 
void push (std::shared_ptr< decode::Decoder > decoder)
 
void remove (int index)
 
double samplerate () const
 
const pv::util::Timestampstart_time () const
 
int64_t samples_decoded () const
 
std::vector< decode::Rowget_visible_rows () const
 
void get_annotation_subset (std::vector< pv::data::decode::Annotation > &dest, const decode::Row &row, uint64_t start_sample, uint64_t end_sample) const
 
QString error_message ()
 
void clear ()
 
uint64_t max_sample_count () const
 
void begin_decode ()
 

Private Slots

void on_new_frame ()
 
void on_data_received ()
 
void on_frame_ended ()
 

Private Member Functions

boost::optional< int64_t > wait_for_data () const
 
void decode_data (const int64_t sample_count, const unsigned int unit_size, srd_session *const session)
 
void decode_proc ()
 

Static Private Member Functions

static void annotation_callback (srd_proto_data *pdata, void *decoder)
 

Private Attributes

pv::Sessionsession_
 
pv::util::Timestamp start_time_
 
double samplerate_
 
std::list< std::shared_ptr< decode::Decoder > > stack_
 
std::shared_ptr< pv::data::LogicSegmentsegment_
 
std::mutex input_mutex_
 
std::condition_variable input_cond_
 
int64_t sample_count_
 
bool frame_complete_
 
std::mutex output_mutex_
 
int64_t samples_decoded_
 
std::map< const decode::Row, decode::RowDatarows_
 
std::map< std::pair< const srd_decoder *, int >, decode::Rowclass_rows_
 
QString error_message_
 
std::thread decode_thread_
 
std::atomic< bool > interrupt_
 

Static Private Attributes

static const double DecodeMargin = 1.0
 
static const double DecodeThreshold = 0.2
 
static const int64_t DecodeChunkLength = 4096
 
static const unsigned int DecodeNotifyPeriod = 65536
 
static std::mutex global_decode_mutex_
 

Friends

struct DecoderStackTest::TwoDecoderStack
 

Detailed Description

Definition at line 71 of file decoderstack.hpp.

Constructor & Destructor Documentation

pv::data::DecoderStack::DecoderStack ( pv::Session session_,
const srd_decoder *const  decoder 
)

Definition at line 62 of file decoderstack.cpp.

Here is the call graph for this function:

pv::data::DecoderStack::~DecoderStack ( )
virtual

Definition at line 82 of file decoderstack.cpp.

Member Function Documentation

void pv::data::DecoderStack::annotation_callback ( srd_proto_data *  pdata,
void *  decoder 
)
staticprivate

Definition at line 381 of file decoderstack.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::DecoderStack::begin_decode ( )

Definition at line 192 of file decoderstack.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::DecoderStack::clear ( )

Definition at line 182 of file decoderstack.cpp.

Here is the caller graph for this function:

void pv::data::DecoderStack::decode_data ( const int64_t  sample_count,
const unsigned int  unit_size,
srd_session *const  session 
)
private

Definition at line 293 of file decoderstack.cpp.

Here is the caller graph for this function:

void pv::data::DecoderStack::decode_proc ( )
private

Definition at line 328 of file decoderstack.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString pv::data::DecoderStack::error_message ( )

Definition at line 176 of file decoderstack.cpp.

void pv::data::DecoderStack::get_annotation_subset ( std::vector< pv::data::decode::Annotation > &  dest,
const decode::Row row,
uint64_t  start_sample,
uint64_t  end_sample 
) const

Extracts sorted annotations between two period into a vector.

Definition at line 163 of file decoderstack.cpp.

std::vector< Row > pv::data::DecoderStack::get_visible_rows ( ) const

Definition at line 133 of file decoderstack.cpp.

uint64_t pv::data::DecoderStack::max_sample_count ( ) const

Definition at line 271 of file decoderstack.cpp.

void pv::data::DecoderStack::new_decode_data ( )
signal

Definition at line 140 of file moc_decoderstack.cpp.

Here is the caller graph for this function:

void pv::data::DecoderStack::on_data_received ( )
privateslot

Definition at line 427 of file decoderstack.cpp.

Here is the caller graph for this function:

void pv::data::DecoderStack::on_frame_ended ( )
privateslot

Definition at line 437 of file decoderstack.cpp.

Here is the caller graph for this function:

void pv::data::DecoderStack::on_new_frame ( )
privateslot

Definition at line 422 of file decoderstack.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::DecoderStack::push ( std::shared_ptr< decode::Decoder decoder)

Definition at line 97 of file decoderstack.cpp.

void pv::data::DecoderStack::remove ( int  index)

Definition at line 103 of file decoderstack.cpp.

double pv::data::DecoderStack::samplerate ( ) const

Definition at line 117 of file decoderstack.cpp.

int64_t pv::data::DecoderStack::samples_decoded ( ) const

Definition at line 127 of file decoderstack.cpp.

const std::list< std::shared_ptr< decode::Decoder > > & pv::data::DecoderStack::stack ( ) const

Definition at line 92 of file decoderstack.cpp.

const pv::util::Timestamp & pv::data::DecoderStack::start_time ( ) const

Definition at line 122 of file decoderstack.cpp.

optional< int64_t > pv::data::DecoderStack::wait_for_data ( ) const
private

Definition at line 282 of file decoderstack.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

friend struct DecoderStackTest::TwoDecoderStack
friend

Definition at line 171 of file decoderstack.hpp.

Member Data Documentation

std::map<std::pair<const srd_decoder*, int>, decode::Row> pv::data::DecoderStack::class_rows_
private

Definition at line 164 of file decoderstack.hpp.

std::thread pv::data::DecoderStack::decode_thread_
private

Definition at line 168 of file decoderstack.hpp.

const int64_t pv::data::DecoderStack::DecodeChunkLength = 4096
staticprivate

Definition at line 78 of file decoderstack.hpp.

const double pv::data::DecoderStack::DecodeMargin = 1.0
staticprivate

Definition at line 76 of file decoderstack.hpp.

const unsigned int pv::data::DecoderStack::DecodeNotifyPeriod = 65536
staticprivate

Definition at line 79 of file decoderstack.hpp.

const double pv::data::DecoderStack::DecodeThreshold = 0.2
staticprivate

Definition at line 77 of file decoderstack.hpp.

QString pv::data::DecoderStack::error_message_
private

Definition at line 166 of file decoderstack.hpp.

bool pv::data::DecoderStack::frame_complete_
private

Definition at line 157 of file decoderstack.hpp.

mutex pv::data::DecoderStack::global_decode_mutex_
staticprivate

This mutex prevents more than one decode operation occuring concurrently.

Definition at line 148 of file decoderstack.hpp.

std::condition_variable pv::data::DecoderStack::input_cond_
mutableprivate

Definition at line 155 of file decoderstack.hpp.

std::mutex pv::data::DecoderStack::input_mutex_
mutableprivate

Definition at line 154 of file decoderstack.hpp.

std::atomic<bool> pv::data::DecoderStack::interrupt_
private

Definition at line 169 of file decoderstack.hpp.

std::mutex pv::data::DecoderStack::output_mutex_
mutableprivate

Definition at line 159 of file decoderstack.hpp.

std::map<const decode::Row, decode::RowData> pv::data::DecoderStack::rows_
private

Definition at line 162 of file decoderstack.hpp.

int64_t pv::data::DecoderStack::sample_count_
private

Definition at line 156 of file decoderstack.hpp.

double pv::data::DecoderStack::samplerate_
private

Definition at line 140 of file decoderstack.hpp.

int64_t pv::data::DecoderStack::samples_decoded_
private

Definition at line 160 of file decoderstack.hpp.

std::shared_ptr<pv::data::LogicSegment> pv::data::DecoderStack::segment_
private

Definition at line 152 of file decoderstack.hpp.

pv::Session& pv::data::DecoderStack::session_
private

Definition at line 137 of file decoderstack.hpp.

std::list< std::shared_ptr<decode::Decoder> > pv::data::DecoderStack::stack_
private

Definition at line 150 of file decoderstack.hpp.

pv::util::Timestamp pv::data::DecoderStack::start_time_
private

Definition at line 139 of file decoderstack.hpp.


The documentation for this class was generated from the following files: