Changeset cd84dca in sasview


Ignore:
Timestamp:
Dec 16, 2008 2:27:50 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
dc317d1
Parents:
e8c96f5
Message:

change on xml loading title

Location:
guiframe
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_loader.py

    re8c96f5 rcd84dca  
    7979        return 
    8080    filename = os.path.basename(path) 
     81     
    8182    if not  output.__class__.__name__=="list": 
    8283        try: 
     
    103104         
    104105        new_plot.source=output.source 
    105         new_plot.name = filename 
     106        new_plot.name = output.filename 
    106107        new_plot.interactive = True 
    107108        new_plot.info= output 
     
    121122        i=1 
    122123        for item in output: 
     124             
    123125            try: 
    124126                dxl=item.dxl 
     
    134136            new_plot.source=item.source 
    135137            new_plot.info=output 
    136             new_plot.name = filename+" "+ str(i) 
     138            new_plot.name = str(item.run[0]) 
    137139            new_plot.interactive = True 
    138140             
  • guiframe/local_perspectives/plotting/Arc.py

    re8c96f5 rcd84dca  
    1919        self.markers = [] 
    2020        self.axes = axes 
    21         self._inner_mouse_x = r 
    22         self._inner_mouse_y = 0 
     21        self._mouse_x = r 
     22        self._mouse_y = 0 
    2323         
    24         self._inner_save_x  = r 
    25         self._inner_save_y  = 0 
     24        self._save_x  = r 
     25        self._save_y  = 0 
    2626         
    2727        self.scale = 10.0 
     
    3030        self.theta2=theta2 
    3131        self.radius= r 
    32         [self.inner_circle] = self.axes.plot([],[], 
     32        [self.arc] = self.axes.plot([],[], 
    3333                                      linestyle='-', marker='', 
    3434                                      color=self.color) 
    3535        self.npts = 20 
    3636        self.has_move= False     
    37         self.connect_markers([self.inner_circle]) 
     37        self.connect_markers([self.arc]) 
    3838        self.update() 
    3939 
     
    4545        self.clear_markers() 
    4646        try: 
    47             self.inner_marker.remove() 
    48             self.inner_circle.remove() 
     47            self.marker.remove() 
     48            self.arc.remove() 
    4949        except: 
    5050            # Old version of matplotlib 
     
    5555         
    5656    def get_radius(self): 
    57         radius =math.sqrt(math.pow(self._inner_mouse_x, 2)+math.pow(self._inner_mouse_y, 2)) 
     57        radius =math.sqrt(math.pow(self._mouse_x, 2)+math.pow(self._mouse_y, 2)) 
    5858        return radius 
    5959         
    6060    def update(self,theta1=None,theta2=None, nbins=None, r=None): 
    6161        """ 
    62         Draw the new roughness on the graph. 
    6362        """ 
    6463        # Plot inner circle 
     
    7271        print "ring update theta1 theta2", math.degrees(self.theta1), math.degrees(self.theta2) 
    7372        while self.theta2 < self.theta1: self.theta2 += 2*math.pi 
    74          
    75          
    76          
    77              
     73        while self.theta2 >= self.theta1+2*math.pi: self.theta2 -= 2*math.pi 
     74 
     75        """ 
    7876        if nbins!=None: 
    7977            self.npts =nbins 
    8078        else: 
    81             npts = int((self.theta2 - self.theta1)/(math.pi/120))    
     79        """ 
     80        npts = int((self.theta2 - self.theta1)/(math.pi/120))   
     81              
     82        if r ==None: 
     83            self.radius=  math.sqrt(math.pow(self._mouse_x, 2)+math.pow(self._mouse_y, 2)) 
     84        else: 
     85            self.radius= r 
     86             
    8287        for i in range(self.npts): 
    8388             
    8489            phi =(self.theta2-self.theta1)/(self.npts-1)*i +self.theta1 
    85             #delta= phi1-phi 
    86             if r ==None: 
    87                 self.radius=  math.sqrt(math.pow(self._inner_mouse_x, 2)+math.pow(self._inner_mouse_y, 2)) 
    88             else: 
    89                 self.radius= r 
    9090             
    9191            xval = 1.0*self.radius*math.cos(phi)  
     
    9595            y.append(yval) 
    9696         
    97         #self.inner_marker.set(xdata=[self._inner_mouse_x],ydata=[0]) 
    98         self.inner_circle.set_data(x, y)  
     97        #self.marker.set(xdata=[self._mouse_x],ydata=[0]) 
     98        self.arc.set_data(x, y)  
    9999         
    100100       
     
    104104        can restore on Esc. 
    105105        """ 
    106         self._inner_save_x = self._inner_mouse_x 
    107         self._inner_save_y = self._inner_mouse_y 
    108         #self._inner_save_x = ev.xdata 
    109         #self._inner_save_y = ev.ydata 
     106        self._save_x = self._mouse_x 
     107        self._save_y = self._mouse_y 
     108        #self._save_x = ev.xdata 
     109        #self._save_y = ev.ydata 
    110110         
    111111        self.base.freeze_axes() 
     
    126126        Restore the roughness for this layer. 
    127127        """ 
    128         self._inner_mouse_x = self._inner_save_x 
    129         self._inner_mouse_y = self._inner_save_y 
     128        self._mouse_x = self._save_x 
     129        self._mouse_y = self._save_y 
    130130        
    131131    def move(self, x, y, ev): 
     
    134134        """ 
    135135        #print "ring move x, y", x,y 
    136         self._inner_mouse_x = x 
    137         self._inner_mouse_y = y 
     136        self._mouse_x = x 
     137        self._mouse_y = y 
    138138        self.has_move= True 
    139139        self.base.base.update() 
     
    156156 
    157157        x = params["radius"]  
    158         self.set_cursor(x, self._inner_mouse_y) 
     158        self.set_cursor(x, self._mouse_y) 
    159159         
    160160     
  • guiframe/local_perspectives/plotting/SectorSlicer.py

    re8c96f5 rcd84dca  
    197197         
    198198         # Post paramters 
    199         event = SlicerParameters.SlicerParameterEvent() 
    200         event.type = self.__class__.__name__ 
    201         event.params = self.get_params() 
    202         print "main moveend ", event.params 
    203         wx.PostEvent(self.base.parent, event) 
     199        #event = SlicerParameters.SlicerParameterEvent() 
     200        #event.type = self.__class__.__name__ 
     201        #event.params = self.get_params() 
     202        #print "main moveend ", event.params 
     203        #wx.PostEvent(self.base.parent, event) 
    204204        self._post_data() 
    205205             
  • guiframe/local_perspectives/plotting/SlicerParameters.py

    re8c96f5 rcd84dca  
    1010(SlicerParameterEvent, EVT_SLICER_PARS)   = wx.lib.newevent.NewEvent() 
    1111 
    12 def format_number(value, high=False): 
    13     """ 
    14         Return a float in a standardized, human-readable formatted string  
    15     """ 
    16     try:  
    17         value = float(value) 
    18     except: 
    19         return "NaN" 
    20      
    21     if high: 
    22         return "%-6.4g" % value 
    23     else: 
    24         return "%-5.3g" % value 
    25 class SlicerParameterPanel(wx.Dialog): 
     12class SlicerParameterPanel(wx.Panel): 
    2613    #TODO: show units 
    2714    #TODO: order parameters properly 
    2815     
    29     def __init__(self, parent, id, title): 
    30         wx.Dialog.__init__(self, parent, id, title, size=(400, 350)) 
     16    def __init__(self, parent, *args, **kwargs): 
     17        wx.Panel.__init__(self, parent, *args, **kwargs) 
    3118        self.params = {} 
    3219        self.parent = parent 
     
    4330        self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 
    4431        self.parent.Bind(EVT_SLICER_PARS, self.onParamChange) 
    45          
    46         
    4732 
    4833    def onEVT_SLICER(self, event): 
     
    5439        """ 
    5540        event.Skip() 
    56         print "on event slicer parameters" 
    5741        if event.obj_class==None: 
    5842            self.set_slicer(None, None) 
     
    6448            Rebuild the panel 
    6549        """ 
    66          
    6750        self.bck.Clear(True)   
    6851        self.type = type   
     
    9174                 
    9275                 
    93                 ctl.SetValue(format_number(str(params[item]))) 
     76                ctl.SetValue(str(params[item])) 
    9477                self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter) 
    9578                ctl.Bind(wx.EVT_KILL_FOCUS, self.onTextEnter) 
     
    130113            event = SlicerParameterEvent(type=self.type, params=params) 
    131114            wx.PostEvent(self.parent, event) 
    132              
    133   
    134         
    135  
    136115         
Note: See TracChangeset for help on using the changeset viewer.