private void AdvParamForm_Load(object sender, EventArgs e) { tolTextBox.Text = m_nestParam.GetConTol().ToString("0.000"); rotTextBox.Text = m_nestParam.GetPartRotStep().ToString("0.000"); evalTextBox.Text = m_nestParam.GetEvalFactor().ToString(); timeTextBox.Text = m_iNestingTime.ToString(); if (m_nestParam.IsPartInPart()) { partInPartCheckBox.Checked = true; } else { partInPartCheckBox.Checked = false; } if (m_nestParam.EnableOptimization()) { optimizationCheckBox.Checked = true; } else { optimizationCheckBox.Checked = false; } GetConfigHigh(); }
static private NestParamEx LoadNestParam_V1(XmlNode paramNode, ref int iNestingTime) { NestParamEx nestParam = new NestParamEx(); // MatLeftMargin. nestParam.SetMatLeftMargin(Convert.ToDouble(paramNode.SelectSingleNode("MatLeftMargin").InnerText)); // MatRightMargin. nestParam.SetMatRightMargin(Convert.ToDouble(paramNode.SelectSingleNode("MatRightMargin").InnerText)); // MatTopMargin. nestParam.SetMatTopMargin(Convert.ToDouble(paramNode.SelectSingleNode("MatTopMargin").InnerText)); // MatBottomMargin. nestParam.SetMatBottomMargin(Convert.ToDouble(paramNode.SelectSingleNode("MatBottomMargin").InnerText)); // MatBottomMargin. nestParam.SetMatMargin(Convert.ToDouble(paramNode.SelectSingleNode("MatMargin").InnerText)); // PartDis. nestParam.SetPartDis(Convert.ToDouble(paramNode.SelectSingleNode("PartDis").InnerText)); // ConTol. nestParam.SetConTol(Convert.ToDouble(paramNode.SelectSingleNode("ConTol").InnerText)); // PartRotStep. nestParam.SetPartRotStep(Convert.ToDouble(paramNode.SelectSingleNode("PartRotStep").InnerText)); // StartCorner. nestParam.SetStartCorner((RECT_CORNER_EX)Convert.ToInt32(paramNode.SelectSingleNode("StartCorner").InnerText)); // NestDir. nestParam.SetNestDir((NEST_DIRECTION_EX)Convert.ToInt32(paramNode.SelectSingleNode("NestDir").InnerText)); // PartInPart. if (Convert.ToInt32(paramNode.SelectSingleNode("PartInPart").InnerText) == 1) { nestParam.IsPartInPart(true); } else if (Convert.ToInt32(paramNode.SelectSingleNode("PartInPart").InnerText) == 0) { nestParam.IsPartInPart(false); } // EvalFactor. nestParam.SetEvalFactor(Convert.ToInt32(paramNode.SelectSingleNode("EvalFactor").InnerText)); // nesting time. iNestingTime = Convert.ToInt32(paramNode.SelectSingleNode("NestingTime").InnerText); return(nestParam); }
static private void SaveNestParam(XmlDocument xmlDoc, XmlNode paramNode, NestParamEx nestParam, int iNestingTime) { // MatLeftMargin. { XmlElement node = xmlDoc.CreateElement("MatLeftMargin"); node.InnerText = nestParam.GetMatLeftMargin().ToString("0.0000000"); paramNode.AppendChild(node); } // MatRightMargin. { XmlElement node = xmlDoc.CreateElement("MatRightMargin"); node.InnerText = nestParam.GetMatRightMargin().ToString("0.0000000"); paramNode.AppendChild(node); } // MatTopMargin. { XmlElement node = xmlDoc.CreateElement("MatTopMargin"); node.InnerText = nestParam.GetMatTopMargin().ToString("0.0000000"); paramNode.AppendChild(node); } // MatBottomMargin. { XmlElement node = xmlDoc.CreateElement("MatBottomMargin"); node.InnerText = nestParam.GetMatBottomMargin().ToString("0.0000000"); paramNode.AppendChild(node); } // MatMargin. { XmlElement node = xmlDoc.CreateElement("MatMargin"); node.InnerText = nestParam.GetMatMargin().ToString("0.0000000"); paramNode.AppendChild(node); } // PartDis. { XmlElement node = xmlDoc.CreateElement("PartDis"); node.InnerText = nestParam.GetPartDis().ToString("0.0000000"); paramNode.AppendChild(node); } // ConTol. { XmlElement node = xmlDoc.CreateElement("ConTol"); node.InnerText = nestParam.GetConTol().ToString("0.0000000"); paramNode.AppendChild(node); } // PartRotStep. { XmlElement node = xmlDoc.CreateElement("PartRotStep"); node.InnerText = nestParam.GetPartRotStep().ToString("0.0000000"); paramNode.AppendChild(node); } // StartCorner. { XmlElement node = xmlDoc.CreateElement("StartCorner"); node.InnerText = ((int)nestParam.GetStartCorner()).ToString(); paramNode.AppendChild(node); } // NestDir. { XmlElement node = xmlDoc.CreateElement("NestDir"); node.InnerText = ((int)nestParam.GetNestDir()).ToString(); paramNode.AppendChild(node); } // PartInPart. { XmlElement node = xmlDoc.CreateElement("PartInPart"); if (nestParam.IsPartInPart()) { node.InnerText = "1"; } else { node.InnerText = "0"; } paramNode.AppendChild(node); } // EvalFactor. { XmlElement node = xmlDoc.CreateElement("EvalFactor"); node.InnerText = nestParam.GetEvalFactor().ToString(); paramNode.AppendChild(node); } // nest time. { XmlElement node = xmlDoc.CreateElement("NestingTime"); node.InnerText = iNestingTime.ToString(); paramNode.AppendChild(node); } }