Marine systems simulation
SwitchConsoleInput.h
1#ifndef SwitchConsoleInput_h__
2#define SwitchConsoleInput_h__
3
8#include <SimObject.h>
9
10#ifdef FH_VISUALIZATION
11#pragma warning(push)
12#pragma warning( disable : 4251 )
13 #include <ois/OIS.h>
14#pragma warning(pop)
15#endif
16namespace Ship{
17
18#ifdef FH_VISUALIZATION
19 class SwitchConsoleInput: public SimObject,OIS::JoyStickListener{
20#else
21 class SwitchConsoleInput: public SimObject{
22#endif
23 public:
24 SwitchConsoleInput(const std::string simObjectName, ISimObjectCreator* const creator);
25
26 void OdeFcn(const double T, const double *const X, double *const XDot, const bool IsMajorTimeStep);
27
28 void InitialConditionSetup(const double T, const double *const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
29
30 const double * WinchSpeed(const double T, const double* const X);
31 const double * WinchCable(const double T, const double* const X);
32
33 const double * AttachCable(const double T, const double* const X);
34
35 const double * BaseRotationAngle(const double T, const double* const X);
36 const double * BaseElevationAngle(const double T, const double* const X);
37 const double * BaseElevationAngleRate(const double T, const double* const X);
38
39 const double * JointAngle0(const double T, const double* const X);
40 const double * JointAngleRate0(const double T, const double* const X);
41 const double * ElementLength0(const double T, const double* const X);
42
43 const double * JointAngle1(const double T, const double* const X);
44 const double * JointAngleRate1(const double T, const double* const X);
45 const double * ElementLength1(const double T, const double* const X);
46
47#ifdef FH_VISUALIZATION
48 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
49 virtual void RenderUpdate( const double T, const double* const X );
50 bool buttonPressed(const OIS::JoyStickEvent &arg, int button);
51 bool buttonReleased(const OIS::JoyStickEvent &arg, int button);
52 bool axisMoved(const OIS::JoyStickEvent &arg, int axis);
53 bool sliderMoved(const OIS::JoyStickEvent &arg, int index);
54 void ProcessJoyEvent(const OIS::JoyStickEvent &arg);
55#endif
56 private:
57
58 size_t m_joypadID;
59
60 double m_winchSpeed;
61 int m_winchCounter;
62 int m_winchState;
63 bool m_craneEnable;
64 bool m_connectEnable;
65
66 double m_baseSpeed;
67 int m_baseState;
68
69 double m_baseAngleSpeed;
70 int m_baseAngle;
71
72 int m_jointAngleState0;
73 int m_jointAngleState1;
74
75 int m_telescopeState0;
76 int m_telescopeState1;
77
78 double m_jointAngleSpeed0;
79 double m_jointAngleSpeed1;
80
81 double m_jointTelescopeSpeed0;
82 double m_jointTelescopeSpeed1;
83
84 double m_baseLimits[2];
85
86 double m_baseAngleLimits[2];
87 double m_baseLength;
88
89 double m_angleLimits0[2];
90 double m_telescopeLimits0[2];
91
92 double m_angleLimits1[2];
93 double m_telescopeLimits1[2];
94
95 double m_winchSpeedOut;
96 double m_attachOut;
97 };
98
99
100}
101#endif // SwitchConsoleInput_h__
Definition: SwitchConsoleInput.h:21
Simple waypoint object.
Definition: CableAttach.h:16