/// <summary>Gets the value of a global iconic variable</summary> public HObjectVector GetGlobalIconicVarVector(string name) { IntPtr vector; HDevEngine.HCkE(EngineAPI.GetGlobalIconicVarVector(this.engine, name, out vector)); GC.KeepAlive((object)this); return(EngineAPI.GetAndDestroyObjectVector(vector)); }
/// <summary>Gets the dimension of a global control variable</summary> public int GetGlobalCtrlVarDimension(string name) { int dimension; HDevEngine.HCkE(EngineAPI.GetGlobalCtrlVarDimension(this.engine, name, out dimension)); GC.KeepAlive((object)this); return(dimension); }
/// <summary>Gets the value of a global iconic variable</summary> public HObject GetGlobalIconicVarObject(string name) { IntPtr key; HDevEngine.HCkE(EngineAPI.GetGlobalIconicVarObject(this.engine, name, out key)); GC.KeepAlive((object)this); return(new HObject(key, false)); }
/// <summary>Sets the value of a global iconic variable</summary> public void SetGlobalIconicVarVector(string name, HObjectVector vector) { IntPtr vectorHandle; HDevEngine.HCkE(EngineAPI.CreateObjectVector(vector, out vectorHandle)); HDevEngine.HCkE(EngineAPI.SetGlobalIconicVarVector(this.engine, name, vectorHandle)); GC.KeepAlive((object)this); HDevEngine.HCkE(EngineAPI.DestroyObjectVector(vectorHandle)); }
/// <summary>Gets the value of a global iconic XLD variable</summary> public HXLD GetGlobalIconicVarXld(string name) { IntPtr key; HDevEngine.HCkE(EngineAPI.GetGlobalIconicVarObject(this.engine, name, out key)); GC.KeepAlive((object)this); EngineAPI.AssertObjectClass(key, "xld", "main"); return(new HXLD(key, false)); }
/// <summary>Sets the value of a global control variable</summary> public void SetGlobalCtrlVarTuple(string name, HTuple tuple) { IntPtr tuple1; HDevEngine.HCkE(HalconAPI.CreateTuple(out tuple1)); HalconAPI.StoreTuple(tuple1, tuple); HDevEngine.HCkE(EngineAPI.SetGlobalCtrlVarTuple(this.engine, name, tuple1)); GC.KeepAlive((object)this); HDevEngine.HCkE(HalconAPI.DestroyTuple(tuple1)); }
/// <summary>Changes a global setting of the engine</summary> /// <param name="name"> /// The name of the attribute, e.g. "ignore_invalid_lines" /// or "ignore_unresolved_lines" /// </param> /// <param name="attributeValue">The new value of the attribute</param> public void SetEngineAttribute(string name, HTuple attributeValue) { IntPtr tuple; HDevEngine.HCkE(HalconAPI.CreateTuple(out tuple)); HalconAPI.StoreTuple(tuple, attributeValue); int err = EngineAPI.SetEngineAttribute(this.engine, name, tuple); GC.KeepAlive((object)this); HalconAPI.DestroyTuple(tuple); HDevEngine.HCkE(err); }
/// <summary>Queries a global setting of the engine</summary> /// <param name="name"> /// The name of the attribute, e.g. "ignore_invalid_lines" /// or "ignore_unresolved_lines" /// </param> /// <returns>The current value of the attribute</returns> public HTuple GetEngineAttribute(string name) { IntPtr tuple; HDevEngine.HCkE(HalconAPI.CreateTuple(out tuple)); HDevEngine.HCkE(EngineAPI.GetEngineAttribute(this.engine, name, tuple)); GC.KeepAlive((object)this); HTuple htuple = HalconAPI.LoadTuple(tuple); HDevEngine.HCkE(HalconAPI.DestroyTuple(tuple)); return(htuple); }
/// <summary>Returns the names of all global control variables</summary> public HTuple GetGlobalCtrlVarNames() { IntPtr tuple; HDevEngine.HCkE(HalconAPI.CreateTuple(out tuple)); HDevEngine.HCkE(EngineAPI.GetGlobalCtrlVarNames(this.engine, tuple)); GC.KeepAlive((object)this); HTuple htuple = HalconAPI.LoadTuple(tuple); HDevEngine.HCkE(HalconAPI.DestroyTuple(tuple)); return(htuple); }
/// <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); } }
public HDevOperatorWrapper(HDevEngine engine, IHDevOperators implementation) { this.implementation = implementation; this.delegateDevOpenWindow = new DevOpenWindowDelegate(this.DevOpenWindow); this.delegateDevCloseWindow = new DevCloseWindowDelegate(this.DevCloseWindow); this.delegateDevSetWindow = new DevSetWindowDelegate(this.DevSetWindow); this.delegateDevGetWindow = new DevGetWindowDelegate(this.DevGetWindow); this.delegateDevSetWindowExtents = new DevSetWindowExtentsDelegate(this.DevSetWindowExtents); this.delegateDevSetPart = new DevSetPartDelegate(this.DevSetPart); this.delegateDevClearWindow = new DevClearWindowDelegate(this.DevClearWindow); this.delegateDevDisplay = new DevDisplayDelegate(this.DevDisplay); this.delegateDevDispText = new DevDispTextDelegate(this.DevDispText); this.delegateDevSetDraw = new DevSetDrawDelegate(this.DevSetDraw); this.delegateDevSetShape = new DevSetShapeDelegate(this.DevSetShape); this.delegateDevSetColored = new DevSetColoredDelegate(this.DevSetColored); this.delegateDevSetColor = new DevSetColorDelegate(this.DevSetColor); this.delegateDevSetLut = new DevSetLutDelegate(this.DevSetLut); this.delegateDevSetPaint = new DevSetPaintDelegate(this.DevSetPaint); this.delegateDevSetLineWidth = new DevSetLineWidthDelegate(this.DevSetLineWidth); EngineAPI.HCkE(EngineAPI.CreateImplementation(out this.implHandle, this.delegateDevOpenWindow, this.delegateDevCloseWindow, this.delegateDevSetWindow, this.delegateDevGetWindow, this.delegateDevSetWindowExtents, this.delegateDevSetPart, this.delegateDevClearWindow, this.delegateDevDisplay, this.delegateDevDispText, this.delegateDevSetDraw, this.delegateDevSetShape, this.delegateDevSetColored, this.delegateDevSetColor, this.delegateDevSetLut, this.delegateDevSetPaint, this.delegateDevSetLineWidth)); GC.KeepAlive((object)this); }
/// <summary>Unloads a previously loaded procedure</summary> /// <param name="name">The name of the procedure to unload</param> public void UnloadProcedure(string name) { HDevEngine.HCkE(EngineAPI.UnloadProcedure(this.engine, name)); GC.KeepAlive((object)this); }
/// <summary>Sets the path for loading external procedures</summary> /// <param name="path">List of directories in the path format of the operating system</param> public void SetProcedurePath(string path) { HDevEngine.HCkE(EngineAPI.SetProcedurePath(this.engine, path)); GC.KeepAlive((object)this); }
/// <summary>Stops the debug server (resuming execution if stopped)</summary> public void StopDebugServer() { HDevEngine.HCkE(EngineAPI.StopDebugServer(this.engine)); GC.KeepAlive((object)this); }
/// <summary>Creates a new instance of HDevEngine</summary> public HDevEngine() { HDevEngine.HCkE(EngineAPI.CreateEngine(out this.engine)); GC.KeepAlive((object)this); }
/// <summary>Sets the value of a global iconic variable</summary> public void SetGlobalIconicVarObject(string name, HObject iconic) { HDevEngine.HCkE(EngineAPI.SetGlobalIconicVarObject(this.engine, name, iconic.Key)); GC.KeepAlive((object)iconic); GC.KeepAlive((object)this); }
/// <summary>Unloads all previously loaded procedure</summary> public void UnloadAllProcedures() { HDevEngine.HCkE(EngineAPI.UnloadAllProcedures(this.engine)); GC.KeepAlive((object)this); }