Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Representations/JoystickData.cpp

Go to the documentation of this file.
00001 /**
00002  * @file JoystickData.cpp
00003  * Implementation of class JoystickData.
00004  *
00005  * @author <a href=mailto:dueffert@informatik.hu-berlin.de>Uwe Düffert</a>
00006  */
00007 
00008 #include "JoystickData.h"
00009 #include "Platform/SystemCall.h"
00010 #include "Representations/Motion/MotionRequest.h"
00011 
00012 JoystickData::JoystickData():x(0),y(0),z(0),accel(0),button(0),coolie(0),directSpecialAction(false),specialActionID(SpecialActionRequest::numOfSpecialAction)
00013 {
00014   timeStamp = SystemCall::getCurrentSystemTime();
00015 }
00016 
00017 In& operator>>(In& stream,JoystickData& joystickData)
00018 {
00019   joystickData.timeStamp = SystemCall::getCurrentSystemTime();
00020   int directSpecialAction, specialActionID;
00021   stream >> joystickData.x >> joystickData.y >> joystickData.z >> joystickData.accel >> joystickData.button >> joystickData.coolie >> directSpecialAction >> specialActionID;
00022   joystickData.directSpecialAction = directSpecialAction!=0;
00023   joystickData.specialActionID = (SpecialActionRequest::SpecialActionID)specialActionID;
00024   return stream;
00025 }
00026  
00027 Out& operator<<(Out& stream, const JoystickData& joystickData)
00028 {
00029   stream << joystickData.x << joystickData.y << joystickData.z << joystickData.accel << joystickData.button << joystickData.coolie << (int)joystickData.directSpecialAction << (int)joystickData.specialActionID;
00030   return stream;
00031 }
00032 
00033 /*
00034  * Changelog:
00035  * 
00036  * $Log: JoystickData.cpp,v $
00037  * Revision 1.2  2004/06/02 17:18:24  spranger
00038  * MotionRequest cleanup
00039  *
00040  * Revision 1.1.1.1  2004/05/22 17:25:01  cvsadm
00041  * created new repository GT2004_WM
00042  *
00043  * Revision 1.2  2004/04/26 15:58:59  thomas
00044  * added new project RobotRemote based on ATHAiboControl
00045  *
00046  * Revision 1.1  2003/10/07 10:07:01  cvsadm
00047  * Created GT2004 (M.J.)
00048  *
00049  * Revision 1.1.1.1  2003/07/02 09:40:22  cvsadm
00050  * created new repository for the competitions in Padova from the 
00051  * tamara CVS (Tuesday 2:00 pm)
00052  *
00053  * removed unused solutions
00054  *
00055  * Revision 1.1  2003/02/27 12:02:11  dueffert
00056  * JoystickData added
00057  *
00058  *
00059  */

Generated on Thu Sep 23 19:57:35 2004 for GT2004 by doxygen 1.3.6