########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Tuesday 17 April 2007 09:19:49 
#    
#       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/SinFunc_net.py,v 1.2 2007/08/29 20:37:16 vareille Exp $
#
# $Id: SinFunc_net.py,v 1.2 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")

try:
    ## saving node SinFunc ##
    from Vision.matplotlibNodes import SinFunc
    SinFunc_10 = SinFunc(constrkw = {}, name='SinFunc', library=matplotliblib)
    masterNet.addNode(SinFunc_10,82,23)
    apply(SinFunc_10.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore SinFunc named SinFunc in network masterNet"
    print_exc()
    SinFunc_10=None

try:
    ## saving node Plot ##
    from Vision.matplotlibNodes import PlotNE
    Plot_11 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib)
    masterNet.addNode(Plot_11,158,186)
    apply(Plot_11.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore PlotNE named Plot in network masterNet"
    print_exc()
    Plot_11=None

masterNet.freeze()

## saving connections for network RandomNormDist ##
if SinFunc_10 is not None and Plot_11 is not None:
    try:
        masterNet.connectNodes(
            SinFunc_10, Plot_11, "x", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between SinFunc_10 and Plot_11 in network masterNet"
if SinFunc_10 is not None and Plot_11 is not None:
    try:
        masterNet.connectNodes(
            SinFunc_10, Plot_11, "y", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between SinFunc_10 and Plot_11 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

