Changeset 214 in flair-src for trunk/demos/Sinus


Ignore:
Timestamp:
Feb 7, 2018, 5:49:27 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

matrix

Location:
trunk/demos/Sinus/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/Sinus/src/Loop.cpp

    r16 r214  
    2424#include <PushButton.h>
    2525#include <DataPlot1D.h>
    26 #include <cvmatrix.h>
     26#include <Matrix.h>
    2727
    2828using namespace std;
     
    4747                                   "1st order lawpass filter");
    4848  sinus->GetPlot()->AddCurve(
    49       firstLowPass->Matrix()->Element(0),
     49      firstLowPass->GetMatrix()->Element(0),
    5050      DataPlot::Blue); // add output of the filter to signal's graph
    5151
     
    5454      sinus, sinus->GetSetupLayout()->NewRow(), "3rd order lawpass filter", 3);
    5555  sinus->GetPlot()->AddCurve(
    56       thirdLowPass->Matrix()->Element(0),
     56      thirdLowPass->GetMatrix()->Element(0),
    5757      DataPlot::Yellow); // add output of the filter to signal's graph
    5858
  • trunk/demos/Sinus/src/MeanFilter.cpp

    r157 r214  
    1313
    1414#include "MeanFilter.h"
    15 #include <cvmatrix.h>
     15#include <Matrix.h>
    1616#include <LayoutPosition.h>
    1717#include <GroupBox.h>
     
    4242  desc->SetElementName(0, 0,
    4343                       "mean filter"); // name will be used for graphs and logs
    44   output = new cvmatrix(this, desc, floatType, name);
     44  output = new Matrix(this, desc, floatType, name);
    4545  delete desc;
    4646
     
    5252MeanFilter::~MeanFilter() {}
    5353
    54 cvmatrix *MeanFilter::GetMatrix() const { return output; }
     54Matrix *MeanFilter::GetMatrix() const { return output; }
    5555
    5656float MeanFilter::GetValue(void) const { return output->Value(0, 0); }
     
    6464
    6565  float result = 0;
    66   // get input argument in a cvmatrix
    67   cvmatrix *input = (cvmatrix *)data;
     66  // get input argument in a matrix
     67  const Matrix* input = dynamic_cast<const Matrix*>(data);
     68 
     69  if (!input) {
     70      Warn("casting %s to Matrix failed\n",data->ObjectName().c_str());
     71      return;
     72  }
    6873
    6974  // simple (and not efficent!) implementation of the filter
  • trunk/demos/Sinus/src/MeanFilter.h

    r16 r214  
    2525namespace flair {
    2626namespace core {
    27 class cvmatrix;
     27class Matrix;
    2828}
    2929namespace gui {
     
    7070  * \return pointer to the output matrix
    7171  */
    72   core::cvmatrix *GetMatrix(void) const;
     72  core::Matrix *GetMatrix(void) const;
    7373
    7474  /*!
     
    8686  gui::GroupBox *groupBox;
    8787  gui::SpinBox *numberOfElements;
    88   core::cvmatrix *output;
     88  core::Matrix *output;
    8989  float previousValues[MAX_NUMBER_OF_ELEMENTS]; // previous values storage
    9090};
  • trunk/demos/Sinus/src/Sinus.cpp

    r157 r214  
    2121#include <SpinBox.h>
    2222#include <DataPlot1D.h>
    23 #include <cvmatrix.h>
     23#include <Matrix.h>
    2424#include <math.h>
    2525
     
    4141  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
    4242  desc->SetElementName(0, 0, "value"); // name will be used for graphs and logs
    43   output = new cvmatrix((IODevice *)this, desc, floatType, name);
     43  output = new Matrix((IODevice *)this, desc, floatType, name);
    4444  delete desc;
    4545
     
    9494}
    9595
    96 cvmatrix *Sinus::GetMatrix(void) const { return output; }
     96Matrix *Sinus::GetMatrix(void) const { return output; }
    9797
    9898float Sinus::GetValue(void) const { return output->Value(0, 0); }
  • trunk/demos/Sinus/src/Sinus.h

    r16 r214  
    2323namespace core {
    2424class FrameworkManager;
    25 class cvmatrix;
     25class Matrix;
    2626}
    2727namespace gui {
     
    6969  * \return un pointeur vers la matrice de sortie
    7070  */
    71   core::cvmatrix *GetMatrix(void) const;
     71  core::Matrix *GetMatrix(void) const;
    7272
    7373  /*!
     
    113113  void Run(void);
    114114
    115   core::cvmatrix *output;
     115  core::Matrix *output;
    116116  gui::Tab *mainTab;
    117117  gui::TabWidget *tabWidget;
Note: See TracChangeset for help on using the changeset viewer.