########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Friday 13 April 2007 13:50:48 
#    
#       The Scripps Research Institute (TSRI)
#       Molecular Graphics Lab
#       La Jolla, CA 92037, USA
#
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
#   
# revision: Guillaume Vareille
#  
#########################################################################
#
# $Header: /opt/cvs/python/packages/share1.5/Vision/doc/Examples/matplotlib/Spy_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Spy_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#

from traceback import print_exc
## loading libraries ##
from Vision.matplotlibNodes import matplotliblib
masterNet.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")

from Vision.StandardNodes import stdlib
masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")

try:
    ## saving node ReadTable ##
    from Vision.StandardNodes import ReadTable
    ReadTable_147 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_147,69,33)
    ReadTable_147.inputPortByName['filename'].widget.set("Data/spy_data.dat", run=False)
    ReadTable_147.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_147.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_147.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_147=None

try:
    ## saving node As Type ##
    from Vision.StandardNodes import AsType
    As_Type_148 = AsType(constrkw = {}, name='As Type', library=stdlib)
    masterNet.addNode(As_Type_148,143,199)
    apply(As_Type_148.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore AsType named As Type in network masterNet"
    print_exc()
    As_Type_148=None

try:
    ## saving node Spy ##
    from Vision.matplotlibNodes import SpyNE
    Spy_149 = SpyNE(constrkw = {}, name='Spy', library=matplotliblib)
    masterNet.addNode(Spy_149,78,292)
except:
    print "WARNING: failed to restore SpyNE named Spy in network masterNet"
    print_exc()
    Spy_149=None

masterNet.freeze()

## saving connections for network Spy ##
if ReadTable_147 is not None and As_Type_148 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_147, As_Type_148, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_147 and As_Type_148 in network masterNet"
if As_Type_148 is not None and Spy_149 is not None:
    try:
        masterNet.connectNodes(
            As_Type_148, Spy_149, "outArray", "Z", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_148 and Spy_149 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

