예제 #1
0
        public static int Load(IntPtr tuple, out HTupleString data)
        {
            int err = 2;
            int length;

            HalconAPI.GetTupleLength(tuple, out length);
            string[] s = new string[length];
            for (int index = 0; index < length; ++index)
            {
                if (!HalconAPI.IsFailure(err))
                {
                    err = HalconAPI.GetS(tuple, index, out s[index]);
                }
            }
            data = new HTupleString(s, false);
            return(err);
        }
예제 #2
0
 internal HTupleElements(HTuple parent, HTupleString tupleImp, int[] indices)
 {
     this.parent   = parent;
     this.elements = (HTupleElementsImplementation) new HTupleElementsString(tupleImp, indices);
 }
예제 #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);
        }