00001
00020 #ifndef __NEW_SIM_SENSOR_THRESHOLD_H__
00021 #define __NEW_SIM_SENSOR_THRESHOLD_H__
00022
00023
00024 #ifndef __NEW_SIM_SENSOR_H__
00025 #include "new_sim_sensor.h"
00026 #endif
00027
00034 class NewSimulatorSensorThreshold : public NewSimulatorSensor {
00035 private:
00036 SaHpiSensorThdMaskT m_read_thold;
00037 SaHpiSensorThdMaskT m_write_thold;
00038 SaHpiSensorThresholdsT m_thres;
00039
00040 SaErrorT checkThresholdValue( const SaHpiSensorReadingT &checkval,
00041 SaHpiSensorRangeFlagsT flag,
00042 SaHpiSensorReadingT &setval );
00043
00044 SaErrorT checkHysteresisValue( const SaHpiSensorReadingT &checkval,
00045 SaHpiSensorRangeFlagsT flag,
00046 SaHpiSensorReadingT &setval );
00047
00048 SaErrorT checkOrdering( const SaHpiSensorThresholdsT &thres );
00049
00050 void setMask( SaHpiSensorThresholdsT &thres, const SaHpiSensorThdMaskT mask);
00051
00052
00053 public:
00054 NewSimulatorSensorThreshold( NewSimulatorResource *res );
00055 NewSimulatorSensorThreshold( NewSimulatorResource *res,
00056 SaHpiRdrT rdr,
00057 SaHpiSensorReadingT data,
00058 SaHpiEventStateT event_state,
00059 SaHpiEventStateT event_amask,
00060 SaHpiEventStateT event_dmask,
00061 SaHpiSensorThresholdsT thresholds,
00062 SaHpiBoolT enabled,
00063 SaHpiBoolT event_enabled);
00064 virtual ~NewSimulatorSensorThreshold();
00065
00066 virtual void HandleNew( NewSimulatorDomain *domain );
00067
00068
00069
00070 virtual void Dump( NewSimulatorLog &dump ) const;
00071
00072 bool Cmp( const NewSimulatorSensor &s2 ) const;
00073
00074 virtual bool CreateRdr( SaHpiRptEntryT &resource, SaHpiRdrT &rdr );
00075
00076
00077
00078
00079 SaErrorT GetSensorReading( SaHpiSensorReadingT &data, SaHpiEventStateT &state );
00080
00081 SaErrorT GetThresholds( SaHpiSensorThresholdsT &thres );
00082
00083 SaErrorT SetThresholds( const SaHpiSensorThresholdsT &thres );
00084
00085 };
00086
00087
00088 #endif