########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Friday 13 April 2007 12:40:31 
#    
#       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/Contour-Filled_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Contour-Filled_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 Contour ##
    from Vision.matplotlibNodes import ContourNE
    Contour_16 = ContourNE(constrkw = {}, name='Contour', library=matplotliblib)
    masterNet.addNode(Contour_16,204,296)
    Contour_16.inputPortByName['contour'].widget.set("filledcontour", run=False)
    Contour_16.inputPortByName['length_colors'].widget.set("10", run=False)
    apply(Contour_16.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ContourNE named Contour in network masterNet"
    print_exc()
    Contour_16=None

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

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

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

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

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

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

try:
    ## saving node ColorBar ##
    from Vision.matplotlibNodes import ColorBarNE
    ColorBar_23 = ColorBarNE(constrkw = {}, name='ColorBar', library=matplotliblib)
    masterNet.addNode(ColorBar_23,298,425)
except:
    print "WARNING: failed to restore ColorBarNE named ColorBar in network masterNet"
    print_exc()
    ColorBar_23=None

masterNet.freeze()

## saving connections for network Contour-Filled ##
if ReadTable_17 is not None and As_Type_20 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_17, As_Type_20, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_17 and As_Type_20 in network masterNet"
if ReadTable_18 is not None and As_Type_21 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_18, As_Type_21, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_18 and As_Type_21 in network masterNet"
if ReadTable_19 is not None and As_Type_22 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_19, As_Type_22, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_19 and As_Type_22 in network masterNet"
if As_Type_20 is not None and Contour_16 is not None:
    try:
        masterNet.connectNodes(
            As_Type_20, Contour_16, "outArray", "arraylistx", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_20 and Contour_16 in network masterNet"
if As_Type_21 is not None and Contour_16 is not None:
    try:
        masterNet.connectNodes(
            As_Type_21, Contour_16, "outArray", "arraylisty", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_21 and Contour_16 in network masterNet"
if As_Type_22 is not None and Contour_16 is not None:
    try:
        masterNet.connectNodes(
            As_Type_22, Contour_16, "outArray", "arraylistz", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_22 and Contour_16 in network masterNet"
if Contour_16 is not None and ColorBar_23 is not None:
    try:
        masterNet.connectNodes(
            Contour_16, ColorBar_23, "axes", "plot", blocking=True)
    except:
        print "WARNING: failed to restore connection between Contour_16 and ColorBar_23 in network masterNet"
if Contour_16 is not None and ColorBar_23 is not None:
    try:
        masterNet.connectNodes(
            Contour_16, ColorBar_23, "contour", "current_image", blocking=True)
    except:
        print "WARNING: failed to restore connection between Contour_16 and ColorBar_23 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

