def activate(self): ''' Activate the plugin. ''' InteractivePlugin.activate(self) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('"-"',), action = self.parent.growTimePeriod) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_SHIFT', '"-"'), action = self.parent.growTimePeriod, action_kwargs = {'ratio': 25}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_COMMAND', '"-"'), action = self.parent.growTimePeriod, action_kwargs = {'ratio': 10}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_ALT', '"-"'), action = self.parent.growTimePeriod, action_kwargs = {'ratio': 1}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('"+"',), action = self.parent.shrinkTimePeriod) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_SHIFT', '"+"'), action = self.parent.shrinkTimePeriod, action_kwargs = {'ratio': 25}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_COMMAND', '"+"'), action = self.parent.shrinkTimePeriod, action_kwargs = {'ratio': 10}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_ALT', '"+"'), action = self.parent.shrinkTimePeriod, action_kwargs = {'ratio': 1})
def __init__(self): ''' The constructor. ''' InteractivePlugin.__init__(self, name = 'zoom', category = 'view', tags = None ) # Create the logging logger instance. loggerName = __name__ + "." + self.__class__.__name__ self.logger = logging.getLogger(loggerName) self.icons['active'] = icons.zoom_icon_16 self.cursor = wx.CURSOR_MAGNIFIER #self.cursor = icons.zoom_icon_16 #self.cursor_hotspot = (0.5, 0.5) self.bg = {} self.startTime = None self.endTime = None # Add the plugin preferences. pref_page = self.pref_manager.add_page('Preferences') resp_group = pref_page.add_group('response') item = preferences_manager.IntegerSpinPrefItem(name = 'zoom ratio', value = 20, limit = (1, 99)) resp_group.add_item(item)
def activate(self): ''' Extend the Plugin activate method. ''' if self.selected_catalog_name is None: self.logger.info('You have to select a pick catalog first.') else: InteractivePlugin.activate(self) self.load_picks() self.add_pick_lines()
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 activate(self): ''' Activate the plugin. ''' selected_event_info = self.parent.get_shared_info( origin_rid=self.parent.collection_node.rid + '/plugin/show_events', name='selected_event') if selected_event_info: if len(selected_event_info) > 1: raise RuntimeError( "More than one selected event returned. Don't know which one to use." ) InteractivePlugin.activate(self) else: self.logger.info( "No selected event found. Can't activate the plugin.")
def __init__(self): ''' The constructor. ''' InteractivePlugin.__init__(self, name = 'navigate', category = 'view', tags = None ) # Create the logging logger instance. loggerName = __name__ + "." + self.__class__.__name__ self.logger = logging.getLogger(loggerName) self.icons['active'] = icons.star_icon_16 self.cursor = wx.CURSOR_HAND
def activate(self): ''' Extend the plugin activate method. ''' self.logger.debug("Activating the create event plugin.") InteractivePlugin.activate(self) if not self.selected_catalog_name: catalog_names = self.library.get_catalogs_in_db(self.parent.project) self.pref_manager.set_limit('event_catalog', catalog_names) if catalog_names: self.pref_manager.set_value('event_catalog', catalog_names[0]) # Load the event catalog. self.on_select_catalog() # Set the event_type. self.on_select_default_event_type()
def __init__(self): ''' Initialize the instance. ''' InteractivePlugin.__init__( self, name='change event limits', category='edit', tags=['event', 'modify', 'change', 'limit', 'start', 'end']) # 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_change_limits_16 self.cursor = wx.CURSOR_CROSS self.bg = {} self.startTime = None self.endTime = None
def activate(self): ''' Activate the plugin. ''' InteractivePlugin.activate(self) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_DOWN',), action = self.parent.displayManager.show_next_station) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_UP',), action = self.parent.displayManager.show_prev_station) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_RIGHT',), action = self.parent.advanceTime) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_SHIFT', 'WXK_RIGHT'), action = self.parent.advanceTimePercentage, action_kwargs = {'step': 25}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_COMMAND', 'WXK_RIGHT'), action = self.parent.advanceTimePercentage, action_kwargs = {'step': 10}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_ALT', 'WXK_RIGHT'), action = self.parent.advanceTimePercentage, action_kwargs = {'step': 1}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_LEFT',), action = self.parent.decreaseTime) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_SHIFT', 'WXK_LEFT'), action = self.parent.decreaseTimePercentage, action_kwargs = {'step': 25}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_COMMAND', 'WXK_LEFT'), action = self.parent.decreaseTimePercentage, action_kwargs = {'step': 10}) self.parent.shortcut_manager.add_shortcut(origin_rid = self.rid, key_combination = ('WXK_ALT', 'WXK_LEFT'), action = self.parent.decreaseTimePercentage, action_kwargs = {'step': 1})
def __init__(self): ''' The constructor. ''' InteractivePlugin.__init__(self, name='measure point', category='analyze', 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.measure_icon_16 self.cursor = wx.CURSOR_CROSS #self.cursor = icons.zoom_icon_16 #self.cursor_hotspot = (0.5, 0.5) self.start_time = None self.end_time = None self.view = None self.crosshair = {}
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 deactivate(self): ''' Extend the Plugin deactivate method. ''' self.clear_pick_lines() InteractivePlugin.deactivate(self)
def deactivate(self): ''' Deactivate the plugin. ''' InteractivePlugin.deactivate(self) self.cleanup()
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)