public void MakeRoi_model(ROIController mx) { if (Sousuo_region_get.Roi_model == "ROICircle") { mx.genCircle(Sousuo_region_get.Roi_x, Sousuo_region_get.Roi_y, Sousuo_region_get.Roi_Cir1radius, ref sou_regions); mx.reset(); } else if (Sousuo_region_get.Roi_model == "ROIRectangle2") { mx.genRect2(Sousuo_region_get.Roi_x, Sousuo_region_get.Roi_y, Sousuo_region_get.Roi_Rec2phi, Sousuo_region_get.Roi_Rec2length1, Sousuo_region_get.Roi_Rec2length2, ref sou_regions); mx.reset(); } }
internal void ReadData(List <string> n_Path, int j, ROIController mm) { IniFile IniFile = new IniFile(n_Path[0] + n_Path[1]); int Selectnumber = 0; if (IniFile.IniReadValue(j.ToString(), "ShapeModel") != "") { Selectnumber = Convert.ToInt32(IniFile.IniReadValue(j.ToString(), "ShapeModel")); } this.comboBox1.SelectedIndex = Selectnumber; if (IniFile.IniReadValue(j.ToString(), "CbbAngle") != "") { this.cbb_angle.SelectedIndex = Convert.ToInt32(IniFile.IniReadValue(j.ToString(), "CbbAngle")); } if (IniFile.IniReadValue(j.ToString(), "CbbPoint") != "") { this.cbb_point.SelectedIndex = Convert.ToInt32(IniFile.IniReadValue(j.ToString(), "CbbPoint")); } this.tb_no.Text = IniFile.IniReadValue(j.ToString(), "TbNo"); if (IniFile.IniReadValue(j.ToString(), "Check_Roi") == "True") { this.checkBox_get.Checked = true; } else { this.checkBox_get.Checked = false; } if (IniFile.IniReadValue(j.ToString(), "Check_handle") == "True") { this.checkBox1.Checked = true; } else { this.checkBox1.Checked = false; } Panel_show(); this.cbb_image.Items.Add(IniFile.IniReadValue(j.ToString(), "ImageIn")); this.cbb_image.SelectedIndex = 0; if (Selectnumber == 1) { this.textBox_rec2row1.Text = IniFile.IniReadValue(j.ToString(), "Rec2row1"); this.textBox_rec2col1.Text = IniFile.IniReadValue(j.ToString(), "Rec2col1"); this.textBox_rec2len1.Text = IniFile.IniReadValue(j.ToString(), "Rec2len1"); this.textBox_rec2len2.Text = IniFile.IniReadValue(j.ToString(), "Rec2len2"); this.txt_rec2phi.Text = IniFile.IniReadValue(j.ToString(), "Rec2phi"); } else { this.textBox_circlerow.Text = IniFile.IniReadValue(j.ToString(), "Cirrow"); this.textBox_circlecolumn.Text = IniFile.IniReadValue(j.ToString(), "Circol"); this.textBox_circleradius.Text = IniFile.IniReadValue(j.ToString(), "Cirradius"); } this.shape_name.Text = IniFile.IniReadValue(j.ToString(), "Modelname"); string Regionnull_check = IniFile.IniReadValue(j.ToString(), "Region_Not_null"); if (Regionnull_check == "ROIRectangle2") { double rec2length1 = 0, rec2length2 = 0, rec2phi = 0, rec2midc = 0, rec2midr = 0; if (IniFile.IniReadValue(j.ToString(), "Rec2length1") != "") { rec2length1 = Convert.ToDouble(IniFile.IniReadValue(j.ToString(), "Rec2length1")); } if (IniFile.IniReadValue(j.ToString(), "Rec2length2") != "") { rec2length2 = Convert.ToDouble(IniFile.IniReadValue(j.ToString(), "Rec2length2")); } if (IniFile.IniReadValue(j.ToString(), "Rec2phi") != "") { rec2phi = Convert.ToDouble(IniFile.IniReadValue(j.ToString(), "Rec2phi")); } if (IniFile.IniReadValue(j.ToString(), "Rec2midc") != "") { rec2midc = Convert.ToDouble(IniFile.IniReadValue(j.ToString(), "Rec2midc")); } if (IniFile.IniReadValue(j.ToString(), "Rec2midr") != "") { rec2midr = Convert.ToDouble(IniFile.IniReadValue(j.ToString(), "Rec2midr")); } //this.comboBox2.SelectedIndex = 1; mm.genRect2(rec2midr, rec2midc, rec2phi, rec2length1, rec2length2, ref sou_regions); mm.reset(); } else if (Regionnull_check == "ROICircle") { double cir1midc = 0, cir1midr = 0, cir1radius = 0; if (IniFile.IniReadValue(j.ToString(), "Cir1midc") != "") { cir1midc = Convert.ToDouble(IniFile.IniReadValue(j.ToString(), "Cir1midc")); } if (IniFile.IniReadValue(j.ToString(), "Cir1midr") != "") { cir1midr = Convert.ToDouble(IniFile.IniReadValue(j.ToString(), "Cir1midr")); } if (IniFile.IniReadValue(j.ToString(), "Cir1radius") != "") { cir1radius = Convert.ToDouble(IniFile.IniReadValue(j.ToString(), "Cir1radius")); } // this.comboBox2.SelectedIndex = 2; mm.genCircle(cir1midr, cir1midc, cir1radius, ref sou_regions); mm.reset(); } if (IniFile.IniReadValue(j.ToString(), "ButtonPress") == "True") { Button_press = true; this.button_搜索形状.BackColor = Color.Yellow; } else { Button_press = false; } }