Changeset 1464


Ignore:
Timestamp:
May 24, 2010, 12:19:44 AM (12 years ago)
Author:
Sven Rech
Message:

changed quadratic sieve presentation a litte bit

Location:
trunk/CrypPlugins/QuadraticSieve
Files:
3 edited

Legend:

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

    r1463 r1464  
    143143                    quadraticSieveQuickWatchPresentation.endTime.Text = endtime_message;
    144144                    quadraticSieveQuickWatchPresentation.timeLeft.Text = timeLeft_message;
     145                    quadraticSieveQuickWatchPresentation.factorList.Items.Clear();
     146                    quadraticSieveQuickWatchPresentation.factorInfo.Content = "Searching trivial factors!";                   
    145147                }
    146148                , null);   
     
    181183                        quadraticSieveQuickWatchPresentation.endTime.Text = endtime_message;
    182184                        quadraticSieveQuickWatchPresentation.timeLeft.Text = timeLeft_message;
     185                        quadraticSieveQuickWatchPresentation.factorInfo.Content = "";
    183186                    }
    184187                    , null);
     
    199202                        quadraticSieveQuickWatchPresentation.endTime.Text = endtime_message;
    200203                        quadraticSieveQuickWatchPresentation.timeLeft.Text = timeLeft_message;
     204                        quadraticSieveQuickWatchPresentation.factorInfo.Content = "";
    201205                    }
    202206                    , null);
     
    349353                ProgressChanged(0.9, 1.0);
    350354                GuiLogMessage("Sieving finished", NotificationLevel.Info);
     355                quadraticSieveQuickWatchPresentation.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     356                {                   
     357                    quadraticSieveQuickWatchPresentation.factorInfo.Content = "Found enough relations! Please wait...";
     358                }, null);
    351359                stopThreads();
    352360                yieldqueue.Clear();
     
    453461                //get one composite factor, which we want to sieve now:
    454462                BigInteger compositeFactor = factorManager.GetCompositeFactor();
     463                quadraticSieveQuickWatchPresentation.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     464                {
     465                    quadraticSieveQuickWatchPresentation.factorInfo.Content = "Now sieving first composite factor!";
     466                }, null);
    455467
    456468                //now start quadratic sieve on it:               
     
    485497                    MethodInfo serializeYield = msieve.GetMethod("serializeYield");
    486498                    byte[] serializedYield = (byte[])serializeYield.Invoke(null, new object[] { yield });
    487                     /*MethodInfo deserializeYield = msieve.GetMethod("deserializeYield");
    488                     yield = (IntPtr)deserializeYield.Invoke(null, new object[] { serializedYield });*/
     499                    MethodInfo deserializeYield = msieve.GetMethod("deserializeYield");
     500                    yield = (IntPtr)deserializeYield.Invoke(null, new object[] { serializedYield });
    489501
    490502                    yieldqueue.Enqueue(yield);
     
    536548        private void FactorsChanged(List<BigInteger> primeFactors, List<BigInteger> compositeFactors)
    537549        {
    538             GuiLogMessage("Factors Changed:", NotificationLevel.Debug);
    539 
    540             foreach (BigInteger pf in primeFactors)
    541                 GuiLogMessage("Prime Factor: " + pf.ToString(), NotificationLevel.Debug);
    542 
    543             foreach (BigInteger cf in compositeFactors)
    544                 GuiLogMessage("Composite Factor: " + cf.ToString(), NotificationLevel.Debug);
     550            quadraticSieveQuickWatchPresentation.Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     551            {
     552                quadraticSieveQuickWatchPresentation.factorList.Items.Clear();
     553
     554                foreach (BigInteger pf in primeFactors)         
     555                    quadraticSieveQuickWatchPresentation.factorList.Items.Add("Prime Factor: " + pf.ToString());           
     556
     557                foreach (BigInteger cf in compositeFactors)
     558                    quadraticSieveQuickWatchPresentation.factorList.Items.Add("Composite Factor: " + cf.ToString());
     559            }, null);
    545560        }
    546561
  • trunk/CrypPlugins/QuadraticSieve/QuadraticSievePresentation.xaml

    r1026 r1464  
    77    Name="Presentation">
    88    <Canvas Name="Canvas">
    9     <Grid Name="Grid" Width="250" Height="100" ShowGridLines="False">
     9    <Grid Name="Grid" ShowGridLines="False">
    1010        <Grid.RowDefinitions>
    1111            <RowDefinition Height="*"/>
    1212            <RowDefinition Height="*"/>
     13            <RowDefinition Height="150"/>
    1314            <RowDefinition Height="*"/>
    1415            <RowDefinition Height="*"/>
     
    2425        <TextBox Name="timeLeft" Grid.Row="1" TextAlignment="Center" IsReadOnly="True" TextWrapping="WrapWithOverflow" Focusable="True" BorderThickness="1" Margin="1" BorderBrush="AliceBlue" />
    2526        <TextBox Name="endTime" Grid.Row="1" Grid.Column="1" TextAlignment="Center" IsReadOnly="True" TextWrapping="WrapWithOverflow" BorderThickness="1" Margin="1" BorderBrush="AliceBlue" />
    26         <Label Grid.Row="2" FontSize="12" Grid.ColumnSpan="2" Name="Label3" Margin="1"></Label>
    27        
    28         <TextBox Name="logging" Grid.Row="3" Grid.ColumnSpan="2" TextAlignment="Left" IsReadOnly="True" TextWrapping="WrapWithOverflow" BorderThickness="1" Margin="1" BorderBrush="AliceBlue" />
    29     </Grid>
     27        <ListBox Grid.Row="2" Grid.ColumnSpan="2" Name="factorList" Canvas.Left="1" Canvas.Top="50" Height="150" Width="233" />
     28        <Label Grid.Row="3" Grid.ColumnSpan="2" Content="" HorizontalAlignment="Left" Name="factorInfo" VerticalAlignment="Top" />
     29        <TextBox Name="logging" Grid.Row="4" Grid.ColumnSpan="2" TextAlignment="Left" IsReadOnly="True" TextWrapping="WrapWithOverflow" BorderThickness="1" Margin="1" BorderBrush="AliceBlue" />       
     30        </Grid>       
    3031    </Canvas>
    3132</UserControl>
  • trunk/CrypPlugins/QuadraticSieve/QuadraticSievePresentation.xaml.cs

    r902 r1464  
    3232        {
    3333            this.Grid.RenderTransform = new ScaleTransform( this.ActualWidth / this.Grid.ActualWidth,
    34                                                        this.ActualHeight / this.Grid.ActualHeight);                       
     34                                                       this.ActualHeight / this.Grid.ActualHeight);
    3535        }
    3636    }
Note: See TracChangeset for help on using the changeset viewer.