Example #1
0
 public bool GrabingImg()
 {
     if (GrabImg != null) GrabImg.Dispose();
     FileLib.Logger.Pop("  开始采图:", false, StationDescribe + "运行日志");
     this.MotionCtrl.SetCoordi(MyVisionPara.localPara.localSetting.TeachCoordi);
     MotionCtrl.GetCoordiPos(out X, out Y, out Z, out Theta);
     return CameraCtrl.Instance.GrabImg(MyVisionPara.camLightPara.CamName, out GrabImg);          
 }
        private int DevDisplay(IntPtr key)
        {
            HObject objectVal = (HObject)null;

            try
            {
                objectVal = new HObject(key);
                this.implementation.DevDisplay(objectVal);
                objectVal.Dispose();
            }
            catch (Exception ex)
            {
                if (objectVal != null)
                {
                    objectVal.Dispose();
                }
                return(HDevOperatorWrapper.ToHalconError(ex));
            }
            return(2);
        }
Example #3
0
        internal static void AssertObjectClass(IntPtr key, string assertClass, string procedureName)
        {
            if (!(key != HObjectBase.UNDEF))
            {
                return;
            }
            HObject hobject  = new HObject(key);
            HTuple  objClass = hobject.GetObjClass();

            hobject.Dispose();
            if (objClass.Length <= 0)
            {
                return;
            }
            string s = objClass.S;

            if (s.StartsWith(assertClass))
            {
                return;
            }
            HDevEngineException.ThrowGeneric("Output object type mismatch (excepted " + assertClass + ", got " + s + ")", procedureName);
        }