Scope
scope::DaqChunk Class Reference

#include <DaqChunk.h>

Inherited by scope::DaqChunkResonance.

Public Types

typedef std::vector< uint16_t >::iterator iterator
 

Public Member Functions

 DaqChunk (const uint32_t &_perchannel, const uint32_t &_nchannels, const uint32_t &_area)
 
virtual ~DaqChunk ()
 
virtual void Downsample (const uint32_t &_factor)
 
virtual void Scale (const double &_factor)
 
Several accessor methods
uint32_t Area () const
 
uint32_t NChannels () const
 
uint32_t PerChannel () const
 
iterator GetLastMapped (const uint32_t &_channel) const
 
Mutator methods
void SetLastMapped (const uint32_t &_channel, const iterator &_last)
 

Public Attributes

std::vector< uint16_t > data
 
std::vector< iteratorlastmapped
 

Protected Attributes

const uint32_t area
 
const uint32_t nchannels
 
uint32_t perchannel
 

Detailed Description

A DaqChunk contains data from all channels sequentially.

First perchannel samples of channel 0, then perchannel samples of channel 1 etc etc...

Definition at line 9 of file DaqChunk.h.

Member Typedef Documentation

typedef std::vector<uint16_t>::iterator scope::DaqChunk::iterator

Iterator over the data vector.

Definition at line 23 of file DaqChunk.h.

Constructor & Destructor Documentation

scope::DaqChunk::DaqChunk ( const uint32_t &  _perchannel,
const uint32_t &  _nchannels,
const uint32_t &  _area 
)
Parameters
[in]_perchannelnumber of samples the chunk should contain per channel
[in]_nchannelsnumber of channels in the chunk (total number of samples is thus _perchannel*_nchannels)
[in]_areasets the area value for the channel

Definition at line 7 of file DaqChunk.cpp.

virtual scope::DaqChunk::~DaqChunk ( )
inlinevirtual

Virtual destructor here, to be prepared for derived classes.

Definition at line 37 of file DaqChunk.h.

Member Function Documentation

void scope::DaqChunk::Downsample ( const uint32_t &  _factor)
virtual

Downsamples by averaging _factor samples.

Replaces every _factor samples by their average. The chunk does shrink that way and perchannel is adjusted.

Parameters
[in]_factordownsampling factor

Definition at line 19 of file DaqChunk.cpp.

void scope::DaqChunk::Scale ( const double &  _factor)
virtual

Multiplies every sample by _factor.

Definition at line 46 of file DaqChunk.cpp.

Member Data Documentation

const uint32_t scope::DaqChunk::area
protected

Area of the DaqChunk.

Definition at line 13 of file DaqChunk.h.

const uint32_t scope::DaqChunk::nchannels
protected

Number of channels in that area/DaqChunk.

Definition at line 16 of file DaqChunk.h.

uint32_t scope::DaqChunk::perchannel
protected

Number of samples per channel.

Definition at line 19 of file DaqChunk.h.

std::vector<uint16_t> scope::DaqChunk::data

The data vector.

Definition at line 26 of file DaqChunk.h.

std::vector<iterator> scope::DaqChunk::lastmapped

Iterators to positions that was last mapped.

One for every channel.

Definition at line 29 of file DaqChunk.h.


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