Пример #1
0
 def moveend(self, ev):
     """
     Called a dragging motion ends.Get slicer event
     """
     self.base.thaw_axes()
     ## Post parameters
     event = SlicerParameterEvent()
     event.type = self.__class__.__name__
     event.params = self.get_params()
     ## Send slicer paramers to plotter2D
     wx.PostEvent(self.base, event)
Пример #2
0
 def moveend(self, ev):
     """
     Called a dragging motion ends.Get slicer event
     """
     self.base.thaw_axes()
     ## Post parameters
     event = SlicerParameterEvent()
     event.type = self.__class__.__name__
     event.params = self.get_params()
     ## Send slicer paramers to plotter2D
     wx.PostEvent(self.base, event)
Пример #3
0
    def moveend(self, ev):
        """
            After a dragging motion reset the flag self.has_move to False
            :param ev: event
        """
        self.has_move = False

        event = SlicerParameterEvent()
        event.type = self.__class__.__name__
        event.params = self.get_params()
        self.base.moveend(ev)
Пример #4
0
    def moveend(self, ev):
        """
            After a dragging motion reset the flag self.has_move to False
            :param ev: event
        """
        self.has_move = False

        event = SlicerParameterEvent()
        event.type = self.__class__.__name__
        event.params = self.get_params()
        self.base.moveend(ev)
Пример #5
0
 def moveend(self, ev):
     """
     Called when any dragging motion ends.
     Post an event (type =SlicerParameterEvent)
     to plotter 2D with a copy  slicer parameters
     Call  _post_data method
     """
     self.base.thaw_axes()
     # Post parameters to plotter 2D
     event = SlicerParameterEvent()
     event.type = self.__class__.__name__
     event.params = self.get_params()
     wx.PostEvent(self.base, event)
Пример #6
0
 def moveend(self, ev):
     """
     Called when any dragging motion ends.
     Post an event (type =SlicerParameterEvent)
     to plotter 2D with a copy  slicer parameters
     Call  _post_data method
     """
     self.base.thaw_axes()
     # Post parameters to plotter 2D
     event = SlicerParameterEvent()
     event.type = self.__class__.__name__
     event.params = self.get_params()
     wx.PostEvent(self.base, event)
Пример #7
0
 def moveend(self, ev):
     """
     Called after a dragging event.
     Post the slicer new parameters and creates a new Data1D
     corresponding to the new average
     """
     self.base.thaw_axes()
     # Post parameters
     event = SlicerParameterEvent()
     event.type = self.__class__.__name__
     event.params = self.get_params()
     wx.PostEvent(self.base.parent, event)
     # create the new data1D
     self._post_data()
Пример #8
0
 def moveend(self, ev):
     """
     Called after a dragging event.
     Post the slicer new parameters and creates a new Data1D
     corresponding to the new average
     """
     self.base.thaw_axes()
     # Post parameters
     event = SlicerParameterEvent()
     event.type = self.__class__.__name__
     event.params = self.get_params()
     wx.PostEvent(self.base.parent, event)
     # create the new data1D
     self._post_data()
Пример #9
0
    def on_text_enter(self, evt):
        """
        Parameters have changed
        """
        params = {}
        has_error = False
        for item in self.parameters:
            try:
                if item[0] == "binning base":
                    title = self.bin_ctl.GetValue()
                    params["binning base"] = BINNING_OPTIONS.get(title)
                    continue
                params[item[0]] = float(item[1].GetValue())
                item[1].SetBackgroundColour(
                    wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
                item[1].Refresh()
            except:
                has_error = True
                item[1].SetBackgroundColour("pink")
                item[1].Refresh()

        if not has_error:
            # Post parameter event
            # parent here is plotter2D
            self.update_file_append(params)
            self.append_name.SetValue(self.default_value)
            self.append_name.Refresh()
            event = SlicerParameterEvent(type=self.type, params=params)
            wx.PostEvent(self.parent, event)
Пример #10
0
    def apply_params_list_and_process(self, evt=None):
        """
        Event based parameter setting.

        :param evt: Event triggered to apply parameters to a list of plots
           evt should have attrs plot_list and params

        """
        if evt is None:
            return
        # Apply parameter list to each plot as desired
        for item in evt.apply_to_list:
            event = SlicerParameterEvent(type=evt.type, params=evt.params)
            wx.PostEvent(item, event)
        # Post an event to save each data set to file
        if evt.auto_save:
            event = save_files(append_to_name=evt.append, path=evt.path,
                               type=evt.type, file_list=evt.apply_to_list,
                               fit=evt.fit)
            wx.PostEvent(self, event)
Пример #11
0
    def onTextEnter(self, evt):
        """
        Parameters have changed
        """
        params = {}
        has_error = False
        for item in self.parameters:
            try:
                params[item[0]] = float(item[1].GetValue())
                item[1].SetBackgroundColour(
                    wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
                item[1].Refresh()
            except:
                has_error = True
                item[1].SetBackgroundColour("pink")
                item[1].Refresh()

        if has_error == False:
            # Post parameter event
            ##parent hier is plotter2D
            event = SlicerParameterEvent(type=self.type, params=params)
            wx.PostEvent(self.parent, event)
Пример #12
0
 def on_text_enter(self, evt):
     """
     Parameters have changed
     """
     evt.Skip()
     params = {}
     has_error = False
     for item in self.parameters:
         try:
             params[item[0]] = float(item[1].GetValue())
             item[1].SetBackgroundColour(
                 wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
             item[1].Refresh()
         except:
             has_error = True
             item[1].SetBackgroundColour("pink")
             item[1].Refresh()
     if not has_error:
         # Post parameter event
         # base is guiframe is this case
         event = SlicerParameterEvent(type=self.type, params=params)
         wx.PostEvent(self.base, event)