public ResponseBase SwitchRadeonGpu(bool on) { if (TryGetMinerClientLocation(out string location)) { MinerClientActionType actionType = MinerClientActionType.SwitchRadeonGpuOn; if (!on) { actionType = MinerClientActionType.SwitchRadeonGpuOff; } Windows.Cmd.RunClose(location, $"{NTKeyword.ActionCmdParameterName}{actionType.ToString()}"); } ResponseBase response = ResponseBase.Ok($"{(on ? "开启" : "关闭")}A卡计算模式,如果本机不是A卡将被忽略"); VirtualRoot.OperationResultSet.Add(response.ToOperationResult()); return(response); }
private ResponseBase RunAction(MinerClientActionType actionType) { if (IsNTMinerOpened()) { var request = new DataRequest <MinerClientActionType> { Data = actionType }; JsonRpcRoot.FirePostAsync(NTKeyword.Localhost, NTKeyword.MinerClientPort, _minerClientControllerName, nameof(IMinerClientController.RunAction), null, data: request); } else if (TryGetMinerClientLocation(out string location)) { Windows.Cmd.RunClose(location, $"{NTKeyword.ActionCmdParameterName}{actionType.ToString()}"); } ResponseBase response = ResponseBase.Ok(actionType.GetDescription()); VirtualRoot.OperationResultSet.Add(response.ToOperationResult()); return(response); }
public MinerClientActionCommand(MinerClientActionType actionType) { this.ActionType = actionType; }