|
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()) |
0 commit comments