nidas v1.2.3
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
nidas::dynld::raf::TwoD_Processing Class Referenceabstract

Base class for SPEC 2DS optical array probe on a USB interface. More...

#include <TwoD_Processing.h>

Inheritance diagram for nidas::dynld::raf::TwoD_Processing:
Inheritance graph
[legend]

Classes

class  Particle
 

Public Member Functions

 TwoD_Processing ()
 
virtual ~TwoD_Processing ()
 
virtual int NumberOfDiodes () const =0
 Number of diodes in the probe array.
 
float getResolution () const
 The probe resolution in meters.
 
unsigned int getResolutionMicron () const
 The probe resolution in micrometers.
 

Protected Member Functions

virtual void processParticleSlice (Particle &p, const unsigned char *slice)
 Process a slice and update the Particle struct area, edgeTouch, width and height.
 
virtual void countParticle (const Particle &p, float resolutionUsec)
 Look at particle stats/info and decide whether to accept or reject.
 
virtual bool acceptThisParticle1D (const Particle &p) const
 Accept/reject criteria are in these functions.
 
virtual bool acceptThisParticle2D (const Particle &p) const
 
virtual void createSamples (dsm_time_t nextTimeTag, std::list< const Sample * > &results) throw ()
 Send derived data and reset.
 
virtual void clearData ()
 Clear size_dist arrays.
 
void saveBuffer (const unsigned char *cp, const unsigned char *eod)
 In case of mis-aligned data, we may need to save some bytes at the end of an image block to pre-pend to the next block.
 
void setupBuffer (const unsigned char **cp, const unsigned char **eod)
 Derived Classes should call this at the beginning of processing an image block.
 

Protected Attributes

unsigned int _numImages
 Number of image blocks processed by driver at time of last printStatus.
 
long long _lastStatusTime
 Time of last printStatus.
 
float _resolutionMeters
 Probe resolution in meters.
 
unsigned int _resolutionMicron
 Probe resolution in micrometers.
 
dsm_sample_id_t _1dcID
 
dsm_sample_id_t _2dcID
 
unsigned int_size_dist_1D
 Arrays for size-distribution histograms.
 
unsigned int_size_dist_2D
 
float _dead_time
 Amount of time probe was inactive or amount of time consumed by rejected particles.
 
unsigned int _totalRecords
 Statistics variables for processRecord().
 
unsigned int _totalParticles
 
unsigned int _rejected1D_Cntr
 
unsigned int _rejected2D_Cntr
 
unsigned int _overLoadSliceCount
 
unsigned int _overSizeCount_2D
 
unsigned int _misAligned
 
unsigned int _suspectSlices
 
unsigned int _recordsPerSecond
 
unsigned int _totalPixelsShadowed
 total # of pixels shadoweded in the time period. per second...
 
dsm_time_t _prevTime
 Time from previous record.
 
long long _histoEndTime
 The end time of the current histogram.
 
float _twoDAreaRejectRatio
 Area of particle rejection ratio.
 
Particle _particle
 Current particle information.
 
int _nextraValues
 If XML file has a variable RPS (records per second) defined, then _nextravalues will be 2, otherwise 1.
 
unsigned char_saveBuffer
 The saved buffer.
 
int _savedBytes
 How many bytes were last saved.
 
int _savedAlloc
 Size of the saved buffer.
 

Private Member Functions

 TwoD_Processing (const TwoD_Processing &)
 No copying.
 
TwoD_Processingoperator= (const TwoD_Processing &)
 No copying.
 

Detailed Description

Base class for SPEC 2DS optical array probe on a USB interface.

Perhaps can be split out into a base class and sub-classes for 2DS & HVPS.

Constructor & Destructor Documentation

◆ TwoD_Processing() [1/2]

TwoD_Processing::TwoD_Processing ( )

◆ ~TwoD_Processing()

TwoD_Processing::~TwoD_Processing ( )
virtual

◆ TwoD_Processing() [2/2]

nidas::dynld::raf::TwoD_Processing::TwoD_Processing ( const TwoD_Processing & )
private

No copying.

Member Function Documentation

◆ acceptThisParticle1D()

bool TwoD_Processing::acceptThisParticle1D ( const Particle & p) const
protectedvirtual

◆ acceptThisParticle2D()

bool TwoD_Processing::acceptThisParticle2D ( const Particle & p) const
protectedvirtual

◆ clearData()

void TwoD_Processing::clearData ( )
protectedvirtual

◆ countParticle()

void TwoD_Processing::countParticle ( const Particle & p,
float resolutionUsec )
protectedvirtual

◆ createSamples()

void TwoD_Processing::createSamples ( dsm_time_t nextTimeTag,
std::list< const Sample * > & results )
throw ( )
protectedvirtual

Send derived data and reset.

