Example #1
0
        private void RefreshAlgorithms()
        {
            _algorithmService.GetAlgorithms().Subscribe(algorithms =>
            {
                // Algorithm service might invoke multiple times.
                // First, it will fire for the cached data.
                // Second, it might fire with updated data retrieved from remote.
                algorithms = algorithms.OrderBy(a => a.Name);

                IsRefreshing = true;

                try
                {
                    _algorithmService.UnsubscribeAll();

                    Algorithms.Clear();

                    foreach (var algorithm in algorithms)
                    {
                        var algorithmViewModel = new AlgorithmViewModel(algorithm, _algorithmService.AlgorithmResults.Where(r => r.AlgorithmId == algorithm.Id));
                        Algorithms.Add(algorithmViewModel);

                        // Request updates for this algoritm
                        // We need this data to update primary statistics
                        //_algorithmService.Subscribe(algorithm.Id, ResultSubscriptionType.LiveResults);
                        // TODO: Updates should be started / stopped when navigating to / from the page.
                    }
                }
                finally
                {
                    IsRefreshing = false;
                }
            });
        }
Example #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            // Check to see if all images have been averaged.
            if (imageNumber > 19)
            {
                imageNumber             = 0;
                timer1.Enabled          = false;
                loadImageButton.Enabled = true;
                return;
            }

            // Initialize averaging buffer to I16 for compatibility with the Result image.
            using (VisionImage average = new VisionImage(ImageType.I16))
            {
                // Read the next image into the operand.
                ReadNoisyImage(operand, imageNumber);

                // Add it to the result image.
                Algorithms.Add(result, operand, result);

                // Perform the average to show the user how much the result has improved so far.
                Algorithms.Divide(result, new PixelValue(imageNumber), average);

                // Change the average type to U8 for display.
                average.Type = ImageType.U8;

                // Display the result in imageViewer2.
                Algorithms.Copy(average, imageViewer2.Image);
            }

            // Increment image index.
            imageNumber++;
        }
Example #3
0
 public void InitAlgos()
 {
     SelectedAlgorithm = null;
     Algorithms.Clear();
     IAlgorithmFactory.GetAllAlgorithms().ForEach((algo) =>
     {
         Dispatcher.Invoke(() => Algorithms.Add(new ListBoxItem {
             Content = algo
         }));
     });
 }
Example #4
0
 public MiningDevice(ComputeDevice device)
 {
     Device = device;
     foreach (var algo in Device.AlgorithmSettings)
     {
         var isAlgoMiningCapable = GroupSetupUtils.IsAlgoMiningCapable(algo);
         if (isAlgoMiningCapable && algo is PluginAlgorithm)
         {
             Algorithms.Add(algo);
         }
     }
 }
Example #5
0
 /// <summary>
 /// Performs the visiting logic against an <see cref="XNode"/> representing
 /// an <see cref="AlgorithmDefinition"/>.
 /// </summary>
 /// <param name="xml">The <see cref="XNode"/> containing the algorithm
 /// information.</param>
 public void VisitAlgorithm(XNode xml)
 {
     try
     {
         AlgorithmDefinition d = _decompiler.DecompileAlgorithm(xml);
         Algorithms.Add(d);
     }
     catch (Exception e)
     {
         throw new XmlDecompilationException(e.Message, e);
     }
 }
Example #6
0
 public MiningDevice(ComputeDevice device)
 {
     Device = device;
     foreach (var algo in Device.GetAlgorithmSettings())
     {
         bool isAlgoMiningCapable = GroupSetupUtils.IsAlgoMiningCapable(algo);
         bool isValidMinerPath    = MinerPaths.IsValidMinerPath(algo.MinerBinaryPath);
         if (isAlgoMiningCapable && isValidMinerPath)
         {
             Algorithms.Add(algo);
         }
     }
 }
 public MiningDevice(ComputeDevice device)
 {
     Device = device;
     foreach (var algo in Device.GetAlgorithmSettings())
     {
         var isAlgoMiningCapable = GroupSetupUtils.IsAlgoMiningCapable(algo);
         var isValidMinerPath    = MinerPaths.IsValidMinerPath(algo.MinerBinaryPath);
         if (isAlgoMiningCapable && isValidMinerPath)
         {
             Algorithms.Add(algo);
         }
     }
     MostProfitableAlgorithmType = AlgorithmType.NONE;
     MostProfitableMinerBaseType = MinerBaseType.NONE;
 }
