11"""Mirror of the OSISoft.AF.Asset namespace."""
22
33import dataclasses
4- from typing import Generic , Self , TypeVar , overload
4+ from typing import Generic , Self , TypeVar
55
66import pandas as pd # type: ignore
77
1010
1111__all__ = [
1212 "AFDataReference" ,
13+ "AFElement" ,
14+ "AFElementList" ,
1315 "AFAttribute" ,
1416 "AFAttributeList" ,
1517]
1618
17- T = TypeVar ("T" )
1819ElementType = TypeVar ("ElementType" , bound = dotnet .AF .Asset .AFBaseElement )
1920
2021
@@ -41,54 +42,6 @@ def pi_point(self) -> PI.PIPoint | None:
4142 return PI .PIPoint (self .data_reference .PIPoint )
4243
4344
44- class AFEnumerationValue :
45- """Representation of an AF enumeration value."""
46-
47- def __init__ (self , value : dotnet .AF .Asset .AFEnumerationValue ) -> None :
48- self ._value = value
49-
50- def __str__ (self ) -> str :
51- """Return the string representation of the enumeration value."""
52- return self ._value .Name
53-
54- def __int__ (self ) -> int :
55- """Return the integer representation of the enumeration value."""
56- return self ._value .Value
57-
58- def __repr__ (self ):
59- """Return the string representation of the enumeration value."""
60- return f"{ self .__class__ .__qualname__ } ({ self ._value .Name } )"
61-
62- @property
63- def name (self ) -> str :
64- """Return the name of the enumeration value."""
65- return self ._value .Name
66-
67- @property
68- def value (self ) -> int :
69- """Return the integer value of the enumeration value."""
70- return self ._value .Value
71-
72- @overload
73- @staticmethod
74- def wrap_enumeration_value (
75- value : dotnet .AF .Asset .AFEnumerationValue ,
76- ) -> "AFEnumerationValue" : ...
77- @overload
78- @staticmethod
79- def wrap_enumeration_value (
80- value : T ,
81- ) -> T : ...
82- @staticmethod
83- def wrap_enumeration_value (
84- value : T | dotnet .AF .Asset .AFEnumerationValue ,
85- ) -> "T | AFEnumerationValue" :
86- """Wrap the value in an AFEnumerationValue if it is an enumeration value."""
87- if isinstance (value , dotnet .lib .AF .Asset .AFEnumerationValue ):
88- return AFEnumerationValue (value )
89- return value
90-
91-
9245class AFAttribute (Data .DataContainer ):
9346 """Representation of an AF attribute."""
9447
@@ -158,7 +111,7 @@ def _normalize_filter_expression(self, filter_expression: str) -> str:
158111
159112 def _current_value (self ) -> object :
160113 """Return the current value of the attribute."""
161- return AFEnumerationValue . wrap_enumeration_value ( self .attribute .GetValue ().Value )
114+ return self .attribute .GetValue ().Value
162115
163116 def _filtered_summaries (
164117 self ,
0 commit comments