def create_selector_preferences(self): ''' Create the preference items of the event selection section. ''' events_page = self.pref_manager.add_page('events') time_group = events_page.add_group('time span') event_group = events_page.add_group('event selection') item = psy_pm.DateTimeEditPrefItem( name='start_time', label='start time', value=UTCDateTime('2015-01-01T00:00:00'), tool_tip= 'The start time of the selection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).' ) time_group.add_item(item) item = psy_pm.DateTimeEditPrefItem( name='end_time', label='end time', value=UTCDateTime('2015-01-01T00:00:00'), tool_tip= 'The end time of the selection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).' ) time_group.add_item(item) item = psy_pm.SingleChoicePrefItem( name='event_catalog', label='event catalog', value='', limit=[], tool_tip='Select an event catalog for which to load the events.') event_group.add_item(item) item = psy_pm.CheckBoxPrefItem( name='select_individual', label='select individual events', value=False, tool_tip='Do a manual selection of the events to process.', hooks={'on_value_change': self.on_select_individual}) event_group.add_item(item) item = psy_pm.ActionItem(name='load_events', label='load events', mode='button', action=self.on_load_events, tool_tip='Load events from the database.') event_group.add_item(item) item = psy_pm.CustomPrefItem( name='events', label='events', value=[], gui_class=EventListField, tool_tip= 'The available events. Selected events will be used for processing.' ) event_group.add_item(item)
def create_archive_prefs(self): ''' Create the archive input preference items. ''' pagename = '1 archive' self.pref_manager.add_page(pagename) # The archive directory pref_item = psy_pm.DirBrowsePrefItem(name = 'archive_dir', label = 'archive directory', group = 'archive', value = '', hooks = {'on_value_change': self.on_archive_dir_changed}, tool_tip = 'The root directory of the Reftek raw data archive.' ) self.pref_manager.add_item(pagename = pagename, item = pref_item) # Scan archive button. item = psy_pm.ActionItem(name = 'acan_archive', label = 'scan archive', group = 'archive', mode = 'button', action = self.on_scan_archive, tool_tip = 'Scan the reftek raw data archive.') self.pref_manager.add_item(pagename = pagename, item = item) # The start time pref_item = psy_pm.DateTimeEditPrefItem(name = 'start_time', label = 'start time', value = utcdatetime.UTCDateTime('2012-07-09T00:00:00'), group = 'time range', tool_tip = 'The start time of the interval to process.') self.pref_manager.add_item(pagename = pagename, item = pref_item) # The end time pref_item = psy_pm.DateTimeEditPrefItem(name = 'end_time', label = 'end time', value = utcdatetime.UTCDateTime('2012-07-09T00:00:00'), group = 'time range', tool_tip = 'The end time of the interval to process.') self.pref_manager.add_item(pagename = pagename, item = pref_item) # The SCNL list pref_item = psy_pm.ListCtrlEditPrefItem(name = 'unit_list', label = 'units', value = [], column_labels = ['unit id', 'stream', 'first data', 'last data'], limit = [], group = 'unit selection', tool_tip = 'Select the units to process.' ) self.pref_manager.add_item(pagename = pagename, item = pref_item)
def __init__(self): ''' Initialize the instance. ''' InteractivePlugin.__init__(self, name='create event', category='edit', tags=['create', 'event']) # Create the logging logger instance. logger_prefix = psysmon.logConfig['package_prefix'] loggerName = logger_prefix + "." + __name__ + "." + self.__class__.__name__ self.logger = logging.getLogger(loggerName) self.icons['active'] = icons.event_new_16 self.cursor = wx.CURSOR_CROSS # The event catalog library used to manage the catalogs. self.library = event_core.Library('event library') # The name of the selected catalog. self.selected_catalog_name = None self.begin_line = {} self.end_line = {} self.bg = {} self.motion_notify_cid = [] self.startTime = None self.endTime = None # Add the pages to the preferences manager. self.pref_manager.add_page('tool options') # Add the plugin preferences. item = psy_pm.SingleChoicePrefItem( name='event_catalog', label='event catalog', group='catalog', value='', limit=[], tool_tip='Select an event catalog to work on.', hooks={'on_value_change': self.on_select_catalog}) self.pref_manager.add_item(pagename='tool options', item=item) item = psy_pm.ActionItem(name='create_new_catalog', label='create new catalog', group='catalog', mode='button', action=self.on_create_new_catalog) self.pref_manager.add_item(pagename='tool options', item=item)
def __init__(self): ''' Initialize the instance. ''' OptionPlugin.__init__(self, name='select event', category='select', tags=['event', 'select']) # Create the logging logger instance. logger_prefix = psysmon.logConfig['package_prefix'] loggerName = logger_prefix + "." + __name__ + "." + self.__class__.__name__ self.logger = logging.getLogger(loggerName) self.icons['active'] = icons.flag_icon_16 # The events library. self.library = ev_core.Library(name=self.rid) # The currently selected event. self.selected_event = {} # The plot colors used by the plugin. self.colors = {} # Setup the pages of the preference manager. select_page = self.pref_manager.add_page('Select') dts_group = select_page.add_group('detection time span') es_group = select_page.add_group('event selection') item = psy_pm.DateTimeEditPrefItem( name='start_time', label='start time', value=UTCDateTime('2015-01-01T00:00:00'), tool_tip= 'The start time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).' ) dts_group.add_item(item) item = psy_pm.FloatSpinPrefItem( name='window_length', label='window length [s]', value=3600, limit=(0, 86400), digits=1, tool_tip= 'The length of the time window for which events should be loaded.') dts_group.add_item(item) item = psy_pm.SingleChoicePrefItem( name='event_catalog', label='event catalog', value='', limit=[], tool_tip='Select an event catalog for which to load the events.') es_group.add_item(item) item = psy_pm.ActionItem(name='load_events', label='load events', mode='button', action=self.on_load_events) es_group.add_item(item) column_labels = [ 'db_id', 'start_time', 'length', 'public_id', 'description', 'agency_uri', 'author_uri', 'comment' ] item = psy_pm.ListCtrlEditPrefItem( name='events', label='events', value=[], column_labels=column_labels, limit=[], hooks={'on_value_change': self.on_event_selected}, tool_tip='The available events.') es_group.add_item(item)
def __init__(self): ''' The constructor. ''' InteractivePlugin.__init__(self, name = 'pick', category = 'edit', tags = None ) # Create the logging logger instance. logger_prefix = psysmon.logConfig['package_prefix'] loggerName = logger_prefix + "." + __name__ + "." + self.__class__.__name__ self.logger = logging.getLogger(loggerName) self.icons['active'] = icons.hand_2_icon_16 self.cursor = wx.CURSOR_CROSS # The pick catalog library used to manage the catalogs. self.library = pick_core.Library('pick library') # The name of the selected catalog. self.selected_catalog_name = None # A flag indicating if the pick catalog was loaded for a selected # event. self.catalog_loaded_for_selected_event = False # The lines of the picks. self.pick_lines = {} # Add the pages to the preferences manager. to_page = self.pref_manager.add_page('tool options') cat_group = to_page.add_group('catalog') po_group = to_page.add_group('pick options') # Add the plugin preferences. item = psy_pm.SingleChoicePrefItem(name = 'catalog_mode', label = 'mode', value = 'time', limit = ['time',], tool_tip = 'Select a pick catalog to work on.') cat_group.add_item(item) item = psy_pm.SingleChoicePrefItem(name = 'pick_catalog', label = 'pick catalog', value = '', limit = [], tool_tip = 'Select a pick catalog to work on.', hooks = {'on_value_change': self.on_select_catalog}) cat_group.add_item(item) item = psy_pm.ActionItem(name = 'create_new_catalog', label = 'create new catalog', mode = 'button', action = self.on_create_new_catalog) cat_group.add_item(item) item = psy_pm.TextEditPrefItem(name = 'label', label = 'label', value = 'P', tool_tip = 'The label of the pick.') po_group.add_item(item) item = psy_pm.FloatSpinPrefItem(name = 'delete_snap_length', label = 'delete snap [s]', value = 0.1, limit = (0, 1000), tool_tip = 'The snap length used when deleting picks.') po_group.add_item(item)
def __init__(self): ''' Initialize the instance. ''' OptionPlugin.__init__(self, name='show events', category='view', tags=['show', 'events']) # Create the logging logger instance. logger_prefix = psysmon.logConfig['package_prefix'] loggerName = logger_prefix + "." + __name__ + "." + self.__class__.__name__ self.logger = logging.getLogger(loggerName) self.icons['active'] = icons.flag_icon_16 # The currently selected event. self.selected_event = {} # The plot colors used by the plugin. self.colors = {} self.colors['event_vspan'] = '0.9' # Setup the pages of the preference manager. self.pref_manager.add_page('Select') self.pref_manager.add_page('Display') item = psy_pm.DateTimeEditPrefItem( name='start_time', label='start time', group='detection time span', value=UTCDateTime('2015-01-01T00:00:00'), tool_tip= 'The start time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).' ) self.pref_manager.add_item(pagename='Select', item=item) item = psy_pm.FloatSpinPrefItem( name='window_length', label='window length [s]', group='detection time span', value=3600, limit=(0, 86400), digits=1, tool_tip= 'The length of the time window for which events should be loaded.') self.pref_manager.add_item(pagename='Select', item=item) item = psy_pm.SingleChoicePrefItem( name='event_catalog', label='event catalog', group='event selection', value='', limit=[], tool_tip='Select an event catalog for which to load the events.') self.pref_manager.add_item(pagename='Select', item=item) # item = psy_pm.CustomPrefItem(name = 'events', # label = 'events', # group = 'event selection', # value = [], # gui_class = EventListField, # tool_tip = 'The start time of the detection time span (UTCDateTime string format YYYY-MM-DDTHH:MM:SS).') column_labels = [ 'db_id', 'start_time', 'length', 'public_id', 'description', 'agency_uri', 'author_uri', 'comment' ] item = psy_pm.ListCtrlEditPrefItem( name='events', label='events', group='event selection', value=[], column_labels=column_labels, limit=[], hooks={'on_value_change': self.on_event_selected}, tool_tip='The available events.') self.pref_manager.add_item(pagename='Select', item=item) item = psy_pm.ActionItem(name='load_events', label='load events', group='detection time span', mode='button', action=self.on_load_events) self.pref_manager.add_item(pagename='Select', item=item) item = psy_pm.FloatSpinPrefItem( name='pre_et', label='pre event time [s]', group='display range', value=5, limit=(0, 86400), digits=1, tool_tip= 'The length of the time window to show before the event start.') self.pref_manager.add_item(pagename='Display', item=item) item = psy_pm.FloatSpinPrefItem( name='post_et', label='post event time [s]', group='display range', value=10, limit=(0, 86400), digits=1, tool_tip= 'The length of the time window to show after the event end.') self.pref_manager.add_item(pagename='Display', item=item) item = psy_pm.CheckBoxPrefItem( name='show_event_limits', label='show event limits', value=True, hooks={'on_value_change': self.on_show_event_limits_changed}, tool_tip='Show the limits of the selected event in the views.') self.pref_manager.add_item(pagename='Display', item=item)
def __init__(self): ''' Initialize the instance. ''' InteractivePlugin.__init__(self, name = 'create event', category = 'edit', tags = ['create', 'event'] ) # Create the logging logger instance. logger_prefix = psysmon.logConfig['package_prefix'] loggerName = logger_prefix + "." + __name__ + "." + self.__class__.__name__ self.logger = logging.getLogger(loggerName) self.icons['active'] = icons.event_new_16 self.cursor = wx.CURSOR_CROSS # The event catalog library used to manage the catalogs. self.library = event_core.Library('event library') # The name of the selected catalog. self.selected_catalog_name = None # The plot colors used by the plugin. self.colors = {} self.colors['event_vspan'] = '0.9' # Animation stuff. self.bg = {} self.startTime = None self.endTime = None # Add the pages to the preferences manager. options_page = self.pref_manager.add_page('tool options') event_group = options_page.add_group('event') catalog_group = options_page.add_group('catalog') item = psy_pm.SingleChoicePrefItem(name = 'default_event_type', label = 'defaul event type', limit = [], value = None, tool_tip = 'The default event type when creating a new event.', hooks = {'on_value_change': self.on_select_default_event_type}) event_group.add_item(item) # Add the plugin preferences. item = psy_pm.SingleChoicePrefItem(name = 'event_catalog', label = 'event catalog', value = '', limit = [], tool_tip = 'Select an event catalog to work on.', hooks = {'on_value_change': self.on_select_catalog}) catalog_group.add_item(item) item = psy_pm.ActionItem(name = 'create_new_catalog', label = 'create new catalog', mode = 'button', action = self.on_create_new_catalog) catalog_group.add_item(item)