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

Base class for PMS 2D particle probes on a USB interface. More...

#include <TwoD_USB.h>

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

Public Member Functions

 TwoD_USB ()
 
virtual ~TwoD_USB ()
 
IODevicebuildIODevice ()
 Factory method for an IODevice for this DSMSensor.
 
SampleScannerbuildSampleScanner ()
 Factory method for a SampleScanner for this DSMSensor.
 
void open (int flags)
 open the sensor and perform any intialization to the driver.
 
void close ()
 close my associated device.
 
int getTASRate () const
 
void setTASRate (int val)
 
void init ()
 Called by post-processing code.
 
virtual void derivedDataNotify (const nidas::core::DerivedDataReader *s)
 Method called on a DerivedDataClient by the DerivedDataReader thread when a new packet of derived data has been received.
 
void printStatus (std::ostream &ostr)
 
virtual int TASToTap2D (void *t2d, float tas)
 Build the struct above from the true airspeed (in m/s).
 
virtual float Tap2DToTAS (const Tap2D *t2d) const
 Reverse the true airspeed encoding.
 
virtual float Tap2DToTAS (const Tap2Dv1 *t2d) const
 The first generation used the Maxim 5418 chip.
 
void setDSMConfig (const DSMConfig *val)
 Set the DSMConfig for this sensor.
 
const DSMConfiggetDSMConfig () const
 What DSMConfig am I associated with?
 
const SitegetSite () const
 What Site am I associated with?
 
virtual void setDeviceName (const std::string &val)
 Set the name of the system device that the sensor is connected to.
 
virtual const std::string & getDeviceName () const
 Fetch the name of the system device that the sensor is connected to.
 
virtual void setClassName (const std::string &val)
 Set the class name.
 
virtual const std::string & getClassName () const
 Fetch the class name.
 
virtual void setCatalogName (const std::string &val)
 Set the name of the catalog entry for this sensor.
 
virtual const std::string & getCatalogName () const
 Fetch the name of the catalog entry for this sensor.
 
const std::string & getDSMName () const
 Fetch the DSM name.
 
virtual std::string getName () const
 Return a name that should fully identify this sensor.
 
const std::string & getLocation () const
 Location string.
 
void setLocation (const std::string &val)
 
const std::string & getSuffix () const
 Sensor suffix, which is added to variable names.
 
void setSuffix (const std::string &val)
 
int getStation () const
 
void setStation (int val)
 
void setHeight (const std::string &val)
 Set sensor height above ground via a string which is added to variable names.
 
void setHeight (float val)
 Set sensor height above ground.
 
const std::string & getHeightString () const
 Get sensor height above ground in a string.
 
float getHeight () const
 Get sensor height above ground.
 
void setDepth (const std::string &val)
 Set sensor depth below ground via a string which is added to variable names.
 
void setDepth (float val)
 Set sensor depth below ground.
 
const std::string & getDepthString () const
 Get sensor depth below ground in a string.
 
float getDepth () const
 Get sensor depth below ground.
 
const std::string & getFullSuffix () const
 Full sensor suffix, the concatenation of the sensor suffix, if any, and the height or depth string, if any.
 
std::string expandString (const std::string &input) const
 Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue().
 
bool getTokenValue (const std::string &token, std::string &value) const
 Implement a lookup for tokens that I know about, like $HEIGHT.
 
const DictionarygetDictionary () const
 
SampleSourcegetRawSampleSource ()
 Implementation of SampleSource::getRawSampleSource().
 
SampleSourcegetProcessedSampleSource ()
 Implementation of SampleSource::getProcessedSampleSource().
 
const SampleTaggetRawSampleTag () const
 Convenience function to get my one-and-only raw SampleTag().
 
virtual void addSampleTag (SampleTag *val)
 Add a SampleTag to this sensor.
 
virtual void removeSampleTag (SampleTag *val)
 Remove val from the list of SampleTags, and delete it.
 
std::list< const SampleTag * > getSampleTags () const
 Implementation of SampleSource::getSampleTags().
 
std::list< SampleTag * > & getSampleTags ()
 Non-const method to get a list of non-const pointers to SampleTags.
 
SampleTagIterator getSampleTagIterator () const
 
void addSampleClient (SampleClient *c) throw ()
 Add a SampleClient to this SampleSource.
 
void removeSampleClient (SampleClient *c) throw ()
 Remove a SampleClient from this SampleSource This will also remove a SampleClient if it has been added with addSampleClientForTag().
 
void addSampleClientForTag (SampleClient *client, const SampleTag *tag) throw ()
 Add a SampleClient to this SampleSource.
 
void removeSampleClientForTag (SampleClient *client, const SampleTag *tag) throw ()
 Remove a SampleClient for a given SampleTag from this SampleSource.
 
int getClientCount () const throw ()
 How many SampleClients are currently in my list.
 
void flush ()
 Implementation of SampleClient::flush().
 
void distributeRaw (const Sample *s)
 Distribute a raw sample which has been read from my file descriptor in real time.
 
const SampleStatsgetSampleStats () const
 
virtual int getReadFd () const
 
virtual int getWriteFd () const
 
virtual bool reopenOnIOException () const
 Whether to reopen this sensor on an IOException.
 
void setId (dsm_sample_id_t val)
 Set the various levels of the sensor identification.
 
void setSensorId (unsigned int val)
 
void setDSMId (unsigned int val)
 
dsm_sample_id_t getId () const
 Get the various levels of the samples identification.
 
unsigned int getDSMId () const
 
unsigned int getSensorId () const
 
virtual void setLatency (float val)
 Set desired latency, providing some control over the response time vs buffer efficiency tradeoff.
 
virtual float getLatency () const
 
virtual void setTimeoutMsecs (int val)
 Set the sensor timeout value in milliseconds.
 
virtual int getTimeoutMsecs () const
 
int getTimeoutCount () const
 
void incrementTimeoutCount ()
 
void addParameter (Parameter *val)
 Add a parameter to this DSMSensor.
 
const std::list< const Parameter * > & getParameters () const
 Get list of parameters.
 
const ParametergetParameter (const std::string &name) const
 Fetch a parameter by name.
 
void setIODevice (IODevice *val)
 Set the IODevice for this sensor.
 
void setSampleScanner (SampleScanner *val)
 Set the SampleScanner for this sensor.
 
virtual void validate ()
 validate() is called once on a DSMSensor after it has been configured, but before open() or init() are called.
 
virtual int getDefaultMode () const
 How do I want to be opened.
 
virtual void setDefaultMode (int val)
 
virtual size_t getBytesAvailable () const
 How many bytes are available to read on this sensor.
 
virtual size_t read (void *buf, size_t len)
 Read from the device (duh).
 
virtual size_t read (void *buf, size_t len, int msecTimeout)
 Read from the device with a timeout.
 
virtual size_t write (const void *buf, size_t len)
 Write to the device (duh).
 
virtual void ioctl (int request, void *buf, size_t len)
 Perform an ioctl on the device.
 
virtual bool readSamples ()
 Read samples from my associated file descriptor, and distribute() them to my RawSampleClient's.
 
virtual SamplenextSample ()
 Extract the next sample from the buffer.
 
virtual SamplereadSample ()
 Return the next sample.
 
bool receive (const Sample *s)
 A DSMSensor can be used as a SampleClient, meaning it receives its own raw samples.
 
virtual bool process (const Sample *, std::list< const Sample * > &result)=0
 Apply further necessary processing to a raw sample from this DSMSensor.
 
void printStatusHeader (std::ostream &ostr)
 
void printStatusTrailer (std::ostream &ostr)
 
void calcStatistics (unsigned int periodUsec)
 Update the sensor sampling statistics.
 
unsigned int getMaxSampleLength () const
 
unsigned int getMinSampleLength () const
 
float getObservedSamplingRate () const
 
float getObservedDataRate () const
 
size_t getBadTimeTagCount () const
 
VariableIterator getVariableIterator () const
 
void fromDOMElement (const xercesc::DOMElement *)
 
xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const
 
xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const
 
virtual void setTypeName (const std::string &val)
 Set the type name of this sensor, e.g.: "ACME Model 99 Mach7 Particle Disambiguator".
 
virtual const std::string & getTypeName (void) const
 Get the type name of this sensor.
 
bool getDuplicateIdOK () const
 getDuplicateIdOK will be true if it is OK for samples from this sensor to have identical IDs to samples from another sensor.
 
void setDuplicateIdOK (bool val)
 Set the duplicate ID attribute of this DSMSensor.
 
virtual bool getApplyVariableConversions () const
 
virtual void setApplyVariableConversions (bool val)
 
virtual int getDriverTimeTagUsecs () const
 
virtual void setDriverTimeTagUsecs (int val)
 
void addCalFile (CalFile *val)
 Add a calibration file for this DSMSensor.
 
const std::map< std::string, CalFile * > & getCalFiles ()
 Return the collection of CalFiles, mapped by name.
 
CalFilegetCalFile (const std::string &name)
 Return a CalFile by its getName().
 
void removeCalFiles ()
 Remove all CalFiles.
 
virtual void executeXmlRpc (XmlRpc::XmlRpcValue &, XmlRpc::XmlRpcValue &)
 Method invoked when the DSMEngineIntf XmlRpcServer receives a "SensorAction" request, with a "device" string matching the string that this DSMSensor registers via DSMEngine::registerSensorWithXmlRpc(string,DSMServer*).
 
virtual const std::list< SampleTag * > & getNonConstSampleTags ()
 We'll allow derived classes and calibration applications to change the SampleTags, so this method returns a list of non-constant SampleTags.
 
bool allowOpen ()
 
bool readBuffer ()
 Read into my SampleScanner's buffer.
 
bool readBuffer (int msecTimeout)
 Read into my SampleScanner's buffer.
 
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.
 

Static Public Member Functions

static const std::string getClassName (const xercesc::DOMElement *node, const Project *project)
 Crawl through the DOM tree for a DSMSensor to find the class name - scanning the catalog entry if necessary.
 
static void deleteLooper ()
 
static const XMLChgetNamespaceURI ()
 

Protected Member Functions

virtual void init_parameters ()
 Initialize parameters for real-time and post-processing.
 
virtual void sendTrueAirspeed (float tas)
 Encode and send the true airspeed to the USB driver, which will in turn send it to the probe.
 
void clearBuffer ()
 Clear the internal buffer.
 
IODevicegetIODevice () const
 
SampleScannergetSampleScanner () const
 
void setFullSuffix (const std::string &val)
 
virtual int getLagUsecs () const
 Return the sampling lag for this sensor in microseconds.
 
virtual double getLagSecs () const
 Return the sampling lag for this sensor in seconds.
 
virtual void setLagSecs (double val)
 Set the sampling lag for this sensor in seconds.
 
void applyConversions (SampleTag *stag, SampleT< float > *outs, float *results=0)
 Perform variable conversions for the variables in stag whose values and sample time have been set in outs.
 
