00001 #ifndef SeaBee3GUIIce_H 00002 #define SeaBee3GUIIce_H 00003 00004 #include "Qt/ui/SeaBee3GUI2.h" 00005 #include "Robots/RobotBrain/RobotBrainComponent.H" 00006 #include "Util/Timer.H" 00007 #include "GUI/CompassMeter.H" 00008 #include "GUI/DepthMeter.H" 00009 #include "GUI/PressureMeter.H" 00010 #include "GUI/CircleFillMeter.H" 00011 00012 class SeaBee3MainDisplayForm; 00013 00014 class BeeStemData 00015 { 00016 public: 00017 float heading; 00018 float externalPressure; 00019 float internalPressure; 00020 int headingPIDOutput; 00021 int depthPIDOutput; 00022 int desiredDepth; 00023 bool killSwitch; 00024 }; 00025 00026 class SeaBee3GUIIce : public RobotBrainComponent 00027 { 00028 public: 00029 SeaBee3GUIIce(OptionManager& mgr, 00030 const std::string& descrName = "SeaBee3GUIIce", 00031 const std::string& tagName = "SeaBee3GUIIce"); 00032 00033 virtual void updateMessage(const RobotSimEvents::EventMessagePtr& eMsg, 00034 const Ice::Current&); 00035 00036 virtual void registerTopics(); 00037 00038 virtual void evolve(); 00039 00040 void registerGUI(SeaBee3MainDisplayForm* form); 00041 00042 void setOrangeSegEnabled(bool enabled); 00043 void setSalientPointsEnabled(bool enabled); 00044 00045 private: 00046 void updateFwdImg(); 00047 00048 void updateDwnImg(); 00049 00050 void updateBeeStemData(); 00051 00052 void updateSaliencyImage(); 00053 00054 00055 SeaBee3MainDisplayForm *itsGUIForm; 00056 00057 bool itsGUIRegistered; 00058 IceUtil::Mutex itsGUIFormMutex; 00059 00060 IceUtil::Mutex itsUpdateMutex; // Locks lists for incoming updates 00061 00062 std::list<Image<PixRGB<byte> > > itsFwdRetinaImages; 00063 char itsFwdRetinaMsgCounter; 00064 00065 std::list<Image<PixRGB<byte> > > itsDwnRetinaImages; 00066 char itsDwnRetinaMsgCounter; 00067 00068 std::list<Image<PixRGB<byte> > > itsOrangeSegImages; 00069 bool itsOrangeSegEnabled; 00070 00071 std::list<Image<PixRGB<byte> > > itsRedSegImages; 00072 char itsRedSegImagesSize; 00073 00074 std::list<Point2D<int> > itsSalientPoints; 00075 int itsSalientPointsSize; 00076 bool itsSalientPointsEnabled; 00077 00078 char itsVisionMsgCounter; 00079 00080 std::list<BeeStemData> itsBeeStemData; 00081 char itsBeeStemMsgCounter; 00082 CompassMeter itsCompassMeter; 00083 DepthMeter itsDepthMeter; 00084 PressureMeter itsPressureMeter; 00085 CircleFillMeter itsCircleFillMeter; 00086 TargetLineMeter itsTargetLineMeter; 00087 00088 Timer itsTimer; 00089 00090 Image<PixRGB<byte> > itsFwdVisionImage; 00091 Image<PixRGB<byte> > itsDwnVisionImage; 00092 00093 }; 00094 00095 #endif 00096