parameters: (self, event=None)
docstring: Load results from virtual population iteration simulation script_vp_iter.py
docstring_summary: Load results from virtual population iteration simulation script_vp_iter.py
docstring_tokens: Load results from virtual population iteration simulation script_vp_iter . py
function: def on_open_iterationresults(self, event=None):
          """
          Load results from virtual population iteration simulation script_vp_iter.py
          """
  
          wildcards_all = "All files (*.*)|*.*"
          wildcards_obj = "VP iterate result files (*.vpiterres.obj)|*.vpiterres.obj|Python binary files (*.obj)|*.obj"
          wildcards = wildcards_obj+"|"+wildcards_all
  
          # Finally, if the directory is changed in the process of getting files, this
          # dialog is set up to change the current working directory to the path chosen.
          dlg = wx.FileDialog(
              self._mainframe, message="Open VP iteration results file",
              defaultDir=self.get_scenario().get_workdirpath(),
              #defaultFile = self.get_scenario().get_rootfilepath()+'.vpiterres.obj',
              wildcard=wildcards,
              style=wx.OPEN | wx.CHANGE_DIR
          )
  
          # Show the dialog and retrieve the user response. If it is the OK response,
          # process the data.
          is_newresults = False
          if dlg.ShowModal() == wx.ID_OK:
              # This returns a Python list of files that were selected.
              filepath = dlg.GetPath()
              if len(filepath) > 0:
                  simresults = self._demand.parent.simulation.results
                  if simresults is not None:
  
                      # delete old object, if any
                      vpiterstats = simresults.get_resultobj('vpiterstats')
                      if vpiterstats is not None:
                          simresults.delete('vpiterstats')
                          del vpiterstats
  
                      vpiterstats = cm.load_obj(filepath)
  
                      simresults.add_resultobj(vpiterstats)
  
                      is_newresults = True
  
          # Destroy the dialog. Don't do this until you are done with it!
          # BAD things can happen otherwise!
          dlg.Destroy()
  
          if is_newresults:
              # this should update all widgets for the new scenario!!
              # print 'call self._mainframe.refresh_moduleguis()'
              self._mainframe.browse_obj(simresults)
function_tokens: def on_open_iterationresults ( self , event = None ) : wildcards_all = "All files (*.*)|*.*" wildcards_obj = "VP iterate result files (*.vpiterres.obj)|*.vpiterres.obj|Python binary files (*.obj)|*.obj" wildcards = wildcards_obj + "|" + wildcards_all # Finally, if the directory is changed in the process of getting files, this # dialog is set up to change the current working directory to the path chosen. dlg = wx . FileDialog ( self . _mainframe , message = "Open VP iteration results file" , defaultDir = self . get_scenario ( ) . get_workdirpath ( ) , #defaultFile = self.get_scenario().get_rootfilepath()+'.vpiterres.obj', wildcard = wildcards , style = wx . OPEN | wx . CHANGE_DIR ) # Show the dialog and retrieve the user response. If it is the OK response, # process the data. is_newresults = False if dlg . ShowModal ( ) == wx . ID_OK : # This returns a Python list of files that were selected. filepath = dlg . GetPath ( ) if len ( filepath ) > 0 : simresults = self . _demand . parent . simulation . results if simresults is not None : # delete old object, if any vpiterstats = simresults . get_resultobj ( 'vpiterstats' ) if vpiterstats is not None : simresults . delete ( 'vpiterstats' ) del vpiterstats vpiterstats = cm . load_obj ( filepath ) simresults . add_resultobj ( vpiterstats ) is_newresults = True # Destroy the dialog. Don't do this until you are done with it! # BAD things can happen otherwise! dlg . Destroy ( ) if is_newresults : # this should update all widgets for the new scenario!! # print 'call self._mainframe.refresh_moduleguis()' self . _mainframe . browse_obj ( simresults )