Index: trunk/demos/Sinus/src/Loop.cpp
===================================================================
--- trunk/demos/Sinus/src/Loop.cpp	(revision 14)
+++ trunk/demos/Sinus/src/Loop.cpp	(revision 16)
@@ -11,7 +11,7 @@
 /*********************************************************************/
 
-//include header of the class
+// include header of the class
 #include "Loop.h"
-//include only header of class declared in Loop.h (forward declaration)
+// include only header of class declared in Loop.h (forward declaration)
 #include "Sinus.h"
 #include "MeanFilter.h"
@@ -26,5 +26,4 @@
 #include <cvmatrix.h>
 
-
 using namespace std;
 using namespace flair::core;
@@ -33,63 +32,81 @@
 using namespace flair::sensor;
 
-Loop::Loop(FrameworkManager* parent,string name,int priority): Thread(parent,name,priority) {
-    Tab *mainTab=new Tab(parent->GetTabWidget(),ObjectName());
-    killButton=new PushButton(mainTab->NewRow(),"kill");
-    startLogButton=new PushButton(mainTab->NewRow(),"start_log");
-    stopLogButton=new PushButton(mainTab->LastRowLastCol(),"stop_log");
-    period=new SpinBox(mainTab->NewRow(),"period thread:"," ms",10,1000,1);
+Loop::Loop(FrameworkManager *parent, string name, int priority)
+    : Thread(parent, name, priority) {
+  Tab *mainTab = new Tab(parent->GetTabWidget(), ObjectName());
+  killButton = new PushButton(mainTab->NewRow(), "kill");
+  startLogButton = new PushButton(mainTab->NewRow(), "start_log");
+  stopLogButton = new PushButton(mainTab->LastRowLastCol(), "stop_log");
+  period = new SpinBox(mainTab->NewRow(), "period thread:", " ms", 10, 1000, 1);
 
-    sinus=new Sinus(parent,"sinus");
-    sinus->UseDefaultPlot();
+  sinus = new Sinus(parent, "sinus");
+  sinus->UseDefaultPlot();
 
-    //1st order law pass filter on raw signal, its parent is the sinus
-    firstLowPass=new LowPassFilter(sinus,sinus->GetSetupLayout()->NewRow(),"1st order lawpass filter");
-    sinus->GetPlot()->AddCurve(firstLowPass->Matrix()->Element(0),DataPlot::Blue);//add output of the filter to signal's graph
+  // 1st order law pass filter on raw signal, its parent is the sinus
+  firstLowPass = new LowPassFilter(sinus, sinus->GetSetupLayout()->NewRow(),
+                                   "1st order lawpass filter");
+  sinus->GetPlot()->AddCurve(
+      firstLowPass->Matrix()->Element(0),
+      DataPlot::Blue); // add output of the filter to signal's graph
 
-    //3rd order law pass filter on raw signal, its parent is the sinus
-    thirdLowPass=new ButterworthLowPass(sinus,sinus->GetSetupLayout()->NewRow(),"3rd order lawpass filter",3);
-    sinus->GetPlot()->AddCurve(thirdLowPass->Matrix()->Element(0),DataPlot::Yellow);//add output of the filter to signal's graph
+  // 3rd order law pass filter on raw signal, its parent is the sinus
+  thirdLowPass = new ButterworthLowPass(
+      sinus, sinus->GetSetupLayout()->NewRow(), "3rd order lawpass filter", 3);
+  sinus->GetPlot()->AddCurve(
+      thirdLowPass->Matrix()->Element(0),
+      DataPlot::Yellow); // add output of the filter to signal's graph
 
-    //mean filter on raw signal, its parent is the sinus
-    mean=new MeanFilter(sinus,sinus->GetSetupLayout()->NewRow(),"Mean filter");
-    sinus->GetPlot()->AddCurve(mean->GetMatrix()->Element(0),DataPlot::Green);//add output of the filter to signal's graph
+  // mean filter on raw signal, its parent is the sinus
+  mean =
+      new MeanFilter(sinus, sinus->GetSetupLayout()->NewRow(), "Mean filter");
+  sinus->GetPlot()->AddCurve(
+      mean->GetMatrix()->Element(0),
+      DataPlot::Green); // add output of the filter to signal's graph
 
-    //mean filter on 1st order law pass filter, its parent is the 1st order law pass filter
-    meanOnfirstLowPass=new MeanFilter(firstLowPass,sinus->GetSetupLayout()->NewRow(),"Mean filter on 1st order lawpass filter");
-    sinus->GetPlot()->AddCurve(meanOnfirstLowPass->GetMatrix()->Element(0),DataPlot::Black);//add output of the filter to signal's graph
+  // mean filter on 1st order law pass filter, its parent is the 1st order law
+  // pass filter
+  meanOnfirstLowPass =
+      new MeanFilter(firstLowPass, sinus->GetSetupLayout()->NewRow(),
+                     "Mean filter on 1st order lawpass filter");
+  sinus->GetPlot()->AddCurve(
+      meanOnfirstLowPass->GetMatrix()->Element(0),
+      DataPlot::Black); // add output of the filter to signal's graph
 
-    //set ojects to be logged
-    //as the law pass filters and the mean filters have the sinus as parent, they are automatically logged
-    parent->AddDeviceToLog(sinus);
+  // set ojects to be logged
+  // as the law pass filters and the mean filters have the sinus as parent, they
+  // are automatically logged
+  parent->AddDeviceToLog(sinus);
 }
 
-Loop::~Loop() {
+Loop::~Loop() {}
 
+// main loop of the Thread
+void Loop::Run(void) {
+  // warn if changing from primary to secondary mode when in real time
+  WarnUponSwitches(true);
+
+  sinus->Start();
+
+  SetPeriodMS(period->Value());
+
+  while (1) {
+    WaitPeriod();
+
+    if (period->ValueChanged())
+      SetPeriodMS(period->Value());
+
+    if (killButton->Clicked())
+      break;
+    if (startLogButton->Clicked())
+      getFrameworkManager()->StartLog();
+    if (stopLogButton->Clicked())
+      getFrameworkManager()->StopLog();
+
+    // nothing more to do
+    // this is a very simple example
+
+    // normaly, we should use results of filters to calculate a control law
+  }
+
+  WarnUponSwitches(false);
 }
-
-//main loop of the Thread
-void Loop::Run(void) {
-    //warn if changing from primary to secondary mode when in real time
-    WarnUponSwitches(true);
-
-    sinus->Start();
-
-    SetPeriodMS(period->Value());
-
-    while(1) {
-        WaitPeriod();
-
-        if(period->ValueChanged()) SetPeriodMS(period->Value());
-
-        if(killButton->Clicked()) break;
-        if(startLogButton->Clicked()) getFrameworkManager()->StartLog();
-        if(stopLogButton->Clicked()) getFrameworkManager()->StopLog();
-
-        //nothing more to do
-        //this is a very simple example
-
-        //normaly, we should use results of filters to calculate a control law
-    }
-
-    WarnUponSwitches(false);
-}
Index: trunk/demos/Sinus/src/Loop.h
===================================================================
--- trunk/demos/Sinus/src/Loop.h	(revision 14)
+++ trunk/demos/Sinus/src/Loop.h	(revision 16)
@@ -14,55 +14,54 @@
 #define LOOP_H
 
-//necessary include, as Thread is a base of our class
+// necessary include, as Thread is a base of our class
 #include <Thread.h>
 
-//forward declaration for other classes
+// forward declaration for other classes
 namespace flair {
-    namespace core {
-       class FrameworkManager;
-    }
-    namespace gui {
-        class PushButton;
-        class SpinBox;
-    }
-    namespace sensor {
-        class Sinus;
-    }
-    namespace filter {
-        class LowPassFilter;
-        class ButterworthLowPass;
-        class MeanFilter;
-    }
+namespace core {
+class FrameworkManager;
+}
+namespace gui {
+class PushButton;
+class SpinBox;
+}
+namespace sensor {
+class Sinus;
+}
+namespace filter {
+class LowPassFilter;
+class ButterworthLowPass;
+class MeanFilter;
+}
 }
 
+class Loop : public flair::core::Thread {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Builds main loop
+  *
+  * \param parent the FrameworkManager to use
+  * \param name object name
+  * \param priority Thread priority, 51 by default (1:mini, 99:maxi)
+  */
+  Loop(flair::core::FrameworkManager *parent, std::string name,
+       int priority = 51);
 
-class Loop : public flair::core::Thread
-{
-    public:
-        /*!
-        * \brief Constructor
-        *
-        * Builds main loop
-        *
-        * \param parent the FrameworkManager to use
-        * \param name object name
-        * \param priority Thread priority, 51 by default (1:mini, 99:maxi)
-        */
-        Loop(flair::core::FrameworkManager* parent,std::string name,int priority=51);
+  /*!
+  * \brief Destructor
+  */
+  ~Loop();
 
-        /*!
-        * \brief Destructor
-        */
-        ~Loop();
+private:
+  void Run(void);
 
-    private:
-        void Run(void);
-
-        flair::sensor::Sinus *sinus;
-        flair::filter::LowPassFilter *firstLowPass;
-        flair::filter::ButterworthLowPass *thirdLowPass;
-        flair::filter::MeanFilter *mean,*meanOnfirstLowPass;
-        flair::gui::PushButton *startLogButton,*stopLogButton,*killButton;
-        flair::gui::SpinBox *period;
+  flair::sensor::Sinus *sinus;
+  flair::filter::LowPassFilter *firstLowPass;
+  flair::filter::ButterworthLowPass *thirdLowPass;
+  flair::filter::MeanFilter *mean, *meanOnfirstLowPass;
+  flair::gui::PushButton *startLogButton, *stopLogButton, *killButton;
+  flair::gui::SpinBox *period;
 };
 
Index: trunk/demos/Sinus/src/MeanFilter.cpp
===================================================================
--- trunk/demos/Sinus/src/MeanFilter.cpp	(revision 14)
+++ trunk/demos/Sinus/src/MeanFilter.cpp	(revision 16)
@@ -22,60 +22,65 @@
 using namespace flair::gui;
 
-namespace flair { namespace filter {
+namespace flair {
+namespace filter {
 
-MeanFilter::MeanFilter(const IODevice* parent,const LayoutPosition* position,string name): IODevice(parent,name) {
-    //interface initialisation
-    groupBox=new GroupBox(position,name);
-    numberOfElements=new SpinBox(groupBox->NewRow(),"numberOfElements:",1,MAX_NUMBER_OF_ELEMENTS,1);//saturated to MAX_NUMBER_OF_ELEMENTS
+MeanFilter::MeanFilter(const IODevice *parent, const LayoutPosition *position,
+                       string name)
+    : IODevice(parent, name) {
+  // interface initialisation
+  groupBox = new GroupBox(position, name);
+  numberOfElements = new SpinBox(groupBox->NewRow(), "numberOfElements:", 1,
+                                 MAX_NUMBER_OF_ELEMENTS,
+                                 1); // saturated to MAX_NUMBER_OF_ELEMENTS
 
-    //init storage
-    for(int i=0; i<MAX_NUMBER_OF_ELEMENTS; i++) previousValues[i]=0;
+  // init storage
+  for (int i = 0; i < MAX_NUMBER_OF_ELEMENTS; i++)
+    previousValues[i] = 0;
 
-    //1*1 output matrix
-    cvmatrix_descriptor* desc=new cvmatrix_descriptor(1,1);
-    desc->SetElementName(0,0,"mean filter");//name will be used for graphs and logs
-    output=new cvmatrix(this,desc,floatType,name);
+  // 1*1 output matrix
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
+  desc->SetElementName(0, 0,
+                       "mean filter"); // name will be used for graphs and logs
+  output = new cvmatrix(this, desc, floatType, name);
 
-    AddDataToLog(output);
+  AddDataToLog(output);
 }
 
-MeanFilter::~MeanFilter() {
-}
+MeanFilter::~MeanFilter() {}
 
-cvmatrix *MeanFilter::GetMatrix() const {
-    return output;
-}
+cvmatrix *MeanFilter::GetMatrix() const { return output; }
 
-float MeanFilter::GetValue(void) const {
-    return output->Value(0,0);
-}
+float MeanFilter::GetValue(void) const { return output->Value(0, 0); }
 
-//UpdateFrom, where we implement the filter
-//this method is automatically called when the parent IODevice calls ProcessUpdate
-//in our case it is the sinus or the 1st orde law pass filter
+// UpdateFrom, where we implement the filter
+// this method is automatically called when the parent IODevice calls
+// ProcessUpdate
+// in our case it is the sinus or the 1st orde law pass filter
 //(see in Sinus::Run the call to ProcessUpdate)
 void MeanFilter::UpdateFrom(const io_data *data) {
 
-    float result=0;
-    //get input argument in a cvmatrix
-    cvmatrix *input=(cvmatrix*)data;
+  float result = 0;
+  // get input argument in a cvmatrix
+  cvmatrix *input = (cvmatrix *)data;
 
-    //simple (and not efficent!) implementation of the filter
-    previousValues[numberOfElements->Value()-1]=input->Value(0,0);
-    for(int i=0; i<numberOfElements->Value(); i++) result+=previousValues[i];
-    for(int i=1; i<numberOfElements->Value(); i++) previousValues[i-1]=previousValues[i];
+  // simple (and not efficent!) implementation of the filter
+  previousValues[numberOfElements->Value() - 1] = input->Value(0, 0);
+  for (int i = 0; i < numberOfElements->Value(); i++)
+    result += previousValues[i];
+  for (int i = 1; i < numberOfElements->Value(); i++)
+    previousValues[i - 1] = previousValues[i];
 
-    //put the result in output matrix
-    output->SetValue(0,0,result/numberOfElements->Value());
-    //put corresponding time
-    output->SetDataTime(data->DataTime());
+  // put the result in output matrix
+  output->SetValue(0, 0, result / numberOfElements->Value());
+  // put corresponding time
+  output->SetDataTime(data->DataTime());
 
-    //ProcessUpdate is very important
-    //we must call it after updating the output matrix
-    //it allows:
-    // -to save value in the logs
-    // -to automatically call the next filter UpdateFrom method
-    ProcessUpdate(output);
+  // ProcessUpdate is very important
+  // we must call it after updating the output matrix
+  // it allows:
+  // -to save value in the logs
+  // -to automatically call the next filter UpdateFrom method
+  ProcessUpdate(output);
 }
-}// end namespace filter
-}// end namespace flair
+} // end namespace filter
+} // end namespace flair
Index: trunk/demos/Sinus/src/MeanFilter.h
===================================================================
--- trunk/demos/Sinus/src/MeanFilter.h	(revision 14)
+++ trunk/demos/Sinus/src/MeanFilter.h	(revision 16)
@@ -15,76 +15,79 @@
 #define MEANFILTER_H
 
-//we fix the max number of elements to compute the mean
-//this is a simple example, it should be dynamical
+// we fix the max number of elements to compute the mean
+// this is a simple example, it should be dynamical
 #define MAX_NUMBER_OF_ELEMENTS 200
 
-//necessary include, as IODevice is a base of our class
+// necessary include, as IODevice is a base of our class
 #include <IODevice.h>
 
-//forward declaration for other classes
+// forward declaration for other classes
 namespace flair {
-    namespace core {
-        class cvmatrix;
-    }
-    namespace gui {
-        class LayoutPosition;
-        class GroupBox;
-        class SpinBox;
-    }
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class LayoutPosition;
+class GroupBox;
+class SpinBox;
+}
 }
 
-//MeanFilter is a class computing a mean
+// MeanFilter is a class computing a mean
 // based on a parametrizable number of elements
 // it derives on IODevice as it as an input and an output
 // it is a filter, we extend the namespace
-namespace flair { namespace filter {
-    class MeanFilter : public core::IODevice {
+namespace flair {
+namespace filter {
+class MeanFilter : public core::IODevice {
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Builds a mean filter. \n
-            * After calling this function, position will be deleted as it is no longer usefull. \n
-            *
-            * \param parent IODevice to use as parent
-            * \param position where to place settings
-            * \param name name of the object
-            */
-            MeanFilter(const core::IODevice* parent,const gui::LayoutPosition* position,std::string name);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Builds a mean filter. \n
+  * After calling this function, position will be deleted as it is no longer
+  *usefull. \n
+  *
+  * \param parent IODevice to use as parent
+  * \param position where to place settings
+  * \param name name of the object
+  */
+  MeanFilter(const core::IODevice *parent, const gui::LayoutPosition *position,
+             std::string name);
 
-            /*!
-            * \brief Destructor
-            */
-            ~MeanFilter();
+  /*!
+  * \brief Destructor
+  */
+  ~MeanFilter();
 
-            /*!
-            * \brief Output matrix
-            *
-            * allows to access output matrix, to get signal value or to put it in a graph.  \n
-            *
-            * \return pointer to the output matrix
-            */
-            core::cvmatrix *GetMatrix(void) const;
+  /*!
+  * \brief Output matrix
+  *
+  * allows to access output matrix, to get signal value or to put it in a graph.
+  *\n
+  *
+  * \return pointer to the output matrix
+  */
+  core::cvmatrix *GetMatrix(void) const;
 
-            /*!
-            * \brief Value
-            *
-            * this method is equivalent to GetMatrix()->Value(0,0)
-            *
-            * \return actual mean value
-            */
-            float GetValue(void) const;
+  /*!
+  * \brief Value
+  *
+  * this method is equivalent to GetMatrix()->Value(0,0)
+  *
+  * \return actual mean value
+  */
+  float GetValue(void) const;
 
-        private:
-            //UpdateFrom method from base class IODevice
-            void UpdateFrom(const core::io_data *data);
-            gui::GroupBox *groupBox;
-            gui::SpinBox *numberOfElements;
-            core::cvmatrix *output;
-            float previousValues[MAX_NUMBER_OF_ELEMENTS];//previous values storage
-
-    };
-}// end namespace filter
-}// end namespace flair
+private:
+  // UpdateFrom method from base class IODevice
+  void UpdateFrom(const core::io_data *data);
+  gui::GroupBox *groupBox;
+  gui::SpinBox *numberOfElements;
+  core::cvmatrix *output;
+  float previousValues[MAX_NUMBER_OF_ELEMENTS]; // previous values storage
+};
+} // end namespace filter
+} // end namespace flair
 #endif // MEANFILTER_H
Index: trunk/demos/Sinus/src/Sinus.cpp
===================================================================
--- trunk/demos/Sinus/src/Sinus.cpp	(revision 14)
+++ trunk/demos/Sinus/src/Sinus.cpp	(revision 16)
@@ -30,99 +30,107 @@
 using namespace flair::gui;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-Sinus::Sinus(const FrameworkManager* parent,string name,int priority) : IODevice(parent,name),Thread(parent,name,priority) {
+Sinus::Sinus(const FrameworkManager *parent, string name, int priority)
+    : IODevice(parent, name), Thread(parent, name, priority) {
 
-    plot=NULL;
+  plot = NULL;
 
-    //1*1 output matrix
-    cvmatrix_descriptor* desc=new cvmatrix_descriptor(1,1);
-    desc->SetElementName(0,0,"value");//name will be used for graphs and logs
-    output=new cvmatrix((IODevice*)this,desc,floatType,name);
-    output->SetValue(0,0,0);
+  // 1*1 output matrix
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
+  desc->SetElementName(0, 0, "value"); // name will be used for graphs and logs
+  output = new cvmatrix((IODevice *)this, desc, floatType, name);
+  output->SetValue(0, 0, 0);
 
+  AddDataToLog(output);
 
-    AddDataToLog(output);
+  // interface initialisation
+  mainTab = new Tab(parent->GetTabWidget(), name);
+  tabWidget = new TabWidget(mainTab->NewRow(), name);
 
-    //interface initialisation
-    mainTab=new Tab(parent->GetTabWidget(),name);
-    tabWidget=new TabWidget(mainTab->NewRow(),name);
+  Tab *settingsTab = new Tab(tabWidget, "Settings");
+  GroupBox *sinusGroupBox = new GroupBox(settingsTab->NewRow(), name);
+  frequency = new DoubleSpinBox(sinusGroupBox->NewRow(), "frequence:", " Hz", 0,
+                                100, 1);
+  amplitude = new DoubleSpinBox(sinusGroupBox->LastRowLastCol(), "amplitude:",
+                                0, 10, 1);
+  offset =
+      new DoubleSpinBox(sinusGroupBox->LastRowLastCol(), "offset:", 0, 10, 1);
+  period =
+      new SpinBox(settingsTab->NewRow(), "period thread:", " ms", 1, 1000, 1);
 
-    Tab* settingsTab=new Tab(tabWidget,"Settings");
-    GroupBox* sinusGroupBox=new GroupBox(settingsTab->NewRow(),name);
-    frequency=new DoubleSpinBox(sinusGroupBox->NewRow(),"frequence:"," Hz",0,100,1);
-    amplitude=new DoubleSpinBox(sinusGroupBox->LastRowLastCol(),"amplitude:",0,10,1);
-    offset=new DoubleSpinBox(sinusGroupBox->LastRowLastCol(),"offset:",0,10,1);
-    period=new SpinBox(settingsTab->NewRow(),"period thread:"," ms",1,1000,1);
-
-    setupLayout=new GridLayout(settingsTab->NewRow(),"setup");//layout sui servira à placer des filtres par exemple
+  setupLayout = new GridLayout(
+      settingsTab->NewRow(),
+      "setup"); // layout sui servira à placer des filtres par exemple
 }
-
 
 Sinus::~Sinus() {
 
-    SafeStop();
-    Join();
+  SafeStop();
+  Join();
 
-    //main_tab has the FrameworkManager as parent; it will be destroyed when FrameworkManager is destroyed
-    //it is cleaner to delete it manually, because main_tab is unnecessary when Sinus is deleted
-    delete mainTab;
+  // main_tab has the FrameworkManager as parent; it will be destroyed when
+  // FrameworkManager is destroyed
+  // it is cleaner to delete it manually, because main_tab is unnecessary when
+  // Sinus is deleted
+  delete mainTab;
 }
 
 void Sinus::UseDefaultPlot(void) {
-    Tab* plotTab=new Tab(tabWidget,"Graph");
-    plot=new DataPlot1D(plotTab->NewRow(),"Sinus",-10,10);
-    plot->AddCurve(output->Element(0),DataPlot::Red);
+  Tab *plotTab = new Tab(tabWidget, "Graph");
+  plot = new DataPlot1D(plotTab->NewRow(), "Sinus", -10, 10);
+  plot->AddCurve(output->Element(0), DataPlot::Red);
 }
 
-GridLayout* Sinus::GetSetupLayout(void) const {
-    return setupLayout;
+GridLayout *Sinus::GetSetupLayout(void) const { return setupLayout; }
+
+DataPlot1D *Sinus::GetPlot(void) const {
+  if (plot == NULL)
+    Printf("Sinus::Plot, plot not yet defined, call UseDefaultPlot first\n");
+  return plot;
 }
 
-DataPlot1D* Sinus::GetPlot(void) const {
-    if(plot==NULL) Printf("Sinus::Plot, plot not yet defined, call UseDefaultPlot first\n");
-    return plot;
-}
+cvmatrix *Sinus::GetMatrix(void) const { return output; }
 
-cvmatrix *Sinus::GetMatrix(void) const {
-    return output;
-}
+float Sinus::GetValue(void) const { return output->Value(0, 0); }
 
-float Sinus::GetValue(void) const {
-    return output->Value(0,0);
-}
-
-//main function, where  we compute the signal
+// main function, where  we compute the signal
 void Sinus::Run(void) {
 
-    SetPeriodMS(period->Value());
+  SetPeriodMS(period->Value());
 
-    //warn if changing from primary to secondary mode when in real time
-    WarnUponSwitches(true);
+  // warn if changing from primary to secondary mode when in real time
+  WarnUponSwitches(true);
 
-    Time initTime=GetTime();
+  Time initTime = GetTime();
 
-    while(!ToBeStopped()) {
-        WaitPeriod();
+  while (!ToBeStopped()) {
+    WaitPeriod();
 
-        if(period->ValueChanged()==true) SetPeriodMS(period->Value());
+    if (period->ValueChanged() == true)
+      SetPeriodMS(period->Value());
 
-        //compute sinus
-        Time actualTime=GetTime();
-        float value=offset->Value()+amplitude->Value()*sinf(2*PI*frequency->Value()*(actualTime-initTime)/1000000000.);//les temps sont en nanosecondes
+    // compute sinus
+    Time actualTime = GetTime();
+    float value =
+        offset->Value() +
+        amplitude->Value() *
+            sinf(2 * PI * frequency->Value() * (actualTime - initTime) /
+                 1000000000.); // les temps sont en nanosecondes
 
-        //put the result in output matrix
-        output->SetValue(0,0,value);
-        //put corresponding time
-        output->SetDataTime(actualTime);
+    // put the result in output matrix
+    output->SetValue(0, 0, value);
+    // put corresponding time
+    output->SetDataTime(actualTime);
 
-        //ProcessUpdate is very important
-        //we must call it after updating the output matrix
-        //it allows:
-        // -to save value in the logs
-        // -to automatically call the next filter UpdateFrom method
-        ProcessUpdate(output);
-    }
+    // ProcessUpdate is very important
+    // we must call it after updating the output matrix
+    // it allows:
+    // -to save value in the logs
+    // -to automatically call the next filter UpdateFrom method
+    ProcessUpdate(output);
+  }
 }
-}// end namespace sensor
-}// end namespace flair
+} // end namespace sensor
+} // end namespace flair
Index: trunk/demos/Sinus/src/Sinus.h
===================================================================
--- trunk/demos/Sinus/src/Sinus.h	(revision 14)
+++ trunk/demos/Sinus/src/Sinus.h	(revision 16)
@@ -15,107 +15,111 @@
 #define SINUS_H
 
-//necessary includes, as IODevice and Thread are bases of our class
+// necessary includes, as IODevice and Thread are bases of our class
 #include <IODevice.h>
 #include <Thread.h>
 
-//forward declaration for other classes
+// forward declaration for other classes
 namespace flair {
-    namespace core {
-        class FrameworkManager;
-        class cvmatrix;
-    }
-    namespace gui {
-        class Tab;
-        class TabWidget;
-        class GridLayout;
-        class DoubleSpinBox;
-        class SpinBox;
-        class DataPlot1D;
-    }
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class GridLayout;
+class DoubleSpinBox;
+class SpinBox;
+class DataPlot1D;
+}
 }
 
