nidas v1.2.3
|
Base class for SPEC 2DS optical array probe on a USB interface. More...
#include <TwoD_Processing.h>
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_Processing & | operator= (const TwoD_Processing &) |
No copying. | |
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.
TwoD_Processing::TwoD_Processing | ( | ) |
|
virtual |
|
private |
No copying.
Accept/reject criteria are in these functions.
p | is particle info class. |
References _twoDAreaRejectRatio, nidas::dynld::raf::TwoD_Processing::Particle::area, nidas::dynld::raf::TwoD_Processing::Particle::dofReject, nidas::dynld::raf::TwoD_Processing::Particle::edgeTouch, nidas::dynld::raf::TwoD_Processing::Particle::height, and nidas::dynld::raf::TwoD_Processing::Particle::width.
Referenced by countParticle().
References _twoDAreaRejectRatio, nidas::dynld::raf::TwoD_Processing::Particle::area, nidas::dynld::raf::TwoD_Processing::Particle::dofReject, nidas::dynld::raf::TwoD_Processing::Particle::edgeTouch, nidas::dynld::raf::TwoD_Processing::Particle::height, and nidas::dynld::raf::TwoD_Processing::Particle::width.
Referenced by countParticle().
|
protectedvirtual |
Clear size_dist arrays.
References _dead_time, _recordsPerSecond, _size_dist_1D, _size_dist_2D, _totalPixelsShadowed, nidas::core::getSample(), and NumberOfDiodes().
Referenced by nidas::dynld::raf::TwoD_USB::init(), and nidas::dynld::raf::TwoDS::init().
Look at particle stats/info and decide whether to accept or reject.
p | is the particle information. |
resolutionUsec | is the current probe clocking rate. |
References _overSizeCount_2D, _rejected1D_Cntr, _rejected2D_Cntr, _size_dist_1D, _size_dist_2D, _totalPixelsShadowed, acceptThisParticle1D(), acceptThisParticle2D(), nidas::dynld::raf::TwoD_Processing::Particle::area, nidas::util::endlog(), nidas::core::getSample(), nidas::dynld::raf::TwoD_Processing::Particle::height, LOG_VERBOSE, NumberOfDiodes(), nidas::dynld::raf::stream_histogram(), and nidas::dynld::raf::TwoD_Processing::Particle::width.
Referenced by nidas::dynld::raf::TwoD64_USB::processImageRecord().
|
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.
results | is the output results. |
nextTimeTag | is 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().
|
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.
References _resolutionMeters.
Referenced by nidas::dynld::raf::TwoD_USB::Tap2DToTAS(), nidas::dynld::raf::TwoD_USB::Tap2DToTAS(), and nidas::dynld::raf::TwoD_USB::TASToTap2D().
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.
References _resolutionMicron.
Referenced by nidas::dynld::raf::TwoD64_USB::processImageRecord(), and nidas::dynld::raf::TwoD64_USB_v3::TASToTap2D().
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.
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().
|
private |
No copying.
|
protectedvirtual |
Process a slice and update the Particle struct area, edgeTouch, width and height.
p | is particle info class. |
slice | is 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().
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.
cp | Pointer to next byte in the image block to be saved. |
eod | Pointer 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().
|
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.
cp | Pointer to pointer of first slice in the new image block to be processed, after the TAS word. |
eod | Pointer 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().
|
protected |
|
protected |
|
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().
The end time of the current histogram.
Time of last printStatus.
Referenced by nidas::dynld::raf::TwoD_USB::printStatus().
|
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.
Referenced by nidas::dynld::raf::TwoD_USB::init(), and nidas::dynld::raf::TwoDS::init().
Number of image blocks processed by driver at time of last printStatus.
Referenced by nidas::dynld::raf::TwoD_USB::printStatus().
|
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().
|
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().
|
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().
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().
The saved buffer.
Referenced by saveBuffer(), setupBuffer(), and ~TwoD_Processing().
|
protected |
Size of the saved buffer.
Referenced by saveBuffer(), and setupBuffer().
|
protected |
How many bytes were last saved.
Referenced by nidas::dynld::raf::TwoD64_USB::processImageRecord(), saveBuffer(), and setupBuffer().
Arrays for size-distribution histograms.
Referenced by clearData(), countParticle(), nidas::dynld::raf::TwoD_USB::init(), nidas::dynld::raf::TwoDS::init(), and ~TwoD_Processing().
total # of pixels shadoweded in the time period. per second...
Referenced by clearData(), and countParticle().
Statistics variables for processRecord().
Referenced by nidas::dynld::raf::TwoDS::processImageRecord(), nidas::dynld::raf::TwoD64_USB::processImageRecord(), ~TwoD_Processing(), nidas::dynld::raf::TwoD_USB::~TwoD_USB(), and nidas::dynld::raf::TwoDS::~TwoDS().
|
protected |
Area of particle rejection ratio.
Actual area of particle divided area of bounding box must be greater than this.
Referenced by acceptThisParticle1D(), acceptThisParticle2D(), nidas::dynld::raf::TwoD_USB::init(), and nidas::dynld::raf::TwoDS::init().