LhxSensor.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2011 Raritan Inc. All rights reserved.
*/
#ifndef __LHXMODEL_SENSOR_IDL__
#define __LHXMODEL_SENSOR_IDL__
#include <Event.idl>
#include <Sensor.idl>
#include <UserEvent.idl>
/** LHX Model */
module lhxmodel {
/** LHX Sensor Interface */
interface Sensor_4_0_3 extends sensors.Sensor_4_0_3 {
/** Sensor's self describing data */
structure MetaData {
/**
* Sensor type, reading type and unit
*/
sensors.Sensor_4_0_3.TypeSpec type;
/**
* Number of significant decimal digits.
*
* Indicates how many digits should be displayed
* to the right of the decimal point. I.e. double
* values must be rounded with this precision.
*/
int numDecDigits;
/**
* Smallest possible Numeric Reading Value
*/
double numRangeMin;
/**
* Largest possible Numeric Reading Value
*/
double numRangeMax;
/**
* Smallest possible Numeric Reading Threshold Value
*/
double numThresholdMin;
/**
* Largest possible Numeric Reading Threshold Value
*/
double numThresholdMax;
/**
* The sensor label.
*/
string label;
/**
* Descriptive ID of sensor containing label.
*/
string id;
};
/** Numerical sensor thresholds */
structure NumThresholds {
boolean lowerCriticalIsEnabled; ///< Lower critical threshold enabled
double lowerCritical; ///< Lower critical threshold value
boolean lowerWarningIsEnabled; ///< Lower warning threshold enabled
double lowerWarning; ///< Lower warning threshold value
boolean upperWarningIsEnabled; ///< Upper warning threshold enabled
double upperWarning; ///< Upper warning threshold value
boolean upperCriticalIsEnabled; ///< Upper critical threshold enabled
double upperCritical; ///< Upper critical threshold value
double hysteresis; ///< Deassertion hysteresis
};
constant int STATE_NOT_AVAILABLE = -1; ///< Communication to sensor lost
constant int STATE_CLOSED = 0; ///< Closed
constant int STATE_OPEN = 1; ///< Open
constant int STATE_NUM_NORMAL = 0; ///< Numerical sensor in normal range
constant int STATE_NUM_ABOVE_UPPER_CRITICAL = 1; ///< Above upper critical threshold
constant int STATE_NUM_ABOVE_UPPER_WARNING = 2; ///< Above upper warning threshold
constant int STATE_NUM_BELOW_LOWER_WARNING = 3; ///< Below lower warning threshold
constant int STATE_NUM_BELOW_LOWER_CRITICAL = 4; ///< Below lower critical threshold
/** Sensor reading */
structure Reading {
time timestamp; ///< Time of sample
int state; ///< discrete reading or state
double value; ///< numeric reading value
boolean isValid; ///< numeric value is valid or NAN
};
/** Event: Sensor thresholds have been changed */
valueobject ThresholdsChangedEvent extends event.UserEvent {
NumThresholds oldThresholds; ///< Thresholds before change
NumThresholds newThresholds; ///< Thresholds after change
};
/** Event: Sensor state has changed */
valueobject StateChangedEvent extends idl.Event {
Reading oldReading; ///< Reading before change
Reading newReading; ///< Reading after change
};
/** Event: Sensor numeric reading has changed */
valueobject ReadingChangedEvent extends idl.Event {
Reading newReading; ///< New reading
};
constant int ERR_INVALID_PARAM = 1; ///< Invalid parameters
constant int ERR_NOT_SUPPORTED = 2; ///< Not supported
/**
* Retrieve the LHX metadata.
*
* @return metadata
*/
MetaData getMetaData();
/**
* Retrieve Numeric Thresholds.
*
* @return sensor thresholds
*/
NumThresholds getThresholds();
/**
* Set Numeric Thresholds.
*
* @return 0 if OK
* @return ERR_INVALID_PARAM if any parameters are invalid
*/
int setThresholds(in NumThresholds thresholds);
/**
* Retrieve sensors reading
*
* @return reading
*/
Reading getReading();
};
}
#endif /* !__LHXMODEL_SENSOR_IDL__ */
lhxmodel::Sensor_4_0_3::MetaData::numThresholdMax
double numThresholdMax
Largest possible Numeric Reading Threshold Value.
Definition: LhxSensor.idl:53
lhxmodel::Sensor_4_0_3::MetaData
Sensor&#39;s self describing data.
Definition: LhxSensor.idl:20
lhxmodel::Sensor_4_0_3
LHX Sensor Interface.
Definition: LhxSensor.idl:17
lhxmodel::Sensor_4_0_3::NumThresholds::lowerWarning
double lowerWarning
Lower warning threshold value.
Definition: LhxSensor.idl:71
lhxmodel::Sensor_4_0_3::NumThresholds::lowerWarningIsEnabled
boolean lowerWarningIsEnabled
Lower warning threshold enabled.
Definition: LhxSensor.idl:70
lhxmodel::Sensor_4_0_3::MetaData::numThresholdMin
double numThresholdMin
Smallest possible Numeric Reading Threshold Value.
Definition: LhxSensor.idl:48
lhxmodel::Sensor_4_0_3::MetaData::id
string id
Descriptive ID of sensor containing label.
Definition: LhxSensor.idl:63
lhxmodel::Sensor_4_0_3::MetaData::numDecDigits
int numDecDigits
Number of significant decimal digits.
Definition: LhxSensor.idl:33
lhxmodel::Sensor_4_0_3::MetaData::numRangeMin
double numRangeMin
Smallest possible Numeric Reading Value.
Definition: LhxSensor.idl:38
lhxmodel::Sensor_4_0_3::NumThresholds::lowerCriticalIsEnabled
boolean lowerCriticalIsEnabled
Lower critical threshold enabled.
Definition: LhxSensor.idl:68
lhxmodel::Sensor_4_0_3::MetaData::type
sensors::Sensor_4_0_3 TypeSpec type
Sensor type, reading type and unit.
Definition: LhxSensor.idl:24
lhxmodel
LHX Model.
Definition: Lhx.idl:14
idl
Basic IDL definitions.
Definition: Event.idl:10
lhxmodel::Sensor_4_0_3::NumThresholds::upperCritical
double upperCritical
Upper critical threshold value.
Definition: LhxSensor.idl:75
lhxmodel::Sensor_4_0_3::Reading
Sensor reading.
Definition: LhxSensor.idl:89
lhxmodel::Sensor_4_0_3::Reading::isValid
boolean isValid
numeric value is valid or NAN
Definition: LhxSensor.idl:93
lhxmodel::Sensor_4_0_3::Reading::state
int state
discrete reading or state
Definition: LhxSensor.idl:91
lhxmodel::Sensor_4_0_3::Reading::timestamp
time timestamp
Time of sample.
Definition: LhxSensor.idl:90
lhxmodel::Sensor_4_0_3::NumThresholds::hysteresis
double hysteresis
Deassertion hysteresis.
Definition: LhxSensor.idl:76
sensors::Sensor_4_0_3
Sensor interface
Definition: Sensor.idl:15
lhxmodel::Sensor_4_0_3::NumThresholds
Numerical sensor thresholds.
Definition: LhxSensor.idl:67
lhxmodel::Sensor_4_0_3::newReading
Reading newReading
Reading after change.
Definition: LhxSensor.idl:105
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
lhxmodel::Sensor_4_0_3::Reading::value
double value
numeric reading value
Definition: LhxSensor.idl:92
lhxmodel::Sensor_4_0_3::newThresholds
NumThresholds newThresholds
Thresholds after change.
Definition: LhxSensor.idl:99
sensors::Sensor_4_0_3::TypeSpec
Complete sensor type specification.
Definition: Sensor.idl:160
lhxmodel::Sensor_4_0_3::NumThresholds::lowerCritical
double lowerCritical
Lower critical threshold value.
Definition: LhxSensor.idl:69
lhxmodel::Sensor_4_0_3::MetaData::numRangeMax
double numRangeMax
Largest possible Numeric Reading Value.
Definition: LhxSensor.idl:43
lhxmodel::Sensor_4_0_3::NumThresholds::upperWarningIsEnabled
boolean upperWarningIsEnabled
Upper warning threshold enabled.
Definition: LhxSensor.idl:72
lhxmodel::Sensor_4_0_3::MetaData::label
string label
The sensor label.
Definition: LhxSensor.idl:58
lhxmodel::Sensor_4_0_3::NumThresholds::upperWarning
double upperWarning
Upper warning threshold value.
Definition: LhxSensor.idl:73
lhxmodel::Sensor_4_0_3::NumThresholds::upperCriticalIsEnabled
boolean upperCriticalIsEnabled
Upper critical threshold enabled.
Definition: LhxSensor.idl:74