-//sinus is a class generating a sinus signal
-//in this example, it emulates a sensonr, so we extend the namespace sensor
-//it derives frome
+// sinus is a class generating a sinus signal
+// in this example, it emulates a sensonr, so we extend the namespace sensor
+// it derives frome
 // IODevice: as it has an ouput
 // Thread: is it a thread
-namespace flair { namespace sensor {
-    class Sinus : public core::IODevice, public core::Thread {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Builds a sinus generator
-            *
-            * \param parent the FrameworkManager to use
-            * \param name object name
-            * \param priority Thread priority, 50 by default (1:mini, 99:maxi)
-            */
-            Sinus(const core::FrameworkManager* parent,std::string name,int priority=50);
+namespace flair {
+namespace sensor {
+class Sinus : public core::IODevice, public core::Thread {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Builds a sinus generator
+  *
+  * \param parent the FrameworkManager to use
+  * \param name object name
+  * \param priority Thread priority, 50 by default (1:mini, 99:maxi)
+  */
+  Sinus(const core::FrameworkManager *parent, std::string name,
+        int priority = 50);
 
-            /*!
-            * \brief Destructor
-            */
-            ~Sinus();
+  /*!
+  * \brief Destructor
+  */
+  ~Sinus();
 
-            /*!
-            * \brief Output matrix
-            *
-            * allows to access output matrix, to get signal value or to put it in a graph.  \n
-            *
-            * \return un pointeur vers la matrice de sortie
-            */
-            core::cvmatrix *GetMatrix(void) const;
+  /*!
+  * \brief Output matrix
+  *
+  * allows to access output matrix, to get signal value or to put it in a graph.
+  *\n
+  *
+  * \return un pointeur vers la matrice de sortie
+  */
+  core::cvmatrix *GetMatrix(void) const;
 
-            /*!
-            * \brief Value
-            *
-            * this method is equivalent to GetMatrix()->Value(0,0)
-            *
-            * \return actual signal value
-            */
-            float GetValue(void) const;
+  /*!
+  * \brief Value
+  *
+  * this method is equivalent to GetMatrix()->Value(0,0)
+  *
+  * \return actual signal value
+  */
+  float GetValue(void) const;
 
-            /*!
-            * \brief Use defautl plot
-            *
-            * this method put a graph in a specific tab
-            *
-            */
-            void UseDefaultPlot(void);
+  /*!
+  * \brief Use defautl plot
+  *
+  * this method put a graph in a specific tab
+  *
+  */
+  void UseDefaultPlot(void);
 
-            /*!
-            * \brief SetupLayout
-            *
-            * this method allows to add other widgets in the sinus tab.
-            *
-            * \return the GridLayout
-            */
-            gui::GridLayout *GetSetupLayout(void) const;
+  /*!
+  * \brief SetupLayout
+  *
+  * this method allows to add other widgets in the sinus tab.
+  *
+  * \return the GridLayout
+  */
+  gui::GridLayout *GetSetupLayout(void) const;
 
-            /*!
-            * \brief Plot
-            *
-            * this method allows to add other curves in the graph
-            *
-            * \return the DataPlot1D
-            */
-            gui::DataPlot1D *GetPlot(void) const;
+  /*!
+  * \brief Plot
+  *
+  * this method allows to add other curves in the graph
+  *
+  * \return the DataPlot1D
+  */
+  gui::DataPlot1D *GetPlot(void) const;
 
-        private:
-            //UpdateFrom method from base class IODevice
-            //sinus is like a sensor, so it does not have input; we define an empty method
-            void UpdateFrom(const core::io_data *data){};
-            void Run(void);
+private:
+  // UpdateFrom method from base class IODevice
+  // sinus is like a sensor, so it does not have input; we define an empty
+  // method
+  void UpdateFrom(const core::io_data *data){};
+  void Run(void);
 
-            core::cvmatrix *output;
-            gui::Tab* mainTab;
-            gui::TabWidget* tabWidget;
-            gui::DataPlot1D* plot;
-            gui::DoubleSpinBox *frequency,*amplitude,*offset;
-            gui::SpinBox *period;
-            gui::GridLayout* setupLayout;
-    };
-}// end namespace sensor
-}// end namespace flair
+  core::cvmatrix *output;
+  gui::Tab *mainTab;
+  gui::TabWidget *tabWidget;
+  gui::DataPlot1D *plot;
+  gui::DoubleSpinBox *frequency, *amplitude, *offset;
+  gui::SpinBox *period;
+  gui::GridLayout *setupLayout;
+};
+} // end namespace sensor
+} // end namespace flair
 #endif // SINUS_H
