Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Kernel::FacilityInfo Class Reference

A class that holds information about a facility. More...

#include <FacilityInfo.h>

Public Member Functions

const std::vector< std::string > & archiveSearch () const
 Return the archive search interface names. More...
 
const CatalogInfocatalogInfo () const
 Returns the catalogInfo class. More...
 
const std::string & delimiter () const
 Returns the default delimiter between instrument name and run number. More...
 
const std::vector< std::string > extensions () const
 Returns a list of file extensions. More...
 
 FacilityInfo (const Poco::XML::Element *elem)
 Constructor. More...
 
const InstrumentInfoinstrument (std::string iName="") const
 Returns instruments with given name. More...
 
const std::vector< InstrumentInfo > & instruments () const
 Returns a list of instruments of this facility. More...
 
std::vector< InstrumentInfoinstruments (const std::string &tech) const
 Returns a list of instruments of given technique. More...
 
size_t multiFileLimit () const
 Returns the multiple file limit. More...
 
const std::string & name () const
 Return the name of the facility. More...
 
bool noFilePrefix () const
 Returns a bool indicating whether prefix is required in file names. More...
 
const std::string & preferredExtension () const
 Returns the preferred file extension. More...
 
const std::string & timezone () const
 Returns the time zone designation compatible with pytz. More...
 
int zeroPadding () const
 Returns default zero padding for this facility. More...
 

Private Member Functions

void addExtension (const std::string &ext)
 Add new extension. More...
 
void fillArchiveNames (const Poco::XML::Element *elem)
 Called from constructor to fill archive interface names. More...
 
void fillDelimiter (const Poco::XML::Element *elem)
 Called from constructor to fill default delimiter. More...
 
void fillExtensions (const Poco::XML::Element *elem)
 Called from constructor to fill file extensions. More...
 
void fillHTTPProxy (const Poco::XML::Element *elem)
 
void fillInstruments (const Poco::XML::Element *elem)
 Called from constructor to fill instrument list. More...
 
void fillMultiFileLimit (const Poco::XML::Element *elem)
 Called from constructor to fill the multifile limit. More...
 
void fillNoFilePrefix (const Poco::XML::Element *elem)
 Called from constructor to fill the noFilePrefix flag. More...
 
void fillTimezone (const Poco::XML::Element *elem)
 
void fillZeroPadding (const Poco::XML::Element *elem)
 Called from constructor to fill zero padding field. More...
 

Private Attributes

std::vector< std::string > m_archiveSearch
 names of the archive search interface More...
 
CatalogInfo m_catalogs
 Gain access to the catalogInfo class. More...
 
std::string m_delimiter
 default delimiter between instrument name and run number More...
 
std::vector< std::string > m_extensions
 file extensions in order of preference More...
 
std::vector< InstrumentInfom_instruments
 list of instruments of this facility More...
 
size_t m_multiFileLimit
 the multiple file limit More...
 
const std::string m_name
 facility name More...
 
bool m_noFilePrefix
 flag indicating if prefix is required in file names More...
 
std::string m_timezone
 Timezone designation in pytz. More...
 
int m_zeroPadding
 default zero padding for this facility More...
 

Detailed Description

A class that holds information about a facility.

Definition at line 36 of file FacilityInfo.h.

Constructor & Destructor Documentation

◆ FacilityInfo()

Mantid::Kernel::FacilityInfo::FacilityInfo ( const Poco::XML::Element *  elem)
explicit

Constructor.

Parameters
elem:: The Poco::XML::Element to read the data from
Exceptions
std::runtime_errorif name or file extensions are not defined

Definition at line 39 of file FacilityInfo.cpp.

References fillArchiveNames(), fillDelimiter(), fillExtensions(), fillInstruments(), fillMultiFileLimit(), fillNoFilePrefix(), fillTimezone(), and fillZeroPadding().

Member Function Documentation

◆ addExtension()

void Mantid::Kernel::FacilityInfo::addExtension ( const std::string &  ext)
private

Add new extension.

Adds both a lowercase and uppercase version

Parameters
ext:: File extension, including the dot, e.g. ".nxs" or ".raw"

Definition at line 104 of file FacilityInfo.cpp.

References m_extensions.

Referenced by fillExtensions().

◆ archiveSearch()

