// you must use protected Miner(PluginContainer plugin, List <MiningPair> miningPairs, string groupKey) { _plugin = plugin; // TODO this is now a must be of type IMinerAsyncExtensions _miner = _plugin.CreateMiner() as IMinerAsyncExtensions; // just so we can set algorithms states _algos = new List <AlgorithmContainer>(); foreach (var pair in miningPairs) { var cDev = AvailableDevices.GetDeviceWithUuid(pair.Device.UUID); if (cDev == null) { continue; } var algoContainer = cDev.AlgorithmSettings.FirstOrDefault(a => a.Algorithm == pair.Algorithm); if (algoContainer == null) { continue; } _algos.Add(algoContainer); } MiningPairs = miningPairs; IsInit = MiningPairs != null && MiningPairs.Count > 0; GroupKey = groupKey; MinerDeviceName = plugin.PluginUUID; Logger.Info(MinerTag(), "NEW MINER CREATED"); }
// you must use protected Miner(PluginContainer plugin, List <MiningPair> miningPairs, string groupKey) { _plugin = plugin; _miner = _plugin.CreateMiner(); MiningPairs = miningPairs; IsInit = MiningPairs != null && MiningPairs.Count > 0; if (IsInit) { foreach (var pair in miningPairs) { // for OLD PRODUCTION we still need these indexes get rid of this when possible var cDev = AvailableDevices.GetDeviceWithUuidOrB64Uuid(pair.Device.UUID); var index = cDev?.Index ?? -1; if (index < 0) { continue; } DevIndexes.Add(index); } } GroupKey = groupKey; MinerDeviceName = plugin.PluginUUID; Logger.Info(MinerTag(), "NEW MINER CREATED"); }
// you must use protected Miner(PluginContainer plugin, List <MiningPair> miningPairs, string groupKey) { _plugin = plugin; _miner = _plugin.CreateMiner(); MiningPairs = miningPairs; IsInit = MiningPairs != null && MiningPairs.Count > 0; GroupKey = groupKey; MinerDeviceName = plugin.PluginUUID; Logger.Info(MinerTag(), "NEW MINER CREATED"); }
// you must use protected Miner(PluginContainer plugin, List <AlgorithmContainer> algorithms, string groupKey) { _plugin = plugin; _miner = _plugin.CreateMiner(); // just so we can set algorithms states _algos = algorithms; _miningPairs = algorithms.Select(algo => algo.ToMiningPair()).ToList(); IsInit = _miningPairs != null && _miningPairs.Any(); GroupKey = groupKey; MinerDeviceName = plugin.PluginUUID; Logger.Info(MinerTag(), "NEW MINER CREATED"); }
public MinerFromPlugin(string pluginUUID, List <MiningPair> miningPairs, string groupKey) : base(pluginUUID, miningPairs, groupKey) { _plugin = MinerPluginsManager.GetPluginWithUuid(pluginUUID); _miner = _plugin.CreateMiner(); }
//public MinerFromPlugin(string pluginUUID, List<MiningPair> miningPairs, string groupKey) : base(pluginUUID, miningPairs, groupKey) //{ // _plugin = MinerPluginsManager.GetPluginWithUuid(pluginUUID); // _miner = _plugin.CreateMiner(); //} public MinerFromPlugin(PluginContainer plugin, List <MiningPair> miningPairs, string groupKey) : base(plugin.PluginUUID, miningPairs, groupKey) { _plugin = plugin; _miner = _plugin.CreateMiner(); }