Beispiel #1
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self._baud = 57600
     self.active_arduino = 0
     self._arduinos = []
     self._arduinos_it = []
Beispiel #2
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     self.running_sugar = self._parent.running_sugar
     self._status = True
     self.pause = 0
     self.widgets = {}
Beispiel #3
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self._baud = 57600
     self.active_arduino = 0
     self._arduinos = []
     self._arduinos_it = []
Beispiel #4
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     if os.path.exists(ACCELEROMETER_DEVICE):
         self._status = True
     else:
         self._status = False
     self.running_sugar = self._parent.running_sugar
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     self.audio_started = False
     self._status = True  # TODO: test for audio device
     # These flags are referenced by audiograb
     self.hw = self._parent.hw
     self.running_sugar = self._parent.running_sugar
Beispiel #6
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     if os.path.exists(ACCELEROMETER_DEVICE):
         self._status = True
     else:
         self._status = False
     self.running_sugar = self._parent.running_sugar
Beispiel #7
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self._baud = 57600
     self.active_rodi = 0
     self._rodis = []
     self._rodis_it = []
     self._rodis_pines = []
     self.actualSpeed = [50, 50]
Beispiel #8
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     if os.path.exists(LIGHT_SENSOR_DEVICE):
         self._status = True
     else:
         self._status = False
     self._light = 0
     self.running_sugar = self._parent.running_sugar
Beispiel #9
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     if os.path.exists(LIGHT_SENSOR_DEVICE):
         self._status = True
     else:
         self._status = False
     self._light = 0
     self.running_sugar = self._parent.running_sugar
Beispiel #10
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     self.audio_started = False
     self._sound_init = False
     self._resistance_init = False
     self._voltage_init = False
     self._status = True  # TODO: test for audio device
     # These flags are referenced by audiograb
     self.hw = self._parent.hw
     self.running_sugar = self._parent.running_sugar
Beispiel #11
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self.init_gconf()
     power_manager_off(True)
     self.butia = pybot_client.robot(auto_connect=False)
     self.actualSpeed = [600, 600]
     self.active_butia = 0
     self.butia_count = 0
     self.pollthread = None
     self.pollrun = True
     self.bobot = None
     self._auto_refresh = False
     self.use_cc = False
     self.modsen_a_f = 'x'
     self.modsen_b_f = 'x'
     self.modsen_c_f = 'x'
     self.getCastButia()
     self.m_d = {}
     self.match_dict = {}
     self.battery_value = ERROR
     self.battery_color = COLOR_NOTPRESENT[:]
     self.old_battery_color = COLOR_NOTPRESENT[:]
     self.statics_color = COLOR_NOTPRESENT[:]
     self.extras_color = COLOR_NOTPRESENT[:]
     self.old_extras_color = COLOR_NOTPRESENT[:]
     self.match_list = []
     self.modules_changed = []
     self.list_connected_device_module = []
     self.pollthread = threading.Timer(0, self.pybot_launch)
     self.pollthread.start()
     self.can_refresh = True
     self.regex = re.compile(r"""^		#Start of the string
                             (\D*?)			# name, an string  without digits, the ? mark says that it's not greedy, to avoid to consume also the "Butia" part, in case it's present
                             (\d*)				# index, a group comprised only of digits, posibly absent
                             (?:Butia)?			# an ocurrence of the "Butia" string, the first ? mark says that the group hasn't to be returned, the second that the group might or not be present 
                             $				# end of the string, this regex must match all of the input
                     """, re.X)  # Verbose definition, to include comments
     global d
     d['led'] = self.setLed
     d['light'] = self.getLight
     d['gray'] = self.getGray
     d['button'] = self.getButton
     d['distance'] = self.getDistance
     d['resistanceB'] = self.getResistance
     d['voltageB'] = self.getVoltage
     d['temperature'] = self.getTemperature
     d['modSenA'] = self.getSenA
     d['modSenB'] = self.getSenB
     d['modSenC'] = self.getSenC
     d['modActA'] = self.setActA
     d['modActB'] = self.setActB
     d['modActC'] = self.setActC
