コード例 #1
0
 def test_update_and_set_facility(self):
     self.assertFalse("TEST" in config.getFacilityNames())
     ConfigService.updateFacilities(
         os.path.join(ConfigService.getInstrumentDirectory(), "IDFs_for_UNIT_TESTING/UnitTestFacilities.xml")
     )
     ConfigService.setFacility("TEST")
     self.assertEquals(config.getFacility().name(), "TEST")
     self.assertRaises(RuntimeError, config.getFacility, "SNS")
コード例 #2
0
 def test_update_and_set_facility(self):
     self.assertFalse("TEST" in config.getFacilityNames())
     ConfigService.updateFacilities(
         os.path.join(ConfigService.getInstrumentDirectory(),
                      "IDFs_for_UNIT_TESTING/UnitTestFacilities.xml"))
     ConfigService.setFacility("TEST")
     self.assertEquals(config.getFacility().name(), "TEST")
     self.assertRaises(RuntimeError, config.getFacility, "SNS")
コード例 #3
0
ファイル: presenter.py プロジェクト: mantidproject/mantid
 def action_facility_changed(self, new_facility):
     """
     When the facility is changed, refreshes all available instruments that can be selected in the dropdown.
     :param new_facility: The name of the new facility that was selected
     """
     ConfigService.setFacility(new_facility)
     # refresh the instrument selection to contain instruments about the selected facility only
     self.view.instrument.clear()
     self.view.instrument.addItems(
         [instr.name() for instr in ConfigService.getFacility(new_facility).instruments()])
コード例 #4
0
 def action_facility_changed(self, new_facility):
     """
     When the facility is changed, refreshes all available instruments that can be selected in the dropdown.
     :param new_facility: The name of the new facility that was selected
     """
     current_value = ConfigService.getFacility().name()
     if new_facility != current_value:
         ConfigService.setFacility(new_facility)
     # refresh the instrument selection to contain instruments about the selected facility only
     self.view.instrument.facility = new_facility
     if new_facility != current_value:
         self.view.instrument.setCurrentIndex(0)
コード例 #5
0
 def action_facility_changed(self, new_facility):
     """
     When the facility is changed, refreshes all available instruments that can be selected in the dropdown.
     :param new_facility: The name of the new facility that was selected
     """
     current_value = ConfigService.getFacility().name()
     if new_facility != current_value:
         ConfigService.setFacility(new_facility)
     # refresh the instrument selection to contain instruments about the selected facility only
     self.view.cbInstrument.clear()
     self.view.cbInstrument.addItems(
         [instr.name() for instr in ConfigService.getFacility(new_facility).instruments()])
コード例 #6
0
ファイル: presenter.py プロジェクト: ethoeng/mantid
 def store_facility(self, new_facility):
     current_value = ConfigService.getFacility().name()
     if new_facility != current_value:
         ConfigService.setFacility(new_facility)
         return True
     return False
コード例 #7
0
ファイル: presenter.py プロジェクト: gemmaguest/mantid
 def store_facility(self, new_facility):
     current_facility = self._get_current_facility()
     if new_facility != current_facility:
         ConfigService.setFacility(new_facility)
         return True
     return False