def edit(self):
        # Initialize the event catalog preference item.
        catalog_names = sorted(self.event_library.get_catalogs_in_db(self.project))
        self.pref_manager.set_limit('event_catalog', catalog_names)
        if catalog_names:
            if self.pref_manager.get_value('event_catalog') not in catalog_names:
                self.pref_manager.set_value('event_catalog', catalog_names[0])

        # Initialize the components.
        if self.project.geometry_inventory:
            channels = sorted([x.scnl for x in self.project.geometry_inventory.get_channel()])
            self.pref_manager.set_limit('scnl_list', channels)

        # Create the edit dialog.
        dlg = gui_pref_dialog.ListbookPrefDialog(preferences = self.pref_manager)

        # Enable/Disable the gui elements based on the pref_manager settings.
        self.on_select_individual()

        # Enable/Disable the time-span elements depending on the 'set
        # collection time-span' collection node.
        if 'set collection time-span' in [x.name for x in self.parentCollection.nodes]:
            item = self.pref_manager.get_item('start_time')[0]
            item.disable_gui_element()
            item = self.pref_manager.get_item('end_time')[0]
            item.disable_gui_element()
        else:
            item = self.pref_manager.get_item('start_time')[0]
            item.enable_gui_element()
            item = self.pref_manager.get_item('end_time')[0]
            item.enable_gui_element()

        dlg.ShowModal()
        dlg.Destroy()
    def edit(self):
        ''' Create the preferences edit dialog.
        '''
        # Initialize the detection_catalog preference item.
        catalog_names = sorted(
            self.detection_library.get_catalogs_in_db(self.project))
        self.pref_manager.set_limit('detection_catalog', catalog_names)
        if catalog_names:
            if self.pref_manager.get_value(
                    'detection_catalog') not in catalog_names:
                self.pref_manager.set_value('detection_catalog',
                                            catalog_names[0])

        # Initialize the event catalog preference item.
        catalog_names = sorted(
            self.event_library.get_catalogs_in_db(self.project))
        self.pref_manager.set_limit('event_catalog', catalog_names)
        if catalog_names:
            if self.pref_manager.get_value(
                    'event_catalog') not in catalog_names:
                self.pref_manager.set_value('event_catalog', catalog_names[0])

        # Create the edit dialog.
        dlg = gui_preference_dialog.ListbookPrefDialog(
            preferences=self.pref_manager)

        # Enable/Disable the gui elements based on the pref_manager settings.
        #self.on_select_individual()

        dlg.ShowModal()
        dlg.Destroy()
Exemple #3
0
    def edit(self):
        ''' Create the preferences edit dialog.
        '''
        # Create the edit dialog.
        dlg = gui_preference_dialog.ListbookPrefDialog(preferences = self.pref_manager)

        dlg.ShowModal()
        dlg.Destroy()
    def edit(self):
        #event_types = self.load_event_types()
        #quarry_event = [x for x in event_types if x.name == 'quarry'][0]
        #self.pref_manager.set_limit('event_type', [x.name for x in quarry_event.children])

        dlg = gui_preference_dialog.ListbookPrefDialog(
            preferences=self.pref_manager)
        dlg.ShowModal()
        dlg.Destroy()
Exemple #5
0
    def edit(self):
        if self.project.geometry_inventory:
            stations = sorted([x.name for x in self.project.geometry_inventory.get_station()])
            self.pref_manager.set_limit('nearest_station', stations)

        event_types = self.load_event_types()
        quarry_event = [x for x in event_types if x.name == 'quarry'][0]
        self.pref_manager.set_limit('event_type', [x.name for x in quarry_event.children])

        dlg = gui_preference_dialog.ListbookPrefDialog(preferences = self.pref_manager)
        dlg.ShowModal()
        dlg.Destroy()
    def edit(self):
        ''' Create the preferences edit dialog.
        '''
        # TODO: Visualize the event types in a tree structure.
        # TODO: In the database table: Make the combination of parent_id and name unique, not only the
        # name.
        event_types = self.load_event_types()
        self.pref_manager.set_limit('event_type',
                                    [x.name for x in event_types])

        # Create the edit dialog.
        dlg = gui_preference_dialog.ListbookPrefDialog(
            preferences=self.pref_manager)

        dlg.ShowModal()
        dlg.Destroy()
    def edit(self):
        # TODO: List the number of potential files in the grid.
        # TODO: List the number of imported files in the grid.
        # TODO: List the number of files in the data directory in the grid.

        # Get all database clients.
        db_clients = sorted([x for x in list(self.project.waveclient.values()) if x.mode == 'PsysmonDbWaveClient'])
        db_client_names = [x.name for x in db_clients]
        self.pref_manager.set_limit('waveclient', db_client_names)
        sel_client = self.pref_manager.get_value('waveclient')
        if not sel_client:
            sel_client = db_client_names[0]
            self.pref_manager.set_value('waveclient', sel_client)

        self.on_waveclient_selected()

        dlg = psy_guiprefdlg.ListbookPrefDialog(preferences = self.pref_manager)
        dlg.ShowModal()
        dlg.Destroy()
    def edit(self):
        ''' Call the edit dialog of the collection node.
        '''
        # Get all database clients.
        #db_clients = sorted([x for x in self.project.waveclient.values() if x.mode == 'PsysmonDbWaveClient'])
        waveclients = sorted(
            [x for x in list(self.project.waveclient.values())])
        waveclient_names = [x.name for x in waveclients]
        self.pref_manager.set_limit('waveclient', waveclient_names)
        sel_client = self.pref_manager.get_value('waveclient')
        if not sel_client:
            sel_client = waveclient_names[0]
            self.pref_manager.set_value('waveclient', sel_client)

        self.on_waveclient_selected()

        dlg = psy_guiprefdlg.ListbookPrefDialog(preferences=self.pref_manager)
        dlg.ShowModal()
        dlg.Destroy()
    def edit(self):
        ''' Create the preferences edit dialog.
        '''
        # Initialize the detection_catalog preference item.
        self.load_catalogs()
        catalog_names = [x.name for x in self.catalogs]
        self.pref_manager.set_limit('detection_catalog', catalog_names)
        if catalog_names:
            if self.pref_manager.get_value('detection_catalog') not in catalog_names:
                self.pref_manager.set_value('detection_catalog', catalog_names[0])


        # Create the edit dialog.
        dlg = gui_preference_dialog.ListbookPrefDialog(preferences = self.pref_manager)

        # Enable/Disable the gui elements based on the pref_manager settings.
        #self.on_select_individual()

        dlg.ShowModal()
        dlg.Destroy()
    def edit(self):
        ''' Create the preferences edit dialog.
        '''
        # Initialize the available processing nodes.
        processing_nodes = self.project.getProcessingNodes(('common', ))
        if self.pref_manager.get_value('processing_stack') is None:
            detrend_node_template = [
                x for x in processing_nodes if x.name == 'detrend'
            ][0]
            detrend_node = copy.deepcopy(detrend_node_template)
            self.pref_manager.set_value('processing_stack', [
                detrend_node,
            ])
        self.pref_manager.set_limit('processing_stack', processing_nodes)

        # Create the edit dialog.
        dlg = gui_preference_dialog.ListbookPrefDialog(
            preferences=self.pref_manager)

        # Enable/Disable the gui elements based on the pref_manager settings.
        #self.on_select_individual()

        dlg.ShowModal()
        dlg.Destroy()
 def edit(self):
     dlg = gui_preference_dialog.ListbookPrefDialog(preferences = self.pref_manager)
     dlg.ShowModal()
     dlg.Destroy()