internal TactonicTouchEvent(TactonicDevice deviceInfo) { device = new TactonicDevice(); device.cols = deviceInfo.cols; device.rows = deviceInfo.rows; device.serialNumber = deviceInfo.serialNumber; device.rowSpacingUM = deviceInfo.rowSpacingUM; device.colSpacingUM = deviceInfo.colSpacingUM; frame = new TactonicTouchFrame(); }
public static void CopyTouchFrame(TactonicTouchFrame srcFrame, TactonicTouchFrame dstFrame) { if (dstFrame == null) { dstFrame = new TactonicTouchFrame(); } dstFrame.numTouches = srcFrame.numTouches; for (int i = 0; i < srcFrame.numTouches; i++) { dstFrame.touches[i].dForce = srcFrame.touches[i].dForce; dstFrame.touches[i].dx = srcFrame.touches[i].dx; dstFrame.touches[i].dy = srcFrame.touches[i].dy; dstFrame.touches[i].force = srcFrame.touches[i].force; dstFrame.touches[i].x = srcFrame.touches[i].x; dstFrame.touches[i].y = srcFrame.touches[i].y; dstFrame.touches[i].id = srcFrame.touches[i].id; dstFrame.touches[i].touchState = srcFrame.touches[i].touchState; } dstFrame.frameNumber = srcFrame.frameNumber; dstFrame.time = srcFrame.time; }
internal void GetTouchFrame(TactonicTouchFrame frame) { int i, touchIndex = 0; TactonicTouch t; int prevFrame = (readFrame); frame.frameNumber = touchFrames[prevFrame].frameNumber; frame.numTouches = touchFrames[prevFrame].numTouches; frame.time = touchFrames[prevFrame].time; for(i = 0; i < frame.numTouches; i++){ t = touchFrames[prevFrame].touches[i]; frame.touches[touchIndex].id = t.id; frame.touches[touchIndex].x = t.x; frame.touches[touchIndex].y = t.y; frame.touches[touchIndex].force = t.force; frame.touches[touchIndex].dx = t.dx; frame.touches[touchIndex].dy = t.dy; frame.touches[touchIndex].dForce = t.dForce; frame.touches[touchIndex].touchState = t.touchState; touchIndex++; } }
internal void SetTouchInfo(TactonicDevice deviceInfo) { frameEvent = new TactonicFrameEvent(device); touchEvent = new TactonicTouchEvent(device); device.serialNumber = deviceInfo.serialNumber; device.rows = deviceInfo.rows; device.cols = deviceInfo.cols; device.rowSpacingUM = deviceInfo.rowSpacingUM; device.colSpacingUM = deviceInfo.colSpacingUM; frameEvent.device = device; for(int i = 0; i < 8; i++){ forceFrames[i] = new TactonicFrame(device); touchFrames[i] = new TactonicTouchFrame(); } }