Ejemplo n.º 1
0
        private void Execute_Click(object sender, RoutedEventArgs e)
        {
            FileWork.BinFileReader binFileReader = new FileWork.BinFileReader();
            List <bool>            bits          = binFileReader.ReadFile(InputFile.Text);

            try
            {
                Int32 Tmin = Int32.Parse(((TextBlock)((ComboBoxItem)TСorrect.SelectedItem).Content).Text);
                CodecsWork.LoopCodec loopCodec = new CodecsWork.LoopCodec(Polinom.Text, Int32.Parse(r.Text), Int32.Parse(k.Text), Tmin);
                if (CodeRadio.IsChecked == true)
                {
                    bits = loopCodec.CodeLineBits(bits);
                }
                else
                {
                    bits = loopCodec.DeCodeLineBits(bits);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Невірні данні");
                return;
            }


            FileWork.BinFileCreator binFileCreator = new FileWork.BinFileCreator();
            binFileCreator.WriteInFile(bits, OutPutFile.Text);
            MessageBox.Show("Готово");
        }
Ejemplo n.º 2
0
        private void Execute_Click(object sender, RoutedEventArgs e)
        {
            FileWork.BinFileReader binFileReader = new FileWork.BinFileReader();
            List <bool>            bits          = binFileReader.ReadFile(InputFile.Text);

            if (CodeRadio.IsChecked == true)
            {
                bits = CodecsWork.СonvolutionalCoder.CodeLineBits(bits);
            }
            else
            {
                bits = CodecsWork.ViterbiCodec.DecodeLineBits(bits);
            }

            FileWork.BinFileCreator binFileCreator = new FileWork.BinFileCreator();
            binFileCreator.WriteInFile(bits, OutPutFile.Text);
            MessageBox.Show("Готово");
        }
Ejemplo n.º 3
0
        private void Execute_Click(object sender, RoutedEventArgs e)
        {
            FileWork.BinFileReader binFileReader = new FileWork.BinFileReader();
            List <bool>            bits          = binFileReader.ReadFile(InputFile.Text);

            CodecsWork.LoopCodec loopCodec = new CodecsWork.LoopCodec(Polinom.Text, Int32.Parse(r.Text), Int32.Parse(k.Text), Int32.Parse(TCorrect.Text));
            if (CodeRadio.IsChecked == true)
            {
                bits = loopCodec.CodeLineBits(bits);
            }
            else
            {
                bits = loopCodec.DeCodeLineBits(bits);
            }

            FileWork.BinFileCreator binFileCreator = new FileWork.BinFileCreator();
            binFileCreator.WriteInFile(bits, OutPutFile.Text);
            MessageBox.Show("Готово");
        }