Loading...
Searching...
No Matches
PowerMeterController.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2015 Raritan Inc. All rights reserved.
*/
#ifndef __PDUMODEL_POWER_METER_CONTROLLER_IDL__
#define __PDUMODEL_POWER_METER_CONTROLLER_IDL__
#include <Panel.idl>
#include <UserEvent.idl>
/**
* PDU Model
*/
module pdumodel {
/**
* Power Meter Controller (PMC) interface
*/
interface PowerMeterController {
constant int ERR_INVALID_PARAM = 1; ///< Invalid parameters
constant int ERR_METER_BOARD_BUSY = 2; ///< A power meter with the given ID already exists
/** Meter board scan result */
structure ScanResult {
boolean present; ///< Meter board was found
int meterCount; ///< Number of meter channels
};
/**
* Scan for presence and configuration of a meter board.
*
* @param powerMeterId ID of meter board to be scanned
* @param result Detected meter board properties
*
* @return 0 if OK
* @return 1 if the meter board ID is out of range
*/
int scanMeterBoard(in int powerMeterId, out ScanResult result);
/** Event: A power meter or panel was created */
valueobject PowerMeterCreatedEvent extends event.UserEvent {
PowerMeter powerMeter; ///< New power meter instance
PowerMeter.Config config; ///< New power meter config
PowerMeter.Settings settings; ///< New power meter settings
};
/** Event: A power meter was deleted */
valueobject PowerMeterDeletedEvent extends event.UserEvent {
PowerMeter.Config config; ///< Old power meter config
PowerMeter.Settings settings; ///< Old power meter settings
};
/** Event: A panel was created */
valueobject PanelCreatedEvent extends PowerMeterCreatedEvent {
Panel.PanelSettings panelSettings; ///< New panel settings
};
/** Event:: A panel was deleted */
valueobject PanelDeletedEvent extends PowerMeterDeletedEvent {
Panel.PanelSettings panelSettings; ///< Old panel settings
};
/**
* Retrieve the list of power meters and panels.
*
* @return Power meter and panel instances, indexed by power meter ID
*/
map<int, PowerMeter> getPowerMeters();
/**
* Create a new standalone power meter (no panel).
*
* @param powerMeter Result: Newly created instance
* @param config New power meter config
* @param settings Power meter settings
*
* @return 0 if OK
* @return 1 if any parameters are invalid
* @return 2 if a power meter with the given ID already exists
*/
int createPowerMeter(out PowerMeter powerMeter,
in PowerMeter.Config config,
in PowerMeter.Settings settings);
/**
* Create a new panel.
*
* @param panel Result: Newly created instance
* @param config New power meter config
* @param powerMeterSettings Power meter settings
* @param panelSettings Panel settings
*
* @return 0 if OK
* @return 1 if any parameters are invalid
* @return 2 if a power meter with the given ID already exists
*/
int createPanel(out Panel panel,
in PowerMeter.Config config,
in PowerMeter.Settings powerMeterSettings,
in Panel.PanelSettings panelSettings);
/**
* Delete a panel or power meter.
*
* @param powerMeterId Power meter ID
*
* @return 0 if OK
* @return 1 if the power meter ID is invalid
*/
int deletePowerMeter(in int powerMeterId);
};
}
#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::ERR_INVALID_PARAM
constant int ERR_INVALID_PARAM
Invalid parameters.
Definition PowerMeterController.idl:22
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::ERR_METER_BOARD_BUSY
constant int ERR_METER_BOARD_BUSY
A power meter with the given ID already exists.
Definition PowerMeterController.idl:23
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