Beispiel #1
0
        public static int Load(IntPtr tuple, out HTupleInt32 data)
        {
            int length;

            HalconAPI.GetTupleLength(tuple, out length);
            int[] numArray = new int[length];
            int   iarr     = HalconAPI.GetIArr(tuple, numArray);

            data = new HTupleInt32(numArray, false);
            return(iarr);
        }
Beispiel #2
0
 internal HTupleElements(HTuple parent, HTupleInt32 source, int[] indices)
 {
     this.parent   = parent;
     this.elements = (HTupleElementsImplementation) new HTupleElementsInt32(source, indices);
 }
Beispiel #3
0
        public static int LoadData(IntPtr tuple, HTupleType type, out HTupleImplementation data)
        {
            int num = 2;

            if (tuple == IntPtr.Zero)
            {
                data = (HTupleImplementation)HTupleVoid.EMPTY;
                return(num);
            }
            int type1;

            HalconAPI.GetTupleTypeScanElem(tuple, out type1);
            switch (type1)
            {
            case 1:
                if (HalconAPI.isPlatform64)
                {
                    HTupleInt64 data1;
                    num  = HTupleInt64.Load(tuple, out data1);
                    data = (HTupleImplementation)data1;
                }
                else
                {
                    HTupleInt32 data1;
                    num  = HTupleInt32.Load(tuple, out data1);
                    data = (HTupleImplementation)data1;
                }
                type = HTupleType.INTEGER;
                break;

            case 2:
                HTupleDouble data2;
                num  = HTupleDouble.Load(tuple, out data2);
                data = (HTupleImplementation)data2;
                type = HTupleType.DOUBLE;
                break;

            case 4:
                HTupleString data3;
                num  = HTupleString.Load(tuple, out data3);
                data = (HTupleImplementation)data3;
                type = HTupleType.STRING;
                break;

            case 7:
                HTupleMixed data4;
                num  = HTupleMixed.Load(tuple, out data4);
                data = (HTupleImplementation)data4;
                type = HTupleType.MIXED;
                break;

            case 15:
                data = (HTupleImplementation)HTupleVoid.EMPTY;
                type = HTupleType.EMPTY;
                break;

            default:
                data = (HTupleImplementation)HTupleVoid.EMPTY;
                num  = 7002;
                break;
            }
            return(num);
        }