Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
PowerMeterController.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2015 Raritan Inc. All rights reserved.
4 */
5
6#ifndef __PDUMODEL_POWER_METER_CONTROLLER_IDL__
7#define __PDUMODEL_POWER_METER_CONTROLLER_IDL__
8
9#include <Panel.idl>
10#include <UserEvent.idl>
11
12/**
13 * PDU Model
14 */
15module pdumodel {
16
17 /**
18 * Power Meter Controller (PMC) interface
19 */
21
22 constant int ERR_INVALID_PARAM = 1; ///< Invalid parameters
23 constant int ERR_METER_BOARD_BUSY = 2; ///< A power meter with the given ID already exists
24
25 /** Meter board scan result */
26 structure ScanResult {
27 boolean present; ///< Meter board was found
28 int meterCount; ///< Number of meter channels
29 };
30
31 /**
32 * Scan for presence and configuration of a meter board.
33 *
34 * @param powerMeterId ID of meter board to be scanned
35 * @param result Detected meter board properties
36 *
37 * @return 0 if OK
38 * @return 1 if the meter board ID is out of range
39 */
40 int scanMeterBoard(in int powerMeterId, out ScanResult result);
41
42 /** Event: A power meter or panel was created */
43 valueobject PowerMeterCreatedEvent extends event.UserEvent {
44 PowerMeter powerMeter; ///< New power meter instance
45 PowerMeter.Config config; ///< New power meter config
46 PowerMeter.Settings settings; ///< New power meter settings
47 };
48
49 /** Event: A power meter was deleted */
50 valueobject PowerMeterDeletedEvent extends event.UserEvent {
51 PowerMeter.Config config; ///< Old power meter config
52 PowerMeter.Settings settings; ///< Old power meter settings
53 };
54
55 /** Event: A panel was created */
57 Panel.PanelSettings panelSettings; ///< New panel settings
58 };
59
60 /** Event:: A panel was deleted */
62 Panel.PanelSettings panelSettings; ///< Old panel settings
63 };
64
65 /**
66 * Retrieve the list of power meters and panels.
67 *
68 * @return Power meter and panel instances, indexed by power meter ID
69 */
70 map<int, PowerMeter> getPowerMeters();
71
72 /**
73 * Create a new standalone power meter (no panel).
74 *
75 * @param powerMeter Result: Newly created instance
76 * @param config New power meter config
77 * @param settings Power meter settings
78 *
79 * @return 0 if OK
80 * @return 1 if any parameters are invalid
81 * @return 2 if a power meter with the given ID already exists
82 */
83 int createPowerMeter(out PowerMeter powerMeter,
84 in PowerMeter.Config config,
85 in PowerMeter.Settings settings);
86
87 /**
88 * Create a new panel.
89 *
90 * @param panel Result: Newly created instance
91 * @param config New power meter config
92 * @param powerMeterSettings Power meter settings
93 * @param panelSettings Panel settings
94 *
95 * @return 0 if OK
96 * @return 1 if any parameters are invalid
97 * @return 2 if a power meter with the given ID already exists
98 */
99 int createPanel(out Panel panel,
100 in PowerMeter.Config config,
101 in PowerMeter.Settings powerMeterSettings,
102 in Panel.PanelSettings panelSettings);
103
104 /**
105 * Delete a panel or power meter.
106 *
107 * @param powerMeterId Power meter ID
108 *
109 * @return 0 if OK
110 * @return 1 if the power meter ID is invalid
111 */
112 int deletePowerMeter(in int powerMeterId);
113
114 };
115
116}
117
118#endif
PMC panel.
Definition: Panel.idl:26
Power Meter Controller (PMC) interface.
int createPowerMeter(out PowerMeter powerMeter, in PowerMeter::Config config, in PowerMeter::Settings settings)
Create a new standalone power meter (no panel).
int scanMeterBoard(in int powerMeterId, out ScanResult result)
Scan for presence and configuration of a meter board.
int createPanel(out Panel panel, in PowerMeter::Config config, in PowerMeter::Settings powerMeterSettings, in Panel::PanelSettings panelSettings)
Create a new panel.
int deletePowerMeter(in int powerMeterId)
Delete a panel or power meter.
map< int, PowerMeter > getPowerMeters()
Retrieve the list of power meters and panels.
A three-phase power meter (PMC).
Definition: PowerMeter.idl:23
PDU Model.
Definition: Ade.idl:12
Panel::PanelSettings panelSettings
New panel settings.
Panel::PanelSettings panelSettings
Old panel settings.
Event: A power meter or panel was created.
PowerMeter::Settings settings
New power meter settings.
PowerMeter::Config config
New power meter config.
PowerMeter::Config config
Old power meter config.
PowerMeter::Settings settings
Old power meter settings.
Power meter configuration.
Definition: PowerMeter.idl:36
Power meter settings.
Definition: PowerMeter.idl:88