InstantSeriesProperties.hh 2.13 KB
/*
 * InstantSeriesProperties.hh
 *
 *  Created on: 13 déc. 2013
 *      Author: CS
 */

#ifndef INSTANTSERIESPROPERTIES_HH_
#define INSTANTSERIESPROPERTIES_HH_

#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>

#include "SeriesProperties.hh"

namespace plot {

/**
 * Instant Serie properties for InstantPlot
 */
class InstantSeriesProperties: public SeriesProperties {
public:
	InstantSeriesProperties() :
		SeriesProperties(),
		_tableOnXAxis(true),
		_id(-1),
		_tableParamsId() {
	}
	InstantSeriesProperties(const SeriesProperties& ref_) :
		SeriesProperties(ref_),
		_tableOnXAxis(true),
		_id(-1),
		_tableParamsId()
	{
	}

	InstantSeriesProperties(const InstantSeriesProperties& pParamDrawingProperties_) :
		SeriesProperties(pParamDrawingProperties_),
			_tableOnXAxis(pParamDrawingProperties_._tableOnXAxis),
			_id(pParamDrawingProperties_._id),
			_tableParamsId(pParamDrawingProperties_._tableParamsId)
	{
	}

	InstantSeriesProperties& operator=(const InstantSeriesProperties& ref_) {
		SeriesProperties::operator=(ref_);
		_tableOnXAxis = ref_._tableOnXAxis;
		_tableParamsId = ref_._tableParamsId;
		_id = ref_._id;
		return *this;
	}


	virtual ~InstantSeriesProperties() {
	}

	bool getTableOnXAxis() const {
		return _tableOnXAxis;
	}

	void setTableOnXAxis(bool tableOnXAxis) {
		_tableOnXAxis = tableOnXAxis;
	}

	int getId() const {
		return _id;
	}

	void setId(int id) {
		_id = id;
	}

	std::string getTableParamIdByName(std::string paramName){
		return _tableParamsId[paramName];
	}

	std::map<std::string, std::string>& getTableParams() {
		return _tableParamsId;
	}

	void addTableParam(std::string paramName, std::string paramId) {
		_tableParamsId[paramName] = paramId;
	}

	/*
	 * Dumps properties for test.
	 */
	void dump(std::ostream& out_, std::string& prefix_);

private :

	/**
	 * draw table value on x axis on the plot
	 */
	bool _tableOnXAxis;

	/**
	 * @brief Serie identifier used by the fill element
	 */
	int _id;

	/**
	 * @brief Calculated tableParamsId (from resolution).
	 */
	std::map<std::string, std::string> _tableParamsId;
};

} /* namespace plot */
#endif /* INSTANTSERIESPROPERTIES_HH_ */