Changeset 6579


Ignore:
Timestamp:
Oct 19, 2015, 7:49:57 PM (6 years ago)
Author:
konze
Message:

CryptCloud:

  • fine tune some layouts

KeySearcher (for cryptcloud):

  • format numbers
  • made local keys per second output faster
  • fix global keys per second
  • scale ui
Location:
trunk
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypCloud/CrypCloudManager/CrypCloudManager.csproj

    r6562 r6579  
    6868    <Reference Include="System.Drawing" />
    6969    <Reference Include="System.Numerics" />
     70    <Reference Include="System.Security" />
    7071    <Reference Include="System.Windows.Forms" />
    7172    <Reference Include="System.Xaml" />
     
    128129    <Compile Include="ViewModels\Base\VerificationBaseVM.cs" />
    129130    <Compile Include="ViewModels\Base\BaseViewModel.cs" />
     131    <Compile Include="ViewModels\Helper\CredentialManager.cs" />
    130132    <Compile Include="ViewModels\Helper\RelayCommand.cs" />
    131133    <Compile Include="ViewModels\JobCreationVM.cs" />
  • trunk/CrypCloud/CrypCloudManager/Screens/JobList.xaml

    r6562 r6579  
    206206        <!-- bottom controls -->
    207207        <Grid VerticalAlignment="Bottom">
    208             <Button Command="{Binding Path=RefreshJobListCommand}" HorizontalAlignment="Left" Margin="5" Width="100"
     208            <Button Command="{Binding Path=RefreshJobListCommand}" HorizontalAlignment="Left" Margin="5" Width="110"
    209209                    Height="30">
    210210                <StackPanel Orientation="Horizontal">
     
    214214            </Button>
    215215
    216             <Button Command="{Binding Path=CreateNewJobCommand}" HorizontalAlignment="Right" Margin="5" Width="100"
     216            <Button Command="{Binding Path=CreateNewJobCommand}" HorizontalAlignment="Right" Margin="5" Width="110"
    217217                    Height="30">
    218218                <StackPanel Orientation="Horizontal">
  • trunk/CrypCloud/CrypCloudManager/Screens/Login.xaml

    r6568 r6579  
    33             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    44             xmlns:viewModels="clr-namespace:CrypCloud.Manager.ViewModels"
     5             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    56             xmlns:converter="clr-namespace:CrypCloud.Manager.Screens.Converter">
    67
     
    4950                <Label Width="200" Content="{Loc _Username_label}"/>
    5051                <Grid Width="200">
    51                     <ComboBox Text="{Binding Path=Username}" ItemsSource="{Binding Path=AvailableCertificates}"
     52                    <ComboBox Text="{Binding Path=Username, Mode=TwoWay}" ItemsSource="{Binding Path=AvailableCertificates}"
    5253                              Name="UsernameInput" HorizontalAlignment="Left" IsEditable="True" IsTextSearchEnabled="True" Width="200">
    5354                    </ComboBox>
     
    5556
    5657                <Label Content="{Loc _Password_label}" Width="200"/>
    57                     <PasswordBox PasswordChanged="PasswordBox_PasswordChanged" Width="200" MaxLength="40" />     
     58                <PasswordBox PasswordChanged="PasswordBox_PasswordChanged" Width="200" MaxLength="40" />     
    5859                <Label/>
    5960
  • trunk/CrypCloud/CrypCloudManager/Screens/Login.xaml.cs

    r6498 r6579  
    11
     2using System.IO;
     3using System.IO.IsolatedStorage;
     4using System.Security;
    25using System.Windows;
    36using System.Windows.Controls;
    4 using CrypCloud.Manager.ViewModels;
     7using CrypCloud.Manager.ViewModels;
     8using CrypCloud.Manager.ViewModels.Helper;
    59
    610namespace CrypCloud.Manager.Screens
  • trunk/CrypCloud/CrypCloudManager/ViewModels/LoginVM.cs

    r6568 r6579  
    11using System;
    22using System.Collections.Generic;
     3using System.Reflection;
    34using System.Security;
     5using System.Security.Cryptography;
     6using System.Text;
    47using CrypCloud.Core;
    58using CrypCloud.Manager.Services;
     
    1114    public class LoginVM : BaseViewModel
    1215    {
     16        public List<string> AvailableCertificates { get; set; }
     17        public string Username { get; set; }
     18        public SecureString Password { private get; set; }
     19       
     20        public RelayCommand RememberPasswordCommand { get; set; }
     21        public RelayCommand LoginCommand { get; set; }
     22        public RelayCommand CreateNewAccountCommand { get; set; }
     23        public RelayCommand ResetPasswordCommand { get; set; }
     24
    1325        public LoginVM()
    1426        {
     
    1931            LoginCommand = new RelayCommand(it => GetCertificateAndLogin());
    2032        }
    21 
    22         public List<string> AvailableCertificates { get; set; }
    23 
    24         public string Username { get; set; }
    25         public SecureString Password { private get; set; }
    26 
    27         public RelayCommand LoginCommand { get; set; }
    28         public RelayCommand CreateNewAccountCommand { get; set; }
    29         public RelayCommand ResetPasswordCommand { get; set; }
    3033
    3134        /// <summary>
  • trunk/CrypPlugins/KeySearcher/CrypCloud/CloudKeySearcher.cs

    r6549 r6579  
    1414using Cryptool.PluginBase.Miscellaneous;
    1515using KeySearcher.CrypCloud;
     16using KeySearcher.CrypCloud.statistics;
    1617using KeySearcher.KeyPattern;
    1718using KeySearcherPresentation.Controls;
     
    1920using voluntLib.common.eventArgs;
    2021using voluntLib.common.interfaces;
     22using Timer = System.Timers.Timer;
    2123
    2224namespace KeySearcher
     
    2426    internal class CloudKeySearcher
    2527    {
     28        public int UpdateInterval = 2000;
     29
    2630        private readonly KeySearcher keySearcher;
    2731        private readonly CalculationTemplate calculationTemplate;
     
    2933        private readonly P2PPresentationVM viewModel;
    3034        private readonly TaskFactory uiContext;
     35       
     36        private readonly SpeedStatistics globalSpeedStatistics = new SpeedStatistics();
     37        private readonly SpeedStatistics localSpeedStatistics = new SpeedStatistics();
     38
     39        private Timer updateTimer;
    3140
    3241        public CloudKeySearcher(JobDataContainer jobDataContainer, KeyPattern.KeyPattern pattern, P2PQuickWatchPresentation presentation, KeySearcher keySearcher)
     
    4352            uiContext = presentation.UiContext;
    4453            viewModel = presentation.ViewModel;
    45 
     54            viewModel.GlobalSpeedStatistics = globalSpeedStatistics;
     55            viewModel.LocalSpeedStatistics = localSpeedStatistics;
    4656
    4757            RunInUiContext(() =>
     
    5060                UpdatePresentation(presentation, keySearcher);
    5161            });
     62
     63        }
     64
     65
     66        private void UpdateKeyPerSecond(object sender, ElapsedEventArgs elapsedEventArgs)
     67        {
     68            var globalApproximateKeysPerSecond = globalSpeedStatistics.ApproximateKeysPerSecond();
     69            var localApproximateKeysPerSecond = localSpeedStatistics.ApproximateKeysPerSecond();
     70            RunInUiContext(() =>
     71            {
     72                viewModel.UpdateGlobalSpeed(globalApproximateKeysPerSecond);
     73                viewModel.UpdateLocalSpeed(localApproximateKeysPerSecond);
     74            });
    5275        }
    5376
    5477        private void TaskProgress(object sender, TaskEventArgs e)
    5578        {
    56            // throw new NotImplementedException();
     79           localSpeedStatistics.AddEntry(e.TaskProgress);
     80           var localApproximateKeysPerSecond = localSpeedStatistics.ApproximateKeysPerSecond();
     81           RunInUiContext(() =>
     82           {
     83               viewModel.UpdateLocalSpeed(localApproximateKeysPerSecond);
     84           });
    5785        }
    5886
     
    81109            var keyResultEntries = progress.ResultList.Select(it => new KeyResultEntry(it)).ToList();
    82110            keyResultEntries.Sort();
    83 
     111             
    84112            RunInUiContext(
    85113                () => viewModel.BlockHasBeenFinished(progress, keyResultEntries)
     
    92120        }
    93121
    94      
    95122
    96123        private void UpdatePresentation(P2PQuickWatchPresentation presentation, KeySearcher keySearcher)
     
    107134        {
    108135            CrypCloudCore.Instance.StartLocalCalculation(jobId, calculationTemplate);
     136
     137            updateTimer = new Timer(UpdateInterval);
     138            updateTimer.Elapsed += UpdateKeyPerSecond;
     139            updateTimer.Interval = UpdateInterval;
     140            updateTimer.Enabled = true; 
    109141        }
    110142
    111143        public void Stop()
    112144        {
     145            try
     146            {
     147                updateTimer.Enabled = false;
     148                updateTimer.Stop();
     149            } catch (Exception){}
     150
    113151            try
    114152            {
  • trunk/CrypPlugins/KeySearcher/CrypCloud/calculation/Worker.cs

    r6518 r6579  
    66using System.Runtime.CompilerServices;
    77using System.Threading;
     8using System.Windows.Input;
    89using Cryptool.PluginBase.Control;
    910using KeySearcher.CrypCloud;
     
    3132        {
    3233            var keySet = GetKeySetForBlock(blockId);
    33             var bestKeys = FindBestKeysInBlock(keySet, cancelToken);
     34            var bestKeys = FindBestKeysInBlock(keySet, cancelToken, blockId);
    3435            return CreateCalculationResult(blockId, bestKeys);
    3536        }
     
    4748
    4849
    49         private IEnumerable<KeyResultEntry> FindBestKeysInBlock(IKeyTranslator keyTranslator, CancellationToken cancelToken)
     50        private IEnumerable<KeyResultEntry> FindBestKeysInBlock(IKeyTranslator keyTranslator, CancellationToken cancelToken, BigInteger blockId)
    5051        {
    5152            var controlEncryption = jobData.CryptoAlgorithm;
     
    5455            var initVector = jobData.InitVector;
    5556            var bytesToUse = jobData.BytesToUse;
    56 
     57             
    5758            var top10Keys = InitTop10Keys();
    5859            var index = 0;
     
    7273                {
    7374                    cancelToken.ThrowIfCancellationRequested();
     75                    OnProgressChanged(blockId, 100000);
    7476                }
    7577            }
     78
     79            OnProgressChanged(blockId, index % 100000);
    7680            return top10Keys;
    7781        }
  • trunk/CrypPlugins/KeySearcher/CrypCloud/model/JobDataContainer.cs

    r6509 r6579  
    1313        public byte[] InitVector { get; set; }
    1414        public BigInteger NumberOfBlocks { get; set; }
     15
    1516    }
    1617}
  • trunk/CrypPlugins/KeySearcher/CrypCloud/model/P2PPresentationVM.cs

    r6549 r6579  
    2222    public class P2PPresentationVM : INotifyPropertyChanged
    2323    {
    24 
    2524        private String jobName;
    2625        private String jobDesc;
     
    4443        private TimeSpan remainingTimeTotal;
    4544        private DateTime estimatedFinishDate;
     45        private BigInteger numberOfLeftBlocks = -1;
     46
     47        public SpeedStatistics GlobalSpeedStatistics { get; set; }
     48        public SpeedStatistics LocalSpeedStatistics { get; set; }
     49
     50        public TaskFactory UiContext { get; set; }
    4651
    4752        public ObservableCollection<BigInteger> CurrentChunks { get; set; }
    4853        public ObservableCollection<KeyResultEntry> TopList { get; set; }
    4954
    50 
    51         private readonly SpeedStatistics globalSpeedStatistics = new SpeedStatistics();
    52         private readonly SpeedStatistics localSpeedStatistics = new SpeedStatistics();
    5355
    5456        public P2PPresentationVM()
     
    5759            AvgTimePerChunk = new TimeSpan(0);
    5860            TopList = new ObservableCollection<KeyResultEntry>();
    59             CurrentChunks = new ObservableCollection<BigInteger>();
    60         }
    61 
    62        
    63          
     61            CurrentChunks = new ObservableCollection<BigInteger>();
     62           
     63        }
     64 
    6465        #region local calculation
    6566
     
    8182            }
    8283
    83             if (taskArgs.Type == TaskEventArgType.Finished)
    84             {
    85                 localSpeedStatistics.Tick(KeysPerBlock);
    86                 AvgTimePerChunk = localSpeedStatistics.LatestAvgTime;
    87                 KeysPerSecond = localSpeedStatistics.LatestKeysPerSecond;
    88 
     84            if (itemInList == 0 && CurrentChunks.Contains(0))
     85            {
     86                CurrentChunks.Remove(0);
     87                OnPropertyChanged("CurrentChunks");
     88            }
     89           
     90           if (taskArgs.Type == TaskEventArgType.Finished)
     91            {
    8992                LocalFinishedChunks++;
    9093            }
     
    99102        public void BlockHasBeenFinished(JobProgressEventArgs progress, List<KeyResultEntry> keyResultEntries)
    100103        {
    101             globalSpeedStatistics.Tick(KeysPerBlock);
    102             AvgTimePerChunkGlobal = globalSpeedStatistics.LatestAvgTime;
    103             KeysPerSecondGlobal = globalSpeedStatistics.LatestKeysPerSecond;
    104          
     104            GlobalSpeedStatistics.AddEntry(KeysPerBlock);
    105105            GlobalProgress = 100 * progress.NumberOfCalculatedBlocks.DivideAndReturnDouble(progress.NumberOfBlocks);
    106 
    107             var numberOfLeftBlocks = progress.NumberOfBlocks - progress.NumberOfCalculatedBlocks;
    108             var remainingTicks = (long) (AvgTimePerChunkGlobal.Ticks * numberOfLeftBlocks);
     106            numberOfLeftBlocks = progress.NumberOfBlocks - progress.NumberOfCalculatedBlocks;
     107            FillTopList(keyResultEntries);
     108        }
     109
     110        public void UpdateGlobalSpeed(BigInteger keysPerSecond)
     111        {
     112            KeysPerSecondGlobal = keysPerSecond;
     113            if (keysPerSecond != 0)
     114            {
     115                var timePerBlock = (KeysPerBlock.DivideAndReturnDouble(KeysPerSecondGlobal));
     116                AvgTimePerChunkGlobal = TimeSpan.FromSeconds(timePerBlock);
     117            }
     118
     119            if(numberOfLeftBlocks == -1) return;
     120
     121            var remainingTicks = (long)(AvgTimePerChunkGlobal.Ticks * numberOfLeftBlocks);
    109122
    110123            RemainingTimeTotal = new TimeSpan(remainingTicks);
    111124            EstimatedFinishDate = DateTime.Now.Add(RemainingTimeTotal);
    112 
    113             FillTopList(keyResultEntries);
    114         }
    115    
     125        }
     126
     127
     128        public void UpdateLocalSpeed(BigInteger localApproximateKeysPerSecond)
     129        {
     130            KeysPerSecond = localApproximateKeysPerSecond;
     131            if (keysPerSecond != 0)
     132            {
     133                var timePerBlock = (KeysPerBlock.DivideAndReturnDouble(localApproximateKeysPerSecond));
     134                AvgTimePerChunk = TimeSpan.FromSeconds(timePerBlock);
     135            }
     136        }
     137
     138
    116139        private void FillTopList(List<KeyResultEntry> keyResultEntries)
    117140        {
     
    304327        }
    305328
    306 
    307329        #endregion
    308330
     
    322344        #endregion
    323345
    324      
     346       
    325347    }
    326348}
  • trunk/CrypPlugins/KeySearcher/CrypCloud/statistics/SpeedStatistics.cs

    r6518 r6579  
    11using System;
     2using System.Collections.Concurrent;
    23using System.Collections.Generic;
    34using System.Linq;
     
    78namespace KeySearcher.CrypCloud.statistics
    89{
    9     class SpeedStatistics
     10    public class SpeedStatistics
    1011    {
    11         public TimeSpan LatestAvgTime { get; set; }
    12         public BigInteger LatestKeysPerSecond { get; set; }
    13    
    14         private DateTime lastTick = DateTime.Now;
    15         private readonly CricularBuffer<long> buffer = new CricularBuffer<long>(10);
     12        public static int MinutesUntilEntryInvalidates = 30;
    1613
    17         public void Tick(BigInteger keysPerBlock)
     14        private DateTime statisticsStartTime = DateTime.UtcNow;
     15        private readonly List<SpeedStatisticsEntry> calculations = new List<SpeedStatisticsEntry>();
     16
     17        public void AddEntry(BigInteger numberOfKeysCalculated)
    1818        {
    19             var timeSpan = DateTime.Now.Subtract(lastTick);
    20             buffer.Enqueue(timeSpan.Ticks);
    21             LatestAvgTime = CalculateAvgTime(buffer);
     19            var entry = new SpeedStatisticsEntry
     20            {
     21                NumberOfKeysInBlock = numberOfKeysCalculated,
     22                InvalidatesAt = DateTime.UtcNow.AddMinutes(MinutesUntilEntryInvalidates)
     23            };
    2224
    23             LatestKeysPerSecond = CalculateGlobalKeyPerSecond(LatestAvgTime, keysPerBlock);
    24 
    25             lastTick = DateTime.Now;
    26         }
    27 
    28         private static TimeSpan CalculateAvgTime(CricularBuffer<long> cricularBuffer)
    29         {
    30             var average = cricularBuffer.Average();
    31             return TimeSpan.FromTicks(Convert.ToInt64(average));
     25            lock (this)
     26            {
     27                calculations.Add(entry);
     28            }
    3229        }
    3330
    3431
    35         private static BigInteger CalculateGlobalKeyPerSecond(TimeSpan avgTickTime, BigInteger keysPerBlock)
     32        /// <summary>
     33        /// Approximates the speed of the calcuation by constructing the avg of all entrys received within the last 30 minutes
     34        /// </summary>
     35        /// <returns></returns>
     36        public BigInteger ApproximateKeysPerSecond()
    3637        {
    37             if (avgTickTime.Ticks == 0) return 0;
     38            BigInteger calculatedKeys;
     39            lock (this)
     40            {
     41                calculations.RemoveAll(it => it.InvalidatesAt < DateTime.UtcNow);
     42                calculatedKeys = calculations.Aggregate(new BigInteger(0), (prev, it) => prev + it.NumberOfKeysInBlock);
     43            }
    3844
    39             var timeTick = avgTickTime.Ticks;
    40             var keyPerTick = keysPerBlock.DivideAndReturnDouble(new BigInteger(timeTick));
    41             return new BigInteger(keyPerTick * TimeSpan.TicksPerSecond);
     45            var seconds = MinutesUntilEntryInvalidates*60;
     46            if (statisticsStartTime.AddMinutes(MinutesUntilEntryInvalidates) > DateTime.UtcNow)
     47            {
     48                var timeSpan = (DateTime.UtcNow - statisticsStartTime);
     49                seconds = (int) timeSpan.TotalSeconds;
     50            }
     51
     52            if (seconds == 0)
     53            {
     54                return 0;
     55            }
     56            return calculatedKeys / seconds;
    4257        }
    43          
     58    }
    4459
     60    internal class SpeedStatisticsEntry
     61    {
     62        public DateTime InvalidatesAt { get; set; }
     63
     64        public BigInteger NumberOfKeysInBlock { get; set; }
    4565    }
     66
    4667}
  • trunk/CrypPlugins/KeySearcher/KeySearcher.csproj

    r6518 r6579  
    6969    </Reference>
    7070    <Reference Include="System.Numerics" />
     71    <Reference Include="System.ServiceModel" />
    7172    <Reference Include="System.Xaml" />
    7273    <Reference Include="System.Xml.Linq">
     
    8687  </ItemGroup>
    8788  <ItemGroup>
     89    <Compile Include="Converter\BigIntegerToStringConverter.cs" />
    8890    <Compile Include="Converter\BigIntegerToHexStringConverter.cs" />
    8991    <Compile Include="Converter\ByteArrayToUtf8StringConverter.cs" />
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/LocalQuickWatchPresentation.xaml

    r6344 r6579  
    4747                    </Grid>
    4848                </Border>
    49                 <Controls:OpenCLPresentation x:Name="OpenCLPresentation" Visibility="{Binding IsOpenCLEnabled, ElementName=LocalQuickWatch, Converter={StaticResource TrueToVisibleOrCollapsedConverter}}" Loaded="OpenCLPresentation_Loaded" />
     49                <Controls:OpenCLPresentation x:Name="OpenCLPresentation"
     50                                             Visibility="{Binding IsOpenCLEnabled, ElementName=LocalQuickWatch, Converter={StaticResource TrueToVisibleOrCollapsedConverter}}" Loaded="OpenCLPresentation_Loaded" />
    5051                <Border BorderBrush="Silver" BorderThickness="2,0,2,2">
    5152                    <Grid>
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/P2PQuickWatchPresentation.xaml

    r6518 r6579  
    33             xmlns:con="clr-namespace:KeySearcher.Converter"
    44             xmlns:crypCloud="clr-namespace:KeySearcher.CrypCloud"
    5              mc:Ignorable="d" x:Name="P2PQuickWatch" Loaded="P2PQuickWatch_Loaded">
     5             x:Name="P2PQuickWatch" Loaded="P2PQuickWatch_Loaded">
    66
    77    <UserControl.Resources>
     8        <con:BigIntegerToStringConverter x:Key="BigIntegerToStringConverter"/>
    89        <con:ByteArrayToHexStringConverter x:Key="ByteArrayToHexStringConverter"/>
    910        <con:BigIntegerToHexStringConverter x:Key="BigIntegerToHexStringConverter" />
     
    2425    </UserControl.DataContext>
    2526   
    26     <Viewbox Height="371">
     27    <Viewbox>
    2728                <Grid Width="646" >
    2829            <StackPanel>
     
    3637                                                <Grid.ColumnDefinitions>
    3738                            <ColumnDefinition Width="26" />
    38                             <ColumnDefinition Width="*" />
    39                             <ColumnDefinition Width="*" />
     39                            <ColumnDefinition Width="200*" />
     40                            <ColumnDefinition Width="200*" />
    4041                                                </Grid.ColumnDefinitions>
    4142                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Grid.RowSpan="3" Grid.Column="0" Background="#FF5C5CFF">
     
    4950
    5051                        <Label Content="{Loc Total_Chunks_}" VerticalAlignment="Center" Grid.Row="2" Grid.Column="1" />
    51                         <Label Content="{Binding TotalAmountOfChunks, FallbackValue=-}" Grid.Row="2" Name="TotalAmountOfChunks" VerticalAlignment="Center" Grid.Column="1" Style="{StaticResource ValueRow}" />
     52                        <Label Content="{Binding TotalAmountOfChunks, FallbackValue=-, Converter={StaticResource BigIntegerToStringConverter}}" Grid.Row="2" Name="TotalAmountOfChunks" VerticalAlignment="Center" Grid.Column="1" Style="{StaticResource ValueRow}" />
    5253
    5354                        <Label Content="{Loc Keys_Per_Chunk_}" VerticalAlignment="Center" Grid.Row="2"  Grid.Column="2" />
    54                         <Label Content="{Binding KeysPerBlock, FallbackValue=-}" Name="KeysPerChunk" Grid.Row="2"  VerticalAlignment="Center" Grid.Column="2" Style="{StaticResource ValueRow}" />
     55                        <Label Content="{Binding KeysPerBlock, FallbackValue=-, Converter={StaticResource BigIntegerToStringConverter}}" Name="KeysPerChunk" Grid.Row="2"  VerticalAlignment="Center" Grid.Column="2" Style="{StaticResource ValueRow}" />
    5556                                        </Grid>
    5657                                </Border>
    57 
     58               
    5859                <!-- global -->
    5960                <Border BorderBrush="Silver" BorderThickness="2,0,2,2">
     
    6162                        <Grid.ColumnDefinitions>
    6263                            <ColumnDefinition Width="26" />
    63                             <ColumnDefinition Width="*" />
    64                             <ColumnDefinition Width="*" />
     64                            <ColumnDefinition Width="200*" />
     65                            <ColumnDefinition Width="200*" />
    6566                        </Grid.ColumnDefinitions>
    6667                        <Grid.RowDefinitions>
    6768                            <RowDefinition Height="26" />
    6869                            <RowDefinition Height="26" />
    69                             <RowDefinition Height="26" /> 
     70                            <RowDefinition Height="26" />
    7071                        </Grid.RowDefinitions>
    7172                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FF099BA7" Grid.Column="0" Grid.RowSpan="99">
     
    7677                        <Label Content="{Binding AvgTimePerChunkGlobal, FallbackValue=-,Converter={StaticResource TimeSpanToStringConverter}}" Grid.Column="1" Grid.Row="0" Style="{StaticResource ValueRow}" />
    7778
    78                         <Label Content="{Loc keys_per_sec}" Grid.Column="2" Grid.Row="0" />
    79                         <Label Content="{Binding KeysPerSecondGlobal, FallbackValue=-}" Grid.Column="2" Grid.Row="0" Style="{StaticResource ValueRow}" />
    80                        
    81                        
     79                        <Label Content="{Loc Keys_Sec_}" Grid.Column="2" Grid.Row="0" />
     80                        <Label Content="{Binding KeysPerSecondGlobal, FallbackValue=-, Converter={StaticResource BigIntegerToStringConverter}}" Grid.Column="2" Grid.Row="0" Style="{StaticResource ValueRow}" />
     81
     82
    8283
    8384                        <Label Content="{Loc End_}" HorizontalAlignment="Left" Grid.Column="1" Grid.Row="1" />
    8485                        <Label Content="{Binding EstimatedFinishDate, FallbackValue=-, Converter={StaticResource DateTimeConverter}}" Grid.Column="1" Style="{StaticResource ValueRow}" Grid.Row="1" />
    85                        
     86
    8687                        <Label Content="{Loc Remaining_}" Grid.Column="2" Grid.Row="1" />
    8788                        <Label Content="{Binding RemainingTimeTotal, FallbackValue=-, Converter={StaticResource TimeSpanToStringConverter}}" Grid.Column="2" Grid.Row="1" Style="{StaticResource ValueRow}" />
     
    99100                <Border BorderBrush="Silver" BorderThickness="2,0,2,2">
    100101                    <Grid Height="78" Background="#AFFFD4C1">
    101                                                 <Grid.ColumnDefinitions>
     102                        <Grid.ColumnDefinitions>
    102103                            <ColumnDefinition Width="26" />
    103                             <ColumnDefinition Width="*" />
    104                             <ColumnDefinition Width="*" /> 
    105                                                 </Grid.ColumnDefinitions>
    106                                                 <Grid.RowDefinitions>
    107                                                         <RowDefinition Height="26" />
     104                            <ColumnDefinition Width="200*" />
     105                            <ColumnDefinition Width="200*" />
     106                        </Grid.ColumnDefinitions>
     107                        <Grid.RowDefinitions>
    108108                            <RowDefinition Height="26" />
    109109                            <RowDefinition Height="26" />
    110                                                 </Grid.RowDefinitions>
     110                            <RowDefinition Height="26" />
     111                        </Grid.RowDefinitions>
    111112                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FFE56B00" Grid.Column="0" Grid.RowSpan="99">
    112113                            <Label Content="{Loc Local_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    113114                        </Border>
    114                        
     115
    115116                        <Label Content="{Loc Finished_Chunks_}" Grid.Column="1" Grid.Row="0" />
    116117                        <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" ToolTip="{Loc Finished_Chunks_Tooltip}">
    117                             <Label Content="{Binding LocalFinishedChunks,  FallbackValue=-}" HorizontalContentAlignment="Right" Padding="5,5,5,5" /> 
     118                            <Label Content="{Binding LocalFinishedChunks,  FallbackValue=-}" HorizontalContentAlignment="Right" Padding="5,5,5,5" />
    118119                        </StackPanel>
    119120
    120121                        <Label Content="{Loc Abort_Chunks_}" Grid.Column="2" Grid.Row="0" />
    121122                        <StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="0" HorizontalAlignment="Right" ToolTip="{Loc Finished_Chunks_Tooltip}">
    122                             <Label Content="{Binding LocalAbortChunks,  FallbackValue=-}" HorizontalContentAlignment="Right" Padding="5,5,5,5" /> 
     123                            <Label Content="{Binding LocalAbortChunks,  FallbackValue=-}" HorizontalContentAlignment="Right" Padding="5,5,5,5" />
    123124                        </StackPanel>
    124                        
     125
    125126                        <Label Content="{Loc Avg_Time_Per_Chunk}" Grid.Column="1" Grid.Row="1" />
    126127                        <Label Content="{Binding AvgTimePerChunk, FallbackValue=-,  Converter={StaticResource TimeSpanToStringConverter}}" Grid.Column="1" Grid.Row="1" Style="{StaticResource ValueRow}" />
    127128
    128                         <Label Content="{Loc keys_per_sec}" Grid.Column="2" Grid.Row="1" />
    129                         <Label Content="{Binding KeysPerSecond, FallbackValue=-}" Grid.Column="2" Grid.Row="1" Style="{StaticResource ValueRow}" />
    130                        
     129                        <Label Content="{Loc Keys_Sec_}" Grid.Column="2" Grid.Row="1" />
     130                        <Label Content="{Binding KeysPerSecond, FallbackValue=-, Converter={StaticResource BigIntegerToStringConverter}}" Grid.Column="2" Grid.Row="1" Style="{StaticResource ValueRow}" />
     131
    131132                        <Label Content="{Loc Current_Chunk_}" Grid.Column="1" Grid.Row="3" />
    132133                        <Label Content="{Binding CurrentChunks, FallbackValue=-, Converter={StaticResource ListToStringConverter}}" Grid.Column="1" Grid.Row="3" Style="{StaticResource ValueRow}" />
    133134
    134135                    </Grid>
    135                                 </Border>
    136                
     136                </Border>
    137137                <!-- top ten -->
    138138                <Border BorderBrush="Silver" BorderThickness="2,0,2,2">
     
    179179                            </ListView.View>
    180180                        </ListView>
    181                     </Grid>                   
    182                 </Border>   
    183                
     181                    </Grid>
     182                </Border>
    184183            </StackPanel>
    185184                </Grid>
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/P2PQuickWatchPresentation.xaml.cs

    r6518 r6579  
    3434            ViewModel = DataContext as P2PPresentationVM;
    3535            UiContext = new TaskFactory(TaskScheduler.FromCurrentSynchronizationContext());
     36            ViewModel.UiContext = UiContext;
    3637        }
    3738
Note: See TracChangeset for help on using the changeset viewer.