當前位置: 首頁>>代碼示例>>Python>>正文


Python state_gui_model.StateGuiModel類代碼示例

本文整理匯總了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)
開發者ID:samueljackson92,項目名稱:mantid,代碼行數:7,代碼來源:create_state_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:8,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:8,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:9,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:9,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:10,代碼來源:state_gui_model_test.py

示例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")
開發者ID:DanNixon,項目名稱:mantid,代碼行數:10,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:11,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:11,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:11,代碼來源:state_gui_model_test.py

示例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.)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:25,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:12,代碼來源:state_gui_model_test.py

示例13: red_dim_wrapper

 def red_dim_wrapper():
     state_gui_model = StateGuiModel({"test": [1]})
     state_gui_model.reduction_dimensionality = "string"
開發者ID:DanNixon,項目名稱:mantid,代碼行數:3,代碼來源:state_gui_model_test.py

示例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")
開發者ID:DanNixon,項目名稱:mantid,代碼行數:4,代碼來源:state_gui_model_test.py

示例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)
開發者ID:DanNixon,項目名稱:mantid,代碼行數:4,代碼來源:state_gui_model_test.py


注:本文中的sans.gui_logic.models.state_gui_model.StateGuiModel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。