/[ascend]/trunk/pygtk/diagnose.py
ViewVC logotype

Diff of /trunk/pygtk/diagnose.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 894 by johnpye, Wed Jul 5 12:36:29 2006 UTC revision 895 by johnpye, Tue Oct 24 00:12:34 2006 UTC
# Line 10  import config Line 10  import config
10  from infodialog import *  from infodialog import *
11    
12  ZOOM_RE = re.compile(r"([0-9]+)\s*%?")  ZOOM_RE = re.compile(r"([0-9]+)\s*%?")
13  MAX_ZOOM_SIZE = 2000  MAX_ZOOM_SIZE = float(2000) # float
14  MAX_ZOOM_RATIO = 16  MAX_ZOOM_RATIO = float(16) # float
15  AT_BOUND_TOL = 0.0001;  AT_BOUND_TOL = 0.0001;
16    
17  class DiagnoseWindow:  class DiagnoseWindow:
# Line 219  class DiagnoseWindow: Line 219  class DiagnoseWindow:
219              #print "SCALE TO FIX, w=%d, h=%d" % (w,h)              #print "SCALE TO FIX, w=%d, h=%d" % (w,h)
220              if self.nc/self.nr > w/h:              if self.nc/self.nr > w/h:
221                  # a 'wide' image                      # a 'wide' image    
222                  self.zoom = w / self.nc                  self.zoom = float(w) / self.nc
223              else:              else:
224                  self.zoom = h / self.nr                  self.zoom = float(h) / self.nr
225    
226            self.browser.reporter.reportNote("Diagnose window: preliminary calculated zoom = %f (nr = %d, nc = %d)" % (self.zoom, self.nr, self.nc))
227            
228    
229          if self.zoom > MAX_ZOOM_RATIO:          if self.zoom > MAX_ZOOM_RATIO:
230              self.zoom = MAX_ZOOM_RATIO              self.zoom = MAX_ZOOM_RATIO
231    
232          if self.zoom * self.nc > MAX_ZOOM_SIZE or self.zoom * self.nr > MAX_ZOOM_SIZE:          if self.zoom * self.nc > MAX_ZOOM_SIZE or self.zoom * self.nr > MAX_ZOOM_SIZE:
233                self.browser.reporter.reportNode("image is too big, reducing to MAX_ZOOM_SIZE = %f" % MAX_ZOOM_SIZE);
234              self.zoom = MAX_ZOOM_SIZE / max(self.nc,self.nr)              self.zoom = MAX_ZOOM_SIZE / max(self.nc,self.nr)
235    
236            self.browser.reporter.reportNote("Diagnose window: matrix zoom = %f" % self.zoom)
237          w = int(self.zoom * self.nc);          w = int(self.zoom * self.nc);
238          h = int(self.zoom * self.nr);          h = int(self.zoom * self.nr);
239                            
# Line 246  class DiagnoseWindow: Line 251  class DiagnoseWindow:
251    
252          names = [str(i) for i in self.im.getBlockVars(self.block)]          names = [str(i) for i in self.im.getBlockVars(self.block)]
253    
254          print "NAMES:",names          #print "NAMES:",names
255    
256          if self.varcollapsed.get_active():          if self.varcollapsed.get_active():
257              res = reduce(names)              res = reduce(names)
# Line 273  class DiagnoseWindow: Line 278  class DiagnoseWindow:
278    
279          names = [str(i) for i in rels]          names = [str(i) for i in rels]
280    
281          print "NAMES =",names          #print "NAMES =",names
282    
283          if self.relcollapsed.get_active():          if self.relcollapsed.get_active():
284              res = reduce(names)              res = reduce(names)

Legend:
Removed from v.894  
changed lines
  Added in v.895

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22