public ModelElement DoVerify(ModelElement element, AceModelRestricted model) { // For interface that are not PnP and can come and go, verify that they are still present. // (e.g. RemoteGPIB, etc.) // In most cases, nothing will need to be done to verify an interface. // Return a copy of the input element. // The following values need to be set in the returned element: // Verified = true means it has been through this method // Failed = true / false if (element == null) { return(null); } var elementCopy = element.MakeCopy(); IConfigDll hwconfig = _container.Resolve <IConfigDll>(AgentName); hwconfig.VerifyElement(elementCopy); var parent = model.FindEquivalentElement(elementCopy.Parent); if (parent != null) { elementCopy.Parent = parent; elementCopy.ParentId = parent.PersistentId; } return(elementCopy); }
public static IEnumerable <ModelInterfaceSample> GetUnconfigedSampleInterfaces(this AceModelRestricted model, IConfigDll hwconfig) { var unconfigured = Enumerable.Empty <ModelInterfaceSample>(); if ((hwconfig != null) && (model != null)) { hwconfig.InitializeDll(); //ModelElement[] configuredInterfaceElements = model.GetInterfacesOfVisaType(this.VisaIntfTypeString); // EOS: unused, removed. var availableInterfaces = hwconfig.GetAvailableInterfaces().Where(i => i is ModelInterfaceSample).Select(i => i as ModelInterfaceSample); // TCPIP only configures 1 interface by default, but this pattern supports any number unconfigured = (from i in availableInterfaces where model.FindEquivalentElement(i) == null select i); hwconfig.UninitializeDll(); } return(unconfigured); }
public ModelElement DoVerify(ModelElement element, AceModelRestricted model) { // For interface that are not PnP and can come and go, verify that they are still present. // (e.g. RemoteGPIB, etc.) // In most cases, nothing will need to be done to verify an interface. // Return a copy of the input element. // The following values need to be set in the returned element: // Verified = true means it has been through this method // Failed = true / false if (element == null) return null; var elementCopy = element.MakeCopy(); IConfigDll hwconfig = _container.Resolve<IConfigDll>(AgentName); hwconfig.VerifyElement(elementCopy); var parent = model.FindEquivalentElement(elementCopy.Parent); if (parent != null) { elementCopy.Parent = parent; elementCopy.ParentId = parent.PersistentId; } return elementCopy; }