File: Tutorial_Logger.cpp

package info (click to toggle)
openms 2.6.0%2Bcleaned1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 783,168 kB
  • sloc: cpp: 526,888; xml: 142,287; ansic: 54,252; python: 11,640; php: 2,454; sh: 1,137; ruby: 529; yacc: 403; perl: 85; lex: 74; makefile: 61
file content (18 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! [Logger] 

  ProgressLogger progresslogger;
    progresslogger.setLogType(log_type_);  // set the log type (command line or a file)

    // set start progress (0) and end (ms_run.size() = the number of spectra)
    progresslogger.startProgress(0, ms_run.size(), "Doing some calculation...");

    for (PeakMap::Iterator it = ms_run.begin(); it != ms_run.end(); ++it)
    {
	  // update progress
         progresslogger.setProgress(ms_run.end() - it);
      
	  // do the actual calculations and processing ...
    }
    progresslogger.endProgress();

//! [Logger]