const std::vector< std::string > & Mantid::Kernel::FacilityInfo::archiveSearch ( ) const
inline

Return the archive search interface names.

Definition at line 56 of file FacilityInfo.h.

Referenced by export_FacilityInfo(), and Mantid::API::FileFinderImpl::getArchiveSearch().

◆ catalogInfo()

const CatalogInfo & Mantid::Kernel::FacilityInfo::catalogInfo ( ) const
inline

Returns the catalogInfo class.

Definition at line 65 of file FacilityInfo.h.

◆ delimiter()

const std::string & Mantid::Kernel::FacilityInfo::delimiter ( ) const
inline

Returns the default delimiter between instrument name and run number.

Definition at line 46 of file FacilityInfo.h.

Referenced by export_FacilityInfo(), and Mantid::Kernel::InstrumentInfo::InstrumentInfo().

◆ extensions()

const std::vector< std::string > Mantid::Kernel::FacilityInfo::extensions ( ) const
inline

◆ fillArchiveNames()

void Mantid::Kernel::FacilityInfo::fillArchiveNames ( const Poco::XML::Element *  elem)
private

Called from constructor to fill archive interface names.

Definition at line 111 of file FacilityInfo.cpp.

References Mantid::Kernel::Logger::error(), Mantid::Kernel::DateAndTimeHelpers::g_log, and m_archiveSearch.

Referenced by FacilityInfo().

◆ fillDelimiter()

void Mantid::Kernel::FacilityInfo::fillDelimiter ( const Poco::XML::Element *  elem)
private

Called from constructor to fill default delimiter.

Definition at line 81 of file FacilityInfo.cpp.

References m_delimiter.

Referenced by FacilityInfo().

◆ fillExtensions()

void Mantid::Kernel::FacilityInfo::fillExtensions ( const Poco::XML::Element *  elem)
private

◆ fillHTTPProxy()

void Mantid::Kernel::FacilityInfo::fillHTTPProxy ( const Poco::XML::Element *  elem)
private

◆ fillInstruments()

void Mantid::Kernel::FacilityInfo::fillInstruments ( const Poco::XML::Element *  elem)
private

Called from constructor to fill instrument list.

Definition at line 144 of file FacilityInfo.cpp.

References Mantid::Kernel::DateAndTimeHelpers::g_log, m_instruments, m_name, n, and Mantid::Kernel::Logger::warning().

Referenced by FacilityInfo().

◆ fillMultiFileLimit()

void Mantid::Kernel::FacilityInfo::fillMultiFileLimit ( const Poco::XML::Element *  elem)
private

Called from constructor to fill the multifile limit.

Definition at line 70 of file FacilityInfo.cpp.

References Mantid::Kernel::Strings::convert(), and m_multiFileLimit.

Referenced by FacilityInfo().

◆ fillNoFilePrefix()

void Mantid::Kernel::FacilityInfo::fillNoFilePrefix ( const Poco::XML::Element *  elem)
private

Called from constructor to fill the noFilePrefix flag.

Definition at line 64 of file FacilityInfo.cpp.

References m_noFilePrefix.

Referenced by FacilityInfo().

◆ fillTimezone()

void Mantid::Kernel::FacilityInfo::fillTimezone ( const Poco::XML::Element *  elem)
private

◆ fillZeroPadding()

void Mantid::Kernel::FacilityInfo::fillZeroPadding ( const Poco::XML::Element *  elem)
private

Called from constructor to fill zero padding field.

Definition at line 56 of file FacilityInfo.cpp.

References Mantid::Kernel::Strings::convert(), and m_zeroPadding.

Referenced by FacilityInfo().

◆ instrument()

const InstrumentInfo & Mantid::Kernel::FacilityInfo::instrument ( std::string  iName = "") const

Returns instruments with given name.

Returns instrument with given name.

Parameters
iNameInstrument name
Returns
the instrument information object
Exceptions
NotFoundErrorif iName was not found

Definition at line 172 of file FacilityInfo.cpp.

References Mantid::Kernel::Logger::debug(), Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::SingletonHolder< T >::Instance(), instrument(), m_instruments, name(), and Mantid::Kernel::InstrumentInfo::name().

Referenced by export_FacilityInfo(), MantidQt::MantidWidgets::InstrumentSelector::fillWithInstrumentsFromFacility(), Mantid::Kernel::ConfigServiceImpl::getInstrument(), and instrument().

