Beispiel #1
0
        public DeviceBenchmarkConfig GetAlgorithmDeviceConfig()
        {
            var ret = new DeviceBenchmarkConfig
            {
                DeviceName = Name,
                DeviceUUID = Uuid
            };

            // init algo settings
            foreach (var algo in AlgorithmSettings)
            {
                // create/setup
                var conf = new AlgorithmConfig
                {
                    Name                  = algo.AlgorithmStringID,
                    NiceHashID            = algo.NiceHashID,
                    MinerBaseType         = algo.MinerBaseType,
                    MinerName             = algo.MinerName,
                    BenchmarkSpeed        = algo.BenchmarkSpeed,
                    ExtraLaunchParameters = algo.ExtraLaunchParameters,
                    Enabled               = algo.Enabled,
                    LessThreads           = algo.LessThreads,
                    PowerUsage            = algo.PowerUsage
                };
                // insert
                ret.AlgorithmSettings.Add(conf);
                if (algo is DualAlgorithm dualAlgo)
                {
                    conf.SecondaryNiceHashID     = dualAlgo.SecondaryNiceHashID;
                    conf.SecondaryBenchmarkSpeed = dualAlgo.SecondaryBenchmarkSpeed;

                    DualAlgorithmConfig dualConf = new DualAlgorithmConfig
                    {
                        Name = algo.AlgorithmStringID,
                        SecondaryNiceHashID      = dualAlgo.SecondaryNiceHashID,
                        IntensitySpeeds          = dualAlgo.IntensitySpeeds,
                        SecondaryIntensitySpeeds = dualAlgo.SecondaryIntensitySpeeds,
                        TuningEnabled            = dualAlgo.TuningEnabled,
                        TuningStart        = dualAlgo.TuningStart,
                        TuningEnd          = dualAlgo.TuningEnd,
                        TuningInterval     = dualAlgo.TuningInterval,
                        IntensityPowers    = dualAlgo.IntensityPowers,
                        UseIntensityPowers = dualAlgo.UseIntensityPowers
                    };

                    ret.DualAlgorithmSettings.Add(dualConf);
                }
            }

            return(ret);
        }
        public DeviceBenchmarkConfig GetAlgorithmDeviceConfig()
        {
            var ret = new DeviceBenchmarkConfig
            {
                DeviceName = Name,
                DeviceUUID = Uuid
            };

            // init algo settings
            foreach (var algo in AlgorithmSettings)
            {
                if (algo is PluginAlgorithm pluginAlgo)
                {
                    var pluginConf = new PluginAlgorithmConfig
                    {
                        Name                  = pluginAlgo.PluginName,
                        PluginUUID            = pluginAlgo.BaseAlgo.MinerID,
                        AlgorithmIDs          = pluginAlgo.BaseAlgo.IDs.ToList(),
                        Enabled               = pluginAlgo.Enabled,
                        ExtraLaunchParameters = pluginAlgo.ExtraLaunchParameters,
                        PluginVersion         = "N/A",
                        PowerUsage            = pluginAlgo.PowerUsage,
                        // TODO dual not supported ATM
                        Speeds = new List <double> {
                            pluginAlgo.BenchmarkSpeed
                        }
                    };
                    ret.PluginAlgorithmSettings.Add(pluginConf);
                    continue;
                }
                // create/setup
                var conf = new AlgorithmConfig
                {
                    Name                  = algo.AlgorithmStringID,
                    NiceHashID            = algo.NiceHashID,
                    MinerBaseType         = algo.MinerBaseType,
                    MinerName             = algo.MinerName,
                    BenchmarkSpeed        = algo.BenchmarkSpeed,
                    ExtraLaunchParameters = algo.ExtraLaunchParameters,
                    Enabled               = algo.Enabled,
                    LessThreads           = algo.LessThreads,
                    PowerUsage            = algo.PowerUsage
                };
                // insert
                ret.AlgorithmSettings.Add(conf);
                if (algo is DualAlgorithm dualAlgo)
                {
                    conf.SecondaryNiceHashID     = dualAlgo.SecondaryNiceHashID;
                    conf.SecondaryBenchmarkSpeed = dualAlgo.SecondaryBenchmarkSpeed;

                    DualAlgorithmConfig dualConf = new DualAlgorithmConfig
                    {
                        Name = algo.AlgorithmStringID,
                        SecondaryNiceHashID      = dualAlgo.SecondaryNiceHashID,
                        IntensitySpeeds          = dualAlgo.IntensitySpeeds,
                        SecondaryIntensitySpeeds = dualAlgo.SecondaryIntensitySpeeds,
                        TuningEnabled            = dualAlgo.TuningEnabled,
                        TuningStart        = dualAlgo.TuningStart,
                        TuningEnd          = dualAlgo.TuningEnd,
                        TuningInterval     = dualAlgo.TuningInterval,
                        IntensityPowers    = dualAlgo.IntensityPowers,
                        UseIntensityPowers = dualAlgo.UseIntensityPowers
                    };

                    ret.DualAlgorithmSettings.Add(dualConf);
                }
            }

            return(ret);
        }