INTMinerContext.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using NTMiner.Core;
  2. using NTMiner.Core.Profile;
  3. using NTMiner.Core.Profiles;
  4. using NTMiner.Cpus;
  5. using NTMiner.Gpus;
  6. using NTMiner.Mine;
  7. using NTMiner.Report;
  8. using System;
  9. namespace NTMiner {
  10. public interface INTMinerContext {
  11. ILocalMessageSet LocalMessageSet { get; }
  12. void ReInitMinerProfile(WorkType workType);
  13. string GetServerJsonVersion();
  14. DateTime CreatedOn { get; }
  15. void Init(Action callback);
  16. bool GetProfileData(
  17. out ICoin mainCoin, out ICoinProfile mainCoinProfile, out IPool mainCoinPool, out ICoinKernel mainCoinKernel, out IKernel kernel,
  18. out IKernelInput kernelInput, out IKernelOutput kernelOutput, out string errorMsg);
  19. void StartMine(bool isRestart = false);
  20. void StartMine(Action<IKernel> callback);
  21. void RestartMine(WorkType workType = WorkType.None, string workerName = null);
  22. StopMineReason StopReason { get; }
  23. void StopMineAsync(StopMineReason stopReason, Action callback = null);
  24. IMineContext CurrentMineContext { get; set; }
  25. /// <summary>
  26. /// 开始挖矿时锁定的挖矿上下文
  27. /// </summary>
  28. IMineContext LockedMineContext { get; }
  29. /// <summary>
  30. /// 等效于LockedMineContext非空
  31. /// </summary>
  32. bool IsMining { get; }
  33. IReportDataProvider ReporterDataProvider { get; }
  34. IServerContext ServerContext { get; }
  35. IGpuProfileSet GpuProfileSet { get; }
  36. IWorkProfile MinerProfile { get; }
  37. string GpuSetInfo { get; }
  38. IGpuSet GpuSet { get; }
  39. IOverClockDataSet OverClockDataSet { get; }
  40. ICpuPackage CpuPackage { get; }
  41. ICalcConfigSet CalcConfigSet { get; }
  42. IKernelProfileSet KernelProfileSet { get; }
  43. IGpusSpeed GpusSpeed { get; }
  44. ICoinShareSet CoinShareSet { get; }
  45. IKernelOutputKeywordSet KernelOutputKeywordSet { get; }
  46. IServerMessageSet ServerMessageSet { get; }
  47. Version MinNvidiaDriverVersion { get; }
  48. Version MinAmdDriverVersion { get; }
  49. void ExportServerVersionJson(string jsonFileFullName);
  50. void ExportWorkJson(MineWorkData mineWorkData, out string localJson, out string serverJson);
  51. }
  52. }