private void Init_numbersize() { this.tableLayoutPanelNumber.Controls.Clear(); for (int i = 0; i < CComLibrary.GlobeVal.filesave.minput.Count; i++) { UserSizeInput b = new UserSizeInput(); b.Dock = DockStyle.Fill; b.lbltitle.Text = CComLibrary.GlobeVal.filesave.minput[i].name; b.txtvalue.Value = CComLibrary.GlobeVal.filesave.minput[i].value; b.txtvalue.Tag = i; b.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue; b.cbounit.Items.Clear(); for (int j = 0; j < CComLibrary.GlobeVal.filesave.minput[i].myitemsignal.cUnitCount; j++) { b.cbounit.Items.Add( CComLibrary.GlobeVal.filesave.minput[i].myitemsignal.cUnits[j] ); } b.cbounit.Enabled = false; b.cbounit.SelectedIndex = CComLibrary.GlobeVal.filesave.minput[i].myitemsignal.cUnitsel; tableLayoutPanelNumber.RowStyles[0].Height = 30; tableLayoutPanelNumber.Controls.Add(b); } }
private void Init_spesize() { if (cboshape.Text == "矩形") { pictureBox1.BackgroundImage = imageList1.Images[0]; } if (cboshape.Text == "圆形") { pictureBox1.BackgroundImage = imageList1.Images[1]; } if (cboshape.Text == "双剪切环") { pictureBox1.BackgroundImage = imageList1.Images[2]; } if (cboshape.Text == "管状") { pictureBox1.BackgroundImage = imageList1.Images[3]; } if (cboshape.Text == "不规则形状") { pictureBox1.BackgroundImage = imageList1.Images[4]; } pictureBox1.BackgroundImageLayout = ImageLayout.Stretch; tableLayoutPanelSize.Controls.Clear(); for (int i = 0; i < CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem.Length; i++) { if (CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cName != "无") { UserSizeInput b = new UserSizeInput(); b.Dock = DockStyle.Fill; b.lbltitle.Text = CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cName; b.txtvalue.Value = CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cvalue; b.txtvalue.Tag = i; b.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue1;; b.cbounit.Items.Clear(); for (int j = 0; j < CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cUnitCount; j++) { b.cbounit.Items.Add( CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cUnits[ j] ); } b.cbounit.Enabled = false; b.cbounit.SelectedIndex = CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cUnitsel; tableLayoutPanelSize.RowStyles[0].Height = 30; tableLayoutPanelSize.Controls.Add(b); } } }
public void Init(int sel) { tabControl1.SelectedIndex = sel; if (sel == 0) { int mold = 0; mold = CComLibrary.GlobeVal.filesave.currentspenumber; CComLibrary.GlobeVal.filesave.currentspenumber = 0; lblstartbefore.Text = CComLibrary.GlobeVal.filesave.teststep[0].mtooltip; numericEdit1.Value = CComLibrary.GlobeVal.filesave.mspecount; numericEdit2.Value = mold + 1; tlp0.Controls.Clear(); tlp0.RowStyles.Clear(); tlp0.RowCount = (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem.Count); for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem.Count; i++) { RowStyle r = new RowStyle(); r.SizeType = SizeType.Absolute; r.Height = 40; tlp0.RowStyles.Add(r); } tlp0.Height = (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem.Count) * 40; for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem.Count; i++) { CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].getvalue(); if (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemkind == 0) { UserTextInput u = new UserTextInput(); u.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemname; u.txtvalue.Text = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemvalue.ToString(); u.Dock = DockStyle.Fill; u.txtvalue.Tag = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i]; u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged); tlp0.Controls.Add(u); } if (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemkind == 1) { UserSizeInput m = new UserSizeInput(); m.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemname; m.txtvalue.Value = Convert.ToDouble(CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemvalue); m.txtvalue.Tag = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i]; m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue; m.cbounit.Items.Clear(); m.cbounit.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemunit); m.cbounit.SelectedIndex = 0; m.Dock = DockStyle.Fill; tlp0.Controls.Add(m); } if (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemkind == 2) { UserComboInput n = new UserComboInput(); n.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemname; n.cbo.Items.Clear(); for (int j = 0; j < CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].mcboitem.mlist.Count; j++) { n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].mcboitem.mlist[j]); } n.cbo.Tag = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i]; n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted); n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemvalue); n.Dock = DockStyle.Fill; tlp0.Controls.Add(n); } } CComLibrary.GlobeVal.filesave.currentspenumber = 0; dataGridView1.DataSource = CComLibrary.GlobeVal.filesave.dt; } if (sel == 1) { lblspetestbefore.Text = CComLibrary.GlobeVal.filesave.teststep[1].mtooltip; tlp1.Controls.Clear(); tlp1.RowStyles.Clear(); tlp1.RowCount = (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem.Count); for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem.Count; i++) { RowStyle r = new RowStyle(); r.SizeType = SizeType.Absolute; r.Height = 40; tlp1.RowStyles.Add(r); } tlp1.Height = (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem.Count) * 40; for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem.Count; i++) { CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].getvalue(); if (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemkind == 0) { UserTextInput u = new UserTextInput(); u.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemname; u.txtvalue.Text = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemvalue.ToString(); u.Dock = DockStyle.Fill; u.txtvalue.Tag = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i]; u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged); tlp1.Controls.Add(u); } if (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemkind == 1) { UserSizeInput m = new UserSizeInput(); m.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemname; m.txtvalue.Value = Convert.ToDouble(CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemvalue); m.txtvalue.Tag = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i]; m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue; m.cbounit.Items.Clear(); m.cbounit.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemunit); m.cbounit.SelectedIndex = 0; m.Dock = DockStyle.Fill; tlp1.Controls.Add(m); } if (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemkind == 2) { UserComboInput n = new UserComboInput(); n.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemname; n.cbo.Items.Clear(); for (int j = 0; j < CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].mcboitem.mlist.Count; j++) { n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].mcboitem.mlist[j]); } n.cbo.Tag = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i]; n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted); n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemvalue); n.Dock = DockStyle.Fill; tlp1.Controls.Add(n); } } } if (sel == 2) { this.lblbeforetest.Text = CComLibrary.GlobeVal.filesave.teststep[2].mtooltip; } if (sel == 3) { lblbeforecalc.Text = CComLibrary.GlobeVal.filesave.teststep[4].mtooltip; tlp3.Controls.Clear(); tlp3.RowStyles.Clear(); tlp3.RowCount = (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem.Count); for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem.Count; i++) { RowStyle r = new RowStyle(); r.SizeType = SizeType.Absolute; r.Height = 40; tlp3.RowStyles.Add(r); } tlp3.Height = (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem.Count) * 40; for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem.Count; i++) { CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].getvalue(); if (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemkind == 0) { UserTextInput u = new UserTextInput(); u.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemname; u.txtvalue.Text = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemvalue.ToString(); u.Dock = DockStyle.Fill; u.txtvalue.Tag = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i]; u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged); tlp3.Controls.Add(u); } if (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemkind == 1) { UserSizeInput m = new UserSizeInput(); m.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemname; m.txtvalue.Value = Convert.ToDouble(CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemvalue); m.txtvalue.Tag = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i]; m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue; m.cbounit.Items.Clear(); m.cbounit.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemunit); m.cbounit.SelectedIndex = 0; m.Dock = DockStyle.Fill; tlp3.Controls.Add(m); } if (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemkind == 2) { UserComboInput n = new UserComboInput(); n.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemname; n.cbo.Items.Clear(); for (int j = 0; j < CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].mcboitem.mlist.Count; j++) { n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].mcboitem.mlist[j]); } n.cbo.Tag = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i]; n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted); n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemvalue); n.Dock = DockStyle.Fill; tlp3.Controls.Add(n); } } } if (sel == 4) { this.lblspeaftertest.Text = CComLibrary.GlobeVal.filesave.teststep[6].mtooltip; tlp4.Controls.Clear(); tlp4.RowStyles.Clear(); tlp4.RowCount = (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem.Count); for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem.Count; i++) { RowStyle r = new RowStyle(); r.SizeType = SizeType.Absolute; r.Height = 40; tlp4.RowStyles.Add(r); } tlp4.Height = (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem.Count) * 40; for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem.Count; i++) { CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].getvalue(); if (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemkind == 0) { UserTextInput u = new UserTextInput(); u.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemname; u.txtvalue.Text = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemvalue.ToString(); u.Dock = DockStyle.Fill; u.txtvalue.Tag = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i]; u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged); tlp4.Controls.Add(u); } if (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemkind == 1) { UserSizeInput m = new UserSizeInput(); m.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemname; m.txtvalue.Value = Convert.ToDouble(CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemvalue); m.txtvalue.Tag = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i]; m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue; m.Dock = DockStyle.Fill; tlp4.Controls.Add(m); } if (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemkind == 2) { UserComboInput n = new UserComboInput(); n.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemname; n.cbo.Items.Clear(); for (int j = 0; j < CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].mcboitem.mlist.Count; j++) { n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].mcboitem.mlist[j]); } n.cbo.Tag = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i]; n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted); n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemvalue); n.Dock = DockStyle.Fill; tlp4.Controls.Add(n); } } } if (sel == 5) { this.lblbeforefinish.Text = CComLibrary.GlobeVal.filesave.teststep[7].mtooltip; } }
private void Init_spesize() { if (cboshape.Text == ClsStaticStation.m_Global.mycls.shapelist[ClsStaticStation.m_Global.mycls.shapelist[0].Rect_Shape].shapename) { pictureBox1.BackgroundImage = imageList1.Images[0]; } if (cboshape.Text == ClsStaticStation.m_Global.mycls.shapelist[ClsStaticStation.m_Global.mycls.shapelist[0].Round_Shape].shapename) { pictureBox1.BackgroundImage = imageList1.Images[1]; } if (cboshape.Text == ClsStaticStation.m_Global.mycls.shapelist[ClsStaticStation.m_Global.mycls.shapelist[0].Double_shear_ring_Shape].shapename) { pictureBox1.BackgroundImage = imageList1.Images[2]; } if (cboshape.Text == ClsStaticStation.m_Global.mycls.shapelist[ClsStaticStation.m_Global.mycls.shapelist[0].Tube_Shape].shapename) { pictureBox1.BackgroundImage = imageList1.Images[3]; } if (cboshape.Text == ClsStaticStation.m_Global.mycls.shapelist[ClsStaticStation.m_Global.mycls.shapelist[0].Irregular_Shape].shapename) { pictureBox1.BackgroundImage = imageList1.Images[4]; } pictureBox1.BackgroundImageLayout = ImageLayout.Stretch; tableLayoutPanelSize.Controls.Clear(); for (int i = 0; i < CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem.Length; i++) { if (CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cName != "None") { UserSizeInput b = new UserSizeInput(); b.Dock = DockStyle.Fill; // b.btnproperty.Tag = i; b.btnproperty.Click += spesize_Btnproperty_Click; b.lbltitle.Text = CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cName; b.txtvalue.Value = CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cvalue; b.txtvalue.Tag = i; b.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue1;; b.cbounit.Items.Clear(); for (int j = 0; j < CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cUnitCount; j++) { b.cbounit.Items.Add( CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cUnits[ j] ); } b.cbounit.Enabled = false; b.cbounit.SelectedIndex = CComLibrary.GlobeVal.filesave.mshapelist[cboshape.SelectedIndex].sizeitem[i].cUnitsel; tableLayoutPanelSize.RowStyles[0].Height = 30; tableLayoutPanelSize.Controls.Add(b); } } }
public void setinput() { tlp1.Controls.Clear(); tlp1.RowStyles.Clear(); tlp1.RowCount = (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem.Count); for (int i = 0; i < CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem.Count; i++) { RowStyle r = new RowStyle(); r.SizeType = SizeType.Absolute; r.Height = 40; tlp1.RowStyles.Add(r); } tlp1.Height = (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem.Count) * 40; for (int i = 0; i < CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem.Count; i++) { CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].getvalue(); if (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemkind == 0) { UserTextInput u = new UserTextInput(); u.lbltitle.Text = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemname; u.txtvalue.Text = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemvalue.ToString(); u.Dock = DockStyle.Fill; u.btnproperty.Visible = false; u.txtvalue.Tag = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i]; u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged); tlp1.Controls.Add(u); } if (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemkind == 1) { UserSizeInput m = new UserSizeInput(); m.lbltitle.Text = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemname; double t = 0; double.TryParse(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemvalue.ToString(), out t); m.txtvalue.Value = t; m.txtvalue.Tag = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i]; m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue; m.cbounit.Items.Clear(); m.btnproperty.Visible = false; m.cbounit.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemunit); m.cbounit.SelectedIndex = 0; m.Dock = DockStyle.Fill; tlp1.Controls.Add(m); } if (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemkind == 2) { UserComboInput n = new UserComboInput(); n.lbltitle.Text = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemname; n.cbo.Items.Clear(); for (int j = 0; j < CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].mcboitem.mlist.Count; j++) { n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].mcboitem.mlist[j]); } n.cbo.Tag = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i]; n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted); n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemvalue); n.Dock = DockStyle.Fill; tlp1.Controls.Add(n); } } }