Marine systems simulation
VirtualCurrentDir.h
1
11
12#ifndef VirtualCurrentDir_H
13#define VirtualCurrentDir_H
14
15#include "SimObject.h"
16#include "sfh/constants.h"
17#include <memory>
18
19class VirtualCurrentDir : public SimObject
20{
21public:
23 VirtualCurrentDir(std::string sSimObjectName, ISimObjectCreator* pCreator);
25
27 void OdeFcn(const double dT, const double* const adX, double* const adXDot, const bool bIsMajorTimeStep){}
28
29 const double * Output(const double T, const double * const X);
30
31#ifdef FH_VISUALIZATION
33 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator){}
34
36 virtual void RenderUpdate(const double T, const double* const X){}
37#endif
38protected:
39
40 int m_PortWidth;
41 double m_MinimumForce[2];
42 double m_RefDir;
43 double m_MaxRelDir;
44 std::unique_ptr<double[]> m_Directions;
45
46 ISignalPort *m_InRef;
47 ISignalPort *m_InForce;
48 double m_Output;
49};
50
51
52#endif
Definition: VirtualCurrentDir.h:20
double m_RefDir
Minimum force.
Definition: VirtualCurrentDir.h:42
ISignalPort * m_InRef
Input directions.
Definition: VirtualCurrentDir.h:46
VirtualCurrentDir(std::string sSimObjectName, ISimObjectCreator *pCreator)
Constructor.
double m_MaxRelDir
Reference direction.
Definition: VirtualCurrentDir.h:43
void OdeFcn(const double dT, const double *const adX, double *const adXDot, const bool bIsMajorTimeStep)
Calculates the state derivatives.
Definition: VirtualCurrentDir.h:27
double m_MinimumForce[2]
The width of the input port.
Definition: VirtualCurrentDir.h:41
std::unique_ptr< double[]> m_Directions
Maximum change to the reference direction.
Definition: VirtualCurrentDir.h:44