Changeset 986da97 in sasview


Ignore:
Timestamp:
Jun 28, 2012 4: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

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/model_editor.py

    r30bc3045 r986da97  
    773773            info = 'Error' 
    774774            color = 'red' 
    775             wx.MessageBox(msg, info)   
     775            #wx.MessageBox(msg, info)   
    776776         
    777777        self._msg_box.SetLabel(msg) 
  • 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", 
  • park_integration/src/sans/fit/AbstractFitEngine.py

    r1f9f3c8a r986da97  
    486486                    self.curr_thread.isquit() 
    487487                except: 
    488                     msg = "Fitting: Terminated...       Note: Forcing to stop " 
    489                     msg += "fitting may cause a 'Functor error message' " 
    490                     msg += "being recorded in the log file....." 
    491                     self.handler.error(msg) 
     488                    #msg = "Fitting: Terminated...       Note: Forcing to stop " 
     489                    #msg += "fitting may cause a 'Functor error message' " 
     490                    #msg += "being recorded in the log file....." 
     491                    #self.handler.stop(msg) 
    492492                    raise 
    493493          
  • park_integration/src/sans/fit/ScipyFitting.py

    r2d0756a5 r986da97  
    114114                if handler is not None: 
    115115                    msg = "Fitting: Terminated!!!" 
    116                     handler.error(msg) 
     116                    handler.stop(msg) 
    117117                    raise KeyboardInterrupt, msg 
    118118            else: 
  • sansguiframe/src/sans/guiframe/gui_statusbar.py

    r3fc01c5 r986da97  
    228228        """ 
    229229        wxStatusB.PopStatusText(self, field=MSG_POSITION) 
    230        
     230         
    231231    def PushStatusText(self, *args, **kwds): 
    232232        """ 
     
    315315                                                 size = (height,height)) 
    316316            self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
     317            e_msg = "Error(s) Occurred:\n" 
     318            e_msg += event.status 
     319            wx.MessageBox(e_msg, style=wx.ICON_ERROR) 
    317320        else: 
    318321            icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, 
  • sansguiframe/src/sans/guiframe/local_perspectives/data_loader/data_loader.py

    rc151afc r986da97  
    177177        log_msg = '' 
    178178        output = {} 
     179        any_error = False 
    179180        error_message = "" 
    180         info = "info" 
    181181        for p_file in path: 
     182            info = "info" 
    182183            basename  = os.path.basename(p_file) 
    183184            root, extension = os.path.splitext(basename) 
    184185            if extension.lower() in EXTENSIONS: 
     186                any_error = True 
    185187                log_msg = "Data Loader cannot " 
    186188                log_msg += "load: %s\n" % str(p_file) 
     
    203205                self.load_update(output=output, message=message, info=info) 
    204206            except: 
    205                  error = "Error while loading Data: %s\n" % str(p_file) 
    206                  error += str(sys.exc_value) + "\n" 
    207                  error_message = "The data file you selected could not be loaded.\n" 
    208                  error_message += "Make sure the content of your file" 
    209                  error_message += " is properly formatted.\n\n" 
    210                  error_message += "When contacting the DANSE team, mention the" 
    211                  error_message += " following:\n%s" % str(error) 
    212                  info = "error" 
    213                  self.load_update(output=output, message=error_message,  
     207                any_error = True 
     208                if error_message == "": 
     209                     error = "Error: " + str(sys.exc_value) + "\n" 
     210                     error += "while loading Data: \n%s\n" % str(p_file) 
     211                     error_message = "The data file you selected could not be loaded.\n" 
     212                     error_message += "Make sure the content of your file" 
     213                     error_message += " is properly formatted.\n\n" 
     214                     error_message += "When contacting the DANSE team, mention the" 
     215                     error_message += " following:\n%s" % str(error) 
     216                else: 
     217                     error_message += "%s\n"% str(p_file) 
     218                info = "error" 
     219                self.load_update(output=output, message=error_message,  
    214220                                  info=info) 
    215221                 
    216222        message = "Loading Data Complete! " 
    217223        message += log_msg 
    218         if error_message!= "": 
     224        if error_message != "": 
    219225            info = 'error' 
    220226        self.load_complete(output=output, error_message=error_message, 
     
    226232        """ 
    227233        if message != "": 
    228             wx.PostEvent(self.parent, StatusEvent(status=message, info=info,  
     234            wx.PostEvent(self.parent, StatusEvent(status=message, info='info',  
    229235                                                  type="progress")) 
    230236    def load_complete(self, output, message="", error_message="", path=None,  
     
    236242                                              info=info, 
    237243                                              type="stop")) 
    238         if error_message != "": 
    239             self.load_error(error_message) 
     244        #if error_message != "": 
     245        #    self.load_error(error_message) 
    240246        self.parent.add_data(data_list=output) 
    241247    
Note: See TracChangeset for help on using the changeset viewer.