Mantid
|
LogParser parses the instrument log files to select records corresponding to 'RUNNING' instrument status. More...
#include <LogParser.h>
Public Member Functions | |
Kernel::Property * | createAllPeriodsLog () const |
Creates a TimeSeriesProperty<int> with all data periods. More... | |
Kernel::Property * | createCurrentPeriodLog (const int &period) const |
Creates a log value for the current period. More... | |
Kernel::TimeSeriesProperty< bool > * | createPeriodLog (int period) const |
Creates a TimeSeriesProperty<bool> showing times when a particular period was active. More... | |
Kernel::TimeSeriesProperty< bool > * | createRunningLog () const |
Creates a TimeSeriesProperty<bool> with running status. More... | |
LogParser (const Kernel::Property *log) | |
Create given the icpevent log property. More... | |
int | nPeriods () const |
Number of periods. More... | |
Static Public Member Functions | |
static Kernel::Property * | createLogProperty (const std::string &logFName, const std::string &name) |
Creates a TimeSeriesProperty of either double or string type depending on the log data Returns a pointer to the created property. More... | |
static const std::string | currentPeriodLogName () |
Returns the name of the log that contains the current period number. More... | |
static const std::string | currentPeriodLogName (const int period) |
Returns the name of the log that contains given period filter. More... | |
static bool | isICPEventLogNewStyle (const std::multimap< Types::Core::DateAndTime, std::string > &logm) |
Check if the icp log commands are in the new style. More... | |
static const std::string | periodsLogName () |
Returns the name of the log that contains all of the periods. More... | |
static const std::string | statusLogName () |
Returns the name of the log created that defines the status during a run. More... | |
Private Types | |
using | CommandMap = std::map< std::string, commands > |
Typedef for a map of string commands to an enum of strongly typed commands. More... | |
enum class | commands { NONE = 0 , BEGIN , END , CHANGE_PERIOD , ABORT } |
Available commands. More... | |
Private Member Functions | |
CommandMap | createCommandMap (bool newStyle) const |
Creates a map of all available old-style commands. More... | |
void | parseNewStyleCommands (const std::multimap< Types::Core::DateAndTime, std::string > &logm, Kernel::TimeSeriesProperty< int > *periods, Kernel::TimeSeriesProperty< bool > *status) |
Parse the icp event log with new style commands. More... | |
void | parseOldStyleCommands (const std::multimap< Types::Core::DateAndTime, std::string > &logm, Kernel::TimeSeriesProperty< int > *periods, Kernel::TimeSeriesProperty< bool > *status) |
Parse the icp event log with old style commands. More... | |
void | tryParsePeriod (const std::string &scom, const Types::Core::DateAndTime &time, std::istringstream &idata, Kernel::TimeSeriesProperty< int > *const periods) |
Try to parse period data. More... | |
Private Attributes | |
int | m_nOfPeriods |
Number of periods. More... | |
std::shared_ptr< Kernel::Property > | m_periods |
TimeSeriesProperty<int> containing data periods. Created by LogParser. More... | |
std::shared_ptr< Kernel::TimeSeriesProperty< bool > > | m_status |
TimeSeriesProperty<bool> containing running status. Created by LogParser. More... | |
LogParser parses the instrument log files to select records corresponding to 'RUNNING' instrument status.
It determines the values of the logged variables at the beginning and the end of each RUNNING interval and keeps track of changes within the interval.
Definition at line 41 of file LogParser.h.
|
private |
Typedef for a map of string commands to an enum of strongly typed commands.
Definition at line 93 of file LogParser.h.
|
strongprivate |
Available commands.
Enumerator | |
---|---|
NONE | |
BEGIN | |
END | |
CHANGE_PERIOD | |
ABORT |
Definition at line 89 of file LogParser.h.
Mantid::Kernel::LogParser::LogParser | ( | const Kernel::Property * | log | ) |
Create given the icpevent log property.
log | :: A pointer to the property |
Definition at line 189 of file LogParser.cpp.
References ABORT, Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue(), BEGIN, CHANGE_PERIOD, createCommandMap(), END, Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::Logger::information(), isICPEventLogNewStyle(), m_nOfPeriods, m_periods, m_status, periodsLogName(), Mantid::Kernel::TimeSeriesProperty< TYPE >::replaceValues(), Mantid::Kernel::TimeSeriesProperty< TYPE >::size(), statusLogName(), Mantid::Kernel::TimeSeriesProperty< TYPE >::timesAsVector(), and tryParsePeriod().
Kernel::Property * Mantid::Kernel::LogParser::createAllPeriodsLog | ( | ) | const |
Creates a TimeSeriesProperty<int> with all data periods.
Ctreates a TimeSeriesProperty<int> with all data periods.
Definition at line 275 of file LogParser.cpp.
References m_periods.
|
private |
Creates a map of all available old-style commands.
Common creational method for generating a command map.
Better ensures that the same command mapping is available for any constructor.
newStyle | Command style selector. |
Definition at line 127 of file LogParser.cpp.
References ABORT, BEGIN, CHANGE_PERIOD, and END.
Referenced by LogParser().
Kernel::Property * Mantid::Kernel::LogParser::createCurrentPeriodLog | ( | const int & | period | ) | const |
Creates a log value for the current period.
Create a log vale for the current period.
period | The period number to create the log entry for. |
Definition at line 268 of file LogParser.cpp.
References currentPeriodLogName().
|
static |
Creates a TimeSeriesProperty of either double or string type depending on the log data Returns a pointer to the created property.
Reads in log data from a log file and stores them in a TimeSeriesProperty.
logFName | :: The name of the log file |
name | :: The name of the property |
Definition at line 38 of file LogParser.cpp.
References Mantid::Geometry::d, Mantid::Kernel::Logger::error(), Mantid::Kernel::Strings::extractToEOL(), Mantid::Kernel::DateAndTimeHelpers::g_log, tmp, and Mantid::Kernel::Logger::warning().
Referenced by Mantid::DataHandling::LoadLog::loadTwoColumnLogFile().
Kernel::TimeSeriesProperty< bool > * Mantid::Kernel::LogParser::createPeriodLog | ( | int | period | ) | const |
Creates a TimeSeriesProperty<bool> showing times when a particular period was active.
period | :: The data period |
Definition at line 242 of file LogParser.cpp.
References Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue(), currentPeriodLogName(), and m_periods.
Kernel::TimeSeriesProperty< bool > * Mantid::Kernel::LogParser::createRunningLog | ( | ) | const |
Creates a TimeSeriesProperty<bool> with running status.
Definition at line 278 of file LogParser.cpp.
References m_status.
|
inlinestatic |
Returns the name of the log that contains the current period number.
Definition at line 44 of file LogParser.h.
Referenced by Mantid::DataHandling::ISISRunLogs::applyLogFiltering(), createCurrentPeriodLog(), and createPeriodLog().
|
static |
Returns the name of the log that contains given period filter.
Definition at line 258 of file LogParser.cpp.
|
static |
Check if the icp log commands are in the new style.
The new style is the one that uses START_COLLECTION and STOP_COLLECTION commands for changing periods and running status.
logm | :: A log map created from a icp-event log. |
Definition at line 295 of file LogParser.cpp.
Referenced by LogParser().
|
inline |
Number of periods.
Definition at line 64 of file LogParser.h.
|
private |
Parse the icp event log with new style commands.
|
private |
Parse the icp event log with old style commands.
|
inlinestatic |
Returns the name of the log that contains all of the periods.
Definition at line 50 of file LogParser.h.
Referenced by Mantid::DataHandling::LoadNexusProcessed::applyLogFiltering(), Mantid::DataHandling::ISISRunLogs::applyLogFiltering(), Mantid::DataHandling::ISISRunLogs::getLogNamesExcludedFromFiltering(), and LogParser().
|
inlinestatic |
Returns the name of the log created that defines the status during a run.
Definition at line 46 of file LogParser.h.
Referenced by Mantid::DataHandling::LoadNexusProcessed::applyLogFiltering(), Mantid::DataHandling::ISISRunLogs::applyLogFiltering(), Mantid::DataHandling::ISISRunLogs::getLogNamesExcludedFromFiltering(), and LogParser().
|
private |
Try to parse period data.
Try to pass the periods.
scom | : The command corresponding to a change in period. |
time | : The time |
idata | : stream of input data |
periods | : periods data to update |
Definition at line 158 of file LogParser.cpp.
References Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue(), and m_nOfPeriods.
Referenced by LogParser().
|
private |
Number of periods.
Definition at line 102 of file LogParser.h.
Referenced by LogParser(), and tryParsePeriod().
|
private |
TimeSeriesProperty<int> containing data periods. Created by LogParser.
Definition at line 96 of file LogParser.h.
Referenced by createAllPeriodsLog(), createPeriodLog(), and LogParser().
|
private |
TimeSeriesProperty<bool> containing running status. Created by LogParser.
Definition at line 99 of file LogParser.h.
Referenced by createRunningLog(), and LogParser().