LoggerModule.H

00001 #include "Component/ModelManager.H"
00002 #include "Component/OptionManager.H"
00003 #include "Component/ModelComponent.H"
00004 #include "Component/ModelParam.H"
00005 #include "Media/FrameSeries.H"
00006 #include "Transport/FrameInfo.H"
00007 #include "Raster/GenericFrame.H"
00008 #include "Image/Image.H"
00009 #include "GUI/XWinManaged.H"
00010 #include "GUI/ImageDisplayStream.H"
00011 #include "Image/Image.H"
00012 #include "Image/Pixels.H"
00013 #include "Robots/RobotBrain/RobotBrainComponent.H"
00014 #include "Ice/RobotBrainObjects.ice.H"
00015 #include "Ice/RobotSimEvents.ice.H"
00016 #include "Ice/IceImageUtils.H"
00017 #include "Raster/PnmWriter.H"
00018 #include <IceUtil/Thread.h>
00019 #include <fstream>
00020 
00021 #ifndef LOGGERMODULE_H
00022 #define LOGGERMODULE_H
00023 
00024 
00025 class LoggerModule : public RobotBrainComponent
00026 {
00027 public:
00028 
00029   LoggerModule(int id, OptionManager& mgr,
00030                const std::string& descrName = "LoggerModule",
00031                const std::string& tagName = "LoggerModule");
00032 
00033   ~LoggerModule();
00034 
00035   virtual void evolve();
00036 
00037   // Get a message
00038   virtual void updateMessage(const RobotSimEvents::EventMessagePtr& eMsg,
00039                              const Ice::Current&);
00040 
00041   virtual void registerTopics();
00042 
00043 private:
00044 
00045   OModelParam<string> itsLogPath;
00046   std::ofstream itsLogFile;
00047 
00048   Image<PixRGB<byte> > itsCurrentFwdImg;
00049   Image<PixRGB<byte> > itsCurrentDwnImg;
00050   int itsCurrentHeading;
00051   int itsCurrentExtPressure;
00052   int itsCurrentIntPressure;
00053 
00054   IceUtil::Mutex itsDataMutex;
00055 
00056   int itsFwdFrameCount;
00057   int itsLastFwdFrameCount;
00058   int itsDwnFrameCount;
00059   int itsLastDwnFrameCount;
00060 
00061 
00062   PnmWriter itsImgWriter;
00063 
00064   bool itsLogOpen;
00065 
00066 };
00067 
00068 #endif
Generated on Sun May 8 08:41:38 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3