Ignore:
Timestamp:
May 20, 2009, 1:53:26 PM (13 years ago)
Author:
Sören Rinne
Message:
  • added a binary function parser that works with '*' and '+' as 'AND' and 'XOR'
File:
1 edited

Legend:

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

    r304 r318  
    206206using System.Linq;
    207207using System.Text;
     208
    208209using Cryptool.PluginBase;
    209 using Cryptool.PluginBase.Cryptography;
    210 
    211210using System.IO;
    212211using System.ComponentModel;
     212using Cryptool.PluginBase.Cryptography;
    213213using Cryptool.PluginBase.IO;
    214214using System.Windows.Controls;
     215using Cryptool.PluginBase.Miscellaneous;
     216using System.Security.Cryptography;
    215217// for [MethodImpl(MethodImplOptions.Synchronized)]
    216218using System.Runtime.CompilerServices;
     
    235237        public int inputOneFlag;
    236238        public int inputTwoFlag;
     239        public int globalControllerCount;
    237240        #endregion
    238241
     
    288291            }
    289292        }
    290         /*
     293       
    291294        private bool controllerInput;
    292295        [ControllerProperty(Direction.Input, "Controller Input", "", DisplayLevel.Beginner)]
     
    294297        {
    295298            get { return controllerInput; }
    296             set { controllerInput = (bool)value; }
    297         }*/
     299            set { controllerInput = (bool)value;
     300            globalControllerCount++;
     301            GuiLogMessage("globalControllerCount: " + globalControllerCount, NotificationLevel.Info);
     302            }
     303        }
    298304
    299305        [PropertyInfo(Direction.Output, "XOR Output", "Output after XORing input one and two. Only fires up, if both inputs are fresh.", "", false, false, DisplayLevel.Beginner, QuickWatchFormat.Text, null)]
     
    347353            if (settings.FlagInputTwo) inputTwoFlag = 1;
    348354            else inputTwoFlag = -1;
     355
     356            globalControllerCount = 0;
    349357        }
    350358
     
    381389#pragma warning disable 67
    382390        public event StatusChangedEventHandler OnPluginStatusChanged;
    383         public event GuiLogNotificationEventHandler OnGuiLogNotificationOccured;
    384391        public event PluginProgressChangedEventHandler OnPluginProgressChanged;
    385392#pragma warning restore
     393
     394        public event GuiLogNotificationEventHandler OnGuiLogNotificationOccured;
     395        private void GuiLogMessage(string message, NotificationLevel logLevel)
     396        {
     397            EventsHelper.GuiLogMessage(OnGuiLogNotificationOccured, this, new GuiLogEventArgs(message, this, logLevel));
     398        }
    386399
    387400        public void Execute()
     
    393406                inputTwoFlag = -1;
    394407
     408                // reset ControllerCount
     409                globalControllerCount = 0;
     410
    395411                output = inputOne ^ inputTwo;
    396412                OnPropertyChanged("Output");
Note: See TracChangeset for help on using the changeset viewer.