Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __JAUS_EXTRAS_CONTROLLERS_JOYSTICK__H
00041 #define __JAUS_EXTRAS_CONTROLLERS_JOYSTICK__H
00042
00043 #include "jaus/extras/controllers/controldevice.h"
00044 #include <cxutils/joystick.h>
00045
00046 namespace JAUS
00047 {
00055 class JAUS_EXTRAS_DLL Joystick : public ControlDevice,
00056 public CxUtils::Joystick::Callback
00057 {
00058 public:
00059
00060 Joystick();
00061
00062 virtual ~Joystick();
00063
00064 void EnableJoystick(const bool enable = true) { mEnableJoystickFlag = enable; }
00065
00066 bool IsJoystickEnabled() const { return mEnableJoystickFlag; }
00067
00068 virtual void Shutdown() { ControlDevice::Shutdown(); mJoystick.Shutdown(); }
00069
00070 virtual bool LoadSettings(const std::string& filename);
00071
00072 virtual void ProcessJoystickEvent(const CxUtils::Joystick& jstick);
00073
00074 virtual void ProcessButtonEvent(const unsigned int buttonNumber, const CxUtils::Joystick::Event type);
00075
00076 virtual void CheckServiceStatus(const unsigned int timeSinceLastCheckMs);
00077 protected:
00078 CxUtils::Joystick mJoystick;
00079 unsigned int mID;
00080 unsigned int mFrequency;
00081 std::string mCalibrationFile;
00082 volatile bool mEnableJoystickFlag;
00083 };
00084 }
00085
00086 #endif
00087