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 |
|
---|
23 | using std::string;
|
---|
24 |
|
---|
25 | namespace flair
|
---|
26 | {
|
---|
27 | namespace gui
|
---|
28 | {
|
---|
29 |
|
---|
30 | using namespace core;
|
---|
31 |
|
---|
32 | DataPlot1D::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 |
|
---|
39 | DataPlot1D::~DataPlot1D() {
|
---|
40 | }
|
---|
41 |
|
---|
42 | void 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 |
|
---|
63 | void 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
|
---|