Changeset 15 in flair-src for trunk/lib/FlairCore/src/DataPlot1D.cpp


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (5 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/DataPlot1D.cpp

    r2 r15  
    2323using std::string;
    2424
    25 namespace flair
    26 {
    27 namespace gui
    28 {
     25namespace flair {
     26namespace gui {
    2927
    3028using namespace core;
    3129
    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();
     30DataPlot1D::DataPlot1D(const LayoutPosition *position, string name, float ymin,
     31                       float ymax)
     32    : DataPlot(position, name, "DataPlot1D") {
     33  SetVolatileXmlProp("min", ymin);
     34  SetVolatileXmlProp("max", ymax);
     35  SendXml();
    3736}
    3837
    39 DataPlot1D::~DataPlot1D() {
     38DataPlot1D::~DataPlot1D() {}
     39
     40void DataPlot1D::AddCurve(const core::IODataElement *element, uint8_t r,
     41                          uint8_t g, uint8_t b, string curve_name) {
     42  if (curve_name != "") {
     43    SetVolatileXmlProp("curve", curve_name);
     44  } else {
     45    SetVolatileXmlProp("curve", element->Parent()->ObjectName() + "\\" +
     46                                    element->ObjectName());
     47  }
     48  SetVolatileXmlProp("type", element->GetDataType().GetDescription());
     49  SetVolatileXmlProp("r", r);
     50  SetVolatileXmlProp("g", g);
     51  SetVolatileXmlProp("b", b);
     52
     53  SendXml();
     54
     55  // save data information
     56  AddDataToSend(element);
    4057}
    4158
    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);
     59void DataPlot1D::AddCurve(const core::IODataElement *element, Color_t color,
     60                          string curve_name) {
     61  uint8_t r, g, b;
     62  RGBFromColor(color, r, g, b);
     63  AddCurve(element, r, g, b, curve_name);
    6764}
    6865
Note: See TracChangeset for help on using the changeset viewer.