|
uniset-algorithms 0.2
|
00001 #ifndef A2D_H_ 00002 #define A2D_H_ 00003 //-------------------------------------------------------------------------- 00004 #include <list> 00005 #include <map> 00006 #include <UniSetTypes.h> 00007 #include <UniversalInterface.h> 00008 #include <MessageType.h> 00009 #include <UniXML.h> 00010 00011 //-------------------------------------------------------------------------- 00055 class A2D 00056 { 00057 public: 00058 00059 A2D( xmlNode* confnode=0 ); 00060 ~A2D(); 00061 00062 void init( xmlNode* cn ); 00063 void sensorInfo( UniversalInterface* ui, UniSetTypes::SensorMessage *sm ); 00064 void askSensors( UniversalInterface* ui, UniversalIO::UIOCommand cmd ); 00065 00066 00067 struct DInfo 00068 { 00069 DInfo(): 00070 id(UniSetTypes::DefaultObjectId), 00071 iotype(UniversalIO::DigitalInput), 00072 invert(false) 00073 { 00074 } 00075 00076 UniSetTypes::ObjectId id; 00077 UniversalIO::IOTypes iotype; 00078 bool invert; 00079 }; 00080 00081 typedef std::list<DInfo> DList; 00082 00083 typedef std::map<long,DList> DMap; 00084 00085 struct AInfo 00086 { 00087 AInfo(): 00088 id(UniSetTypes::DefaultObjectId) 00089 { 00090 } 00091 00092 UniSetTypes::ObjectId id; 00093 DMap dlst; 00094 // long value; 00095 }; 00096 00097 typedef std::list<AInfo> AList; 00098 00099 protected: 00100 00101 void updateState( UniversalInterface* ui, DInfo& di, bool state ); 00102 00103 AList lst; 00104 }; 00105 //-------------------------------------------------------------------------- 00106 #endif
1.7.4