EpochAxisDecorator.hh 1.08 KB
/*
 * EpochAxisDecorator.hh
 *
 *  Created on: Jan 16, 2015
 *      Author: AKKA
 */

#ifndef EPOCHAXISDECORATOR_HH_
#define EPOCHAXISDECORATOR_HH_

#include <boost/smart_ptr/shared_ptr.hpp>
#include <iosfwd>

#include "plplot/plplot.h"

#include "plplot/plstream.h"

#include "DefaultTimeAxisDecorator.hh"


namespace plot {

/**
 * @brief A simple decorator that display epoch time.
 */
class EpochAxisDecorator: public DefaultTimeAxisDecorator {
public:
	EpochAxisDecorator() : DefaultTimeAxisDecorator() {
	}
	EpochAxisDecorator(const EpochAxisDecorator& ref_ ) : DefaultTimeAxisDecorator(ref_){
	}
	EpochAxisDecorator& operator=(const EpochAxisDecorator& /*ref_*/) {
		return *this;
	}
	virtual ~EpochAxisDecorator(){
	}

protected:
	/**
	 * @overload DefaultTimeAxisDecorator::installLabelGenerator
	 */
	void installLabelGenerator(PanelPlotOutput* pplot_, TimeAxis* axis_);
};

/**
 * @brief Custom generator for epoch time label
 */
void generateEpochTimeLabel(PLINT axis, PLFLT value, char *label, PLINT length,
		PLPointer data);

} /* namespace plot */

#endif /* DEFAULEPOCHAXISDECORATOR_HH_ */