def test_set_setting_with_int(self):
        set_setting(GROUP, PREFIX, "something", 10)

        settings = QSettings()
        settings.beginGroup(GROUP)
        returned = settings.value(PREFIX + "something", type=int)
        settings.endGroup()
        self.assertEqual(returned, 10)
    def test_set_setting_with_bool_true(self):
        set_setting(GROUP, PREFIX, "something", True)

        settings = QSettings()
        settings.beginGroup("CustomInterfaces")
        returned = settings.value("EngineeringDiffraction2/" + "something", type=bool)
        settings.endGroup()
        self.assertEqual(returned, True)
    def test_set_setting_with_string(self):
        set_setting(GROUP, PREFIX, "something", "value")

        settings = QSettings()
        settings.beginGroup(GROUP)
        returned = settings.value(PREFIX + "something")
        settings.endGroup()
        self.assertEqual(returned, "value")
Beispiel #4
0
 def generate_prm_output_file(difa_list, difc_list, tzero_list,
                              bank_name, kwargs_to_pass):
     file_path = calibration_dir + EnggUtils.generate_output_file_name(
         ceria_path, instrument, bank=bank_name)
     EnggUtils.write_ENGINX_GSAS_iparam_file(file_path, difa_list,
                                             difc_list, tzero_list,
                                             bk2bk_params,
                                             **kwargs_to_pass)
     set_setting(output_settings.INTERFACES_SETTINGS_GROUP,
                 output_settings.ENGINEERING_PREFIX,
                 "last_calibration_path", file_path)
Beispiel #5
0
 def on_focus_clicked(self):
     if not self._validate():
         return
     regions_dict = self.current_calibration.create_focus_roi_dictionary()
     focus_paths = self.view.get_focus_filenames()
     van_path = self.view.get_vanadium_filename()
     if self._number_of_files_warning(focus_paths):
         self.start_focus_worker(focus_paths, van_path,
                                 self.view.get_plot_output(), self.rb_num,
                                 regions_dict)
     van_run = self.view.get_vanadium_run()
     set_setting(output_settings.INTERFACES_SETTINGS_GROUP,
                 output_settings.ENGINEERING_PREFIX, "last_vanadium_run",
                 van_run)
 def set_setting(name, value):
     set_setting(output_settings.INTERFACES_SETTINGS_GROUP,
                 output_settings.ENGINEERING_PREFIX, name, value)
Beispiel #7
0
 def set_setting(name, value):
     set_setting(path_handling.INTERFACES_SETTINGS_GROUP,
                 path_handling.ENGINEERING_PREFIX, name, value)