Beispiel #1
0
 /// <summary>Registers your implementation of visualization operators</summary>
 /// <param name="implementation">
 ///   An object implementing the IHDevOperators interface
 /// </param>
 public void SetHDevOperators(IHDevOperators implementation)
 {
     if (implementation == null)
     {
         HDevEngine.HCkE(EngineAPI.SetHDevOperatorImpl(this.engine, IntPtr.Zero));
         GC.KeepAlive((object)this);
         this.operatorWrapper = (HDevOperatorWrapper)null;
     }
     else
     {
         this.operatorWrapper = new HDevOperatorWrapper(this, implementation);
         HDevEngine.HCkE(EngineAPI.SetHDevOperatorImpl(this.engine, this.operatorWrapper.ImplementationHandle));
         GC.KeepAlive((object)this);
     }
 }
        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);
        }
 private int DevDispText(IntPtr text, IntPtr coordSystem, IntPtr row, IntPtr column, IntPtr color, IntPtr genParamNames, IntPtr genParamValues)
 {
     try
     {
         this.implementation.DevDispText(HDevOperatorWrapper.LoadTuple(text), HDevOperatorWrapper.LoadTuple(coordSystem), HDevOperatorWrapper.LoadTuple(row), HDevOperatorWrapper.LoadTuple(column), HDevOperatorWrapper.LoadTuple(color), HDevOperatorWrapper.LoadTuple(genParamNames), HDevOperatorWrapper.LoadTuple(genParamValues));
     }
     catch (Exception ex)
     {
         return(HDevOperatorWrapper.ToHalconError(ex));
     }
     return(2);
 }
 private int DevSetPart(IntPtr row, IntPtr column, IntPtr width, IntPtr height)
 {
     try
     {
         this.implementation.DevSetPart(HDevOperatorWrapper.LoadTuple(row), HDevOperatorWrapper.LoadTuple(column), HDevOperatorWrapper.LoadTuple(width), HDevOperatorWrapper.LoadTuple(height));
     }
     catch (Exception ex)
     {
         return(HDevOperatorWrapper.ToHalconError(ex));
     }
     return(2);
 }
 private int DevOpenWindow(IntPtr row, IntPtr column, IntPtr width, IntPtr height, IntPtr background, IntPtr windowID)
 {
     try
     {
         HTuple windowHandle;
         this.implementation.DevOpenWindow(HDevOperatorWrapper.LoadTuple(row), HDevOperatorWrapper.LoadTuple(column), HDevOperatorWrapper.LoadTuple(width), HDevOperatorWrapper.LoadTuple(height), HDevOperatorWrapper.LoadTuple(background), out windowHandle);
         HalconAPI.StoreTuple(windowID, windowHandle);
     }
     catch (Exception ex)
     {
         return(HDevOperatorWrapper.ToHalconError(ex));
     }
     return(2);
 }