Ignore:
Timestamp:
Dec 14, 2009, 6:34:34 PM (12 years ago)
Author:
weyers
Message:

myupdateprogress updated!

Location:
trunk/CrypPlugins/Transposition
Files:
3 edited

Legend:

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

    r986 r990  
    188188            if (Presentation.IsVisible)
    189189                //myPresentation.main(settings.NumberMode,Read_in_matrix,Permuted_matrix,key,Keyword,Input,Output,this.settings.Permutation,this.settings.ReadIn,this.settings.ReadOut,this.settings.Action);
    190                 myPresentation.main(Read_in_matrix, Permuted_matrix, key, Keyword, Input, output, this.settings.Permutation, this.settings.ReadIn, this.settings.ReadOut, this.settings.Action);
     190                myPresentation.main(Read_in_matrix, Permuted_matrix, key, Keyword, Input, output, this.settings.Permutation, this.settings.ReadIn, this.settings.ReadOut, this.settings.Action, this.settings.Number);
    191191            else
    192192            {
  • trunk/CrypPlugins/Transposition/TranspositionPresentation.xaml.cs

    r987 r990  
    6262        private int rein;
    6363        private int reout;
     64        private int number;
    6465        private TextBlock[] reina;
    6566        private TextBlock[] reouta;
     
    9697        /// <param name="rein"></param>
    9798        /// <param name="reout"></param>
    98         private void init(byte[,] read_in_matrix, byte[,] permuted_matrix, String keyword, int per, int rein, int reout, int act, int[] key)
     99        private void init(byte[,] read_in_matrix, byte[,] permuted_matrix, String keyword, int per, int rein, int reout, int act, int[] key,int number)
    99100        {
    100101            LinearGradientBrush myBrush = new LinearGradientBrush();
     
    147148            this.act = act;
    148149            this.key = key;
     150            this.number = number;
    149151
    150152            countup = 0;
     
    215217        }
    216218
    217         public void main(byte[,] read_in_matrix, byte[,] permuted_matrix, int[] key, String keyword, byte[] input, byte[] output, int per, int rein, int reout, int act)
     219        public void main(byte[,] read_in_matrix, byte[,] permuted_matrix, int[] key, String keyword, byte[] input, byte[] output, int per, int rein, int reout, int act,int number)
    218220        {
    219221
     
    223225                if (keyword != null && input != null)
    224226                {
    225                     init(read_in_matrix, permuted_matrix, keyword, per, rein, reout, act, key);
     227                    init(read_in_matrix, permuted_matrix, keyword, per, rein, reout, act, key, number);
    226228                    create(read_in_matrix, permuted_matrix, key, keyword, input, output);
    227229                    sizeChanged(this, EventArgs.Empty);
     
    259261
    260262                    //OLO
    261                     if (rein == 0) { textBox2.Text = "status: reading in by row"; }
    262                     else { textBox2.Text = "status: reading in by column"; }
     263                    if (rein == 0) { textBox2.Text = "reading in by row"; }
     264                    else { textBox2.Text = "reading in by column"; }
    263265
    264266
     
    280282                        TextBlock txt = new TextBlock();
    281283                        String s = key[i].ToString();
    282 
    283284                        txt.VerticalAlignment = VerticalAlignment.Center;
    284285                        if (act == 0)
     
    380381                            TextBlock txt = new TextBlock();
    381382                            txt.VerticalAlignment = VerticalAlignment.Center;
     383                            if(number==0)
    382384                            if (Convert.ToInt64(read_in_matrix[ix, i]) != 0)
    383385                                txt.Text = Convert.ToChar(read_in_matrix[ix, i]).ToString();
    384386                            else
    385387                                txt.Text = "";
     388                            else
     389                                if (Convert.ToInt64(read_in_matrix[ix, i]) != 0)
     390                                    txt.Text = read_in_matrix[ix, i].ToString("X");
     391
    386392                            if (ix % 2 == x)
    387393                                mat_back[ix, i] = Brushes.AliceBlue;
     
    412418                        txt.FontSize = 12;
    413419                        txt.FontWeight = FontWeights.ExtraBold;
     420                        if(number==0)
    414421                        txt.Text = Convert.ToChar(input[i]).ToString();
     422                        else
     423                            txt.Text = input[i].ToString();
    415424                        reina[i] = txt;
    416425                        reina[i].Background = Brushes.Transparent;
     
    443452                        txt.FontSize = 12;
    444453                        txt.FontWeight = FontWeights.ExtraBold;
     454                        if(number==0)
    445455                        txt.Text = Convert.ToChar(output[i]).ToString();
     456                        else
     457                            txt.Text = output[i].ToString("X");
    446458                        reouta[i] = txt;
    447459                        reouta[i].Background = Brushes.Orange;
     
    654666            myupdateprogress(i * 1000 / teba.GetLength(0) + 1000);
    655667            //OLOo
    656             if (per == 0) { textBox2.Text = "status: permuting by row"; }
    657             else { textBox2.Text = "status: permuting by column"; }
     668            if (per == 0) { textBox2.Text = "permuting by row"; }
     669            else { textBox2.Text = "permuting by column"; }
    658670
    659671            if (per == 1)
     
    857869                if (reout == 0)
    858870                {
    859                     myupdateprogress(outcount4 * 1000 / mat_back.GetLength(0) + 2000);
     871                    myupdateprogress(outcount4 * 1000 / mat_back.GetLength(1) + 2000);
    860872                    for (int i = rowper; i < teba.GetLength(0); i++)
    861873                    {
     
    878890                else
    879891                {
    880                     myupdateprogress(outcount4 * 1000 / mat_back.GetLength(1) + 2000);
     892                    myupdateprogress(outcount4 * 1000 / mat_back.GetLength(0) + 2000);
    881893                    for (int i = colper; i < teba.GetLength(1); i++)
    882894                    {
     
    905917        {
    906918            //OLO?
    907             if (reout == 0) { textBox2.Text = "status: reading out by row"; }
    908             else { textBox2.Text = "status: reading out by column"; }
     919            if (reout == 0) { textBox2.Text = "reading out by row"; }
     920            else { textBox2.Text = "reading out by column"; }
    909921
    910922            DoubleAnimation myDoubleAnimation = new DoubleAnimation();
     
    11181130        private void my_Help13(object sender, EventArgs e)
    11191131        {
    1120             mainGrid.Children.Remove(mywrap1);
    1121             mainGrid.Children.Remove(myGrid);
    11221132            sizeChanged(this, EventArgs.Empty);
    11231133            feuerEnde(this, EventArgs.Empty);
  • trunk/CrypPlugins/Transposition/TranspositionSettings.cs

    r940 r990  
    2020        private int Presentation_Speed = 1;
    2121        //private int hexmode = 0;
    22         //private NumberMode selectedNumberMode = NumberMode.asChar;
     22        private NumberMode selectedNumberMode = NumberMode.asChar;
    2323       
    2424        # endregion
     
    2929        public enum PermutationMode { byRow = 0, byColumn = 1 };
    3030        public enum ReadOutMode { byRow = 0, byColumn = 1 };
    31         //public enum NumberMode {asChar = 0, asHex = 1};
     31        public enum NumberMode {asChar = 0, asHex = 1};
    3232
    3333        # endregion
     
    115115        }
    116116
    117         //[PropertySaveOrder(6)]
    118         //[ContextMenu("Number Representation Mode", "Select a mode of Representation", 6, DisplayLevel.Expert, ContextMenuControlType.ComboBox, null, new string[] { "char", "hex" })]
    119         //[TaskPane("Number Representation Mode", "Select a mode of Representation", null, 6, false, DisplayLevel.Expert, ControlType.ComboBox, new string[] { "char", "hex" })]
    120         //public int NumberMode
    121         //{
    122         //    get { return (int)this.selectedNumberMode;}
    123         //    set
    124         //    {
    125         //        if ((NumberMode)value != selectedNumberMode) HasChanges = true;
    126         //        this.selectedNumberMode = (NumberMode)value;
    127         //        OnPropertyChanged("NumberMode");
    128         //    }
    129         //}
     117        [PropertySaveOrder(6)]
     118        [ContextMenu("Number Representation Mode", "Select a mode of Representation", 6, DisplayLevel.Expert, ContextMenuControlType.ComboBox, null, new string[] { "char", "hex" })]
     119        [TaskPane("Number Representation Mode", "Select a mode of Representation", null, 6, false, DisplayLevel.Expert, ControlType.ComboBox, new string[] { "char", "hex" })]
     120        public int Number
     121        {
     122            get { return (int)this.selectedNumberMode;}
     123            set
     124            {
     125                if ((NumberMode)value != selectedNumberMode) HasChanges = true;
     126                this.selectedNumberMode = (NumberMode)value;
     127                OnPropertyChanged("NumberMode");
     128            }
     129        }
    130130
    131131
Note: See TracChangeset for help on using the changeset viewer.