Changeset 15 in flair-src for trunk/lib/FlairFilter/src/PidThrust.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/FlairFilter/src/PidThrust.cpp

    r10 r15  
    2727using namespace flair::gui;
    2828
    29 namespace flair
    30 {
    31 namespace filter
    32 {
     29namespace flair {
     30namespace filter {
    3331
    34 PidThrust::PidThrust(const LayoutPosition* position,string name) : ControlLaw(position->getLayout(),name)
    35 {
    36     pimpl_=new PidThrust_impl(this,position,name);
     32PidThrust::PidThrust(const LayoutPosition *position, string name)
     33    : ControlLaw(position->getLayout(), name) {
     34  pimpl_ = new PidThrust_impl(this, position, name);
    3735}
    3836
    39 PidThrust::~PidThrust(void)
    40 {
    41     delete pimpl_;
    42 }
     37PidThrust::~PidThrust(void) { delete pimpl_; }
    4338
    44 void PidThrust::UseDefaultPlot(const flair::gui::LayoutPosition* position)
    45 {
    46     pimpl_->UseDefaultPlot(position);
     39void PidThrust::UseDefaultPlot(const flair::gui::LayoutPosition *position) {
     40  pimpl_->UseDefaultPlot(position);
    4741}
    4842
    4943void PidThrust::Reset(void) {
    50     pimpl_->i=0;
    51     pimpl_->offset_g=0;
     44  pimpl_->i = 0;
     45  pimpl_->offset_g = 0;
    5246}
    5347
    54 void PidThrust::ResetI(void)
    55 {
    56     pimpl_->i=0;
     48void PidThrust::ResetI(void) { pimpl_->i = 0; }
     49
     50float PidThrust::GetOffset(void) { return pimpl_->offset_g; }
     51
     52void PidThrust::UpdateFrom(const io_data *data) {
     53  pimpl_->UpdateFrom(data);
     54  ProcessUpdate(output);
    5755}
    5856
    59 float PidThrust::GetOffset(void) {
    60     return pimpl_->offset_g;
     57void PidThrust::SetValues(float p, float d) {
     58  input->SetValue(0, 0, p);
     59  input->SetValue(1, 0, d);
    6160}
    6261
    63 void PidThrust::UpdateFrom(const io_data *data)
    64 {
    65     pimpl_->UpdateFrom(data);
    66     ProcessUpdate(output);
     62void PidThrust::ResetOffset(void) { pimpl_->offset_g = 0; }
     63
     64void PidThrust::SetOffset(void) { pimpl_->offset_g = pimpl_->offset->Value(); }
     65
     66bool PidThrust::OffsetStepUp(void) {
     67  pimpl_->offset_g += pimpl_->pas_offset->Value();
     68  if (pimpl_->offset_g > 1) {
     69    pimpl_->offset_g = 1;
     70    return false;
     71  } else {
     72    return true;
     73  }
    6774}
    6875
    69 void PidThrust::SetValues(float p,float d)
    70 {
    71     input->SetValue(0,0,p);
    72     input->SetValue(1,0,d);
    73 }
    74 
    75 void PidThrust::ResetOffset(void)
    76 {
    77     pimpl_->offset_g=0;
    78 }
    79 
    80 void PidThrust::SetOffset(void)
    81 {
    82     pimpl_->offset_g=pimpl_->offset->Value();
    83 }
    84 
    85 bool PidThrust::OffsetStepUp(void)
    86 {
    87     pimpl_->offset_g+=pimpl_->pas_offset->Value();
    88     if(pimpl_->offset_g>1)
    89     {
    90         pimpl_->offset_g=1;
    91         return false;
    92     }
    93     else
    94     {
    95         return true;
    96     }
    97 }
    98 
    99 bool PidThrust::OffsetStepDown(void)
    100 {
    101     pimpl_->offset_g-=pimpl_->pas_offset->Value();
    102     if(pimpl_->offset_g<pimpl_->offset->Value())
    103     {
    104         pimpl_->offset_g=pimpl_->offset->Value();
    105         return false;
    106     }
    107     else
    108     {
    109         return true;
    110     }
     76bool PidThrust::OffsetStepDown(void) {
     77  pimpl_->offset_g -= pimpl_->pas_offset->Value();
     78  if (pimpl_->offset_g < pimpl_->offset->Value()) {
     79    pimpl_->offset_g = pimpl_->offset->Value();
     80    return false;
     81  } else {
     82    return true;
     83  }
    11184}
    11285
Note: See TracChangeset for help on using the changeset viewer.