예제 #1
0
            /*! \brief Return one of the lower and upper bounds or step size of the
             * writable field in the Scale object.
             * \param [in] flags Flag indicating which bounds to return.
             * \return The value of the bounds requested.  */
            public int GetBounds(BoundsFlags flags)
            {
                int lower;
                int upper;
                int step;

                MiscOp_GetR0R1R2((uint)flags,
                                 Method.GetBounds,
                                 out lower,
                                 out upper,
                                 out step);

                switch (flags)
                {
                case BoundsFlags.Lower:
                    return((int)lower);

                case BoundsFlags.Upper:
                    return((int)upper);

                case BoundsFlags.StepSize:
                    return((int)step);
                }

                throw new ArgumentOutOfRangeException("flags", "Only bits 0, 1 or 2 should be set");
            }
예제 #2
0
            /*! \brief Sets one of the lower and upper bounds and step size of the writable field in
             * the Scale object according to the flags given.
             * \param [in] flags Set bit 0, 1 or 2 to indicate which bounds value to set.
             * \param [in] value The value to set the bounds to.
             * \return Nothing.  */
            public void SetBounds(BoundsFlags flags, int value)
            {
                int lower = 0;
                int upper = 0;
                int step  = 0;

                switch (flags)
                {
                case BoundsFlags.Lower:
                    lower = value;
                    break;

                case BoundsFlags.Upper:
                    upper = value;
                    break;

                case BoundsFlags.StepSize:
                    step = value;
                    break;
                }

                MiscOp_SetR3R4R5((uint)flags,
                                 Method.SetBounds,
                                 (uint)lower,
                                 (uint)upper,
                                 (uint)step);
            }