Exemplo n.º 1
0
        //here we go, thats the method called by vvvv each frame
        //all data handling should be in here
        public void Evaluate(int SpreadMax)
        {
            double pinInputEnable, pinInputDigitizing;

            FPinInputEnable.GetValue(0, out pinInputEnable);
            FPinInputDigitizing.GetValue(0, out pinInputDigitizing);
            if (FPinInputEnable.PinIsChanged)
            {
                if (pinInputEnable == 1d)
                {
                    Enable();
                }
                else
                {
                    Disable();
                }
            }
            if (Tablet == null)
            {
                return;
            }
            if (FPinInputDigitizing.PinIsChanged)
            {
                digitizing = (pinInputDigitizing == 1d);
                if (pinInputEnable == 1d)
                {
                    Disable();
                }
                Disconnect();
                Connect();
                if (pinInputEnable == 1d)
                {
                    Enable();
                }
            }
            if ((pinInputEnable == 1d))
            {
                FPinOutputProximity.SetValue(0, InContext ? 1 : 0);
                FPinOutputX.SetValue(0, X);
                FPinOutputY.SetValue(0, Y);
                FPinOutputPressure.SetValue(0, NormalPressure);
                FPinOutputCursor.SetValue(0, CursorNum);
                FPinOutputSerialNo.SetValue(0, SerialNo);
                FPinOutputCursorType.SetValue(0, CursorType);
                FPinOutputCursorSubtype.SetValue(0, CursorSubtype);
                FPinOutputButtons.SliceCount = NumButtons;
                for (int i = 0; i < NumButtons; i++)
                {
                    FPinOutputButtons.SetValue(i, ((Buttons & (1 << i)) != 0) ? 1 : 0);
                }
                FPinOutputAzimuth.SetValue(0, Azimuth);
                FPinOutputTilt.SetValue(0, Tilt);
                if (FPinDebugButtons != null)
                {
                    FPinDebugButtons.SetValue(0, NumButtons);
                }
                FPinOutputDimensions.SliceCount = 2;
                FPinOutputDimensions.SetValue(0, Tablet.Context.InputExtentX);
                FPinOutputDimensions.SetValue(1, Tablet.Context.InputExtentY);
                FPinOutputCursorName.SetString(0, CursorName);
            }
        }