Marine systems simulation
VirtualTime.h
1
10#ifndef VirtualTime_H
11#define VirtualTime_H
12
13#include <SimObject.h>
14#include "CEnvironment.h"
15#include <ctime>
16#include <fstream>
17
18class VirtualTime : public SimObject
19{
20public:
22 VirtualTime(std::string sSimObjectName, ISimObjectCreator* pCreator);
23 virtual ~VirtualTime();
24
26 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
27 void FinalSetup(const double T, const double* const X, ISimObjectCreator* const pCreator);
28
29 const double* OutYear(const double T, const double * const X);
30 const double* OutMonth(const double T, const double * const X);
31 const double* OutDay(const double T, const double * const X);
32 const double* OutHour(const double T, const double * const X);
33 const double* OutMinute(const double T, const double * const X);
34 const double* OutSecond(const double T, const double * const X);
35
36 const double* OutAdaTime(const double T, const double * const X);
37 const double* OutTimeDev(const double T, const double * const X);
38 const double* OutTimeVeusz(const double T, const double * const X);
39
40 const double* OutTimeSim(const double T, const double * const X);
41
42#ifdef FH_VISUALIZATION
44 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator) {}
45
47 virtual void RenderUpdate(const double T, const double* const X) {}
48#endif
49protected:
50
51 ISignalPort* m_InTime;
52
53 time_t m_Time;
54 double m_Year;
55 double m_Month;
56 double m_Day;
57 double m_Hour;
58 double m_Minute;
59 double m_Second;
60
61 bool m_CalAdaTime;
62 ISignalPort* m_InTimeD;
63 double m_AdaTime;
64 double m_TimeDev;
65 double m_PreTime;
66
67 bool m_CalTimeVeuze;
68 double m_VeuszDev;
69 double m_TimeVeusz;
70
71 double m_TimeSim;
72
73 bool m_OutSeaEnv;
74 std::string m_OutFileName;
75 CEnvironment* m_Environment;
76 int m_WNum;
77 std::vector<double> m_WaveF;
78 std::vector<double> m_WaveA;
79 std::vector<double> m_WaveP;
80 std::vector<double> m_WaveD;
81 int m_DepthLNum;
82 double* m_DepthL;
83};
84
85#endif
Definition: CEnvironment.h:10
Definition: VirtualTime.h:19
void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
Calculates the state derivatives.
VirtualTime(std::string sSimObjectName, ISimObjectCreator *pCreator)
Constructor.