def setUp(self): silent = True self.arbstudio = MockArbStudio(name='arbstudio', silent=silent) self.pulseblaster = MockPulseBlaster(name='pulseblaster', silent=silent) self.chip = Chip(name='chip') self.ATS = MockATS(name='ATS', server_name='ATS_server', silent=silent) self.ATS.config(sample_rate=100000) self.acquisition_controller = MockAcquisitionController( name='basic_acquisition_controller', alazar_name='ATS', silent=silent) self.instruments = [ self.arbstudio, self.pulseblaster, self.chip, self.ATS ] self.interfaces = { instrument.name: get_instrument_interface(instrument) for instrument in self.instruments } self.interfaces['ATS'].add_acquisition_controller( 'basic_acquisition_controller', cls_name='Basic_AcquisitionController') self.layout = Layout(name='layout', instrument_interfaces=list( self.interfaces.values()), server_name='layout_server') self.instruments += [self.acquisition_controller, self.layout]
def test_setup_ATS(self): self.ATS_interface = get_instrument_interface(self.ATS) self.ATS_interface.add_acquisition_controller( 'basic_acquisition_controller') self.ATS_interface.update_settings(trigger_engine1='J', trigger_source1='positive', records_per_buffer=True) self.assertNotIn('trigger_engine1', self.ATS.configuration_settings()) self.assertNotIn('records_per_buffer', self.ATS.configuration_settings()) self.ATS_interface.setup_ATS() self.assertIn('trigger_engine1', self.ATS.configuration_settings()) self.assertNotIn('records_per_buffer', self.ATS.configuration_settings())
def test_interface_settings(self): self.ATS_interface = get_instrument_interface(self.ATS) self.ATS_interface.add_acquisition_controller( 'basic_acquisition_controller') self.ATS_interface._set_configuration_settings( trigger_slope1='positive') self.assertEqual(self.ATS_interface.setting('trigger_slope1'), 'positive') self.ATS_interface.update_settings(trigger_slope2='positive') self.assertEqual(self.ATS_interface.setting('trigger_slope1'), 'positive') self.ATS_interface.update_settings(trigger_slope1='negative') self.assertEqual(self.ATS_interface.setting('trigger_slope1'), 'negative') self.assertEqual(self.ATS_interface.setting('trigger_slope2'), 'positive')
def test_setup_acquisition_controller(self): self.ATS_interface = get_instrument_interface(self.ATS) self.ATS_interface.add_acquisition_controller( 'basic_acquisition_controller', cls_name='Basic_AcquisitionController') pulse = MeasurementPulse(t_start=10, t_stop=20) self.ATS_interface.pulse_sequence.add(pulse) self.ATS_interface.average_mode('point') self.ATS_interface.setup() self.ATS_interface.update_settings(trigger_engine1='J', trigger_source1='positive', records_per_buffer=True) self.assertNotIn('trigger_engine1', self.ATS.configuration_settings()) self.assertNotIn('records_per_buffer', self.ATS.configuration_settings()) self.assertEqual(self.acquisition_controller.average_mode(), 'point') self.ATS_interface.setup_acquisition_controller() self.assertNotIn('trigger_engine1', self.acquisition_controller.acquisition_settings()) self.assertIn('records_per_buffer', self.acquisition_controller.acquisition_settings())
def setUp(self): self.pulse_sequence = PulseSequence() self.arbstudio = MockArbStudio(name='mock_arbstudio', server_name='') self.arbstudio_interface = get_instrument_interface(self.arbstudio)
def test_add_acquisition_controller(self): self.ATS_interface = get_instrument_interface(self.ATS) self.ATS_interface.add_acquisition_controller( 'basic_acquisition_controller')