diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-10-06 22:23:09 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-10-06 22:23:09 -0300 |
commit | ae9530685962e8d4d88c871ec7f5f896dd0b4a93 (patch) | |
tree | 21de2874efead27294cf39f603ff4dd858d94831 /Project/ControlElementSolver.h | |
parent | a32372968abb2f4b3bf0472f59c18f5028d20206 (diff) | |
download | PSP.git-ae9530685962e8d4d88c871ec7f5f896dd0b4a93.tar.gz PSP.git-ae9530685962e8d4d88c871ec7f5f896dd0b4a93.tar.xz PSP.git-ae9530685962e8d4d88c871ec7f5f896dd0b4a93.zip |
Several new implementation, not working
Diffstat (limited to 'Project/ControlElementSolver.h')
-rw-r--r-- | Project/ControlElementSolver.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/Project/ControlElementSolver.h b/Project/ControlElementSolver.h index 44925f5..786ae78 100644 --- a/Project/ControlElementSolver.h +++ b/Project/ControlElementSolver.h @@ -46,25 +46,29 @@ class ControlElementSolver { public: ControlElementSolver() {} - ControlElementSolver(ControlEditor* controlEditor, - double timeStep = 1e-3, - double integrationError = 1e-3, - bool startAllZero = true, - double input = 0.0); + ControlElementSolver(ControlEditor* controlEditor, double timeStep = 1e-3, double integrationError = 1e-3); ControlElementSolver(ControlElementContainer* ctrlContainer, double timeStep = 1e-3, double integrationError = 1e-3, - bool startAllZero = true, - double input = 0.0, wxWindow* parent = NULL); virtual ~ControlElementSolver() {} - virtual bool InitializeValues(double input, bool startAllZero); - virtual void SolveNextStep(double input); + virtual bool InitializeValues(bool startAllZero); + virtual void SolveNextStep(); virtual std::vector<double> GetSolutions() { return m_solutions; } virtual double GetLastSolution() { return m_solutions[m_solutions.size() - 1]; } virtual bool IsOK() const { return m_isOK; } + virtual wxString GetErrorMessage() { return m_failMessage; } + void SetTerminalVoltage(double value) { m_terminalVoltage = value; } + void SetVelocity(double value) { m_velocity = value; } + void SetActivePower(double value) { m_activePower = value; } + void SetReactivePower(double value) { m_reactivePower = value; } + void SetInitialTerminalVoltage(double value) { m_initTerminalVoltage = value; } + void SetInitialMecPower(double value) { m_initMecPower = value; } + void SetInitialVelocity(double value) { m_initVelocity = value; } + double GetFieldVoltage() { return m_fieldVoltage; } + double GetMechanicalPower() { return m_mecPower; } protected: - void Initialize(wxWindow* parent, double timeStep, double integrationError, bool startAllZero, double input); + void Initialize(wxWindow* parent, double timeStep, double integrationError); void FillAllConnectedChildren(ConnectionLine* parent); ConnectionLine* SolveNextElement(ConnectionLine* currentLine); @@ -73,9 +77,21 @@ class ControlElementSolver double m_integrationError; std::vector<double> m_solutions; bool m_isOK = false; + wxString m_failMessage = _("Unknown error."); - IOControl* m_inputControl = NULL; + IOControl* m_inputControl = NULL; /**< First input control to be solved */ IOControl* m_outputControl = NULL; + // Inputs + double m_terminalVoltage = 0.0; + double m_velocity = 0.0; + double m_activePower = 0.0; + double m_reactivePower = 0.0; + double m_initTerminalVoltage = 0.0; + double m_initMecPower = 0.0; + double m_initVelocity = 0.0; + // Outputs + double m_fieldVoltage = 0.0; + double m_mecPower = 0.0; }; #endif // CONTROLELEMENTSOLVER_H |