PDA

View Full Version : Timestamps on Arrington data? VPX.dll?


performlabrit
04-11-2014, 08:35 AM
I'm attempting to use the Arrington interface, but want accurate timing data.

Although the Vizard plugin does not provide a function to get accurate timing information, the Arrington SDK does, with its function:

VPX_GetDataTime2(0,pointerToACTypeDouble);

I was hoping to use the arrington.sendCommand() function, but seems to only be able to send command line interface functions.

I've seen mention of Vizards vpx.pyd module, but see no documentation.

Any advice?

performlabrit
04-11-2014, 10:42 AM
Solved! Here's a way to access the SDK functions directly, using ctypes module's DLL support. Special thanks to Flip Phillips at Skidmore College for the solution.


from ctypes import * # eyetrackka
import os

vpxDll = 'C:\ViewPoint 2.9.2.5\VPX_InterApp.dll'

if ( not os.access(vpxDll,os.F_OK) ):
print("WARNING: Invalid vpxDll path")

cdll.LoadLibrary( vpxDll )
vpx = CDLL( vpxDll )

eyeTime = c_double();
eyeTimePointer = pointer(eyeTime)
eyeA = self.arrington.EYE_A;


eyeDataTime = vpx.VPX_GetDataTime2(eyeA,eyeTimePointer)

outputString = 'eyeDataTime %f eyeTime %f' % (eyeDataTime, eyeTime.value)
print outputString