Skip to content
debug.py 1.05 KiB
Newer Older
Dalai Felinto's avatar
Dalai Felinto committed
"""
Debug
=====

Debug device for testing
"""

from . import HMD_Data

Dalai Felinto's avatar
Dalai Felinto committed
VERBOSE = False

def print_debug(*args):
    if VERBOSE:
        print("Debug: {0}".format(*args))


Dalai Felinto's avatar
Dalai Felinto committed
class Debug:
    def __init__(self):
        self._device = None

    def isConnected(self):
        """
        Check if device is connected

        :return: return True if the device is connected
        :rtype: bool
        """
Dalai Felinto's avatar
Dalai Felinto committed
        print_debug('isConnected()')
Dalai Felinto's avatar
Dalai Felinto committed
        return True

    def init(self):
        """
        Initialize device

        :return: return True if the device was properly initialized
        :rtype: bool
        """
Dalai Felinto's avatar
Dalai Felinto committed
        print_debug('init()')

        self._width = 512
        self._height = 512

Dalai Felinto's avatar
Dalai Felinto committed
        return True

    def loop(self):
        """
        Get fresh tracking data
        """
Dalai Felinto's avatar
Dalai Felinto committed
        print_debug('loop()')
Dalai Felinto's avatar
Dalai Felinto committed

    def frameReady(self):
        """
        The frame is ready to be send to the device
        """
Dalai Felinto's avatar
Dalai Felinto committed
        print_debug('frameReady()')
Dalai Felinto's avatar
Dalai Felinto committed

    def quit(self):
        """
        Garbage collection
        """
Dalai Felinto's avatar
Dalai Felinto committed
        print_debug('quit()')
Dalai Felinto's avatar
Dalai Felinto committed