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/FlairSensorActuator/src/UsRangeFinder.cpp

    r3 r15  
    2929using namespace flair::gui;
    3030
    31 namespace flair
    32 {
    33 namespace sensor
    34 {
     31namespace flair {
     32namespace sensor {
    3533
    36 UsRangeFinder::UsRangeFinder(const FrameworkManager* parent,string name) : IODevice(parent,name)
    37 {
    38     plot_tab=NULL;
     34UsRangeFinder::UsRangeFinder(const FrameworkManager *parent, string name)
     35    : IODevice(parent, name) {
     36  plot_tab = NULL;
    3937
    40     cvmatrix_descriptor* desc=new cvmatrix_descriptor(1,1);
    41     desc->SetElementName(0,0,name);
    42     output=new cvmatrix(this,desc,floatType);
    43     AddDataToLog(output);
     38  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
     39  desc->SetElementName(0, 0, name);
     40  output = new cvmatrix(this, desc, floatType);
     41  AddDataToLog(output);
    4442
    45     //station sol
    46     main_tab=new Tab(parent->GetTabWidget(),name);
    47     tab=new TabWidget(main_tab->NewRow(),name);
    48         sensor_tab=new Tab(tab,"Reglages");
    49         setup_groupbox=new GroupBox(sensor_tab->NewRow(),name);
     43  // station sol
     44  main_tab = new Tab(parent->GetTabWidget(), name);
     45  tab = new TabWidget(main_tab->NewRow(), name);
     46  sensor_tab = new Tab(tab, "Reglages");
     47  setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
    5048}
    5149
    52 UsRangeFinder::UsRangeFinder(const IODevice* parent,std::string name) : IODevice(parent,name)
    53 {
    54     plot_tab=NULL;
    55     main_tab=NULL;
    56     tab=NULL;
    57         sensor_tab=NULL;
    58         setup_groupbox=NULL;
     50UsRangeFinder::UsRangeFinder(const IODevice *parent, std::string name)
     51    : IODevice(parent, name) {
     52  plot_tab = NULL;
     53  main_tab = NULL;
     54  tab = NULL;
     55  sensor_tab = NULL;
     56  setup_groupbox = NULL;
    5957
    60     output=NULL;
     58  output = NULL;
    6159}
    6260
    63 UsRangeFinder::~UsRangeFinder()
    64 {
    65     if(main_tab!=NULL) delete main_tab;
     61UsRangeFinder::~UsRangeFinder() {
     62  if (main_tab != NULL)
     63    delete main_tab;
    6664}
    6765
    68 GroupBox* UsRangeFinder::GetGroupBox(void) const
    69 {
    70     return setup_groupbox;
     66GroupBox *UsRangeFinder::GetGroupBox(void) const { return setup_groupbox; }
     67
     68Layout *UsRangeFinder::GetLayout(void) const { return sensor_tab; }
     69
     70DataPlot1D *UsRangeFinder::GetPlot(void) const { return plot; }
     71
     72Tab *UsRangeFinder::GetPlotTab(void) const { return plot_tab; }
     73
     74void UsRangeFinder::UseDefaultPlot(void) {
     75  if (tab == NULL) {
     76    Err("not applicable for simulation part.\n");
     77    return;
     78  }
     79
     80  plot_tab = new Tab(tab, "Mesures");
     81  plot = new DataPlot1D(plot_tab->NewRow(), ObjectName(), 0, 2);
     82  plot->AddCurve(output->Element(0));
    7183}
    7284
    73 Layout* UsRangeFinder::GetLayout(void) const
    74 {
    75     return sensor_tab;
     85void UsRangeFinder::LockUserInterface(void) const {
     86  setup_groupbox->setEnabled(false);
    7687}
    7788
    78 DataPlot1D* UsRangeFinder::GetPlot(void) const
    79 {
    80     return plot;
     89void UsRangeFinder::UnlockUserInterface(void) const {
     90  setup_groupbox->setEnabled(true);
    8191}
    8292
    83 Tab* UsRangeFinder::GetPlotTab(void) const
    84 {
    85     return plot_tab;
    86 }
    87 
    88 void UsRangeFinder::UseDefaultPlot(void)
    89 {
    90     if(tab==NULL)
    91     {
    92         Err("not applicable for simulation part.\n");
    93         return;
    94     }
    95 
    96     plot_tab=new Tab(tab,"Mesures");
    97         plot=new DataPlot1D(plot_tab->NewRow(),ObjectName(),0,2);
    98             plot->AddCurve(output->Element(0));
    99 }
    100 
    101 void UsRangeFinder::LockUserInterface(void) const
    102 {
    103     setup_groupbox->setEnabled(false);
    104 }
    105 
    106 void UsRangeFinder::UnlockUserInterface(void) const
    107 {
    108     setup_groupbox->setEnabled(true);
    109 }
    110 
    111 float UsRangeFinder::Value(void) const
    112 {
    113     return output->Value(0,0);
    114 }
     93float UsRangeFinder::Value(void) const { return output->Value(0, 0); }
    11594
    11695} // end namespace sensor
Note: See TracChangeset for help on using the changeset viewer.