void trimUnparsed (SampleTag *stag, SampleT< float > *outs, int nparsed)
 Fill with floatNAN all the values past nparsed values in output sample outs, and trim the length of the sample to match the length of the variables in SampleTag stag.
 
VariableIndex findVariableIndex (const std::string &vprefix)
 Search all the sample tags for a variable whose name starts with the given prefix, and return it's index in the list of variables in the sample tag.
 
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.
 

Static Protected Member Functions

static LoopergetLooper ()
 Fetch a pointer to a static instance of a Looper thread.
 

Protected Attributes

int _tasRate
 How often to send the true air speed.
 
unsigned int _tasOutOfRange
 
dsm_sample_id_t _sorID
 Shadow OR sample ID.
 
float _trueAirSpeed
 True air speed, received from IWGADTS feed.
 
bool _openable
 Whether this sensor is allowed to be opened.
 
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.
 

Static Protected Attributes

static const nidas::util::EndianConverterbigEndian
 
static const nidas::util::EndianConverterlittleEndian
 
static const float DefaultTrueAirspeed = 23.0
 

Private Member Functions

 TwoD_USB (const TwoD_USB &)
 No copying.
 
TwoD_USBoperator= (const TwoD_USB &)
 No copying.
 
void addSampleTag (const SampleTag *val)
 DSMSensor does provide public support for SampleSource::addSampleTag(const SampleTag* val).
 
void removeSampleTag (const SampleTag *val)
 DSMSensor does not provide public support for SampleSource::removeSampleTag(const SampleTag* val)
 

Private Attributes

std::string _devname
 
nidas::core::DSMSensor::MyDictionary _dictionary
 
IODevice_iodev
 
int _defaultMode
 
std::string _className
 Class name attribute of this sensor.
 
std::string _catalogName
 
std::string _suffix
 Sensor suffix, which is added to variable names.
 
std::string _heightString
 
std::string _depthString
 
float _height
 
std::string _fullSuffix
 Concatenation of sensor suffix, and the height or depth string.
 
std::string _location
 
SampleScanner_scanner
 
const DSMConfig_dsm
 
dsm_sample_id_t _id
 Id of this sensor.
 
SampleTag _rawSampleTag
 
std::list< SampleTag * > _sampleTags
 
SampleSourceSupport _rawSource
 
SampleSourceSupport _source
 
float _latency
 
std::map< std::string, Parameter * > _parameters
 Map of parameters by name.
 
std::list< const Parameter * > _constParameters
 List of const pointers to Parameters for providing via getParameters().
 
std::map< std::string, CalFile * > _calFiles
 
std::string _typeName
 
int _timeoutMsecs
 
bool _duplicateIdOK
 
bool _applyVariableConversions
 
int _driverTimeTagUsecs
 
int _nTimeouts
 
int _lag
 
int _station
 

Static Private Attributes

static bool zebra = false
 
static Looper_looper = 0
 
static nidas::util::Mutex _looperMutex
 
static XMLChnamespaceURI = 0
 

Detailed Description

Base class for PMS 2D particle probes on a USB interface.

Covers both the Fast2DC and the white converter box for older 2D probes.

Constructor & Destructor Documentation

◆ TwoD_USB() [1/2]

TwoD_USB::TwoD_USB ( )

◆ ~TwoD_USB()

TwoD_USB::~TwoD_USB ( )
virtual

◆ TwoD_USB() [2/2]

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

No copying.

Member Function Documentation

◆ acceptThisParticle1D()

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

◆ acceptThisParticle2D()

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

◆ addCalFile()

void DSMSensor::addCalFile ( CalFile * val)
inherited

Add a calibration file for this DSMSensor.

After this method is finished, DSMSensor will own the pointer, and will delete it in the DSMSensor destructor.

References nidas::core::DSMSensor::_calFiles, and nidas::core::getSample().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ addParameter()

void DSMSensor::addParameter ( Parameter * val)
inherited

Add a parameter to this DSMSensor.

DSMSensor will then own the pointer and will delete it in its destructor. If a Parameter exists with the same name, it will be replaced with the new Parameter.

References nidas::core::DSMSensor::_constParameters, nidas::core::DSMSensor::_parameters, and nidas::core::getSample().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ addSampleClient()

void nidas::core::DSMSensor::addSampleClient ( SampleClient * c)
throw ( )
inlinevirtualinherited

Add a SampleClient to this SampleSource.

The pointer to the SampleClient must remain valid, until after it is removed.

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_source, and nidas::core::SampleSourceSupport::addSampleClient().

Referenced by nidas::core::SamplePipeline::addSampleClient(), and nidas::core::SamplePipeline::addSampleClientForTag().

◆ addSampleClientForTag()

void nidas::core::DSMSensor::addSampleClientForTag ( SampleClient * client,
const SampleTag * tag )
throw ( )
inlinevirtualinherited

Add a SampleClient to this SampleSource.

The pointer to the SampleClient must remain valid, until after it is removed.

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_source, and nidas::core::SampleSourceSupport::addSampleClientForTag().

Referenced by nidas::core::SamplePipeline::addSampleClientForTag().

◆ addSampleTag() [1/2]

void DSMSensor::addSampleTag ( const SampleTag * val)
privatevirtualinherited

◆ addSampleTag() [2/2]

void DSMSensor::addSampleTag ( SampleTag * val)
virtualinherited

Add a SampleTag to this sensor.

DSMSensor will own the SampleTag. Throw an exception the DSMSensor cannot support the sample (bad rate, wrong number of variables, etc). Note that a SampleTag may be changed after it has been added. addSampleTag() is called when a sensor is initialized from the sensor catalog. The SampleTag may be modified later if it is overridden in the actual sensor entry. For this reason, it is wise to wait to scan the SampleTags of a DSMSensor in the validate(), init() or open() methods, which are invoked after fromDOMElement.

Exceptions
nidas::util::InvalidParameterException

Reimplemented in nidas::dynld::iss::TiltSensor, nidas::dynld::iss::WICORSensor, and nidas::dynld::isff::DAUSensor.

References nidas::core::DSMSensor::_sampleTags, nidas::core::DSMSensor::_source, nidas::core::SampleSourceSupport::addSampleTag(), GET_DSM_ID, GET_SHORT_ID, nidas::core::DSMSensor::getName(), nidas::core::getSample(), and LOG_WARNING.

Referenced by nidas::dynld::isff::WisardMote::addMoteSampleTag(), nidas::dynld::iss::WICORSensor::addSampleTag(), nidas::dynld::RawSampleService::connect(), nidas::core::DSMSensor::fromDOMElement(), nidas::dynld::RawSampleService::fromDOMElement(), nidas::dynld::raf::SyncServer::initSensors(), and main().

◆ allowOpen()

bool nidas::core::DSMSensor::allowOpen ( )
inlineinherited

◆ applyConversions()

void DSMSensor::applyConversions ( SampleTag * stag,
SampleT< float > * outs,
float * results = 0 )
protectedinherited

Perform variable conversions for the variables in stag whose values and sample time have been set in outs.

This method can be used by subclasses to apply any variable conversions associated with the variables in the given SampleTag, using a general algorithm which loops over each value in each variable. The min/max value limits of a variable are applied also, so if a variable value is converted but lies outside the min/max range, the value is set to floatNAN. Typically this can be the last step applied to the output sample of a sensor's process() method, and note that the sample time must already be set in the output sample outs, since that time will be used to look up conversions in calibration files.

If results is non-null, then the converted values are written into results instead of overwriting the values in outs. This is used when one variable's results may be used to filter other variables without replacing the one variable's results. An example is the Ifan variable in the TRH WisardMote. results must point to enough memory to hold all of the values in outs, including for any Variables with multiple values (getLength() > 1).

See Variable::convert().

References fp, nidas::core::getSample(), and nidas::core::SampleTag::getVariables().

Referenced by nidas::dynld::isff::WisardMote::convert(), nidas::dynld::iss::WICORSensor::process(), nidas::dynld::iss::TiltSensor::process(), nidas::core::CharacterSensor::process(), and nidas::dynld::raf::A2D_Serial::process().

◆ buildIODevice()

IODevice * TwoD_USB::buildIODevice ( )
virtual

Factory method for an IODevice for this DSMSensor.

Must be implemented by derived classes.

Exceptions
nidas::util::IOException

Implements nidas::core::DSMSensor.

◆ buildSampleScanner()

SampleScanner * TwoD_USB::buildSampleScanner ( )
virtual

Factory method for a SampleScanner for this DSMSensor.

Must be implemented by derived classes.

Exceptions
nidas::util::InvalidParameterException

Implements nidas::core::DSMSensor.

◆ calcStatistics()

void nidas::core::DSMSensor::calcStatistics ( unsigned int periodUsec)
inlineinherited

Update the sensor sampling statistics.

Should be called every periodUsec by a user of this sensor.

Parameters
periodUsecStatistics period.

References nidas::core::DSMSensor::_scanner, and nidas::core::SampleScanner::calcStatistics().

◆ clearBuffer()

void nidas::core::DSMSensor::clearBuffer ( )
inlineprotectedinherited

◆ clearData()

void TwoD_Processing::clearData ( )
protectedvirtualinherited

◆ close()

void TwoD_USB::close ( )
virtual

close my associated device.

Exceptions
nidas::util::IOException;

Reimplemented from nidas::core::DSMSensor.

References nidas::core::DSMSensor::close(), and nidas::core::DerivedDataReader::getInstance().

◆ countParticle()

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

◆ createSamples()

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

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().

◆ deleteLooper()

void DSMSensor::deleteLooper ( )
staticinherited

◆ derivedDataNotify()

void TwoD_USB::derivedDataNotify ( const nidas::core::DerivedDataReader * s)
virtual

Method called on a DerivedDataClient by the DerivedDataReader thread when a new packet of derived data has been received.

This method is called on the DerivedDataClients in the sequence that they registered with the DerivedDataReader. The implementation of this method in a client should run quickly, to reduce the delay in calling successive clients in the list.

Exceptions

)

Implements nidas::core::DerivedDataClient.

References _trueAirSpeed, LOG_WARNING, and sendTrueAirspeed().

◆ distributeRaw()

void nidas::core::DSMSensor::distributeRaw ( const Sample * s)
inlineinherited

◆ executeXmlRpc()

virtual void nidas::core::DSMSensor::executeXmlRpc ( XmlRpc::XmlRpcValue & ,
XmlRpc::XmlRpcValue &  )
inlinevirtualinherited

Method invoked when the DSMEngineIntf XmlRpcServer receives a "SensorAction" request, with a "device" string matching the string that this DSMSensor registers via DSMEngine::registerSensorWithXmlRpc(string,DSMServer*).

The default base class method does nothing.

Reimplemented in nidas::dynld::DSC_A2DSensor, nidas::dynld::raf::A2D_Serial, nidas::dynld::raf::DSMAnalogSensor, and nidas::dynld::raf::PSI9116_Sensor.

