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

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

flaircore

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#include "FrameworkManager.h"
22
23using std::string;
24
25namespace flair
26{
27namespace gui
28{
29
30using namespace core;
31
32DataPlot1D::DataPlot1D(const LayoutPosition* position,string name,float ymin,float ymax):DataPlot(position,name,"DataPlot1D")
33{
34 SetVolatileXmlProp("min",ymin);
35 SetVolatileXmlProp("max",ymax);
36 SendXml();
37}
38
39DataPlot1D::~DataPlot1D() {
40}
41
42void DataPlot1D::AddCurve(const core::IODataElement* element,uint8_t r,uint8_t g,uint8_t b,string curve_name)
43{
44 if(curve_name!="")
45 {
46 SetVolatileXmlProp("curve",curve_name);
47 }
48 else
49 {
50 SetVolatileXmlProp("curve",element->Parent()->ObjectName() + "\\" +element->ObjectName());
51 }
52 SetVolatileXmlProp("type",element->GetDataType().GetDescription());
53 SetVolatileXmlProp("r",r);
54 SetVolatileXmlProp("g",g);
55 SetVolatileXmlProp("b",b);
56
57 SendXml();
58
59 //save data information
60 AddDataToSend(element);
61}
62
63void DataPlot1D::AddCurve(const core::IODataElement* element,Color_t color,string curve_name) {
64 uint8_t r,g,b;
65 RGBFromColor(color,r,g,b);
66 AddCurve(element,r,g,b,curve_name);
67}
68
69} // end namespace gui
70} // end namespace flair
Note: See TracBrowser for help on using the repository browser.