1
0
nttest 6 жил өмнө
parent
commit
fef788fc6a

+ 2 - 2
src/AppModels/Vms/StartStopMineButtonViewModel.cs

@@ -30,8 +30,7 @@ namespace NTMiner.Vms {
                     }
                 });
             });
-            Logger.InfoDebugLine($"StartStopMineButtonViewModel {NTMinerRoot.IsAutoStart} {this.MinerProfile.IsMining} {VirtualRoot.SecondCount} {MinerProfile.AutoStartDelaySeconds}");
-            if (NTMinerRoot.IsAutoStart && !this.MinerProfile.IsMining && VirtualRoot.SecondCount < MinerProfile.AutoStartDelaySeconds) {
+            if (NTMinerRoot.IsAutoStart && !this.MinerProfile.IsMining) {
                 this.MinerProfile.IsMining = true;
                 int n = MinerProfile.AutoStartDelaySeconds;
                 Bus.IDelegateHandler handler = null;
@@ -42,6 +41,7 @@ namespace NTMiner.Vms {
                         VirtualRoot.UnPath(handler);
                         if (!NTMinerRoot.IsAutoStartCanceled) {
                             BtnStopText = "正在挖矿";
+                            MinerProfile.IsMining = true;
                             NTMinerRoot.Instance.StartMine();
                         }
                     }

+ 1 - 2
src/AppModels/Vms/StateBarViewModel.cs

@@ -1,5 +1,4 @@
-using Microsoft.Win32;
-using System;
+using System;
 using System.Windows;
 using System.Windows.Input;
 using System.Windows.Media;

+ 0 - 11
src/AppViews0/Ucs/StateBar.xaml.cs

@@ -31,20 +31,9 @@ namespace NTMiner.Views.Ucs {
                     action: message => {
                         DateTime now = DateTime.Now;
                         Vm.UpdateBootTimeSpan(now - NTMinerRoot.Instance.CreatedOn);
-                        if (NTMinerRoot.IsAutoStart && VirtualRoot.SecondCount <= Vm.MinerProfile.AutoStartDelaySeconds + 2 && !NTMinerRoot.IsAutoStartCanceled) {
-                            return;
-                        }
                         var mineContext = NTMinerRoot.Instance.CurrentMineContext;
                         if (mineContext != null) {
                             Vm.UpdateMineTimeSpan(now - mineContext.CreatedOn);
-                            if (!Vm.MinerProfile.IsMining) {
-                                Vm.MinerProfile.IsMining = true;
-                            }
-                        }
-                        else {
-                            if (Vm.MinerProfile.IsMining) {
-                                Vm.MinerProfile.IsMining = false;
-                            }
                         }
                     });
                 window.On<AppVersionChangedEvent>("发现了服务端新版本", LogEnum.DevConsole,