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

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

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

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

try:
    ## saving node As Type ##
    from Vision.StandardNodes import AsType
    As_Type_103 = AsType(constrkw = {}, name='As Type', library=stdlib)
    masterNet.addNode(As_Type_103,60,191)
except:
    print "WARNING: failed to restore AsType named As Type in network masterNet"
    print_exc()
    As_Type_103=None

try:
    ## saving node As Type ##
    from Vision.StandardNodes import AsType
    As_Type_104 = AsType(constrkw = {}, name='As Type', library=stdlib)
    masterNet.addNode(As_Type_104,213,196)
except:
    print "WARNING: failed to restore AsType named As Type in network masterNet"
    print_exc()
    As_Type_104=None

try:
    ## saving node PcolorMesh ##
    from Vision.matplotlibNodes import PcolorMeshNE
    PcolorMesh_105 = PcolorMeshNE(constrkw = {}, name='PcolorMesh', library=matplotliblib)
    masterNet.addNode(PcolorMesh_105,201,274)
except:
    print "WARNING: failed to restore PcolorMeshNE named PcolorMesh in network masterNet"
    print_exc()
    PcolorMesh_105=None

masterNet.freeze()

## saving connections for network PcolorMesh ##
if ReadTable_99 is not None and As_Type_100 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_99, As_Type_100, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_99 and As_Type_100 in network masterNet"
if ReadTable_101 is not None and As_Type_103 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_101, As_Type_103, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_101 and As_Type_103 in network masterNet"
if ReadTable_102 is not None and As_Type_104 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_102, As_Type_104, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_102 and As_Type_104 in network masterNet"
if As_Type_103 is not None and PcolorMesh_105 is not None:
    try:
        masterNet.connectNodes(
            As_Type_103, PcolorMesh_105, "outArray", "arraylistx", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_103 and PcolorMesh_105 in network masterNet"
if As_Type_104 is not None and PcolorMesh_105 is not None:
    try:
        masterNet.connectNodes(
            As_Type_104, PcolorMesh_105, "outArray", "arraylisty", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_104 and PcolorMesh_105 in network masterNet"
if As_Type_100 is not None and PcolorMesh_105 is not None:
    try:
        masterNet.connectNodes(
            As_Type_100, PcolorMesh_105, "outArray", "arraylistz", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_100 and PcolorMesh_105 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

