예제 #1
0
파일: __init__.py 프로젝트: Faham/emophiz
def init():
    """Initializes the Tobii SDK, you must call this function before
    any other function in the SDK.
    """
    tobiisdkpy.init()

    for T in (types.Point2D, types.Point3D):
        Converter.register(T.NODE_ID, T._node_converter)
   
    global _initialized
    _initialized = True
예제 #2
0
파일: eyetracker.py 프로젝트: Faham/emophiz
    def SetXConfiguration(self, UpperLeft, UpperRight, LowerLeft, callback = None, *args, **kwargs):

        response_callback = None
        if callback is not None:
            if not callable(callback):        
                raise ValueError("response_callback must be callable")
            response_callback = lambda error, response: callback(error, response, *args, **kwargs)

        response_handler = BasicEyetracker.ResponseHandlerFunctor(data_converter=None,
                                                                  response_callback=response_callback)
        
        params = tobiisdkpy.ParamStack()
        Converter.to_tree(params, UpperLeft)
        Converter.to_tree(params, UpperRight)
        Converter.to_tree(params, LowerLeft)
        
        # write empty tool data
        params.push_node_prolog(1 << 16 | 256)
        params.push_uint32(12345)
            
        self._message_passer.execute_request (1440,
                                              params,
                                              response_handler)
        if response_callback is None:
            return response_handler.wait_for_result()