//private void toolStripMenuItemEnable_Click(object sender, EventArgs e) {
        //    ComputeDeviceEnabledOption G = listViewDevices.FocusedItem.Tag as ComputeDeviceEnabledOption;
        //    var isEnabled = !G.IsEnabled;
        //    G.IsEnabled = isEnabled;
        //    if (AutoSaveChange) {
        //        G.SaveOption();
        //    }
        //    if (SaveToGeneralConfig) {
        //        ConfigManager.Instance.GeneralConfig.Commit();
        //    }
        //    var lvi = listViewDevices.FocusedItem as ListViewItem;
        //    if (lvi != null) _listItemCheckColorSetter.LviSetColor(lvi);
        //    if (_algorithmsListView != null) _algorithmsListView.RepaintStatus(G.IsEnabled, G.CDevice.UUID);
        //    if (BenchmarkCalculation != null) _benchmarkCalculation.CalcBenchmarkDevicesAlgorithmQueue();
        //}

        private void toolStripMenuItemCopySettings_Click(object sender, EventArgs e)
        {
            ComputeDeviceEnabledOption G    = listViewDevices.FocusedItem.Tag as ComputeDeviceEnabledOption;
            ToolStripMenuItem          item = sender as ToolStripMenuItem;

            if (item != null)
            {
                var uuid = item.Tag as string;
                if (uuid != null)
                {
                    var copyBenchCDev = ComputeDevice.GetDeviceWithUUID(uuid);
                    G.CDevice.BenchmarkCopyUUID = uuid;

                    var result = MessageBox.Show(
                        String.Format(
                            International.GetText("DeviceListView_ContextMenu_CopySettings_Confirm_Dialog_Msg"), copyBenchCDev.GetFullName(), G.CDevice.GetFullName()),
                        International.GetText("DeviceListView_ContextMenu_CopySettings_Confirm_Dialog_Title"),
                        MessageBoxButtons.YesNo);
                    if (result == DialogResult.Yes)
                    {
                        // just copy
                        G.CDevice.CopyBenchmarkSettingsFrom(copyBenchCDev);
                        if (_algorithmsListView != null)
                        {
                            _algorithmsListView.RepaintStatus(G.IsEnabled, G.CDevice.UUID);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public void AfterDeviceQueryInitialization()
        {
            GeneralConfig.AfterDeviceQueryInitialization();
            LoadBenchmarks();

            SetDeviceBenchmarkReferences();



            // check ethminers and remove from settings if no device supports it in config
            foreach (var config in BenchmarkConfigs)
            {
                bool removeDagger = true;
                var  cDev         = ComputeDevice.GetDeviceWithUUID(config.Value.DeviceUUID);
                if (cDev != null)
                {
                    // if only one dev ing roup supports terminate
                    if (cDev.IsEtherumCapale)
                    {
                        removeDagger = false;
                        break;
                    }
                }
                if (removeDagger)
                {
                    config.Value.AlgorithmSettings.Remove(AlgorithmType.DaggerHashimoto);
                }
            }

            CommitBenchmarks();
        }
Esempio n. 3
0
            public GroupMiners(GroupedDevices deviceUUIDSet)
            {
                _miners      = new List <Miner>();
                _deviceNames = new SortedSet <string>();
                foreach (var uuid in deviceUUIDSet)
                {
                    var tmpCdev = ComputeDevice.GetDeviceWithUUID(uuid);
                    _deviceNames.Add(tmpCdev.NameCount);
                    if (_deviceGroupType == DeviceGroupType.NONE)
                    {
                        _deviceGroupType = tmpCdev.DeviceGroupType;
                    }
                }
                // init device uuids
                _deviceUUIDs = deviceUUIDSet.ToArray();
                // init DevicesInfoString
                string[] _deviceNamesCount = new string[_deviceNames.Count];
                {
                    int i = 0;
                    foreach (var devName in _deviceNames)
                    {
                        _deviceNamesCount[i++] =
                            ComputeDevice.GetEnabledDeviceNameCount(devName).ToString()
                            + " * " + devName;
                    }
                }

                DevicesInfoString = "{ " + string.Join(", ", _deviceNames) + " }";
            }
 private void CopyBenchmarks()
 {
     Helpers.ConsolePrint("CopyBenchmarks", "Checking for benchmarks to copy");
     foreach (var GdevSetting in devicesListViewEnableControl1.Options)
     {
         // check if copy
         if (!GdevSetting.IsEnabled && GdevSetting.CDevice.BenchmarkCopyUUID != null)
         {
             var copyCdevSettings = ComputeDevice.GetDeviceWithUUID(GdevSetting.CDevice.BenchmarkCopyUUID);
             if (copyCdevSettings != null)
             {
                 Helpers.ConsolePrint("CopyBenchmarks", String.Format("Copy from {0} to {1}", GdevSetting.CDevice.UUID, GdevSetting.CDevice.BenchmarkCopyUUID));
                 GdevSetting.CDevice.CopyBenchmarkSettingsFrom(copyCdevSettings);
             }
         }
     }
 }