parameters: (self, amplitude)
return_statement: return True
docstring: amplitude subscriber
docstring_summary: amplitude subscriber
docstring_tokens: amplitude subscriber
function: def set_amplitude(self, amplitude):
          """
          amplitude subscriber
          """
          if amplitude < 0.0 or amplitude > 1.0:
              self.vprint("Amplitude out of range:", amplitude)
              return False
          if self[TYPE_KEY] in (analog.GR_SIN_WAVE, analog.GR_CONST_WAVE, analog.GR_GAUSSIAN, analog.GR_UNIFORM):
              self._src.set_amplitude(amplitude)
          elif self[TYPE_KEY] == "2tone":
              self._src1.set_amplitude(amplitude / 2.0)
              self._src2.set_amplitude(amplitude / 2.0)
          elif self[TYPE_KEY] == "sweep":
              self._src.set_k(amplitude)
          else:
              return True  # Waveform not yet set
          self.vprint("Set amplitude to:", amplitude)
          self.update_gain_range()
          return True
function_tokens: def set_amplitude ( self , amplitude ) : if amplitude < 0.0 or amplitude > 1.0 : self . vprint ( "Amplitude out of range:" , amplitude ) return False if self [ TYPE_KEY ] in ( analog . GR_SIN_WAVE , analog . GR_CONST_WAVE , analog . GR_GAUSSIAN , analog . GR_UNIFORM ) : self . _src . set_amplitude ( amplitude ) elif self [ TYPE_KEY ] == "2tone" : self . _src1 . set_amplitude ( amplitude / 2.0 ) self . _src2 . set_amplitude ( amplitude / 2.0 ) elif self [ TYPE_KEY ] == "sweep" : self . _src . set_k ( amplitude ) else : return True # Waveform not yet set self . vprint ( "Set amplitude to:" , amplitude ) self . update_gain_range ( ) return True