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


Ignore:
Timestamp:
04/08/16 15:40:57 (8 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

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

    r2 r15  
    2424using std::string;
    2525
    26 namespace flair
    27 {
    28 namespace gui
    29 {
     26namespace flair {
     27namespace gui {
    3028
    3129using namespace core;
    3230
    33 void RGBFromColor(DataPlot::Color_t color,uint8_t &r,uint8_t &g,uint8_t &b)
    34 {
    35     switch(color)
    36     {
    37         case DataPlot::Red:
    38             r=255;
    39             g=0;
    40             b=0;
    41             break;
    42         case DataPlot::Blue:
    43             r=0;
    44             g=0;
    45             b=255;
    46             break;
    47         case DataPlot::Green:
    48             r=0;
    49             g=255;
    50             b=0;
    51             break;
    52         case DataPlot::Yellow:
    53             r=255;
    54             g=255;
    55             b=0;
    56             break;
    57         case DataPlot::Black:
    58             r=0;
    59             g=0;
    60             b=0;
    61             break;
    62         case DataPlot::White:
    63             r=255;
    64             g=255;
    65             b=255;
    66             break;
    67     }
     31void RGBFromColor(DataPlot::Color_t color, uint8_t &r, uint8_t &g, uint8_t &b) {
     32  switch (color) {
     33  case DataPlot::Red:
     34    r = 255;
     35    g = 0;
     36    b = 0;
     37    break;
     38  case DataPlot::Blue:
     39    r = 0;
     40    g = 0;
     41    b = 255;
     42    break;
     43  case DataPlot::Green:
     44    r = 0;
     45    g = 255;
     46    b = 0;
     47    break;
     48  case DataPlot::Yellow:
     49    r = 255;
     50    g = 255;
     51    b = 0;
     52    break;
     53  case DataPlot::Black:
     54    r = 0;
     55    g = 0;
     56    b = 0;
     57    break;
     58  case DataPlot::White:
     59    r = 255;
     60    g = 255;
     61    b = 255;
     62    break;
     63  }
    6864}
    6965
    70 DataPlot::DataPlot(const LayoutPosition* position,string name,string type):SendData(position,name,type)
    71 {
    72     pimpl_=new DataPlot_impl();
     66DataPlot::DataPlot(const LayoutPosition *position, string name, string type)
     67    : SendData(position, name, type) {
     68  pimpl_ = new DataPlot_impl();
    7369}
    7470
    75 DataPlot::~DataPlot()
    76 {
    77     delete pimpl_;
     71DataPlot::~DataPlot() { delete pimpl_; }
     72
     73void DataPlot::AddDataToSend(const IODataElement *element) {
     74  pimpl_->tosend.push_back(element);
     75
     76  SetSendSize(SendSize() + element->Size());
    7877}
    7978
    80 void DataPlot::AddDataToSend(const IODataElement *element)
    81 {
    82     pimpl_->tosend.push_back(element);
     79void DataPlot::CopyDatas(char *buf) const {
     80  int buf_size = 0;
    8381
    84     SetSendSize(SendSize()+element->Size());
    85 }
    86 
    87 void DataPlot::CopyDatas(char* buf) const {
    88     int buf_size=0;
    89 
    90     for(size_t i=0;i<pimpl_->tosend.size();i++) {
    91         pimpl_->tosend[i]->CopyData(buf+buf_size);
    92         buf_size+=pimpl_->tosend[i]->Size();
    93     }
     82  for (size_t i = 0; i < pimpl_->tosend.size(); i++) {
     83    pimpl_->tosend[i]->CopyData(buf + buf_size);
     84    buf_size += pimpl_->tosend[i]->Size();
     85  }
    9486}
    9587
Note: See TracChangeset for help on using the changeset viewer.