DSS C-API and dss.hpp
DSS C-API and dss.hpp expose a customized and extended implementation of OpenDSS to C and C++.
dss::classic::IDSS Class Reference
Inheritance diagram for dss::classic::IDSS:
[legend]
Collaboration diagram for dss::classic::IDSS:
[legend]

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...
 
IDSSDataPath (const char *value)
 
IDSSDataPath (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.
 
IDSSAllowForms (bool value)
 
bool AllowEditor ()
 Gets/sets whether running the external editor for "Show" is allowed. More...
 
IDSSAllowEditor (bool value)
 
void ShowPanel ()
 
ICircuitNewCircuit (const char *name)
 
ICircuitNewCircuit (const string &name)
 
bool LegacyModels ()
 If enabled, the legacy/deprecated models for PVSystem, InvControl, Storage and StorageControl are used. More...
 
IDSSLegacyModels (bool value)
 
bool AllowChangeDir ()
 If disabled, the engine will not change the active working directory during execution. More...
 
IDSSAllowChangeDir (bool value)
 
bool AllowDOScmd ()
 If enabled, the DOScmd command is allowed. More...
 
IDSSAllowDOScmd (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...
 
IDSSCOMErrorResults (bool value)
 
- Public Member Functions inherited from dss::ContextState
 ContextState (APIUtil *util)
 

Static Public Member Functions

static IDSSNewContext ()
 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.
 
APIUtilapi_util
 API utility functions.
 

Constructor & Destructor Documentation

◆ IDSS()

dss::classic::IDSS::IDSS ( )
inline

Expose DSS without a constructor parameters for backwards compatibility.

This contructors always exposes the prime/default instance of OpenDSS.

Member Function Documentation

◆ AllowChangeDir()

bool dss::classic::IDSS::AllowChangeDir ( )
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)

◆ AllowDOScmd()

bool dss::classic::IDSS::AllowDOScmd ( )
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)

◆ AllowEditor()

bool dss::classic::IDSS::AllowEditor ( )
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)

◆ COMErrorResults()

bool dss::classic::IDSS::COMErrorResults ( )
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:

  • In the disabled state (COMErrorResults=False), the function will return "[]", an array with 0 elements.
  • In the enabled state (COMErrorResults=True), the function will return "[0.0]" instead. This should be compatible with the return value of the official COM interface.

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)

◆ DataPath()

string dss::classic::IDSS::DataPath ( )
inline

DSS Data File Path.

Default path for reports, etc. from DSS

◆ LegacyModels()

bool dss::classic::IDSS::LegacyModels ( )
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)

◆ NewContext()

static IDSS * dss::classic::IDSS::NewContext ( )
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)


The documentation for this class was generated from the following file: