DefaultPlotConfiguration.cc
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* DefaultPlotConfiguration.cc
*
* Created on: 28 oct. 2013
* Author: CS
*/
#include "DefaultPlotConfiguration.hh"
#include "PlotConfigurationLoader.hh"
namespace plot {
const std::string DefaultPlotConfiguration::TIME_DEFAULT_ID = "timeAxis";
const std::string DefaultPlotConfiguration::EPOCH_DEFAULT_ID = "epochAxis";
const std::string DefaultPlotConfiguration::COLORAXIS_ID = "colorAxis";
std::unique_ptr<DefaultPlotConfiguration> DefaultPlotConfiguration::_instance =
nullptr;
std::once_flag DefaultPlotConfiguration::_instanceOnceFlag;
DefaultPlotConfiguration::DefaultPlotConfiguration() {
PlotConfigurationLoader lPlotLoader = PlotConfigurationLoader();
lPlotLoader.load<DefaultPlotConfiguration>(this);
}
DefaultPlotConfiguration::~DefaultPlotConfiguration() {
}
void DefaultPlotConfiguration::applyDefaultDrawingProperties(const std::string& key_, DrawingProperties& p_){
auto p = _defaultDrawingProperties.find(key_);
if( p != _defaultDrawingProperties.end() ){
p_.setXAxisId(p->second.getXAxisId());
p_.setZAxisId(p->second.getZAxisId());
//p_.setYAxisId(p->second.getXAxisId());
p_.setColor(p->second.getColor());
p_.setLineProperties(p->second.getLineProperties());
p_.setSymbolProperties(p->second.getSymbolProperties());
p_.setMaxResolution(_defaultPanel._resolution);
}
}
} /* namespace plot */