The process() method for image data is to build size-distribution histograms for 1 second of data and then send that.

Parameters
resultsis the output results.
nextTimeTagis the timetag of a sample that is past the end of the current histogram period. The end

References nidas::core::getSample(), and USECS_PER_SEC.

Referenced by nidas::dynld::raf::TwoDS::processImageRecord(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ getResolution()

float nidas::dynld::raf::TwoD_Processing::getResolution ( ) const
inline

The probe resolution in meters.

Probe resolution is also the diameter of the each diode. Typical values are 25 for the 2DC and 200 micrometers for the 2DP.

Returns
The probe resolution in meters.

References _resolutionMeters.

Referenced by nidas::dynld::raf::TwoD_USB::Tap2DToTAS(), nidas::dynld::raf::TwoD_USB::Tap2DToTAS(), and nidas::dynld::raf::TwoD_USB::TASToTap2D().

◆ getResolutionMicron()

unsigned int nidas::dynld::raf::TwoD_Processing::getResolutionMicron ( ) const
inline

The probe resolution in micrometers.

Probe resolution is also the diameter of the each diode. Typical values are 25 for the 2DC and 200 micrometers for the 2DP.

Returns
The probe resolution in micrometers.

References _resolutionMicron.

Referenced by nidas::dynld::raf::TwoD64_USB::processImageRecord(), and nidas::dynld::raf::TwoD64_USB_v3::TASToTap2D().

◆ NumberOfDiodes()

virtual int nidas::dynld::raf::TwoD_Processing::NumberOfDiodes ( ) const
pure virtual

Number of diodes in the probe array.

This is also the bits-per-slice value. Traditional 2D probes have 32 diodes, the HVPS has 128 and the Fast2DC has 64.

Returns
the number of bits per data slice.

Implemented in nidas::dynld::raf::TwoD32_USB, nidas::dynld::raf::TwoD64_USB, and nidas::dynld::raf::TwoDS.

Referenced by clearData(), countParticle(), nidas::dynld::raf::TwoD_USB::init(), and processParticleSlice().

◆ operator=()

TwoD_Processing & nidas::dynld::raf::TwoD_Processing::operator= ( const TwoD_Processing & )
private

No copying.

◆ processParticleSlice()

void TwoD_Processing::processParticleSlice ( Particle & p,
const unsigned char * slice )
protectedvirtual

Process a slice and update the Particle struct area, edgeTouch, width and height.

Parameters
pis particle info class.
sliceis a pointer to the start of the slice, in big-endian and uncomplemented.

References nidas::dynld::raf::TwoD_Processing::Particle::area, nidas::dynld::raf::TwoD_Processing::Particle::edgeTouch, nidas::core::getSample(), nidas::dynld::raf::TwoD_Processing::Particle::height, NumberOfDiodes(), and nidas::dynld::raf::TwoD_Processing::Particle::width.

Referenced by nidas::dynld::raf::TwoDS::processImageRecord(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ saveBuffer()

void TwoD_Processing::saveBuffer ( const unsigned char * cp,
const unsigned char * eod )
protected

In case of mis-aligned data, we may need to save some bytes at the end of an image block to pre-pend to the next block.

Parameters
cpPointer to next byte in the image block to be saved.
eodPointer to one-past-the-end of the image block. If cp is equal to eod, then nothing is saved, and this function does not need to be called.

References _saveBuffer, _savedAlloc, _savedBytes, and nidas::core::getSample().

Referenced by nidas::dynld::raf::TwoDS::processImageRecord(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ setupBuffer()

void TwoD_Processing::setupBuffer ( const unsigned char ** cp,
const unsigned char ** eod )
protected

Derived Classes should call this at the beginning of processing an image block.

If bytes were saved from the end of the last image block, then the pointers are adjusted to point to a new buffer that contains the saved and the new data.

Parameters
cpPointer to pointer of first slice in the new image block to be processed, after the TAS word.
eodPointer to pointer to one-past-the-end of the image block.

References _saveBuffer, _savedAlloc, _savedBytes, and nidas::core::getSample().

Referenced by nidas::dynld::raf::TwoDS::processImageRecord(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

Member Data Documentation

◆ _1dcID

dsm_sample_id_t nidas::dynld::raf::TwoD_Processing::_1dcID
protected

◆ _2dcID

dsm_sample_id_t nidas::dynld::raf::TwoD_Processing::_2dcID
protected

◆ _dead_time

float nidas::dynld::raf::TwoD_Processing::_dead_time
protected

Amount of time probe was inactive or amount of time consumed by rejected particles.

nimbus will then subtract this deadtime out of the sample volume.

Referenced by clearData(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ _histoEndTime

long long nidas::dynld::raf::TwoD_Processing::_histoEndTime
protected

The end time of the current histogram.

◆ _lastStatusTime

long long nidas::dynld::raf::TwoD_Processing::_lastStatusTime
protected

Time of last printStatus.

Referenced by nidas::dynld::raf::TwoD_USB::printStatus().

◆ _misAligned

unsigned int nidas::dynld::raf::TwoD_Processing::_misAligned
protected

◆ _nextraValues

int nidas::dynld::raf::TwoD_Processing::_nextraValues
protected

If XML file has a variable RPS (records per second) defined, then _nextravalues will be 2, otherwise 1.

This keeps us from having to retrofit old XML files.

See also
init()
process()

Referenced by nidas::dynld::raf::TwoD_USB::init(), and nidas::dynld::raf::TwoDS::init().

◆ _numImages

unsigned int nidas::dynld::raf::TwoD_Processing::_numImages
protected

Number of image blocks processed by driver at time of last printStatus.

Referenced by nidas::dynld::raf::TwoD_USB::printStatus().

◆ _overLoadSliceCount

unsigned int nidas::dynld::raf::TwoD_Processing::_overLoadSliceCount
protected

◆ _overSizeCount_2D

unsigned int nidas::dynld::raf::TwoD_Processing::_overSizeCount_2D
protected

◆ _particle

Particle nidas::dynld::raf::TwoD_Processing::_particle
protected

Current particle information.

This is in here, since a particle can cross samples/records.

Referenced by nidas::dynld::raf::TwoDS::processImageRecord(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ _prevTime

dsm_time_t nidas::dynld::raf::TwoD_Processing::_prevTime
protected

Time from previous record.

Time belongs to end of record it came with, or start of the next record. Save it so we can use it as a start.

Referenced by nidas::dynld::raf::TwoD_USB::init(), nidas::dynld::raf::TwoDS::init(), nidas::dynld::raf::TwoDS::processImageRecord(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ _recordsPerSecond

unsigned int nidas::dynld::raf::TwoD_Processing::_recordsPerSecond
protected

◆ _rejected1D_Cntr

unsigned int nidas::dynld::raf::TwoD_Processing::_rejected1D_Cntr
protected

◆ _rejected2D_Cntr

unsigned int nidas::dynld::raf::TwoD_Processing::_rejected2D_Cntr
protected

◆ _resolutionMeters

float nidas::dynld::raf::TwoD_Processing::_resolutionMeters
protected

Probe resolution in meters.

Acquired from XML config file.

Referenced by getResolution(), nidas::dynld::raf::TwoD_USB::init_parameters(), and nidas::dynld::raf::TwoDS::init_parameters().

◆ _resolutionMicron

unsigned int nidas::dynld::raf::TwoD_Processing::_resolutionMicron
protected

Probe resolution in micrometers.

Acquired from XML config file.

Referenced by getResolutionMicron(), nidas::dynld::raf::TwoD_USB::init_parameters(), and nidas::dynld::raf::TwoDS::init_parameters().

◆ _saveBuffer

unsigned char* nidas::dynld::raf::TwoD_Processing::_saveBuffer
protected

The saved buffer.

Referenced by saveBuffer(), setupBuffer(), and ~TwoD_Processing().

◆ _savedAlloc

int nidas::dynld::raf::TwoD_Processing::_savedAlloc
protected

Size of the saved buffer.

Referenced by saveBuffer(), and setupBuffer().

◆ _savedBytes

int nidas::dynld::raf::TwoD_Processing::_savedBytes
protected

How many bytes were last saved.

Referenced by nidas::dynld::raf::TwoD64_USB::processImageRecord(), saveBuffer(), and setupBuffer().

◆ _size_dist_1D

unsigned int* nidas::dynld::raf::TwoD_Processing::_size_dist_1D
protected

◆ _size_dist_2D

unsigned int* nidas::dynld::raf::TwoD_Processing::_size_dist_2D
protected

◆ _suspectSlices

unsigned int nidas::dynld::raf::TwoD_Processing::_suspectSlices
protected

◆ _totalParticles

unsigned int nidas::dynld::raf::TwoD_Processing::_totalParticles
protected

◆ _totalPixelsShadowed

unsigned int nidas::dynld::raf::TwoD_Processing::_totalPixelsShadowed
protected

total # of pixels shadoweded in the time period. per second...

Referenced by clearData(), and countParticle().

◆ _totalRecords

unsigned int nidas::dynld::raf::TwoD_Processing::_totalRecords
protected

◆ _twoDAreaRejectRatio

float nidas::dynld::raf::TwoD_Processing::_twoDAreaRejectRatio
protected

Area of particle rejection ratio.

Actual area of particle divided area of bounding box must be greater than this.

See also
acceptThisParticle1D()

Referenced by acceptThisParticle1D(), acceptThisParticle2D(), nidas::dynld::raf::TwoD_USB::init(), and nidas::dynld::raf::TwoDS::init().


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