Referenced by nidas::core::DSMEngineIntf::SensorAction::execute().

◆ expandString()

std::string nidas::core::DSMSensor::expandString ( const std::string & input) const
inlineinherited

Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue().

If curly brackets are not used, then the TOKEN should be delimited by a '/', a '.' or the end of string, e.g.: xxx/yyy/$ZZZ.dat

References nidas::core::DSMSensor::_dictionary, and nidas::core::Dictionary::expandString().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ findVariableIndex()

VariableIndex DSMSensor::findVariableIndex ( const std::string & vprefix)
protectedinherited

Search all the sample tags for a variable whose name starts with the given prefix, and return it's index in the list of variables in the sample tag.

If no such variable is found, return -1.

References nidas::core::getSample(), nidas::core::DSMSensor::getSampleTags(), and nidas::core::SampleTag::getVariables().

Referenced by nidas::dynld::isff::CSI_IRGA_Sonic::checkSampleTags(), and nidas::dynld::isff::NCAR_TRH::validate().

◆ flush()

void nidas::core::DSMSensor::flush ( )
inlinevirtualinherited

Implementation of SampleClient::flush().

This is where a DSMSensor's process() method could send out any buffered results that might be ready.

Implements nidas::core::SampleSource.

◆ fromDOMElement()

void DSMSensor::fromDOMElement ( const xercesc::DOMElement * node)
virtualinherited
Exceptions
nidas::util::InvalidParameterException

Implements nidas::core::DOMable.

Reimplemented in nidas::dynld::raf::IRIGSensor, nidas::core::SerialSensor, nidas::dynld::isff::Wind2D, nidas::dynld::iss::TiltSensor, and nidas::dynld::raf::LamsSensor.

References nidas::core::DSMSensor::_dictionary, nidas::core::DSMSensor::_rawSampleTag, nidas::core::DSMSensor::_rawSource, nidas::core::DSMSensor::_sampleTags, nidas::core::DSMSensor::addCalFile(), nidas::core::DSMSensor::addParameter(), nidas::core::SampleSourceSupport::addSampleTag(), nidas::core::DSMSensor::addSampleTag(), nidas::core::Parameter::createParameter(), nidas::core::DSMSensor::expandString(), nidas::core::Parameter::FLOAT_PARAM, nidas::core::DSMSensor::fromDOMElement(), nidas::core::SampleTag::fromDOMElement(), nidas::core::DSMSensor::getApplyVariableConversions(), nidas::core::DSMSensor::getClassName(), nidas::core::DSMSensor::getDefaultMode(), nidas::core::DSMSensor::getDSMConfig(), nidas::core::DSMSensor::getDSMId(), nidas::core::SampleTag::getDSMId(), nidas::core::DSMSensor::getFullSuffix(), nidas::core::SampleTag::getId(), nidas::core::DSMSensor::getName(), nidas::core::Variable::getName(), nidas::core::SampleTag::getRate(), nidas::core::getSample(), nidas::core::SampleTag::getSampleId(), nidas::core::DSMSensor::getSampleTags(), nidas::core::DSMSensor::getSensorId(), nidas::core::DSMSensor::getSite(), nidas::core::SampleTag::getSpSId(), nidas::core::DSMSensor::getStation(), nidas::core::DSMSensor::getSuffix(), nidas::core::DSMSensor::getVariableIterator(), nidas::core::Parameter::INT_PARAM, LOG_WARNING, MSECS_PER_SEC, nidas::core::DSMSensor::setApplyVariableConversions(), nidas::core::DSMSensor::setCatalogName(), nidas::core::DSMSensor::setClassName(), nidas::core::DSMSensor::setDefaultMode(), nidas::core::DSMSensor::setDepth(), nidas::core::DSMSensor::setDeviceName(), nidas::core::SampleTag::setDSMConfig(), nidas::core::SampleTag::setDSMId(), nidas::core::SampleTag::setDSMSensor(), nidas::core::DSMSensor::setDuplicateIdOK(), nidas::core::DSMSensor::setHeight(), nidas::core::DSMSensor::setLagSecs(), nidas::core::DSMSensor::setLatency(), nidas::core::DSMSensor::setLocation(), nidas::core::SampleTag::setRate(), nidas::core::SampleTag::setSampleId(), nidas::core::DSMSensor::setSensorId(), nidas::core::SampleTag::setSensorId(), nidas::core::DSMSensor::setStation(), nidas::core::SampleTag::setStation(), nidas::core::DSMSensor::setSuffix(), nidas::core::SampleTag::setSuffix(), nidas::core::DSMSensor::setTimeoutMsecs(), and nidas::core::DSMSensor::setTypeName().

Referenced by nidas::core::CharacterSensor::fromDOMElement(), nidas::core::DSMSensor::fromDOMElement(), nidas::dynld::raf::DSMArincSensor::fromDOMElement(), nidas::dynld::raf::DSMMesaSensor::fromDOMElement(), nidas::dynld::raf::IRIGSensor::fromDOMElement(), nidas::dynld::raf::LamsSensor::fromDOMElement(), and nidas::core::DSMConfig::sensorFromDOMElement().

◆ getApplyVariableConversions()

virtual bool nidas::core::DSMSensor::getApplyVariableConversions ( ) const
inlinevirtualinherited

◆ getBadTimeTagCount()

size_t nidas::core::DSMSensor::getBadTimeTagCount ( ) const
inlineinherited

◆ getBytesAvailable()

virtual size_t nidas::core::DSMSensor::getBytesAvailable ( ) const
inlinevirtualinherited

◆ getCalFile()

CalFile * DSMSensor::getCalFile ( const std::string & name)
inherited

◆ getCalFiles()

const std::map< std::string, CalFile * > & nidas::core::DSMSensor::getCalFiles ( )
inlineinherited

◆ getCatalogName()

virtual const std::string & nidas::core::DSMSensor::getCatalogName ( ) const
inlinevirtualinherited

◆ getClassName() [1/2]

virtual const std::string & nidas::core::DSMSensor::getClassName ( ) const
inlinevirtualinherited

◆ getClassName() [2/2]

const string DSMSensor::getClassName ( const xercesc::DOMElement * node,
const Project * project )
staticinherited

Crawl through the DOM tree for a DSMSensor to find the class name - scanning the catalog entry if necessary.

Exceptions
nidas::util::InvalidParameterException

References nidas::core::DSMSensor::getClassName(), and nidas::core::getSample().

◆ getClientCount()

int nidas::core::DSMSensor::getClientCount ( ) const
throw ( )
inlinevirtualinherited

How many SampleClients are currently in my list.

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_source, and nidas::core::SampleSourceSupport::getClientCount().

◆ getDefaultMode()

virtual int nidas::core::DSMSensor::getDefaultMode ( ) const
inlinevirtualinherited

How do I want to be opened.

The user can ignore it if they want to.

Returns
one of O_RDONLY, O_WRONLY or O_RDWR.

References nidas::core::DSMSensor::_defaultMode.

Referenced by nidas::core::DSMSensor::fromDOMElement(), and nidas::core::SensorOpener::run().

◆ getDepth()

float nidas::core::DSMSensor::getDepth ( ) const
inlineinherited

Get sensor depth below ground.

Returns
Depth of sensor below ground, in meters.

References nidas::core::DSMSensor::_height.

◆ getDepthString()

const std::string & nidas::core::DSMSensor::getDepthString ( ) const
inlineinherited

Get sensor depth below ground in a string.

Returns
Depth of sensor below ground, e.g. "5cm".

References nidas::core::DSMSensor::_depthString.

Referenced by SampleCounter::collectMetadata().

◆ getDeviceName()

virtual const std::string & nidas::core::DSMSensor::getDeviceName ( ) const
inlinevirtualinherited

◆ getDictionary()

const Dictionary & nidas::core::DSMSensor::getDictionary ( ) const
inlineinherited

◆ getDriverTimeTagUsecs()

virtual int nidas::core::DSMSensor::getDriverTimeTagUsecs ( ) const
inlinevirtualinherited

◆ getDSMConfig()

const DSMConfig * nidas::core::DSMSensor::getDSMConfig ( ) const
inlineinherited

◆ getDSMId()

unsigned int nidas::core::DSMSensor::getDSMId ( ) const
inlineinherited

◆ getDSMName()

const std::string & DSMSensor::getDSMName ( ) const
inherited

◆ getDuplicateIdOK()

bool nidas::core::DSMSensor::getDuplicateIdOK ( ) const
inlineinherited

getDuplicateIdOK will be true if it is OK for samples from this sensor to have identical IDs to samples from another sensor.

That other sensor must also agree that dupicateIdOK are OK. This can be useful if one may not be certain of the device name, e.g. /dev/ttyUSB*, that the system will assign to a sensor may use, but there are identifiers in the data returned that allow one to sort things out. In general, getDuplicateID is false.

References nidas::core::DSMSensor::_duplicateIdOK.

Referenced by nidas::core::Site::validate(), and nidas::core::DSMConfig::validateSensorAndSampleIds().

◆ getFullSuffix()

const std::string & nidas::core::DSMSensor::getFullSuffix ( ) const
inlineinherited

Full sensor suffix, the concatenation of the sensor suffix, if any, and the height or depth string, if any.

The full sensor suffix are words 2 and 3 in the dot-separated name: variable[.sensor][.height][.site]

References nidas::core::DSMSensor::_fullSuffix.

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ getHeight()

float nidas::core::DSMSensor::getHeight ( ) const
inlineinherited

Get sensor height above ground.

Returns
Height of sensor above ground, in meters. Nan if unknown.

References nidas::core::DSMSensor::_height.

◆ getHeightString()

const std::string & nidas::core::DSMSensor::getHeightString ( ) const
inlineinherited

◆ getId()

dsm_sample_id_t nidas::core::DSMSensor::getId ( ) const
inlineinherited

◆ getIODevice()

IODevice * nidas::core::DSMSensor::getIODevice ( ) const
inlineprotectedinherited

◆ getLagSecs()

virtual double nidas::core::DSMSensor::getLagSecs ( ) const
inlineprotectedvirtualinherited

Return the sampling lag for this sensor in seconds.

See getLagUsecs().

References nidas::core::DSMSensor::_lag, and USECS_PER_SEC.

◆ getLagUsecs()

virtual int nidas::core::DSMSensor::getLagUsecs ( ) const
inlineprotectedvirtualinherited

Return the sampling lag for this sensor in microseconds.

A positive lag means one should adjust the sample time tags for this sensor earlier in time to achieve a better estimate of the actual time to be associated for each sample. Derived classes can use this method in their process method to correct for inherent, constant, sampling lags of a sensor. A fixed sample lag, in fractional seconds, can be set for a sensor in the XML:

<sensor>
<parameter name="lag" type = "float" value="0.186"/>
</sensor>

