source: trunk/CrypPlugins/FriedmanTest/FriedmanTestSettings.cs @ 1941

Last change on this file since 1941 was 300, checked in by Arno Wacker, 13 years ago
  • Code cleanup for Friedman test.
  • Added some more error checking and some more info messages in log (i.e. what it gets and what it processes)
  • Added new output (double) for the index of coincidences (IC) of analyzed letters
  • Added possibility to see double values in quickwatch window
  • Extended string output to output more information, i.e. probable key length, IC analyzed, IC provided and suggestion if analyzed string was mono or polyalphabetic. The output follows a well define format of key = value, hence it can be parsed if necessary.
  • Adapted samples to reflect changes.
File size: 1.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Cryptool.PluginBase;
6using Cryptool.PluginBase.Analysis;
7using System.ComponentModel;
8
9namespace FriedmanTest
10{
11    class FriedmanTestSettings : ISettings
12    {
13
14        private bool hasChanges = false;
15        private int kappa = 0; //0="English", 1="German", 2="French", 3="Spanish", 4="Italian",5="Portugeese"
16        #region ISettings Members
17
18        [ContextMenu("Kappa plain-text", "Select the language to be analysed", 2, DisplayLevel.Beginner, ContextMenuControlType.ComboBox, null, new String[] { "English", "German", "French", "Spanish", "Italian", "Portugeese" })]
19        [TaskPane("Kappa plain-text", "Select the language to be analysed", null, 2, false, DisplayLevel.Experienced, ControlType.ComboBox, new String[] { "English", "German", "French", "Spanish", "Italian", "Portugeese" })]
20        public int Kappa
21        {
22            get { return this.kappa; }
23            set
24            {
25                if (((int)value) != kappa) hasChanges = true;
26                this.kappa = (int)value;
27                OnPropertyChanged("Kappa");
28            }
29        }
30
31        public bool HasChanges
32        {
33            get { return hasChanges; }
34            set { hasChanges = value; }
35        }
36        #endregion
37
38        #region INotifyPropertyChanged Members
39
40        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
41
42        protected void OnPropertyChanged(string name)
43        {
44            if (PropertyChanged != null)
45            {
46                PropertyChanged(this, new PropertyChangedEventArgs(name));
47            }
48        }
49
50        #endregion
51    }
52}
Note: See TracBrowser for help on using the repository browser.