Robotsystem from Robot Group Leipzig: plotlog.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# plotlog.h

Go to the documentation of this file.

    00001 #ifndef _PLOTLOG_H_
    00002 #define _PLOTLOG_H_
    00003
    00004 #include "gnuplot.h"
    00005 #include "logfile.h"
    00006
    00007 /// \ingroup baseclasses
    00008
    00009 /** gnuplot and logfile classes in one. if you need to print and plot the same data, you can use this class */
    00010
    00011 template <class T> class PlotLog :  public Gnuplot<T> , public LogFile<T>
    00012 {
    00013  public:
    00014     PlotLog(int buffersize,const std::string& filename="",const std::string& info="",const std::string& separator="\t")
    00015         :Gnuplot<T>(buffersize)
    00016         ,LogFile<T>(filename,info,separator){
    00017     };
    00018
    00019     PlotLog(const std::string& filename="",const std::string& info="",const std::string& separator="\t")
    00020         :Gnuplot<T>(256)
    00021         ,LogFile<T>(filename,info,separator){
    00022     };
    00023
    00024 /// add a new channel
    00025     void addChannel(const T& name , const std::string& title="",const std::string& style="lines"){
    00026         Gnuplot<T>::addChannel(name,title,style);
    00027         LogFile<T>::addChannel(name);
    00028     };
    00029
    00030 /// put data in buffer
    00031     void putData(const T& channel, double value){
    00032         Gnuplot<T>::putData(channel,value);
    00033         LogFile<T>::putData(channel,value);
    00034     };
    00035 };
    00036
    00037 #endif