Start() public method

Start listening.
public Start ( ) : void
return void
Beispiel #1
0
        virtual protected NiceHashProcess _Start()
        {
            PreviousTotalMH = 0.0;
            if (LastCommandLine.Length == 0 || EnabledDeviceCount() == 0)
            {
                return(null);
            }

            Helpers.ConsolePrint(MinerDeviceName, "Starting miner: " + LastCommandLine);

            NiceHashProcess P = new NiceHashProcess();

            if (WorkingDirectory.Length > 1)
            {
                P.StartInfo.WorkingDirectory = WorkingDirectory;
            }

            NumRetries = Config.ConfigData.MinerAPIGraceMinutes * 60 / Config.ConfigData.MinerAPIQueryInterval;
            if (AlgoNameIs("daggerhashimoto"))
            {
                NumRetries = Config.ConfigData.EthMinerAPIGraceMinutes * 60 / Config.ConfigData.MinerAPIQueryInterval;
                ER.Start();
                P.StartInfo.FileName = Ethereum.EtherMinerPath;
            }
            else
            {
                P.StartInfo.FileName = Path;
            }

            P.StartInfo.Arguments      = LastCommandLine;
            P.StartInfo.CreateNoWindow = Config.ConfigData.HideMiningWindows;
            //P.StartInfo.UseShellExecute = !Config.ConfigData.HideMiningWindows;
            P.StartInfo.UseShellExecute = false;
            //P.EnableRaisingEvents = true;
            //P.Exited += Miner_Exited;
            P.ExitEvent = Miner_Exited;

            try
            {
                if (P.Start())
                {
                    return(P);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                Helpers.ConsolePrint(MinerDeviceName, "_Start: " + ex.Message);
                return(null);
            }
        }
Beispiel #2
0
        public Form5(string worker, Process eprocess)
        {
            InitializeComponent();

            Success = false;

            Worker          = worker;
            EthMinerProcess = eprocess;
            EthMinerProcess.Start();

            EthReader = new EthminerReader(37450);
            EthReader.Start();

            CheckTimer          = new Timer();
            CheckTimer.Interval = 1000;
            CheckTimer.Tick    += CheckTimer_Tick;
            CheckTimer.Start();
        }