From 41e93a0c5fc7db14553797e40acfd475f890f0c3 Mon Sep 17 00:00:00 2001 From: Pootle daemon Date: Thu, 08 Nov 2012 05:30:54 +0000 Subject: Merge branch 'master' of git.sugarlabs.org:turtleart/mainline --- diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index 18c0324..e0a9106 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -1328,7 +1328,14 @@ class TurtleArtWindow(): elif blk.name == 'trashall': for b in self.just_blocks(): if b.type != 'trash': - self._put_in_trash(find_top_block(b)) + if b.name == 'start': # Don't trash start block + b1 = b.connections[-1] + if b1 is not None: + b.connections[-1] = None + b1.connections[0] = None + self._put_in_trash(b1) + else: + self._put_in_trash(find_top_block(b)) elif blk.name in MACROS: self.new_macro(blk.name, x + 20, y + 20) else: diff --git a/icons/run-slowoff.svg b/icons/run-slowoff.svg index 21b827e..5e4dc4f 100644 --- a/icons/run-slowoff.svg +++ b/icons/run-slowoff.svg @@ -11,40 +11,69 @@ width="45" height="45" id="svg2"> - - - - - - - - - + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/audio_sensors/audio_sensors.py b/plugins/audio_sensors/audio_sensors.py index 7cc42ba..5a2a001 100644 --- a/plugins/audio_sensors/audio_sensors.py +++ b/plugins/audio_sensors/audio_sensors.py @@ -172,7 +172,8 @@ class Audio_sensors(Plugin): help_string=_('microphone input voltage'), prim_name='voltage') - if self.hw in [XO15, XO175, XO30] and self._status: + # FIXME: Only add stereo capture for XO15 (broken on ARM #3675) + if self.hw in [XO15] and self._status: palette.add_block('resistance2', style='box-style', label=_('resistance') + '2', @@ -340,11 +341,21 @@ class Audio_sensors(Plugin): return 0 def prim_resistance(self, channel): - ''' return resistance sensor value ''' if not self.hw in [XO1, XO15, XO175, XO30] or not self._status: return 0 - if self.hw == XO1 and channel != 0: - return 0 + if self.hw == XO1: + return self._prim_resistance(0) + elif self.hw == XO15: + return self._prim_resistance(channel) + # FIXME: For ARM (XO175, XO4) channel assignment is seemingly + # random (#3675), so sum both channels + else: + chan0 = self._prim_resistance(0) + chan1 = self._prim_resistance(1) + return chan0 + chan1 + + def _prim_resistance(self, channel): + ''' return resistance sensor value ''' buf = self.ringbuffer[channel].read(None, self.input_step) if len(buf) > 0: # See @@ -378,11 +389,21 @@ class Audio_sensors(Plugin): return 0 def prim_voltage(self, channel): - ''' return voltage sensor value ''' if not self.hw in [XO1, XO15, XO175, XO30] or not self._status: return 0 - if self.hw == XO1 and channel != 0: - return 0 + if self.hw == XO1: + return self._prim_voltage(0) + elif self.hw == XO15: + return self._prim_voltage(channel) + # FIXME: For ARM (XO175, XO4) channel assignment is seemingly + # random (#3675), so sum both channels + else: + chan0 = self._prim_voltage(0) + chan1 = self._prim_voltage(1) + return chan0 + chan1 + + def _prim_voltage(self, channel): + ''' return voltage sensor value ''' buf = self.ringbuffer[channel].read(None, self.input_step) if len(buf) > 0: # See diff --git a/turtleblocks.py b/turtleblocks.py index 09a62a9..5c536a2 100755 --- a/turtleblocks.py +++ b/turtleblocks.py @@ -47,7 +47,8 @@ sys.argv[1:] = [] # Execution of import gst cannot see '--help' or '-h' import gettext -from TurtleArt.taconstants import OVERLAY_LAYER, DEFAULT_TURTLE_COLORS +from TurtleArt.taconstants import OVERLAY_LAYER, DEFAULT_TURTLE_COLORS, \ + TAB_LAYER from TurtleArt.tautils import data_to_string, data_from_string, get_save_name from TurtleArt.tawindow import TurtleArtWindow from TurtleArt.taexportlogo import save_logo @@ -553,6 +554,7 @@ class TurtleMain(): self.tw.lc.trace = 0 self.tw.hideblocks() self.tw.display_coordinates(clear=True) + self.tw.toolbar_shapes['stopiton'].set_layer(TAB_LAYER) self.tw.run_button(0, running_from_button_push=True) return @@ -570,10 +572,13 @@ class TurtleMain(): def _do_stop_cb(self, widget): ''' Callback for stop button. ''' - self.tw.lc.trace = 0 + if not self.tw.hide and not self.tw.running_blocks: + self.tw.hideblocks() + else: + self.tw.showblocks() + self.tw.toolbar_shapes['stopiton'].hide() self.tw.stop_button() self.tw.display_coordinates() - return def _do_copy_cb(self, button): ''' Callback for copy button. ''' -- cgit v0.9.1