Skip to content

Commit 9b80a57

Browse files
committed
Fix recent changes and port them to the IR version.
1 parent be1bb4f commit 9b80a57

File tree

3 files changed

+84
-58
lines changed

3 files changed

+84
-58
lines changed

dss/dss_capi_gr/IPVSystems.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ def IrradianceNow(self):
191191
Returns the current irradiance value for the active PVSystem. Use it to
192192
know what's the current irradiance value for the PV during a simulation.
193193
'''
194-
self._lib.PVSystems_Get_IrradianceNow()
194+
return self._lib.PVSystems_Get_IrradianceNow()
195195

196196
@property
197197
def Pmpp(self):
198198
'''
199199
Gets/sets the rated max power of the PV array for 1.0 kW/sq-m irradiance
200200
and a user-selected array temperature of the active PVSystem.
201201
'''
202-
self._lib.PVSystems_Get_Pmpp()
202+
return self._lib.PVSystems_Get_Pmpp()
203203

204204
@Pmpp.setter
205205
def Pmpp(self, Value):

dss/dss_capi_ir/IActiveClass.py

Lines changed: 61 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,61 @@
1-
'''
2-
A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.
3-
4-
Copyright (c) 2016-2019 Paulo Meira
5-
'''
6-
from __future__ import absolute_import
7-
from .._cffi_api_util import Base
8-
9-
class IActiveClass(Base):
10-
__slots__ = []
11-
12-
@property
13-
def ActiveClassName(self):
14-
'''(read-only) Returns name of active class.'''
15-
return self._get_string(self._lib.ActiveClass_Get_ActiveClassName())
16-
17-
@property
18-
def AllNames(self):
19-
'''(read-only) Array of strings consisting of all element names in the active class.'''
20-
return self._get_string_array(self._lib.ActiveClass_Get_AllNames)
21-
22-
@property
23-
def Count(self):
24-
'''(read-only) Number of elements in Active Class. Same as NumElements Property.'''
25-
return self._lib.ActiveClass_Get_Count()
26-
27-
def __len__(self):
28-
return self._lib.ActiveClass_Get_Count()
29-
30-
@property
31-
def First(self):
32-
'''(read-only) Sets first element in the active class to be the active DSS object. If object is a CktElement, ActiveCktELment also points to this element. Returns 0 if none.'''
33-
return self._lib.ActiveClass_Get_First()
34-
35-
@property
36-
def Name(self):
37-
'''Name of the Active Element of the Active Class'''
38-
return self._get_string(self._lib.ActiveClass_Get_Name())
39-
40-
@Name.setter
41-
def Name(self, Value):
42-
if type(Value) is not bytes:
43-
Value = Value.encode(self._api_util.codec)
44-
45-
self._lib.ActiveClass_Set_Name(Value)
46-
self.CheckForError()
47-
48-
@property
49-
def Next(self):
50-
'''(read-only) Sets next element in active class to be the active DSS object. If object is a CktElement, ActiveCktElement also points to this element. Returns 0 if no more.'''
51-
return self._lib.ActiveClass_Get_Next()
52-
53-
@property
54-
def NumElements(self):
55-
'''(read-only) Number of elements in this class. Same as Count property.'''
56-
return self._lib.ActiveClass_Get_NumElements()
1+
'''
2+
A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.
3+
4+
Copyright (c) 2016-2019 Paulo Meira
5+
'''
6+
from __future__ import absolute_import
7+
from .._cffi_api_util import Base
8+
9+
class IActiveClass(Base):
10+
__slots__ = []
11+
12+
@property
13+
def ActiveClassName(self):
14+
'''(read-only) Returns name of active class.'''
15+
return self._get_string(self._lib.ActiveClass_Get_ActiveClassName())
16+
17+
@property
18+
def AllNames(self):
19+
'''(read-only) Array of strings consisting of all element names in the active class.'''
20+
return self._get_string_array(self._lib.ActiveClass_Get_AllNames)
21+
22+
@property
23+
def Count(self):
24+
'''(read-only) Number of elements in Active Class. Same as NumElements Property.'''
25+
return self._lib.ActiveClass_Get_Count()
26+
27+
def __len__(self):
28+
return self._lib.ActiveClass_Get_Count()
29+
30+
@property
31+
def First(self):
32+
'''(read-only) Sets first element in the active class to be the active DSS object. If object is a CktElement, ActiveCktELment also points to this element. Returns 0 if none.'''
33+
return self._lib.ActiveClass_Get_First()
34+
35+
@property
36+
def Name(self):
37+
'''Name of the Active Element of the Active Class'''
38+
return self._get_string(self._lib.ActiveClass_Get_Name())
39+
40+
@Name.setter
41+
def Name(self, Value):
42+
if type(Value) is not bytes:
43+
Value = Value.encode(self._api_util.codec)
44+
45+
self._lib.ActiveClass_Set_Name(Value)
46+
self.CheckForError()
47+
48+
@property
49+
def Next(self):
50+
'''(read-only) Sets next element in active class to be the active DSS object. If object is a CktElement, ActiveCktElement also points to this element. Returns 0 if no more.'''
51+
return self._lib.ActiveClass_Get_Next()
52+
53+
@property
54+
def NumElements(self):
55+
'''(read-only) Number of elements in this class. Same as Count property.'''
56+
return self._lib.ActiveClass_Get_NumElements()
57+
58+
@property
59+
def ActiveClassParent(self):
60+
'''Get the name of the parent class of the active class'''
61+
return self._get_string(self._lib.ActiveClass_Get_ActiveClassParent())

dss/dss_capi_ir/IPVSystems.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,24 @@ def Tyearly(self, Value):
183183

184184
self._lib.PVSystems_Set_Tyearly(Value)
185185
self.CheckForError()
186+
187+
@property
188+
def IrradianceNow(self):
189+
'''
190+
Returns the current irradiance value for the active PVSystem. Use it to
191+
know what's the current irradiance value for the PV during a simulation.
192+
'''
193+
return self._lib.PVSystems_Get_IrradianceNow()
194+
195+
@property
196+
def Pmpp(self):
197+
'''
198+
Gets/sets the rated max power of the PV array for 1.0 kW/sq-m irradiance
199+
and a user-selected array temperature of the active PVSystem.
200+
'''
201+
return self._lib.PVSystems_Get_Pmpp()
202+
203+
@Pmpp.setter
204+
def Pmpp(self, Value):
205+
self._lib.PVSystems_Set_Pmpp(Value)
206+
self.CheckForError()

0 commit comments

Comments
 (0)