DSS C-API and dss.hpp
DSS C-API and dss.hpp expose a customized and extended implementation of OpenDSS to C and C++.
|
Classes | |
struct | Properties |
Public Types | |
enum class | MonitorAction : int32_t { Clear = 0 , Save = 1 , Take = 2 , Process = 3 , Reset = 0 } |
Monitor: Action (DSS enumeration for Monitor) More... | |
Public Member Functions | |
Monitor (APIUtil *util=nullptr, void *ptr_=nullptr) | |
Create wrapper directly by a given object handle/pointer. | |
Monitor (APIUtil *util, int32_t idx) | |
Create a wrapper for an element given by the integer index "idx". | |
Monitor (APIUtil *util, char *name) | |
Create a wrapper for an element given its name. | |
const char * | name () |
Returns the object's name. | |
Monitor & | begin_edit () |
Marks an object for edition. More... | |
Monitor & | end_edit (int32_t num_edits=1) |
Finalizes an object edition. More... | |
string | element () |
Name (Full Object name) of element to which the monitor is connected. More... | |
Monitor & | element (const string &value) |
Monitor & | element (dss::obj::DSSObj &value) |
dss::obj::DSSObj | element_obj () |
Name (Full Object name) of element to which the monitor is connected. More... | |
Monitor & | element_obj (dss::obj::DSSObj &value) |
int32_t | terminal () |
Number of the terminal of the circuit element to which the monitor is connected. More... | |
Monitor & | terminal (int32_t value) |
int32_t | mode () |
Bitmask integer designating the values the monitor is to capture: 0 = Voltages and currents at designated terminal 1 = Powers at designated terminal 2 = Tap Position (Transformer Device only) 3 = State Variables (PCElements only) 4 = Flicker level and severity index (Pst) for voltages. More... | |
Monitor & | mode (int32_t value) |
Monitor & | action (int32_t value) |
{Clear | Save | Take | Process} (C)lears or (S)aves current buffer. More... | |
Monitor & | action (MonitorAction value) |
{Clear | Save | Take | Process} (C)lears or (S)aves current buffer. More... | |
Monitor & | action (const string &value) |
{Clear | Save | Take | Process} (C)lears or (S)aves current buffer. More... | |
Monitor & | action (const char *value) |
{Clear | Save | Take | Process} (C)lears or (S)aves current buffer. More... | |
bool | residual () |
{Yes/True | No/False} Default = No. More... | |
Monitor & | residual (bool value) |
bool | VIPolar () |
{Yes/True | No/False} Default = YES. More... | |
Monitor & | VIPolar (bool value) |
bool | PPolar () |
{Yes/True | No/False} Default = YES. More... | |
Monitor & | PPolar (bool value) |
double | basefreq () |
Base Frequency for ratings. More... | |
Monitor & | basefreq (double value) |
bool | enabled () |
{Yes|No or True|False} Indicates whether this element is enabled. More... | |
Monitor & | enabled (bool value) |
Monitor & | like (const string &value) |
Make like another object, e.g. More... | |
Monitor & | like (const char *value) |
Make like another object, e.g. More... | |
Public Member Functions inherited from dss::obj::DSSObj | |
DSSObj (APIUtil *util=nullptr, void *ptr_=nullptr) | |
Static Public Attributes | |
static const char | dss_cls_name [] = "Monitor" |
static const int32_t | dss_cls_idx = 46 |
Additional Inherited Members | |
Public Attributes inherited from dss::obj::DSSObj | |
APIUtil * | api_util |
void * | ptr |
Protected Member Functions inherited from dss::obj::DSSObj | |
void | check_for_error () |
void | set_string (int32_t index, const string &value) |
void | set_string (int32_t index, const char *value) |
string | get_prop_string (int32_t index) |
complex | get_complex (int32_t index) |
void | set_complex (int32_t index, complex value) |
void | set_string_array (int32_t index, strings &value) |
void | set_obj (int32_t index, DSSObj &value) |
template<typename T > | |
T | get_obj (int32_t index) |
template<typename T = VectorXd> | |
T | get_array (int32_t index) |
template<typename T = VectorXd> | |
void | set_array (int32_t index, T value) |
Static Protected Member Functions inherited from dss::obj::DSSObj | |
template<typename T = VectorXd> | |
static void | set_array (void *ptr, int32_t index, T value) |
Protected Attributes inherited from dss::obj::DSSObj | |
friend | DSSBatch |
|
strong |
|
inline |
{Clear | Save | Take | Process} (C)lears or (S)aves current buffer.
(T)ake action takes a sample. (P)rocesses the data taken so far (e.g. Pst for mode 4).
Note that monitors are automatically reset (cleared) when the Set Mode= command is issued. Otherwise, the user must explicitly reset all monitors (reset monitors command) or individual monitors with the Clear action.
DSS property name: action, DSS property index: 4
|
inline |
{Clear | Save | Take | Process} (C)lears or (S)aves current buffer.
(T)ake action takes a sample. (P)rocesses the data taken so far (e.g. Pst for mode 4).
Note that monitors are automatically reset (cleared) when the Set Mode= command is issued. Otherwise, the user must explicitly reset all monitors (reset monitors command) or individual monitors with the Clear action.
DSS property name: action, DSS property index: 4
|
inline |
{Clear | Save | Take | Process} (C)lears or (S)aves current buffer.
(T)ake action takes a sample. (P)rocesses the data taken so far (e.g. Pst for mode 4).
Note that monitors are automatically reset (cleared) when the Set Mode= command is issued. Otherwise, the user must explicitly reset all monitors (reset monitors command) or individual monitors with the Clear action.
DSS property name: action, DSS property index: 4
|
inline |
{Clear | Save | Take | Process} (C)lears or (S)aves current buffer.
(T)ake action takes a sample. (P)rocesses the data taken so far (e.g. Pst for mode 4).
Note that monitors are automatically reset (cleared) when the Set Mode= command is issued. Otherwise, the user must explicitly reset all monitors (reset monitors command) or individual monitors with the Clear action.
DSS property name: action, DSS property index: 4
|
inline |
Base Frequency for ratings.
DSS property name: basefreq, DSS property index: 8
|
inline |
Marks an object for edition.
Until end_edit
is called, some actions are postponed.
|
inline |
Name (Full Object name) of element to which the monitor is connected.
DSS property name: element, DSS property index: 1
|
inline |
Name (Full Object name) of element to which the monitor is connected.
DSS property name: element, DSS property index: 1
|
inline |
{Yes|No or True|False} Indicates whether this element is enabled.
DSS property name: enabled, DSS property index: 9
|
inline |
Finalizes an object edition.
This will result more compelx side-effects like Yprim and other internal data recalculation, for example.
|
inline |
Make like another object, e.g.
:
New Capacitor.C2 like=c1 ...
DSS property name: like, DSS property index: 10
|
inline |
Make like another object, e.g.
:
New Capacitor.C2 like=c1 ...
DSS property name: like, DSS property index: 10
|
inline |
Bitmask integer designating the values the monitor is to capture: 0 = Voltages and currents at designated terminal 1 = Powers at designated terminal 2 = Tap Position (Transformer Device only) 3 = State Variables (PCElements only) 4 = Flicker level and severity index (Pst) for voltages.
No adders apply. Flicker level at simulation time step, Pst at 10-minute time step. 5 = Solution variables (Iterations, etc). Normally, these would be actual phasor quantities from solution. 6 = Capacitor Switching (Capacitors only) 7 = Storage state vars (Storage device only) 8 = All winding currents (Transformer device only) 9 = Losses, watts and var (of monitored device) 10 = All Winding voltages (Transformer device only) Normally, these would be actual phasor quantities from solution. 11 = All terminal node voltages and line currents of monitored device 12 = All terminal node voltages LL and line currents of monitored device Combine mode with adders below to achieve other results for terminal quantities: +16 = Sequence quantities +32 = Magnitude only +64 = Positive sequence only or avg of all phases
Mix adder to obtain desired results. For example: Mode=112 will save positive sequence voltage and current magnitudes only Mode=48 will save all sequence voltages and currents, but magnitude only.
DSS property name: mode, DSS property index: 3
|
inline |
{Yes/True | No/False} Default = YES.
Report power in Apparent power, S, in polar form (Mag/Angle).(default) Otherwise, is P and Q
DSS property name: PPolar, DSS property index: 7
|
inline |
{Yes/True | No/False} Default = No.
Include Residual cbannel (sum of all phases) for voltage and current. Does not apply to sequence quantity modes or power modes.
DSS property name: residual, DSS property index: 5
|
inline |
Number of the terminal of the circuit element to which the monitor is connected.
1 or 2, typically. For monitoring states, attach monitor to terminal 1.
DSS property name: terminal, DSS property index: 2
|
inline |
{Yes/True | No/False} Default = YES.
Report voltage and current in polar form (Mag/Angle). (default) Otherwise, it will be real and imaginary.
DSS property name: VIPolar, DSS property index: 6