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 */
20 interface PowerMeterController {
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 */
56 valueobject PanelCreatedEvent extends PowerMeterCreatedEvent {
57 Panel.PanelSettings panelSettings; ///< New panel settings
58 };
59
60 /** Event:: A panel was deleted */
61 valueobject PanelDeletedEvent extends PowerMeterDeletedEvent {
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
pdumodel::Panel
PMC panel.
Definition Panel.idl:26
pdumodel::PowerMeterController
Power Meter Controller (PMC) interface.
Definition PowerMeterController.idl:20
pdumodel::PowerMeterController::createPowerMeter
int createPowerMeter(out PowerMeter powerMeter, in PowerMeter::Config config, in PowerMeter::Settings settings)
Create a new standalone power meter (no panel).
pdumodel::PowerMeterController::scanMeterBoard
int scanMeterBoard(in int powerMeterId, out ScanResult result)
Scan for presence and configuration of a meter board.
pdumodel::PowerMeterController::createPanel
int createPanel(out Panel panel, in PowerMeter::Config config, in PowerMeter::Settings powerMeterSettings, in Panel::PanelSettings panelSettings)
Create a new panel.
pdumodel::PowerMeterController::deletePowerMeter
int deletePowerMeter(in int powerMeterId)
Delete a panel or power meter.
pdumodel::PowerMeterController::getPowerMeters
map< int, PowerMeter > getPowerMeters()
Retrieve the list of power meters and panels.
pdumodel::PowerMeter
A three-phase power meter (PMC).
Definition PowerMeter.idl:23
pdumodel
PDU Model.
Definition Circuit.idl:16
pdumodel::Panel::PanelSettings
Panel settings.
Definition Panel.idl:37
pdumodel::PowerMeterController::PanelCreatedEvent
Event: A panel was created.
Definition PowerMeterController.idl:56
pdumodel::PowerMeterController::PanelCreatedEvent::panelSettings
Panel::PanelSettings panelSettings
New panel settings.
Definition PowerMeterController.idl:57
pdumodel::PowerMeterController::PanelDeletedEvent
Event:: A panel was deleted.
Definition PowerMeterController.idl:61
pdumodel::PowerMeterController::PanelDeletedEvent::panelSettings
Panel::PanelSettings panelSettings
Old panel settings.
Definition PowerMeterController.idl:62
pdumodel::PowerMeterController::PowerMeterCreatedEvent
Event: A power meter or panel was created.
Definition PowerMeterController.idl:43
pdumodel::PowerMeterController::PowerMeterCreatedEvent::powerMeter
PowerMeter powerMeter
New power meter instance.
Definition PowerMeterController.idl:44
pdumodel::PowerMeterController::PowerMeterCreatedEvent::settings
PowerMeter::Settings settings
New power meter settings.
Definition PowerMeterController.idl:46
pdumodel::PowerMeterController::PowerMeterCreatedEvent::config
PowerMeter::Config config
New power meter config.
Definition PowerMeterController.idl:45
pdumodel::PowerMeterController::PowerMeterDeletedEvent
Event: A power meter was deleted.
Definition PowerMeterController.idl:50
pdumodel::PowerMeterController::PowerMeterDeletedEvent::config
PowerMeter::Config config
Old power meter config.
Definition PowerMeterController.idl:51
pdumodel::PowerMeterController::PowerMeterDeletedEvent::settings
PowerMeter::Settings settings
Old power meter settings.
Definition PowerMeterController.idl:52
pdumodel::PowerMeterController::ScanResult
Meter board scan result.
Definition PowerMeterController.idl:26
pdumodel::PowerMeterController::ScanResult::meterCount
int meterCount
Number of meter channels.
Definition PowerMeterController.idl:28
pdumodel::PowerMeterController::ScanResult::present
boolean present
Meter board was found.
Definition PowerMeterController.idl:27
pdumodel::PowerMeter::Config
Power meter configuration.
Definition PowerMeter.idl:36
pdumodel::PowerMeter::Settings
Power meter settings.
Definition PowerMeter.idl:88