示例#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
    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()