########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Friday 13 April 2007 13:52:45 
#    
#       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/Stem_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Stem_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_150 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_150,142,10)
    ReadTable_150.inputPortByName['filename'].widget.set("Data/stem_plot_data.dat", run=False)
    ReadTable_150.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_150.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_150.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_150=None

try:
    ## saving node Stem ##
    from Vision.matplotlibNodes import StemNE
    Stem_151 = StemNE(constrkw = {}, name='Stem', library=matplotliblib)
    masterNet.addNode(Stem_151,166,312)
except:
    print "WARNING: failed to restore StemNE named Stem in network masterNet"
    print_exc()
    Stem_151=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_152 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_152,26,171)
    apply(Index_152.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_152=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_153 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_153,299,176)
    apply(Index_153.inputPortByName['index'].widget.configure, (), {'max': 1})
    Index_153.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_153.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_153=None

masterNet.freeze()

## saving connections for network Stem ##
if ReadTable_150 is not None and Index_152 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_150, Index_152, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_150 and Index_152 in network masterNet"
if ReadTable_150 is not None and Index_153 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_150, Index_153, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_150 and Index_153 in network masterNet"
if Index_152 is not None and Stem_151 is not None:
    try:
        masterNet.connectNodes(
            Index_152, Stem_151, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_152 and Stem_151 in network masterNet"
if Index_153 is not None and Stem_151 is not None:
    try:
        masterNet.connectNodes(
            Index_153, Stem_151, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_153 and Stem_151 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

