Changeset 75


Ignore:
Timestamp:
Nov 26, 2008, 5:25:15 PM (13 years ago)
Author:
Danail Vazov
Message:

Changes made to the Presentation and CollectionElement class. Maximum height of the bars in the Presentation is now scaled to ~200pixels.

Location:
trunk/CrypPlugins/KasiskiTest
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KasiskiTest/CollectionElement.cs

    r74 r75  
    1313        private int m_amount;
    1414        private int m_factor;
     15        private double m_height;
    1516
    1617
    17 
    18         public CollectionElement(int factor, int amount)
     18        public CollectionElement(int factor, int amount, double height)
    1919        {
    2020            m_amount = amount;
    2121            m_factor = factor;
    22            
     22            m_height = height;
    2323        }
    2424
     
    4040            }
    4141        }
    42 
     42        public double Height
     43        {
     44            get { return m_height; }
     45            set
     46            {
     47                m_height = value;
     48            }
     49        }
    4350    }
    4451}
  • trunk/CrypPlugins/KasiskiTest/KasiskiTest.cs

    r73 r75  
    2020    public class KasiskiTest : IStatistic
    2121    {
    22         public static DataSource Data = new DataSource();
     22       
    2323       
    2424
     
    2828        private string stringInput;
    2929        #endregion
    30 
     30        public static DataSource Data = new DataSource();
    3131        #region Properties (Inputs/Outputs)
    3232
     
    9292
    9393
    94         private KasiskiTestPresentation presentation;
     94        public KasiskiTestPresentation presentation;
    9595        public KasiskiTest()
    9696        {
    9797            settings = new KasiskiTestSettings();
    98             KasiskiTestPresentation presentation = new KasiskiTestPresentation(this);
     98            presentation = new KasiskiTestPresentation(this);
    9999            Presentation = presentation;
    100100        }
     
    241241                }
    242242                Data.ValueCollection.Clear();
    243                 for (int n = 2; n < factorCounter.Count()-1; n++)
     243                double bigestheight = 0;
     244                for (int z = 1; z <= factorCounter.Count(); z++)
     245                {
     246                    if (bigestheight < (double)factorCounter[z - 1])
     247                    {
     248                        bigestheight = (double)factorCounter[z - 1];
     249                    }
     250                }
     251                 
     252                for (int n = 2; n <= factorCounter.Count()-1; n++)
    244253                {
    245254                   
    246                     CollectionElement row = new CollectionElement(n, factorCounter[n]);
     255                    CollectionElement row = new CollectionElement(n, factorCounter[n], (factorCounter[n]*(200/bigestheight)) );
    247256                    Data.ValueCollection.Add(row);
    248257                }
    249                 presentation.OpenPresentationFile();
     258               
    250259
    251260                // OUTPUT
     
    254263               
    255264                {
    256                     StringOutput +=i+":"+Convert.ToString(factorCounter[i])+"\n";
    257                 }
     265                    StringOutput +=i+":"+Convert.ToString(factorCounter[i])+Environment.NewLine;
     266                }
     267                presentation.OpenPresentationFile();
    258268
    259269             //   for (int k = 0; k <= checkedGramms.Count - 1; k++)
  • trunk/CrypPlugins/KasiskiTest/KasiskiTestPresentation.xaml

    r73 r75  
    2727                    <Rectangle Height="3"/>
    2828
    29                     <Rectangle Height="{Binding Path=Amount}" Width="30" StrokeThickness="1" Stroke="Beige" RadiusX="5" RadiusY="5" >
     29                    <Rectangle Height="{Binding Path=Height}" Width="30" StrokeThickness="1" Stroke="Beige" RadiusX="5" RadiusY="5" >
    3030                        <Rectangle.BitmapEffect>
    3131                            <DropShadowBitmapEffect />
     
    6464    <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto"  ScrollViewer.HorizontalScrollBarVisibility="Auto">
    6565        <StackPanel>
    66             <TextBlock TextAlignment="Center" FontSize="20" Foreground="DarkBlue"  FontFamily="Academy" OpacityMask="Turquoise" Text="Kasiski's Test Analysis"></TextBlock>
     66            <TextBlock TextAlignment="Center" FontSize="20" Foreground="DarkBlue"  FontFamily="Academy" OpacityMask="Turquoise" Text="Probable key lengths. Probability increases with Factor Count"></TextBlock>
    6767
    6868
  • trunk/CrypPlugins/KasiskiTest/KasiskiTestPresentation.xaml.cs

    r73 r75  
    2424    public partial class KasiskiTestPresentation: UserControl
    2525    {
    26        
    2726
    2827
    29        
     28
     29        //private KasiskiTest kTest;
    3030        public KasiskiTestPresentation(KasiskiTest KasiskiTest)
    3131        {
     32            //this.kTest = KasiskiTest;
    3233            InitializeComponent();
     34            //OpenPresentationFile();
    3335           
    3436        }
Note: See TracChangeset for help on using the changeset viewer.