Esempio n. 1
0
 // methods
 public void SetDefaults()
 {
     ConfigFileVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
     Language          = LanguageType.En;
     ForceCPUExtension = CPUExtensionType.Automatic;
     BitcoinAddress    = "";
     WorkerName        = "worker1";
     ServiceLocation   = 0;
     AutoStartMining   = false;
     //LessThreads = 0;
     DebugConsole                = false;
     HideMiningWindows           = false;
     MinimizeToTray              = false;
     BenchmarkTimeLimits         = new BenchmarkTimeLimitsConfig();
     DeviceDetection             = new DeviceDetectionConfig();
     DisableAMDTempControl       = true;
     DisableDefaultOptimizations = false;
     AutoScaleBTCValues          = true;
     StartMiningWhenIdle         = false;
     LogToFile                    = true;
     LogMaxFileSize               = 1048576;
     ShowDriverVersionWarning     = true;
     DisableWindowsErrorReporting = true;
     NVIDIAP0State                = false;
     MinerRestartDelayMS          = 500;
     ethminerDefaultBlockHeight   = 2000000;
     SwitchMinSecondsFixed        = 90;
     SwitchMinSecondsDynamic      = 30;
     SwitchMinSecondsAMD          = 90;
     SwitchProfitabilityThreshold = 0.05; // percent
     MinIdleSeconds               = 60;
     DisplayCurrency              = "USD";
     ApiBindPortPoolStart         = 4000;
     MinimumProfit                = 0;
     EthminerDagGenerationType    = DagGenerationType.SingleKeep;
     DownloadInit                 = false;
     //ContinueMiningIfNoInternetAccess = false;
     IdleWhenNoInternetAccess = true;
     Use3rdPartyMiners        = Use3rdPartyMiners.NOT_SET;
     DownloadInit3rdParty     = false;
     AllowMultipleInstances   = true;
     WebInterfaceEnabled      = true;
     WebInterfacePort         = 8888;
 }
Esempio n. 2
0
 public void FixSettingBounds()
 {
     this.ConfigFileVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
     if (string.IsNullOrEmpty(this.DisplayCurrency) ||
         String.IsNullOrWhiteSpace(this.DisplayCurrency))
     {
         this.DisplayCurrency = "USD";
     }
     if (this.SwitchMinSecondsFixed <= 0)
     {
         this.SwitchMinSecondsFixed = 90;
     }
     if (this.SwitchMinSecondsDynamic <= 0)
     {
         this.SwitchMinSecondsDynamic = 30;
     }
     if (this.SwitchMinSecondsAMD <= 0)
     {
         this.SwitchMinSecondsAMD = 60;
     }
     if (this.MinerAPIQueryInterval <= 0)
     {
         this.MinerAPIQueryInterval = 5;
     }
     if (this.MinerRestartDelayMS <= 0)
     {
         this.MinerRestartDelayMS = 500;
     }
     if (this.MinIdleSeconds <= 0)
     {
         this.MinIdleSeconds = 60;
     }
     if (this.LogMaxFileSize <= 0)
     {
         this.LogMaxFileSize = 1048576;
     }
     // check port start number, leave about 2000 ports pool size, huge yea!
     if (this.ApiBindPortPoolStart > (65535 - 2000))
     {
         this.ApiBindPortPoolStart = 5100;
     }
     if (this.BenchmarkTimeLimits == null)
     {
         this.BenchmarkTimeLimits = new BenchmarkTimeLimitsConfig();
     }
     if (this.DeviceDetection == null)
     {
         this.DeviceDetection = new DeviceDetectionConfig();
     }
     if (this.LastDevicesSettup == null)
     {
         this.LastDevicesSettup = new List <ComputeDeviceConfig>();
     }
     if (IQROverFactor < 0)
     {
         IQROverFactor = 3.0;
     }
     if (NormalizedProfitHistory < 0)
     {
         NormalizedProfitHistory = 15;
     }
     if (IQRNormalizeFactor < 0)
     {
         IQRNormalizeFactor = 0.0;
     }
 }
