00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __MotionRatingBehaviorMessage_h_
00011 #define __MotionRatingBehaviorMessage_h_
00012
00013
00014 class MotionRatingBehaviorMessage;
00015
00016 #include "Tools/Streams/InOut.h"
00017 #include "Tools/Math/Vector2.h"
00018 #include <string.h>
00019
00020
00021
00022
00023
00024
00025
00026 class MotionRatingBehaviorMessage
00027 {
00028 public:
00029
00030 enum MessageType {
00031 none = 0,
00032 test,
00033
00034 ping, report,
00035
00036 init, request, abort, pause, proceed, stop, sleep,
00037 numOfMessageTypes
00038 };
00039
00040 enum States { unknown, sleeping, preparing, waiting, testing, dead };
00041
00042 MessageType type;
00043 States state;
00044 int paramSetId;
00045 int data;
00046 double currentSpeed;
00047 double averageSpeed;
00048 int currentWalk;
00049 int walkCount;
00050 bool finished;
00051 char remainingPower;
00052 double distance;
00053 unsigned long time;
00054
00055 Vector2<double> start;
00056 Vector2<double> end;
00057
00058
00059 MotionRatingBehaviorMessage();
00060
00061 static char* getStateName ( States state )
00062 {
00063 switch ( state )
00064 {
00065 case unknown: return "unknown";
00066 case sleeping: return "sleeping";
00067 case preparing: return "preparing";
00068 case waiting: return "waiting";
00069 case testing: return "testing";
00070 case dead: return "dead";
00071 default: return "undefined state";
00072 }
00073 };
00074
00075 };
00076
00077 In& operator>>(In& stream, MotionRatingBehaviorMessage& message);
00078
00079 Out& operator<<(Out& stream, const MotionRatingBehaviorMessage& message);
00080
00081
00082 #endif// __MotionRatingBehaviorMessage_h_
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092