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; 00109 00110 //variables for forwarding 00111 wxIPV4address local, remote; 00112 wxDatagramSocket *sendSock; 00113 00115 bool forward; 00116 Parameter::ParameterIdentificator forwardParamID; 00117 00119 wxString forwardMachines; 00120 Parameter::ParameterIdentificator forwardMachinesParamID; 00121 00123 virtual void processEvent(wxCommandEvent & evt); 00124 //Overload only if you need to do some action every iteration of module's loop 00125 00127 00130 virtual void run(); 00131 00133 void safeEmptyQueue(); 00134 00135 void processQueue(); 00136 00137 void dumpFilterTable(); 00138 00139 public: 00141 Tracking(const MODULE_ID & _id, const wxString & _name, EventHandler * msgSink); 00143 virtual ~Tracking(); 00144 00146 virtual wxString GetDesc() const; 00147 00148 }; 00149 00150 }; 00151 00152 EXPORT_VRUT_MODULE_FUNCTIONS( Tracking ) 00153 00154 00155 00156 #endif