Ignore:
Timestamp:
Jun 26, 2010, 5:48:36 PM (11 years ago)
Author:
Paul Lelgemann
Message:

o KeySearcher: improved visualization of local and distributed components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/KeySearcher.cs

    r1698 r1705  
    11using System;
     2using System.Diagnostics;
    23using System.Linq;
    34using System.Text;
     
    4142        private readonly LocalQuickWatchPresentation localQuickWatchPresentation;
    4243
     44        private readonly Stopwatch localBruteForceStopwatch;
     45
    4346        private KeyPattern.KeyPattern pattern;
    4447        public KeyPattern.KeyPattern Pattern
     
    219222
    220223            settings.PropertyChanged += SettingsPropertyChanged;
     224
     225            localBruteForceStopwatch = new Stopwatch();
    221226        }
    222227
     
    679684        internal LinkedList<ValueKey> BruteForceWithLocalSystem(KeyPattern.KeyPattern pattern, bool redirectResultsToStatisticsGenerator = false)
    680685        {
     686            if (!redirectResultsToStatisticsGenerator)
     687            {
     688                localQuickWatchPresentation.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(SetStartDate));
     689                localBruteForceStopwatch.Start();
     690            }
     691
    681692            BigInteger size = pattern.size();
    682693            KeyPattern.KeyPattern[] patterns = splitPatternForThreads(pattern);
     
    786797        }
    787798
     799        private void SetStartDate()
     800        {
     801            localQuickWatchPresentation.startTime.Content = DateTime.Now.ToString("g", Thread.CurrentThread.CurrentCulture); ;
     802        }
     803
    788804        internal void showProgress(LinkedList<ValueKey> costList, BigInteger size, BigInteger keycounter, BigInteger doneKeys)
    789805        {
     
    820836                localQuickWatchPresentation.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    821837                {
    822                     localQuickWatchPresentation.keysPerSecond.Text = "" + doneKeys;
     838                    localQuickWatchPresentation.elapsedTime.Content = localBruteForceStopwatch.Elapsed;
     839
     840                    localQuickWatchPresentation.keysPerSecond.Content = "" + doneKeys;
    823841                    if (timeleft != new TimeSpan(-1))
    824842                    {
    825                         localQuickWatchPresentation.timeLeft.Text = "" + timeleft;
     843                        localQuickWatchPresentation.timeLeft.Content = "" + timeleft;
    826844                        try
    827845                        {
    828                             localQuickWatchPresentation.endTime.Text = "" + DateTime.Now.Add(timeleft);
     846                            localQuickWatchPresentation.endTime.Content = "" + DateTime.Now.Add(timeleft);
    829847                        }
    830848                        catch
    831849                        {
    832                             localQuickWatchPresentation.endTime.Text = "in a galaxy far, far away...";
     850                            localQuickWatchPresentation.endTime.Content = "in a galaxy far, far away...";
    833851                        }
    834852                    }
    835853                    else
    836854                    {
    837                         localQuickWatchPresentation.timeLeft.Text = "incalculable :-)";
    838                         localQuickWatchPresentation.endTime.Text = "in a galaxy far, far away...";
     855                        localQuickWatchPresentation.timeLeft.Content = "incalculable :-)";
     856                        localQuickWatchPresentation.endTime.Content = "in a galaxy far, far away...";
    839857                    }
    840858
Note: See TracChangeset for help on using the changeset viewer.