internal override void SetControlCurve(ControlCurve <double, double> curve) { DisabledCheck(); List <CurvePoint <double, double> > points = curve.Points; if (points.Count != 5) { throw new ArgumentException(); } byte[] tempTable = new byte[10]; byte[] rpmTable = new byte[10]; for (int i = 0; i < 10; i += 2) { CurvePoint <double, double> point = points[i / 2]; Buffer.BlockCopy(BitConverter.GetBytes((short)(point.X * 256)), 0, tempTable, i, 2); Buffer.BlockCopy(BitConverter.GetBytes((short)point.Y), 0, rpmTable, i, 2); } using (var localMutexLock = CorsairRootDevice.usbGlobalMutex.GetLock()) { modernDevice.SetCurrentFan(id, true); modernDevice.WriteRegister(0x1A, tempTable, true); modernDevice.WriteRegister(0x19, rpmTable, true); } }
internal override void SetControlCurve(ControlCurve <double, Color> curve) { List <CurvePoint <double, Color> > points = curve.Points; if (points.Count != 3) { throw new ArgumentException(); } byte[] tempTable = new byte[6]; byte[] colorTable = new byte[9]; for (int i = 0; i < 3; i++) { CurvePoint <double, Color> point = points[i]; Buffer.BlockCopy(BitConverter.GetBytes((short)(point.X * 256)), 0, tempTable, i, 2); Buffer.BlockCopy(point.Y.ToArray(), 0, colorTable, i, 2); } using (var localMutexLock = CorsairRootDevice.usbGlobalMutex.GetLock()) { modernDevice.SetCurrentLED(id, true); modernDevice.WriteRegister(0x09, tempTable, true); modernDevice.WriteRegister(0x0A, colorTable, true); } }
public override void SetCurve(ControlCurve<double, double> curve) { this.curve = curve; }
internal abstract void SetControlCurve(ControlCurve <double, Color> colors);
public virtual void SetCurve(ControlCurve <double, double> curve) { throw new InvalidOperationException(); }
public virtual void SetCurve(ControlCurve<double, double> curve) { throw new InvalidOperationException(); }
internal override void SetControlCurve(ControlCurve <double, double> curve) { throw new NotImplementedException(); }
public virtual void AssignFrom(Sensor.LED led) { SetThermistor(((TemperatureControllableSensor)led).GetTemperatureSensor()); curve = led.GetControlCurve(); }
internal override void SetControlCurve(ControlCurve<double, double> curve) { throw new NotImplementedException(); }
public CustomCurve(ControlCurve<double, Color> colors) { Value = colors; }
internal abstract void SetControlCurve(ControlCurve <double, double> curve);
internal abstract void SetControlCurve(ControlCurve<double, double> curve);
internal override void SetControlCurve(ControlCurve<double, Color> curve) { List<CurvePoint<double, Color>> points = curve.Points; if (points.Count != 3) throw new ArgumentException(); byte[] tempTable = new byte[6]; byte[] colorTable = new byte[9]; for(int i = 0; i < 3; i++) { CurvePoint<double, Color> point = points[i]; Buffer.BlockCopy(BitConverter.GetBytes((short)(point.X * 256)), 0, tempTable, i, 2); Buffer.BlockCopy(point.Y.ToArray(), 0, colorTable, i, 2); } using(var localMutexLock = CorsairRootDevice.usbGlobalMutex.GetLock()) { modernDevice.SetCurrentLED(id, true); modernDevice.WriteRegister(0x09, tempTable, true); modernDevice.WriteRegister(0x0A, colorTable, true); } }
public override void SetCurve(ControlCurve <double, double> curve) { this.curve = curve; }
internal abstract void SetControlCurve(ControlCurve<double, Color> colors);
public CustomCurve(ControlCurve <double, Color> colors) { Value = colors; }
internal override void SetControlCurve(ControlCurve<double, double> curve) { DisabledCheck(); List<CurvePoint<double, double>> points = curve.Points; if (points.Count != 5) throw new ArgumentException(); byte[] tempTable = new byte[10]; byte[] rpmTable = new byte[10]; for (int i = 0; i < 10; i += 2) { CurvePoint<double, double> point = points[i / 2]; Buffer.BlockCopy(BitConverter.GetBytes((short)(point.X * 256)), 0, tempTable, i, 2); Buffer.BlockCopy(BitConverter.GetBytes((short)point.Y), 0, rpmTable, i, 2); } using(var localMutexLock = CorsairRootDevice.usbGlobalMutex.GetLock()) { modernDevice.SetCurrentFan(id, true); modernDevice.WriteRegister(0x1A, tempTable, true); modernDevice.WriteRegister(0x19, rpmTable, true); } }