示例#1
0
    def __init__(self, window, vehicle):
        """Initialization Routine
        @param window The window instance.
        @param vehicle The vehicle instance."""
        ## @var window
        # The window object instance.
        self.window = window
        ## @var elements
        # The elements dictionary.
        self.elements = {}
        for measurement_type in DASHBOARD_MEASUREMENTS:
            self.elements[Measurement.name_from_class(
                    measurement_type)] = DataPoint(measurement_type)
            vehicle.listen(measurement_type, self.receive)
        ## @var started_time
        # The dashboard start time.
        self.started_time = datetime.now()
        ## @var messages_received
        # Stores the number of stored messages.
        self.messages_received = 0

        curses.use_default_colors()
        curses.init_pair(1, curses.COLOR_RED, -1)
        curses.init_pair(2, curses.COLOR_GREEN, -1)
        curses.init_pair(3, curses.COLOR_YELLOW, -1)
示例#2
0
    def unregister(self, measurement_class, callback):
        """Stop notifying ``callback`` of new values of ``measurement_class``.

        If the callback wasn't previously registered, this method will have no
        effect.
        """
        self.callbacks[Measurement.name_from_class(measurement_class)].remove(
            callback)
示例#3
0
    def unregister(self, measurement_class, callback):
        """Stop notifying ``callback`` of new values of ``measurement_class``.

        If the callback wasn't previously registered, this method will have no
        effect.
        """
        self.callbacks[Measurement.name_from_class(measurement_class)
                ].remove(callback)
示例#4
0
 def register(self, measurement_class, callback):
     """Call the ``callback`` with any new values of ``measurement_class``
     received.
     @param measurement_class The measurement class for this object 
     instance.
     @param callback the callback function name.
     """
     self.callbacks[Measurement.name_from_class(measurement_class)
             ].add(callback)
示例#5
0
    def __init__(self, window, vehicle):
        self.window = window
        self.elements = {}
        for measurement_type in DASHBOARD_MEASUREMENTS:
            self.elements[Measurement.name_from_class(
                    measurement_type)] = DataPoint(measurement_type)
            vehicle.listen(measurement_type, self.receive)

        self.started_time = datetime.now()
        self.messages_received = 0

        curses.use_default_colors()
        curses.init_pair(1, curses.COLOR_RED, -1)
        curses.init_pair(2, curses.COLOR_GREEN, -1)
        curses.init_pair(3, curses.COLOR_YELLOW, -1)
示例#6
0
    def __init__(self, window, vehicle):
        self.window = window
        self.elements = {}
        for measurement_type in DASHBOARD_MEASUREMENTS:
            self.elements[Measurement.name_from_class(
                measurement_type)] = DataPoint(measurement_type)
            vehicle.listen(measurement_type, self.receive)

        self.started_time = datetime.now()
        self.messages_received = 0

        curses.use_default_colors()
        curses.init_pair(1, curses.COLOR_RED, -1)
        curses.init_pair(2, curses.COLOR_GREEN, -1)
        curses.init_pair(3, curses.COLOR_YELLOW, -1)
示例#7
0
 def register(self, measurement_class, callback):
     """Call the ``callback`` with any new values of ``measurement_class``
     received.
     """
     self.callbacks[Measurement.name_from_class(measurement_class)].add(
         callback)
示例#8
0
 def register(self, measurement_class, callback):
     """Call the ``callback`` with any new values of ``measurement_class``
     received.
     """
     self.callbacks[Measurement.name_from_class(measurement_class)
             ].add(callback)