~ubuntu-branches/ubuntu/natty/mgltools-vision/natty

« back to all changes in this revision

Viewing changes to Vision/doc/Examples/matplotlib/DrawArea_net.py

  • Committer: Bazaar Package Importer
  • Author(s): Steffen Moeller
  • Date: 2008-07-31 22:00:08 UTC
  • Revision ID: james.westby@ubuntu.com-20080731220008-broax3qn6pq9ygnb
Tags: upstream-1.5.2.cvs.20080731
ImportĀ upstreamĀ versionĀ 1.5.2.cvs.20080731

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
########################################################################
 
2
#
 
3
#    Vision Network - Python source code - file generated by vision
 
4
#    Wednesday 18 April 2007 08:43:15 
 
5
#    
 
6
#       The Scripps Research Institute (TSRI)
 
7
#       Molecular Graphics Lab
 
8
#       La Jolla, CA 92037, USA
 
9
#
 
10
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
 
11
#   
 
12
# revision: Guillaume Vareille
 
13
#  
 
14
#########################################################################
 
15
#
 
16
# $Header: /opt/cvs/python/packages/share1.5/Vision/doc/Examples/matplotlib/DrawArea_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
 
17
#
 
18
# $Id: DrawArea_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
 
19
#
 
20
 
 
21
from traceback import print_exc
 
22
## loading libraries ##
 
23
from Vision.matplotlibNodes import matplotliblib
 
24
masterNet.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")
 
25
 
 
26
from Vision.StandardNodes import stdlib
 
27
masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")
 
28
 
 
29
try:
 
30
    ## saving node Plot ##
 
31
    from Vision.matplotlibNodes import PlotNE
 
32
    Plot_6 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib)
 
33
    masterNet.addNode(Plot_6,160,342)
 
34
    Plot_6.inputPortByName['color'].widget.set("magenta", run=False)
 
35
    Plot_6.inputPortByName['line_linewidth'].widget.set(3.60555555556, run=False)
 
36
    apply(Plot_6.configure, (), {'expanded': True})
 
37
except:
 
38
    print "WARNING: failed to restore PlotNE named Plot in network masterNet"
 
39
    print_exc()
 
40
    Plot_6=None
 
41
 
 
42
try:
 
43
    ## saving node Draw Area ##
 
44
    from Vision.matplotlibNodes import MPLDrawAreaNE
 
45
    Draw_Area_7 = MPLDrawAreaNE(constrkw = {}, name='Draw Area', library=matplotliblib)
 
46
    masterNet.addNode(Draw_Area_7,312,210)
 
47
    Draw_Area_7.inputPortByName['left'].widget.set(0.158333333333, run=False)
 
48
    Draw_Area_7.inputPortByName['bottom'].widget.set(0.172222222222, run=False)
 
49
    Draw_Area_7.inputPortByName['width'].widget.set(0.663888888889, run=False)
 
50
    Draw_Area_7.inputPortByName['height'].widget.set(0.652777777778, run=False)
 
51
    Draw_Area_7.inputPortByName['title'].widget.set("About as simple as it gets , folks", run=False)
 
52
    Draw_Area_7.inputPortByName['xlabel'].widget.set("time(s)", run=False)
 
53
    Draw_Area_7.inputPortByName['ylabel'].widget.set("voltage(mV)", run=False)
 
54
    Draw_Area_7.inputPortByName['ylimit'].widget.set("[0,1.0]", run=False)
 
55
    Draw_Area_7.inputPortByName['xticklabels'].widget.set(0, run=False)
 
56
    Draw_Area_7.inputPortByName['autoscaleon'].widget.set(0, run=False)
 
57
except:
 
58
    print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet"
 
59
    print_exc()
 
60
    Draw_Area_7=None
 
61
 
 
62
try:
 
63
    ## saving node Index ##
 
64
    from Vision.StandardNodes import Index
 
65
    Index_8 = Index(constrkw = {}, name='Index', library=stdlib)
 
66
    masterNet.addNode(Index_8,5,183)
 
67
    apply(Index_8.configure, (), {'expanded': True})
 
68
except:
 
69
    print "WARNING: failed to restore Index named Index in network masterNet"
 
70
    print_exc()
 
71
    Index_8=None
 
72
 
 
73
try:
 
74
    ## saving node Index ##
 
75
    from Vision.StandardNodes import Index
 
76
    Index_9 = Index(constrkw = {}, name='Index', library=stdlib)
 
77
    masterNet.addNode(Index_9,150,182)
 
78
    apply(Index_9.inputPortByName['index'].widget.configure, (), {'max': 1})
 
79
    Index_9.inputPortByName['index'].widget.set(1, run=False)
 
80
    apply(Index_9.configure, (), {'expanded': True})
 
81
except:
 
82
    print "WARNING: failed to restore Index named Index in network masterNet"
 
83
    print_exc()
 
84
    Index_9=None
 
85
 
 
86
try:
 
87
    ## saving node ReadTable ##
 
88
    from Vision.StandardNodes import ReadTable
 
89
    ReadTable_10 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
 
90
    masterNet.addNode(ReadTable_10,142,33)
 
91
    ReadTable_10.inputPortByName['filename'].widget.set("Data/plot_data.dat", run=False)
 
92
    ReadTable_10.inputPortByName['sep'].widget.set(",", run=False)
 
93
    ReadTable_10.inputPortByName['datatype'].widget.set("float", run=False)
 
94
    apply(ReadTable_10.configure, (), {'expanded': True})
 
95
except:
 
96
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
 
97
    print_exc()
 
98
    ReadTable_10=None
 
99
 
 
100
masterNet.freeze()
 
101
 
 
102
## saving connections for network DrawArea ##
 
103
if Draw_Area_7 is not None and Plot_6 is not None:
 
104
    try:
 
105
        masterNet.connectNodes(
 
106
            Draw_Area_7, Plot_6, "drawAreaDef", "drawAreaDef", blocking=True)
 
107
    except:
 
108
        print "WARNING: failed to restore connection between Draw_Area_7 and Plot_6 in network masterNet"
 
109
if Index_8 is not None and Plot_6 is not None:
 
110
    try:
 
111
        masterNet.connectNodes(
 
112
            Index_8, Plot_6, "data", "y", blocking=True)
 
113
    except:
 
114
        print "WARNING: failed to restore connection between Index_8 and Plot_6 in network masterNet"
 
115
if Index_9 is not None and Plot_6 is not None:
 
116
    try:
 
117
        masterNet.connectNodes(
 
118
            Index_9, Plot_6, "data", "x", blocking=True)
 
119
    except:
 
120
        print "WARNING: failed to restore connection between Index_9 and Plot_6 in network masterNet"
 
121
if ReadTable_10 is not None and Index_8 is not None:
 
122
    try:
 
123
        masterNet.connectNodes(
 
124
            ReadTable_10, Index_8, "data", "data", blocking=True)
 
125
    except:
 
126
        print "WARNING: failed to restore connection between ReadTable_10 and Index_8 in network masterNet"
 
127
if ReadTable_10 is not None and Index_9 is not None:
 
128
    try:
 
129
        masterNet.connectNodes(
 
130
            ReadTable_10, Index_9, "data", "data", blocking=True)
 
131
    except:
 
132
        print "WARNING: failed to restore connection between ReadTable_10 and Index_9 in network masterNet"
 
133
masterNet.unfreeze()
 
134
#masterNet.run()
 
135