コード例 #1
0
        /// <summary>Compile all procedures that are used by the program and that
        /// can be compiled with a just-in-time compiler.
        /// The method returns true when all used procedures could be compiled by
        /// the just-in-time compiler.
        /// Procedures that could not be compiled are called normally by the
        /// HDevEngine interpreter.
        /// To check which procedure could not be compiled and what the reason is
        /// for that start HDevelop and check there the compilation states.
        /// </summary>
        public bool CompileUsedProcedures()
        {
            bool ret;

            HDevProgram.HCkE(EngineAPI.CompileUsedProceduresForProgram(this.program, out ret));
            GC.KeepAlive((object)this);
            return(ret);
        }
コード例 #2
0
ファイル: HDevProcedure.cs プロジェクト: zshankang/OpenHalcon
 /// <summary>Loads a local procedure</summary>
 public void LoadProcedure(HDevProgram program, string procedureName)
 {
     if (program.Handle == IntPtr.Zero)
     {
         HDevEngineException.ThrowGeneric("Uninitialized program while creating a local procedure call");
     }
     HDevProcedure.HCkE(EngineAPI.LoadProcedure(this.procedure, program.Handle, procedureName));
     GC.KeepAlive((object)this);
     this.UpdateProcedureInfo();
 }
コード例 #3
0
 /// <summary>
 /// Releases the resources used by this engine
 /// </summary>
 public virtual void Dispose()
 {
     if (this.call != IntPtr.Zero)
     {
         EngineAPI.DestroyProgramCall(this.call);
         this.call = IntPtr.Zero;
     }
     this.program = (HDevProgram)null;
     GC.SuppressFinalize((object)this);
     GC.KeepAlive((object)this);
 }
コード例 #4
0
        /// <summary>Returns the names of all local procedures</summary>
        public HTuple GetLocalProcedureNames()
        {
            IntPtr tuple;

            HDevProgram.HCkE(HalconAPI.CreateTuple(out tuple));
            HDevProgram.HCkE(EngineAPI.GetLocalProcedureNames(this.program, tuple));
            GC.KeepAlive((object)this);
            HTuple htuple = HalconAPI.LoadTuple(tuple);

            HDevProgram.HCkE(HalconAPI.DestroyTuple(tuple));
            return(htuple);
        }
コード例 #5
0
ファイル: HDevProcedure.cs プロジェクト: zshankang/OpenHalcon
 /// <summary>Loads a local procedure</summary>
 public HDevProcedure(HDevProgram program, string procedureName)
     : this()
 {
     this.LoadProcedure(program, procedureName);
 }
コード例 #6
0
 /// <summary>Loads an HDevelop script</summary>
 /// <remarks>
 ///   You can use this to exceute the program or local procedures.
 /// </remarks>
 /// <param name="fileName">Path and file name of the HDevelop script</param>
 public void LoadProgram(string fileName)
 {
     HDevProgram.HCkE(EngineAPI.LoadProgram(this.program, fileName));
     EngineAPI.GetProgramInfo(this.program, out this.name, out this.loaded, out this.varNamesIconic, out this.varNamesCtrl, out this.varDimsIconic, out this.varDimsCtrl);
     GC.KeepAlive((object)this);
 }
コード例 #7
0
 /// <summary>Creates an empty program instance</summary>
 public HDevProgram()
 {
     HDevProgram.HCkE(EngineAPI.CreateProgram(out this.program));
     GC.KeepAlive((object)this);
 }
コード例 #8
0
 /// <summary>
 /// Creates a program call for the specified program
 /// </summary>
 public HDevProgramCall(HDevProgram program)
 {
     HDevProgramCall.HCkE(EngineAPI.CreateProgramCall(program.Handle, out this.call));
     GC.KeepAlive((object)this);
     this.program = program;
 }