Ignore:
Timestamp:
Dec 21, 2009, 9:21:59 PM (12 years ago)
Author:
Sören Rinne
Message:
  • bugfixing
  • replaced all licenses with the short version
Location:
trunk/CrypPlugins/LFSR
Files:
5 edited

Legend:

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

    r1015 r1042  
    1 using System;
     1/*
     2   Copyright 2009 Sören Rinne, Ruhr-Universität Bochum, Germany
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16
     17using System;
    218using System.Collections.Generic;
    319using System.Linq;
     
    540556                    return;
    541557                }
    542             }
    543 
    544             // convert tapSequence into char array
    545             //tapSequenceCharArray = ReverseOrder(tapSequencebuffer.ToCharArray());
    546             tapSequenceCharArray = tapSequencebuffer.ToCharArray();
     558
     559                // convert tapSequence into char array
     560                tapSequenceCharArray = tapSequencebuffer.ToCharArray();
     561            }
     562            else
     563            {
     564                GuiLogMessage("Polynomial in binary form: " + tapSequencebuffer, NotificationLevel.Info, createLog);
     565                // convert tapSequence into char array
     566                tapSequenceCharArray = ReverseOrder(tapSequencebuffer.ToCharArray());
     567            }
    547568
    548569            if (tapSequencebuffer.Length != seedbuffer.Length)
     
    563584            if (tapSequenceCharArray[tapSequenceCharArray.Length - 1] == '0')
    564585            {
    565                 GuiLogMessage("ERROR - Last tap of tapSequence must be 1. Aborting now.", NotificationLevel.Error, createLog);
     586                GuiLogMessage("ERROR - First tap of tapSequence must be 1. Aborting now.", NotificationLevel.Error, createLog);
    566587                return;
    567588            }
     
    575596                if (character != '0' && character != '1')
    576597                {
    577                     GuiLogMessage("ERROR 0 - Seed has to be binary. Aborting now. Character is: " + character, NotificationLevel.Error, createLog);
     598                    GuiLogMessage("ERROR - Seed has to be binary. Aborting now. Character is: " + character, NotificationLevel.Error, createLog);
    578599                    return;
    579600                }
     
    751772                                outputBool = false;
    752773                                outputbuffer = '0';
     774                                outputBit = '0';
     775                                // write last bit to output buffer, output stream buffer, stream and bool
     776                                outputbuffer = outputBit;
     777                                outputStringBuffer += outputBit;
     778                                OnPropertyChanged("OutputBool");
    753779                            }
    754780                            else
     
    758784                                else
    759785                                    outputBool = true;
     786                                // write last bit to output buffer, output stream buffer, stream and bool
    760787                                outputbuffer = outputBit;
     788                                outputStringBuffer += outputBit;
     789                                OnPropertyChanged("OutputBool");
    761790                            }
    762791                            //GuiLogMessage("OutputBool is: " + outputBool.ToString(), NotificationLevel.Info, true);
    763 
    764                             OnPropertyChanged("OutputBool");
    765792
    766793                            // update quickwatch presentation
  • trunk/CrypPlugins/LFSR/LFSR.csproj

    r1015 r1042  
    6565  </ItemGroup>
    6666  <ItemGroup>
     67    <None Include="LFSRClassDiagram.cd" />
    6768    <None Include="key.snk" />
    68     <None Include="LFSRClassDiagram.cd" />
    6969  </ItemGroup>
    7070  <ItemGroup>
  • trunk/CrypPlugins/LFSR/LFSRClassDiagram.cd

    r900 r1042  
    11<?xml version="1.0" encoding="utf-8"?>
    22<ClassDiagram MajorVersion="1" MinorVersion="1">
    3   <Class Name="Cryptool.LFSR.LFSR">
    4     <Position X="5.5" Y="4" Width="2.5" />
    5     <Members>
    6       <Method Name="Dispose" Hidden="true" />
    7       <Method Name="Execute" Hidden="true" />
    8       <Method Name="GuiLogMessage" Hidden="true" />
    9       <Method Name="Initialize" Hidden="true" />
    10       <Method Name="OnPropertyChanged" Hidden="true" />
    11       <Method Name="Pause" Hidden="true" />
    12       <Method Name="PostExecution" Hidden="true" />
    13       <Method Name="PreExecution" Hidden="true" />
    14       <Method Name="ProgressChanged" Hidden="true" />
    15       <Field Name="settings" Hidden="true" />
    16       <Method Name="settings_PropertyChanged" Hidden="true" />
    17       <Method Name="StatusChanged" Hidden="true" />
    18       <Method Name="Stop" Hidden="true" />
    19     </Members>
    20     <Compartments>
    21       <Compartment Name="Events" Collapsed="true" />
    22     </Compartments>
     3  <Class Name="Cryptool.LFSR.LFSR" BaseTypeListCollapsed="true">
     4    <Position X="0.5" Y="0.5" Width="2.5" />
    235    <TypeIdentifier>
    24       <HashCode>ACCgKUJAJCFQQR4zIEAAAsACgECgEABqsAAoQQBSABA=</HashCode>
     6      <HashCode>ACCgeUJAJCFQQR4jIEAAAsACgEGgEABrsAAoQQBSABA=</HashCode>
    257      <FileName>LFSR.cs</FileName>
     8    </TypeIdentifier>
     9    <Lollipop Position="0.2" />
     10  </Class>
     11  <Class Name="Cryptool.LFSR.LFSRPresentation">
     12    <Position X="3.25" Y="8.5" Width="2.5" />
     13    <TypeIdentifier>
     14      <HashCode>AEAEAAAAAAAAAAAgAAAAAAAAAAAAAAAAAgAAAIAAAAA=</HashCode>
     15      <FileName>LFSRPresentation.xaml.cs</FileName>
     16    </TypeIdentifier>
     17  </Class>
     18  <Class Name="Cryptool.LFSR.LFSRSettings" BaseTypeListCollapsed="true">
     19    <Position X="3.25" Y="0.5" Width="2.5" />
     20    <TypeIdentifier>
     21      <HashCode>QEEAAAAAAAAEUMAAJFCAACAAhQQAAJQAAgAAAgJBQAI=</HashCode>
     22      <FileName>LFSRSettings.cs</FileName>
    2623    </TypeIdentifier>
    2724    <Lollipop Position="0.2" />
  • trunk/CrypPlugins/LFSR/LFSRPresentation.xaml.cs

    r956 r1042  
    1 using System;
     1/*
     2   Copyright 2009 Sören Rinne, Ruhr-Universität Bochum, Germany
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16
     17using System;
    218using System.Collections.Generic;
    319using System.Linq;
     
    292308        public void FillBoxes(char[] state, char[] tapSequence, char output, string polynomial)
    293309        {
     310           
    294311            // fill the boxes with current state
    295312            Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    296313            {
    297                 // get the textboxes as children of myGrid. textboxes are 6 + 2 + 2 + ... [don't forget to change line 314, Col 73]
    298                 Visual childVisual;
    299                 int i;
    300                
    301                 for (i = 0; i < state.Length; i++)
     314                try
    302315                {
    303                     childVisual = (Visual)VisualTreeHelper.GetChild(myGrid, 6 + i * 2);
    304                     childVisual.SetValue(TextBox.TextProperty, state[i].ToString());
    305 
    306                     /*
    307                     // this only seems to work for children not added at runtime
    308                     Label myInfoText = myGrid.FindName("infoText") as Label;
    309                     if (myInfoText != null)
     316                    // get the textboxes as children of myGrid. textboxes are 6 + 2 + 2 + ... [don't forget to change line 314, Col 73]
     317                    Visual childVisual;
     318                    int i;
     319
     320                    for (i = 0; i < state.Length; i++)
    310321                    {
    311                         myInfoText.Background = Brushes.DodgerBlue;
    312                     }*/
    313                 }
    314 
    315                 // update output label
    316                 childVisual = (Visual)VisualTreeHelper.GetChild(myGrid, 8 + (i-1) * 2);
    317                 childVisual.SetValue(Label.ContentProperty, output);
    318 
    319                 // update polynome
    320                 childVisual = (Visual)VisualTreeHelper.GetChild(polynomialGrid, 0);
    321                 childVisual.SetValue(Label.ContentProperty, polynomial);
    322 
     322                        childVisual = (Visual)VisualTreeHelper.GetChild(myGrid, 6 + i * 2);
     323                        childVisual.SetValue(TextBox.TextProperty, state[i].ToString());
     324
     325                        /*
     326                        // this only seems to work for children not added at runtime
     327                        Label myInfoText = myGrid.FindName("infoText") as Label;
     328                        if (myInfoText != null)
     329                        {
     330                            myInfoText.Background = Brushes.DodgerBlue;
     331                        }*/
     332                    }
     333
     334                    // update output label
     335                    childVisual = (Visual)VisualTreeHelper.GetChild(myGrid, 8 + (i - 1) * 2);
     336                    childVisual.SetValue(Label.ContentProperty, output);
     337
     338                    // update polynome
     339                    childVisual = (Visual)VisualTreeHelper.GetChild(polynomialGrid, 0);
     340                    childVisual.SetValue(Label.ContentProperty, polynomial);                       
     341                } catch (Exception ex) { }
    323342            }, null);
    324343        }
  • trunk/CrypPlugins/LFSR/LFSRSettings.cs

    r985 r1042  
    1 using System;
     1/*
     2   Copyright 2009 Sören Rinne, Ruhr-Universität Bochum, Germany
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16
     17using System;
    218using System.Collections.Generic;
    319using System.Linq;
Note: See TracChangeset for help on using the changeset viewer.