The DSMSensor::fromDOM() method parses this parameter and sets the value of the lag.

References nidas::core::DSMSensor::_lag.

Referenced by nidas::core::CharacterSensor::adjustTimeTag(), nidas::dynld::raf::A2D_Serial::process(), nidas::dynld::raf::DSMMesaSensor::process(), and nidas::dynld::raf::UHSAS_Serial::process().

◆ getLatency()

virtual float nidas::core::DSMSensor::getLatency ( ) const
inlinevirtualinherited

◆ getLocation()

const std::string & DSMSensor::getLocation ( ) const
inherited

Location string.

A DSMConfig also has a Location. If the location has not been set for this DSMSensor, then the location of the DSMConfig will be returned.

References nidas::core::DSMSensor::_dsm, and nidas::core::DSMSensor::_location.

Referenced by SampleCounter::collectMetadata(), and nidas::core::DSMSensor::printStatusHeader().

◆ getLooper()

Looper * DSMSensor::getLooper ( )
staticprotectedinherited

Fetch a pointer to a static instance of a Looper thread.

Use this Looper for periodic callbacks, as for prompting, in support of a DSMSensor.

References nidas::core::DSMSensor::_looper, nidas::core::DSMSensor::_looperMutex, nidas::core::getSample(), and LOG_WARNING.

Referenced by nidas::dynld::isff::MOSMote::close(), nidas::dynld::isff::MOSMote::open(), nidas::core::SerialSensor::startPrompting(), and nidas::core::SerialSensor::stopPrompting().

◆ getMaxSampleLength()

unsigned int nidas::core::DSMSensor::getMaxSampleLength ( ) const
inlineinherited

◆ getMinSampleLength()

unsigned int nidas::core::DSMSensor::getMinSampleLength ( ) const
inlineinherited

◆ getName()

virtual std::string nidas::core::DSMSensor::getName ( ) const
inlinevirtualinherited

Return a name that should fully identify this sensor.

This name could be used in informative messages. The returned name has this format: dsmName:deviceName.

References nidas::core::DSMSensor::getDeviceName(), and nidas::core::DSMSensor::getDSMName().

Referenced by nidas::core::SensorHandler::add(), nidas::dynld::isff::WisardMote::addMoteSampleTag(), nidas::core::SamplePipeline::addSampleClient(), nidas::dynld::iss::TiltSensor::addSampleTag(), nidas::dynld::iss::WICORSensor::addSampleTag(), nidas::core::DSMSensor::addSampleTag(), nidas::core::SerialSensor::buildSampleScanner(), nidas::dynld::GPS_NMEA_Serial::buildSampleScanner(), nidas::dynld::raf::A2D_Serial::checkCkSum(), nidas::dynld::isff::WisardMote::checkCRC(), nidas::dynld::isff::WisardMote::checkEOM(), nidas::dynld::isff::ATIK_Sonic::checkSampleTags(), nidas::dynld::isff::CSAT3_Sonic::checkSampleTags(), nidas::dynld::isff::CSI_IRGA_Sonic::checkSampleTags(), nidas::dynld::raf::A2DBoardTempSensor::close(), nidas::dynld::raf::PPT_Serial::close(), nidas::core::SamplePipeline::connect(), nidas::dynld::raf::CVIProcessor::connectSource(), nidas::dynld::isff::WisardMote::createSampleTags(), nidas::dynld::isff::CSAT3_Sonic::dataMode(), nidas::dynld::raf::LamsSensor::derivedDataNotify(), nidas::core::RemoteSerialConnection::doEscCmds(), nidas::dynld::raf::A2D_Serial::dumpConfig(), nidas::dynld::raf::PSI9116_Sensor::executeXmlRpc(), nidas::core::CharacterSensor::fromDOMElement(), nidas::core::DSMSensor::fromDOMElement(), nidas::dynld::raf::Arinc_IRS::fromDOMElement(), nidas::dynld::raf::DSMArincSensor::fromDOMElement(), nidas::dynld::raf::DSMMesaSensor::fromDOMElement(), nidas::dynld::raf::IRIGSensor::fromDOMElement(), nidas::core::SerialSensor::fromDOMElement(), nidas::dynld::isff::Wind2D::fromDOMElement(), nidas::dynld::raf::LamsSensor::fromDOMElement(), nidas::core::SensorHandler::PolledDSMSensor::getName(), nidas::dynld::GPS_Novatel_Serial::gps_to_utc(), nidas::dynld::isff::NCAR_TRH::handleRawRH(), nidas::dynld::isff::NCAR_TRH::handleRawT(), nidas::core::SensorHandler::incrementFullBufferReads(), nidas::core::CharacterSensor::init(), nidas::dynld::DSC_Event::init(), nidas::dynld::ParoSci_202BG_P::init(), nidas::dynld::ParoSci_202BG_T::init(), nidas::dynld::raf::A2D_Serial::init(), nidas::dynld::raf::DSMArincSensor::init(), nidas::dynld::raf::UHSAS_Serial::init(), nidas::dynld::WxtSensor::init(), nidas::dynld::raf::TwoD64_USB::init_parameters(), nidas::dynld::raf::TwoD64_USB_v3::init_parameters(), init_parameters(), nidas::dynld::raf::TwoDS::init_parameters(), nidas::core::TimetagAdjuster::log(), nidas::dynld::isff::MOSMote::MOS_TimeSyncer::looperNotify(), nidas::core::SerialSensor::open(), nidas::dynld::DSC_A2DSensor::open(), nidas::dynld::isff::CSAT3_Sonic::open(), nidas::dynld::ModbusRTU::open(), nidas::dynld::raf::A2DBoardTempSensor::open(), nidas::dynld::raf::AlicatSDI::open(), nidas::dynld::raf::DSMAnalogSensor::open(), nidas::dynld::raf::LamsSensor::open(), nidas::dynld::raf::PIP_Serial::open(), open(), nidas::dynld::raf::UHSAS_Serial::open(), nidas::dynld::raf::VCSEL2_Serial::open(), nidas::dynld::raf::VCSEL_Serial::open(), nidas::dynld::raf::A2D_Serial::parseConfigLine(), nidas::dynld::isff::ATIK_Sonic::parseParameters(), nidas::dynld::isff::CSAT3_Sonic::parseParameters(), nidas::dynld::isff::CSI_IRGA_Sonic::parseParameters(), nidas::dynld::isff::Wind3D::parseParameters(), nidas::dynld::DSC_Event::printStatus(), nidas::dynld::DSC_FreqCounter::printStatus(), nidas::dynld::DSC_PulseCounter::printStatus(), nidas::dynld::raf::DSMArincSensor::printStatus(), nidas::dynld::raf::LamsSensor::printStatus(), printStatus(), nidas::core::DSMSensor::printStatusHeader(), nidas::dynld::iss::TiltSensor::process(), nidas::dynld::isff::WisardMote::process(), nidas::dynld::isff::CSI_IRGA_Sonic::process(), nidas::dynld::raf::PPT_Serial::process(), nidas::dynld::raf::PSI9116_Sensor::process(), nidas::dynld::raf::UDPArincSensor::process(), nidas::dynld::raf::UHSAS_Serial::process(), nidas::dynld::raf::TwoD64_USB::processImageRecord(), nidas::dynld::isff::CSAT3_Sonic::querySonic(), nidas::core::SampleScanner::readBuffer(), nidas::core::DatagramSampleScanner::readBuffer(), nidas::core::SampleScanner::readBuffer(), nidas::dynld::raf::A2D_Serial::readConfig(), nidas::dynld::isff::WisardMote::readHead(), nidas::dynld::DSC_FreqCounter::readParams(), nidas::dynld::ParoSci_202BG_P::readParams(), nidas::dynld::ParoSci_202BG_T::readParams(), nidas::core::DSMSensor::readSamples(), nidas::dynld::isff::CU_Coldwire::reportBadChecksum(), nidas::dynld::isff::CSI_CRX_Binary::reportBadCRC(), nidas::dynld::isff::CSI_IRGA_Sonic::reportBadCRC(), nidas::core::SensorOpener::run(), nidas::dynld::WxtSensor::scanSample(), nidas::dynld::raf::PSI9116_Sensor::sendCommand(), nidas::dynld::raf::DSMMesaSensor::sendFPGACodeToDriver(), nidas::dynld::raf::SppSerial::sendInitPacketAndCheckAck(), nidas::dynld::raf::BCPD_Serial::sendInitString(), nidas::dynld::raf::CDP_Serial::sendInitString(), nidas::dynld::raf::PIP_Serial::sendInitString(), nidas::dynld::raf::SPP100_Serial::sendInitString(), nidas::dynld::raf::SPP200_Serial::sendInitString(), nidas::dynld::raf::SPP300_Serial::sendInitString(), nidas::dynld::raf::UHSAS_Serial::sendInitString(), nidas::dynld::isff::CSAT3_Sonic::sendRateCommand(), sendTrueAirspeed(), nidas::core::DSMConfig::sensorFromDOMElement(), nidas::dynld::DSC_A2DSensor::setGainBipolar(), nidas::dynld::raf::DSMAnalogSensor::setGainBipolar(), nidas::core::CharacterSensor::setMessageParameters(), nidas::core::RemoteSerialConnection::setSensor(), PConfig::showAll(), nidas::core::CharacterSensor::startPrompting(), nidas::core::CharacterSensor::stopPrompting(), nidas::dynld::isff::CSAT3_Sonic::terminalMode(), nidas::dynld::isff::WisardMote::unpackTsoil(), nidas::core::CharacterSensor::validate(), nidas::core::DSMSensor::validate(), nidas::core::Site::validate(), nidas::dynld::A2DSensor::validate(), nidas::dynld::DSC_A2DSensor::validate(), nidas::dynld::DSC_FreqCounter::validate(), nidas::dynld::DSC_PulseCounter::validate(), nidas::dynld::GPS_NMEA_Serial::validate(), nidas::dynld::GPS_Novatel_Serial::validate(), nidas::dynld::IEEE_Float::validate(), nidas::dynld::isff::CSI_CRX_Binary::validate(), nidas::dynld::isff::CU_Coldwire::validate(), nidas::dynld::isff::NCAR_TRH::validate(), nidas::dynld::isff::Wind2D::validate(), nidas::dynld::isff::WisardMote::validate(), nidas::dynld::ModbusRTU::validate(), nidas::dynld::raf::A2D_Serial::validate(), nidas::dynld::raf::AlicatSDI::validate(), nidas::dynld::raf::CDP_Serial::validate(), nidas::dynld::raf::DSMAnalogSensor::validate(), nidas::dynld::raf::PIP_Serial::validate(), nidas::dynld::raf::PSI9116_Sensor::validate(), nidas::dynld::raf::SPP100_Serial::validate(), nidas::dynld::raf::SPP200_Serial::validate(), nidas::dynld::raf::SPP300_Serial::validate(), nidas::dynld::raf::SppSerial::validate(), nidas::dynld::raf::TwoD64_USB_v3::validate(), nidas::dynld::raf::UDPArincSensor::validate(), nidas::dynld::raf::UDPiPMSensor::validate(), nidas::dynld::Uio48Sensor::validate(), nidas::core::DSMConfig::validateSensorAndSampleIds(), nidas::core::CharacterSensor::validateSscanfs(), nidas::dynld::isff::Wind2D::validateSscanfs(), nidas::dynld::isff::Wind3D::validateSscanfs(), nidas::core::MessageStreamScanner::warnBackwardsStepTimeTag(), nidas::core::MessageStreamScanner::warnNonIncrTimeTag(), nidas::dynld::WxtSensor::wxtValidateSscanfs(), nidas::dynld::raf::A2D_Serial::~A2D_Serial(), and nidas::dynld::raf::UHSAS_Serial::~UHSAS_Serial().

