ImageCapture/ImageObserver/ImageObserver.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2002,2004 Sony Corporation 
00003 //
00004 // Permission to use, copy, modify, and redistribute this software for
00005 // non-commercial use is hereby granted.
00006 //
00007 // This software is provided "as is" without warranty of any kind,
00008 // either expressed or implied, including but not limited to the
00009 // implied warranties of fitness for a particular purpose.
00010 //
00011 
00012 #ifndef ImageObserver_h_DEFINED
00013 #define ImageObserver_h_DEFINED
00014 
00015 #include <OPENR/OObject.h>
00016 #include <OPENR/OSubject.h> 
00017 #include <OPENR/OObserver.h>
00018 #include "def.h"
00019 
00020 enum ImageObserverState {
00021     IOS_IDLE,
00022     IOS_START
00023 };
00024 
00025 static const char* const FBK_LOCATOR = "PRM:/r1/c1/c2/c3/i1-FbkImageSensor:F1";
00026 static const char* const TINSW_LOCATOR = "PRM:/r1/c1/c2/c3/c4/s5-Sensor:s5";
00027 static const char* const BACKSW_LOCATOR = "PRM:/r6/s1-Sensor:s1";
00028 static const char* const BACKR7_LOCATOR = "PRM:/t2-Sensor:t2"; // REAR
00029 static const char* const BACKM7_LOCATOR = "PRM:/t3-Sensor:t3"; // FRONT
00030 static const char* const BACKF7_LOCATOR = "PRM:/t4-Sensor:t4"; // MID
00031 
00032 class ImageObserver : public OObject {
00033 public:  
00034     ImageObserver();
00035     virtual ~ImageObserver() {}
00036   
00037     OSubject*  subject[numOfSubject];
00038     OObserver* observer[numOfObserver];
00039 
00040     virtual OStatus DoInit   (const OSystemEvent& event);
00041     virtual OStatus DoStart  (const OSystemEvent& event);
00042     virtual OStatus DoStop   (const OSystemEvent& event);
00043     virtual OStatus DoDestroy(const OSystemEvent& event);
00044     
00045     void Notify(const ONotifyEvent& event);
00046 
00047 private:
00048     void OpenPrimitive();
00049     void PrintTagInfo(OFbkImageVectorData* imageVec);
00050     void SaveRawData(char* path,
00051                      OFbkImageVectorData* imageVec, OFbkImageLayer layer);
00052 
00053     bool ExistData(int serialNumber);
00054     void SaveData(int serialNumber, OFbkImageVectorData* imageVec);
00055 
00056     ImageObserverState  imageObserverState;
00057     OPrimitiveID        fbkID;
00058     OPrimitiveID        tinswID;
00059     OPrimitiveID        backswID;
00060     OPrimitiveID        backf7ID;
00061     OPrimitiveID        backm7ID;
00062     OPrimitiveID        backr7ID;
00063 
00064     static const int ROBOT_UNDEF  = 0;
00065     static const int ROBOT_ERS200 = 1;
00066     static const int ROBOT_ERS7   = 2;
00067     int robot;
00068 };
00069 
00070 #endif // ImageObserver_h_DEFINED

Generated on Sun Dec 2 23:04:28 2007 for openSDK by  doxygen 1.3.9.1