Exemple #1
0
        private void checkBox_AMD_DisableAMDTempControl_CheckedChanged(object sender, EventArgs e)
        {
            if (!_isInitFinished)
            {
                return;
            }

            // indicate there has been a change
            IsChange = true;
            ConfigManager.GeneralConfig.DisableAMDTempControl = checkBox_AMD_DisableAMDTempControl.Checked;
            foreach (var cDev in ComputeDeviceManager.Avaliable.AllAvaliableDevices)
            {
                if (cDev.DeviceType == DeviceType.AMD)
                {
                    foreach (var algorithm in cDev.AlgorithmSettings)
                    {
                        if (algorithm.Key != AlgorithmType.DaggerHashimoto)
                        {
                            algorithm.Value.ExtraLaunchParameters += AmdGpuDevice.TemperatureParam;
                            algorithm.Value.ExtraLaunchParameters  = ExtraLaunchParametersParser.ParseForMiningPair(
                                new MiningPair(cDev, algorithm.Value), algorithm.Key, DeviceType.AMD, false);
                        }
                    }
                }
            }
        }
Exemple #2
0
        private void checkBox_DisableDefaultOptimizations_CheckedChanged(object sender, EventArgs e)
        {
            if (!_isInitFinished)
            {
                return;
            }

            // indicate there has been a change
            IsChange = true;
            ConfigManager.GeneralConfig.DisableDefaultOptimizations = checkBox_DisableDefaultOptimizations.Checked;
            if (ConfigManager.GeneralConfig.DisableDefaultOptimizations)
            {
                foreach (var cDev in ComputeDeviceManager.Avaliable.AllAvaliableDevices)
                {
                    foreach (var algorithm in cDev.AlgorithmSettings)
                    {
                        algorithm.Value.ExtraLaunchParameters = "";
                        if (cDev.DeviceType == DeviceType.AMD && algorithm.Key != AlgorithmType.DaggerHashimoto)
                        {
                            algorithm.Value.ExtraLaunchParameters += AmdGpuDevice.TemperatureParam;
                            algorithm.Value.ExtraLaunchParameters  = ExtraLaunchParametersParser.ParseForMiningPair(
                                new MiningPair(cDev, algorithm.Value), algorithm.Key, cDev.DeviceType, false);
                        }
                    }
                }
            }
            else
            {
                foreach (var cDev in ComputeDeviceManager.Avaliable.AllAvaliableDevices)
                {
                    if (cDev.DeviceType == DeviceType.CPU)
                    {
                        continue;                                    // cpu has no defaults
                    }
                    var deviceDefaultsAlgoSettings = GroupAlgorithms.CreateForDevice(cDev);
                    foreach (var defaultAlgoSettings in deviceDefaultsAlgoSettings)
                    {
                        var algorithmKey = defaultAlgoSettings.Key;
                        if (cDev.AlgorithmSettings.ContainsKey(algorithmKey))
                        {
                            var algorithm = cDev.AlgorithmSettings[algorithmKey];
                            algorithm.ExtraLaunchParameters = defaultAlgoSettings.Value.ExtraLaunchParameters;
                            algorithm.ExtraLaunchParameters = ExtraLaunchParametersParser.ParseForMiningPair(
                                new MiningPair(cDev, algorithm), algorithmKey, cDev.DeviceType, false);
                        }
                    }
                }
            }
        }
        private void checkBox_DisableDefaultOptimizations_CheckedChanged(object sender, EventArgs e)
        {
            if (!_isInitFinished)
            {
                return;
            }

            // indicate there has been a change
            IsChange = true;
            ConfigManager.GeneralConfig.DisableDefaultOptimizations = checkBox_DisableDefaultOptimizations.Checked;
            if (ConfigManager.GeneralConfig.DisableDefaultOptimizations)
            {
                foreach (var cDev in ComputeDeviceManager.Avaliable.AllAvaliableDevices)
                {
                    foreach (var algorithm in cDev.GetAlgorithmSettings())
                    {
                        algorithm.ExtraLaunchParameters = "";
                        if (cDev.DeviceType == DeviceType.AMD && algorithm.NiceHashID != AlgorithmType.DaggerHashimoto)
                        {
                            algorithm.ExtraLaunchParameters += AmdGpuDevice.TemperatureParam;
                            algorithm.ExtraLaunchParameters  = ExtraLaunchParametersParser.ParseForMiningPair(
                                new MiningPair(cDev, algorithm), algorithm.NiceHashID, cDev.DeviceType, false);
                        }
                    }
                }
            }
            else
            {
                foreach (var cDev in ComputeDeviceManager.Avaliable.AllAvaliableDevices)
                {
                    if (cDev.DeviceType == DeviceType.CPU)
                    {
                        continue;                                    // cpu has no defaults
                    }
                    var deviceDefaultsAlgoSettings = GroupAlgorithms.CreateForDeviceList(cDev);
                    foreach (var defaultAlgoSettings in deviceDefaultsAlgoSettings)
                    {
                        var toSetAlgo = cDev.GetAlgorithm(defaultAlgoSettings.MinerBaseType, defaultAlgoSettings.NiceHashID);
                        if (toSetAlgo != null)
                        {
                            toSetAlgo.ExtraLaunchParameters = defaultAlgoSettings.ExtraLaunchParameters;
                            toSetAlgo.ExtraLaunchParameters = ExtraLaunchParametersParser.ParseForMiningPair(
                                new MiningPair(cDev, toSetAlgo), toSetAlgo.NiceHashID, cDev.DeviceType, false);
                        }
                    }
                }
            }
        }