Example #8
0
        public MiningDevice(ComputeDevice device)
        {
            Device = device;

#if FORCE_MINING
            foreach (var algo in Device.AlgorithmSettings)
            {
                if (algo.Enabled)
                {
                    algo.BenchmarkSpeed = 1000;
                    Algorithms.Add(algo);
                }
            }
#else
            foreach (var algo in Device.AlgorithmSettings)
            {
                var isAlgoMiningCapable = GroupSetupUtils.IsAlgoMiningCapable(algo);
                if (isAlgoMiningCapable)
                {
                    Algorithms.Add(algo);
                }
            }
#endif
        }
Example #9
0
 public void PutAlgorithm(Algorithm algorithm)
 {
     Algorithms.Add(algorithm);
 }
Example #10
0
 private void addImagesButton_Click(object sender, EventArgs e)
 {
     // Add the two images and display the result.
     Algorithms.Add(imageViewer1.Image, imageViewer2.Image, imageViewer3.Image);
 }
        public SortingViewModel()
        {
            SortCommand  = new RelayCommand(SortThread);
            ResetCommand = new RelayCommand(InitializeLines);

            DisplayItem item = new DisplayItem
            {
                Algorithm     = selSort,
                DisplayMember = "Selection Sort"
            };

            Algorithms.Add(item);

            item = new DisplayItem
            {
                Algorithm     = qSort,
                DisplayMember = "Quick Sort"
            };
            Algorithms.Add(item);

            item = new DisplayItem
            {
                Algorithm     = bSort,
                DisplayMember = "Bubble Sort"
            };
            Algorithms.Add(item);

            item = new DisplayItem
            {
                Algorithm     = hSort,
                DisplayMember = "Heap Sort"
            };
            Algorithms.Add(item);

            item = new DisplayItem
            {
                Algorithm     = sSort,
                DisplayMember = "Shaker Sort"
            };
            Algorithms.Add(item);

            item = new DisplayItem
            {
                Algorithm     = cSort,
                DisplayMember = "Cocktail Sort"
            };
            Algorithms.Add(item);

            item = new DisplayItem
            {
                Algorithm     = hSort,
                DisplayMember = "Shell Sort"
            };
            Algorithms.Add(item);

            selSort.ElementsSwapped += algo_ElementsSwapped;
            selSort.SortFinished    += algo_SortFinished;

            qSort.ElementsSwapped += algo_ElementsSwapped;
            qSort.SortFinished    += algo_SortFinished;

            bSort.ElementsSwapped += algo_ElementsSwapped;
            bSort.SortFinished    += algo_SortFinished;

            hSort.ElementsSwapped += algo_ElementsSwapped;
            hSort.SortFinished    += algo_SortFinished;

            sSort.ElementsSwapped += algo_ElementsSwapped;
            sSort.SortFinished    += algo_SortFinished;

            cSort.ElementsSwapped += algo_ElementsSwapped;
            cSort.SortFinished    += algo_SortFinished;

            shSort.ElementsSwapped += algo_ElementsSwapped;
            shSort.SortFinished    += algo_SortFinished;

            InitializeLines();
        }
Example #12
0
 public void AlgorithmElement(IAlgorithmElement algorithm)
 {
     Algorithms.Add(algorithm);
 }