◆ getNamespaceURI()

static const XMLCh * nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited

◆ getNonConstSampleTags()

virtual const std::list< SampleTag * > & nidas::core::DSMSensor::getNonConstSampleTags ( )
inlinevirtualinherited

We'll allow derived classes and calibration applications to change the SampleTags, so this method returns a list of non-constant SampleTags.

References nidas::core::DSMSensor::_sampleTags.

◆ getObservedDataRate()

float nidas::core::DSMSensor::getObservedDataRate ( ) const
inlineinherited

◆ getObservedSamplingRate()

float nidas::core::DSMSensor::getObservedSamplingRate ( ) const
inlineinherited

◆ getParameter()

const Parameter * DSMSensor::getParameter ( const std::string & name) const
inherited

◆ getParameters()

const std::list< const Parameter * > & nidas::core::DSMSensor::getParameters ( ) const
inlineinherited

◆ getProcessedSampleSource()

SampleSource * nidas::core::DSMSensor::getProcessedSampleSource ( )
inlinevirtualinherited

Implementation of SampleSource::getProcessedSampleSource().

Return the SampleSource for processed samples from this DSMSensor.

Implements nidas::core::SampleSource.

Referenced by nidas::dynld::RawSampleService::schedule().

◆ getRawSampleSource()

SampleSource * nidas::core::DSMSensor::getRawSampleSource ( )
inlinevirtualinherited

Implementation of SampleSource::getRawSampleSource().

Return the SampleSource for raw samples from this DSMSensor. A DSMSensor is only a SampleSource of raw samples when running in real-time, not during post-processing.

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_rawSource.

Referenced by nidas::core::RemoteSerialConnection::close(), and nidas::dynld::RawSampleService::schedule().

◆ getRawSampleTag()

const SampleTag * nidas::core::DSMSensor::getRawSampleTag ( ) const
inlineinherited

◆ getReadFd()

virtual int nidas::core::DSMSensor::getReadFd ( ) const
inlinevirtualinherited

◆ getResolution()

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

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 nidas::dynld::raf::TwoD_Processing::_resolutionMeters.

Referenced by Tap2DToTAS(), Tap2DToTAS(), and TASToTap2D().

◆ getResolutionMicron()

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

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 nidas::dynld::raf::TwoD_Processing::_resolutionMicron.

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

◆ getSampleScanner()

SampleScanner * nidas::core::DSMSensor::getSampleScanner ( ) const
inlineprotectedinherited

◆ getSampleStats()

const SampleStats & nidas::core::DSMSensor::getSampleStats ( ) const
inlinevirtualinherited

◆ getSampleTagIterator()

SampleTagIterator nidas::core::DSMSensor::getSampleTagIterator ( ) const
inlinevirtualinherited

◆ getSampleTags() [1/2]

std::list< SampleTag * > & nidas::core::DSMSensor::getSampleTags ( )
inlineinherited

Non-const method to get a list of non-const pointers to SampleTags.

References nidas::core::DSMSensor::_sampleTags.

◆ getSampleTags() [2/2]

std::list< const SampleTag * > nidas::core::DSMSensor::getSampleTags ( ) const
inlinevirtualinherited

Implementation of SampleSource::getSampleTags().

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_source, and nidas::core::SampleSourceSupport::getSampleTags().

Referenced by nidas::dynld::isff::WisardMote::addMoteSampleTag(), nidas::dynld::iss::TiltSensor::addSampleTag(), nidas::dynld::iss::WICORSensor::addSampleTag(), nidas::dynld::isff::ATIK_Sonic::checkSampleTags(), nidas::dynld::isff::CSAT3_Sonic::checkSampleTags(), nidas::dynld::isff::CSI_IRGA_Sonic::checkSampleTags(), nidas::dynld::isff::Wind3D::checkSampleTags(), nidas::core::DSMSensor::findVariableIndex(), nidas::core::DSMSensor::fromDOMElement(), nidas::dynld::raf::IRIGSensor::fromDOMElement(), nidas::core::SampleTagIterator::hasNext(), nidas::core::CharacterSensor::init(), nidas::dynld::DSC_Event::init(), nidas::dynld::raf::A2D_Serial::init(), nidas::dynld::raf::DSMArincSensor::init(), init(), nidas::dynld::raf::TwoDS::init(), nidas::dynld::raf::UHSAS_Serial::init(), nidas::dynld::raf::TwoD64_USB::init_parameters(), nidas::dynld::raf::TwoD64_USB_v3::init_parameters(), nidas::dynld::raf::DSMArincSensor::open(), nidas::dynld::iss::WICORSensor::process(), nidas::dynld::iss::TiltSensor::process(), nidas::dynld::isff::CU_Coldwire::process(), nidas::dynld::isff::CSI_IRGA_Sonic::process(), nidas::dynld::isff::DAUSensor::process(), nidas::dynld::raf::A2D_Serial::process(), nidas::dynld::raf::SyncRecordSource::selectVariablesFromSensor(), PConfig::showCalFiles(), nidas::core::CharacterSensor::validate(), nidas::dynld::A2DSensor::validate(), nidas::dynld::DSC_FreqCounter::validate(), nidas::dynld::DSC_PulseCounter::validate(), nidas::dynld::GPS_NMEA_Serial::validate(), nidas::dynld::GPS_Novatel_Serial::validate(), nidas::dynld::IEEE_Float::validate(), nidas::dynld::isff::CSI_CRX_Binary::validate(), nidas::dynld::isff::CU_Coldwire::validate(), nidas::dynld::isff::Licor7500::validate(), nidas::dynld::isff::NCAR_TRH::validate(), nidas::dynld::isff::Wind2D::validate(), nidas::dynld::isff::WisardMote::validate(), nidas::dynld::ModbusRTU::validate(), nidas::dynld::raf::A2D_Serial::validate(), nidas::dynld::raf::DSMAnalogSensor::validate(), nidas::dynld::raf::PSI9116_Sensor::validate(), nidas::dynld::raf::SppSerial::validate(), nidas::dynld::raf::TwoD64_USB_v3::validate(), nidas::dynld::Uio48Sensor::validate(), and nidas::core::DSMConfig::validateSensorAndSampleIds().

◆ getSensorId()

unsigned int nidas::core::DSMSensor::getSensorId ( ) const
inlineinherited

◆ getSite()

const Site * DSMSensor::getSite ( ) const
inherited

What Site am I associated with?

References nidas::core::DSMSensor::_dsm.

Referenced by SampleCounter::collectMetadata(), and nidas::core::DSMSensor::fromDOMElement().

◆ getStation()

int nidas::core::DSMSensor::getStation ( ) const
inlineinherited

◆ getSuffix()

const std::string & nidas::core::DSMSensor::getSuffix ( ) const
inlineinherited

Sensor suffix, which is added to variable names.

It is only necessary to have a sensor suffix to make variable names unique. For example, if there are multiple sensors at the same height, with common variable names, then one can use a sensor suffix to make unique names. The sensor suffix is the second dot-separated word in a variable name, where only the first word is required: variable[.sensor][.height][.site]

References nidas::core::DSMSensor::_suffix.

Referenced by nidas::core::DSMSensor::fromDOMElement(), nidas::core::DSMSensor::MyDictionary::getTokenValue(), nidas::dynld::raf::TwoD64_USB::processImageRecord(), sensorTitle(), nidas::core::DSMSensor::setDepth(), nidas::core::DSMSensor::setDepth(), nidas::core::DSMSensor::setHeight(), and nidas::core::DSMSensor::setHeight().

◆ getTASRate()

int nidas::dynld::raf::TwoD_USB::getTASRate ( ) const
inline

◆ getTimeoutCount()

int nidas::core::DSMSensor::getTimeoutCount ( ) const
inlineinherited

◆ getTimeoutMsecs()

virtual int nidas::core::DSMSensor::getTimeoutMsecs ( ) const
inlinevirtualinherited

◆ getTokenValue()

bool nidas::core::DSMSensor::getTokenValue ( const std::string & token,
std::string & value ) const
inlineinherited

Implement a lookup for tokens that I know about, like $HEIGHT.

For other tokens, call getDSMConfig()->getTokenValue(token,value);

References nidas::core::DSMSensor::_dictionary, and nidas::core::DSMSensor::MyDictionary::getTokenValue().

◆ getTypeName()

virtual const std::string & nidas::core::DSMSensor::getTypeName ( void ) const
inlinevirtualinherited

Get the type name of this sensor.

References nidas::core::DSMSensor::_typeName.

◆ getVariableIterator()

VariableIterator DSMSensor::getVariableIterator ( ) const
inherited

◆ getWriteFd()

virtual int nidas::core::DSMSensor::getWriteFd ( ) const
inlinevirtualinherited

◆ incrementTimeoutCount()

void nidas::core::DSMSensor::incrementTimeoutCount ( )
inlineinherited

◆ init()

void TwoD_USB::init ( )
virtual

◆ init_parameters()

void TwoD_USB::init_parameters ( )
protectedvirtual

◆ ioctl()

virtual void nidas::core::DSMSensor::ioctl ( int request,
void * buf,
size_t len )
inlinevirtualinherited

Perform an ioctl on the device.

request is an integer value which must be supported by the device. Normally this is a value from a header file for the device.

Exceptions
nidas::util::IOException

References nidas::core::DSMSensor::_iodev, nidas::core::IODevice::ioctl(), and len.

