Beispiel #1
0
        private void BT_InsertInterf_MouseUp(object sender, MouseEventArgs e)
        {
            System.Drawing.Point[] InterferdBits_arr = InterferenceGenerator.GenInter(ref convol_code_inter, (int)NUD_InterfIntensive.Value);
            recovered_convol_code = WorkWithFinka.UncodeFinkaArr(convol_code_inter);
            str_recovered         = StrngToBin.BinToStr(recovered_convol_code);

            for (int i = 0; i < RTB_ConvolCodeWithInter.TextLength; i++) // Должно раскрашивать красным цветом помехи в свёрточном коде (изменённые биты), но не работает...
            {
                if (RTB_ConvolCodeWithInter.Text[i] != RTB_ConvolCode.Text[i])
                {
                    RTB_ConvolCodeWithInter.Select(i, 1);
                    RTB_ConvolCodeWithInter.SelectionColor = Color.Red;
                    RTB_ConvolCodeWithInter.DeselectAll();
                }
            }

            for (int i = 0; i < RTB_RecoveredCode.TextLength; i++) // Должно раскрашивать красным цветом помехи в восстановленом коде (изменённые биты), но не работает...
            {
                if (RTB_RecoveredCode.Text[i] != RTB_BinStr.Text[i])
                {
                    RTB_RecoveredCode.Select(i, 1);
                    RTB_RecoveredCode.SelectionColor = Color.Red;
                    RTB_RecoveredCode.DeselectAll();
                }
            }

            FillInterfRTB();
        }
Beispiel #2
0
        void FillInterfRTB() // Процедура заполняент панель с помехами
        {
            RTB_ConvolCodeWithInter.Clear();
            RTB_RecoveredCode.Clear();
            RTB_RecoveredStr.Clear();

            FillRTB(RTB_ConvolCodeWithInter, convol_code);     // Заполняем RTB с изменённым свёрточным кодом (пока что совпадающим с обычны, помехи будут вноситься нажатием соответствующей кнопки)

            FillRTB(RTB_RecoveredCode, recovered_convol_code); // Заполняем RTB с восстановленным кодом

            RTB_RecoveredStr.Text = str_recovered;             // Заполняем RTB с восстановленой строкой
        }