Example #1
0
    def on_plot_results(self, event=None):
        if self._results == None:
            self._results = results.Simresults(ident='simresults',
                                               scenario=self.get_scenario())

        if is_mpl:
            resultplotter = results_mpl.Resultplotter(
                self._results, logger=self._mainframe.get_logger())
            dlg = ResultDialog(self._mainframe, resultplotter)

            dlg.CenterOnScreen()

            # this does not return until the dialog is closed.
            val = dlg.ShowModal()
            # print '  val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL
            # print '  status =',dlg.get_status()
            if dlg.get_status() != 'success':  # val == wx.ID_CANCEL:
                # print ">>>>>>>>>Unsuccessful\n"
                dlg.Destroy()

            if dlg.get_status() == 'success':
                # print ">>>>>>>>>successful\n"
                # apply current widget values to scenario instance
                dlg.apply()
                dlg.Destroy()
        else:
            if event:
                event.Skip()
Example #2
0
    def on_plot_results(self, event=None):
        """Plot edge results on map using the Matplotlib plotting envitonment."""
        if self._simulation.results is None:
            self._simulation.results = results.Simresults(
                ident='simresults', simulation=self._simulation)

        if is_mpl:
            resultplotter = results_mpl.Resultplotter(
                self._simulation.results, logger=self._mainframe.get_logger())
            dlg = ResultDialog(self._mainframe, resultplotter)

            dlg.CenterOnScreen()

            # this does not return until the dialog is closed.
            val = dlg.ShowModal()
            #print '  val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL
            #print '  status =',dlg.get_status()
            if dlg.get_status() != 'success':  #val == wx.ID_CANCEL:
                #print ">>>>>>>>>Unsuccessful\n"
                dlg.Destroy()

            if dlg.get_status() == 'success':
                #print ">>>>>>>>>successful\n"
                # apply current widget values to scenario instance
                dlg.apply()
                dlg.Destroy()