private void optBtn_Click(object sender, EventArgs e) { optBtn.Enabled = false; optBtn.BackColor = Color.Red; rtbResult.Clear(); rtbWork.Clear(); startOptShow(); if (evokWork.IsMaterialExist()) { if (evokWork.getOptSize().MaterialId <= Constant.patternMaterialId) { evokWork.optReady(Constant.optNormal); } else { MessageBox.Show("花纹材料请直接启动程序!"); } } else { MessageBox.Show("材料不存在,请设置材料库文件!"); } stopOptShow(); optBtn.BackColor = Color.Transparent; optBtn.Enabled = true; }
public void UserOpt(int id) { if (evokWork.IsMaterialExist()) { switch (id) { case 1: { evokWork.getOptSize().DtData = dtAuto; break; } case 2: { evokWork.getOptSize().DtData = dtManual; break; } case 3: { string upsize = "0"; string downsize = "0"; string usersize = "0"; string oppositeSize = "0"; string maxSize = "0"; foreach (DataRow dr in dtBl.Rows) { usersize = dr[Constant.strformatSimiBl[7]].ToString(); dr[Constant.strformatSimiBl[1]] = "1"; dr[Constant.strformatSimiBl[2]] = "0"; dr[Constant.strformatSimiBl[3]] = "补料"; double sized = evokWork.getOptSize(). SimiM.calculateSize( usersize.ToString(), dr[Constant.strformatSimiBl[4]].ToString(), dr[Constant.strformatSimiBl[5]].ToString(), ref oppositeSize, ref maxSize); dr[Constant.strformatSimiBl[0]] = maxSize; //排版需要大尺寸 dr[Constant.strformatSimiBl[8]] = sized.ToString("0.00"); dr[Constant.strformatSimiBl[9]] = oppositeSize; dr[Constant.strformatSimiBl[19]] = evokWork.getOptSize().SimiM.Width.ToString(); } evokWork.getOptSize().DtData = dtBl; break; } } if (evokWork.getOptSize().MaterialId <= Constant.patternMaterialId) { evokWork.optReadySimi(Constant.optNormal, id); UpdateNowOpt(0); //evokWork.SetUserDataGridView(UserData); MessageBox.Show("优化完成!"); } else { MessageBox.Show("花纹材料请直接启动程序!"); } } else { MessageBox.Show("材料不存在,请设置材料库文件!"); } }