Beispiel #1
0
        private void NestParamForm_Load(object sender, EventArgs e)
        {
            // the border margin of the material.
            topTextBox.Text    = m_nestParam.GetMatTopMargin().ToString("0.000");
            bottomTextBox.Text = m_nestParam.GetMatBottomMargin().ToString("0.000");
            leftTextBox.Text   = m_nestParam.GetMatLeftMargin().ToString("0.000");
            rightTextBox.Text  = m_nestParam.GetMatRightMargin().ToString("0.000");
            marginTextBox.Text = m_nestParam.GetMatMargin().ToString("0.000");

            // the part spacing.
            spaceTextBox.Text = m_nestParam.GetPartDis().ToString("0.000");

            // the start nesting corner.
            if (m_nestParam.GetStartCorner() == RECT_CORNER_EX.LEFT_TOP)
            {
                ltRadioBtn.Checked = true;
            }
            else if (m_nestParam.GetStartCorner() == RECT_CORNER_EX.LEFT_BOTTOM)
            {
                lbRadioBtn.Checked = true;
            }
            else if (m_nestParam.GetStartCorner() == RECT_CORNER_EX.RIGHT_TOP)
            {
                rtRadioBtn.Checked = true;
            }
            else if (m_nestParam.GetStartCorner() == RECT_CORNER_EX.RIGHT_BOTTOM)
            {
                rbRadioBtn.Checked = true;
            }

            // the nesting direction.
            if (m_nestParam.GetNestDir() == NEST_DIRECTION_EX.NEST_DIR_X)
            {
                xRadioBtn.Checked = true;
            }
            else if (m_nestParam.GetNestDir() == NEST_DIRECTION_EX.NEST_DIR_Y)
            {
                yRadioBtn.Checked = true;
            }

            lstConfig = GetConfig();
            int iCount = 1;

            foreach (var cfg in lstConfig)
            {
                ListViewItem item = lvConfigList.Items.Add(iCount.ToString());

                // part name column.
                item.SubItems.Add(cfg.ConfigName);
                item.Tag = cfg;
                iCount++;
            }
        }
Beispiel #2
0
        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);
            }
        }