예제 #1
0
    def left_button_click(self, context):
        """OVERRIDE METHOD from abstract super class.
        if user clicks on left button, the number increase of one unit and then the audio interface tells the new number"""

        self.counter.decrease()
        list_element = self.list_to_scroll[self.counter.get_value()]
        output_interface.output(list_element)
예제 #2
0
    def __init__(self, list_to_scroll, minimum=1):
        super(State, self).__init__()
        self.counter = Simple_counter(minimum, len(list_to_scroll) - 1)
        self.list_to_scroll = list_to_scroll

        list_element = self.list_to_scroll[self.counter.get_value()]
        output_interface.output(list_element)
예제 #3
0
def start(initial_value):
    """cuntdown from initial_value to 0. Each second I give output remaining seconds"""
    for x in range(initial_value, 0, -1):
        oldnow = time.time()
        output_interface.output(str(x), 250)
        delay = float(time.time()) - oldnow
        if (delay >= 0.0 and delay < 1.0):
            time.sleep(1.0 - delay)
예제 #4
0
    def notify(self, percentage, sensor_position):
        self.result_sum += percentage
        self.n_result += 1 

        if(percentage<MINIMUM_PERCENTAGE):
            output_interface.output(ERROR + " " + lang.dictionary[sensor_position])
        else:
            output_interface.output(CORRECT + " " + lang.dictionary[sensor_position])
# -*- coding: utf-8 -*-

import pyttsx
import vocal_synthesizer as vs

vs.init()
vs.output("it works")
예제 #6
0
    def left_button_click(self, context):
        """OVERRIDE METHOD from abstract super class.
        user don't want to confirm current number -> the state returns to inital_state to allow user to select another number"""

        output_interface.output(NO + ", " + DISCARDED_VALUE)
        context.state = context.initial_state
예제 #7
0
 def right_button_click(self, context):
     """OVERRIDE METHOD from abstract super class.
     user confirmed current number -> current module can return the selected number and its work is done"""
     output_interface.output(YES)
     context.finish = True
예제 #8
0
 def __init__(self, selected):
     super(State, self).__init__()
     output_interface.output(CONFIRM + " " + str(selected) + "?")
예제 #9
0
    def right_button_click(self, context):
        """OVERRIDE METHOD from abstract super class.
        if user clicks on right button, the number increase of one unit and then the audio interface tells the new number"""

        self.counter.increase()
        output_interface.output(self.counter.get_value())
예제 #10
0
 def __init__(self):
     super(State, self).__init__()
     self.counter = Simple_counter(0, MAX_EXERCISE_ID)
     output_interface.output(self.counter.get_value())