Esempio n. 3
0
        public void FixSettingBounds()
        {
            ConfigFileVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
            if (string.IsNullOrEmpty(DisplayCurrency) ||
                string.IsNullOrWhiteSpace(DisplayCurrency))
            {
                DisplayCurrency = "USD";
            }
            if (SwitchMinSecondsFixed <= 0)
            {
                SwitchMinSecondsFixed = 90;
            }
            if (SwitchMinSecondsDynamic <= 0)
            {
                SwitchMinSecondsDynamic = 30;
            }
            if (SwitchMinSecondsAMD <= 0)
            {
                SwitchMinSecondsAMD = 60;
            }
            if (MinerAPIQueryInterval <= 0)
            {
                MinerAPIQueryInterval = 5;
            }
            if (MinerRestartDelayMS <= 0)
            {
                MinerRestartDelayMS = 500;
            }
            if (MinIdleSeconds <= 0)
            {
                MinIdleSeconds = 60;
            }
            if (LogMaxFileSize <= 0)
            {
                LogMaxFileSize = 1048576;
            }
            // check port start number, leave about 2000 ports pool size, huge yea!
            if (ApiBindPortPoolStart > (65535 - 2000))
            {
                ApiBindPortPoolStart = 5100;
            }
            if (BenchmarkTimeLimits == null)
            {
                BenchmarkTimeLimits = new BenchmarkTimeLimitsConfig();
            }
            if (DeviceDetection == null)
            {
                DeviceDetection = new DeviceDetectionConfig();
            }
            if (LastDevicesSettup == null)
            {
                LastDevicesSettup = new List <ComputeDeviceConfig>();
            }
            if (IQROverFactor < 0)
            {
                IQROverFactor = 3.0;
            }
            if (NormalizedProfitHistory < 0)
            {
                NormalizedProfitHistory = 15;
            }
            if (IQRNormalizeFactor < 0)
            {
                IQRNormalizeFactor = 0.0;
            }
            if (KwhPrice < 0)
            {
                KwhPrice = 0;
            }
            // for backward compatibility fix the new setting to language codes
            var langCodes = new Dictionary <string, string> {
                { "0", "en" },
                { "1", "ru" },
                { "2", "es" },
                { "3", "pt" },
                { "4", "bg" },
                { "5", "it" },
                { "6", "pl" },
                { "7", "zh_cn" },
                { "8", "ro" },
            };

            if (Language == null)
            {
                Language = "en";
            }
            else if (langCodes.ContainsKey(Language))
            {
                Language = langCodes[Language];
            }

            SwitchSmaTimeChangeSeconds.FixRange();
            SwitchSmaTicksStable.FixRange();
            SwitchSmaTicksUnstable.FixRange();
        }
Esempio n. 4
0
 public void FixSettingBounds()
 {
     this.ConfigFileVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
     if (string.IsNullOrEmpty(this.DisplayCurrency)
         || StringHelper.IsNullOrWhiteSpace(this.DisplayCurrency)) {
         this.DisplayCurrency = "USD";
     }
     if (this.SwitchMinSecondsFixed <= 0) {
         this.SwitchMinSecondsFixed = 90;
     }
     if (this.SwitchMinSecondsDynamic <= 0) {
         this.SwitchMinSecondsDynamic = 30;
     }
     if (this.SwitchMinSecondsAMD <= 0) {
         this.SwitchMinSecondsAMD = 60;
     }
     if (this.MinerAPIQueryInterval <= 0) {
         this.MinerAPIQueryInterval = 5;
     }
     if (this.MinerRestartDelayMS <= 0) {
         this.MinerRestartDelayMS = 500;
     }
     if (this.MinIdleSeconds <= 0) {
         this.MinIdleSeconds = 60;
     }
     if (this.LogMaxFileSize <= 0) {
         this.LogMaxFileSize = 1048576;
     }
     // check port start number, leave about 2000 ports pool size, huge yea!
     if (this.ApiBindPortPoolStart > (65535 - 2000)) {
         this.ApiBindPortPoolStart = 5100;
     }
     if (this.BenchmarkTimeLimits == null) {
         this.BenchmarkTimeLimits = new BenchmarkTimeLimitsConfig();
     }
     if (this.DeviceDetection == null) {
         this.DeviceDetection = new DeviceDetectionConfig();
     }
     if (this.LastDevicesSettup == null) {
         this.LastDevicesSettup = new List<ComputeDeviceConfig>();
     }
 }
