Exemplo n.º 1
0
        private void Exec_Click(object sender, RoutedEventArgs e)
        {
            FileWork.BinFileReader binFileReader = new FileWork.BinFileReader();
            List <bool>            bits          = binFileReader.ReadFile(InputFile.Text);
            Int32 row    = getRow();
            Int32 column = getColumn();

            bits = BinWork.Shufle.ShufleBits(bits, row, column);

            FileWork.BinFileCreator binFileCreator = new FileWork.BinFileCreator();
            binFileCreator.WriteInFile(bits, OutPutFile.Text);
            MessageBox.Show("Готово");
        }
Exemplo n.º 2
0
        private void Execute_Click(object sender, RoutedEventArgs e)
        {
            FileWork.BinFileReader      binFileReader = new FileWork.BinFileReader();
            List <bool>                 bits          = binFileReader.ReadFile(InputFile.Text);
            Dictionary <string, double> param         = parameters.GetParams();
            int typeSim = GetSimetryType();

            CodecsWork.ChanelModel chanelModel = new CodecsWork.ChanelModel(typeSim);


            if (ErrSingleRadio.IsChecked == true)
            {
                if (!param.ContainsKey("typeSingle"))
                {
                    ErrorTypeSingle errWin = new ErrorTypeSingle(parameters);
                    errWin.Close();
                    param       = parameters.GetParams();
                    chanelModel = new CodecsWork.ChanelModel(typeSim);
                }

                bits = chanelModel.SingleError(bits, param["typeSingle"] == 1 ? param["SingleError"] : param["Noise"], param["typeSingle"] == 1 ? true : false);
            }

            if (ErrPacketRadio.IsChecked == true)
            {
                if (!param.ContainsKey("PacketError"))
                {
                    ErrorTypePacket errWin = new ErrorTypePacket(parameters);
                    errWin.Close();
                    param       = parameters.GetParams();
                    chanelModel = new CodecsWork.ChanelModel(typeSim);
                }

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