Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
kome::objects::Sample Class Referenceabstract

sample information management class More...

#include <Sample.h>

Inheritance diagram for kome::objects::Sample:
Inheritance graph
[legend]
Collaboration diagram for kome::objects::Sample:
Collaboration graph
[legend]

Public Member Functions

 Sample (SampleSet *sampleSet)
 constructor
 
virtual ~Sample ()
 destructor
 
SampleSetgetSampleSet ()
 gets sample set object More...
 
void setSampleIndex (const int index)
 sets sample index More...
 
int getSampleIndex ()
 gets sample index More...
 
void setName (const char *name)
 sets sample name More...
 
const char * getName ()
 gets sample name More...
 
void setType (const char *type)
 sets sample type More...
 
const char * getType ()
 gets sample type More...
 
void setInstrument (const char *instrument)
 sets instrument name More...
 
const char * getInstrument ()
 gets instrument name More...
 
void setMsCompany (const char *company)
 sets MS company More...
 
const char * getMsCompany ()
 gets MS company More...
 
void setSoftwareName (const char *name)
 sets software name More...
 
const char * getSoftwareName ()
 gets software name More...
 
void setSoftwareVersion (const char *version)
 sets software version More...
 
const char * getSoftwareVersion ()
 gets software version More...
 
void setOpened (const bool opened)
 sets opened flag More...
 
bool isOpened ()
 judges whther this sample is opened or not More...
 
void setEdited (const bool edited)
 sets edited flag More...
 
bool isEdited ()
 judges whther this sample is edited or not More...
 
DataGroupNodegetRootDataGroupNode ()
 gets root spectrum group More...
 
DataSetgetHiddenDataSet ()
 gets the hidden data set More...
 
unsigned int getNumberOfGroups ()
 gets the number of spectrum groups More...
 
DataGroupNodegetGroup (const unsigned int index)
 gets spectrum group More...
 
void setParallelReadable (const bool readable)
 sets parallel readable or not More...
 
bool isParallelReadable ()
 gets whether this sample is parallel readable or not More...
 
bool openSample (kome::core::Progress *progress=NULL)
 opens sample [out] progress progressbar to display More...
 
bool closeSample ()
 closes sample More...
 
void detectPeaksByAPI (Spectrum *spec, Peaks *peaks)
 detect peaks using Application Progreamming Interface More...
 
void setSampleId (int id)
 set sample id More...
 
int getSampleId ()
 get sample id More...
 
int issueSpecId ()
 to issue the spectrum id More...
 
SpectrumgetSpectrumById (int id)
 A spectrum is acquired by id. More...
 
int issueChromId (Sample *sample)
 to issue the chromatogram id More...
 
ChromatogramgetChromatogramById (int id)
 A schromatogram is acquired by id. More...
 
int issueGroupId (Sample *sample)
 to issue the group id More...
 
DataGroupNodegetGroupById (int id)
 A DataGroupNode is qcquired by id. More...
 
bool isSupportedAPIPeaks ()
 judges whether API peak detection is supported on this sample. More...
 
void setSupportedAPIPeaks (const bool supported)
 sets API peak dtection is supported on this sample. More...
 

Static Public Member Functions

static void resetId ()
 Reset the ID of the sample.
 
static bool isCommonProperty (const char *key)
 check whther the specified property key is common property or not More...
 
static int issueSampleId ()
 to issue the sample id More...
 
static SamplegetSampleById (int id)
 A sample is acquired by id. More...
 

Protected Member Functions

void getGroups (DataGroupNode *parentGroup=NULL)
 gets spectrum groups More...
 
virtual void onDetectPeaksByAPI (Spectrum *spec, Peaks *peaks)
 This methos is called by detectPeakByAPI method.
 
virtual bool onOpenSample (DataGroupNode *rootGroup, kome::core::Progress *progress)=0
 This method is called by openSample method. (abstract method) More...
 
virtual bool onCloseSample ()=0
 This method is called by closeSample method. (abstract method) More...
 

Protected Attributes

SampleSetm_sampleSet
 
int m_sampleIdx
 
int m_specId
 
std::string m_name
 
std::string m_type
 
