File tree Expand file tree Collapse file tree 4 files changed +119
-2
lines changed Expand file tree Collapse file tree 4 files changed +119
-2
lines changed Original file line number Diff line number Diff line change 45
45
from .IReactors import IReactors
46
46
from .IParallel import IParallel
47
47
from .IReduceCkt import IReduceCkt
48
+ from .IStorages import IStorages
48
49
49
50
class ICircuit (Base ):
50
51
__slots__ = [
@@ -89,7 +90,8 @@ class ICircuit(Base):
89
90
'TSData' ,
90
91
'Reactors' ,
91
92
'Parallel' ,
92
- 'ReduceCkt'
93
+ 'ReduceCkt' ,
94
+ 'Storages'
93
95
]
94
96
95
97
_columns = [
@@ -162,6 +164,7 @@ def __init__(self, api_util):
162
164
self .TSData = ITSData (api_util )
163
165
self .Reactors = IReactors (api_util )
164
166
self .ReduceCkt = IReduceCkt (api_util ) #: Circuit Reduction Interface
167
+ self .Storages = IStorages (api_util )
165
168
166
169
if hasattr (api_util .lib , 'Parallel_CreateActor' ):
167
170
self .Parallel = IParallel (api_util )
Original file line number Diff line number Diff line change
1
+ '''
2
+ A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.
3
+
4
+ Copyright (c) 2022 Paulo Meira
5
+ Copyright (c) 2022 DSS Extensions contributors
6
+ '''
7
+ from .._cffi_api_util import Iterable
8
+
9
+ class IStorages (Iterable ):
10
+ '''Storage objects'''
11
+
12
+ __slots__ = []
13
+
14
+ _columns = [
15
+ 'Name' ,
16
+ 'idx' ,
17
+ 'RegisterNames' ,
18
+ 'RegisterValues' ,
19
+ 'puSOC' ,
20
+ 'State' ,
21
+ ]
22
+
23
+
24
+ @property
25
+ def puSOC (self ):
26
+ '''Per unit state of charge'''
27
+ return self .CheckForError (self ._lib .Storages_Get_puSOC ())
28
+
29
+ @puSOC .setter
30
+ def puSOC (self , Value ):
31
+ self .CheckForError (self ._lib .Storages_Set_puSOC (Value ))
32
+
33
+ @property
34
+ def State (self ):
35
+ '''
36
+ Get/set state: 0=Idling; 1=Discharging; -1=Charging;
37
+
38
+ Related enumeration: StorageStates
39
+ '''
40
+ return self .CheckForError (self ._lib .Storages_Get_State ())
41
+
42
+ @State .setter
43
+ def State (self , Value ):
44
+ self .CheckForError (self ._lib .Storages_Set_State (Value ))
45
+
46
+ @property
47
+ def RegisterNames (self ):
48
+ '''Array of Names of all Storage energy meter registers'''
49
+ return self .CheckForError (self ._get_string_array (self ._lib .Storages_Get_RegisterNames ))
50
+
51
+ @property
52
+ def RegisterValues (self ):
53
+ '''Array of values in Storage registers.'''
54
+ self .CheckForError (self ._lib .Storages_Get_RegisterValues_GR ())
55
+ return self ._get_float64_gr_array ()
56
+
Original file line number Diff line number Diff line change 45
45
from .IReactors import IReactors
46
46
from .IParallel import IParallel
47
47
from .IReduceCkt import IReduceCkt
48
+ from .IStorages import IStorages
48
49
49
50
class ICircuit (Base ):
50
51
__slots__ = [
@@ -89,7 +90,8 @@ class ICircuit(Base):
89
90
'TSData' ,
90
91
'Reactors' ,
91
92
'Parallel' ,
92
- 'ReduceCkt'
93
+ 'ReduceCkt' ,
94
+ 'Storages'
93
95
]
94
96
95
97
_columns = [
@@ -162,6 +164,7 @@ def __init__(self, api_util):
162
164
self .TSData = ITSData (api_util )
163
165
self .Reactors = IReactors (api_util )
164
166
self .ReduceCkt = IReduceCkt (api_util ) #: Circuit Reduction Interface
167
+ self .Storages = IStorages (api_util )
165
168
166
169
if hasattr (api_util .lib , 'Parallel_CreateActor' ):
167
170
self .Parallel = IParallel (api_util )
Original file line number Diff line number Diff line change
1
+ '''
2
+ A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.
3
+
4
+ Copyright (c) 2022 Paulo Meira
5
+ Copyright (c) 2022 DSS Extensions contributors
6
+ '''
7
+ from .._cffi_api_util import Iterable
8
+
9
+ class IStorages (Iterable ):
10
+ '''Storage objects'''
11
+
12
+ __slots__ = []
13
+
14
+ _columns = [
15
+ 'Name' ,
16
+ 'idx' ,
17
+ 'RegisterNames' ,
18
+ 'RegisterValues' ,
19
+ 'puSOC' ,
20
+ 'State' ,
21
+ ]
22
+
23
+
24
+ @property
25
+ def puSOC (self ):
26
+ '''Per unit state of charge'''
27
+ return self .CheckForError (self ._lib .Storages_Get_puSOC ())
28
+
29
+ @puSOC .setter
30
+ def puSOC (self , Value ):
31
+ self .CheckForError (self ._lib .Storages_Set_puSOC (Value ))
32
+
33
+ @property
34
+ def State (self ):
35
+ '''
36
+ Get/set state: 0=Idling; 1=Discharging; -1=Charging;
37
+
38
+ Related enumeration: StorageStates
39
+ '''
40
+ return self .CheckForError (self ._lib .Storages_Get_State ())
41
+
42
+ @State .setter
43
+ def State (self , Value ):
44
+ self .CheckForError (self ._lib .Storages_Set_State (Value ))
45
+
46
+ @property
47
+ def RegisterNames (self ):
48
+ '''Array of Names of all Storage energy meter registers'''
49
+ return self .CheckForError (self ._get_string_array (self ._lib .Storages_Get_RegisterNames ))
50
+
51
+ @property
52
+ def RegisterValues (self ):
53
+ '''Array of values in Storage registers.'''
54
+ return self ._get_float64_array (self ._lib .Storages_Get_RegisterValues )
55
+
You can’t perform that action at this time.
0 commit comments