|
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. | |
| Kernel::Property * | createCurrentPeriodLog (const int &period) const |
| Creates a log value for the current period. | |
| Kernel::TimeSeriesProperty< bool > * | createPeriodLog (int period) const |
| Creates a TimeSeriesProperty<bool> showing times when a particular period was active. | |
| Kernel::TimeSeriesProperty< bool > * | createRunningLog () const |
| Creates a TimeSeriesProperty<bool> with running status. | |
| LogParser (const Kernel::Property *log) | |
| Create given the icpevent log property. | |
| int | nPeriods () const |
| Number of periods. | |
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. | |
| static const std::string | currentPeriodLogName () |
| Returns the name of the log that contains the current period number. | |
| static const std::string | currentPeriodLogName (const int period) |
| Returns the name of the log that contains given period filter. | |
| static bool | isICPEventLogNewStyle (const std::multimap< Types::Core::DateAndTime, std::string > &logm) |
| Check if the icp log commands are in the new style. | |
| static const std::string | periodsLogName () |
| Returns the name of the log that contains all of the periods. | |
| static const std::string | statusLogName () |
| Returns the name of the log created that defines the status during a run. | |
Private Types | |
| using | CommandMap = std::map< std::string, commands > |
| Typedef for a map of string commands to an enum of strongly typed commands. | |
| 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. | |
| 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. | |
| 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. | |
| void | tryParsePeriod (const std::string &scom, const Types::Core::DateAndTime &time, std::istringstream &idata, Kernel::TimeSeriesProperty< int > *const periods) |
| Try to parse period data. | |
Private Attributes | |
| int | m_nOfPeriods |
| Number of periods. | |
| std::shared_ptr< Kernel::TimeSeriesProperty< int > > | m_periods |
| TimeSeriesProperty<int> containing data periods. Created by LogParser. | |
| std::shared_ptr< Kernel::TimeSeriesProperty< bool > > | m_status |
| TimeSeriesProperty<bool> containing running status. Created by LogParser. | |
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 42 of file LogParser.h.
|
private |
Typedef for a map of string commands to an enum of strongly typed commands.
Definition at line 94 of file LogParser.h.
|
strongprivate |
Available commands.
| Enumerator | |
|---|---|
| NONE | |
| BEGIN | |
| END | |
| CHANGE_PERIOD | |
| ABORT | |
Definition at line 90 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 190 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(), statusLogName(), 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 276 of file LogParser.cpp.
References Mantid::Kernel::Property::clone(), and 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 128 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 269 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 39 of file LogParser.cpp.
References Mantid::Geometry::d, Mantid::Kernel::Logger::error(), Mantid::Kernel::Strings::extractToEOL(), Mantid::Kernel::DateAndTimeHelpers::g_log, name, 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 241 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 279 of file LogParser.cpp.
References Mantid::Kernel::TimeSeriesProperty< TYPE >::clone(), and m_status.
|
inlinestatic |
Returns the name of the log that contains the current period number.
Definition at line 45 of file LogParser.h.
Referenced by Mantid::API::ISISRunLogs::applyLogFiltering(), createCurrentPeriodLog(), and createPeriodLog().
|
static |
Returns the name of the log that contains given period filter.
Definition at line 259 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 296 of file LogParser.cpp.
Referenced by LogParser().
|
inline |
Number of periods.
Definition at line 65 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 51 of file LogParser.h.
Referenced by Mantid::DataHandling::LoadNexusProcessed::applyLogFiltering(), Mantid::API::ISISRunLogs::applyLogFiltering(), Mantid::API::ISISRunLogs::getLogNamesExcludedFromFiltering(), and LogParser().
|
inlinestatic |
Returns the name of the log created that defines the status during a run.
Definition at line 47 of file LogParser.h.
Referenced by Mantid::DataHandling::LoadNexusProcessed::applyLogFiltering(), Mantid::API::ISISRunLogs::applyLogFiltering(), Mantid::API::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 159 of file LogParser.cpp.
References Mantid::Kernel::TimeSeriesProperty< TYPE >::addValue(), and m_nOfPeriods.
Referenced by LogParser().
|
private |
Number of periods.
Definition at line 103 of file LogParser.h.
Referenced by LogParser(), and tryParsePeriod().
|
private |
TimeSeriesProperty<int> containing data periods. Created by LogParser.
Definition at line 97 of file LogParser.h.
Referenced by createAllPeriodsLog(), createPeriodLog(), and LogParser().
|
private |
TimeSeriesProperty<bool> containing running status. Created by LogParser.
Definition at line 100 of file LogParser.h.
Referenced by createRunningLog(), and LogParser().