Example #13
0
        static Consts()
        {
            #region  Coinok feltöltése

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_V8,
                CoinType  = CoinTypes.XMR,
                Icon      = "coinMonero.png",
                Name      = "Monero",
                ShortName = "XMR",
                Webpage   = "https://monero.org"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight,
                CoinType  = CoinTypes.ETN,
                Icon      = "coinElectroneum.png",
                Name      = "Electroneum",
                ShortName = "ETN",
                Webpage   = "https://electroneum.com"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_Heavy,
                CoinType  = CoinTypes.RYO,
                Icon      = "coinRyo.png",
                Name      = "Ryo",
                ShortName = "RYO",
                Webpage   = "https://ryo-currency.com"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight,
                CoinType  = CoinTypes.BCN,
                Icon      = "coinBytecoin.png",
                Name      = "Bytecoin",
                ShortName = "BCN",
                Webpage   = "https://bytecoin.org"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight,
                CoinType  = CoinTypes.KRB,
                Icon      = "coinKrb.png",
                Name      = "Karbo",
                ShortName = "KRB",
                Webpage   = "https://karbo.io"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_V7,
                CoinType  = CoinTypes.GRFT,
                Icon      = "coinGraft.png",
                Name      = "Graft",
                ShortName = "GRFT",
                Webpage   = "https://www.graft.network"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_BitTube_V2,
                CoinType  = CoinTypes.TUBE,
                Icon      = "coinTube.png",
                Name      = "BitTube",
                ShortName = "TUBE",
                Webpage   = "https://coin.bit.tube"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_Lite_V7,
                CoinType  = CoinTypes.TRTL,
                Icon      = "coinTurtle.png",
                Name      = "TurtleCoin",
                ShortName = "TRTL",
                Webpage   = "https://turtlecoin.lol"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight,
                CoinType  = CoinTypes.NiceHash,
                Icon      = "coinNiceHash.png",
                Name      = "NiceHash",
                ShortName = "NiceHash",
                Webpage   = "https://www.nicehash.com"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_Stellite_V4,
                CoinType  = CoinTypes.XTL,
                Icon      = "coinStellite.png",
                Name      = "Stellite",
                ShortName = "XTL",
                Webpage   = "https://stellite.cash/"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_Heavy,
                CoinType  = CoinTypes.LOKI,
                Icon      = "coinLoki.png",
                Name      = "Loki",
                ShortName = "LOKI",
                Webpage   = "https://loki.network/"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight,
                CoinType  = CoinTypes.SUMO,
                Icon      = "coinSumokoin.png",
                Name      = "Sumokoin",
                ShortName = "SUMO",
                Webpage   = "https://www.sumokoin.org"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_Haven,
                CoinType  = CoinTypes.XHV,
                Icon      = "coinHaven.png",
                Name      = "Haven",
                ShortName = "XHV",
                Webpage   = "https://www.havenprotocol.com"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight_Alloy,
                CoinType  = CoinTypes.XAO,
                Icon      = "coinAlloy.png",
                Name      = "Alloy",
                ShortName = "XAO",
                Webpage   = "https://www.havenprotocol.com"
            });

            Coins.Add(new Coin
            {
                Algorithm = (int)SupportedAlgos.CryptoNight,
                CoinType  = CoinTypes.OTHER,
                Icon      = "coinOther.png",
                Name      = "Another Cryptonight coin",
                ShortName = "OTHER",
                Webpage   = ""
            });

            #endregion

            #region Algoritmusok feltöltése

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight),
                IsCpuSupport = true,
                IsGpuSupport = true
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_V7,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_V7),
                IsCpuSupport = true,
                IsGpuSupport = true
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_Lite,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_Lite),
                IsCpuSupport = true,
                IsGpuSupport = true
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_Lite_V7,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_Lite_V7),
                IsCpuSupport = true,
                IsGpuSupport = false
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_Heavy,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_Heavy),
                IsCpuSupport = true,
                IsGpuSupport = true
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_Fast,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_Fast),
                IsCpuSupport = true,
                IsGpuSupport = true
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_BitTube_V2,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_BitTube_V2),
                IsCpuSupport = true,
                IsGpuSupport = false
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_V8,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_V8),
                IsCpuSupport = true,
                IsGpuSupport = true
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_Stellite_V4,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_Stellite_V4),
                IsCpuSupport = true,
                IsGpuSupport = false
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_Haven,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_Haven),
                IsCpuSupport = true,
                IsGpuSupport = false
            });

            Algorithms.Add(new Algo()
            {
                ID           = (int)SupportedAlgos.CryptoNight_Alloy,
                Name         = EnumHelper.Description(SupportedAlgos.CryptoNight_Alloy),
                IsCpuSupport = true,
                IsGpuSupport = false
            });

            #endregion
        }