本文整理汇总了Python中sans.gui_logic.models.state_gui_model.StateGuiModel类的典型用法代码示例。如果您正苦于以下问题:Python StateGuiModel类的具体用法?Python StateGuiModel怎么用?Python StateGuiModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StateGuiModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_gui_state_from_userfile_adds_save_format_from_gui
def test_create_gui_state_from_userfile_adds_save_format_from_gui(self):
gui_state = StateGuiModel({})
gui_state.save_types = [SaveType.NXcanSAS]
row_state = create_gui_state_from_userfile('MaskLOQData.txt', gui_state)
self.assertEqual(gui_state.save_types, row_state.save_types)
示例2: test_that_can_set_transmission_roi_mask_and_radius
def test_that_can_set_transmission_roi_mask_and_radius(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.transmission_roi_files = "roi.xml"
state_gui_model.transmission_mask_files = "mask.xml"
state_gui_model.transmission_radius = 8.
self.assertTrue(state_gui_model.transmission_roi_files == "roi.xml")
self.assertTrue(state_gui_model.transmission_mask_files == "mask.xml")
self.assertTrue(state_gui_model.transmission_radius == 8)
示例3: test_that_phi_mask_can_be_set
def test_that_phi_mask_can_be_set(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.phi_limit_min = 12.
state_gui_model.phi_limit_max = 13.
state_gui_model.phi_limit_use_mirror = True
self.assertTrue(state_gui_model.phi_limit_min == 12.)
self.assertTrue(state_gui_model.phi_limit_max == 13.)
self.assertTrue(state_gui_model.phi_limit_use_mirror)
示例4: test_that_can_set_transmission_monitor
def test_that_can_set_transmission_monitor(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.transmission_incident_monitor = 2
state_gui_model.transmission_interpolate = True
self.assertTrue(state_gui_model.transmission_incident_monitor == 2)
self.assertTrue(state_gui_model.transmission_interpolate)
# # Reassign
state_gui_model.transmission_incident_monitor = 3
self.assertTrue(state_gui_model.transmission_incident_monitor == 3)
示例5: test_that_can_set_normalize_to_monitor
def test_that_can_set_normalize_to_monitor(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.normalization_incident_monitor = 2
state_gui_model.normalization_interpolate = True
self.assertTrue(state_gui_model.normalization_incident_monitor == 2)
self.assertTrue(state_gui_model.normalization_interpolate)
# Reassign
state_gui_model.normalization_incident_monitor = 3
self.assertTrue(state_gui_model.normalization_incident_monitor == 3)
示例6: test_that_can_set_transmission_fit_options
def test_that_can_set_transmission_fit_options(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.transmission_sample_fit_type = FitType.Logarithmic
state_gui_model.transmission_can_fit_type = FitType.Linear
state_gui_model.transmission_sample_polynomial_order = 2
state_gui_model.transmission_can_polynomial_order = 2
self.assertTrue(state_gui_model.transmission_sample_fit_type is FitType.Logarithmic)
self.assertTrue(state_gui_model.transmission_can_fit_type is FitType.Linear)
self.assertTrue(state_gui_model.transmission_sample_polynomial_order == 2)
self.assertTrue(state_gui_model.transmission_can_polynomial_order == 2)
示例7: test_that_adjustment_files_can_be_set
def test_that_adjustment_files_can_be_set(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.wavelength_adjustment_det_1 = "wav1.txt"
state_gui_model.wavelength_adjustment_det_2 = "wav2.txt"
state_gui_model.pixel_adjustment_det_1 = "pix1.txt"
state_gui_model.pixel_adjustment_det_2 = "pix2.txt"
self.assertTrue(state_gui_model.wavelength_adjustment_det_1 == "wav1.txt")
self.assertTrue(state_gui_model.wavelength_adjustment_det_2 == "wav2.txt")
self.assertTrue(state_gui_model.pixel_adjustment_det_1 == "pix1.txt")
self.assertTrue(state_gui_model.pixel_adjustment_det_2 == "pix2.txt")
示例8: test_that_can_set_wavelength
def test_that_can_set_wavelength(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.wavelength_min = 1.
state_gui_model.wavelength_max = 2.
state_gui_model.wavelength_step = .5
state_gui_model.wavelength_step_type = RangeStepType.Lin
state_gui_model.wavelength_step_type = RangeStepType.Log
self.assertTrue(state_gui_model.wavelength_min == 1.)
self.assertTrue(state_gui_model.wavelength_max == 2.)
self.assertTrue(state_gui_model.wavelength_step == .5)
self.assertTrue(state_gui_model.wavelength_step_type is RangeStepType.Log)
示例9: test_that_transmission_fit_wavelength_can_be_set
def test_that_transmission_fit_wavelength_can_be_set(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.transmission_sample_wavelength_min = 1.3
state_gui_model.transmission_sample_wavelength_max = 10.3
state_gui_model.transmission_can_wavelength_min = 1.3
state_gui_model.transmission_can_wavelength_max = 10.3
self.assertTrue(state_gui_model.transmission_sample_wavelength_min == 1.3)
self.assertTrue(state_gui_model.transmission_sample_wavelength_max == 10.3)
self.assertTrue(state_gui_model.transmission_can_wavelength_min == 1.3)
self.assertTrue(state_gui_model.transmission_can_wavelength_max == 10.3)
示例10: test_that_can_set_the_q_limits
def test_that_can_set_the_q_limits(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.q_1d_rebin_string = "test"
state_gui_model.q_xy_max = 1.
state_gui_model.q_xy_step = 122.
state_gui_model.q_xy_step_type = RangeStepType.Log
self.assertTrue(state_gui_model.q_1d_rebin_string == "test")
self.assertTrue(state_gui_model.q_xy_max == 1.)
self.assertTrue(state_gui_model.q_xy_step == 122.)
self.assertTrue(state_gui_model.q_xy_step_type is RangeStepType.Log)
示例11: test_that_can_set_and_reset_merged_settings
def test_that_can_set_and_reset_merged_settings(self):
state_gui_model = StateGuiModel({DetectorId.shift_fit: [det_fit_range(start=1., stop=2., use_fit=True)],
DetectorId.rescale_fit: [det_fit_range(start=1.4, stop=7., use_fit=False)],
DetectorId.rescale: [12.],
DetectorId.shift: [234.]})
self.assertTrue(state_gui_model.merge_scale == 12.)
self.assertTrue(state_gui_model.merge_shift == 234.)
self.assertFalse(state_gui_model.merge_scale_fit)
self.assertTrue(state_gui_model.merge_shift_fit)
self.assertTrue(state_gui_model.merge_q_range_start == 1.)
self.assertTrue(state_gui_model.merge_q_range_stop == 7.)
state_gui_model.merge_scale = 12.3
state_gui_model.merge_shift = 3.
state_gui_model.merge_scale_fit = True
state_gui_model.merge_shift_fit = False
state_gui_model.merge_q_range_start = 2.
state_gui_model.merge_q_range_stop = 8.
self.assertTrue(state_gui_model.merge_scale == 12.3)
self.assertTrue(state_gui_model.merge_shift == 3.)
self.assertTrue(state_gui_model.merge_scale_fit)
self.assertFalse(state_gui_model.merge_shift_fit)
self.assertTrue(state_gui_model.merge_q_range_start == 2.)
self.assertTrue(state_gui_model.merge_q_range_stop == 8.)
示例12: test_that_can_set_the_sample_geometry
def test_that_can_set_the_sample_geometry(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.sample_width = 1.2
state_gui_model.sample_height = 1.6
state_gui_model.sample_thickness = 1.8
state_gui_model.z_offset = 1.78
state_gui_model.sample_shape = SampleShape.Cuboid
self.assertTrue(state_gui_model.sample_width == 1.2)
self.assertTrue(state_gui_model.sample_height == 1.6)
self.assertTrue(state_gui_model.sample_thickness == 1.8)
self.assertTrue(state_gui_model.z_offset == 1.78)
self.assertTrue(state_gui_model.sample_shape is SampleShape.Cuboid)
示例13: red_dim_wrapper
def red_dim_wrapper():
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.reduction_dimensionality = "string"
示例14: test_that_slice_event_can_be_updated
def test_that_slice_event_can_be_updated(self):
state_gui_model = StateGuiModel({OtherId.event_slices: [event_binning_string_values(value="test")]})
state_gui_model.event_slices = "test2"
self.assertTrue(state_gui_model.event_slices == "test2")
示例15: test_that_is_set_to_2D_reduction
def test_that_is_set_to_2D_reduction(self):
state_gui_model = StateGuiModel({"test": [1]})
state_gui_model.reduction_dimensionality = ReductionDimensionality.TwoDim
self.assertTrue(state_gui_model.reduction_dimensionality is ReductionDimensionality.TwoDim)