Exemplo n.º 1
0
    def submitGUI(self):
        """ Submit the GUI

        Get all settings, confirm they are valid, save new settings file

        """
        ## Error Check All GUI SETTINGS
        errorCheckPassed = self.check_GUI_settings()

        # write GUI settings to file
        if errorCheckPassed:
            # Convery the GUI_settings from kivy dictproperty to a regular ol'
            # python dict (and do some reformatting along the way)
            allSettings = {}
            for k in self.GUI_settings.keys():
                # convert text inputs to integers
                if k in ['pynealScannerPort', 'resultsServerPort', 'numTimepts']:
                        allSettings[k] = int(self.GUI_settings[k])
                else:
                    allSettings[k] = self.GUI_settings[k]

            # write the settings as the new config yaml file
            with open(setupConfigFile, 'w') as outputFile:
                yaml.dump(allSettings, outputFile, default_flow_style=False)

            # Close the GUI
            global submitButtonPressed
            submitButtonPressed = True
            App.get_running_app().stop()
            EventLoop.exit()
Exemplo n.º 2
0
    def submitGUI(self):
        """ Submit the GUI

        Get all settings, confirm they are valid, save new settings file

        """
        ## Error Check All GUI SETTINGS
        errorCheckPassed = self.check_GUI_settings()

        # write GUI settings to file
        if errorCheckPassed:
            # Convery the GUI_settings from kivy dictproperty to a regular ol'
            # python dict (and do some reformatting along the way)
            allSettings = {}
            for k in self.GUI_settings.keys():
                # convert text inputs to integers
                if k in [
                        'pynealScannerPort', 'resultsServerPort', 'numTimepts'
                ]:
                    allSettings[k] = int(self.GUI_settings[k])
                else:
                    allSettings[k] = self.GUI_settings[k]

            # write the settings as the new config yaml file
            with open(setupConfigFile, 'w') as outputFile:
                yaml.dump(allSettings, outputFile, default_flow_style=False)

            # Close the GUI
            global submitButtonPressed
            submitButtonPressed = True
            App.get_running_app().stop()
            EventLoop.exit()
Exemplo n.º 3
0
    def submitGUI(self):
        """ Submit the GUI

        Get all settings, confirm they are valid, save new settings file

        """
        # Error check all GUI settings
        errorCheckPassed = self.check_GUI_settings()

        # write GUI settings to file
        if errorCheckPassed:
            # Convery the GUI_settings from kivy dictproperty to a regular ol'
            # python dict
            allSettings = {}
            for k in self.GUI_settings.keys():
                allSettings[k] = self.GUI_settings[k]

            # write the settings as the new config yaml file
            with open(createMaskConfigFile, 'w') as outputFile:
                yaml.dump(allSettings, outputFile, default_flow_style=False)

            # Close the GUI
            global submitButtonPressed
            submitButtonPressed = True
            App.get_running_app().stop()
            EventLoop.exit()
Exemplo n.º 4
0
    def submitGUI(self):
        """ Submit the GUI

        Get all settings, confirm they are valid, save new settings file

        """
        # Error check all GUI settings
        errorCheckPassed = self.check_GUI_settings()

        # write GUI settings to file
        if errorCheckPassed:
            # Convery the GUI_settings from kivy dictproperty to a regular ol'
            # python dict
            allSettings = {}
            for k in self.GUI_settings.keys():
                allSettings[k] = self.GUI_settings[k]

            # write the settings as the new config yaml file
            with open(createMaskConfigFile, 'w') as outputFile:
                yaml.dump(allSettings, outputFile, default_flow_style=False)

            # Close the GUI
            global submitButtonPressed
            submitButtonPressed = True
            App.get_running_app().stop()
            EventLoop.exit()