/[ascend]/trunk/pygtk/canvas/blocklist.py
ViewVC logotype

Diff of /trunk/pygtk/canvas/blocklist.py

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

revision 1983 by jpye, Tue Jan 13 01:08:34 2009 UTC revision 1984 by jpye, Wed Jan 21 22:56:28 2009 UTC
# Line 5  import os, sys Line 5  import os, sys
5  os.chdir(os.path.abspath(os.path.dirname(sys.argv[0])))  os.chdir(os.path.abspath(os.path.dirname(sys.argv[0])))
6    
7  os.environ['ASCENDLIBRARY'] = "../../models"  os.environ['ASCENDLIBRARY'] = "../../models"
8    os.environ['ASCENDSOLVERS'] = "../../solvers/qrslv"
9    
10  if sys.platform.startswith("win"):  if sys.platform.startswith("win"):
11      os.environ['PATH'] += ";..\.."      os.environ['PATH'] += ";..\.."
# Line 151  def BlockToolChain(): Line 152  def BlockToolChain():
152      chain.append(ContextMenuTool()) # right-click      chain.append(ContextMenuTool()) # right-click
153      chain.append(LineSegmentTool()) # for moving line 'elbows'      chain.append(LineSegmentTool()) # for moving line 'elbows'
154      chain.append(ItemTool())      chain.append(ItemTool())
     chain.append(ZoomTool())  
155      chain.append(PanTool())      chain.append(PanTool())
156        chain.append(ZoomTool())
157      chain.append(RubberbandTool())      chain.append(RubberbandTool())
158      return chain      return chain
159    
# Line 291  class app(gtk.Window): Line 292  class app(gtk.Window):
292              self.load_canvas(None)              self.load_canvas(None)
293          elif key == 'V' or key == 'v':          elif key == 'V' or key == 'v':
294              self.preview_canvas(None)              self.preview_canvas(None)
295            elif key == 'X' or key == 'x':
296                self.run_canvas(None)
297    
298    
299      def debug_canvas(self,widget):      def debug_canvas(self,widget):
# Line 313  class app(gtk.Window): Line 316  class app(gtk.Window):
316          try:          try:
317              pickle.dump(self.view.canvas,f)              pickle.dump(self.view.canvas,f)
318          except Exception,e:          except Exception,e:
319                print "ERROR:",str(e)
320              import obrowser              import obrowser
321              b = obrowser.Browser("canvas",self.view.canvas)              b = obrowser.Browser("canvas",self.view.canvas)
322              d = gtk.Dialog("Error",self,gtk.DIALOG_DESTROY_WITH_PARENT,              d = gtk.Dialog("Error",self,gtk.DIALOG_DESTROY_WITH_PARENT,
# Line 359  class app(gtk.Window): Line 363  class app(gtk.Window):
363          model = str(self.view.canvas)          model = str(self.view.canvas)
364          print model          print model
365          print "RUN NOT IMPLEMENTED"          print "RUN NOT IMPLEMENTED"
366            L.loadString(model,"canvasmodel")
367            T = L.findType("canvasmodel")
368            M = T.getSimulation('canvassim')
369            M.setSolver(ascpy.Solver("QRSlv"))
370            M.solve(ascpy.Solver("QRSlv"),ascpy.SolverReporter())  
371            
372                    
373                
374  a = app()  a = app()

Legend:
Removed from v.1983  
changed lines
  Added in v.1984

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