private void SensorAdded(ISensor sensor) { if (softwareCurve != null) { return; } if (sensor.Identifier.ToString() == sensorIdentifier) { List <ISoftwareCurvePoint> points; if (!SoftwareCurve.TryParse(settings.GetValue( new Identifier(identifier, "curveValue").ToString(), ""), out points)) { return; } this.softwareCurve = new SoftwareCurve(points, sensor); Debug.WriteLine("hardware added software curve created"); if (mode == ControlMode.SoftwareCurve) { AttachSoftwareCurve(softwareCurve); } } }
public void NotifyHardwareAdded(List <IGroup> allhardware) { if (nonSoftwareCurve || softwareCurve != null) { return; } if (sensorIdentifier == null) { if (!SoftwareCurve.TryParse(settings.GetValue( new Identifier(identifier, "curveValue").ToString(), ""), out sensorIdentifier)) { nonSoftwareCurve = true; return; } } foreach (var group in allhardware) { foreach (var hardware in group.Hardware) { HardwareAdded(hardware); } } }