Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
kome::operation::Filter Class Reference

filter class More...

#include <Filter.h>

Inheritance diagram for kome::operation::Filter:
Inheritance graph
[legend]
Collaboration diagram for kome::operation::Filter:
Collaboration graph
[legend]

Public Member Functions

 Filter ()
 constructor
 
virtual ~Filter ()
 destructor
 
void setFilterInfo (kome::plugin::PluginCall *func, kome::objects::SettingParameterValues *settings)
 sets filter information More...
 
- Public Member Functions inherited from kome::objects::XYDataOperation
 XYDataOperation ()
 constructor
 
virtual ~XYDataOperation ()
 destructor
 
void setName (const char *name)
 sets name More...
 
const char * getName ()
 gets name More...
 
void setIndex (int index)
 set index More...
 
int getIndex ()
 get index More...
 
void update (kome::core::XYData &src, kome::core::XYData &dst, Chromatogram &chrom)
 updates xy data More...
 
void update (kome::core::XYData &src, kome::core::XYData &dst, Spectrum &spec)
 updates xy data More...
 
void update (kome::core::XYData &src, kome::core::XYData &dst, Sample &sample)
 updates xy data More...
 

Protected Member Functions

void init ()
 initializes
 
virtual void getUpdatedData (kome::core::XYData &src, kome::core::XYData &dst)
 gets updated data points More...
 
virtual void onUpdate (kome::core::XYData &src, kome::core::XYData &dst, kome::objects::Chromatogram &chrom)
 This method is called by update method. (override method) More...
 
virtual void onUpdate (kome::core::XYData &src, kome::core::XYData &dst, kome::objects::Spectrum &spec)
 This method is called by update method. (override method) More...
 
virtual void onUpdate (kome::core::XYData &src, kome::core::XYData &dst, kome::objects::Sample &sample)
 This method is called by update method. (override method) More...
 

Protected Attributes

kome::plugin::PluginCall * m_fun
 
kome::objects::SettingParameterValues m_settings
 
- Protected Attributes inherited from kome::objects::XYDataOperation
std::string m_name
 
int m_index
 

Detailed Description

filter class

Definition at line 32 of file Filter.h.

Member Function Documentation

void kome::operation::Filter::getUpdatedData ( kome::core::XYData src,
kome::core::XYData dst 
)
protectedvirtual

gets updated data points

Parameters
[in]srcsource xy data
[out]dstthe object to store updated xy data

Definition at line 91 of file Filter.cpp.

94  {
95  // check the member
96  if( m_fun == NULL ) {
97  LOG_WARN( FMT( "The filter function is not assigned." ) );
98  return;
99  }
100 
101  // check the parameter
102  if( src.getLength() == 0 ) {
103  return;
104  }
105 
106  // parameters
108 
109  kome::plugin::PluginCallTool::setXYData( params, src );
110  kome::plugin::PluginCallTool::setUpdatedXYData( params, dst );
111  kome::plugin::PluginCallTool::setSettingValues( params, m_settings );
112 
113  try {
114  m_fun->invoke( &params );
115  }
116  catch( ... ) {
117  }
118 }
#define NULL
Definition: CoreMacros.h:18
kome::objects::SettingParameterValues m_settings
Definition: Filter.h:51
kome::plugin::PluginCall * m_fun
Definition: Filter.h:48
parameters of plug-in function management class
Definition: Parameters.h:28
unsigned int getLength()
gets the number of points @return the number of points
Definition: XYData.cpp:216

Here is the call graph for this function:

void kome::operation::Filter::onUpdate ( kome::core::XYData src,
kome::core::XYData dst,
kome::objects::Chromatogram chrom 
)
protectedvirtual

This method is called by update method. (override method)

Parameters
[in]srcsource xy data
[out]dstthe object to store updated xy data
[in]chromchromatogram

Implements kome::objects::XYDataOperation.

Definition at line 121 of file Filter.cpp.

125  {
126  getUpdatedData( src, dst );
127 }
virtual void getUpdatedData(kome::core::XYData &src, kome::core::XYData &dst)
gets updated data points
Definition: Filter.cpp:91

Here is the call graph for this function:

void kome::operation::Filter::onUpdate ( kome::core::XYData src,
kome::core::XYData dst,
kome::objects::Spectrum spec 
)
protectedvirtual

This method is called by update method. (override method)

Parameters
[in]srcsource xy data
[out]dstthe object to store updated xy data
[in]specspectrum

Implements kome::objects::XYDataOperation.

Definition at line 130 of file Filter.cpp.

134  {
135  getUpdatedData( src, dst );
136 }
virtual void getUpdatedData(kome::core::XYData &src, kome::core::XYData &dst)
gets updated data points
Definition: Filter.cpp:91

Here is the call graph for this function:

void kome::operation::Filter::onUpdate ( kome::core::XYData src,
kome::core::XYData dst,
kome::objects::Sample sample 
)
protectedvirtual

This method is called by update method. (override method)

Parameters
[in]srcsource xy data
[out]dstthe object to store updated xy data
[in]samplesample

Implements kome::objects::XYDataOperation.

Definition at line 139 of file Filter.cpp.

143  {
144  getUpdatedData( src, dst );
145 }
virtual void getUpdatedData(kome::core::XYData &src, kome::core::XYData &dst)
gets updated data points
Definition: Filter.cpp:91

Here is the call graph for this function:

void kome::operation::Filter::setFilterInfo ( kome::plugin::PluginCall *  func,
kome::objects::SettingParameterValues settings 
)

sets filter information

Parameters
[in]funcfilter function
[in]settingssetting parameter values

Definition at line 48 of file Filter.cpp.

48  {
49  // initialize
50  init();
51  if( func == NULL ) {
52  return;
53  }
54 
55  // set information
56  m_fun = func;
57  if( settings != NULL ) {
58  m_settings = *settings;
59  }
60 
61  // item
62  kome::plugin::PluginFunctionItem item;
63  item.setInfo( func );
64 
65  // set name
66  std::string name = FMT( "Filter [%s", item.getLongName() );
67  std::string paramStr;
68  for( unsigned int i = 0; i < m_settings.getNumberOfParameters(); i++ ) {
69  // add parameter name
70  if( !paramStr.empty() ) {
71  paramStr.append( ", " );
72  }
73 
74  std::string name = m_settings.getParameterName( i );
75  std::string value = m_settings.getParameterValue( i );
76 
77  paramStr.append( FMT( "%s=%s", name.c_str(), value.c_str() ) );
78  }
79 
80  if( paramStr.empty() ) {
81  name.append( "]" );
82  }
83  else {
84  name.append( FMT( "(%s)]", paramStr.c_str() ) );
85  }
86 
87  setName( name.c_str() );
88 }
void init()
initializes
Definition: Filter.cpp:40
void setName(const char *name)
sets name
#define NULL
Definition: CoreMacros.h:18
kome::objects::SettingParameterValues m_settings
Definition: Filter.h:51
const char * getParameterValue(const unsigned int index)
gets parameter value
const char * getParameterName(const unsigned int index)
gets parameter name
kome::plugin::PluginCall * m_fun
Definition: Filter.h:48
unsigned int getNumberOfParameters()
gets the number of parameters

Here is the call graph for this function:

Member Data Documentation

kome::plugin::PluginCall* kome::operation::Filter::m_fun
protected

filter function

Definition at line 48 of file Filter.h.

kome::objects::SettingParameterValues kome::operation::Filter::m_settings
protected

parameters

Definition at line 51 of file Filter.h.


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