Changeset 1913
- Timestamp:
- 08/30/10 12:47:16 (14 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r1910 r1913 52 52 self._panellayout = self.set_panellayout(refresh=False) 53 53 self._offset = None 54 ###-S 55 #self._rowcount = 0 56 ###-E 54 self._rowcount = 0 55 self._panelcnt = 0 57 56 58 57 def _translate(self, instr): … … 97 96 are consistent e.g. all 'channel' or all 'velocity' etc. 98 97 """ 99 ###-S 100 #self._rowcount = 0 101 ###-E 98 self._rowcount = self._panelcnt = 0 102 99 if self._plotter.is_dead: 103 100 if hasattr(self._plotter.figmgr,'casabar'): … … 345 342 if self._panelling == 'r': 346 343 self._stacking = '_r' 344 elif self._stacking == 'r': 345 self._panelling = '_r' 347 346 if refresh and self._data: self.plot(self._data) 348 347 return … … 360 359 self._panelling = md 361 360 self._title = None 362 if self._panelling== 'r':361 if md == 'r': 363 362 self._stacking = '_r' 364 363 return True … … 395 394 self._stacking = md 396 395 self._lmap = None 396 if md == 'r': 397 self._panelling = '_r' 397 398 return True 398 399 return False … … 841 842 if isinstance(n0, int): n = n0 842 843 else: n = len(n0) 843 ###-S844 #nptot = n845 ###-E846 844 if isinstance(nstack0, int): nstack = nstack0 847 845 else: nstack = len(nstack0) 846 nptot = n 848 847 maxpanel, maxstack = 16,16 849 ###-S 850 if n > maxpanel or nstack > maxstack: 851 #if nstack > maxstack: 852 ###-E 853 ###-S 854 maxn = 0 855 if nstack > maxstack: maxn = maxstack 856 if n > maxpanel: maxn = maxpanel 857 msg ="Scan to be plotted contains more than %d selections.\n" \ 858 "Selecting first %d selections..." % (maxn, maxn) 859 #msg ="Scan to be overlayed contains more than %d selections.\n" \ 860 # "Selecting first %d selections..." % (maxstack, maxstack) 861 ###-E 848 if nstack > maxstack: 849 msg ="Scan to be overlayed contains more than %d selections.\n" \ 850 "Selecting first %d selections..." % (maxstack, maxstack) 862 851 asaplog.push(msg) 863 852 asaplog.post('WARN') 864 ###-S865 n = min(n,maxpanel)866 ###-E867 853 nstack = min(nstack,maxstack) 868 ###-S 869 #n = min(n,maxpanel) 870 ###-E 854 n = min(n,maxpanel) 871 855 872 856 if n > 1: … … 885 869 # self._plotter.set_panels() 886 870 self._plotter.set_panels(layout=self._panellayout) 887 ###-S 888 r = 0 889 #r = self._rowcount 890 ###-E 871 #r = 0 872 r = self._rowcount 891 873 nr = scan.nrow() 892 874 a0,b0 = -1,-1 … … 912 894 self._plotter.set_axes('ylabel', ylab) 913 895 lbl = self._get_label(scan, r, self._panelling, self._title) 896 #if self._panelling == 'r': lbl = '' 914 897 if isinstance(lbl, list) or isinstance(lbl, tuple): 915 898 if 0 <= panelcount < len(lbl): … … 920 903 self._plotter.set_axes('title',lbl) 921 904 newpanel = True 922 stackcount = 0905 stackcount = 0 923 906 panelcount += 1 924 907 if (b > b0 or newpanel) and stackcount < nstack: … … 988 971 r+=1 # next row 989 972 ###-S 990 #self._rowcount = r+1 991 #if self._rowcount > 0: enable prev button 992 #if self._rowcount >= nr: disable next button 973 self._rowcount = r+1 974 self._panelcnt += panelcount 975 if self._plotter.figmgr.casabar: 976 if self._panelcnt >= nptot-1: 977 self._plotter.figmgr.casabar.disable_next() 978 else: 979 self._plotter.figmgr.casabar.enable_next() 980 #if self._panelcnt - panelcount > 0: 981 # self._plotter.figmgr.casabar.enable_prev() 982 #else: 983 # self._plotter.figmgr.casabar.disable_prev() 993 984 ###-E 994 985 #reset the selector to the scantable's original … … 1073 1064 't': str(scan.get_time(row)), 1074 1065 'r': "row "+str(row), 1075 '_r': str(scan.get_time(row))+",\nIF"+str(scan.getif(row))+", "+poleval+", Beam"+str(scan.getbeam(row)) } 1066 #'_r': str(scan.get_time(row))+",\nIF"+str(scan.getif(row))+", "+poleval+", Beam"+str(scan.getbeam(row)) } 1067 '_r': "" } 1076 1068 return userlabel or d[mode] 1077 1069 -
trunk/python/casatoolbar.py
r1890 r1913 167 167 return False 168 168 169 def _new_page(self,next=True): 170 self.plotter._plotter.hold() 171 self.plotter._plotter.clear() 172 self.plotter._plot(self.plotter._data) 173 self.plotter._plotter.release() 174 self.plotter._plotter.tidy() 175 self.plotter._plotter.show(hardrefresh=False) 176 pass 177 169 178 ##################################### 170 179 ## Backend dependent Classes ## … … 202 211 text='notation', 203 212 command=self.modify_note) 213 self.bPrev=self._NewButton(master=self, 214 text='- page', 215 command=self.prev_page) 216 self.bPrev.config(padx=5) 217 self.bNext=self._NewButton(master=self, 218 text='+ page', 219 command=self.next_page) 220 self.bNext.config(padx=5) 204 221 self.bQuit=self._NewButton(master=self, 205 222 text='Quit', … … 256 273 self._p.register('button_press',self._mod_note) 257 274 275 def prev_page(self): 276 self.figmgr.toolbar.set_message('plotting the previous page') 277 self._new_page(next=False) 278 279 def next_page(self): 280 self.figmgr.toolbar.set_message('plotting the next page') 281 self._new_page(next=True) 282 258 283 def quit(self): 259 284 self.__disconnect_event() … … 273 298 self.bStat.config(relief='raised', state=Tk.DISABLED) 274 299 self.bSpec.config(relief='raised', state=Tk.DISABLED) 300 self.bPrev.config(state=Tk.DISABLED) 301 #self.bNext.config(state=Tk.DISABLED) 275 302 self.button=False 276 303 self.mode='' 277 304 self.__disconnect_event() 305 306 def enable_next(self): 307 self.bNext.config(state=Tk.NORMAL) 308 309 def disable_next(self): 310 self.bNext.config(state=Tk.DISABLED) 311 312 def enable_prev(self): 313 self.bPrev.config(state=Tk.NORMAL) 314 315 def disable_prev(self): 316 self.bPrev.config(state=Tk.DISABLED) 278 317 279 318 def delete_bar(self):
Note:
See TracChangeset
for help on using the changeset viewer.