Referenced by nidas::dynld::raf::IRIGSensor::checkClock(), nidas::dynld::IR104_Relays::clearOutputs(), nidas::dynld::DSC_A2DSensor::close(), nidas::dynld::DSC_PulseCounter::close(), nidas::dynld::raf::LamsSensor::derivedDataNotify(), nidas::dynld::IR104_Relays::getInputs(), nidas::dynld::raf::IRIGSensor::getIRIGTime(), nidas::dynld::IR104_Relays::getOutputs(), nidas::dynld::raf::DSMAnalogSensor::getTemp(), nidas::dynld::DSC_A2DSensor::open(), nidas::dynld::DSC_Event::open(), nidas::dynld::DSC_FreqCounter::open(), nidas::dynld::DSC_PulseCounter::open(), nidas::dynld::IR104_Relays::open(), nidas::dynld::raf::DSMAnalogSensor::open(), nidas::dynld::raf::DSMArincSensor::open(), nidas::dynld::raf::DSMMesaSensor::open(), nidas::dynld::raf::LamsSensor::open(), open(), nidas::dynld::DSC_Event::printStatus(), nidas::dynld::DSC_FreqCounter::printStatus(), nidas::dynld::DSC_PulseCounter::printStatus(), nidas::dynld::raf::DSMArincSensor::printStatus(), nidas::dynld::raf::LamsSensor::printStatus(), printStatus(), nidas::dynld::raf::DSMMesaSensor::sendFPGACodeToDriver(), sendTrueAirspeed(), nidas::dynld::raf::IRIGSensor::setIRIGTime(), nidas::dynld::IR104_Relays::setOutputs(), and nidas::dynld::IR104_Relays::setOutputs().

◆ nextSample()

virtual Sample * nidas::core::DSMSensor::nextSample ( )
inlinevirtualinherited

◆ NumberOfDiodes()

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

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 nidas::dynld::raf::TwoD_Processing::clearData(), nidas::dynld::raf::TwoD_Processing::countParticle(), init(), and nidas::dynld::raf::TwoD_Processing::processParticleSlice().

◆ open()

void TwoD_USB::open ( int flags)
virtual

◆ operator=()

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

No copying.

◆ printStatus()

void TwoD_USB::printStatus ( std::ostream & ostr)
virtual

◆ printStatusHeader()

void DSMSensor::printStatusHeader ( std::ostream & ostr)
inherited

◆ printStatusTrailer()

void DSMSensor::printStatusTrailer ( std::ostream & ostr)
inherited

◆ process()

virtual bool nidas::core::DSMSensor::process ( const Sample * ,
std::list< const Sample * > & result )
pure virtualinherited

Apply further necessary processing to a raw sample from this DSMSensor.

Return the resultant sample(s) in result. The default implementation of process() simply puts the input Sample into result.

Implemented in nidas::core::CharacterSensor, nidas::dynld::DSC_Event, nidas::dynld::DSC_FreqCounter, nidas::dynld::DSC_PulseCounter, nidas::dynld::ParoSci_202BG_P, nidas::dynld::ParoSci_202BG_T, nidas::dynld::raf::A2DBoardTempSensor, nidas::dynld::raf::DSMAnalogSensor, nidas::dynld::raf::DSMArincSensor, nidas::dynld::A2DSensor, nidas::dynld::isff::WisardMote, nidas::dynld::Uio48Sensor, nidas::dynld::raf::IRIGSensor, nidas::dynld::GPS_NMEA_Serial, nidas::dynld::GPS_Novatel_Serial, nidas::dynld::IEEE_Float, nidas::dynld::isff::CSAT3_Sonic, nidas::dynld::isff::CSI_IRGA_Sonic, nidas::dynld::isff::DAUSensor, nidas::dynld::isff::MOSMote, nidas::dynld::ModbusRTU, nidas::dynld::raf::A2D_Serial, nidas::dynld::raf::BCPD_Serial, nidas::dynld::raf::CDP_Serial, nidas::dynld::raf::CVI_LV_Input, nidas::dynld::raf::DSMMesaSensor, nidas::dynld::raf::LamsNetSensor, nidas::dynld::raf::LamsSensor, nidas::dynld::raf::PHIPS_UDP, nidas::dynld::raf::PIP_Image, nidas::dynld::raf::PIP_Serial, nidas::dynld::raf::PPT_Serial, nidas::dynld::raf::PSI9116_Sensor, nidas::dynld::raf::SidsNetSensor, nidas::dynld::raf::SPP100_Serial, nidas::dynld::raf::SPP200_Serial, nidas::dynld::raf::SPP300_Serial, nidas::dynld::raf::TwoD32_USB, nidas::dynld::raf::TwoD64_USB, nidas::dynld::raf::TwoD_House, nidas::dynld::raf::TwoDS, nidas::dynld::raf::UDPArincSensor, nidas::dynld::raf::UHSAS_Serial, nidas::dynld::raf::VCSEL_Serial, nidas::dynld::raf::Watlow, nidas::dynld::TSI_CPC3772, and nidas::dynld::WxtSensor.

Referenced by nidas::core::DSMSensor::receive().

◆ processParticleSlice()

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

◆ read() [1/2]

virtual size_t nidas::core::DSMSensor::read ( void * buf,
size_t len )
inlinevirtualinherited

◆ read() [2/2]

virtual size_t nidas::core::DSMSensor::read ( void * buf,
size_t len,
int msecTimeout )
inlinevirtualinherited

Read from the device with a timeout.

Exceptions
nidas::util::IOException

References nidas::core::DSMSensor::_iodev, len, and nidas::core::IODevice::read().

◆ readBuffer() [1/2]

bool nidas::core::DSMSensor::readBuffer ( )
inlineinherited

◆ readBuffer() [2/2]

bool nidas::core::DSMSensor::readBuffer ( int msecTimeout)
inlineinherited

◆ readSample()

Sample * DSMSensor::readSample ( )
virtualinherited

Return the next sample.

Buffer(s) will be read if necessary.

Exceptions
nidas::util::IOException

References nidas::core::getSample(), nidas::core::DSMSensor::nextSample(), and nidas::core::DSMSensor::readBuffer().

◆ readSamples()

bool DSMSensor::readSamples ( )
virtualinherited

Read samples from my associated file descriptor, and distribute() them to my RawSampleClient's.

This method is called by SensorHander, when select/poll indicates that data is available on the file descriptor returned by getReadFd(). This is a convienence method which does a readBuffer() to read available data from the DSMSensor into a buffer, and then repeatedly calls nextSample() to extract all samples out of that buffer.

Exceptions
nidas::util::IOException;

References nidas::core::DSMSensor::_rawSource, nidas::core::SampleSourceSupport::distribute(), DLOG, nidas::core::DSMSensor::getDSMConfig(), nidas::core::DSMSensor::getDSMId(), nidas::core::DSMSensor::getName(), nidas::core::getSample(), nidas::core::DSMSensor::getSensorId(), nidas::core::DSMSensor::nextSample(), and nidas::core::DSMSensor::readBuffer().

◆ receive()

bool DSMSensor::receive ( const Sample * s)
virtualinherited

A DSMSensor can be used as a SampleClient, meaning it receives its own raw samples.

In real-time operations, a DSMSensor can be added as a raw SampleClient of itself, using addRawSampleClient(). In post-processing, a DSMSensor typically receives samples with its own sample id from a SampleSorter. receive() then applies further processing via the process() method.

Implements nidas::core::SampleClient.

References nidas::core::DSMSensor::_source, nidas::core::SampleSourceSupport::distribute(), nidas::core::getSample(), and nidas::core::DSMSensor::process().

◆ removeCalFiles()

void DSMSensor::removeCalFiles ( )
inherited

Remove all CalFiles.

References nidas::core::DSMSensor::_calFiles.

Referenced by nidas::core::DSMSensor::~DSMSensor().

◆ removeSampleClient()

void nidas::core::DSMSensor::removeSampleClient ( SampleClient * c)
throw ( )
inlinevirtualinherited

Remove a SampleClient from this SampleSource This will also remove a SampleClient if it has been added with addSampleClientForTag().

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_source, and nidas::core::SampleSourceSupport::removeSampleClient().

Referenced by nidas::core::SamplePipeline::removeSampleClient(), and nidas::core::SamplePipeline::removeSampleClientForTag().

◆ removeSampleClientForTag()

void nidas::core::DSMSensor::removeSampleClientForTag ( SampleClient * client,
const SampleTag * tag )
throw ( )
inlinevirtualinherited

Remove a SampleClient for a given SampleTag from this SampleSource.

The pointer to the SampleClient must remain valid, until after it is removed.

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_source, and nidas::core::SampleSourceSupport::removeSampleClientForTag().

Referenced by nidas::core::SamplePipeline::removeSampleClientForTag().

◆ removeSampleTag() [1/2]

void DSMSensor::removeSampleTag ( const SampleTag * val)
privatevirtualinherited

DSMSensor does not provide public support for SampleSource::removeSampleTag(const SampleTag* val)

Exceptions

)

Implements nidas::core::SampleSource.

References nidas::core::getSample().

◆ removeSampleTag() [2/2]

void DSMSensor::removeSampleTag ( SampleTag * val)
virtualinherited

◆ reopenOnIOException()

virtual bool nidas::core::DSMSensor::reopenOnIOException ( ) const
inlinevirtualinherited

Whether to reopen this sensor on an IOException.

The base method returns true. Over-ride if a reopen should not be attempted.

◆ saveBuffer()

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

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 nidas::dynld::raf::TwoD_Processing::_saveBuffer, nidas::dynld::raf::TwoD_Processing::_savedAlloc, nidas::dynld::raf::TwoD_Processing::_savedBytes, and nidas::core::getSample().

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

◆ sendTrueAirspeed()

void TwoD_USB::sendTrueAirspeed ( float tas)
protectedvirtual

Encode and send the true airspeed to the USB driver, which will in turn send it to the probe.

References nidas::core::DSMSensor::getName(), nidas::core::getSample(), nidas::core::DSMSensor::ioctl(), LOG_WARNING, TASToTap2D(), and USB2D_SET_TAS.

Referenced by derivedDataNotify(), and open().

◆ setApplyVariableConversions()

virtual void nidas::core::DSMSensor::setApplyVariableConversions ( bool val)
inlinevirtualinherited

◆ setCatalogName()

virtual void nidas::core::DSMSensor::setCatalogName ( const std::string & val)
inlinevirtualinherited

Set the name of the catalog entry for this sensor.

References nidas::core::DSMSensor::_catalogName, and nidas::core::getSample().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ setClassName()

virtual void nidas::core::DSMSensor::setClassName ( const std::string & val)
inlinevirtualinherited

Set the class name.

In the usual usage this method is not used, and getClassName() is over-ridden in a derived class to return a constant string.

References nidas::core::DSMSensor::_className, and nidas::core::getSample().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ setDefaultMode()

virtual void nidas::core::DSMSensor::setDefaultMode ( int val)
inlinevirtualinherited

◆ setDepth() [1/2]

void DSMSensor::setDepth ( const std::string & val)
inherited

Set sensor depth below ground via a string which is added to variable names.

Parameters
valString containing sensor below and units in meters (m) or centimeters(cm), e.g. "5cm". This depth string is added to all the variable names, with a "." separator, so that a variable "Tsoil" for this sensor becomes "Tsoil.5cm".

References nidas::core::DSMSensor::_depthString, nidas::core::DSMSensor::_height, nidas::core::DSMSensor::_heightString, nidas::core::floatNAN, nidas::core::getSample(), nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setFullSuffix().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ setDepth() [2/2]

