public void SetAlgorithmDeviceConfig(DeviceBenchmarkConfig config) { if (config != null && config.DeviceUUID == UUID && config.AlgorithmSettings != null) { foreach (var algoSetting in config.AlgorithmSettings) { AlgorithmType key = algoSetting.Key; AlgorithmConfig conf = algoSetting.Value; if (this.AlgorithmSettings.ContainsKey(key)) { this.AlgorithmSettings[key].BenchmarkSpeed = conf.BenchmarkSpeed; this.AlgorithmSettings[key].ExtraLaunchParameters = conf.ExtraLaunchParameters; this.AlgorithmSettings[key].Skip = conf.Skip; this.AlgorithmSettings[key].LessThreads = conf.LessThreads; } } } }
public DeviceBenchmarkConfig GetAlgorithmDeviceConfig() { DeviceBenchmarkConfig ret = new DeviceBenchmarkConfig(); ret.DeviceName = this.Name; ret.DeviceUUID = this.UUID; // init algo settings foreach (var algo in this.AlgorithmSettings.Values) { AlgorithmType key = algo.NiceHashID; // create/setup AlgorithmConfig conf = new AlgorithmConfig(); conf.NiceHashID = key; conf.MinerName = algo.MinerName; // TODO probably not needed conf.BenchmarkSpeed = algo.BenchmarkSpeed; conf.ExtraLaunchParameters = algo.ExtraLaunchParameters; conf.Skip = algo.Skip; conf.LessThreads = algo.LessThreads; // insert ret.AlgorithmSettings[key] = conf; } return ret; }