std::string m_instrument
 
std::string m_company
 
std::string m_softwareName
 
std::string m_softwareVersion
 
DataGroupNodem_root
 
bool m_opened
 
bool m_edited
 
std::vector< DataGroupNode * > m_groups
 
bool m_parallelReadable
 
DataSet m_hiddenSet
 
bool m_supportedApiPeaks
 

Static Protected Attributes

static int m_optSampleId = 0
 
static std::vector< std::string > m_commonProps
 

Detailed Description

sample information management class

Definition at line 34 of file Sample.h.

Member Function Documentation

bool kome::objects::Sample::closeSample ( )

closes sample

Returns
If true, it succeeded to close this sample.

Definition at line 357 of file Sample.cpp.

357  {
358  if( !m_opened ) {
359  return true;
360  }
361 
362  // close
363  bool ret = onCloseSample();
364  DataManager::closeSample( this, false );
365  m_opened = false;
366 
367  // delete spectra
368  if( m_root != NULL ) {
369  delete m_root;
370  m_root = NULL;
371  m_groups.clear();
372  }
373 
374  // sample set
375  if( m_sampleSet != NULL ) {
376  m_sampleSet->onCloseSample( this );
377  }
378  m_specId = 0; // @date 2013.09.05 <Add> M.Izumi
379 
380  return ret;
381 }
virtual bool onCloseSample()=0
This method is called by closeSample method. (abstract method)
std::vector< DataGroupNode * > m_groups
Definition: Sample.h:86
static void closeSample(Sample *sample, const bool deleting)
This method is called when a sample is closed.
Definition: DataManager.cpp:64
#define NULL
Definition: CoreMacros.h:18
SampleSet * m_sampleSet
Definition: Sample.h:50
virtual bool onCloseSample(Sample *sample)=0
This method is called by closeSample method. (abstract method)
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

void kome::objects::Sample::detectPeaksByAPI ( Spectrum spec,
Peaks peaks 
)

detect peaks using Application Progreamming Interface

Parameters
[in]specspectrum to detect peaks
[out]peakspeaks object to store peaks information

Definition at line 384 of file Sample.cpp.

384  {
385  onDetectPeaksByAPI( spec, peaks );
386 }
virtual void onDetectPeaksByAPI(Spectrum *spec, Peaks *peaks)
This methos is called by detectPeakByAPI method.
Definition: Sample.cpp:556

Here is the call graph for this function:

Chromatogram * kome::objects::Sample::getChromatogramById ( int  id)

A schromatogram is acquired by id.

Parameters
[in]idchromatogram id
Returns
chromatogram object

Definition at line 501 of file Sample.cpp.

