Raritan / Server Technology Xerus™ PDU JSON-RPC API
VoltageMonitoringSensor.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2020 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __PDUMODEL_VOLTAGE_MONITORING_SENSOR_IDL__
7 #define __PDUMODEL_VOLTAGE_MONITORING_SENSOR_IDL__
8 
9 #include <NumericSensor.idl>
10 #include <UserEvent.idl>
11 #include <Waveform.idl>
12 
13 /**
14  * PDU Model
15  */
16 module pdumodel {
17 
18  /** Interface of a voltage sensor with extended monitoring capabilities */
19  interface VoltageMonitoringSensor extends sensors.NumericSensor {
20  [unknown_fallback("UNKNOWN")]
21  enumeration EventType {
22  DIP,
23  SWELL,
24  UNKNOWN
25  };
26 
27  structure DipSwellThresholds {
28  boolean dipActive; ///< \c true if dip events should be monitored
29  double dipThreshold; ///< Dip event threshold
30  boolean swellActive; ///< \c true if swell events should be monitored
31  double swellThreshold; ///< Swell event threshold
32  float deassertionHysteresis; ///< Deassertion hysteresis
33  };
34 
35  /** Definition of a voltage fluctuation event observed by this sensor */
36  structure Event {
37  EventType type; ///< Type of event
38  time timestamp; ///< Time of event occurrence
39  int duration; ///< Event duration in milliseconds
40  double voltage; ///< Voltage level observed during the event:
41  ///< - for dip events: lowest voltage observed
42  ///< - for swell events: highest voltage observed
43  Waveform waveform; ///< Waveform of event
44  };
45 
46  /** Event: A new dip/swell event occurred */
47  valueobject EventOccurredEvent extends idl.Event {
48  Event event; ///< Event that was observed
49  };
50 
51  /** Event: The list of observed events was cleared */
52  valueobject EventListClearedEvent extends event.UserEvent {
53  };
54 
55  /** Event: Dip/swell thresholds were changed */
56  valueobject DipSwellThresholdsChangedEvent extends event.UserEvent {
57  DipSwellThresholds oldThresholds;
58  DipSwellThresholds newThresholds;
59  };
60 
61  /** Get all events that were observed so far, ordered from
62  * most recent to least recent event.
63  * Note: The response might be limited to a certain number of records.
64  */
65  vector<Event> getRecentEvents();
66 
67  /** Clear list of observed events. */
69 
70  /**
71  * Retrieve the dip/swell thresholds.
72  *
73  * @return Set of thresholds
74  */
76 
77  /**
78  * Change the dip/swell thresholds.
79  *
80  * @param thresholds New set of thresholds
81  *
82  * @return 0 if OK
83  * @return THRESHOLD_OUT_OF_RANGE if any threshold is out of range
84  * @return THRESHOLD_INVALID if thresholds don't meet the requirements
85  */
87  };
88 }
89 
90 #endif
Interface of a voltage sensor with extended monitoring capabilities.
Definition: VoltageMonitoringSensor.idl:19
vector< Event > getRecentEvents()
Get all events that were observed so far, ordered from most recent to least recent event.
DipSwellThresholds getDipSwellThresholds()
Retrieve the dip/swell thresholds.
int setDipSwellThresholds(in DipSwellThresholds thresholds)
Change the dip/swell thresholds.
void clearRecentEvents()
Clear list of observed events.
Basic IDL definitions.
Definition: Event.idl:10
PDU Model.
Definition: Ade.idl:12
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
Common base for all events.
Definition: Event.idl:13
Event: Dip/swell thresholds were changed.
Definition: VoltageMonitoringSensor.idl:56
Definition: VoltageMonitoringSensor.idl:27
float deassertionHysteresis
Deassertion hysteresis.
Definition: VoltageMonitoringSensor.idl:32
boolean swellActive
true if swell events should be monitored
Definition: VoltageMonitoringSensor.idl:30
double swellThreshold
Swell event threshold.
Definition: VoltageMonitoringSensor.idl:31
boolean dipActive
true if dip events should be monitored
Definition: VoltageMonitoringSensor.idl:28
double dipThreshold
Dip event threshold.
Definition: VoltageMonitoringSensor.idl:29
Event: The list of observed events was cleared.
Definition: VoltageMonitoringSensor.idl:52
Event: A new dip/swell event occurred.
Definition: VoltageMonitoringSensor.idl:47
Event event
Event that was observed.
Definition: VoltageMonitoringSensor.idl:48
Definition of a voltage fluctuation event observed by this sensor.
Definition: VoltageMonitoringSensor.idl:36
Waveform waveform
Waveform of event.
Definition: VoltageMonitoringSensor.idl:43
time timestamp
Time of event occurrence.
Definition: VoltageMonitoringSensor.idl:38
int duration
Event duration in milliseconds.
Definition: VoltageMonitoringSensor.idl:39
EventType type
Type of event.
Definition: VoltageMonitoringSensor.idl:37
double voltage
Voltage level observed during the event:
Definition: VoltageMonitoringSensor.idl:40
Waveform data, including metadata.
Definition: Waveform.idl:12