Index: sansview/perspectives/fitting/fit_thread.py
===================================================================
--- sansview/perspectives/fitting/fit_thread.py	(revision 60c19433276a4083d80b1d9a0d15d1af357d5109)
+++ sansview/perspectives/fitting/fit_thread.py	(revision 785c823324aaba8461c3abed70e8f3dfe58f0d5b)
@@ -146,5 +146,5 @@
                           cpage= self.cpage,
                           elapsed=elapsed )
-            
+           
         except KeyboardInterrupt:
             # Thread was interrupted, just proceed and re-raise.
@@ -155,5 +155,6 @@
         except :
             #Stop on exception during fitting. Todo: need to put some mssg and reset progress bar.
-            wx.PostEvent(self.parent, StatusEvent(status=" Fit exception occurred..." ,type="stop"))
+            msg= " Fit Error occurred... %s"%sys.exc_value
+            wx.PostEvent(self.parent, StatusEvent(status= msg,type="stop"))
             #raise
     
Index: sansview/perspectives/fitting/gui_thread.py
===================================================================
--- sansview/perspectives/fitting/gui_thread.py	(revision 077809cc34f294ac6bdd73e60f59f5494154c970)
+++ sansview/perspectives/fitting/gui_thread.py	(revision 785c823324aaba8461c3abed70e8f3dfe58f0d5b)
@@ -62,5 +62,5 @@
         res=[]
         try:
-            res = self.fitdata.residuals(self.model.run)
+            res = self.fitdata.residuals(self.model.evalDistribution)
             sum=0
             for item in res:
@@ -133,5 +133,5 @@
         res=[]
         try:
-            res = self.fitdata.residuals(self.model.run)
+            res = self.fitdata.residuals(self.model.evalDistribution)
             sum=0
             for item in res:
Index: sansview/perspectives/fitting/model_thread.py
===================================================================
--- sansview/perspectives/fitting/model_thread.py	(revision b2936834e219ab7e000652ca519a915b56057f6f)
+++ sansview/perspectives/fitting/model_thread.py	(revision 785c823324aaba8461c3abed70e8f3dfe58f0d5b)
@@ -54,15 +54,19 @@
         index_model = (self.qmin <= radius)&(radius<= self.qmax)
        
-        ## receive only list of 2 numpy array 
-        ## One must reshape to vertical and the other to horizontal
-        value = self.model.evalDistribution([self.y_array,self.x_array] )
-        ## for data ignore the qmax 
-        if self.data == None:
-            # Only qmin value will be consider for the detector
-            output = value *index_data  
-        else:
-            # The user can define qmin and qmax for the detector
-            output = value*index_model
-        
+        try:
+            ## receive only list of 2 numpy array 
+            ## One must reshape to vertical and the other to horizontal
+            value = self.model.evalDistribution([self.y_array,self.x_array] )
+            ## for data ignore the qmax 
+            if self.data == None:
+                # Only qmin value will be consider for the detector
+                output = value *index_data  
+            else:
+                # The user can define qmin and qmax for the detector
+                output = value*index_model
+        except:
+            raise
+           
+       
         elapsed = time.time()-self.starttime
         self.complete( image = output,
@@ -74,34 +78,5 @@
                        qstep = self.qstep )
         
-    def compute_point(self):
-        """
-            Compute the data given a model function. Loop through each point
-            of x and y to compute the model
-            @return output : is a matrix of size x*y
-        """
-        output = numpy.zeros((len(self.x),len(self.y)))
-       
-        for i_x in range(len(self.x)):
-            # Check whether we need to bail out
-            self.update(output=output )
-            self.isquit()
-       
-            for i_y in range(int(len(self.y))):
-                radius = math.sqrt(self.x[i_x]*self.x[i_x]+self.y[i_y]*self.y[i_y])
-                ## for data ignore the qmax 
-                if self.data == None:
-                    if  self.qmin <= radius :
-                        value = self.model.runXY( [self.x[i_x], self.y[i_y]] )
-                        output[i_y][i_x] =value   
-                    else:
-                        output[i_y][i_x] =0   
-                else:  
-                    if  self.qmin <= radius and radius<= self.qmax:
-                        value = self.model.runXY( [self.x[i_x], self.y[i_y]] )
-                        output[i_y][i_x] =value   
-                    else:
-                        output[i_y][i_x] =0  
-        return output 
-     
+   
     
 
@@ -138,7 +113,11 @@
         self.starttime = time.time()
         
-        index= (self.qmin <= self.x)& (self.x <= self.qmax)
-        output = self.model.evalDistribution(self.x[index])
- 
+        try:
+            index= (self.qmin <= self.x)& (self.x <= self.qmax)
+            output = self.model.evalDistribution(self.x[index])
+        except:
+            raise
+            
+
         ##smearer the ouput of the plot    
         if self.smearer!=None:
@@ -150,26 +129,9 @@
                 
         elapsed = time.time()-self.starttime
-        
+       
         self.complete(x= self.x, y= output, 
                       elapsed=elapsed, model= self.model, data=self.data)
         
-    def compute_point(self):
-        """
-            Compute the data given a model function. Loop through each point
-            of x  compute the model
-            @return output : is a numpy vector of size x
-        """  
-        output = numpy.zeros(len(self.x))      
-        # Loop through each q of data.x
-        for i_x in range(len(self.x)):
-            self.update(x= self.x, output=output )
-            # Check whether we need to bail out
-            self.isquit()
-            if self.qmin <= self.x[i_x] and self.x[i_x] <= self.qmax:
-                value = self.model.run(self.x[i_x])
-                output[i_x] = value
-                
-        return output
-                
+ 
                 
 class CalcCommandline:
Index: sansview/perspectives/fitting/sldPanel.py
===================================================================
--- sansview/perspectives/fitting/sldPanel.py	(revision 785c823324aaba8461c3abed70e8f3dfe58f0d5b)
+++ sansview/perspectives/fitting/sldPanel.py	(revision 785c823324aaba8461c3abed70e8f3dfe58f0d5b)
@@ -0,0 +1,216 @@
+import wx
+_BOX_WIDTH = 76
+_STATICBOX_WIDTH = 350
+
+class SldPanel(wx.Panel):
+    def __init__(self, parent, id = -1):
+        wx.Panel.__init__(self, parent, id = id)
+        
+        self._do_layout()
+        self.SetAutoLayout(True)
+        self.Layout()
+       
+
+    def _do_layout(self):
+        """
+            Draw window content
+        """
+        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(g/cm^3)')
+        self.density_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        wavelength_txt = wx.StaticText(self, -1, 'Wavelength (A)')
+        self.wavelength_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
+        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) 
+        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) 
+        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))
+        
+        unit_a= '[A^(-2)]'
+        unit_cm1='[cm^(-1)]'
+        unit_cm='[cm]'
+        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_a)
+        
+        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_a)
+        
+        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_a)
+        
+        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_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_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")
+        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) 
+        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) 
+        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) 
+        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((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        sizer_button.Add(button_calculate, 0, wx.RIGHT|wx.ADJUST_MINSIZE, 10)
+        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)
+        
+        
+class SldWindow(wx.Frame):
+    def __init__(self, parent, id, title):
+        wx.Frame.__init__(self, parent, id, title, size=(400, 400))
+        
+        self.panel = SldPanel(self)
+        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()     