◆ instruments() [1/2]

const std::vector< InstrumentInfo > & Mantid::Kernel::FacilityInfo::instruments ( ) const
inline

◆ instruments() [2/2]

std::vector< InstrumentInfo > Mantid::Kernel::FacilityInfo::instruments ( const std::string &  tech) const

Returns a list of instruments of given technique.

Parameters
tech:: Technique name
Returns
a list of instrument information objects

Definition at line 204 of file FacilityInfo.cpp.

References m_instruments.

◆ multiFileLimit()

size_t Mantid::Kernel::FacilityInfo::multiFileLimit ( ) const
inline

Returns the multiple file limit.

Definition at line 71 of file FacilityInfo.h.

◆ name()

const std::string & Mantid::Kernel::FacilityInfo::name ( ) const
inline

◆ noFilePrefix()

bool Mantid::Kernel::FacilityInfo::noFilePrefix ( ) const
inline

Returns a bool indicating whether prefix is required in file names.

Definition at line 68 of file FacilityInfo.h.

Referenced by Mantid::API::FileFinderImpl::findRun().

◆ preferredExtension()

const std::string & Mantid::Kernel::FacilityInfo::preferredExtension ( ) const
inline

Returns the preferred file extension.

Definition at line 50 of file FacilityInfo.h.

Referenced by export_FacilityInfo().

◆ timezone()

const std::string & Mantid::Kernel::FacilityInfo::timezone ( ) const
inline

Returns the time zone designation compatible with pytz.

Definition at line 53 of file FacilityInfo.h.

Referenced by export_FacilityInfo().

◆ zeroPadding()

int Mantid::Kernel::FacilityInfo::zeroPadding ( ) const
inline

Returns default zero padding for this facility.

Definition at line 44 of file FacilityInfo.h.

Referenced by export_FacilityInfo(), Mantid::Kernel::InstrumentInfo::fillZeroPadding(), and Mantid::Kernel::InstrumentInfo::zeroPadding().

Member Data Documentation

◆ m_archiveSearch

std::vector<std::string> Mantid::Kernel::FacilityInfo::m_archiveSearch
private

names of the archive search interface

Definition at line 93 of file FacilityInfo.h.

Referenced by fillArchiveNames().

◆ m_catalogs

CatalogInfo Mantid::Kernel::FacilityInfo::m_catalogs
private

Gain access to the catalogInfo class.

Definition at line 87 of file FacilityInfo.h.

◆ m_delimiter

std::string Mantid::Kernel::FacilityInfo::m_delimiter
private

default delimiter between instrument name and run number

Definition at line 91 of file FacilityInfo.h.

Referenced by fillDelimiter().

◆ m_extensions

std::vector<std::string> Mantid::Kernel::FacilityInfo::m_extensions
private

file extensions in order of preference

Definition at line 92 of file FacilityInfo.h.

Referenced by addExtension().

◆ m_instruments

std::vector<InstrumentInfo> Mantid::Kernel::FacilityInfo::m_instruments
private

list of instruments of this facility

Definition at line 94 of file FacilityInfo.h.

Referenced by fillInstruments(), instrument(), and instruments().

◆ m_multiFileLimit

size_t Mantid::Kernel::FacilityInfo::m_multiFileLimit
private

the multiple file limit

Definition at line 96 of file FacilityInfo.h.

Referenced by fillMultiFileLimit().

◆ m_name

const std::string Mantid::Kernel::FacilityInfo::m_name
private

facility name

Definition at line 88 of file FacilityInfo.h.

Referenced by fillInstruments(), and fillTimezone().

◆ m_noFilePrefix

bool Mantid::Kernel::FacilityInfo::m_noFilePrefix
private

flag indicating if prefix is required in file names

Definition at line 95 of file FacilityInfo.h.

Referenced by fillNoFilePrefix().

◆ m_timezone

std::string Mantid::Kernel::FacilityInfo::m_timezone
private

Timezone designation in pytz.

Definition at line 89 of file FacilityInfo.h.

Referenced by fillTimezone().

◆ m_zeroPadding

int Mantid::Kernel::FacilityInfo::m_zeroPadding
private

default zero padding for this facility

Definition at line 90 of file FacilityInfo.h.

Referenced by fillZeroPadding().


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