private void BtnNext_Click(object sender, EventArgs e) { if (_isTest) { countPassedQuestion++; string result = textBox1.Text + "," + textBox2.Text + "," + textBox3.Text + "," + textBox4.Text; if (result == correctAnswer) { countCorrectAnswer++; } if (maxCount > countPassedQuestion) { FormVarshamovaTest1 form = new FormVarshamovaTest1(true); form.Show(); this.Close(); } else { FormVarshamovaTest2 form = new FormVarshamovaTest2(true, countCorrectAnswer); form.Show(); countPassedQuestion = 0; countCorrectAnswer = 0; this.Close(); } } else { FormVarshamovaTest2 form = new FormVarshamovaTest2(false, countCorrectAnswer); form.Show(); this.Close(); } }
private void OpenForm(string formName, bool isTest, bool codec = true) { if (formName.Equals("Код Элайеса")) { if (codec) { SystematicCode.ElaesaCode.FormElaesaTest1 form = new SystematicCode.ElaesaCode.FormElaesaTest1(isTest); form.Show(); } else { SystematicCode.ElaesaCode.FormElaesaTest5 form = new SystematicCode.ElaesaCode.FormElaesaTest5(isTest); form.Show(); } } else if (formName.Equals("Код Варшамова")) { if (codec) { SystematicCode.VarshamovaCode.FormVarshamovaTest1 form = new SystematicCode.VarshamovaCode.FormVarshamovaTest1(isTest); form.Show(); } else { SystematicCode.VarshamovaCode.FormVarshamovaTest2 form = new SystematicCode.VarshamovaCode.FormVarshamovaTest2(isTest); form.Show(); } } else if (formName.Equals("Коды Рида-Милеера")) { if (codec) { SystematicCode.Rida_MilleraCode.FormRida_MilleraTest1 form = new SystematicCode.Rida_MilleraCode.FormRida_MilleraTest1(isTest); form.Show(); } else { SystematicCode.Rida_MilleraCode.FormRida_MilleraTest2 form = new SystematicCode.Rida_MilleraCode.FormRida_MilleraTest2(isTest); form.Show(); } } else if (formName.Equals("Код Хеминга 1")) { SystematicCode.HemingaCode.FormHemingaTest1 form = new SystematicCode.HemingaCode.FormHemingaTest1(isTest, codec); form.Show(); } // cyclic codes else if (formName.Equals("Коды Абрамсона")) { CyclicCode.AbramsonaCode.FormAbramsTest1 form = new CyclicCode.AbramsonaCode.FormAbramsTest1(isTest, codec); form.Show(); } else if (formName.Equals("Коды Файра")) { FormFairaTest1 form = new FormFairaTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Хеминга 2")) { CyclicCode.HemingaCode.FormHemingaTest1 form = new CyclicCode.HemingaCode.FormHemingaTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код БЧХ")) { CyclicCode.BChHCode.FormBChHTest1 form = new CyclicCode.BChHCode.FormBChHTest1(isTest, codec); form.Show(); } //non binary codes else if (formName.Equals("Первичные недвоичные коды")) { if (codec) { Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest1 form = new Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest1(isTest); form.Show(); } else { Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest2 form = new Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest2(isTest); form.Show(); } } else if (formName.Equals("Код с проверкой по модулю q")) { if (codec) { Non_binaryCode.CodeWithModuleTest.FormModuleTest1 form = new Non_binaryCode.CodeWithModuleTest.FormModuleTest1(isTest); form.Show(); } else { Non_binaryCode.CodeWithModuleTest.FormModuleTest6 form = new Non_binaryCode.CodeWithModuleTest.FormModuleTest6(isTest); form.Show(); } } else if (formName.Equals("Код с простым повторением")) { Non_binaryCode.CodeWithaSimpleIteration.FormIterationTest1 form = new Non_binaryCode.CodeWithaSimpleIteration.FormIterationTest1(isTest, codec); form.Show(); } else if (formName.Equals("Итеративный код")) { if (codec) { Non_binaryCode.IterativityCode.FormIterativityTest1 form = new Non_binaryCode.IterativityCode.FormIterativityTest1(isTest); form.Show(); } else { Non_binaryCode.IterativityCode.FormIterativityTest5 form = new Non_binaryCode.IterativityCode.FormIterativityTest5(isTest); form.Show(); } } //other codes else if (formName.Equals("Код Грея")) { ElseCodeAndLabs.GrayCode.FormGrayTest1 form = new ElseCodeAndLabs.GrayCode.FormGrayTest1(isTest, codec); form.Show(); } else if (formName.Equals("Двоично-десятичный код")) { FormDDCTest1 form = new FormDDCTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Бергера")) { ElseCodeAndLabs.BergerCode.FormBergerTest1 form = new ElseCodeAndLabs.BergerCode.FormBergerTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Шенона-Фано")) { ElseCodeAndLabs.Shenona_FanoCode.FormShenona_FanoTest1 form = new ElseCodeAndLabs.Shenona_FanoCode.FormShenona_FanoTest1(isTest); form.Show(); } else if (formName.Equals("Код Хаффмена")) { if (codec) { ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest1 form = new ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest1(isTest); form.Show(); } else { ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest2 form = new ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest2(isTest); form.Show(); } } else if (formName.Equals("Коды-спутники")) { if (codec) { ElseCodeAndLabs.SateliteCode.FormSateliteTest1 form = new ElseCodeAndLabs.SateliteCode.FormSateliteTest1(isTest); form.Show(); } else { ElseCodeAndLabs.SateliteCode.FormSateliteTest4 form = new ElseCodeAndLabs.SateliteCode.FormSateliteTest4(isTest); form.Show(); } } else if (formName.Equals("Количество информации и энтропия")) { ElseCodeAndLabs.Entropy.FormEntropyTest1 form = new ElseCodeAndLabs.Entropy.FormEntropyTest1(); form.Show(); } else if (formName.Equals("Рекурентный код")) { if (codec) { ElseCodeAndLabs.RekyrentCode.FormRekyrentTest1 form = new ElseCodeAndLabs.RekyrentCode.FormRekyrentTest1(isTest); form.Show(); } else { ElseCodeAndLabs.RekyrentCode.FormRekyrentTest4 form = new ElseCodeAndLabs.RekyrentCode.FormRekyrentTest4(isTest); form.Show(); } } else if (formName.Equals("Канальные коды")) { } }
private void button1_Click(object sender, EventArgs e) { string result = text1.Text + "," + text2.Text + "," + text3.Text + "," + text4.Text + "," + text5.Text + "," + text6.Text + "," + text7.Text + "," + text8.Text + "," + text9.Text + "," + text10.Text + "," + text11.Text + "," + text12.Text + "," + text13.Text + "," + text14.Text + "," + text15.Text + "," + text16.Text + "," + text17.Text + "," + text18.Text + "," + text19.Text + "," + text20.Text + "," + text31.Text + "," + text32.Text + "," + text33.Text + "," + text34.Text + "," + text35.Text + "," + text36.Text + "," + text37.Text + "," + text38.Text + "," + text39.Text + "," + text40.Text + "," + text41.Text + "," + text42.Text + "," + text43.Text + "," + text44.Text + "," + text45.Text + "," + text46.Text + "," + text47.Text + "," + text48.Text + "," + text49.Text + "," + text50.Text + "," + text51.Text + "," + text52.Text + "," + text53.Text + "," + text54.Text; if (_isTest) { countPassedQuestion++; if (result == correctAnswer) { countCorrectAnswer++; } if (maxCount > countPassedQuestion) { FormVarshamovaTest1 form = new FormVarshamovaTest1(true); form.Show(); this.Close(); } else { int mark = countCorrectAnswer * 5 / countPassedQuestion; ResultForm form = new ResultForm(mark, Text, countCorrectAnswer, countPassedQuestion); form.Show(); countPassedQuestion = 1; countCorrectAnswer = 0; this.Close(); } } else { FormVarshamovaTest1 form = new FormVarshamovaTest1(false); form.Show(); this.Close(); } }