Esempio n. 5
0
 // methods
 public void SetDefaults()
 {
     ConfigFileVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
     Language = LanguageType.En;
     ForceCPUExtension = CPUExtensionType.Automatic;
     BitcoinAddress = "";
     WorkerName = "worker1";
     ServiceLocation = 0;
     AutoStartMining = false;
     //LessThreads = 0;
     DebugConsole = false;
     HideMiningWindows = false;
     MinimizeToTray = false;
     BenchmarkTimeLimits = new BenchmarkTimeLimitsConfig();
     DeviceDetection = new DeviceDetectionConfig();
     DisableAMDTempControl = false;
     DisableDefaultOptimizations = false;
     AutoScaleBTCValues = true;
     StartMiningWhenIdle = false;
     LogToFile = true;
     LogMaxFileSize = 1048576;
     ShowDriverVersionWarning = true;
     DisableWindowsErrorReporting = true;
     NVIDIAP0State = false;
     MinerRestartDelayMS = 500;
     ethminerDefaultBlockHeight = 2000000;
     SwitchMinSecondsFixed = 90;
     SwitchMinSecondsDynamic = 30;
     SwitchMinSecondsAMD = 90;
     MinIdleSeconds = 60;
     DisplayCurrency = "USD";
     ApiBindPortPoolStart = 4000;
     MinimumProfit = 0;
     EthminerDagGenerationType = DagGenerationType.SingleKeep;
     DownloadInit = false;
     //ContinueMiningIfNoInternetAccess = false;
     IdleWhenNoInternetAccess = true;
     Use3rdPartyMiners = Use3rdPartyMiners.NOT_SET;
     DownloadInit3rdParty = false;
     AllowMultipleInstances = true;
 }
        public void FixSettingBounds()
        {
            ConfigFileVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
            if (string.IsNullOrEmpty(DisplayCurrency) ||
                string.IsNullOrWhiteSpace(DisplayCurrency))
            {
                DisplayCurrency = "USD";
            }
            if (SwitchMinSecondsFixed <= 0)
            {
                SwitchMinSecondsFixed = 90;
            }
            if (SwitchMinSecondsDynamic <= 0)
            {
                SwitchMinSecondsDynamic = 30;
            }
            if (SwitchMinSecondsAMD <= 0)
            {
                SwitchMinSecondsAMD = 60;
            }
            if (MinerAPIQueryInterval <= 0)
            {
                MinerAPIQueryInterval = 5;
            }
            if (MinerRestartDelayMS <= 0)
            {
                MinerRestartDelayMS = 500;
            }
            if (MinIdleSeconds <= 0)
            {
                MinIdleSeconds = 60;
            }
            if (LogMaxFileSize <= 0)
            {
                LogMaxFileSize = 1048576;
            }
            // check port start number, leave about 2000 ports pool size, huge yea!
            if (ApiBindPortPoolStart > (65535 - 2000))
            {
                ApiBindPortPoolStart = 5100;
            }
            if (this.ApiBindPortPoolStart <= 4001)  //fix to hsrminer
            {
                this.ApiBindPortPoolStart = 4002;
            }
            if (BenchmarkTimeLimits == null)
            {
                BenchmarkTimeLimits = new BenchmarkTimeLimitsConfig();
            }
            if (DeviceDetection == null)
            {
                DeviceDetection = new DeviceDetectionConfig();
            }
            if (LastDevicesSettup == null)
            {
                LastDevicesSettup = new List <ComputeDeviceConfig>();
            }
            if (IQROverFactor < 0)
            {
                IQROverFactor = 3.0;
            }
            if (NormalizedProfitHistory < 0)
            {
                NormalizedProfitHistory = 15;
            }
            if (IQRNormalizeFactor < 0)
            {
                IQRNormalizeFactor = 0.0;
            }
            if (KwhPrice < 0)
            {
                KwhPrice = 0;
            }

            SwitchSmaTimeChangeSeconds.FixRange();
            SwitchSmaTicksStable.FixRange();
            SwitchSmaTicksUnstable.FixRange();
        }