private void cb_algorithm_SelectedIndexChanged(object sender, EventArgs e) { switch (cb_algorithm.SelectedIndex) { case 0: groupBox_DYNAMICQ.Visible = false; groupBox_FIXEDQ.Visible = true; if (cb_target.SelectedIndex == 2) { cb_toggle.Checked = true; } else { cb_toggle.Checked = false; } break; case 1: groupBox_FIXEDQ.Visible = false; groupBox_DYNAMICQ.Visible = true; if (cb_target.SelectedIndex == 2) { checkBox_Toggle.Checked = true; } else { checkBox_Toggle.Checked = false; } break; default: groupBox_DYNAMICQ.Visible = false; groupBox_FIXEDQ.Visible = false; break; } #if nouse tabControl1.SuspendLayout(); tabControl1.Controls.Remove(singulation_fixedQ); tabControl1.Controls.Remove(singulation_dynamicQ); tabControl1.Controls.Remove(singulation_dynamicQAdjust); tabControl1.Controls.Remove(singulation_dynamicQThreshold); #if ENGINEERING_MODE tabControl1.Controls.Remove(this.tp_cwonoff); #endif switch (cb_algorithm.SelectedIndex) { case 0: //Add fixed Q Form //Program.appSetting.Singulation = SingulationAlgorithm.FIXEDQ; singulation_fixedQ = new Singulation_FixedQ ( Program.appSetting.SingulationAlg ); singulation_fixedQ.Text = "FixedQ"; singulation_fixedQ.BackColor = Color.FromArgb(192, 255, 192); tabControl1.Controls.Add(singulation_fixedQ); break; case 1: //Program.appSetting.Singulation = SingulationAlgorithm.DYNAMICQ; singulation_dynamicQ = new Singulation_DynamicQ ( Program.appSetting.SingulationAlg, SingulationAlgorithm.DYNAMICQ ); singulation_dynamicQ.Text = "DynamicQ"; singulation_dynamicQ.BackColor = Color.FromArgb(192, 255, 192); tabControl1.Controls.Add(singulation_dynamicQ); break; /*case 2: * //Program.appSetting.Singulation = SingulationAlgorithm.DYNAMICQ_ADJUST; * singulation_dynamicQAdjust = new Singulation_DynamicQ * ( * Program.appSetting.SingulationAlg, SingulationAlgorithm.DYNAMICQ_ADJUST * ); * singulation_dynamicQAdjust.Text = "DynamicQAdj"; * singulation_dynamicQAdjust.BackColor = Color.FromArgb(192, 255, 192); * tabControl1.Controls.Add(singulation_dynamicQAdjust); * break; * case 3: * //Program.appSetting.Singulation = SingulationAlgorithm.DYNAMICQ_THRESH; * singulation_dynamicQThreshold = new Singulation_DynamicQ * ( * Program.appSetting.SingulationAlg, SingulationAlgorithm.DYNAMICQ_THRESH * ); * singulation_dynamicQThreshold.Text = "DynamicQThres"; * singulation_dynamicQThreshold.BackColor = Color.FromArgb(192, 255, 192); * tabControl1.Controls.Add(singulation_dynamicQThreshold); * break;*/ } #if ENGINEERING_MODE tabControl1.Controls.Add(this.tp_cwonoff); #endif tabControl1.ResumeLayout(); // tabControl1.SelectedIndex = 3; #endif }
private void cb_algorithm_SelectedIndexChanged(object sender, EventArgs e) { tabControl1.SuspendLayout(); tabControl1.Controls.Remove(singulation_fixedQ); tabControl1.Controls.Remove(singulation_dynamicQ); tabControl1.Controls.Remove(singulation_dynamicQAdjust); tabControl1.Controls.Remove(singulation_dynamicQThreshold); #if ENGINEERING_MODE tabControl1.Controls.Remove(this.tp_cwonoff); #endif switch (cb_algorithm.SelectedIndex) { case 0: //Add fixed Q Form //Program.appSetting.Singulation = SingulationAlgorithm.FIXEDQ; singulation_fixedQ = new Singulation_FixedQ ( Program.appSetting.SingulationAlg ); singulation_fixedQ.Text = "FixedQ"; singulation_fixedQ.BackColor = Color.FromArgb(192, 255, 192); tabControl1.Controls.Add(singulation_fixedQ); break; case 1: //Program.appSetting.Singulation = SingulationAlgorithm.DYNAMICQ; singulation_dynamicQ = new Singulation_DynamicQ ( Program.appSetting.SingulationAlg, SingulationAlgorithm.DYNAMICQ ); singulation_dynamicQ.Text = "DynamicQ"; singulation_dynamicQ.BackColor = Color.FromArgb(192, 255, 192); tabControl1.Controls.Add(singulation_dynamicQ); break; case 2: //Program.appSetting.Singulation = SingulationAlgorithm.DYNAMICQ_ADJUST; singulation_dynamicQAdjust = new Singulation_DynamicQ ( Program.appSetting.SingulationAlg, SingulationAlgorithm.DYNAMICQ_ADJUST ); singulation_dynamicQAdjust.Text = "DynamicQAdj"; singulation_dynamicQAdjust.BackColor = Color.FromArgb(192, 255, 192); tabControl1.Controls.Add(singulation_dynamicQAdjust); break; case 3: //Program.appSetting.Singulation = SingulationAlgorithm.DYNAMICQ_THRESH; singulation_dynamicQThreshold = new Singulation_DynamicQ ( Program.appSetting.SingulationAlg, SingulationAlgorithm.DYNAMICQ_THRESH ); singulation_dynamicQThreshold.Text = "DynamicQThres"; singulation_dynamicQThreshold.BackColor = Color.FromArgb(192, 255, 192); tabControl1.Controls.Add(singulation_dynamicQThreshold); break; } #if ENGINEERING_MODE tabControl1.Controls.Add(this.tp_cwonoff); #endif tabControl1.ResumeLayout(); tabControl1.SelectedIndex = 2; }