def _init(self): if not self.DefaultPISystem: self.DefaultPISystem = AF.PISystem("TestingAF")
def __init__(self, name): self.Name = name self.Elements = [AF.AFElement("TestElement")]
def __init__(self): self.DefaultDatabase = AF.AFDatabase("TestDatabase")
import clr # Get the installation directory from the environment variable or fall back # to the Windows default installation path PIAF_SDK = os.getenv("PIHOME", "C:\\Program Files\\PIPC") PIAF_SDK += "\\AF\\PublicAssemblies\\4.0\\" if not os.path.isdir(PIAF_SDK): raise ImportError("PIAF SDK not found in %s, check installation" % PIAF_SDK) sys.path.append(PIAF_SDK) clr.AddReference("OSIsoft.AFSDK") # pylint: disable=no-member from OSIsoft import AF # pylint: wrong-import-position AF_SDK_VERSION = AF.PISystems().Version print("OSIsoft(r) AF SDK Version: {}".format(AF_SDK_VERSION)) except ImportError: import enum import warnings warnings.warn("Can't import the PI AF SDK, running in test mode", ImportWarning) AF_SDK_VERSION = "2.7_compatible" # pragma pylint: disable=invalid-name, unused-argument, too-few-public-methods class AF: """Mock class of the AF namespace""" class Data: """Mock class of the AF.Data namespace""" class AFBoundaryType(enum.IntEnum):