void DSMSensor::setDepth ( float val)
inherited

Set sensor depth below ground.

Parameters
valdepth below ground, in meters. The depth is converted to centimeters and is added to all the variable names, with a "." separator, so that a variable "Tsoil" for this sensor becomes "Tsoil.5cm".

References nidas::core::DSMSensor::_depthString, nidas::core::DSMSensor::_height, nidas::core::DSMSensor::_heightString, nidas::core::getSample(), nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setFullSuffix().

◆ setDeviceName()

virtual void nidas::core::DSMSensor::setDeviceName ( const std::string & val)
inlinevirtualinherited

Set the name of the system device that the sensor is connected to.

Parameters
valName of device, e.g. "/dev/xxx0".

References nidas::core::DSMSensor::_devname, and nidas::core::getSample().

Referenced by nidas::core::DSMSensor::fromDOMElement(), and main().

◆ setDriverTimeTagUsecs()

virtual void nidas::core::DSMSensor::setDriverTimeTagUsecs ( int val)
inlinevirtualinherited

◆ setDSMConfig()

void DSMSensor::setDSMConfig ( const DSMConfig * val)
inherited

◆ setDSMId()

void nidas::core::DSMSensor::setDSMId ( unsigned int val)
inlineinherited

◆ setDuplicateIdOK()

void nidas::core::DSMSensor::setDuplicateIdOK ( bool val)
inlineinherited

Set the duplicate ID attribute of this DSMSensor.

References nidas::core::DSMSensor::_duplicateIdOK, and nidas::core::getSample().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ setFullSuffix()

void nidas::core::DSMSensor::setFullSuffix ( const std::string & val)
inlineprotectedinherited

◆ setHeight() [1/2]

void DSMSensor::setHeight ( const std::string & val)
inherited

Set sensor height above ground via a string which is added to variable names.

Parameters
valString containing sensor height and units in meters (m) or centimeters(cm), e.g. "15m". This height string is added to all the variable names, with a "." separator, so that a variable "u" for this sensor becomes "u.15m".

References nidas::core::DSMSensor::_depthString, nidas::core::DSMSensor::_height, nidas::core::DSMSensor::_heightString, nidas::core::floatNAN, nidas::core::getSample(), nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setFullSuffix().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ setHeight() [2/2]

void DSMSensor::setHeight ( float val)
inherited

Set sensor height above ground.

Parameters
valheight above ground, in meters. The height is added to all the variable names, with a "." separator, so that a variable "u" for this sensor becomes "u.15m".

References nidas::core::DSMSensor::_depthString, nidas::core::DSMSensor::_height, nidas::core::DSMSensor::_heightString, nidas::core::getSample(), nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setFullSuffix().

◆ setId()

void nidas::core::DSMSensor::setId ( dsm_sample_id_t val)
inlineinherited

Set the various levels of the sensor identification.

A sensor ID is a 32-bit value comprised of four parts: 6-bit sample type id (not used by DSMSensor), 10-bit DSM id, and 16-bit sensor+sample ids.

References nidas::core::DSMSensor::_id, and SET_FULL_ID.

◆ setIODevice()

void nidas::core::DSMSensor::setIODevice ( IODevice * val)
inlineinherited

Set the IODevice for this sensor.

DSMSensor then owns the pointer and will delete it in its destructor.

References nidas::core::DSMSensor::_iodev, and nidas::core::getSample().

◆ setLagSecs()

virtual void nidas::core::DSMSensor::setLagSecs ( double val)
inlineprotectedvirtualinherited

Set the sampling lag for this sensor in seconds.

This lag should then used to correct the timetags of the processed samples in the process() method of derived classes. Note that this lag is not used to alter the timetags of the raw samples. Raw samples are saved with the un-altered timetag that was determined at the moment they were sampled.

The lag is stored as a signed integer of microseconds, so lags should be between += 2147 seconds. No warning or exception is given if the value exceeds that limit. If your lag is greater than that I suggest you junk your sensor! A positive lag means one should adjust the sample time tags for this sensor earlier in time to achieve a better estimate of the actual time to be associated for each sample. A fixed sample lag, in fractional seconds, can be set for a sensor in the XML:

<parameter name="lag" type = "float" value="0.186"/>

The DSMSensor::fromDOM() method parses this parameter and calls this method to set the lag. process() methods in derived classes must apply this lag value. The DSMSensor base class does not adjust time tags of processed samples.

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

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ setLatency()

virtual void nidas::core::DSMSensor::setLatency ( float val)
inlinevirtualinherited

Set desired latency, providing some control over the response time vs buffer efficiency tradeoff.

Setting a latency of 1/10 sec means buffer data in the driver for a 1/10 sec, then send the data to user space. Generally it should be set before doing a sensor open().

Parameters
valLatency, in seconds.
Exceptions
nidas::util::InvalidParameterException

References nidas::core::DSMSensor::_latency, and nidas::core::getSample().

Referenced by nidas::dynld::A2DSensor::A2DSensor(), nidas::core::DSMSensor::fromDOMElement(), and nidas::dynld::A2DSensor::validate().

◆ setLocation()

void nidas::core::DSMSensor::setLocation ( const std::string & val)
inlineinherited

◆ setSampleScanner()

void nidas::core::DSMSensor::setSampleScanner ( SampleScanner * val)
inlineinherited

Set the SampleScanner for this sensor.

DSMSensor then owns the pointer and will delete it in its destructor.

References nidas::core::DSMSensor::_scanner, and nidas::core::getSample().

◆ setSensorId()

void nidas::core::DSMSensor::setSensorId ( unsigned int val)
inlineinherited

◆ setStation()

void DSMSensor::setStation ( int val)
inherited

◆ setSuffix()

void DSMSensor::setSuffix ( const std::string & val)
inherited

◆ setTASRate()

void nidas::dynld::raf::TwoD_USB::setTASRate ( int val)
inline

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

Referenced by init_parameters().

◆ setTimeoutMsecs()

virtual void nidas::core::DSMSensor::setTimeoutMsecs ( int val)
inlinevirtualinherited

Set the sensor timeout value in milliseconds.

A value of 0 means no timeout (e.g. infinite). If no data is received for this period, then the sensor is closed, and re-opened. For efficiency reasons, the system may not actually detect a sensor timeout of less than 1 second, so setting it to less than 1000 milliseconds will likely not reduce the time before a sensor timeout is detected.

References nidas::core::DSMSensor::_timeoutMsecs, and nidas::core::getSample().

Referenced by nidas::core::RemoteSerialConnection::close(), nidas::core::RemoteSerialConnection::doEscCmds(), nidas::core::DSMSensor::fromDOMElement(), and nidas::dynld::ModbusRTU::open().

◆ setTypeName()

virtual void nidas::core::DSMSensor::setTypeName ( const std::string & val)
inlinevirtualinherited

Set the type name of this sensor, e.g.: "ACME Model 99 Mach7 Particle Disambiguator".

This is meant for descriptive purposes only, and is not meant to change the behavior of a sensor object.

References nidas::core::DSMSensor::_typeName, and nidas::core::getSample().

Referenced by nidas::core::DSMSensor::fromDOMElement().

◆ setupBuffer()

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

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 nidas::dynld::raf::TwoD_Processing::_saveBuffer, nidas::dynld::raf::TwoD_Processing::_savedAlloc, nidas::dynld::raf::TwoD_Processing::_savedBytes, and nidas::core::getSample().

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

◆ Tap2DToTAS() [1/2]

float TwoD_USB::Tap2DToTAS ( const Tap2D * t2d) const
virtual

Reverse the true airspeed encoding.

Used to extract TAS from recorded records. The *v1 method is for the first generation TAS clock, the second generation gives finer resolution (07/01/2009). Second generation chip is an Analog Devices AD5255.

Parameters
t2dthe Tap2D to extract from.
theprobe frequency.
Returns
true airspeed in m/s.
Todo
2DP is going to need an extra divide by 10 at the end.

Reimplemented in nidas::dynld::raf::TwoD64_USB_v3.

References nidas::dynld::raf::TwoD_Processing::getResolution(), and nidas::core::getSample().

Referenced by nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ Tap2DToTAS() [2/2]

float TwoD_USB::Tap2DToTAS ( const Tap2Dv1 * t2d) const
virtual

The first generation used the Maxim 5418 chip.

This is for legacy data (PACDEX through VOCALS).

References nidas::dynld::raf::TwoD_Processing::getResolution(), and nidas::core::getSample().

◆ TASToTap2D()

int TwoD_USB::TASToTap2D ( void * t2d,
float tas )
virtual

Build the struct above from the true airspeed (in m/s).

Encodes for Analog Devices AD5255.

Parameters
t2dthe Tap2D to be filled
tasthe true airspeed in m/s

Reimplemented in nidas::dynld::raf::TwoD64_USB_v3.

References DefaultTrueAirspeed, nidas::dynld::raf::TwoD_Processing::getResolution(), and nidas::core::getSample().

Referenced by sendTrueAirspeed().

◆ toDOMElement()

xercesc::DOMElement * DSMSensor::toDOMElement ( xercesc::DOMElement * node,
bool complete ) const
virtualinherited
Exceptions
xercesc::DOMException;

Reimplemented from nidas::core::DOMable.

Referenced by nidas::core::DSMSensor::toDOMParent().

◆ toDOMParent()

xercesc::DOMElement * DSMSensor::toDOMParent ( xercesc::DOMElement * parent,
bool complete ) const
virtualinherited

◆ trimUnparsed()

void DSMSensor::trimUnparsed ( SampleTag * stag,
SampleT< float > * outs,
int nparsed )
protectedinherited

Fill with floatNAN all the values past nparsed values in output sample outs, and trim the length of the sample to match the length of the variables in SampleTag stag.

process() methods which support partial scans of messages can use this to finalize an output sample according to the SampleTag that was matched with it and the number of values parsed.

References nidas::core::floatNAN, fp, nidas::core::getSample(), and nidas::core::SampleTag::getVariables().

Referenced by nidas::dynld::iss::WICORSensor::process().

◆ validate()

void DSMSensor::validate ( )
virtualinherited

validate() is called once on a DSMSensor after it has been configured, but before open() or init() are called.

Exceptions
nidas::util::InvalidParameterException