Beispiel #12
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.init_gconf()
     self._parent = parent
     self.running_sugar = self._parent.running_sugar
     self._status = True
     self.pause = 0
     self._events = Events()
     self._buttons = {
     }  #previous values from buttons {key:[value, lastDebounceTime]}
     self._last_event = 0
     self._program_name = ''
     self._defaults = {}  # local default values for conf keys
Beispiel #13
0
  def __init__(self, parent):
    Plugin.__init__(self)
    self.parent = parent
    self.handPresent = False
    self.lastHandPresent = False
    self.xHand = 0
    self.yHand = 0
    self.zHand = 0

    self.kinectBlocks = ['xKinect', 'yKinect', 'zKinect']

    self.pollrun = True
    self.kinectThread=None
    self.paletteThread=None
Beispiel #14
0
 def getPlugins(self, categories = None):
     """Returns the plugin_list of all plugins of the given categories,
     or all the plugins if categories is not specified
     Returns: List[Subclass<Plugin>]
     Params:
         categories: List[String]
     """
     import plugins
     from plugins.plugin import Plugin
     if categories is None or len(categories) == 0:
         plugin_list = Plugin.__subclasses__()
     else:
         plugin_list = [p for p in Plugin.__subclasses__() if p.category in categories]
     return plugin_list
Beispiel #15
0
 def getPlugins(self, categories=None):
     """Returns the plugin_list of all plugins of the given categories,
     or all the plugins if categories is not specified
     Returns: List[Subclass<Plugin>]
     Params:
         categories: List[String]
     """
     import plugins
     from plugins.plugin import Plugin
     if categories is None or len(categories) == 0:
         plugin_list = Plugin.__subclasses__()
     else:
         plugin_list = [
             p for p in Plugin.__subclasses__() if p.category in categories
         ]
     return plugin_list
    def __init__(self, parent):
        Plugin.__init__(self)
        ''' Make sure there is a camera device '''
        self._parent = parent
        self._status = False
        self._ag_control = None
        self.devices = []
        self.cameras = []
        self.luminance = 0

        if os.path.exists('/dev/video0'):
            self.devices.append('/dev/video0')
        if os.path.exists('/dev/video1'):
            self.devices.append('/dev/video1')
        if len(self.devices) > 0:
            self._status = True
        else:
            self._status = False
Beispiel #17
0
    def __init__(self, parent):
        Plugin.__init__(self)
        ''' Make sure there is a camera device '''
        self._parent = parent
        self._status = False
        self._ag_control = None
        self.devices = []
        self.cameras = []
        self.luminance = 0

        if os.path.exists('/dev/video0'):
            self.devices.append('/dev/video0')
        if os.path.exists('/dev/video1'):
            self.devices.append('/dev/video1')
        if len(self.devices) > 0:
            self._status = True
        else:
            self._status = False
Beispiel #18
0
    def __init__(self, parent):
        Plugin.__init__(self)
        self._parent = parent
        self._status = False

        """
        The following code will initialize a USB RFID reader. Please note that
        in order to make this initialization function work, it is necessary to
        set the permission for the ttyUSB device to 0666. You can do this by
        adding a rule to /etc/udev/rules.d

        As root (using sudo or su), copy the following text into a new file in
        /etc/udev/rules.d/94-ttyUSB-rules

        KERNEL=="ttyUSB[0-9]",MODE="0666"

        You only have to do this once.
        """

        self.rfid_connected = False
        self.rfid_device = find_device()
        self.rfid_idn = ''

        if self.rfid_device is not None:
            _logger.info("RFID device found")
            self.rfid_connected = self.rfid_device.do_connect()
            if self.rfid_connected:
                self.rfid_device.connect("tag-read", self._tag_read_cb)
                self.rfid_device.connect("disconnected", self._disconnected_cb)

            loop = DBusGMainLoop()
            bus = dbus.SystemBus(mainloop=loop)
            hmgr_iface = dbus.Interface(
                bus.get_object(
                    HAL_SERVICE,
                    HAL_MGR_PATH),
                HAL_MGR_IFACE)

            hmgr_iface.connect_to_signal('DeviceAdded', self._device_added_cb)

            self._status = True
