Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 public MinerClientActionCommand(MinerClientActionType actionType)
 {
     this.ActionType = actionType;
 }