source: flair-src/trunk/lib/FlairCore/src/DataPlot1D.cpp@ 219

Last change on this file since 219 was 137, checked in by Sanahuja Guillaume, 8 years ago

singleton manager

File size: 1.7 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5// created: 2011/10/07
6// filename: DataPlot1D.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Class displaying a 1D plot on the ground station
14//
15//
16/*********************************************************************/
17
18#include "DataPlot1D.h"
19#include "LayoutPosition.h"
20#include "IODataElement.h"
21
22using std::string;
23
24namespace flair {
25namespace gui {
26
27using namespace core;
28
29DataPlot1D::DataPlot1D(const LayoutPosition *position, string name, float ymin,
30 float ymax)
31 : DataPlot(position, name, "DataPlot1D") {
32 SetVolatileXmlProp("min", ymin);
33 SetVolatileXmlProp("max", ymax);
34 SendXml();
35}
36
37DataPlot1D::~DataPlot1D() {}
38
39void DataPlot1D::AddCurve(const core::IODataElement *element, uint8_t r,
40 uint8_t g, uint8_t b, string curve_name) {
41 if (curve_name != "") {
42 SetVolatileXmlProp("curve", curve_name);
43 } else {
44 SetVolatileXmlProp("curve", element->Parent()->ObjectName() + "\\" +
45 element->ObjectName());
46 }
47 SetVolatileXmlProp("type", element->GetDataType().GetDescription());
48 SetVolatileXmlProp("r", r);
49 SetVolatileXmlProp("g", g);
50 SetVolatileXmlProp("b", b);
51
52 SendXml();
53
54 // save data information
55 AddDataToSend(element);
56}
57
58void DataPlot1D::AddCurve(const core::IODataElement *element, Color_t color,
59 string curve_name) {
60 uint8_t r, g, b;
61 RGBFromColor(color, r, g, b);
62 AddCurve(element, r, g, b, curve_name);
63}
64
65} // end namespace gui
66} // end namespace flair
Note: See TracBrowser for help on using the repository browser.