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

#include <logicsegment.hpp>

Inheritance diagram for pv::data::LogicSegment:
Collaboration diagram for pv::data::LogicSegment:

Classes

struct  MipMapLevel
 

Public Types

typedef std::pair< int64_t, bool > EdgePair
 

Public Member Functions

 LogicSegment (std::shared_ptr< sigrok::Logic > logic, uint64_t samplerate, uint64_t expected_num_samples=0)
 
virtual ~LogicSegment ()
 
void append_payload (std::shared_ptr< sigrok::Logic > logic)
 
void get_samples (uint8_t *const data, int64_t start_sample, int64_t end_sample) const
 
void get_subsampled_edges (std::vector< EdgePair > &edges, uint64_t start, uint64_t end, float min_length, int sig_index)
 
- Public Member Functions inherited from pv::data::Segment
 Segment (uint64_t samplerate, unsigned int unit_size)
 
virtual ~Segment ()
 
uint64_t get_sample_count () const
 
const pv::util::Timestampstart_time () const
 
double samplerate () const
 
void set_samplerate (double samplerate)
 
unsigned int unit_size () const
 
void set_capacity (uint64_t new_capacity)
 Increase the capacity of the segment. More...
 
uint64_t capacity () const
 Get the current capacity of the segment. More...
 

Private Member Functions

uint64_t unpack_sample (const uint8_t *ptr) const
 
void pack_sample (uint8_t *ptr, uint64_t value)
 
void reallocate_mipmap_level (MipMapLevel &m)
 
void append_payload_to_mipmap ()
 
uint64_t get_sample (uint64_t index) const
 
uint64_t get_subsample (int level, uint64_t offset) const
 

Static Private Member Functions

static uint64_t pow2_ceil (uint64_t x, unsigned int power)
 

Private Attributes

struct MipMapLevel mip_map_ [ScaleStepCount]
 
uint64_t last_append_sample_
 

Static Private Attributes

static const unsigned int ScaleStepCount = 10
 
static const int MipMapScalePower = 4
 
static const int MipMapScaleFactor = 1 << MipMapScalePower
 
static const float LogMipMapScaleFactor = logf(MipMapScaleFactor)
 
static const uint64_t MipMapDataUnit = 64*1024
 

Friends

struct LogicSegmentTest::Pow2
 
struct LogicSegmentTest::Basic
 
struct LogicSegmentTest::LargeData
 
struct LogicSegmentTest::Pulses
 
struct LogicSegmentTest::LongPulses
 

Additional Inherited Members

- Protected Member Functions inherited from pv::data::Segment
void append_data (void *data, uint64_t samples)
 
- Protected Attributes inherited from pv::data::Segment
std::recursive_mutex mutex_
 
std::vector< uint8_t > data_
 
uint64_t sample_count_
 
pv::util::Timestamp start_time_
 
double samplerate_
 
uint64_t capacity_
 
unsigned int unit_size_
 

Detailed Description

Definition at line 44 of file logicsegment.hpp.


Class Documentation

struct pv::data::LogicSegment::MipMapLevel

Definition at line 47 of file logicsegment.hpp.

Collaboration diagram for pv::data::LogicSegment::MipMapLevel:
Class Members
void * data
uint64_t data_length
uint64_t length

Member Typedef Documentation

typedef std::pair<int64_t, bool> pv::data::LogicSegment::EdgePair

Definition at line 62 of file logicsegment.hpp.

Constructor & Destructor Documentation

pv::data::LogicSegment::LogicSegment ( std::shared_ptr< sigrok::Logic >  logic,
uint64_t  samplerate,
uint64_t  expected_num_samples = 0 
)

Definition at line 49 of file logicsegment.cpp.

Here is the call graph for this function:

pv::data::LogicSegment::~LogicSegment ( )
virtual

Definition at line 61 of file logicsegment.cpp.

Member Function Documentation

void pv::data::LogicSegment::append_payload ( std::shared_ptr< sigrok::Logic >  logic)

Definition at line 142 of file logicsegment.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::LogicSegment::append_payload_to_mipmap ( )
private

Definition at line 185 of file logicsegment.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t pv::data::LogicSegment::get_sample ( uint64_t  index) const
private

Definition at line 262 of file logicsegment.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::LogicSegment::get_samples ( uint8_t *const  data,
int64_t  start_sample,
int64_t  end_sample 
) const

Definition at line 156 of file logicsegment.cpp.

uint64_t pv::data::LogicSegment::get_subsample ( int  level,
uint64_t  offset 
) const
private

Definition at line 443 of file logicsegment.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::LogicSegment::get_subsampled_edges ( std::vector< EdgePair > &  edges,
uint64_t  start,
uint64_t  end,
float  min_length,
int  sig_index 
)

Parses a logic data segment to generate a list of transitions in a time interval to a given level of detail.

Parameters
[out]edgesThe vector to place the edges into.
[in]startThe start sample index.
[in]endThe end sample index.
[in]min_lengthThe minimum number of samples that can be resolved at this level of detail.
[in]sig_indexThe index of the signal.

Definition at line 269 of file logicsegment.cpp.

Here is the call graph for this function:

void pv::data::LogicSegment::pack_sample ( uint8_t *  ptr,
uint64_t  value 
)
private

Definition at line 106 of file logicsegment.cpp.

Here is the caller graph for this function:

uint64_t pv::data::LogicSegment::pow2_ceil ( uint64_t  x,
unsigned int  power 
)
staticprivate

Definition at line 451 of file logicsegment.cpp.

Here is the caller graph for this function:

void pv::data::LogicSegment::reallocate_mipmap_level ( MipMapLevel m)
private

Definition at line 172 of file logicsegment.cpp.

Here is the caller graph for this function:

uint64_t pv::data::LogicSegment::unpack_sample ( const uint8_t *  ptr) const
private

Definition at line 68 of file logicsegment.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

friend struct LogicSegmentTest::Basic
friend

Definition at line 110 of file logicsegment.hpp.

friend struct LogicSegmentTest::LargeData
friend

Definition at line 111 of file logicsegment.hpp.

friend struct LogicSegmentTest::LongPulses
friend

Definition at line 113 of file logicsegment.hpp.

friend struct LogicSegmentTest::Pow2
friend

Definition at line 109 of file logicsegment.hpp.

friend struct LogicSegmentTest::Pulses
friend

Definition at line 112 of file logicsegment.hpp.

Member Data Documentation

uint64_t pv::data::LogicSegment::last_append_sample_
private

Definition at line 107 of file logicsegment.hpp.

const float pv::data::LogicSegment::LogMipMapScaleFactor = logf(MipMapScaleFactor)
staticprivate

Definition at line 58 of file logicsegment.hpp.

struct MipMapLevel pv::data::LogicSegment::mip_map_[ScaleStepCount]
private

Definition at line 106 of file logicsegment.hpp.

const uint64_t pv::data::LogicSegment::MipMapDataUnit = 64*1024
staticprivate

Definition at line 59 of file logicsegment.hpp.

const int pv::data::LogicSegment::MipMapScaleFactor = 1 << MipMapScalePower
staticprivate

Definition at line 57 of file logicsegment.hpp.

const int pv::data::LogicSegment::MipMapScalePower = 4
staticprivate

Definition at line 56 of file logicsegment.hpp.

const unsigned int pv::data::LogicSegment::ScaleStepCount = 10
staticprivate

Definition at line 55 of file logicsegment.hpp.


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