private void WCFMain_Load(object sender, EventArgs e) { mAutoUI.controllInitializeSize(this); mWDataToolClass = new WDataToolClass(); int rtn = 0; rtn = mWDataToolClass.CheckAndOpenDataFile(); if (rtn != 0) { MessageBox.Show("mWDataToolClass.CheckAndOpenDataFile()"); } //初始化卡参数编辑控件 wcfCardEdit.ConInit(mWDataToolClass); //初始化轴界面 lvWcfAxis.ConInit(mWDataToolClass);//先参数轴数据才能初始化参数 //初始化输入界面 lvWcfDI.ConInit(mWDataToolClass); //初始化输出界面 lvWcfDO.ConInit(mWDataToolClass); //初始化设备参数编辑控件(并给赋值当前参数表mParameter,) wcfDataPata.ConInit(mWDataToolClass); //卡工具类数据库操作参数设置(必须在wcfDataPata.ConInit之后,) WCardToolClass.mWDataToolClass = mWDataToolClass; WCardToolClass.InitOpenCard(); //初始化设备参数控件 wcfDataGroup.ConInit(mWDataToolClass); //初始化机种选择 wcfDataType.ConInit(mWDataToolClass, false); //初始化流程控件 wcfAutoScript.ConInit(); }
public void ConInit(WDataToolClass mWDataToolClass, string GroupName = "") { this.mWDataToolClass = mWDataToolClass; int rtn = 0; DataTable dt; rtn = mWDataToolClass.SelectShowAxis(out dt, GroupName); if (rtn != 0) { MessageBox.Show("SelectShowModel"); } lvAxisView.Columns.Add("轴名称", 120, HorizontalAlignment.Left); lvAxisView.Columns.Add("负限位", 60, HorizontalAlignment.Center); lvAxisView.Columns.Add("正限位", 60, HorizontalAlignment.Center); lvAxisView.Columns.Add("报警", 60, HorizontalAlignment.Center); lvAxisView.Columns.Add("复位", 60, HorizontalAlignment.Center); lvAxisView.Columns.Add("使能", 60, HorizontalAlignment.Center); lvAxisView.Columns.Add("实际位置", 60, HorizontalAlignment.Center); lvAxisView.Columns.Add("规划位置", 60, HorizontalAlignment.Center); string mGroupName = ""; ListViewGroup mHeader = new ListViewGroup(); ListViewItem mLvi; foreach (DataRow row in dt.Rows) { //创建列表组名并添加 if (mGroupName != row[0].ToString()) { mGroupName = row[0].ToString(); mHeader = new ListViewGroup(); mHeader.Header = mGroupName; mHeader.HeaderAlignment = HorizontalAlignment.Left; lvAxisView.Groups.Add(mHeader); lvAxisView.ShowGroups = true; } //添加数据 mLvi = new ListViewItem(); mLvi.UseItemStyleForSubItems = false;//设置可以改变单元格背景颜色 mLvi.Text = row[1].ToString(); mLvi.SubItems.Add("").BackColor = Color.Gray; mLvi.SubItems.Add("").BackColor = Color.Gray; mLvi.SubItems.Add("").BackColor = Color.Red; mLvi.SubItems.Add("").BackColor = Color.Gray; mLvi.SubItems.Add("").BackColor = Color.Gray; mLvi.SubItems.Add("0"); mLvi.SubItems.Add("0"); //添加到列表 mHeader.Items.Add(mLvi); lvAxisView.Items.Add(mLvi); } tSignalRefresh.Enabled = true; }
public void ConInit(WDataToolClass mWDataToolClass, string GroupName = "") { this.mWDataToolClass = mWDataToolClass; int rtn = 0; DataTable dt; rtn = mWDataToolClass.SelectShowDI(out dt, GroupName); if (rtn != 0) { MessageBox.Show("SelectShowModel"); } string mGroupName = ""; ListViewGroup mHeader = new ListViewGroup(); ListViewItem mLvi; lvDIView.SmallImageList = ilImageList; foreach (DataRow row in dt.Rows) { //创建列表组名并添加 if (mGroupName != row[0].ToString()) { mGroupName = row[0].ToString(); mHeader = new ListViewGroup(); mHeader.Header = mGroupName; mHeader.HeaderAlignment = HorizontalAlignment.Left; lvDIView.Groups.Add(mHeader); lvDIView.ShowGroups = true; } //添加数据 mLvi = new ListViewItem(); mLvi.ImageIndex = 0; mLvi.Text = row[1].ToString(); mLvi.SubItems.Add(row[2].ToString()); mLvi.SubItems.Add(row[3].ToString()); mLvi.SubItems.Add(row[4].ToString()); mLvi.SubItems.Add(row[5].ToString()); mLvi.SubItems.Add(row[6].ToString()); //添加到列表 mHeader.Items.Add(mLvi); lvDIView.Items.Add(mLvi); } //启动信号刷新定时器 tSignalRefresh.Enabled = true; }
public void ConInit(WDataToolClass mWDataToolClass) { this.mWDataToolClass = mWDataToolClass; int rtn = 0; rtn = mWDataToolClass.SelectShowModel("", ref cbWcfData); if (rtn != 0) { MessageBox.Show("SelectShowModel"); } UpdateCorrAxis(); rtn = mWDataToolClass.SelectShowParameter(ref dgvParameter); if (rtn != 0) { MessageBox.Show("SelectShowAxis"); } }
public void ConInit(WDataToolClass mWDataToolClass, bool isEdit = true) { this.mWDataToolClass = mWDataToolClass; if (isEdit) { btnCopyAdd.Visible = true; btnDelete.Visible = true; } else { btnCopyAdd.Visible = false; btnDelete.Visible = false; } int rtn = 0; rtn = mWDataToolClass.SelectShowModel("", ref cbWcfData); if (rtn != 0) { MessageBox.Show("SelectShowModel"); } }
public void ConInit(WDataToolClass mWDataToolClass) { this.mWDataToolClass = mWDataToolClass; int rtn = 0; rtn = mWDataToolClass.SelectShowAxis(ref dgvAxis); if (rtn != 0) { MessageBox.Show("SelectShowAxis"); } rtn = mWDataToolClass.SelectShowDI(ref dgvDI); if (rtn != 0) { MessageBox.Show("SelectShowAxis"); } rtn = mWDataToolClass.SelectShowDO(ref dgvDO); if (rtn != 0) { MessageBox.Show("SelectShowAxis"); } }
public void ConInit(WDataToolClass mWDataToolClass, string GroupName = "") { this.mWDataToolClass = mWDataToolClass; this.GroupName = GroupName; UpdateData(); }
public void ConInit(WDataToolClass mWDataToolClass, string sNameX, string sNameY) { this.mWDataToolClass = mWDataToolClass; this.sNameX = sNameX; this.sNameY = sNameY; }