[2] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[2] | 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 |
|
---|
| 22 | using std::string;
|
---|
| 23 |
|
---|
[15] | 24 | namespace flair {
|
---|
| 25 | namespace gui {
|
---|
[2] | 26 |
|
---|
| 27 | using namespace core;
|
---|
| 28 |
|
---|
[15] | 29 | DataPlot1D::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();
|
---|
[2] | 35 | }
|
---|
| 36 |
|
---|
[15] | 37 | DataPlot1D::~DataPlot1D() {}
|
---|
[2] | 38 |
|
---|
[15] | 39 | void 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);
|
---|
[2] | 51 |
|
---|
[15] | 52 | SendXml();
|
---|
[2] | 53 |
|
---|
[15] | 54 | // save data information
|
---|
| 55 | AddDataToSend(element);
|
---|
[2] | 56 | }
|
---|
| 57 |
|
---|
[15] | 58 | void 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);
|
---|
[2] | 63 | }
|
---|
| 64 |
|
---|
| 65 | } // end namespace gui
|
---|
| 66 | } // end namespace flair
|
---|