Ejemplo n.º 1
0
        /// <summary>
        /// 确定第二条直线
        /// </summary>
        /// <param name="id_"></param>
        /// <param name="obj_"></param>
        /// <returns></returns>
        public bool Set_QueDingDiErTiaoZhiXian(IDistanceTwoLineShuJu id_, Object obj_)
        {
            bool ok  = false;
            var  il_ = obj_ as ILineStruct;

            if (il_ is ILineStruct)
            {
                id_.DiErTiaoZhiXian = il_;
                ok = true;
            }
            return(ok);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 显示数据
        /// </summary>
        /// <param name="id_"></param>
        public void Set_showParameter(IDistanceTwoLineShuJu id_, ListBox list_One, ListBox list_Two)
        {
            id_.DiYiTiaoZhiXianLuJing = this.panDuanToolShiFouCunZai(id_.DiYiTiaoZhiXianLuJing);

            if (id_.DiYiTiaoZhiXianLuJing == "")
            {
                id_.DiYiTiaoZhiXian = null;
            }
            else
            {
                list_One.Items.Add(id_.DiYiTiaoZhiXianLuJing);
            }

            id_.DiErTiaoZhiXianLuJing = this.panDuanToolShiFouCunZai(id_.DiErTiaoZhiXianLuJing);
            if (id_.DiErTiaoZhiXianLuJing == "")
            {
                id_.DiYiTiaoZhiXian = null;
            }
            else
            {
                list_Two.Items.Add(id_.DiErTiaoZhiXianLuJing);
            }
        }
Ejemplo n.º 3
0
        private void ParentFrm_Load(object sender, EventArgs e)
        {
            halconWinControl_ROI1.init();
            halconWinControl_ROI1.Repaint += ROIMoveEvent;

            _read += read_one_image;
            _run  += run;

            #region 第一个点树
            //TreeNode tr_0 = new TreeNode();
            //tr_0.Text = "驱动1";
            //tr_0.Name = "System_1"; //新建一个驱动
            //if (treeView1.Nodes != null)
            //{
            //    treeView1.Nodes.Clear();
            //}//清空树
            //TreeStatic.load_MultTreeNode_To_TreeNode_ContainsSelf(tr_0, _ICheckStr.Check_Root);
            //treeView1.Nodes.Add(tr_0);//添加一个检测
            //treeView1.ExpandAll();

            MultTree.operationTreeViewTool.initTreeView(treeView1, _ICheckStr.Check_Root);
            #endregion

            #region   第二个点树
            //TreeNode tr_1 = new TreeNode();
            //tr_1.Text = "驱动1";
            //tr_1.Name = "System_1"; //新建一个驱动

            //if (treeView2.Nodes != null)
            //{
            //    treeView2.Nodes.Clear();
            //}//清空树

            //TreeStatic.load_MultTreeNode_To_TreeNode_ContainsSelf(tr_1, _ICheckStr.Check_Root);

            //treeView2.Nodes.Add(tr_1);//添加一个检测
            //treeView2.ExpandAll();

            MultTree.operationTreeViewTool.initTreeView(treeView2, _ICheckStr.Check_Root);

            #endregion

            //#region 初始化图片数据
            //if (TreeStatic.Mult_Tree_Node_Picture != null)
            //{
            //    if (TreeStatic.Mult_Tree_Node_Picture.SelfId.Contains("acquire"))
            //    {
            //        _IRead = (ReadImageHalconLibrary.ReadShuJu)TreeStatic.Mult_Tree_Node_Picture.Obj;

            //        #region  把图片写入

            //        foreach (string file_name in _IRead.Path_Picture)
            //        {
            //            listBox_acquire_picture.Items.Add(file_name); //加载所有文件
            //        }
            //        #endregion
            //    }
            //    else
            //    {
            //        _IRead = new ReadImageHalconLibrary.ReadShuJu();
            //    }
            //}
            //else
            //{
            //    _IRead = new ReadImageHalconLibrary.ReadShuJu();
            //}
            //#endregion

            #region   初始化设置器
            _set_DistanceTwo = new Set_DistanceTwoLine();
            #endregion

#if DEBUG == true
            if (TreeStatic.Mult_Tree_Node.Obj == null)
            {
                _idistance = new DistanceTwoLineShuJu();
            }
            else
            {
                _idistance = (DistanceTwoLineShuJu)TreeStatic.Mult_Tree_Node.Obj;
            }
#else
#endif
            #region   步定位点

            this._set_DistanceTwo.Set_showParameter(_idistance, listBox_DiYiTiaoZhiXian, listBox_DiErTiaoZhiXian);

            #region  无用代码
            //if (this._idistance.DiYiTiaoZhiXianLuJing != "")
            //{
            //    listBox_DiYiTiaoZhiXian.Items.Add(this._idistance.DiYiTiaoZhiXianLuJing);
            //}

            //if (this._idistance.DiErTiaoZhiXianLuJing != "")
            //{
            //    listBox_DiErTiaoZhiXian.Items.Add(this._idistance.DiErTiaoZhiXianLuJing);
            //}
            #endregion

            #endregion
        }