コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: LEDModern.cs プロジェクト: wiz/CorsairLinkPlusPlus
        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);
            }
        }
コード例 #3
0
 public override void SetCurve(ControlCurve<double, double> curve)
 {
     this.curve = curve;
 }
コード例 #4
0
ファイル: LED.cs プロジェクト: wiz/CorsairLinkPlusPlus
 internal abstract void SetControlCurve(ControlCurve <double, Color> colors);
コード例 #5
0
 public virtual void SetCurve(ControlCurve <double, double> curve)
 {
     throw new InvalidOperationException();
 }
コード例 #6
0
 public virtual void SetCurve(ControlCurve<double, double> curve)
 {
     throw new InvalidOperationException();
 }
コード例 #7
0
ファイル: FanPSU.cs プロジェクト: wiz/CorsairLinkPlusPlus
 internal override void SetControlCurve(ControlCurve <double, double> curve)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public virtual void AssignFrom(Sensor.LED led)
 {
     SetThermistor(((TemperatureControllableSensor)led).GetTemperatureSensor());
     curve = led.GetControlCurve();
 }
コード例 #9
0
 internal override void SetControlCurve(ControlCurve<double, double> curve)
 {
     throw new NotImplementedException();
 }
コード例 #10
0
 public virtual void AssignFrom(Sensor.LED led)
 {
     SetThermistor(((TemperatureControllableSensor)led).GetTemperatureSensor());
     curve = led.GetControlCurve();
 }
コード例 #11
0
 public CustomCurve(ControlCurve<double, Color> colors)
 {
     Value = colors;
 }
コード例 #12
0
ファイル: Fan.cs プロジェクト: wiz/CorsairLinkPlusPlus
 internal abstract void SetControlCurve(ControlCurve <double, double> curve);
コード例 #13
0
ファイル: Fan.cs プロジェクト: Doridian/CorsairLinkPlusPlus
 internal abstract void SetControlCurve(ControlCurve<double, double> curve);
コード例 #14
0
        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);
            }
        }
コード例 #15
0
 public override void SetCurve(ControlCurve <double, double> curve)
 {
     this.curve = curve;
 }
コード例 #16
0
ファイル: LED.cs プロジェクト: Doridian/CorsairLinkPlusPlus
 internal abstract void SetControlCurve(ControlCurve<double, Color> colors);
コード例 #17
0
 public CustomCurve(ControlCurve <double, Color> colors)
 {
     Value = colors;
 }
コード例 #18
0
        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);
            }
        }