Index: calculatorview/build/lib/sans/perspectives/calculator/__init__.py
===================================================================
--- calculatorview/build/lib/sans/perspectives/calculator/__init__.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/build/lib/sans/perspectives/calculator/__init__.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
@@ -0,0 +1,2 @@
+PLUGIN_ID = "Calculator plug-in 1.0"
+from calculator import *
Index: calculatorview/build/lib/sans/perspectives/calculator/calculator.py
===================================================================
--- calculatorview/build/lib/sans/perspectives/calculator/calculator.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/build/lib/sans/perspectives/calculator/calculator.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
@@ -0,0 +1,126 @@
+
+import wx
+import logging
+from sld_panel import SldPanel
+from sans.guicomm.events import NewPlotEvent, StatusEvent 
+
+
+class Plugin:
+    """
+        This class defines the interface for a Plugin class
+        for calculator perspective
+    """
+    
+    def __init__(self, standalone=True):
+        """
+            Abstract class for gui_manager Plugins.
+        """
+        ## Plug-in name. It will appear on the application menu.
+        self.sub_menu = "Calculator"        
+        
+        ## Reference to the parent window. Filled by get_panels() below.
+        self.parent = None
+        
+        ## List of panels that you would like to open in AUI windows
+        #  for your plug-in. This defines your plug-in "perspective"
+        self.perspective = []
+        # Log startup
+        logging.info("Calculator plug-in started")   
+        
+    def populate_menu(self, id, owner):
+        """
+            Create and return the list of application menu
+            items for the plug-in. 
+            
+            @param id: deprecated. Un-used.
+            @param parent: parent window
+            @return: plug-in menu
+        """
+        return []
+      
+    def get_panels(self, parent):
+        """
+            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".
+            
+            @param parent: parent window
+            @return: list of panels
+        """
+        ## Save a reference to the parent
+        self.parent = parent
+        
+        # Define a panel
+        self.sld_panel= SldPanel(self.parent, -1)
+        
+        # If needed, add its name to the perspective list
+        self.perspective.append(self.sld_panel.window_name)
+
+        # Return the list of panels
+        return [self.sld_panel]
+    
+    def help(self, evt):
+        """
+            Show a general help dialog. 
+            TODO: replace the text with a nice image
+        """
+        
+        """
+            provide more hint on the SLD calculator
+        """
+        from help_panel import  HelpWindow
+        frame = HelpWindow(None, -1, pageToOpen="doc/sld_calculator_help.html")    
+        frame.Show(True)
+        name = "SLD_calculator"
+        if frame.rhelp.HasAnchor(name):
+            frame.rhelp.ScrollToAnchor(name)
+        else:
+           msg= "Cannot find SLD Calculator description "
+           msg +="Please.Search in the Help window"
+           wx.PostEvent(self.parent, StatusEvent(status = msg )) 
+        
+    def get_context_menu(self, graph=None):
+        """
+            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 Graph 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.
+            
+            @param graph: the Graph object to which we attach the context menu
+            @return: a list of menu items with call-back function
+        """
+        return []    
+    
+    def get_perspective(self):
+        """
+            Get the list of panel names for this perspective
+        """
+        return self.perspective
+    
+    def on_perspective(self, event):
+        """
+            Call back function for the perspective menu item.
+            We notify the parent window that the perspective
+            has changed.
+            @param event: menu event
+        """
+        self.parent.set_perspective(self.perspective)
+    
+    def post_init(self):
+        """
+            Post initialization call back to close the loose ends
+        """
+        pass
Index: calculatorview/build/lib/sans/perspectives/calculator/sld_panel.py
===================================================================
--- calculatorview/build/lib/sans/perspectives/calculator/sld_panel.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/build/lib/sans/perspectives/calculator/sld_panel.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
@@ -0,0 +1,365 @@
+"""
+    This module provide GUI for the neutron scattering length density calculator
+    @author: Gervaise B. Alina
+"""
+
+import wx
+import sys
+
+from sans.guiframe.utils import format_number, check_float
+from sans.guicomm.events import StatusEvent  
+from sans.calculator.sld_calculator import SldCalculator
+
+_BOX_WIDTH = 76
+_STATICBOX_WIDTH = 350
+_SCALE = 1e-6
+
+#SLD panel size 
+if sys.platform.count("win32")>0:
+    _STATICBOX_WIDTH = 350
+    PANEL_SIZE = 400
+    FONT_VARIANT = 0
+else:
+    _STATICBOX_WIDTH = 380
+    PANEL_SIZE = 430
+    FONT_VARIANT = 1
+    
+class SldPanel(wx.Panel):
+    """
+        Provides the SLD calculator GUI.
+    """
+    ## Internal nickname for the window, used by the AUI manager
+    window_name = "SLD Calculator"
+    ## Name to appear on the window title bar
+    window_caption = "SLD Calculator"
+    ## Flag to tell the AUI manager to put this panel in the center pane
+    CENTER_PANE = True
+    def __init__(self, parent,base=None, id = -1):
+        wx.Panel.__init__(self, parent, id = id)
+        #Font size 
+        self.SetWindowVariant(variant=FONT_VARIANT)
+        
+        # Object that receive status event
+        self.base= base
+        self.calculator = SldCalculator()
+        self.wavelength = self.calculator.wavelength
+        
+        self._do_layout()
+        self.SetAutoLayout(True)
+        self.Layout()
+       
+
+    def _do_layout(self):
+        """
+            Draw window content
+        """
+        unit_a = '[A]'
+        unit_density = '[g/cm^(3)]'
+        unit_sld= '[1/A^(2)]'
+        unit_cm1='[1/cm]'
+        unit_cm='[cm]'
+        sizer_input = wx.GridBagSizer(5,5)
+        sizer_output = wx.GridBagSizer(5,5)
+        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
+        sizer1 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer2 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer3 = wx.BoxSizer(wx.HORIZONTAL)
+        #---------inputs----------------
+        inputbox = wx.StaticBox(self, -1, "Input")
+        boxsizer1 = wx.StaticBoxSizer(inputbox, wx.VERTICAL)
+        boxsizer1.SetMinSize((_STATICBOX_WIDTH,-1))
+        
+        compound_txt = wx.StaticText(self, -1, 'Compound ')
+        self.compound_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        density_txt = wx.StaticText(self, -1, 'Density ')
+        self.density_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        unit_density_txt = wx.StaticText(self, -1, unit_density)
+        wavelength_txt = wx.StaticText(self, -1, 'Wavelength ')
+        self.wavelength_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.wavelength_ctl.SetValue(str(self.wavelength))
+        unit_a_txt = wx.StaticText(self, -1, unit_a)
+        iy = 0
+        ix = 0
+        sizer_input.Add(compound_txt,(iy, ix),(1,1),\
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_input.Add(self.compound_ctl,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_input.Add(density_txt,(iy, ix),(1,1),\
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_input.Add(self.density_ctl,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_input.Add(unit_density_txt,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_input.Add(wavelength_txt,(iy, ix),(1,1),\
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_input.Add(self.wavelength_ctl,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_input.Add(unit_a_txt,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        boxsizer1.Add( sizer_input )
+        sizer1.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10)
+        #---------Outputs sizer--------
+        outputbox = wx.StaticBox(self, -1, "Output")
+        boxsizer2 = wx.StaticBoxSizer(outputbox, wx.VERTICAL)
+        boxsizer2.SetMinSize((_STATICBOX_WIDTH,-1))
+        
+        i_complex= '+ i'
+        neutron_sld_txt = wx.StaticText(self, -1, 'Neutron SLD')
+        self.neutron_sld_reel_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_sld_reel_ctl.SetEditable(False)
+        self.neutron_sld_reel_ctl.SetToolTipString("Neutron SLD reel.")
+        self.neutron_sld_im_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_sld_im_ctl.SetEditable(False)
+        self.neutron_sld_im_ctl.SetToolTipString("Neutron SLD imaginary.")
+        neutron_sld_units_txt = wx.StaticText(self, -1, unit_sld)
+        
+        cu_ka_sld_txt = wx.StaticText(self, -1, 'Cu Ka SLD')
+        self.cu_ka_sld_reel_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.cu_ka_sld_reel_ctl.SetEditable(False)
+        self.cu_ka_sld_reel_ctl.SetToolTipString("Cu Ka SLD reel.")
+        self.cu_ka_sld_im_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.cu_ka_sld_im_ctl.SetEditable(False)
+        self.cu_ka_sld_im_ctl.SetToolTipString("Cu Ka SLD imaginary.")
+        cu_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld)
+        
+        mo_ka_sld_txt = wx.StaticText(self, -1, 'Mo Ka SLD')
+        self.mo_ka_sld_reel_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.mo_ka_sld_reel_ctl.SetEditable(False)
+        self.mo_ka_sld_reel_ctl.SetToolTipString("Mo Ka SLD reel.")
+        self.mo_ka_sld_im_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.mo_ka_sld_im_ctl.SetEditable(False)
+        self.mo_ka_sld_im_ctl.SetToolTipString("Mo Ka SLD reel.")
+        mo_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld)
+        
+        neutron_inc_txt = wx.StaticText(self, -1, 'Neutron Inc. Xs')
+        self.neutron_inc_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_inc_ctl.SetEditable(False)
+        self.neutron_inc_ctl.SetToolTipString("Neutron Inc. Xs")
+        neutron_inc_units_txt = wx.StaticText(self, -1,  unit_cm1)
+        
+        neutron_abs_txt = wx.StaticText(self, -1, 'Neutron Abs. Xs')
+        self.neutron_abs_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_abs_ctl.SetEditable(False)
+        self.neutron_abs_ctl.SetToolTipString("Neutron Abs. Xs")
+        neutron_abs_units_txt = wx.StaticText(self, -1,  unit_cm1)
+        
+        neutron_length_txt = wx.StaticText(self, -1, 'Neutron 1/e length')
+        self.neutron_length_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_length_ctl.SetEditable(False)
+        self.neutron_length_ctl.SetToolTipString("Neutron 1/e length")
+        neutron_length_units_txt = wx.StaticText(self, -1,  unit_cm)
+        iy = 0
+        ix = 0
+        sizer_output.Add(neutron_sld_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.neutron_sld_reel_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(wx.StaticText(self, -1, i_complex)
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(self.neutron_sld_im_ctl
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(neutron_sld_units_txt
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_output.Add(cu_ka_sld_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.cu_ka_sld_reel_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(wx.StaticText(self, -1, i_complex)
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix +=1
+        sizer_output.Add(self.cu_ka_sld_im_ctl
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+        ix +=1
+        sizer_output.Add(cu_ka_sld_units_txt
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_output.Add(mo_ka_sld_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.mo_ka_sld_reel_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(wx.StaticText(self, -1, i_complex)
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix +=1
+        sizer_output.Add(self.mo_ka_sld_im_ctl
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+        ix +=1
+        sizer_output.Add(mo_ka_sld_units_txt
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        iy += 1
+        ix = 0
+        sizer_output.Add(neutron_inc_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.neutron_inc_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=2
+        sizer_output.Add(neutron_inc_units_txt,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_output.Add(neutron_abs_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.neutron_abs_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=2
+        sizer_output.Add(neutron_abs_units_txt,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_output.Add(neutron_length_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.neutron_length_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix +=2
+        sizer_output.Add(neutron_length_units_txt,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+        boxsizer2.Add( sizer_output )
+        sizer2.Add(boxsizer2,0, wx.EXPAND | wx.ALL, 10)
+        #-----Button  sizer------------
+    
+        id = wx.NewId()
+        button_calculate = wx.Button(self, id, "Calculate")
+        button_calculate.SetToolTipString("Calculate SlD of neutrons.")
+        self.Bind(wx.EVT_BUTTON, self.calculateSld, id = id)   
+        
+        sizer_button.Add((250, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        sizer_button.Add(button_calculate, 0, wx.RIGHT|wx.ADJUST_MINSIZE,20)
+        sizer3.Add(sizer_button)
+        #---------layout----------------
+        vbox  = wx.BoxSizer(wx.VERTICAL)
+        vbox.Add(sizer1)
+        vbox.Add(sizer2)
+        vbox.Add(sizer3)
+        vbox.Fit(self) 
+        self.SetSizer(vbox)
+        
+        
+    def check_inputs(self):
+        """Check validity user inputs"""
+        flag= True
+       
+        if check_float(self.density_ctl):
+            self.density = float(self.density_ctl.GetValue())
+        else:
+            flag=False
+            raise ValueError,"Error for Density value :expect float"
+    
+        self.wavelength= self.wavelength_ctl.GetValue()
+        if self.wavelength.lstrip().rstrip()=="":
+            self.wavelength = self.calculator.wavelength
+        else:
+            if check_float(self.wavelength_ctl):
+                self.wavelength= float(self.wavelength)
+            else:
+                flag = False
+                raise ValueError,"Error for wavelenth value :expect float"
+                
+        self.formulata_text= self.compound_ctl.GetValue().lstrip().rstrip()
+        if self.formulata_text!="":
+            self.compound_ctl.SetBackgroundColour(wx.WHITE)
+            self.compound_ctl.Refresh()
+        else:
+            self.compound_ctl.SetBackgroundColour("pink")
+            self.compound_ctl.Refresh()
+            flag=False
+            raise ValueError, "Enter a formula"
+        return flag 
+        
+    def calculateSld(self, event):
+        """
+            Calculate the neutron scattering density length of a molecule
+        """
+        try:
+            #Check validity user inputs
+            if self.check_inputs():
+                #get ready to compute
+                try:
+                    self.calculator.setValue(self.formulata_text,self.density,self.wavelength)
+                except:
+                    if self.base !=None:
+                        msg= "SLD Calculator: %s" % (sys.exc_value)
+                        wx.PostEvent(self.base, StatusEvent(status= msg ))
+                    else:
+                        raise
+                    return
+                
+                # Compute the Cu SLD
+                Cu_reel, Cu_im = self.calculator.calculateXRaySld( "Cu")
+                self.cu_ka_sld_reel_ctl.SetValue(format_number(Cu_reel*_SCALE))
+                self.cu_ka_sld_im_ctl.SetValue(format_number(Cu_im*_SCALE))
+                
+                # Compute the Mo SLD
+                Mo_reel, Mo_im = self.calculator.calculateXRaySld( "Mo")
+                self.mo_ka_sld_reel_ctl.SetValue(format_number(Mo_reel*_SCALE))
+                self.mo_ka_sld_im_ctl.SetValue(format_number(Mo_im*_SCALE))
+               
+                coh,absorp,inc= self.calculator.calculateNSld()
+                im = self.calculator.calculateAbsorptionIm()
+                length = self.calculator.calculateLength()
+                # Neutron SLD
+                self.neutron_sld_reel_ctl.SetValue(format_number(coh*_SCALE))
+                self.neutron_sld_im_ctl.SetValue(format_number(im*_SCALE))
+                self.neutron_inc_ctl.SetValue(format_number(inc ))
+                self.neutron_abs_ctl.SetValue(format_number(absorp))
+                # Neutron length
+                self.neutron_length_ctl.SetValue(format_number(length))
+                # display wavelength
+                self.wavelength_ctl.SetValue(str(self.wavelength))
+        except:
+            if self.base !=None:
+                  msg= "SLD Calculator: %s" % (sys.exc_value)
+                  wx.PostEvent(self.base, StatusEvent(status= msg ))
+            else:
+                raise
+            return   
+
+   
+        
+  
+    
+   
+ 
+        
+               
+class SldWindow(wx.Frame):
+    def __init__(self, parent=None, id=1, title="SLD Calculator",base=None):
+        wx.Frame.__init__(self, parent, id, title, size=( PANEL_SIZE,  PANEL_SIZE))
+        
+        self.panel = SldPanel(self, base=base)
+        self.Centre()
+        self.Show(True)
+        
+class ViewApp(wx.App):
+    def OnInit(self):
+        frame = SldWindow(None, -1, 'SLD Calculator')    
+        frame.Show(True)
+        self.SetTopWindow(frame)
+        
+        return True
+        
+
+if __name__ == "__main__": 
+    app = ViewApp(0)
+    app.MainLoop()     
Index: calculatorview/perspectives/calculator/__init__.py
===================================================================
--- calculatorview/perspectives/calculator/__init__.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/perspectives/calculator/__init__.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
@@ -0,0 +1,2 @@
+PLUGIN_ID = "Calculator plug-in 1.0"
+from calculator import *
Index: calculatorview/perspectives/calculator/calculator.py
===================================================================
--- calculatorview/perspectives/calculator/calculator.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/perspectives/calculator/calculator.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
@@ -0,0 +1,126 @@
+
+import wx
+import logging
+from sld_panel import SldPanel
+from sans.guicomm.events import NewPlotEvent, StatusEvent 
+
+
+class Plugin:
+    """
+        This class defines the interface for a Plugin class
+        for calculator perspective
+    """
+    
+    def __init__(self, standalone=True):
+        """
+            Abstract class for gui_manager Plugins.
+        """
+        ## Plug-in name. It will appear on the application menu.
+        self.sub_menu = "Calculator"        
+        
+        ## Reference to the parent window. Filled by get_panels() below.
+        self.parent = None
+        
+        ## List of panels that you would like to open in AUI windows
+        #  for your plug-in. This defines your plug-in "perspective"
+        self.perspective = []
+        # Log startup
+        logging.info("Calculator plug-in started")   
+        
+    def populate_menu(self, id, owner):
+        """
+            Create and return the list of application menu
+            items for the plug-in. 
+            
+            @param id: deprecated. Un-used.
+            @param parent: parent window
+            @return: plug-in menu
+        """
+        return []
+      
+    def get_panels(self, parent):
+        """
+            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".
+            
+            @param parent: parent window
+            @return: list of panels
+        """
+        ## Save a reference to the parent
+        self.parent = parent
+        
+        # Define a panel
+        self.sld_panel= SldPanel(self.parent, -1)
+        
+        # If needed, add its name to the perspective list
+        self.perspective.append(self.sld_panel.window_name)
+
+        # Return the list of panels
+        return [self.sld_panel]
+    
+    def help(self, evt):
+        """
+            Show a general help dialog. 
+            TODO: replace the text with a nice image
+        """
+        
+        """
+            provide more hint on the SLD calculator
+        """
+        from help_panel import  HelpWindow
+        frame = HelpWindow(None, -1, pageToOpen="doc/sld_calculator_help.html")    
+        frame.Show(True)
+        name = "SLD_calculator"
+        if frame.rhelp.HasAnchor(name):
+            frame.rhelp.ScrollToAnchor(name)
+        else:
+           msg= "Cannot find SLD Calculator description "
+           msg +="Please.Search in the Help window"
+           wx.PostEvent(self.parent, StatusEvent(status = msg )) 
+        
+    def get_context_menu(self, graph=None):
+        """
+            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 Graph 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.
+            
+            @param graph: the Graph object to which we attach the context menu
+            @return: a list of menu items with call-back function
+        """
+        return []    
+    
+    def get_perspective(self):
+        """
+            Get the list of panel names for this perspective
+        """
+        return self.perspective
+    
+    def on_perspective(self, event):
+        """
+            Call back function for the perspective menu item.
+            We notify the parent window that the perspective
+            has changed.
+            @param event: menu event
+        """
+        self.parent.set_perspective(self.perspective)
+    
+    def post_init(self):
+        """
+            Post initialization call back to close the loose ends
+        """
+        pass
Index: calculatorview/perspectives/calculator/help_panel.py
===================================================================
--- calculatorview/perspectives/calculator/help_panel.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/perspectives/calculator/help_panel.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
@@ -0,0 +1,159 @@
+#!/usr/bin/python
+import wx
+import wx.html as html
+from wx.lib.splitter import MultiSplitterWindow
+import os
+def help():
+    """
+        Provide general online help text
+        Future work: extend this function to allow topic selection
+    """
+    info_txt  = "The inversion approach is based on Moore, J. Appl. Cryst. (1980) 13, 168-175.\n\n"
+    info_txt += "P(r) is set to be equal to an expansion of base functions of the type "
+    info_txt += "phi_n(r) = 2*r*sin(pi*n*r/D_max). The coefficient of each base functions "
+    info_txt += "in the expansion is found by performing a least square fit with the "
+    info_txt += "following fit function:\n\n"
+    info_txt += "chi**2 = sum_i[ I_meas(q_i) - I_th(q_i) ]**2/error**2 + Reg_term\n\n"
+    info_txt += "where I_meas(q) is the measured scattering intensity and I_th(q) is "
+    info_txt += "the prediction from the Fourier transform of the P(r) expansion. "
+    info_txt += "The Reg_term term is a regularization term set to the second derivative "
+    info_txt += "d**2P(r)/dr**2 integrated over r. It is used to produce a smooth P(r) output.\n\n"
+    info_txt += "The following are user inputs:\n\n"
+    info_txt += "   - Number of terms: the number of base functions in the P(r) expansion.\n\n"
+    info_txt += "   - Regularization constant: a multiplicative constant to set the size of "
+    info_txt += "the regularization term.\n\n"
+    info_txt += "   - Maximum distance: the maximum distance between any two points in the system.\n"
+     
+    return info_txt
+    
+class HelpDialog(wx.Dialog):
+    def __init__(self, parent, id):
+      
+        wx.Dialog.__init__(self, parent, id, size=(400, 420))
+        self.SetTitle("Calculator help") 
+        
+
+        vbox = wx.BoxSizer(wx.VERTICAL)
+
+        explanation = help()
+           
+        label_explain = wx.StaticText(self, -1, explanation, size=(350,320))
+            
+        vbox.Add(label_explain, 0, wx.ALL|wx.EXPAND, 15)
+
+
+        static_line = wx.StaticLine(self, -1)
+        vbox.Add(static_line, 0, wx.EXPAND, 0)
+        
+        button_OK = wx.Button(self, wx.ID_OK, "OK")
+
+        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_button.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        sizer_button.Add(button_OK, 0, wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 10)       
+        vbox.Add(sizer_button, 0, wx.EXPAND|wx.BOTTOM|wx.TOP, 10)
+
+        self.SetSizer(vbox)
+        self.SetAutoLayout(True)
+        
+        self.Layout()
+        self.Centre()
+
+class HelpWindow(wx.Frame):
+    def __init__(self, parent, id, title= 'HelpWindow', pageToOpen=None):
+        wx.Frame.__init__(self, parent, id, title, size=(700, 450))
+        """
+             contains help info
+        """
+      
+        splitter = MultiSplitterWindow(self, style=wx.SP_LIVE_UPDATE)
+        rpanel = wx.Panel(splitter, -1)
+        lpanel = wx.Panel(splitter, -1,style=wx.BORDER_SUNKEN)
+        
+        vbox = wx.BoxSizer(wx.VERTICAL)
+        header = wx.Panel(rpanel, -1)
+        header.SetBackgroundColour('#6666FF')
+        header.SetForegroundColour('WHITE')
+        hbox = wx.BoxSizer(wx.HORIZONTAL)
+        st = wx.StaticText(header, -1, 'Contents', (5, 5))
+        font = st.GetFont()
+        font.SetPointSize(10)
+        st.SetFont(font)
+        hbox.Add(st, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 5)
+        header.SetSizer(hbox)
+        vbox.Add(header, 0, wx.EXPAND)
+       
+        vboxl= wx.BoxSizer(wx.VERTICAL)
+        headerl = wx.Panel(lpanel, -1, size=(-1, 20))
+       
+        headerl.SetBackgroundColour('#6666FF')
+        headerl.SetForegroundColour('WHITE')
+        hboxl = wx.BoxSizer(wx.HORIZONTAL)
+        lst = wx.StaticText(headerl, -1, 'Menu', (5, 5))
+        fontl = lst.GetFont()
+        fontl.SetPointSize(10)
+        lst.SetFont(fontl)
+        hboxl.Add(lst, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 5)
+        headerl.SetSizer(hboxl)
+        vboxl.Add(headerl, 0, wx.EXPAND)
+        self.lhelp = html.HtmlWindow(lpanel, -1, style=wx.NO_BORDER)
+        self.rhelp = html.HtmlWindow(rpanel, -1, style=wx.NO_BORDER, 
+                                     size=(500,-1))
+        path = os.getcwd()
+        path= os.path.join(os.path.split(path)[0],"calculatorview",
+                            "doc","sld_calculator_help.html")
+       
+        page1="""<html>
+            <body>
+             <p>Select topic on Menu</p>
+            </body>
+            </html>"""
+        page="""<html>
+            <body>
+            <ul>
+            <li><a href =%s target ="showframe">SLD Calculator</a><br></li>
+            </ul>
+            </body>
+            </html>"""%path
+        self.rhelp.SetPage(page1)
+        self.lhelp.SetPage(page)
+        self.lhelp.Bind(wx.html.EVT_HTML_LINK_CLICKED,self.OnLinkClicked )
+        
+        #open the help frame a the current page
+        if  pageToOpen!= None:
+            self.rhelp.LoadPage(str( pageToOpen))
+            
+        vbox.Add(self.rhelp,1, wx.EXPAND)
+        vboxl.Add(self.lhelp, 1, wx.EXPAND)
+        rpanel.SetSizer(vbox)
+        lpanel.SetSizer(vboxl)
+        lpanel.SetFocus()
+        
+        vbox1 = wx.BoxSizer(wx.HORIZONTAL)
+        vbox1.Add(splitter,1,wx.EXPAND)
+        splitter.AppendWindow(lpanel, 200)
+        splitter.AppendWindow(rpanel)
+        self.SetSizer(vbox1)
+       
+        self.Centre()
+        self.Show(True)
+        
+        
+    def OnLinkClicked(self, event):
+        """
+            Function to diplay html page related to the hyperlinktext selected
+        """
+        link= event.GetLinkInfo().GetHref()
+        self.rhelp.LoadPage(link)
+
+class ViewApp(wx.App):
+    def OnInit(self):
+        frame = HelpWindow(None, -1, 'HelpWindow')    
+        frame.Show(True)
+        self.SetTopWindow(frame)
+        
+        return True
+        
+
+if __name__ == "__main__": 
+    app = ViewApp(0)
+    app.MainLoop()     
Index: calculatorview/perspectives/calculator/sld_panel.py
===================================================================
--- calculatorview/perspectives/calculator/sld_panel.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/perspectives/calculator/sld_panel.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
@@ -0,0 +1,365 @@
+"""
+    This module provide GUI for the neutron scattering length density calculator
+    @author: Gervaise B. Alina
+"""
+
+import wx
+import sys
+
+from sans.guiframe.utils import format_number, check_float
+from sans.guicomm.events import StatusEvent  
+from sans.calculator.sld_calculator import SldCalculator
+
+_BOX_WIDTH = 76
+_STATICBOX_WIDTH = 350
+_SCALE = 1e-6
+
+#SLD panel size 
+if sys.platform.count("win32")>0:
+    _STATICBOX_WIDTH = 350
+    PANEL_SIZE = 400
+    FONT_VARIANT = 0
+else:
+    _STATICBOX_WIDTH = 380
+    PANEL_SIZE = 430
+    FONT_VARIANT = 1
+    
+class SldPanel(wx.Panel):
+    """
+        Provides the SLD calculator GUI.
+    """
+    ## Internal nickname for the window, used by the AUI manager
+    window_name = "SLD Calculator"
+    ## Name to appear on the window title bar
+    window_caption = "SLD Calculator"
+    ## Flag to tell the AUI manager to put this panel in the center pane
+    CENTER_PANE = True
+    def __init__(self, parent,base=None, id = -1):
+        wx.Panel.__init__(self, parent, id = id)
+        #Font size 
+        self.SetWindowVariant(variant=FONT_VARIANT)
+        
+        # Object that receive status event
+        self.base= base
+        self.calculator = SldCalculator()
+        self.wavelength = self.calculator.wavelength
+        
+        self._do_layout()
+        self.SetAutoLayout(True)
+        self.Layout()
+       
+
+    def _do_layout(self):
+        """
+            Draw window content
+        """
+        unit_a = '[A]'
+        unit_density = '[g/cm^(3)]'
+        unit_sld= '[1/A^(2)]'
+        unit_cm1='[1/cm]'
+        unit_cm='[cm]'
+        sizer_input = wx.GridBagSizer(5,5)
+        sizer_output = wx.GridBagSizer(5,5)
+        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
+        sizer1 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer2 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer3 = wx.BoxSizer(wx.HORIZONTAL)
+        #---------inputs----------------
+        inputbox = wx.StaticBox(self, -1, "Input")
+        boxsizer1 = wx.StaticBoxSizer(inputbox, wx.VERTICAL)
+        boxsizer1.SetMinSize((_STATICBOX_WIDTH,-1))
+        
+        compound_txt = wx.StaticText(self, -1, 'Compound ')
+        self.compound_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        density_txt = wx.StaticText(self, -1, 'Density ')
+        self.density_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        unit_density_txt = wx.StaticText(self, -1, unit_density)
+        wavelength_txt = wx.StaticText(self, -1, 'Wavelength ')
+        self.wavelength_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.wavelength_ctl.SetValue(str(self.wavelength))
+        unit_a_txt = wx.StaticText(self, -1, unit_a)
+        iy = 0
+        ix = 0
+        sizer_input.Add(compound_txt,(iy, ix),(1,1),\
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_input.Add(self.compound_ctl,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_input.Add(density_txt,(iy, ix),(1,1),\
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_input.Add(self.density_ctl,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_input.Add(unit_density_txt,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_input.Add(wavelength_txt,(iy, ix),(1,1),\
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_input.Add(self.wavelength_ctl,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_input.Add(unit_a_txt,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        boxsizer1.Add( sizer_input )
+        sizer1.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10)
+        #---------Outputs sizer--------
+        outputbox = wx.StaticBox(self, -1, "Output")
+        boxsizer2 = wx.StaticBoxSizer(outputbox, wx.VERTICAL)
+        boxsizer2.SetMinSize((_STATICBOX_WIDTH,-1))
+        
+        i_complex= '+ i'
+        neutron_sld_txt = wx.StaticText(self, -1, 'Neutron SLD')
+        self.neutron_sld_reel_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_sld_reel_ctl.SetEditable(False)
+        self.neutron_sld_reel_ctl.SetToolTipString("Neutron SLD reel.")
+        self.neutron_sld_im_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_sld_im_ctl.SetEditable(False)
+        self.neutron_sld_im_ctl.SetToolTipString("Neutron SLD imaginary.")
+        neutron_sld_units_txt = wx.StaticText(self, -1, unit_sld)
+        
+        cu_ka_sld_txt = wx.StaticText(self, -1, 'Cu Ka SLD')
+        self.cu_ka_sld_reel_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.cu_ka_sld_reel_ctl.SetEditable(False)
+        self.cu_ka_sld_reel_ctl.SetToolTipString("Cu Ka SLD reel.")
+        self.cu_ka_sld_im_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.cu_ka_sld_im_ctl.SetEditable(False)
+        self.cu_ka_sld_im_ctl.SetToolTipString("Cu Ka SLD imaginary.")
+        cu_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld)
+        
+        mo_ka_sld_txt = wx.StaticText(self, -1, 'Mo Ka SLD')
+        self.mo_ka_sld_reel_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.mo_ka_sld_reel_ctl.SetEditable(False)
+        self.mo_ka_sld_reel_ctl.SetToolTipString("Mo Ka SLD reel.")
+        self.mo_ka_sld_im_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.mo_ka_sld_im_ctl.SetEditable(False)
+        self.mo_ka_sld_im_ctl.SetToolTipString("Mo Ka SLD reel.")
+        mo_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld)
+        
+        neutron_inc_txt = wx.StaticText(self, -1, 'Neutron Inc. Xs')
+        self.neutron_inc_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_inc_ctl.SetEditable(False)
+        self.neutron_inc_ctl.SetToolTipString("Neutron Inc. Xs")
+        neutron_inc_units_txt = wx.StaticText(self, -1,  unit_cm1)
+        
+        neutron_abs_txt = wx.StaticText(self, -1, 'Neutron Abs. Xs')
+        self.neutron_abs_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_abs_ctl.SetEditable(False)
+        self.neutron_abs_ctl.SetToolTipString("Neutron Abs. Xs")
+        neutron_abs_units_txt = wx.StaticText(self, -1,  unit_cm1)
+        
+        neutron_length_txt = wx.StaticText(self, -1, 'Neutron 1/e length')
+        self.neutron_length_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        self.neutron_length_ctl.SetEditable(False)
+        self.neutron_length_ctl.SetToolTipString("Neutron 1/e length")
+        neutron_length_units_txt = wx.StaticText(self, -1,  unit_cm)
+        iy = 0
+        ix = 0
+        sizer_output.Add(neutron_sld_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.neutron_sld_reel_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(wx.StaticText(self, -1, i_complex)
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(self.neutron_sld_im_ctl
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(neutron_sld_units_txt
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_output.Add(cu_ka_sld_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.cu_ka_sld_reel_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(wx.StaticText(self, -1, i_complex)
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix +=1
+        sizer_output.Add(self.cu_ka_sld_im_ctl
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+        ix +=1
+        sizer_output.Add(cu_ka_sld_units_txt
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_output.Add(mo_ka_sld_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.mo_ka_sld_reel_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_output.Add(wx.StaticText(self, -1, i_complex)
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix +=1
+        sizer_output.Add(self.mo_ka_sld_im_ctl
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+        ix +=1
+        sizer_output.Add(mo_ka_sld_units_txt
+                         ,(iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        iy += 1
+        ix = 0
+        sizer_output.Add(neutron_inc_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.neutron_inc_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=2
+        sizer_output.Add(neutron_inc_units_txt,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_output.Add(neutron_abs_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.neutron_abs_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=2
+        sizer_output.Add(neutron_abs_units_txt,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        iy += 1
+        ix = 0
+        sizer_output.Add(neutron_length_txt,(iy, ix),(1,1),
+                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        sizer_output.Add(self.neutron_length_ctl,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix +=2
+        sizer_output.Add(neutron_length_units_txt,(iy, ix),(1,1),
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+        boxsizer2.Add( sizer_output )
+        sizer2.Add(boxsizer2,0, wx.EXPAND | wx.ALL, 10)
+        #-----Button  sizer------------
+    
+        id = wx.NewId()
+        button_calculate = wx.Button(self, id, "Calculate")
+        button_calculate.SetToolTipString("Calculate SlD of neutrons.")
+        self.Bind(wx.EVT_BUTTON, self.calculateSld, id = id)   
+        
+        sizer_button.Add((250, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        sizer_button.Add(button_calculate, 0, wx.RIGHT|wx.ADJUST_MINSIZE,20)
+        sizer3.Add(sizer_button)
+        #---------layout----------------
+        vbox  = wx.BoxSizer(wx.VERTICAL)
+        vbox.Add(sizer1)
+        vbox.Add(sizer2)
+        vbox.Add(sizer3)
+        vbox.Fit(self) 
+        self.SetSizer(vbox)
+        
+        
+    def check_inputs(self):
+        """Check validity user inputs"""
+        flag= True
+       
+        if check_float(self.density_ctl):
+            self.density = float(self.density_ctl.GetValue())
+        else:
+            flag=False
+            raise ValueError,"Error for Density value :expect float"
+    
+        self.wavelength= self.wavelength_ctl.GetValue()
+        if self.wavelength.lstrip().rstrip()=="":
+            self.wavelength = self.calculator.wavelength
+        else:
+            if check_float(self.wavelength_ctl):
+                self.wavelength= float(self.wavelength)
+            else:
+                flag = False
+                raise ValueError,"Error for wavelenth value :expect float"
+                
+        self.formulata_text= self.compound_ctl.GetValue().lstrip().rstrip()
+        if self.formulata_text!="":
+            self.compound_ctl.SetBackgroundColour(wx.WHITE)
+            self.compound_ctl.Refresh()
+        else:
+            self.compound_ctl.SetBackgroundColour("pink")
+            self.compound_ctl.Refresh()
+            flag=False
+            raise ValueError, "Enter a formula"
+        return flag 
+        
+    def calculateSld(self, event):
+        """
+            Calculate the neutron scattering density length of a molecule
+        """
+        try:
+            #Check validity user inputs
+            if self.check_inputs():
+                #get ready to compute
+                try:
+                    self.calculator.setValue(self.formulata_text,self.density,self.wavelength)
+                except:
+                    if self.base !=None:
+                        msg= "SLD Calculator: %s" % (sys.exc_value)
+                        wx.PostEvent(self.base, StatusEvent(status= msg ))
+                    else:
+                        raise
+                    return
+                
+                # Compute the Cu SLD
+                Cu_reel, Cu_im = self.calculator.calculateXRaySld( "Cu")
+                self.cu_ka_sld_reel_ctl.SetValue(format_number(Cu_reel*_SCALE))
+                self.cu_ka_sld_im_ctl.SetValue(format_number(Cu_im*_SCALE))
+                
+                # Compute the Mo SLD
+                Mo_reel, Mo_im = self.calculator.calculateXRaySld( "Mo")
+                self.mo_ka_sld_reel_ctl.SetValue(format_number(Mo_reel*_SCALE))
+                self.mo_ka_sld_im_ctl.SetValue(format_number(Mo_im*_SCALE))
+               
+                coh,absorp,inc= self.calculator.calculateNSld()
+                im = self.calculator.calculateAbsorptionIm()
+                length = self.calculator.calculateLength()
+                # Neutron SLD
+                self.neutron_sld_reel_ctl.SetValue(format_number(coh*_SCALE))
+                self.neutron_sld_im_ctl.SetValue(format_number(im*_SCALE))
+                self.neutron_inc_ctl.SetValue(format_number(inc ))
+                self.neutron_abs_ctl.SetValue(format_number(absorp))
+                # Neutron length
+                self.neutron_length_ctl.SetValue(format_number(length))
+                # display wavelength
+                self.wavelength_ctl.SetValue(str(self.wavelength))
+        except:
+            if self.base !=None:
+                  msg= "SLD Calculator: %s" % (sys.exc_value)
+                  wx.PostEvent(self.base, StatusEvent(status= msg ))
+            else:
+                raise
+            return   
+
+   
+        
+  
+    
+   
+ 
+        
+               
+class SldWindow(wx.Frame):
+    def __init__(self, parent=None, id=1, title="SLD Calculator",base=None):
+        wx.Frame.__init__(self, parent, id, title, size=( PANEL_SIZE,  PANEL_SIZE))
+        
+        self.panel = SldPanel(self, base=base)
+        self.Centre()
+        self.Show(True)
+        
+class ViewApp(wx.App):
+    def OnInit(self):
+        frame = SldWindow(None, -1, 'SLD Calculator')    
+        frame.Show(True)
+        self.SetTopWindow(frame)
+        
+        return True
+        
+
+if __name__ == "__main__": 
+    app = ViewApp(0)
+    app.MainLoop()     
Index: calculatorview/setup.py
===================================================================
--- calculatorview/setup.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/setup.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
@@ -0,0 +1,15 @@
+"""
+     Installation script for DANSE calculator perspective for SansView
+"""
+
+from distutils.core import setup
+
+setup(
+    name="calculator",
+    description = "P(r) inversion perspective for SansView",
+    package_dir = {"sans.perspectives":"perspectives",
+                   "sans.perspectives.calculator":"perspectives/calculator"},
+    packages = ["sans.perspectives",
+                "sans.perspectives.calculator"],
+    )
+
