Changeset 214 in flair-src for trunk/demos/Sinus/src
- Timestamp:
- Feb 7, 2018, 5:49:27 PM (7 years ago)
- Location:
- trunk/demos/Sinus/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/demos/Sinus/src/Loop.cpp
r16 r214 24 24 #include <PushButton.h> 25 25 #include <DataPlot1D.h> 26 #include < cvmatrix.h>26 #include <Matrix.h> 27 27 28 28 using namespace std; … … 47 47 "1st order lawpass filter"); 48 48 sinus->GetPlot()->AddCurve( 49 firstLowPass-> Matrix()->Element(0),49 firstLowPass->GetMatrix()->Element(0), 50 50 DataPlot::Blue); // add output of the filter to signal's graph 51 51 … … 54 54 sinus, sinus->GetSetupLayout()->NewRow(), "3rd order lawpass filter", 3); 55 55 sinus->GetPlot()->AddCurve( 56 thirdLowPass-> Matrix()->Element(0),56 thirdLowPass->GetMatrix()->Element(0), 57 57 DataPlot::Yellow); // add output of the filter to signal's graph 58 58 -
trunk/demos/Sinus/src/MeanFilter.cpp
r157 r214 13 13 14 14 #include "MeanFilter.h" 15 #include < cvmatrix.h>15 #include <Matrix.h> 16 16 #include <LayoutPosition.h> 17 17 #include <GroupBox.h> … … 42 42 desc->SetElementName(0, 0, 43 43 "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); 45 45 delete desc; 46 46 … … 52 52 MeanFilter::~MeanFilter() {} 53 53 54 cvmatrix *MeanFilter::GetMatrix() const { return output; }54 Matrix *MeanFilter::GetMatrix() const { return output; } 55 55 56 56 float MeanFilter::GetValue(void) const { return output->Value(0, 0); } … … 64 64 65 65 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 } 68 73 69 74 // simple (and not efficent!) implementation of the filter -
trunk/demos/Sinus/src/MeanFilter.h
r16 r214 25 25 namespace flair { 26 26 namespace core { 27 class cvmatrix;27 class Matrix; 28 28 } 29 29 namespace gui { … … 70 70 * \return pointer to the output matrix 71 71 */ 72 core:: cvmatrix *GetMatrix(void) const;72 core::Matrix *GetMatrix(void) const; 73 73 74 74 /*! … … 86 86 gui::GroupBox *groupBox; 87 87 gui::SpinBox *numberOfElements; 88 core:: cvmatrix *output;88 core::Matrix *output; 89 89 float previousValues[MAX_NUMBER_OF_ELEMENTS]; // previous values storage 90 90 }; -
trunk/demos/Sinus/src/Sinus.cpp
r157 r214 21 21 #include <SpinBox.h> 22 22 #include <DataPlot1D.h> 23 #include < cvmatrix.h>23 #include <Matrix.h> 24 24 #include <math.h> 25 25 … … 41 41 cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1); 42 42 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); 44 44 delete desc; 45 45 … … 94 94 } 95 95 96 cvmatrix *Sinus::GetMatrix(void) const { return output; }96 Matrix *Sinus::GetMatrix(void) const { return output; } 97 97 98 98 float Sinus::GetValue(void) const { return output->Value(0, 0); } -
trunk/demos/Sinus/src/Sinus.h
r16 r214 23 23 namespace core { 24 24 class FrameworkManager; 25 class cvmatrix;25 class Matrix; 26 26 } 27 27 namespace gui { … … 69 69 * \return un pointeur vers la matrice de sortie 70 70 */ 71 core:: cvmatrix *GetMatrix(void) const;71 core::Matrix *GetMatrix(void) const; 72 72 73 73 /*! … … 113 113 void Run(void); 114 114 115 core:: cvmatrix *output;115 core::Matrix *output; 116 116 gui::Tab *mainTab; 117 117 gui::TabWidget *tabWidget;
Note:
See TracChangeset
for help on using the changeset viewer.