########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Friday 13 April 2007 13:33:57 
#    
#       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/Pie_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Pie_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 Pie ##
    from Vision.matplotlibNodes import PieNE
    Pie_106 = PieNE(constrkw = {}, name='Pie', library=matplotliblib)
    masterNet.addNode(Pie_106,89,318)
    Pie_106.inputPortByName['shadow'].widget.set(0, run=False)
    apply(Pie_106.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore PieNE named Pie in network masterNet"
    print_exc()
    Pie_106=None

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

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

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

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

masterNet.freeze()

## saving connections for network Pie ##
if ReadTable_108 is not None and Index_109 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_108, Index_109, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_108 and Index_109 in network masterNet"
if Index_109 is not None and Pie_106 is not None:
    try:
        masterNet.connectNodes(
            Index_109, Pie_106, "data", "fractions", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_109 and Pie_106 in network masterNet"
if ReadTable_107 is not None and Index_110 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_107, Index_110, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_107 and Index_110 in network masterNet"
if Index_110 is not None and Pie_106 is not None:
    try:
        masterNet.connectNodes(
            Index_110, Pie_106, "data", "labels", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_110 and Pie_106 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

