########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Monday 16 April 2007 14:08:32 
#    
#       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/ScatterClassic_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: ScatterClassic_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_12 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_12,108,57)
    ReadTable_12.inputPortByName['filename'].widget.set("Data/scatter_data.dat", run=False)
    ReadTable_12.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_12.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_12.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_12=None

try:
    ## saving node ScatterClassic ##
    from Vision.matplotlibNodes import ScatterClassicNE
    ScatterClassic_13 = ScatterClassicNE(constrkw = {}, name='ScatterClassic', library=matplotliblib)
    masterNet.addNode(ScatterClassic_13,118,363)
    ScatterClassic_13.inputPortByName['s'].widget.set(0.0377777777778, run=False)
    ScatterClassic_13.inputPortByName['c'].widget.set("g", run=False)
    apply(ScatterClassic_13.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ScatterClassicNE named ScatterClassic in network masterNet"
    print_exc()
    ScatterClassic_13=None

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

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

masterNet.freeze()

## saving connections for network ScatterClassic ##
if ReadTable_12 is not None and Index_14 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_12, Index_14, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_12 and Index_14 in network masterNet"
if ReadTable_12 is not None and Index_15 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_12, Index_15, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_12 and Index_15 in network masterNet"
if Index_14 is not None and ScatterClassic_13 is not None:
    try:
        masterNet.connectNodes(
            Index_14, ScatterClassic_13, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_14 and ScatterClassic_13 in network masterNet"
if Index_15 is not None and ScatterClassic_13 is not None:
    try:
        masterNet.connectNodes(
            Index_15, ScatterClassic_13, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_15 and ScatterClassic_13 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

