/// <summary>
        /// 显示选择电极
        /// </summary>
        private void DispSeleteEle()
        {
            Part pt = FindSelectEle();

            if (pt != null)
            {
                PartUtils.SetPartDisplay(pt);
                PartUtils.SetPartWork(null);
                CreateElectrodeCAMBuilder cc = GetBuilder(pt);
                if (cc != null && cc.Template != null)
                {
                    this.operInfo = new OperationTreeListViewInfo(cc.Template);
                    ShowTreeInfo(this.operInfo.TreeInfo);
                }
                else
                {
                    ClassItem.StatusMessge("选择模板类型");
                    if (cc == null)
                    {
                        cc = new CreateElectrodeCAMBuilder(pt, model);
                        this.camBd.Add(cc);
                        SetTemplate(cc.GetElectrodeTemplate());
                        ShowTreeInfo(new List <ElectrodeCAMTreeInfo>());
                    }
                    else
                    {
                        SetTemplate(cc.GetElectrodeTemplate());
                        ShowTreeInfo(new List <ElectrodeCAMTreeInfo>());
                    }
                }
                this.butTemplate.Enabled = true;
            }
        }
Пример #2
0
 private void butUpdate_Click(object sender, EventArgs e)
 {
     if (this.operInfo != null)
     {
         this.operInfo.Update();
         ShowTreeInfo(this.operInfo.TreeInfo);
         ClassItem.StatusMessge("更新成功");
     }
 }
Пример #3
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (this.operInfo != null && this.treeListViewOper.SelectedObject is ElectrodeCAMTreeInfo)
     {
         bool isok = this.operInfo.Delete(this.treeListViewOper.SelectedObject as ElectrodeCAMTreeInfo);
         if (isok)
         {
             ShowTreeInfo(this.operInfo.TreeInfo);
             ClassItem.StatusMessge("删除成功");
         }
     }
 }
Пример #4
0
 private void butSkick_Click(object sender, EventArgs e)
 {
     if (this.operInfo != null && this.treeListViewOper.SelectedObject is ElectrodeCAMTreeInfo && copy != null)
     {
         bool isok = this.operInfo.Stick(this.treeListViewOper.SelectedObject as ElectrodeCAMTreeInfo, copy);
         if (isok)
         {
             ShowTreeInfo(this.operInfo.TreeInfo);
             ClassItem.StatusMessge("粘贴成功");
         }
     }
 }
Пример #5
0
 /// <summary>
 /// 复制
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolCopy_Click(object sender, EventArgs e)
 {
     if (this.operInfo != null && this.treeListViewOper.SelectedObject is ElectrodeCAMTreeInfo)
     {
         copy = this.operInfo.Copy(this.treeListViewOper.SelectedObject as ElectrodeCAMTreeInfo);
         if (copy != null)
         {
             this.toolSkick.Enabled = true;
             ClassItem.StatusMessge("复制成功");
         }
     }
 }
Пример #6
0
        private void butOpen_Click(object sender, EventArgs e)
        {
            UFSession theUFSession = UFSession.GetUFSession();
            Session   theSession   = Session.GetSession();

            ClassItem.StatusMessge("选择电极文件");
            List <string> elePath = new List <string>();

            if (elePart.Count == 0)
            {
                elePath = file.CopyFile();
            }
            else
            {
                string fileName = Path.GetDirectoryName(elePart[0].FullPath) + "\\";
                elePath = file.AddFile(fileName);
            }
            List <string> errd = new List <string>();

            if (elePath.Count > 0)
            {
                foreach (string st in elePath)
                {
                    Tag partTag;
                    UFPart.LoadStatus err;
                    try
                    {
                        theUFSession.Part.Open(st, out partTag, out err);
                        elePart.Add(NXObjectManager.Get(partTag) as Part);
                    }
                    catch (NXException ex)
                    {
                        errd.Add(st + "             " + ex.Message);
                    }
                }
                if (errd.Count != 0)
                {
                    ClassItem.Print(errd.ToArray());
                }
                SetEleInfo();
                DispSeleteEle();
                this.butTemplate.Enabled = true;
            }
        }