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
