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

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

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

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

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

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

try:
    ## saving node Pcolor ##
    from Vision.matplotlibNodes import PcolorNE
    Pcolor_91 = PcolorNE(constrkw = {}, name='Pcolor', library=matplotliblib)
    masterNet.addNode(Pcolor_91,218,339)
except:
    print "WARNING: failed to restore PcolorNE named Pcolor in network masterNet"
    print_exc()
    Pcolor_91=None

masterNet.freeze()

## saving connections for network Pcolor ##
if ReadTable_85 is not None and As_Type_86 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_85, As_Type_86, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_85 and As_Type_86 in network masterNet"
if ReadTable_87 is not None and As_Type_89 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_87, As_Type_89, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_87 and As_Type_89 in network masterNet"
if ReadTable_88 is not None and As_Type_90 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_88, As_Type_90, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_88 and As_Type_90 in network masterNet"
if As_Type_89 is not None and Pcolor_91 is not None:
    try:
        masterNet.connectNodes(
            As_Type_89, Pcolor_91, "outArray", "arraylistx", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_89 and Pcolor_91 in network masterNet"
if As_Type_90 is not None and Pcolor_91 is not None:
    try:
        masterNet.connectNodes(
            As_Type_90, Pcolor_91, "outArray", "arraylisty", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_90 and Pcolor_91 in network masterNet"
if As_Type_86 is not None and Pcolor_91 is not None:
    try:
        masterNet.connectNodes(
            As_Type_86, Pcolor_91, "outArray", "arraylistz", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_86 and Pcolor_91 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

