public override List<HeliosInterface> GetInterfaceInstances(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { List<HeliosInterface> cardInterfaces = new List<HeliosInterface>(); foreach (String serialNumber in DTSCard.CardSerialNumbers) { // TODO Check to see if card already in profile. cardInterfaces.Add(new DTSCardInterface(serialNumber)); } return cardInterfaces; }
public override List <HeliosInterface> GetInterfaceInstances(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { List <HeliosInterface> cardInterfaces = new List <HeliosInterface>(); foreach (String serialNumber in DTSCard.CardSerialNumbers) { // TODO Check to see if card already in profile. cardInterfaces.Add(new DTSCardInterface(serialNumber)); } return(cardInterfaces); }
public override List <HeliosInterface> GetInterfaceInstances(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { List <HeliosInterface> interfaces = new List <HeliosInterface>(); foreach (DirectXControllerGuid guid in GetAvailableControllers(profile)) { DirectXControllerInterface newInterface = new DirectXControllerInterface(); newInterface.ControllerId = guid; interfaces.Add(newInterface); } return(interfaces); }
public override List<HeliosInterface> GetInterfaceInstances(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { List<HeliosInterface> interfaces = new List<HeliosInterface>(); foreach (DirectXControllerGuid guid in GetAvailableControllers(profile)) { DirectXControllerInterface newInterface = new DirectXControllerInterface(); newInterface.ControllerId = guid; interfaces.Add(newInterface); } return interfaces; }
public override List <HeliosInterface> GetInterfaceInstances(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { HashSet <int> serialNumbers = new HashSet <int>(); List <HeliosInterface> interfaces = new List <HeliosInterface>(); foreach (HeliosInterface currentInterface in profile.Interfaces) { PhidgetInterface phidgetInterface = currentInterface as PhidgetInterface; if (phidgetInterface != null) { serialNumbers.Add(phidgetInterface.SerialNumber); } } foreach (Phidget phidget in PhidgetManager.Devices) { if (!serialNumbers.Contains(phidget.SerialNumber)) { switch (phidget.Type) { case "PhidgetStepper": if (descriptor.TypeIdentifier.Equals("Helios.Phidgets.UnipolarStepperBoard")) { interfaces.Add(new PhidgetStepperBoard(phidget.SerialNumber)); } break; case "PhidgetLED": if (descriptor.TypeIdentifier.Equals("Helios.Phidgets.LedBoard")) { interfaces.Add(new PhidgetLEDBoard(phidget.SerialNumber)); } break; case "PhidgetAdvancedServo": case "PhidgetServo": if (descriptor.TypeIdentifier.Equals("Helios.Phidgets.AdvancedServoBoard")) { interfaces.Add(new PhidgetsServoBoard(phidget.SerialNumber)); } break; default: break; } ConfigManager.LogManager.LogInfo("Found phidget Type = " + phidget.Type + " Serail Number = " + phidget.SerialNumber.ToString()); } } return(interfaces); }
private bool IsUnique(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { foreach (HeliosInterface heliosInterface in profile.Interfaces) { HeliosInterfaceDescriptor interfaceDescriptor = ConfigManager.ModuleManager.InterfaceDescriptors[heliosInterface.GetType()]; if (interfaceDescriptor.TypeIdentifier.Equals(descriptor.TypeIdentifier)) { // If any existing interfaces in the profile have the same type identifier do not add them. return(false); } } return(true); }
public override List<HeliosInterface> GetInterfaceInstances(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { HashSet<int> serialNumbers = new HashSet<int>(); List<HeliosInterface> interfaces = new List<HeliosInterface>(); foreach (HeliosInterface currentInterface in profile.Interfaces) { PhidgetInterface phidgetInterface = currentInterface as PhidgetInterface; if (phidgetInterface != null) { serialNumbers.Add(phidgetInterface.SerialNumber); } } foreach (Phidget phidget in PhidgetManager.Devices) { if (!serialNumbers.Contains(phidget.SerialNumber)) { switch (phidget.Type) { case "PhidgetStepper": if (descriptor.TypeIdentifier.Equals("Helios.Phidgets.UnipolarStepperBoard")) { interfaces.Add(new PhidgetStepperBoard(phidget.SerialNumber)); } break; case "PhidgetLED": if (descriptor.TypeIdentifier.Equals("Helios.Phidgets.LedBoard")) { interfaces.Add(new PhidgetLEDBoard(phidget.SerialNumber)); } break; case "PhidgetAdvancedServo": case "PhidgetServo": if (descriptor.TypeIdentifier.Equals("Helios.Phidgets.AdvancedServoBoard")) { interfaces.Add(new PhidgetsServoBoard(phidget.SerialNumber)); } break; default: break; } ConfigManager.LogManager.LogInfo("Found phidget Type = " + phidget.Type + " Serail Number = " + phidget.SerialNumber.ToString()); } } return interfaces; }
private InterfaceStatus(HeliosInterface heliosInterface) { Interface = heliosInterface; ReadyCheck = heliosInterface as IReadyCheck; Name = $"{heliosInterface.Name}"; if (heliosInterface is IExtendedDescription extendedInfo) { Description = extendedInfo.Description; } else { Description = Name; } HeliosInterfaceDescriptor descriptor = ConfigManager.ModuleManager.InterfaceDescriptors[heliosInterface.TypeIdentifier]; HasEditor = descriptor.InterfaceEditorType != null; Subscription = heliosInterface as IStatusReportNotify; Subscription?.Subscribe(this); }
private bool IsUnique(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { foreach (HeliosInterface heliosInterface in profile.Interfaces) { HeliosInterfaceDescriptor interfaceDescriptor = ConfigManager.ModuleManager.InterfaceDescriptors[heliosInterface.GetType()]; if (interfaceDescriptor.TypeIdentifier.Equals(descriptor.TypeIdentifier)) { // If any existing interfaces in the profile have the same type identifier do not add them. return false; } } return true; }
public override List <HeliosInterface> GetAutoAddInterfaces(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { return(new List <HeliosInterface>()); }
public override List <HeliosInterface> GetInterfaceInstances(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) => new List <HeliosInterface>();
public override List<HeliosInterface> GetAutoAddInterfaces(HeliosInterfaceDescriptor descriptor, HeliosProfile profile) { return new List<HeliosInterface>(); }