Exemplo n.º 1
0
 internal void SetRange(eNkMAIDCapability capability, NkMAIDRange value)
 {
     CapSet(
         capability,
         eNkMAIDDataType.kNkMAIDDataType_RangePtr,
         new IntPtr(&value));
 }
Exemplo n.º 2
0
        internal NkMAIDRange GetDefaultRange(eNkMAIDCapability capability)
        {
            NkMAIDRange result = new NkMAIDRange();

            CapGetDefault(
                capability,
                eNkMAIDDataType.kNkMAIDDataType_RangePtr,
                new IntPtr(&result));

            return(result);
        }
Exemplo n.º 3
0
        public object Get(eNkMAIDCapability cap)
        {
            switch (GetCapabilityType(cap))
            {
            case eNkMAIDCapType.kNkMAIDCapType_String:
                return(_scheduler.Invoke(new GetStringDelegate(_object.GetString), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Unsigned:
                return(_scheduler.Invoke(new GetUnsignedDelegate(_object.GetUnsigned), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Integer:
                return(_scheduler.Invoke(new GetIntegerDelegate(_object.GetInteger), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Boolean:
                return(_scheduler.Invoke(new GetBooleanDelegate(_object.GetBoolean), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Float:
                return(_scheduler.Invoke(new GetFloatDelegate(_object.GetFloat), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Enum:
            {
                NikonEnumWithData result = (NikonEnumWithData)_scheduler.Invoke(new GetEnumWithDataDelegate(_object.GetEnumWithData), cap);
                return(new NikonEnum(result.nativeEnum, result.buffer));
            }

            case eNkMAIDCapType.kNkMAIDCapType_Array:
            {
                NikonArrayWithData result = (NikonArrayWithData)_scheduler.Invoke(new GetArrayWithDataDelegate(_object.GetArrayWithData), cap);
                return(new NikonArray(result.nativeArray, result.buffer));
            }

            case eNkMAIDCapType.kNkMAIDCapType_Range:
            {
                NkMAIDRange result = (NkMAIDRange)_scheduler.Invoke(new GetRangeDelegate(_object.GetRange), cap);
                return(new NikonRange(result));
            }

            case eNkMAIDCapType.kNkMAIDCapType_DateTime:
                return(_scheduler.Invoke(new GetDateTimeDelegate(_object.GetDateTime), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Point:
                return(_scheduler.Invoke(new GetPointDelegate(_object.GetPoint), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Rect:
                return(_scheduler.Invoke(new GetRectDelegate(_object.GetRect), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Size:
                return(_scheduler.Invoke(new GetSizeDelegate(_object.GetSize), cap));

            default:
                return(null);
            }
        }
Exemplo n.º 4
0
        public object GetDefault(eNkMAIDCapability cap)
        {
            switch (GetCapabilityType(cap))
            {
            case eNkMAIDCapType.kNkMAIDCapType_String:
                return(_scheduler.Invoke(new GetStringDelegate(_object.GetDefaultString), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Unsigned:
                return(_scheduler.Invoke(new GetUnsignedDelegate(_object.GetDefaultUnsigned), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Integer:
                return(_scheduler.Invoke(new GetIntegerDelegate(_object.GetDefaultInteger), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Boolean:
                return(_scheduler.Invoke(new GetBooleanDelegate(_object.GetDefaultBoolean), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Float:
                return(_scheduler.Invoke(new GetFloatDelegate(_object.GetDefaultFloat), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Range:
            {
                NkMAIDRange result = (NkMAIDRange)_scheduler.Invoke(new GetRangeDelegate(_object.GetDefaultRange), cap);
                return(new NikonRange(result));
            }

            case eNkMAIDCapType.kNkMAIDCapType_DateTime:
                return(_scheduler.Invoke(new GetDateTimeDelegate(_object.GetDefaultDateTime), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Point:
                return(_scheduler.Invoke(new GetPointDelegate(_object.GetDefaultPoint), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Rect:
                return(_scheduler.Invoke(new GetRectDelegate(_object.GetDefaultRect), cap));

            case eNkMAIDCapType.kNkMAIDCapType_Size:
                return(_scheduler.Invoke(new GetSizeDelegate(_object.GetDefaultSize), cap));

            // Note: 'Array' and 'Enum' are not here

            default:
                return(null);
            }
        }
 internal NikonRange(NkMAIDRange range)
 {
     _range = range;
 }
Exemplo n.º 6
0
        //
        // Range
        //
        internal NkMAIDRange GetRange(eNkMAIDCapability capability)
        {
            NkMAIDRange result = new NkMAIDRange();

            CapGet(
                capability,
                eNkMAIDDataType.kNkMAIDDataType_RangePtr,
                new IntPtr(&result));

            return result;
        }
Exemplo n.º 7
0
 internal void SetRange(eNkMAIDCapability capability, NkMAIDRange value)
 {
     CapSet(
         capability,
         eNkMAIDDataType.kNkMAIDDataType_RangePtr,
         new IntPtr(&value));
 }
Exemplo n.º 8
0
 internal NikonRange(NkMAIDRange range)
 {
     _range = range;
 }