Reimplemented in nidas::core::CharacterSensor, nidas::dynld::A2DSensor, nidas::dynld::DSC_A2DSensor, nidas::dynld::DSC_FreqCounter, nidas::dynld::DSC_PulseCounter, nidas::dynld::GPS_NMEA_Serial, nidas::dynld::GPS_Novatel_Serial, nidas::dynld::IEEE_Float, nidas::dynld::isff::CSI_CRX_Binary, nidas::dynld::isff::CU_Coldwire, nidas::dynld::isff::Licor7500, nidas::dynld::isff::NCAR_TRH, nidas::dynld::isff::Wind2D, nidas::dynld::isff::Wind3D, nidas::dynld::isff::WisardMote, nidas::dynld::ModbusRTU, nidas::dynld::raf::A2D_Serial, nidas::dynld::raf::AlicatSDI, nidas::dynld::raf::BCPD_Serial, nidas::dynld::raf::CDP_Serial, nidas::dynld::raf::DSMAnalogSensor, nidas::dynld::raf::PIP_Serial, nidas::dynld::raf::PSI9116_Sensor, nidas::dynld::raf::SPP100_Serial, nidas::dynld::raf::SPP200_Serial, nidas::dynld::raf::SPP300_Serial, nidas::dynld::raf::SppSerial, nidas::dynld::raf::TwoD64_USB_v3, nidas::dynld::raf::UDPArincSensor, nidas::dynld::raf::UDPiPMSensor, nidas::dynld::TSI_CPC3772, and nidas::dynld::Uio48Sensor.

References nidas::core::DSMSensor::getDeviceName(), nidas::core::DSMSensor::getDSMConfig(), nidas::core::DSMSensor::getName(), and nidas::core::DSMSensor::getSensorId().

Referenced by nidas::core::CharacterSensor::validate(), nidas::core::DSMConfig::validate(), nidas::dynld::A2DSensor::validate(), nidas::dynld::DSC_FreqCounter::validate(), nidas::dynld::DSC_PulseCounter::validate(), nidas::dynld::raf::TwoD64_USB_v3::validate(), and nidas::dynld::Uio48Sensor::validate().

◆ write()

virtual size_t nidas::core::DSMSensor::write ( const void * buf,
size_t len )
inlinevirtualinherited

Member Data Documentation

◆ _1dcID

dsm_sample_id_t nidas::dynld::raf::TwoD_Processing::_1dcID
protectedinherited

◆ _2dcID

dsm_sample_id_t nidas::dynld::raf::TwoD_Processing::_2dcID
protectedinherited

◆ _applyVariableConversions

bool nidas::core::DSMSensor::_applyVariableConversions
privateinherited

◆ _calFiles

std::map<std::string,CalFile*> nidas::core::DSMSensor::_calFiles
privateinherited

◆ _catalogName

std::string nidas::core::DSMSensor::_catalogName
privateinherited

◆ _className

std::string nidas::core::DSMSensor::_className
privateinherited

Class name attribute of this sensor.

Only used here for informative messages.

Referenced by nidas::core::DSMSensor::getClassName(), and nidas::core::DSMSensor::setClassName().

◆ _constParameters

std::list<const Parameter*> nidas::core::DSMSensor::_constParameters
privateinherited

List of const pointers to Parameters for providing via getParameters().

Referenced by nidas::core::DSMSensor::addParameter(), and nidas::core::DSMSensor::getParameters().

◆ _dead_time

float nidas::dynld::raf::TwoD_Processing::_dead_time
protectedinherited

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 nidas::dynld::raf::TwoD_Processing::clearData(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ _defaultMode

int nidas::core::DSMSensor::_defaultMode
privateinherited

◆ _depthString

std::string nidas::core::DSMSensor::_depthString
privateinherited

◆ _devname

std::string nidas::core::DSMSensor::_devname
privateinherited

◆ _dictionary

nidas::core::DSMSensor::MyDictionary nidas::core::DSMSensor::_dictionary
privateinherited

◆ _driverTimeTagUsecs

int nidas::core::DSMSensor::_driverTimeTagUsecs
privateinherited

◆ _dsm

const DSMConfig* nidas::core::DSMSensor::_dsm
privateinherited

◆ _duplicateIdOK

bool nidas::core::DSMSensor::_duplicateIdOK
privateinherited

◆ _fullSuffix

std::string nidas::core::DSMSensor::_fullSuffix
privateinherited

Concatenation of sensor suffix, and the height or depth string.

Referenced by nidas::core::DSMSensor::getFullSuffix(), and nidas::core::DSMSensor::setFullSuffix().

◆ _height

float nidas::core::DSMSensor::_height
privateinherited

◆ _heightString

std::string nidas::core::DSMSensor::_heightString
privateinherited

◆ _histoEndTime

long long nidas::dynld::raf::TwoD_Processing::_histoEndTime
protectedinherited

The end time of the current histogram.

◆ _id

dsm_sample_id_t nidas::core::DSMSensor::_id
privateinherited

◆ _iodev

IODevice* nidas::core::DSMSensor::_iodev
privateinherited

◆ _lag

int nidas::core::DSMSensor::_lag
privateinherited

◆ _lastStatusTime

long long nidas::dynld::raf::TwoD_Processing::_lastStatusTime
protectedinherited

Time of last printStatus.

Referenced by printStatus().

◆ _latency

float nidas::core::DSMSensor::_latency
privateinherited

◆ _location

std::string nidas::core::DSMSensor::_location
privateinherited

◆ _looper

Looper * DSMSensor::_looper = 0
staticprivateinherited

◆ _looperMutex

n_u::Mutex DSMSensor::_looperMutex
staticprivateinherited

◆ _misAligned

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

◆ _nextraValues

int nidas::dynld::raf::TwoD_Processing::_nextraValues
protectedinherited

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 init(), and nidas::dynld::raf::TwoDS::init().

◆ _nTimeouts

int nidas::core::DSMSensor::_nTimeouts
privateinherited

◆ _numImages

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

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

Referenced by printStatus().

◆ _openable

bool nidas::core::DSMSensor::_openable
protectedinherited

Whether this sensor is allowed to be opened.

Most cases the answer is yes/true. But certain sensors should not be opened due to implementation. e.g. DSMArincSensor when used in conjunction with the UDPArincSensor for then Alta ENET appliance.

The fallout from setting this to false is that the sensor will not be added to SensorHandler.

Referenced by nidas::core::DSMSensor::allowOpen(), and nidas::dynld::raf::DSMArincSensor::fromDOMElement().

◆ _overLoadSliceCount

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

◆ _overSizeCount_2D

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

◆ _parameters

std::map<std::string,Parameter*> nidas::core::DSMSensor::_parameters
privateinherited

◆ _particle

Particle nidas::dynld::raf::TwoD_Processing::_particle
protectedinherited

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
protectedinherited

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 init(), nidas::dynld::raf::TwoDS::init(), nidas::dynld::raf::TwoDS::processImageRecord(), and nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ _rawSampleTag

SampleTag nidas::core::DSMSensor::_rawSampleTag
privateinherited

◆ _rawSource

SampleSourceSupport nidas::core::DSMSensor::_rawSource
privateinherited

◆ _recordsPerSecond

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

◆ _rejected1D_Cntr

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

◆ _rejected2D_Cntr

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

◆ _resolutionMeters

float nidas::dynld::raf::TwoD_Processing::_resolutionMeters
protectedinherited

Probe resolution in meters.

Acquired from XML config file.

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

◆ _resolutionMicron

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

Probe resolution in micrometers.

Acquired from XML config file.

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

◆ _sampleTags

std::list<SampleTag*> nidas::core::DSMSensor::_sampleTags
privateinherited

◆ _saveBuffer

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

◆ _savedAlloc

int nidas::dynld::raf::TwoD_Processing::_savedAlloc
protectedinherited

◆ _savedBytes

int nidas::dynld::raf::TwoD_Processing::_savedBytes
protectedinherited

◆ _scanner

SampleScanner* nidas::core::DSMSensor::_scanner
privateinherited

◆ _size_dist_1D

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

◆ _size_dist_2D

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

◆ _sorID

dsm_sample_id_t nidas::dynld::raf::TwoD_USB::_sorID
protected

Shadow OR sample ID.

Shadow-OR is the total number of particle triggers the probes saw, regardless of how many images were downloaded. The 32 bit 2D probes which use the white USB box, don't send shadow-OR via USB. So this sample ID is only used by the Fast2DC. We need to stash sample ID's since the XML will not quite look the same between Fast2DC and 2Ds using the white USB box. The sample IDs will be acquired in the formDOM looking for specific (read hard-coded) string names. Not sure what the best approach is....

Referenced by nidas::dynld::raf::TwoD64_USB::init_parameters(), nidas::dynld::raf::TwoD64_USB_v3::init_parameters(), nidas::dynld::raf::TwoD64_USB::process(), and nidas::dynld::raf::TwoD64_USB::processSOR().

◆ _source

SampleSourceSupport nidas::core::DSMSensor::_source
privateinherited

◆ _station

int nidas::core::DSMSensor::_station
privateinherited

◆ _suffix

std::string nidas::core::DSMSensor::_suffix
privateinherited

Sensor suffix, which is added to variable names.

Referenced by nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setSuffix().

◆ _suspectSlices

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

◆ _tasOutOfRange

unsigned int nidas::dynld::raf::TwoD_USB::_tasOutOfRange
protected

◆ _tasRate

int nidas::dynld::raf::TwoD_USB::_tasRate
protected

How often to send the true air speed.

Probes also send back the shadowOR when they receive the true airspeed, so in general this is also the receive rate of the shadowOR.

Referenced by getTASRate(), open(), and setTASRate().

◆ _timeoutMsecs

int nidas::core::DSMSensor::_timeoutMsecs
privateinherited

◆ _totalParticles

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

◆ _totalPixelsShadowed

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

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

Referenced by nidas::dynld::raf::TwoD_Processing::clearData(), and nidas::dynld::raf::TwoD_Processing::countParticle().

◆ _totalRecords

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

◆ _trueAirSpeed

float nidas::dynld::raf::TwoD_USB::_trueAirSpeed
protected

True air speed, received from IWGADTS feed.

Referenced by derivedDataNotify(), and printStatus().

◆ _twoDAreaRejectRatio

float nidas::dynld::raf::TwoD_Processing::_twoDAreaRejectRatio
protectedinherited

Area of particle rejection ratio.

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

See also
acceptThisParticle1D()

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

◆ _typeName

std::string nidas::core::DSMSensor::_typeName
privateinherited

◆ bigEndian

const n_u::EndianConverter * TwoD_USB::bigEndian
staticprotected
Initial value:
=
n_u::EndianConverter::getConverter(n_u::EndianConverter::
EC_BIG_ENDIAN)
Virtual base class declaring methods for converting numeric values between little-endian and big-endi...
Definition EndianConverter.h:304

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

◆ DefaultTrueAirspeed

const float TwoD_USB::DefaultTrueAirspeed = 23.0
staticprotected

◆ littleEndian

const n_u::EndianConverter * TwoD_USB::littleEndian
staticprotected
Initial value:
=
n_u::EndianConverter::getConverter(n_u::EndianConverter::
EC_LITTLE_ENDIAN)

Referenced by nidas::dynld::raf::TwoD64_USB::processImageRecord().

◆ namespaceURI

XMLCh * DOMable::namespaceURI = 0
staticprivateinherited

◆ zebra

bool DSMSensor::zebra = false
staticprivateinherited

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