00001 #ifndef MONITOR_COMPONENT_H
00002 #define MONITOR_COMPONENT_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __cplusplus
00029 #error This is a C++ include file and cannot be used from plain C
00030 #endif
00031
00032 #include "MonitorPoint.h"
00033
00034 #define ROMONITORPOINTNS(NS, Type, type) ROMonitorPoint<NS::Type, TMCDB::type##BlobDataSeq, ACS::P##type, POA_ACS::CB##type, POA_ACS::Alarm##type, NS::Type, ACS::type##Seq_var, NS::Type>
00035 #define ROMONITORPOINT(Type, type) ROMonitorPoint<const Type, TMCDB::type##BlobDataSeq, ACS::P##type, POA_ACS::CB##type, POA_ACS::Alarm##type, Type, ACS::type##Seq_var, const Type>
00036 #define ROMONITORPOINTNSSEQ(NS, Type, type) ROMonitorPoint<const ACS::type##Seq&, TMCDB::type##SeqBlobDataSeq, ACS::P##type##Seq, POA_ACS::CB##type##Seq, POA_ACS::Alarm##type, NS::Type, ACS::type##SeqSeq_var, NS::Type>
00037 #define ROMONITORPOINTSEQ(Type, type) ROMonitorPoint<const ACS::type##Seq&, TMCDB::type##SeqBlobDataSeq, ACS::P##type##Seq, POA_ACS::CB##type##Seq, POA_ACS::Alarm##type, Type, ACS::type##SeqSeq_var, const Type>
00038 #define MONITORPOINTNS(NS, Type, type) MonitorPoint<NS::Type, TMCDB::type##BlobDataSeq, ACS::P##type, POA_ACS::CB##type, NS::Type>
00039 #define MONITORPOINT(Type, type) MonitorPoint<const Type, TMCDB::type##BlobDataSeq, ACS::P##type, POA_ACS::CB##type, Type>
00040 #define MONITORPOINTNSSEQ(NS, Type, type) MonitorPoint<const ACS::type##Seq&, TMCDB::type##SeqBlobDataSeq, ACS::P##type##Seq, POA_ACS::CB##type##Seq, NS::Type>
00041 #define MONITORPOINTSEQ(Type, type) MonitorPoint<const ACS::type##Seq&, TMCDB::type##SeqBlobDataSeq, ACS::P##type##Seq, POA_ACS::CB##type##Seq, Type>
00042 #define CBTIENS(NS, Type, type) POA_ACS::CB##type##_tie<MONITORPOINTNS(NS, Type, type) >
00043 #define CBTIE(Type, type) POA_ACS::CB##type##_tie<MONITORPOINT(Type, type) >
00044 #define CBTIENSSEQ(NS, Type, type) POA_ACS::CB##type##Seq_tie<MONITORPOINTNSSEQ(NS, Type, type) >
00045 #define CBTIESEQ(Type, type) POA_ACS::CB##type##Seq_tie<MONITORPOINTSEQ(Type, type) >
00046 #define ALARMTIENS(NS, Type, type) POA_ACS::Alarm##type##_tie<ROMONITORPOINTNS(NS, Type, type) >
00047 #define ALARMTIE(Type, type) POA_ACS::Alarm##type##_tie<ROMONITORPOINT(Type, type) >
00048 #define ALARMTIENSSEQ(NS, Type, type) POA_ACS::Alarm##type##_tie<ROMONITORPOINTNSSEQ(NS, Type, type) >
00049 #define ALARMTIESEQ(Type, type) POA_ACS::Alarm##type##_tie<ROMONITORPOINTSEQ(Type, type) >
00050
00051 namespace TMCDB
00052 {
00053
00054
00055
00059 class MonitorComponent
00060 {
00061 public:
00063 MonitorComponent(ACS::CharacteristicComponent_ptr comp, maci::ContainerServices *cs);
00064
00065 virtual ~MonitorComponent();
00066
00067 void startMonitoring();
00068
00069 void stopMonitoring();
00070
00073 bool addProperty(const char *propName);
00074
00075 bool addProperty(const char *propName, const char *pType, ACS::Property* propRef, ACS::TimeInterval &monitoringInterval);
00076
00078 void addAllProperties();
00079
00080 void fillSeq();
00081
00082 MonitorDataBlock& getMonitorDataBlock() { return monitorDataBlock_m; }
00083
00084 void setDeviceSerialNumber(serialNumberType sn);
00085
00086 void setPropertySerialNumber(char* propertyName, serialNumberTypeSeq sn);
00087
00088 void set_archiving_interval(const char* propertyName, ACS::TimeInterval time);
00089
00090 void suppress_archiving(const char* propertyName);
00091
00092 void enable_archiving(const char* propertyName);
00093
00094 private:
00095
00099 ACS::TimeInterval propertyArchivingInterval(ACS::PropertyDesc *);
00100
00102 std::vector<MonitorPointBase*> monitorPoints_m;
00104 ACS::CharacteristicComponent_var component_m;
00105
00107 MonitorDataBlock monitorDataBlock_m;
00108
00110 unsigned int seqIndex_m;
00111
00112
00113 maci::ContainerServices *containerServices_m;
00114
00116 ACS::CharacteristicComponentDesc_var compDesc_m;
00117
00119 CORBA::ULong numOfProp_m;
00120
00121 bool monitoring_m;
00122
00123 ACS::Time m_monitoringStartTime;
00124
00125 ACE_Thread_Mutex m_proMutex;
00126
00127 };
00128
00129
00130
00131 };
00132
00133
00134 #endif