23 using namespace kome::objects;
28 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
29 #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
125 if( instrument ==
NULL ) {
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 ) ) {
136 c = (char)toupper( c );
139 else if( !prevSpace ) {
243 if( parentGroup ==
NULL ) {
263 if( child !=
NULL ) {
294 std::string groupName =
m_name;
296 std::string fileName;
301 if( !fileName.empty() ) {
302 if( !groupName.empty() ) {
303 groupName.append(
" : " );
305 groupName.append( fileName );
309 groupName.append( FMT(
"(%d)", this->
m_sampleIdx ) );
321 LOG_INFO( FMT(
"Open Sample [%s]",
m_name.c_str() ) );
348 LOG_ERROR( FMT(
"Failed to open the sample.[%s]",
m_name.c_str() ) );
391 const char* keys[] = {
404 const unsigned int num =
sizeof( keys ) /
sizeof(
const char* );
406 for(
unsigned int i = 0; i < num; i++ ) {
451 for(
int i=0; i < inum; i++ ){
484 if( tmp->
getId() == id ) {
494 static int chromId = 0;
516 if( tmp->
getId() == id ) {
527 static int groupId = 0;
536 for(
int i=0; i < inum; i++ ){
538 if( group->
getId() == id ){
558 LOG_WARN( FMT(
"This file type does not support API peak detection." ) );
int issueSpecId()
to issue the spectrum id
interfaces of ActiveObjectsManager class
group of spectrum management class
bool isEdited()
judges whther this sample is edited or not
virtual bool onOpenSample(Sample *sample, kome::core::Progress *progress=NULL)=0
This method is called by openSample method. (abstract method)
void getDataSet(DataSet *dataSet)
gets spectra that contains this group. (getSpectrum method cannot get spectra that belong to child gr...
virtual bool onCloseSample()=0
This method is called by closeSample method. (abstract method)
sample set information management class
void setName(const char *name)
sets sample name
interfaces of Chromatogram class
SampleSet * getSampleSet()
gets sample set object
int getId()
gets spectrum id
DataGroupNode * getChild(const unsigned int index)
gets child group
virtual void onDetectPeaksByAPI(Spectrum *spec, Peaks *peaks)
This methos is called by detectPeakByAPI method.
sample information management class
Chromatogram * getChromatogramById(int id)
A schromatogram is acquired by id.
DataGroupNode * getGroup(const unsigned int index)
gets spectrum group
std::vector< DataGroupNode * > m_groups
static void openSample(Sample *sample)
This method is called when a sample is opened.
int getId()
gets chromatogram id
void setInstrument(const char *instrument)
sets instrument name
static ActiveObjectsManager & getInstance()
get active object manager object (This is the only object.)
active object management class
static void closeSample(Sample *sample, const bool deleting)
This method is called when a sample is closed.
static std::vector< std::string > m_commonProps
void setValue(const char *key, const char *value)
sets parameter value
Spectrum * getSpectrumById(int id)
A spectrum is acquired by id.
interfaces of SampleSet class
const char * getFileName()
gets file name
unsigned int getNumberOfSpectra()
gets the number of spectra
std::string m_softwareName
std::string trimstring(const char *s)
remove white spaces from both ends of specified string
interfaces of Spectrum class
static void stopLoadingTimer()
stops loading timer
kome::core::Properties & getProperties()
gets properties
const char * getName()
gets sample name
progress display abstract class
Spectrum * getSpectrum(const unsigned int index)
gets the number of spectra
interfaces of DataGroupNode class
static void resetId()
Reset the ID of the sample.
interfaces of Sample class
interfaces of Peaks class
void setMsCompany(const char *company)
sets MS company
const char * getType()
gets sample type
void setParallelReadable(const bool readable)
sets parallel readable or not
DataGroupNode * getGroupById(int id)
A DataGroupNode is qcquired by id.
Chromatogram * getChromatogram(const unsigned int index)
gets chroamtogram
void detectPeaksByAPI(Spectrum *spec, Peaks *peaks)
detect peaks using Application Progreamming Interface
#define NVL(checkVal, replaceVal)
unsigned int getNumberOfOpenedSamples()
gets the number of opened samples
Sample(SampleSet *sampleSet)
constructor
const char * getInstrument()
gets instrument name
std::string m_softwareVersion
const char * getSoftwareName()
gets software name
bool closeSample()
closes sample
static int issueSampleId()
to issue the sample id
unsigned int getNumberOfChromatograms()
gets the number of chromatograms
bool isParallelReadable()
gets whether this sample is parallel readable or not
void setSampleId(int id)
set sample id
void setEdited(const bool edited)
sets edited flag
const char * getMsCompany()
gets MS company
int getSampleIndex()
gets sample index
unsigned int getNumberOfSamples()
gets the nubmer of samples
bool isSupportedAPIPeaks()
judges whether API peak detection is supported on this sample.
DataGroupNode * getRootDataGroupNode()
gets root spectrum group
void setType(const char *type)
sets sample type
unsigned int getNumberOfGroups()
gets the number of spectrum groups
bool openSample(kome::core::Progress *progress=NULL)
opens sample [out] progress progressbar to display
void setSampleIndex(const int index)
sets sample index
spectrum information management class
static bool isCommonProperty(const char *key)
check whther the specified property key is common property or not
void getGroups(DataGroupNode *parentGroup=NULL)
gets spectrum groups
one or more spectra management class
virtual bool onOpenSample(DataGroupNode *rootGroup, kome::core::Progress *progress)=0
This method is called by openSample method. (abstract method)
int getSampleId()
get sample id
void setSupportedAPIPeaks(const bool supported)
sets API peak dtection is supported on this sample.
void setSoftwareVersion(const char *version)
sets software version
static Sample * getSampleById(int id)
A sample is acquired by id.
int issueChromId(Sample *sample)
to issue the chromatogram id
Sample * getOpenedSample(const unsigned int idx)
gets opened sample
int issueGroupId(Sample *sample)
to issue the group id
chromatogram information management class
const char * getSoftwareVersion()
gets software version
virtual ~Sample()
destructor
static void startLoadingTimer()
starts loading timer
interfaces of DataManager class
bool isOpened()
judges whther this sample is opened or not
void setSoftwareName(const char *name)
sets software name
virtual void sortSpectra()
sorts spectra in retention time order (override method)
const char * getFilePath()
gets file path
DataSet * getHiddenDataSet()
gets the hidden data set
void setOpened(const bool opened)
sets opened flag
virtual bool onCloseSample(Sample *sample)=0
This method is called by closeSample method. (abstract method)
unsigned int getNumberOfChildren()
gets the number of children
void setGroupIndex(const int index)
sets group index