parameters: (self)
return_statement: return script
docstring: Generate the script for live data reduction
docstring_summary: Generate the script for live data reduction
docstring_tokens: Generate the script for live data reduction
function: def to_live_script(self):
          """
              Generate the script for live data reduction
          """
          # Need to construct Dgs call slightly differently: no line breaks & extract output workspace
          options = ""
          for item in self._observers:
              if item.state() is not None:
                  for subitem in str(item.state()).split('\n'):
                      if len(subitem):
                          if 'OutputWorkspace' in subitem:
                              output_workspace = subitem
                              options += "OutputWorkspace=output,"
                          else:
                              options += subitem
  
          if '_spe' in output_workspace:
              output_workspace = 'OutputWorkspace="live_spe"'
  
          script = """StartLiveData(UpdateEvery='10',Instrument='"""
          script += self.instrument_name
          script += """',ProcessingScript='"""
          script += DgsReductionScripter.TOPLEVEL_WORKFLOWALG + '('
          script += options
          script += ")"
  
          script += """',PreserveEvents=True,RunTransitionBehavior='Stop',"""
          script += output_workspace
          script += ")\n"
  
          return script
function_tokens: def to_live_script ( self ) : # Need to construct Dgs call slightly differently: no line breaks & extract output workspace options = "" for item in self . _observers : if item . state ( ) is not None : for subitem in str ( item . state ( ) ) . split ( '\n' ) : if len ( subitem ) : if 'OutputWorkspace' in subitem : output_workspace = subitem options += "OutputWorkspace=output," else : options += subitem if '_spe' in output_workspace : output_workspace = 'OutputWorkspace="live_spe"' script = """StartLiveData(UpdateEvery='10',Instrument='""" script += self . instrument_name script += """',ProcessingScript='""" script += DgsReductionScripter . TOPLEVEL_WORKFLOWALG + '(' script += options script += ")" script += """',PreserveEvents=True,RunTransitionBehavior='Stop',""" script += output_workspace script += ")\n" return script