00001 /* 00002 * $Id: tracking.h $ 00003 * 00004 * Description : UDP packet listener and parser 00005 * Author : Radek Bien <mail: radek.bien@seznam.cz> <ICQ: 201-963-660> 00006 * 00007 * Purpose : 00008 * Tracking parser is an UDP datagram listener, taht receives UDP datagram and 00009 * parse it and returns data structures representing transformations of an object 00010 */ 00011 00012 00013 #ifndef _TRACKING_H__ 00014 #define _TRACKING_H__ 00015 00016 //#include <wx/socket.h> 00017 00018 #include "receiver.h" 00019 #include "../../core/src/module.h" 00020 #include "pparser.h" 00021 #include "bodies.h" 00022 #include "filter.h" 00023 #include "../../core/src/evtstructs.h" 00024 #include <queue> 00025 00026 00027 namespace VRUT 00028 { 00030 const int MODULE_VERSION = 1; 00031 00033 class Tracking: public Module//, public Receiver 00034 { 00035 protected: 00037 00044 int IDoffset; 00045 Parameter::ParameterIdentificator IDoffsetParamID; 00046 00047 TrackingFilter filter; 00048 00049 // TrackingTable TrackTable; 00050 00052 PacketParser parser; 00053 00055 Receiver * listener; 00056 00058 std::queue<Body *> bodyQueue; 00059 00061 wxString remoteAddress; 00062 00064 unsigned short remotePort; 00065 00067 unsigned short packetTimeout; 00069 Parameter::ParameterIdentificator packetTimeoutParamID; 00070 00072 unsigned short localPort; 00074 Parameter::ParameterIdentificator localPortParamID; 00075 00077 unsigned short bufferSize; 00079 Parameter::ParameterIdentificator bufferSizeParamID; 00080 00082 00085 float rotationFilter; 00087 Parameter::ParameterIdentificator rotationFilterParamID; 00088 00090 00093 float translationFilter; 00095 Parameter::ParameterIdentificator translationFilterParamID; 00096 00098 int bodyID; 00099 Parameter::ParameterIdentificator bodyIDParamID; 00101 int bodyType; 00102 Parameter::ParameterIdentificator bodyTypeParamID; 00104 short updateTable; 00105 Parameter::ParameterIdentificator updateTableParamID; 00107 short dumpTable; 00108 Parameter::ParameterIdentificator dumpTableParamID; 00110 virtual void processEvent(wxCommandEvent & evt); 00111 //Overload only if you need to do some action every iteration of module's loop 00112 00114 00117 virtual void run(); 00118 00120 void safeEmptyQueue(); 00121 00122 void processQueue(); 00123 00124 void dumpFilterTable(); 00125 00126 public: 00128 Tracking(const MODULE_ID & _id, const wxString & _name, EventHandler * msgSink); 00130 virtual ~Tracking(); 00131 00133 virtual wxString GetDesc() const; 00134 00135 }; 00136 00137 }; 00138 00139 EXPORT_VRUT_MODULE_FUNCTIONS( Tracking ) 00140 00141 00142 00143 #endif
1.5.5