UniWidgets  1.0.0
OscillographLogic.h
00001 #ifndef _OSCILLOGRAPHLOGIC_H
00002 #define _OSCILLOGRAPHLOGIC_H
00003 // -------------------------------------------------------------------------
00004 #include <gtkmm.h>
00005 #include <objects/AbstractLogic.h>
00006 #include <UniSetTypes.h>
00007 #include <uniwidgets/USignals.h>
00008 #include <global_macros.h>
00009 // -------------------------------------------------------------------------
00010 namespace UniWidgets
00011 {
00012 class SimpleOscillograph;
00020 class OscillographLogic : public AbstractLogic
00021 {
00022 
00023 public:
00024     OscillographLogic();
00025     explicit OscillographLogic(Gtk::EventBox::BaseObjectType* gobject);
00026     virtual ~OscillographLogic();
00028     void add_new_oscil_id(const long id, Glib::ustring *);
00029     bool on_timer_tick();                   
00030     sigc::connection tmr;                   
00032 protected:
00033     /* Methods */
00034     virtual void on_init();
00035     virtual void connect();
00036     virtual void disconnect();
00037 
00038 private:
00039     /* Variables */
00040     SimpleOscillograph* current_oscil_; 
00041     /* Methods */
00042     void constructor();
00043     void init_oscil();
00044 
00045     /* Handlers */
00046     inline void sensor_value_changed(UniSetTypes::ObjectId sensor, UniSetTypes::ObjectId node, long value)
00047     {
00048         std::cout << "Oscil::sensor_value_changed....  " << sensor << ":  " << value << std::endl;
00049     }
00050     void set_current_state();
00051 
00052     DISALLOW_COPY_AND_ASSIGN(OscillographLogic);
00053     /* Properties */
00054     ADD_PROPERTY( channel_ai, UniSetTypes::ObjectId ) /*Сенсор осциллографа,
00055                                *который отображается по-умолчанию.
00056                                *Можно подумать как можно задать группу сенсоров.
00057                               */
00058     ADD_PROPERTY( channelname, Glib::ustring )
00059     ADD_PROPERTY( node, UniSetTypes::ObjectId )
00060 };
00061 
00062 }
00063 #endif