Index: trunk/demos/Sinus/src/main.cpp
===================================================================
--- trunk/demos/Sinus/src/main.cpp	(revision 14)
+++ trunk/demos/Sinus/src/main.cpp	(revision 16)
@@ -16,79 +16,82 @@
 #include <stdio.h>
 
-//we use namespace std, to avoid writing for examlpe std::string
+// we use namespace std, to avoid writing for examlpe std::string
 using namespace std;
-//idem for TCLAP
+// idem for TCLAP
 using namespace TCLAP;
-//idem for flair
+// idem for flair
 using namespace flair::core;
 
-//global variables for the command line arguments
-string logPath;//path for logs
-string address;//address for FlairGCS
-int port;//port for FlairGCS
-string xmlFile;//setup xml file
-string name;//name
+// global variables for the command line arguments
+string logPath; // path for logs
+string address; // address for FlairGCS
+int port; // port for FlairGCS
+string xmlFile; // setup xml file
+string name; // name
 
-void parseOptions(int argc, char** argv);
+void parseOptions(int argc, char **argv);
 
-int main(int argc, char* argv[]) {
-    //get command line arguments (name,port,xml_file,log_path)
-    parseOptions(argc,argv);
+int main(int argc, char *argv[]) {
+  // get command line arguments (name,port,xml_file,log_path)
+  parseOptions(argc, argv);
 
-    //creation of FrameworkManager
-    FrameworkManager *manager;
-    manager= new FrameworkManager(name);
-    manager->SetupConnection(address,port);
-    manager->SetupUserInterface(xmlFile);
-    manager->SetupLogger(logPath);
+  // creation of FrameworkManager
+  FrameworkManager *manager;
+  manager = new FrameworkManager(name);
+  manager->SetupConnection(address, port);
+  manager->SetupUserInterface(xmlFile);
+  manager->SetupLogger(logPath);
 
-    //creation of the
-    Loop* example=new Loop(manager,"Loop");
+  // creation of the
+  Loop *example = new Loop(manager, "Loop");
 
-    //start loop
-    example->Start();
+  // start loop
+  example->Start();
 
-    //wait for loop ends (with kill button)
-    example->Join();
+  // wait for loop ends (with kill button)
+  example->Join();
 
-    delete manager;
+  delete manager;
 }
 
+void parseOptions(int argc, char **argv) {
+  try {
+    CmdLine cmd("Command description message", ' ', "0.1");
 
-void parseOptions(int argc, char** argv) {
-    try {
-        CmdLine cmd("Command description message", ' ', "0.1");
+    // name of the FrameworkManager, Sinus by default
+    ValueArg<string> nameArg("n", "name", "program name", false, "Sinus",
+                             "string");
+    cmd.add(nameArg);
 
-        //name of the FrameworkManager, Sinus by default
-        ValueArg<string> nameArg("n","name","program name",false,"Sinus","string");
-        cmd.add( nameArg );
+    // setup xml file, ./Sinus.xml by default
+    ValueArg<string> xmlArg("x", "xml", "xml file", false, "./Sinus.xml",
+                            "string");
+    cmd.add(xmlArg);
 
-        //setup xml file, ./Sinus.xml by default
-        ValueArg<string> xmlArg("x","xml","xml file",false,"./Sinus.xml","string");
-        cmd.add( xmlArg );
+    // log path, ./ by defaults
+    ValueArg<string> logArg("l", "log", "log path", false, "/tmp", "string");
+    cmd.add(logArg);
 
-        //log path, ./ by defaults
-        ValueArg<string> logArg("l","log","log path",false,"/tmp","string");
-        cmd.add( logArg );
+    // address for FlairGCS
+    ValueArg<string> addressArg("a", "address",
+                                "address for FlairGCS station sol", false,
+                                "127.0.0.1", "string");
+    cmd.add(addressArg);
 
-        //address for FlairGCS
-        ValueArg<string> addressArg("a","address","address for FlairGCS station sol",false,"127.0.0.1","string");
-        cmd.add( addressArg );
+    // port for FlairGCS, 9000 by default
+    ValueArg<int> portArg("p", "port", "port for FlairGCS", false, 9000, "int");
+    cmd.add(portArg);
 
-        //port for FlairGCS, 9000 by default
-        ValueArg<int> portArg("p","port","port for FlairGCS",false,9000,"int");
-        cmd.add( portArg );
+    cmd.parse(argc, argv);
 
-        cmd.parse( argc, argv );
+    // Get the value parsed by each arg.
+    logPath = logArg.getValue();
+    port = portArg.getValue();
+    xmlFile = xmlArg.getValue();
+    name = nameArg.getValue();
+    address = addressArg.getValue();
 
-        // Get the value parsed by each arg.
-        logPath = logArg.getValue();
-        port=portArg.getValue();
-        xmlFile = xmlArg.getValue();
-        name=nameArg.getValue();
-        address=addressArg.getValue();
-
-    } catch (ArgException &e) { // catch any exceptions
-        cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
-    }
+  } catch (ArgException &e) { // catch any exceptions
+    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
+  }
 }
