Ejemplo n.º 1
0
        internal static void GetProgramInfo(
            IntPtr program,
            out string name,
            out bool loaded,
            out HTuple varNamesIconic,
            out HTuple varNamesCtrl,
            out HTuple varDimsIconic,
            out HTuple varDimsCtrl)
        {
            IntPtr tuple1;

            EngineAPI.HCkE(HalconAPI.CreateTuple(out tuple1));
            IntPtr tuple2;

            EngineAPI.HCkE(HalconAPI.CreateTuple(out tuple2));
            IntPtr tuple3;

            EngineAPI.HCkE(HalconAPI.CreateTuple(out tuple3));
            IntPtr tuple4;

            EngineAPI.HCkE(HalconAPI.CreateTuple(out tuple4));
            IntPtr name1;

            EngineAPI.HCkE(EngineAPI.HCenGetProgramInfo(program, out name1, out loaded, tuple1, tuple2, tuple3, tuple4));
            name           = Marshal.PtrToStringAnsi(name1);
            varNamesIconic = HalconAPI.LoadTuple(tuple1);
            varNamesCtrl   = HalconAPI.LoadTuple(tuple2);
            varDimsIconic  = HalconAPI.LoadTuple(tuple3);
            varDimsCtrl    = HalconAPI.LoadTuple(tuple4);
            EngineAPI.HCkE(HalconAPI.DestroyTuple(tuple1));
            EngineAPI.HCkE(HalconAPI.DestroyTuple(tuple2));
            EngineAPI.HCkE(HalconAPI.DestroyTuple(tuple3));
            EngineAPI.HCkE(HalconAPI.DestroyTuple(tuple4));
        }