501  {
502  // @date 2013.09.03 <Mod> M.Izumi ->
503  // gets all spectra
504  kome::objects::DataSet chroms;
505 
507  if( root == NULL ) {
508  return NULL;
509  }
510  root->getDataSet( &chroms );
511 
512  // search spectrum
514  for( unsigned int i = 0; i < chroms.getNumberOfChromatograms() && chrom == NULL; i++ ) {
515  kome::objects::Chromatogram* tmp = chroms.getChromatogram( i );
516  if( tmp->getId() == id ) {
517  chrom = tmp;
518  }
519  }
520 
521  return chrom;
522  // @date 2013.09.03 <Mod> M.Izumi <-
523 }
group of spectrum management class
Definition: DataGroupNode.h:33
void getDataSet(DataSet *dataSet)
gets spectra that contains this group. (getSpectrum method cannot get spectra that belong to child gr...
int getId()
gets chromatogram id
Chromatogram * getChromatogram(const unsigned int index)
gets chroamtogram
Definition: DataSet.cpp:146
#define NULL
Definition: CoreMacros.h:18
unsigned int getNumberOfChromatograms()
gets the number of chromatograms
Definition: DataSet.cpp:141
DataGroupNode * getRootDataGroupNode()
gets root spectrum group
Definition: Sample.cpp:219
one or more spectra management class
Definition: DataSet.h:31
chromatogram information management class
Definition: Chromatogram.h:33

Here is the call graph for this function:

DataGroupNode * kome::objects::Sample::getGroup ( const unsigned int  index)

gets spectrum group

Parameters
[in]indexspectrum group index
Returns
spectrum group (If NULL, the index is illegal.)

Definition at line 234 of file Sample.cpp.

234  {
235  if( index >= m_groups.size() ) {
236  return NULL;
237  }
238  return m_groups[ index ];
239 }
std::vector< DataGroupNode * > m_groups
Definition: Sample.h:86
#define NULL
Definition: CoreMacros.h:18
DataGroupNode * kome::objects::Sample::getGroupById ( int  id)

A DataGroupNode is qcquired by id.

Parameters
[in]idgroup id
Returns
DataGroupNode object

Definition at line 534 of file Sample.cpp.

534  {
535  int inum = getNumberOfGroups();
536  for( int i=0; i < inum; i++ ){
537  DataGroupNode* group = getGroup(i);
538  if( group->getId() == id ){
539  return group;
540  }
541  }
542  return NULL;
543 }
group of spectrum management class
Definition: DataGroupNode.h:33
DataGroupNode * getGroup(const unsigned int index)
gets spectrum group
Definition: Sample.cpp:234
#define NULL
Definition: CoreMacros.h:18
unsigned int getNumberOfGroups()
gets the number of spectrum groups
Definition: Sample.cpp:229

Here is the call graph for this function:

void kome::objects::Sample::getGroups ( DataGroupNode parentGroup = NULL)
protected

gets spectrum groups

Parameters
[in]parentGroupparent spectrum group

Definition at line 242 of file Sample.cpp.

242  {
243  if( parentGroup == NULL ) { // all groups
244  // initialize
245  m_groups.clear();
246 
247  if( m_root != NULL ) {
248  getGroups( m_root );
249  }
250  }
251  else {
252  // add
253  if( parentGroup->getNumberOfChildren() == 0 ) { // leaf
254  // set index
255  parentGroup->setGroupIndex( (int)m_groups.size() );
256  m_groups.push_back( parentGroup );
257  }
258 
259  // add children
260  for( unsigned int i = 0; i < parentGroup->getNumberOfChildren(); i++ ) {
261  // child
262  DataGroupNode* child = parentGroup->getChild( i );
263  if( child != NULL ) {
264  getGroups( child );
265  }
266  }
267  }
268 }
group of spectrum management class
Definition: DataGroupNode.h:33
DataGroupNode * getChild(const unsigned int index)
gets child group
std::vector< DataGroupNode * > m_groups
Definition: Sample.h:86
#define NULL
Definition: CoreMacros.h:18
void getGroups(DataGroupNode *parentGroup=NULL)
gets spectrum groups
Definition: Sample.cpp:242
unsigned int getNumberOfChildren()
gets the number of children
DataGroupNode * m_root
Definition: Sample.h:77
void setGroupIndex(const int index)
sets group index

Here is the call graph for this function:

DataSet * kome::objects::Sample::getHiddenDataSet ( )

gets the hidden data set

Returns
hidden data set

Definition at line 224 of file Sample.cpp.

224  {
225  return &m_hiddenSet;
226 }
DataSet m_hiddenSet
Definition: Sample.h:92
const char * kome::objects::Sample::getInstrument ( )

gets instrument name

Returns
instrument name

Definition at line 152 of file Sample.cpp.

152  {
153  return m_instrument.c_str();
154 }
std::string m_instrument
Definition: Sample.h:65
const char * kome::objects::Sample::getMsCompany ( )

gets MS company

Returns
MS company

Definition at line 166 of file Sample.cpp.

166  {
167  return m_company.c_str();
168 }
std::string m_company
Definition: Sample.h:68
const char * kome::objects::Sample::getName ( )

gets sample name

Returns
sample name

Definition at line 102 of file Sample.cpp.

102  {
103  return m_name.c_str();
104 }
std::string m_name
Definition: Sample.h:59
unsigned int kome::objects::Sample::getNumberOfGroups ( )

gets the number of spectrum groups

Returns
the number of spectrum groups

Definition at line 229 of file Sample.cpp.

229  {
230  return m_groups.size();
231 }
std::vector< DataGroupNode * > m_groups
Definition: Sample.h:86
DataGroupNode * kome::objects::Sample::getRootDataGroupNode ( )

gets root spectrum group

Returns
root spectrum group

Definition at line 219 of file Sample.cpp.

219  {
220  return m_root;
221 }
DataGroupNode * m_root
Definition: Sample.h:77
static Sample * kome::objects::Sample::getSampleById ( int  id)
static

A sample is acquired by id.

Parameters
[in]idsample id

Definition at line 447 of file Sample.cpp.

447  {
449 
450  int inum = aoMgr.getNumberOfOpenedSamples();
451  for( int i=0; i < inum; i++ ){
452  Sample* sample = aoMgr.getOpenedSample( i );
453  if( m_optSampleId == id ){
454  return sample;
455  }
456  }
457 
458  return NULL;
459 }
sample information management class
Definition: Sample.h:34
static ActiveObjectsManager & getInstance()
get active object manager object (This is the only object.)
active object management class
unsigned int getNumberOfOpenedSamples()
gets the number of opened samples
#define NULL
Definition: CoreMacros.h:18
Sample * getOpenedSample(const unsigned int idx)
gets opened sample
static int m_optSampleId
Definition: Sample.h:98

Here is the call graph for this function:

int kome::objects::Sample::getSampleId ( )

get sample id

Returns
sample id

Definition at line 442 of file Sample.cpp.

442  {
443  return m_optSampleId;
444 }
static int m_optSampleId
Definition: Sample.h:98
int kome::objects::Sample::getSampleIndex ( )

gets sample index

Returns
sample index

Definition at line 87 of file Sample.cpp.

87  {
88  return m_sampleIdx;
89 }
SampleSet * kome::objects::Sample::getSampleSet ( )

gets sample set object

Returns
sample set

Definition at line 77 of file Sample.cpp.

77  {
78  return m_sampleSet;
79 }
SampleSet * m_sampleSet
Definition: Sample.h:50
const char * kome::objects::Sample::getSoftwareName ( )

gets software name

Returns
software name

Definition at line 180 of file Sample.cpp.

180  {
181  return m_softwareName.c_str();
182 }
std::string m_softwareName
Definition: Sample.h:71
const char * kome::objects::Sample::getSoftwareVersion ( )

gets software version

Returns
software version

Definition at line 194 of file Sample.cpp.

194  {
195  return m_softwareVersion.c_str();
196 }
std::string m_softwareVersion
Definition: Sample.h:74
Spectrum * kome::objects::Sample::getSpectrumById ( int  id)

A spectrum is acquired by id.

Parameters
[in]idspectrum id
Returns
spectrum object

Definition at line 470 of file Sample.cpp.

470  {
471  // gets all spectra
472  kome::objects::DataSet spectra;
473 
475  if( root == NULL ) {
476  return NULL;
477  }
478  root->getDataSet( &spectra );
479 
480  // search spectrum
482  for( unsigned int i = 0; i < spectra.getNumberOfSpectra() && spec == NULL; i++ ) {
483  kome::objects::Spectrum* tmp = spectra.getSpectrum( i );
484  if( tmp->getId() == id ) {
485  spec = tmp;
486  }
487  }
488 
489  return spec;
490 }
group of spectrum management class
Definition: DataGroupNode.h:33
void getDataSet(DataSet *dataSet)
gets spectra that contains this group. (getSpectrum method cannot get spectra that belong to child gr...
int getId()
gets spectrum id
Definition: Spectrum.cpp:1136
unsigned int getNumberOfSpectra()
gets the number of spectra
Definition: DataSet.cpp:128
Spectrum * getSpectrum(const unsigned int index)
gets the number of spectra
Definition: DataSet.cpp:133
#define NULL
Definition: CoreMacros.h:18
DataGroupNode * getRootDataGroupNode()
gets root spectrum group
Definition: Sample.cpp:219
spectrum information management class
Definition: Spectrum.h:30
one or more spectra management class
Definition: DataSet.h:31

Here is the call graph for this function:

const char * kome::objects::Sample::getType ( )

gets sample type

Returns
sample type

Definition at line 117 of file Sample.cpp.

117  {
118  return m_type.c_str();
119 }
std::string m_type
Definition: Sample.h:62
static bool kome::objects::Sample::isCommonProperty ( const char *  key)
static

check whther the specified property key is common property or not

Parameters
[in]keyparameter key
Returns
If true, specified key is common property key

Definition at line 389 of file Sample.cpp.

389  {
390  // keys
391  const char* keys[] = {
392  "File Path",
393  "File Name",
394  "Instrument",
395  "Manufacturer",
396  "Sample Name",
397  "Sample Type",
398  "Software Name",
399  "Software Version"
400  };
401 
402  // create array
403  if( m_commonProps.size() == 0 ) {
404  const unsigned int num = sizeof( keys ) / sizeof( const char* );
405 
406  for( unsigned int i = 0; i < num; i++ ) {
407  m_commonProps.push_back( keys[ i ] );
408  }
409  }
410 
411  // check the key
412  if( key == NULL ) {
413  return false;
414  }
415 
416  for( unsigned int i = 0; i < m_commonProps.size(); i++ ) {
417  if( m_commonProps[ i ].compare( key ) == 0 ) {
418  return true;
419  }
420  }
421 
422  return false;
423 }
static std::vector< std::string > m_commonProps
Definition: Sample.h:102
#define NULL
Definition: CoreMacros.h:18
bool kome::objects::Sample::isEdited ( )

judges whther this sample is edited or not

Returns
If true, this sample is edited.

Definition at line 214 of file Sample.cpp.

214  {
215  return m_edited;
216 }
bool kome::objects::Sample::isOpened ( )

judges whther this sample is opened or not

Returns
If true, this sample is opened.

Definition at line 204 of file Sample.cpp.

204  {
205  return m_opened;
206 }
bool kome::objects::Sample::isParallelReadable ( )

gets whether this sample is parallel readable or not

Returns
If true, this sample is parallel readable.

Definition at line 276 of file Sample.cpp.

276  {
277  return m_parallelReadable;
278 }
bool m_parallelReadable
Definition: Sample.h:89
int kome::objects::Sample::issueChromId ( Sample sample)

to issue the chromatogram id

Parameters
[in]samplesample object
Returns
chromatogram id

Definition at line 493 of file Sample.cpp.

493  {
494  static int chromId = 0;
495  chromId++;
496 
497  return chromId;
498 }
int kome::objects::Sample::issueGroupId ( Sample sample)

to issue the group id

Parameters
[in]samplesample object
Returns
group id

Definition at line 526 of file Sample.cpp.

526  {
527  static int groupId = 0;
528 
529  groupId++;
530  return groupId;
531 }
static int kome::objects::Sample::issueSampleId ( )
static

to issue the sample id

Returns
sample id

Definition at line 426 of file Sample.cpp.

426  {
428  int inum = aoMgr.getNumberOfOpenedSamples();
429  int id = m_optSampleId;
430  if( inum > 0 ){
431  id++;
432  }
433  return id;
434 }
static ActiveObjectsManager & getInstance()
get active object manager object (This is the only object.)
active object management class
unsigned int getNumberOfOpenedSamples()
gets the number of opened samples
static int m_optSampleId
Definition: Sample.h:98

Here is the call graph for this function:

int kome::objects::Sample::issueSpecId ( )

to issue the spectrum id

Returns
new spectrum ID

Definition at line 462 of file Sample.cpp.

462  {
463  int specId = m_specId;
464  m_specId++;
465 
466  return specId;
467 }
bool kome::objects::Sample::isSupportedAPIPeaks ( )

judges whether API peak detection is supported on this sample.

Returns
If true, API peak detection is supported.

Definition at line 546 of file Sample.cpp.

546  {
547  return m_supportedApiPeaks;
548 }
bool m_supportedApiPeaks
Definition: Sample.h:95
bool kome::objects::Sample::onCloseSample ( )
protectedpure virtual

This method is called by closeSample method. (abstract method)

Returns
If true, it succeeded to close this sample.

Implemented in kome::operation::ManipulatedSample.

bool kome::objects::Sample::onOpenSample ( DataGroupNode rootGroup,
kome::core::Progress progress 
)
protectedpure virtual

This method is called by openSample method. (abstract method)

Parameters
[out]rootGrouproot spectrum group [out] progress progressbar to display
Returns
If true, it succeeded to open this sample.

Implemented in kome::operation::ManipulatedSample.

bool kome::objects::Sample::openSample ( kome::core::Progress progress = NULL)

opens sample [out] progress progressbar to display

Returns
If true, it succeeded to open this sample.

Definition at line 281 of file Sample.cpp.

281  {
282  if( m_opened ) { // already opened
283  return true;
284  }
285 
286  // active objects manager
288 
289  // create root group
290  if( m_root != NULL ) {
291  delete m_root;
292  m_groups.clear();
293  }
294  std::string groupName = m_name;
295 
296  std::string fileName;
297  if( m_sampleSet != NULL ) {
298  fileName = m_sampleSet->getFileName();
299  }
300 
301  if( !fileName.empty() ) {
302  if( !groupName.empty() ) {
303  groupName.append( " : " );
304  }
305  groupName.append( fileName );
306  }
307 
308  if( m_sampleSet != NULL && m_sampleSet->getNumberOfSamples() > 1 ) {
309  groupName.append( FMT( "(%d)", this->m_sampleIdx ) );
310  }
311 
312  m_root = new DataGroupNode( this, groupName.c_str() );
313 
314  // sample set
316  if( m_sampleSet != NULL ) {
317  m_sampleSet->onOpenSample( this, progress ); // add param @date 2014.07.08 <Mod> M.Izumi
318  }
319 
320  // open
321  LOG_INFO( FMT( "Open Sample [%s]", m_name.c_str() ) );
322  bool ret = onOpenSample( m_root, progress );
323 
324  // add sort @date 2011.10.31 <Add> M.Izumi
325  m_root->sortSpectra();
326 
328 
329  // properties
330  if( m_sampleSet != NULL ) {
331  m_root->getProperties().setValue( "File Path", m_sampleSet->getFilePath() );
332  m_root->getProperties().setValue( "File Name", m_sampleSet->getFileName() );
333  }
334  m_root->getProperties().setValue( "Instrument", m_instrument.c_str() );
335  m_root->getProperties().setValue( "Manufacturer", m_instrument.c_str() );
336  m_root->getProperties().setValue( "Sample Name", m_name.c_str() );
337  m_root->getProperties().setValue( "Sample Type", m_type.c_str() );
338  m_root->getProperties().setValue( "Software Name", m_softwareName.c_str() );
339  m_root->getProperties().setValue( "Software Version", m_softwareVersion.c_str() );
340 
341  if( ret ) { // success
342  m_opened = true;
343  getGroups( NULL );
344 
345  DataManager::openSample( this );
346  }
347  else { // failed
348  LOG_ERROR( FMT( "Failed to open the sample.[%s]", m_name.c_str() ) );
349  closeSample();
350  }
351 
352 
353  return ret;
354 }
group of spectrum management class
Definition: DataGroupNode.h:33
virtual bool onOpenSample(Sample *sample, kome::core::Progress *progress=NULL)=0
This method is called by openSample method. (abstract method)
std::vector< DataGroupNode * > m_groups
Definition: Sample.h:86
static void openSample(Sample *sample)
This method is called when a sample is opened.
Definition: DataManager.cpp:56
static ActiveObjectsManager & getInstance()
get active object manager object (This is the only object.)
active object management class
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
const char * getFileName()
gets file name
Definition: SampleSet.cpp:74
std::string m_softwareName
Definition: Sample.h:71
static void stopLoadingTimer()
stops loading timer
Definition: SampleSet.cpp:188
kome::core::Properties & getProperties()
gets properties
std::string m_type
Definition: Sample.h:62
#define NULL
Definition: CoreMacros.h:18
SampleSet * m_sampleSet
Definition: Sample.h:50
std::string m_softwareVersion
Definition: Sample.h:74
bool closeSample()
closes sample
Definition: Sample.cpp:357
std::string m_name
Definition: Sample.h:59
unsigned int getNumberOfSamples()
gets the nubmer of samples
Definition: SampleSet.cpp:115
void getGroups(DataGroupNode *parentGroup=NULL)
gets spectrum groups
Definition: Sample.cpp:242
virtual bool onOpenSample(DataGroupNode *rootGroup, kome::core::Progress *progress)=0
This method is called by openSample method. (abstract method)
std::string m_instrument
Definition: Sample.h:65
static void startLoadingTimer()
starts loading timer
Definition: SampleSet.cpp:183
virtual void sortSpectra()
sorts spectra in retention time order (override method)
const char * getFilePath()
gets file path
Definition: SampleSet.cpp:69
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

void kome::objects::Sample::setEdited ( const bool  edited)

sets edited flag

Parameters
[in]editededited flag value

Definition at line 209 of file Sample.cpp.

209  {
210  m_edited = edited;
211 }
void kome::objects::Sample::setInstrument ( const char *  instrument)

sets instrument name

Parameters
[in]instrumentinstrument name

Definition at line 122 of file Sample.cpp.

122  {
123  // clear
124  m_instrument.clear();
125  if( instrument == NULL ) {
126  return;
127  }
128 
129  // instrument name
130  std::string instStr = trimstring( instrument );
131  bool prevSpace = false;
132  for( unsigned int i = 0; i < instStr.size(); i++ ) {
133  char c = instStr[ i ];
134  if( isalpha( c ) || isdigit( c ) ) {
135  prevSpace = false;
136  c = (char)toupper( c );
137  m_instrument.push_back( c );
138  }
139  else if( !prevSpace ) {
140  prevSpace = true;
141  m_instrument.push_back( '-' );
142  }
143  }
144 
145  // set property
146  if( m_root != NULL ) {
147  m_root->getProperties().setValue( "Instrument", m_instrument.c_str() );
148  }
149 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
std::string trimstring(const char *s)
remove white spaces from both ends of specified string
kome::core::Properties & getProperties()
gets properties
#define NULL
Definition: CoreMacros.h:18
std::string m_instrument
Definition: Sample.h:65
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

void kome::objects::Sample::setMsCompany ( const char *  company)

sets MS company

Parameters
[in]companyMS company

Definition at line 157 of file Sample.cpp.

157  {
158  m_company = NVL( company, "" );
159 
160  if( m_root != NULL ) {
161  m_root->getProperties().setValue( "Manufacturer", m_company.c_str() );
162  }
163 }
std::string m_company
Definition: Sample.h:68
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
kome::core::Properties & getProperties()
gets properties
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
#define NULL
Definition: CoreMacros.h:18
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

void kome::objects::Sample::setName ( const char *  name)

sets sample name

Parameters
[in]namesample name

Definition at line 92 of file Sample.cpp.

92  {
93  m_name = NVL( name, "" );
94 
95  // property
96  if( m_root != NULL ) {
97  m_root->getProperties().setValue( "Sample Name", m_name.c_str() );
98  }
99 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
kome::core::Properties & getProperties()
gets properties
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
#define NULL
Definition: CoreMacros.h:18
std::string m_name
Definition: Sample.h:59
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

void kome::objects::Sample::setOpened ( const bool  opened)

sets opened flag

Parameters
[in]openedopened flag value

Definition at line 199 of file Sample.cpp.

199  {
200  m_opened = opened;
201 }
void kome::objects::Sample::setParallelReadable ( const bool  readable)

sets parallel readable or not

Parameters
[in]readableIf true, this sample is parallel readabale.

Definition at line 271 of file Sample.cpp.

271  {
272  m_parallelReadable = readable;
273 }
bool m_parallelReadable
Definition: Sample.h:89
void kome::objects::Sample::setSampleId ( int  id)

set sample id

Parameters
[in]idsample id

Definition at line 437 of file Sample.cpp.

437  {
438  m_optSampleId = id;
439 }
static int m_optSampleId
Definition: Sample.h:98
void kome::objects::Sample::setSampleIndex ( const int  index)

sets sample index

Parameters
[in]indexsample index

Definition at line 82 of file Sample.cpp.

82  {
83  m_sampleIdx = index;
84 }
void kome::objects::Sample::setSoftwareName ( const char *  name)

sets software name

Parameters
[in]namesoftware name

Definition at line 171 of file Sample.cpp.

171  {
172  m_softwareName = NVL( name, "" );
173 
174  if( m_root != NULL ) {
175  m_root->getProperties().setValue( "Software Name", m_softwareName.c_str() );
176  }
177 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
std::string m_softwareName
Definition: Sample.h:71
kome::core::Properties & getProperties()
gets properties
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
#define NULL
Definition: CoreMacros.h:18
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

void kome::objects::Sample::setSoftwareVersion ( const char *  version)

sets software version

Parameters
[in]versionsoftware version

Definition at line 185 of file Sample.cpp.

185  {
186  m_softwareVersion = NVL( version, "" );
187 
188  if( m_root != NULL ) {
189  m_root->getProperties().setValue( "Software Version", m_softwareVersion.c_str() );
190  }
191 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
kome::core::Properties & getProperties()
gets properties
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
#define NULL
Definition: CoreMacros.h:18
std::string m_softwareVersion
Definition: Sample.h:74
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

void kome::objects::Sample::setSupportedAPIPeaks ( const bool  supported)

sets API peak dtection is supported on this sample.

Parameters
[in]supportedIf true, API peak detection is supported.

Definition at line 551 of file Sample.cpp.

551  {
552  m_supportedApiPeaks = supported;
553 }
bool m_supportedApiPeaks
Definition: Sample.h:95
void kome::objects::Sample::setType ( const char *  type)

sets sample type

Parameters
[in]typesample type

Definition at line 107 of file Sample.cpp.

107  {
108  m_type = NVL( type, "" );
109 
110  // property
111  if( m_root != NULL ) {
112  m_root->getProperties().setValue( "Sample Type", m_type.c_str() );
113  }
114 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
kome::core::Properties & getProperties()
gets properties
std::string m_type
Definition: Sample.h:62
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
#define NULL
Definition: CoreMacros.h:18
DataGroupNode * m_root
Definition: Sample.h:77

Here is the call graph for this function:

Member Data Documentation

std::vector< std::string > Sample::m_commonProps
staticprotected

common properties

Definition at line 102 of file Sample.h.

std::string kome::objects::Sample::m_company
protected

company name

Definition at line 68 of file Sample.h.

bool kome::objects::Sample::m_edited
protected

edited flag

Definition at line 83 of file Sample.h.

std::vector< DataGroupNode* > kome::objects::Sample::m_groups
protected

groups

Definition at line 86 of file Sample.h.

DataSet kome::objects::Sample::m_hiddenSet
protected

data set

Definition at line 92 of file Sample.h.

std::string kome::objects::Sample::m_instrument
protected

instrument name

Definition at line 65 of file Sample.h.

std::string kome::objects::Sample::m_name
protected

name

Definition at line 59 of file Sample.h.

bool kome::objects::Sample::m_opened
protected

opened flag

Definition at line 80 of file Sample.h.

int Sample::m_optSampleId = 0
staticprotected

sample id

Definition at line 98 of file Sample.h.

bool kome::objects::Sample::m_parallelReadable
protected

parallel readable

Definition at line 89 of file Sample.h.

DataGroupNode* kome::objects::Sample::m_root
protected

root spectrum group

Definition at line 77 of file Sample.h.

int kome::objects::Sample::m_sampleIdx
protected

sample index

Definition at line 53 of file Sample.h.

SampleSet* kome::objects::Sample::m_sampleSet
protected

sample set

Definition at line 50 of file Sample.h.

std::string kome::objects::Sample::m_softwareName
protected

software name

Definition at line 71 of file Sample.h.

std::string kome::objects::Sample::m_softwareVersion
protected

software version

Definition at line 74 of file Sample.h.

int kome::objects::Sample::m_specId
protected

spectrum ID

Definition at line 56 of file Sample.h.

bool kome::objects::Sample::m_supportedApiPeaks
protected

api peaks support

Definition at line 95 of file Sample.h.

std::string kome::objects::Sample::m_type
protected

type

Definition at line 62 of file Sample.h.


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