00001
00002 #ifndef DDF_MULTIROBSIMU_HPP
00003 #define DDF_MULTIROBSIMU_HPP
00004
00005
00006 #include <string>
00007 #include <iostream>
00008 #include <fstream>
00009
00010 #include "robotsimu.hpp"
00011
00012 namespace jafar
00013 {
00014 namespace ddfsimu
00015 {
00016 namespace demo
00017 {
00018
00023 class MultiRobSimu
00024 {
00025 typedef RobotSimu::SortedBuffer SortedBuffer;
00026 typedef RobotSimu::SortedBufferItem SortedBufferItem;
00027
00028 SortedBuffer m_Sbuf;
00029 SortedBuffer::iterator m_meas_it;
00030 unsigned int m_nr_meas;
00031
00032 public:
00033 MultiRobSimu() { ResetCounter(); ClearBuffer(); }
00034 ~MultiRobSimu() {}
00035
00036 void ResetCounter() { m_meas_it = m_Sbuf.begin(); }
00037 void IncCounter() { m_meas_it->sensor->IncCounter(); m_meas_it++; }
00038 unsigned short GetCurRobID();
00039 unsigned short GetCurSensorType();
00040 unsigned short GetCurSensorID();
00041 int GetCurTriggerNodeID();
00042 time GetCurRelTime();
00043 void GetCurInfo(InfoContainer &meas);
00044 bool IsCurTriggerUpdatePOM();
00045 bool IsCurTriggerSyncTracker();
00046 void ClearBuffer() { m_nr_meas = 0; m_Sbuf.clear(); }
00047 void AddRobotMeasurements(RobotSimu & rob);
00048 void DumpAllMeasures(std::string const& fname);
00049 unsigned int GetNrMeas() const { return m_nr_meas; }
00050
00051 private:
00052 void DumpMeasure(unsigned short nb, MeasureItem const& meas, std::ofstream &stream) const;
00053
00054 };
00055 }
00056
00057 }
00058 }
00059 #endif