Beispiel #19
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self.cam_on = False
     self.cam_present = False
     self.cam_init = False
     self.tamanioc = (320, 240)
     self.colorc = (255, 255, 255)
     self.threshold = (25, 25, 25)
     self.pixels_min = 10
     self.pixels = 0
     self.brightness = 128
     self.color_dist = 9000
     self.use_average = True
     self.calibrations = {}
     self.mode = 'RGB'
     self.cam = None
     self.mask = None
     self.connected = None
     self.capture = None
     self.lcamaras = []
Beispiel #20
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self.cam_on = False
     self.cam_present = False
     self.cam_init = False
     self.tamanioc = (320, 240)
     self.colorc = (255, 255, 255)
     self.threshold = (25, 25, 25)
     self.pixels_min = 10
     self.pixels = 0
     self.brightness = 128
     self.color_dist = 9000
     self.use_average = True
     self.calibrations = {}
     self.mode = 'RGB'
     self.cam = None
     self.mask = None
     self.connected = None
     self.capture = None
     self.lcamaras = []
Beispiel #21
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self.vel = 10
     self._inited = False
     self.api = apiSumoUY.apiSumoUY()
Beispiel #22
0
 def __init__(self, turtle_window):
     Plugin.__init__(self)
     self.tw = turtle_window
     self.command = None
Beispiel #23
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self.WeDos = []
     self.active_wedo = 0
Beispiel #24
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     self.running_sugar = self._parent.running_sugar
     self._result = ""
Beispiel #25
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     self.running_sugar = self._parent.running_sugar
     self._status = True
     self.pause = 0
Beispiel #26
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self._fischers = []
     self.active_fischer = 0
Beispiel #27
0
 def __init__(self):
   Plugin.__init__(self)
Beispiel #28
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self.WeDos = []
     self.active_wedo = 0
Beispiel #29
0
 def __init__(self,parent):
     Plugin.__init__(self)
     self.tw = parent
     self.butia = pybot_client.robot()
Beispiel #30
0
    def __init__(self, parent):
        Plugin.__init__(self)
        self.tw = parent
        power_manager_off(True)

        self.apiArDrone = ardroneAPI.ardroneAPI()
Beispiel #31
0
 def __register_plugin(self):
     for plugin in Plugin.__subclasses__():
         self.__operations[plugin.op] = plugin
Beispiel #32
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self._fischers = []
     self.active_fischer = 0
Beispiel #33
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self._bricks = []
     self.active_nxt = 0
     self._motor_pos = {}
Beispiel #34
0
 def __init__(self):
     Plugin.__init__(self)
     self.libplugin = LibAuth()
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self.vel = 10
     self._inited = False
     self.api = apiSumoUY.apiSumoUY()
Beispiel #36
0
 def __init__(self, parent):
     Plugin.__init__(self);
     self.tw = parent
     self.active_rodi = 0
     self._rodis = []
     self.actualSpeed = [100, 100]
Beispiel #37
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self._bricks = []
     self.active_nxt = 0
     self._motor_pos = {}
Beispiel #38
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self.tw = parent
     self.isInit = False
     self._path = os.path.dirname(__file__)
     self.detection = patternsAPI.detection()
Beispiel #39
0
 def __init__(self, parent):
     Plugin.__init__(self)
     self._parent = parent
     self.running_sugar = self._parent.running_sugar
     self.from_lang = 'english'
     self.to_lang = 'spanish'
Beispiel #40
0
	def __init__(self, parent):
		Plugin.__init__(self)
		self.tw = parent
		self.butia = pybot_client.robot(auto_connect=True)
		self.pause = 0
Beispiel #41
0
 def __init__(self):
     Plugin.__init__(self)
     self.libplugin = LibAuth()