calculator

sans.perspectives.calculator.calculator

Calculator Module

class sans.perspectives.calculator.calculator.Plugin

Bases: sans.guiframe.plugin_base.PluginBase

This class defines the interface for a Plugin class for calculator perspective

__init__()
__module__ = 'sans.perspectives.calculator.calculator'
add_color()

Adds color to a plugin

can_load_data()

if return True, then call handler to laod data

clear_panel()

clear all related panels

delete_data()

Delete all references of data which id are in data_list.

get_batch_capable()

Check if the plugin has a batch capability

get_context_menu()

This method is optional.

When the context menu of a plot is rendered, the get_context_menu method will be called to give you a chance to add a menu item to the context menu.

A ref to a plotpanel object is passed so that you can investigate the plot content and decide whether you need to add items to the context menu.

This method returns a list of menu items. Each item is itself a list defining the text to appear in the menu, a tool-tip help text, and a call-back method.

Parameters:graph – the Graph object to which we attach the context menu
Returns:a list of menu items with call-back function
get_extensions()

return state reader and its extensions

get_panels()

Create and return the list of wx.Panels for your plug-in. Define the plug-in perspective.

Panels should inherit from DefaultPanel defined below, or should present the same interface. They must define “window_caption” and “window_name”.

Parameters:parent – parent window
Returns:list of panels
get_perspective()

Get the list of panel names for this perspective

get_tools()

Returns a set of menu entries for tools

help()

Show a general help dialog.

Todo :replace the text with a nice image provide more hint on the SLD calculator
is_always_active()

return True is this plugin is always active and it is local to guiframe even if the user is switching between perspectives

is_in_use()
get a data id a list of data name if data data is
currently used by the plugin and the name of the plugin

data_name = ‘None’ in_use = False example [(data_name, self.sub_menu)]

load_data()

Load data

load_folder()

Load entire folder

on_batch_selection()

need to be overwritten by the derivated class

on_calculate_kiessig()

Compute the Kiessig thickness

on_calculate_resoltuion()

Estimate the instrumental resolution

on_calculate_sld()

Compute the scattering length density of molecula

on_calculate_slit_size()

Compute the slit size a given data

on_edit_data()

Edit meta data

on_perspective()

Call back function for the perspective menu item. We notify the parent window that the perspective has changed.

Parameters:event – menu event
on_python_console()

Open Python Console

Parameters:event – menu event
on_set_state_helper()

update state

populate_file_menu()

Append menu item under file menu item of the frame

populate_menu()

Create and return the list of application menu items for the plug-in.

Parameters:parent – parent window
Returns:plug-in menu
post_init()

Post initialization call back to close the loose ends

put_icon()

Put icon in the frame title bar

set_batch_selection()

the plugin to its batch state if flag is True

set_data()

receive a list of data and use it in the current perspective

set_default_perspective()

Call back method that True to notify the parent that the current plug-in can be set as default perspective. when returning False, the plug-in is not candidate for an automatic default perspective setting

set_is_active()
set_state()

update state

set_theory()
Parameters:theory_list – list of information

related to available theory state

use_data()

return True if these plugin use data

Table Of Contents

Previous topic

aperture_editor

Next topic

calculator_widgets

This Page