Beispiel #1
0
        public bool start(uint index, USBProductID productID)
        {
            Monitor.Enter(mLock);

            if (index == 0)
            {
                mFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + "Kraken.json";
            }
            else
            {
                mFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + string.Format("Kraken{0}.json", index + 1);
            }

            mPumpSpeed      = 50;
            mFanPercent     = 25;
            mLastPumpSpeed  = 0;
            mLastFanPercent = 0;

            mPumpLastSendTime = 0;
            mFanLastSendTime  = 0;

            mUSBController = new HidUSBController(USBVendorID.NZXT, productID);
            mUSBController.onRecvHandler += onRecv;
            if (mUSBController.start(index) == false)
            {
                Monitor.Exit(mLock);
                this.stop();
                return(false);
            }

            if (this.readFile() == true)
            {
                mIsSendCustomData = (mCustomDataList.Count > 0);
            }

            mTimer.Interval = 1000;
            mTimer.Elapsed += onTimer;
            mTimer.Start();
            Monitor.Exit(mLock);
            return(true);
        }
Beispiel #2
0
        public bool start(uint index)
        {
            Monitor.Enter(mLock);

            if (index == 0)
            {
                mFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + "RGBnFC.json";
            }
            else
            {
                mFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + string.Format("RGBnFC{0}.json", index + 1);
            }

            mUSBController = new HidUSBController(USBVendorID.NZXT, USBProductID.RGBAndFanController);
            mUSBController.onRecvHandler += onRecv;
            if (mUSBController.start(index) == false)
            {
                Monitor.Exit(mLock);
                this.stop();
                return(false);
            }

            if (this.readFile() == true)
            {
                mIsSendCustomData = (mCustomDataList.Count > 0);
            }

            // initialize
            this.initialize();

            mTimer.Interval = 1000;
            mTimer.Elapsed += onTimer;
            mTimer.Start();

            Monitor.Exit(mLock);
            return(true);
        }