TypicalImitatorLamp.h
00001 #ifndef _TYPICALIMITATORLAMP_H
00002 #define _TYPICALIMITATORLAMP_H
00003
00004 #include <map>
00005 #include <typical/AbstractTypical.h>
00006 #include <objects/ImitatorLogic.h>
00007 #include <objects/ImitatorShowLogic.h>
00008 #include <components/Image.h>
00009 #include <USignals.h>
00010 #include <global_macros.h>
00011
00012 namespace UniWidgets
00013 {
00025 class TypicalImitatorLamp : public AbstractTypical
00026 {
00027 public:
00028 TypicalImitatorLamp();
00029 explicit TypicalImitatorLamp(AbstractTypical::BaseObjectType* gobject);
00030 virtual ~TypicalImitatorLamp();
00031
00032
00033 typedef std::map<long, Image*> ModeImageMap;
00034 typedef std::pair<long, Image*> ModeImagePair;
00035 typedef std::map<long, Glib::ustring > ModePathMap;
00036 typedef std::pair<long, Glib::ustring > ModePathPair;
00037 typedef std::map<long, int> BlinkTimeMap;
00038 typedef std::pair<long, int> BlinkTimePair;
00039
00040
00041 void configure();
00042
00043 void set_rect(const Gdk::Rectangle rect);
00044 void set_path(const long mode, const Glib::ustring& path);
00045 void set_path2(const long mode, const Glib::ustring& path);
00046 void set_state_ai(const UniSetTypes::ObjectId sensor);
00047 void set_state_obj(const UniSetTypes::ObjectId sensor);
00048 void set_node(const UniSetTypes::ObjectId node);
00049 void set_mode_state(const long mode);
00050 void set_blinking_time(const long mode, const int sec);
00052 Glib::ustring get_path(const long, bool is_back = false);
00053 Gdk::Rectangle* get_rect();
00054 int get_blinking_time(const long mode);
00056 private:
00057
00058 Gdk::Rectangle rect_;
00059 ImitatorShowLogic imitatorshowlogic_;
00060 ImitatorLogic imitatorlogic_;
00061 ModeImageMap images_;
00062 ModePathMap paths_;
00063 ModePathMap paths_2;
00064 BlinkTimeMap blinktimes_;
00065
00066 int blinktimesec1;
00067 int blinktimesec2;
00068
00069
00070 void create_images();
00071 void constructor();
00072
00073 DISALLOW_COPY_AND_ASSIGN(TypicalImitatorLamp);
00074 };
00075
00076 }
00077 #endif