Ejemplo n.º 1
0
 def _swap_in_mwrunfiles_widget(self):
     labeltext = self._content.sample_label.text()
     self._content.sample_label.hide()
     self._content.sample_edit.hide()
     self._content.sample_browse.hide()
     self._content.horizontalLayout.removeWidget(self._content.sample_label)
     self._content.horizontalLayout.removeWidget(self._content.sample_edit)
     self._content.horizontalLayout.removeWidget(
         self._content.sample_browse)
     spacer = self._content.horizontalLayout.takeAt(0)
     self._content.sample_edit = mantidqtpython.MantidQt.API.FileFinderWidget(
     )
     # Unfortunately, can only use live if default instrument = gui-set instrument
     if self._instrument_name == config.getInstrument().name():
         self._content.sample_edit.setProperty("liveButton", "Show")
     self._content.sample_edit.setProperty("multipleFiles", True)
     self._content.sample_edit.setProperty("algorithmAndProperty",
                                           "Load|Filename")
     self._content.sample_edit.setProperty("label", labeltext)
     self._content.sample_edit.setLabelMinWidth(
         self._content.sample_label.minimumWidth())
     self._content.horizontalLayout.addWidget(self._content.sample_edit)
     self._content.horizontalLayout.addItem(spacer)
     self._content.sample_edit.fileFindingFinished.connect(
         lambda: self._validate_edit(self._content.sample_edit))
     self._livebuttonwidget = self._content.sample_edit
Ejemplo n.º 2
0
 def create_info_table(self):
     """Sets the names of properties retrieve from the log when creating
     an info table.
     """
     
     inst_name = config.getInstrument().name()
     inst = mtd["__empty_" + inst_name].getInstrument()
     props = inst.getStringParameter('Workflow.InfoTable')
     
     if props:
         self._info_table_props = props
     else:
         logger.error("Instrument does not have Workflow.InfoTable " +
             "defined in its parameter file.  Unable to create info table for runs.")
Ejemplo n.º 3
0
 def __init__(self, user_name, calibration_dir, output_dir, inst_prefix):
     # ----- Properties common to ALL instruments -------- #
     if user_name is None:
         raise ValueError("A user name must be specified")
     self._user_name = user_name
     self._calibration_dir = calibration_dir
     self._inst_prefix = inst_prefix
     try:
         self._inst_prefix_short = config.getInstrument(inst_prefix).shortName()
     except RuntimeError:
         logger.warning(
             "Unknown instrument {}. Setting short prefix equal to full prefix".format(
                 inst_prefix))
         self._inst_prefix_short = inst_prefix
     self._output_dir = output_dir
     self._is_vanadium = None
     self._beam_parameters = None
Ejemplo n.º 4
0
 def _swap_in_mwrunfiles_widget(self):
     labeltext = self._content.sample_label.text()
     self._content.sample_label.hide()
     self._content.sample_edit.hide()
     self._content.sample_browse.hide()
     self._content.horizontalLayout.removeWidget(self._content.sample_label)
     self._content.horizontalLayout.removeWidget(self._content.sample_edit)
     self._content.horizontalLayout.removeWidget(self._content.sample_browse)
     spacer = self._content.horizontalLayout.takeAt(0)
     self._content.sample_edit = mantidqtpython.MantidQt.MantidWidgets.MWRunFiles()
     # Unfortunately, can only use live if default instrument = gui-set instrument
     if self._instrument_name == config.getInstrument().name():
         self._content.sample_edit.setProperty("liveButton","ShowIfCanConnect")
     self._content.sample_edit.setProperty("multipleFiles",True)
     self._content.sample_edit.setProperty("algorithmAndProperty","Load|Filename")
     self._content.sample_edit.setProperty("label",labeltext)
     self._content.sample_edit.setLabelMinWidth(self._content.sample_label.minimumWidth())
     self._content.horizontalLayout.addWidget(self._content.sample_edit)
     self._content.horizontalLayout.addItem(spacer)
     self._content.sample_edit.fileFindingFinished.connect(lambda: self._validate_edit(self._content.sample_edit))
     self._livebuttonwidget = self._content.sample_edit
Ejemplo n.º 5
0
 def test_getInstrumentReturns_A_InstrumentInfo_Object(self):
     self.assertTrue(
         isinstance(config.getInstrument("WISH"), InstrumentInfo))
     self.assertRaises(RuntimeError, config.getInstrument,
                       "MadeUpInstrument")
Ejemplo n.º 6
0
 def test_getInstrumentReturns_A_InstrumentInfo_Object(self):
     self.assertTrue(isinstance(config.getInstrument("WISH"), InstrumentInfo))
     self.assertRaises(RuntimeError, config.getInstrument, "MadeUpInstrument")