Changeset 986da97 in sasview for fittingview/src/sans


Ignore:
Timestamp:
Jun 28, 2012 2:53:08 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
83b81b8
Parents:
9c30b8c
Message:

Popup dialog on status event with error

Location:
fittingview/src/sans/perspectives/fitting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fittingview/src/sans/perspectives/fitting/console.py

    rafac721 r986da97  
    102102        wx.PostEvent(self.parent, StatusEvent(status=message, 
    103103                                   info="error", type="stop")) 
     104    def stop(self, msg): 
     105        """ 
     106        Post event msg and stop 
     107        """ 
     108        if self.isbetter: 
     109            #self.result.print_summary() 
     110            self.update_fit() 
     111 
     112        message = str(msg) + " \n %s \n" % self.result.__str__() 
     113        wx.PostEvent(self.parent, StatusEvent(status=message, 
     114                                   info="info", type="stop")) 
     115         
    104116    def finalize(self): 
    105117        """ 
  • fittingview/src/sans/perspectives/fitting/fit_thread.py

    r940aca7 r986da97  
    100100             
    101101            if self.handler is not None: 
    102                 self.handler.error(msg=msg) 
     102                self.handler.stop(msg=msg) 
    103103        except: 
    104104            if self.handler is not None: 
  • fittingview/src/sans/perspectives/fitting/fitting.py

    r743f480 r986da97  
    10331033                    current_page_id = page_id 
    10341034                    value.clear_model_param() 
     1035            except KeyboardInterrupt: 
     1036                flag = True 
     1037                msg = "Fitting terminated" 
     1038                wx.PostEvent(self.parent, StatusEvent(status=msg, info="info", 
     1039                                                      type="stop")) 
     1040                return flag 
    10351041            except: 
    10361042                flag = False 
     
    14741480                                         batch_inputs=batch_inputs) 
    14751481         
    1476         wx.PostEvent(self.parent, StatusEvent(status=msg, error="error", 
     1482        wx.PostEvent(self.parent, StatusEvent(status=msg, error="info", 
    14771483                                              type="stop")) 
    14781484        # Remove parameters that are not shown 
     
    16001606                        index += 1 
    16011607                        wx.CallAfter(cpage._on_fit_complete) 
     1608                    except KeyboardInterrupt: 
     1609                        msg = "Singular point: Fitting Stoped." 
     1610                        wx.PostEvent(self.parent, StatusEvent(status=msg, 
     1611                                                              info="info", 
     1612                                                              type="stop")) 
    16021613                    except: 
    16031614                        msg = "Singular point: Fitting Error occurred." 
     
    16071618                     
    16081619        except: 
    1609             msg = "Fit completed but Following" 
     1620            msg = "Fit completed 33but Following" 
    16101621            msg += " error occurred:%s" % sys.exc_value 
    16111622            wx.PostEvent(self.parent, StatusEvent(status=msg, info="error", 
Note: See TracChangeset for help on using the changeset viewer.