コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            tmp1 = "";
            tmp2 = "";
            dana = inputTxt.Text;

            tablicaBitowa = BitHelper.GetBytes(dana);
            for (int i = 0; i < tablicaBitowa.Length; i++)
            {
                tmp1 += tablicaBitowa[i];
            }
            input                        = BitHelper.BytesToInts(tablicaBitowa);
            encoded                      = hamming.GenerateCode(input);
            disturbedTxt.Text            = BitHelper.IntsToString(hamming.Disturbed);
            DisturbedBits                = GetDisturbedBits();
            DisturbedBitsBox.ItemsSource = DisturbedBits;

            tmp1                = BitHelper.IntsToString(encoded);
            encodedTxt.Text     = tmp1;
            bitowa              = Formatuj(tablicaBitowa);
            tablicaZnakow       = bitowa.ToCharArray();
            binaryInputTxt.Text = FormatCharArray(tablicaZnakow);
            decoded             = GetString(tablicaBitowa);
            recivedTxt.Text     = decoded;
        }