Changeset 2158


Ignore:
Timestamp:
Dec 3, 2010, 9:51:17 PM (11 years ago)
Author:
Sven Rech
Message:

keysearcher presentation changes

Location:
trunk/CrypPlugins/KeySearcher
Files:
5 edited

Legend:

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

    r2152 r2158  
    252252                oclManager.CreateDefaultContext(0, DeviceType.ALL);
    253253            }
     254            else
     255            {
     256                settings.UseOpenCL = false;
     257            }
    254258
    255259            settings = new KeySearcherSettings(this, oclManager);
     
    260264
    261265            settings.PropertyChanged += SettingsPropertyChanged;
     266            ((QuickWatch)QuickWatchPresentation).IsOpenCLEnabled = settings.UseOpenCL;
    262267
    263268            localBruteForceStopwatch = new Stopwatch();
     
    267272        {
    268273            p2PQuickWatchPresentation.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
    269                                                              new Action(UpdateIsP2PEnabledSetting));
    270         }
    271 
    272         void UpdateIsP2PEnabledSetting()
     274                                                             new Action(UpdateQuickwatchSettings));
     275        }
     276
     277        void UpdateQuickwatchSettings()
    273278        {
    274279            ((QuickWatch)QuickWatchPresentation).IsP2PEnabled = settings.UsePeerToPeer;
     
    484489                ((QuickWatch) QuickWatchPresentation).Dispatcher.BeginInvoke(DispatcherPriority.Normal, (SendOrPostCallback) delegate
    485490                                                                    {
    486                                                                         ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.batches.Content = subbatches;
    487                                                                         ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.threads.Content = subbatchSize;
     491                                                                        //((QuickWatch)QuickWatchPresentation).OpenCLPresentation.batches.Content = subbatches;
     492                                                                        ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.workItems.Content = subbatchSize;
    488493                                                                    }, null);
    489494                GuiLogMessage(string.Format("Now using {0} subbatches", subbatches), NotificationLevel.Info);
     
    860865                ((QuickWatch)QuickWatchPresentation).Dispatcher.BeginInvoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    861866                {
    862                     ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.keysPerSecond.Content = String.Format("{0:N}", openCLKeysPerSecond);
     867                    ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.keysPerSecondOpenCL.Content = String.Format("{0:N}", openCLKeysPerSecond);
     868                    ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.keysPerSecondCPU.Content = String.Format("{0:N}", (keysPerSecond - openCLKeysPerSecond));
    863869                    ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.ratio.Content = String.Format("{0:P}", ratio);
    864870                }, null);
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/LocalQuickWatchPresentation.xaml

    r2146 r2158  
    33    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:KeySearcherPresentation.Controls" xmlns:Converter="clr-namespace:KeySearcherConverter" x:Name="LocalQuickWatch">
    44    <UserControl.Resources>
    5         <Converter:TrueToVisibleConverter x:Key="TrueToVisibleConverter" />
     5        <Converter:TrueToVisibleConverter x:Key="TrueToVisibleOrCollapsedConverter" />
    66        <RotateTransform x:Key="HeaderRotate" Angle="270" />
    77        <Style x:Key="ValueRow1">
     
    4141                </Grid>
    4242            </Border>
     43            <Controls:OpenCLPresentation x:Name="OpenCLPresentation" Visibility="{Binding IsOpenCLEnabled, ElementName=LocalQuickWatch, Converter={StaticResource TrueToVisibleOrCollapsedConverter}}"/>
    4344            <Border BorderBrush="Silver" BorderThickness="2,0,2,2">
    4445                <Grid>
     
    8586                    </ListView>
    8687                </Grid>
    87             </Border>
    88             <Controls:OpenCLPresentation x:Name="OpenCLPresentation" Visibility="{Binding IsOpenCLEnabled, ElementName=LocalQuickWatch, Converter={StaticResource TrueToVisibleConverter}}" />
     88            </Border>           
    8989        </StackPanel>
    9090    </Viewbox>
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/LocalQuickWatchPresentation.xaml.cs

    r2146 r2158  
    11using System;
    22using System.Windows;
     3using System.Windows.Controls;
    34using System.Windows.Media;
    45using System.Collections.ObjectModel;
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/OpenCLPresentation.xaml

    r2146 r2158  
    88        </Style>
    99        <Style x:Key="ValueRow2">
    10             <Setter Property="Label.Margin" Value="80,0,0,0" />
     10            <Setter Property="Label.Margin" Value="110,0,0,0" />
    1111        </Style>
    1212    </UserControl.Resources>
     
    1414        <StackPanel Width="646">
    1515            <Border BorderBrush="Silver" BorderThickness="2,2,2,2">
    16                 <Grid Height="78" Background="#AF375700">
     16                <Grid Height="78" Background="#AF73B7A6">
    1717                    <Grid.ColumnDefinitions>
    1818                        <ColumnDefinition Width="26" />
     
    2525                        <RowDefinition Height="26" />
    2626                    </Grid.RowDefinitions>
    27                     <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FF006B00" Grid.Column="0" Grid.RowSpan="3">
     27                    <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FF3B8EA4" Grid.Column="0" Grid.RowSpan="3">
    2828                        <Label Content="OpenCL" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    2929                    </Border>
    30                     <Label Content="Keys / sec:" Grid.Column="1" Grid.Row="0" />
    31                     <Label Name="keysPerSecond" Style="{StaticResource ValueRow2}" Grid.Column="1" Grid.Row="0" />
    32                     <Label Content="Devices:" Grid.Column="2" Grid.Row="0" />
    33                     <Label Name="devices" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="0" />
    34                     <Label Content="Batches:" Grid.Column="1" Grid.Row="1" />
    35                     <Label Name="batches" Style="{StaticResource ValueRow2}" Grid.Column="1" Grid.Row="1" />
    36                     <Label Content="Threads:" Grid.Column="2" Grid.Row="1" />
    37                     <Label Name="threads" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="1" />
     30                   
     31                    <Label Content="Keys/sec (OpenCL):" Grid.Column="1" Grid.Row="0" />
     32                    <Label Name="keysPerSecondOpenCL" Style="{StaticResource ValueRow2}" Grid.Column="1" Grid.Row="0" />
     33                    <Label Content="Keys/sec (CPU):" Grid.Column="2" Grid.Row="0" />
     34                    <Label Name="keysPerSecondCPU" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="0" />
     35                   
     36                    <Label Content="Devices:" Grid.Column="1" Grid.Row="1" />
     37                    <Label Name="devices" Style="{StaticResource ValueRow2}" Grid.Column="1" Grid.Row="1" />
     38                   
     39                    <Label Content="Work Items:" Grid.Column="2" Grid.Row="1" />
     40                    <Label Name="workItems" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="1" />
     41                   
    3842                    <Label Content="Ratio:" Grid.Column="1" Grid.Row="2" />
    3943                    <Label Name="ratio" Style="{StaticResource ValueRow2}" Grid.Column="1" Grid.Row="2" />
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/P2PQuickWatchPresentation.xaml

    r2146 r2158  
    22        <UserControl.Resources>
    33                <Converter:TrueToVisibleOrCollapsedConverter x:Key="TrueToVisibleOrCollapsedConverter" />
    4         <Converter:TrueToVisibleConverter x:Key="TrueToVisibleConverter" />
    54        <Converter:LongToSizeMetricString x:Key="LongToSizeMetricString" />
    65        <Converter:DateTimeConverter x:Key="DateTimeConverter" />
     
    128127                    </Grid>
    129128                                </Border>
     129                <Controls:OpenCLPresentation x:Name="OpenCLPresentation" Visibility="{Binding IsOpenCLEnabled, ElementName=P2PQuickWatch, Converter={StaticResource TrueToVisibleOrCollapsedConverter}}" />
    130130                <Border BorderBrush="Silver" BorderThickness="2,0,2,2" Visibility="{Binding IsVerboseEnabled, ElementName=P2PQuickWatch, Converter={StaticResource TrueToVisibleOrCollapsedConverter}}">
    131131                    <Grid Height="78" Background="#AFF9C7FF">
     
    233233                        </ListView>
    234234                    </Grid>                   
    235                 </Border>
    236                 <Controls:OpenCLPresentation x:Name="OpenCLPresentation" Visibility="{Binding IsOpenCLEnabled, ElementName=P2PQuickWatch, Converter={StaticResource TrueToVisibleConverter}}" />
     235                </Border>               
    237236            </StackPanel>
    238237                </Grid>
Note: See TracChangeset for help on using the changeset viewer.