nidas
v1.2-1520
|
A measurement site. More...
#include <Site.h>
Classes | |
class | MyDictionary |
Public Member Functions | |
Site () | |
virtual | ~Site () |
void | setName (const std::string &val) |
Set the name of the Site. More... | |
const std::string & | getName () const |
void | setNumber (int val) |
Identify the Site by number. More... | |
int | getNumber () const |
bool | operator== (const Site &x) const |
Equivalence operator for Site, checks name. More... | |
bool | operator!= (const Site &x) const |
Non-equivalence operator for Site. More... | |
bool | operator< (const Site &x) const |
Less than operator for Site, compares the names. More... | |
void | setSuffix (const std::string &val) |
Set the suffix for the Site. More... | |
const std::string & | getSuffix () const |
const Project * | getProject () const |
Provide pointer to Project. More... | |
Project * | getProject () |
void | setProject (Project *val) |
Set the current project for this Site. More... | |
void | addDSMConfig (DSMConfig *dsm) |
A Site contains one or more DSMs. More... | |
void | removeDSMConfig (DSMConfig *dsm) |
const std::list< const DSMConfig * > & | getDSMConfigs () const |
const std::list< DSMConfig * > & | getDSMConfigs () |
void | addServer (DSMServer *srvr) |
A Site has one or more DSMServers. More... | |
const std::list< DSMServer * > & | getServers () const |
DSMServer * | findServer (const std::string &hostname) const |
Look for a server on this aircraft that either has no name or whose name matches hostname. More... | |
const DSMConfig * | findDSM (const nidas::util::Inet4Address &addr) const |
Find a DSM whose name corresponds to a given IP address. More... | |
const DSMConfig * | findDSM (unsigned int id) const |
Find a DSM by id. More... | |
const DSMConfig * | findDSM (const std::string &name) const |
Find a DSM by name. More... | |
DSMSensor * | findSensor (unsigned int id) const |
Find a DSMSensor by the full id, both the DSM id and the sensor id. More... | |
void | initSensors () throw (nidas::util::IOException) |
Initialize all sensors for a Site. More... | |
void | initSensors (DSMConfig *dsm) throw (nidas::util::IOException) |
Initialize all sensors for a given dsm. More... | |
virtual void | addParameter (Parameter *val) |
Add a parameter to this Site. More... | |
virtual const Parameter * | getParameter (const std::string &name) const |
virtual const std::list< const Parameter * > & | getParameters () const |
virtual bool | getApplyVariableConversions () const |
Do we want DSMSensor::process methods at this site to apply variable conversions? Currently on raf.Aircraft we don't want process methods to apply the conversions. More... | |
std::string | expandString (const std::string &input) const |
Utility function to expand ${TOKEN} or $TOKEN fields in a string. More... | |
bool | getTokenValue (const std::string &token, std::string &value) const |
Implement a lookup for tokens that I know about, like $SITE, and $AIRCRAFT. More... | |
const Dictionary & | getDictionary () const |
DSMServerIterator | getDSMServerIterator () const |
DSMServiceIterator | getDSMServiceIterator () const |
ProcessorIterator | getProcessorIterator () const |
DSMConfigIterator | getDSMConfigIterator () const |
SensorIterator | getSensorIterator () const |
SampleTagIterator | getSampleTagIterator () const |
VariableIterator | getVariableIterator () const |
void | validate () throw (nidas::util::InvalidParameterException) |
void | fromDOMElement (const xercesc::DOMElement *) throw (nidas::util::InvalidParameterException) |
Initialize myself from a xercesc::DOMElement. More... | |
xercesc::DOMElement * | toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException) |
Create a DOMElement and append it to the parent. More... | |
xercesc::DOMElement * | toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException) |
Add my content into a DOMElement. More... | |
Static Public Member Functions | |
static const XMLCh * | getNamespaceURI () |
Protected Attributes | |
bool | _applyCals |
Should NIDAS apply calibrations, or defer them to other processing. More... | |
Private Member Functions | |
Site (const Site &) | |
Copy not supported. More... | |
Site & | operator= (const Site &) |
Assignment not supported. More... | |
Private Attributes | |
Project * | _project |
Pointer back to my project. More... | |
std::string | _name |
int | _number |
std::string | _suffix |
nidas::core::Site::MyDictionary | _dictionary |
std::list< const DSMConfig * > | _dsms |
std::list< DSMConfig * > | _ncDsms |
std::list< DSMServer * > | _servers |
std::map< std::string, Parameter * > | _parameterMap |
Mapping of Parameters, by name. More... | |
std::list< const Parameter * > | _constParameters |
List of const pointers to Parameters for providing via getParameters(). More... | |
A measurement site.
It could be an Aircraft, or a grouping of measurement systems (e.g. "meadow" site).
Site::Site | ( | ) |
|
virtual |
References _ncDsms, _parameterMap, and _servers.
|
private |
Copy not supported.
See Project copy constructor: Project(const Project&);
|
inline |
|
virtual |
Add a parameter to this Site.
Site will then own the pointer and will delete it in its destructor.
References _constParameters, _parameterMap, and nidas::core::Parameter::getName().
|
inline |
|
inline |
Utility function to expand ${TOKEN} or $TOKEN fields in a string.
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 _dictionary, and nidas::core::Dictionary::expandString().
Referenced by PConfig::getHostNames().
const DSMConfig * Site::findDSM | ( | const nidas::util::Inet4Address & | addr | ) | const |
Find a DSM whose name corresponds to a given IP address.
References _dsms, nidas::util::Inet4Address::getAllByName(), nidas::core::DSMConfig::getName(), and VLOG.
Referenced by nidas::core::Project::findDSM().
const DSMConfig * Site::findDSM | ( | unsigned int | id | ) | const |
Find a DSM by id.
References _dsms, nidas::core::DSMConfig::getId(), nidas::core::DSMConfig::getName(), and VLOG.
const DSMConfig * Site::findDSM | ( | const std::string & | name | ) | const |
Find a DSM by name.
References _dsms, nidas::core::DSMConfig::getName(), and VLOG.
DSMSensor * Site::findSensor | ( | unsigned int | id | ) | const |
Find a DSMSensor by the full id, both the DSM id and the sensor id.
References GET_DSM_ID, GET_SPS_ID, nidas::core::DSMSensor::getDSMId(), nidas::core::SampleTag::getId(), nidas::core::DSMSensor::getId(), getName(), nidas::core::DSMSensor::getSampleTagIterator(), nidas::core::DSMSensor::getSensorId(), getSensorIterator(), nidas::core::SensorIterator::hasNext(), nidas::core::SampleTagIterator::hasNext(), nidas::core::SensorIterator::next(), nidas::core::SampleTagIterator::next(), and VLOG.
Referenced by nidas::core::Project::findSensor().
DSMServer * Site::findServer | ( | const std::string & | hostname | ) | const |
Look for a server on this aircraft that either has no name or whose name matches hostname.
If none found, remove any domain names and try again.
References _servers, and nidas::core::DSMServer::getName().
|
virtual |
Initialize myself from a xercesc::DOMElement.
Implements nidas::core::DOMable.
References nidas::core::Parameter::createParameter(), nidas::core::DSMServer::fromDOMElement(), nidas::core::DSMConfig::fromDOMElement(), nidas::core::DSMConfig::getId(), nidas::core::DSMConfig::getName(), nidas::core::XDOMAttr::getName(), nidas::core::XDOMElement::getNodeName(), nidas::core::DSMServer::setProject(), nidas::core::DSMConfig::setSite(), and nidas::core::DSMServer::setSite().
Referenced by nidas::core::Project::fromDOMElement().
|
inlinevirtual |
Do we want DSMSensor::process methods at this site to apply variable conversions? Currently on raf.Aircraft we don't want process methods to apply the conversions.
References _applyCals.
Referenced by nidas::core::Variable::convert().
|
inline |
References _dictionary.
DSMConfigIterator Site::getDSMConfigIterator | ( | ) | const |
|
inline |
References _dsms.
Referenced by nidas::core::Project::findDSMFromHostname(), nidas::core::DSMConfigIterator::hasNext(), initSensors(), PConfig::showCalFiles(), and validate().
DSMServerIterator Site::getDSMServerIterator | ( | ) | const |
DSMServiceIterator Site::getDSMServiceIterator | ( | ) | const |
|
inline |
References _name.
Referenced by nidas::core::Project::addSite(), SampleCounter::collectMetadata(), nidas::core::SampleAverager::connect(), nidas::dynld::StatisticsCruncher::connect(), nidas::dynld::StatisticsProcessor::connectSource(), nidas::core::NearestResampler::ctorCommon(), nidas::core::Project::findDSM(), findSensor(), nidas::core::Site::MyDictionary::getTokenValue(), PConfig::loadVariables(), main(), DataPrep::matchVariables(), SampleToDatabase::setSiteAndMeasurement(), PConfig::showAll(), and PConfig::showCalFiles().
|
inlinestaticinherited |
References nidas::core::DOMable::namespaceURI.
Referenced by nidas::dynld::UDPSampleOutput::getProjectDOM(), nidas::core::Dataset::toDOMElement(), nidas::core::ProjectConfig::toDOMElement(), nidas::core::Dataset::toDOMParent(), nidas::core::ProjectConfig::toDOMParent(), nidas::core::Datasets::toDOMParent(), nidas::core::ProjectConfigs::toDOMParent(), nidas::core::DSMConfig::toDOMParent(), nidas::core::Project::toDOMParent(), toDOMParent(), nidas::core::SampleTag::toDOMParent(), nidas::core::ServerSocket::toDOMParent(), nidas::core::Variable::toDOMParent(), nidas::core::DSMSensor::toDOMParent(), nidas::core::Datasets::writeXML(), and nidas::core::ProjectConfigs::writeXML().
|
inline |
References _number.
Referenced by nidas::core::Project::addSite(), nidas::dynld::isff::GOESProject::GOESProject(), and PConfig::showAll().
|
virtual |
References _parameterMap.
|
virtual |
References _constParameters.
ProcessorIterator Site::getProcessorIterator | ( | ) | const |
Referenced by nidas::dynld::isff::GOESProject::GOESProject().
|
inline |
Provide pointer to Project.
References _project.
Referenced by nidas::core::DSMConfig::getProject(), and nidas::core::Site::MyDictionary::getTokenValue().
SampleTagIterator Site::getSampleTagIterator | ( | ) | const |
SensorIterator Site::getSensorIterator | ( | ) | const |
Referenced by findSensor(), and nidas::core::DSMServer::getSensorIterator().
|
inline |
References _servers.
Referenced by nidas::core::DSMServerIterator::hasNext().
|
inline |
References _suffix.
Referenced by nidas::dynld::StatisticsProcessor::connectSource(), nidas::core::Variable::setSite(), and nidas::core::Variable::setStation().
|
inline |
Implement a lookup for tokens that I know about, like $SITE, and $AIRCRAFT.
For other tokens, call getProject()->getTokenValue(token,value);
References _dictionary, and nidas::core::Site::MyDictionary::getTokenValue().
Referenced by nidas::core::DSMConfig::MyDictionary::getTokenValue().
VariableIterator Site::getVariableIterator | ( | ) | const |
void Site::initSensors | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
Initialize all sensors for a Site.
References getDSMConfigs(), and nidas::core::DSMConfig::initSensors().
Referenced by nidas::core::Project::initSensors().
void Site::initSensors | ( | DSMConfig * | dsm | ) | |
throw | ( | nidas::util::IOException | |||
) |
Initialize all sensors for a given dsm.
References nidas::core::DSMConfig::initSensors().
|
inline |
Non-equivalence operator for Site.
References operator==().
|
inline |
|
inline |
Equivalence operator for Site, checks name.
References _name, _number, and _suffix.
Referenced by operator!=().
|
inline |
|
inline |
|
inline |
Set the current project for this Site.
References _project.
Referenced by nidas::core::Project::fromDOMElement().
|
inline |
|
virtual |
Add my content into a DOMElement.
Reimplemented from nidas::core::DOMable.
References nidas::core::DSMConfigIterator::hasNext(), nidas::core::XDOMElement::setAttributeValue(), and nidas::core::DSMConfig::toDOMParent().
|
virtual |
Create a DOMElement and append it to the parent.
Reimplemented from nidas::core::DOMable.
References nidas::core::DOMable::getNamespaceURI().
Referenced by nidas::core::Project::toDOMElement().
void Site::validate | ( | ) | ||
throw | ( | nidas::util::InvalidParameterException | ||
) |
References getDSMConfigs(), nidas::core::DSMSensor::getDSMId(), nidas::core::DSMSensor::getDuplicateIdOK(), nidas::core::DSMConfig::getId(), nidas::core::DSMConfig::getName(), nidas::core::DSMSensor::getName(), nidas::core::Variable::getName(), nidas::core::DSMSensor::getSensorId(), nidas::core::DSMConfig::getSensorIterator(), nidas::core::DSMSensor::getVariableIterator(), nidas::core::SensorIterator::hasNext(), nidas::core::VariableIterator::hasNext(), and nidas::core::DSMConfig::validate().
Referenced by nidas::core::Project::fromDOMElement().
|
protected |
Should NIDAS apply calibrations, or defer them to other processing.
Referenced by getApplyVariableConversions().
|
private |
List of const pointers to Parameters for providing via getParameters().
Referenced by addParameter(), and getParameters().
|
private |
Referenced by expandString(), getDictionary(), and getTokenValue().
|
private |
Referenced by addDSMConfig(), findDSM(), getDSMConfigs(), and removeDSMConfig().
|
private |
Referenced by getName(), operator<(), operator==(), and setName().
|
private |
Referenced by addDSMConfig(), getDSMConfigs(), removeDSMConfig(), and ~Site().
|
private |
Referenced by getNumber(), operator==(), and setNumber().
|
private |
Mapping of Parameters, by name.
Referenced by addParameter(), getParameter(), and ~Site().
|
private |
Pointer back to my project.
Referenced by getProject(), and setProject().
|
private |
Referenced by addServer(), findServer(), getServers(), and ~Site().
|
private |
Referenced by getSuffix(), operator==(), and setSuffix().