DSS C-API and dss.hpp
DSS C-API and dss.hpp expose a customized and extended implementation of OpenDSS to C and C++.
|
Public Member Functions | |
IDSS (dss::APIUtil *util, bool owns=false) | |
IDSS () | |
Expose DSS without a constructor parameters for backwards compatibility. More... | |
void | ClearAll () |
void | Reset () |
int32_t | SetActiveClass (const char *ClassName) |
int32_t | SetActiveClass (const string &ClassName) |
bool | Start (int32_t code) |
strings | Classes () |
List of DSS intrinsic classes (names of the classes) | |
string | DataPath () |
DSS Data File Path. More... | |
IDSS & | DataPath (const char *value) |
IDSS & | DataPath (const string &value) |
string | DefaultEditor () |
Returns the path name for the default text editor. | |
int32_t | NumCircuits () |
Number of Circuits currently defined. | |
int32_t | NumClasses () |
Number of DSS intrinsic classes. | |
int32_t | NumUserClasses () |
Number of user-defined classes. | |
strings | UserClasses () |
List of user-defined classes. | |
string | Version () |
Get version string for the DSS. | |
bool | AllowForms () |
Gets/sets whether text output is allowed. | |
IDSS & | AllowForms (bool value) |
bool | AllowEditor () |
Gets/sets whether running the external editor for "Show" is allowed. More... | |
IDSS & | AllowEditor (bool value) |
void | ShowPanel () |
ICircuit & | NewCircuit (const char *name) |
ICircuit & | NewCircuit (const string &name) |
bool | LegacyModels () |
If enabled, the legacy/deprecated models for PVSystem, InvControl, Storage and StorageControl are used. More... | |
IDSS & | LegacyModels (bool value) |
bool | AllowChangeDir () |
If disabled, the engine will not change the active working directory during execution. More... | |
IDSS & | AllowChangeDir (bool value) |
bool | AllowDOScmd () |
If enabled, the DOScmd command is allowed. More... | |
IDSS & | AllowDOScmd (bool value) |
bool | COMErrorResults () |
If enabled, in case of errors or empty arrays, the API returns arrays with values compatible with the official OpenDSS COM interface. More... | |
IDSS & | COMErrorResults (bool value) |
Public Member Functions inherited from dss::ContextState | |
ContextState (APIUtil *util) | |
Static Public Member Functions | |
static IDSS * | NewContext () |
Creates a new DSS engine context. More... | |
Public Attributes | |
ICircuit | ActiveCircuit |
ICircuit | Circuits |
IError | Error |
IText | Text |
IDSSProgress | DSSProgress |
IActiveClass | ActiveClass |
IDSS_Executive | Executive |
IParser | Parser |
IDSSimComs | DSSim_Coms |
IYMatrix | YMatrix |
IZIP | ZIP |
bool | owns_util |
Public Attributes inherited from dss::ContextState | |
void * | ctx |
Pointer to the DSSContext for easy access. | |
APIUtil * | api_util |
API utility functions. | |
|
inline |
Expose DSS without a constructor parameters for backwards compatibility.
This contructors always exposes the prime/default instance of OpenDSS.
|
inline |
If disabled, the engine will not change the active working directory during execution.
E.g. a "compile" command will not "chdir" to the file path.
If you have issues with long paths, enabling this might help in some scenarios.
Defaults to True (allow changes, backwards compatible) in the 0.10.x versions of DSS C-API. This might change to False in future versions.
This can also be set through the environment variable DSS_CAPI_ALLOW_CHANGE_DIR. Set it to 0 to disallow changing the active working directory.
(API Extension)
|
inline |
If enabled, the DOScmd
command is allowed.
Otherwise, an error is reported if the user tries to use it.
Defaults to False/0 (disabled state). Users should consider DOScmd deprecated on DSS Extensions.
This can also be set through the environment variable DSS_CAPI_ALLOW_DOSCMD. Setting it to 1 enables the command.
(API Extension)
|
inline |
Gets/sets whether running the external editor for "Show" is allowed.
AllowEditor controls whether the external editor is used in commands like "Show". If you set to 0 (false), the editor is not executed. Note that other side effects, such as the creation of files, are not affected.
(API Extension)
|
inline |
If enabled, in case of errors or empty arrays, the API returns arrays with values compatible with the official OpenDSS COM interface.
For example, consider the function Loads_Get_ZIPV
. If there is no active circuit or active load element:
Defaults to True/1 (enabled state) in the v0.12.x series. This will change to false in future series.
This can also be set through the environment variable DSS_CAPI_COM_DEFAULTS. Setting it to 0 disables the legacy/COM behavior. The value can be toggled through the API at any time.
(API Extension)
|
inline |
DSS Data File Path.
Default path for reports, etc. from DSS
|
inline |
If enabled, the legacy/deprecated models for PVSystem, InvControl, Storage and StorageControl are used.
In the official OpenDSS version 9.0, the old models where removed. They are temporarily present here but may be removed in the near future. If they are important to you, please open an issue on GitHub or contact the authors from DSS Extensions: https://github.com/dss-extensions/
After toggling LegacyModels, run a "clear" command and the models will be loaded accordingly. Defaults to False.
This can also be enabled by setting the environment variable DSS_CAPI_LEGACY_MODELS to 1.
NOTE: this option will be removed in a future release.
(API Extension)
|
inlinestatic |
Creates a new DSS engine context.
A DSS Context encapsulates most of the global state of the original OpenDSS engine, allowing the user to create multiple instances in the same process. By creating contexts manually, the management of threads and potential issues should be handled by the user.
(API Extension)