diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-05-04 17:03:19 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-05-04 17:03:19 -0300 |
commit | 412ddd0fa4a6e32651619897c8606d4cbaaa1ffa (patch) | |
tree | d93249ee4a8e32668d497bc6675fbb42b93d0f2c /Project/ControlElementSolver.h | |
parent | 7ade1da522d642fa5f7a38e62d0e865733ef1afe (diff) | |
download | PSP.git-412ddd0fa4a6e32651619897c8606d4cbaaa1ffa.tar.gz PSP.git-412ddd0fa4a6e32651619897c8606d4cbaaa1ffa.tar.xz PSP.git-412ddd0fa4a6e32651619897c8606d4cbaaa1ffa.zip |
Control solver class created
Just the basics methods implemented
Diffstat (limited to 'Project/ControlElementSolver.h')
-rw-r--r-- | Project/ControlElementSolver.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Project/ControlElementSolver.h b/Project/ControlElementSolver.h new file mode 100644 index 0000000..47838d7 --- /dev/null +++ b/Project/ControlElementSolver.h @@ -0,0 +1,41 @@ +#ifndef CONTROLELEMENTSOLVER_H +#define CONTROLELEMENTSOLVER_H + +#include <stddef.h> // NULL definition +#include <vector> + +class ControlElementContainer; +class ControlEditor; +class ConnectionLine; +class Constant; +class Exponential; +class Gain; +class IOControl; +class Limiter; +class Multiplier; +class RateLimiter; +class Sum; +class TransferFunction; + +class ControlElementSolver +{ + public: + ControlElementSolver() {} + ControlElementSolver(ControlEditor* controlEditor, double timeStep = 1e-3, bool startAllZero = false, double input = 0.0); + ~ControlElementSolver() {} + + virtual void InitializeValues(double input); + virtual void SolveNextStep(double input); + virtual std::vector<double> GetSolutions() { return m_solutions; } + virtual double GetLastSolution() {return m_solutions[m_solutions.size() - 1];} + + protected: + ControlElementContainer* m_ctrlContainer = NULL; + double m_timeStep; + std::vector<double> m_solutions; + + IOControl* m_inputControl = NULL; + IOControl* m_outputControl = NULL; +}; + +#endif // CONTROLELEMENTSOLVER_H |