Example #1
0
        private void tmrTimeUpdate_Tick(object sender, EventArgs e)
        {
            if (_engine.ExitTime.HasValue && DateTime.Now >= _engine.ExitTime)
            {
                Application.Exit();
            }

            UpdateTimes();

            if (_engine.PricesUpdated)
            {
                UpdateGrid();

                if (_engine.ShowHistory)
                {
                    HistoryChart historyChart = tabHistory.Controls["historyChart"] as HistoryChart;
                    historyChart?.UpdateChart(_engine.StatWindow, 3);
                    _totalHistoryForm?.UpdateChart();
                }

                _engine.PricesUpdated = false;
            }

            MiningModeEnum[] autoModes = { MiningModeEnum.Automatic, MiningModeEnum.Donation };
            if (!autoModes.Contains(_engine.MiningMode))
            {
                return;
            }

            RunBestAlgo();
        }
        private void tmrTimeUpdate_Tick(object sender, EventArgs e)
        {
            if (_engine.ExitTime.HasValue && DateTime.Now >= _engine.ExitTime)
            {
                Application.Exit();
            }

            UpdateTimes();

            if (_engine.PricesUpdated)
            {
                UpdateGrid();

                HistoryChart historyChart = tabHistory.Controls["historyChart"] as HistoryChart;
                if (historyChart != null)
                {
                    historyChart.UpdateChart(TimeSpan.FromMinutes(20), 3);
                }
                if (_totalHistoryForm != null)
                {
                    _totalHistoryForm.UpdateChart();
                }

                _engine.PricesUpdated = false;
            }

            MiningModeEnum[] autoModes = { MiningModeEnum.Automatic, MiningModeEnum.Donation };
            if (!autoModes.Contains(_engine.MiningMode))
            {
                return;
            }

            RunBestAlgo();
        }