示例#1
0
        protected void ShutdownMiner(bool withCrtlC = false)
        {
            if (IsRunning)
            {
                Helpers.ConsolePrint(MinerTag(), ProcessTag() + " Shutting down miner");
            }

            if (ProcessHandle != null)
            {
                try
                {
                    if (withCrtlC)
                    {
                        ProcessHandle.SendCtrlC((uint)Process.GetCurrentProcess().Id);
                    }
                    else
                    {
                        ProcessHandle.Kill();
                    }
                }
                catch { }

                ProcessHandle.Close();
                ProcessHandle = null;

                // sgminer needs to be removed and kill by PID
                if (IsKillAllUsedMinerProcs)
                {
                    KillAllUsedMinerProcesses();
                }
            }
        }
示例#2
0
        protected void Stop_cpu_ccminer_sgminer_nheqminer(MinerStopType willswitch)
        {
            if (IsRunning)
            {
                Helpers.ConsolePrint(MinerTAG(), ProcessTag() + " Shutting down miner");
            }
            if (ProcessHandle != null)
            {
                //try { ProcessHandle.Kill(); } catch { }
                try { ProcessHandle.SendCtrlC((uint)Process.GetCurrentProcess().Id); } catch { }
                ProcessHandle.Close();
                ProcessHandle = null;

                // sgminer needs to be removed and kill by PID
                //if (IsKillAllUsedMinerProcs) KillAllUsedMinerProcesses();
            }
        }
示例#3
0
        virtual public void Stop(bool willswitch)
        {
            if (willswitch && AlgoNameIs("daggerhashimoto"))
            {
                // daggerhashimoto - we only "pause" mining
                Helpers.ConsolePrint(MinerDeviceName, "Pausing ethminer..");
                ethminerLink.StopMining();
                return;
            }

            Helpers.ConsolePrint(MinerDeviceName, "Shutting down miner");

            if (ProcessHandle != null)
            {
                try { ProcessHandle.Kill(); }
                catch { }
                ProcessHandle.Close();
                ProcessHandle = null;

                if (MinerDeviceName == "AMD_OpenCL")
                {
                    KillSGMiner();
                }
            }

            if (!willswitch && ethminerProcess != null)
            {
                try { ethminerProcess.Kill(); }
                catch { }
                ethminerProcess.Close();
                ethminerProcess = null;
            }

            StartingUpDelay = false;
            PreviousTotalMH = 0.0;
            NotProfitable   = true;
            //IsRunning = false;
            //CurrentAlgo = -1;
        }
示例#4
0
        virtual public void Stop()
        {
            if (ProcessHandle != null)
            {
                Helpers.ConsolePrint(MinerDeviceName, "Shutting down miner");
                try { ProcessHandle.Kill(); }
                catch { }
                ProcessHandle.Close();
                ProcessHandle   = null;
                StartingUpDelay = false;
                PreviousTotalMH = 0.0;

                if (AlgoNameIs("daggerhashimoto"))
                {
                    ER.Stop();
                }
                else if (MinerDeviceName == "AMD_OpenCL")
                {
                    KillSGMiner();
                }
            }
        }
示例#5
0
        protected void Stop_cpu_ccminer_sgminer_nheqminer(MinerStopType willswitch)
        {
            if (IsRunning)
            {
                Helpers.ConsolePrint(MinerTAG(), ProcessTag() + " Shutting down miner");
            }
            if (willswitch != MinerStopType.FORCE_END)
            {
                ChangeToNextAvaliablePort();
            }
            if (ProcessHandle != null)
            {
                try { ProcessHandle.Kill(); } catch { }
                ProcessHandle.Close();
                ProcessHandle = null;

                // sgminer needs to be removed and kill by PID
                if (DeviceType == DeviceType.AMD)
                {
                    KillAllUsedMinerProcesses();
                }
            }
        }