########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Friday 13 April 2007 13:24: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/Log_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Log_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 LogCurve ##
    from Vision.matplotlibNodes import LogCurveNE
    LogCurve_69 = LogCurveNE(constrkw = {}, name='LogCurve', library=matplotliblib)
    masterNet.addNode(LogCurve_69,109,300)
except:
    print "WARNING: failed to restore LogCurveNE named LogCurve in network masterNet"
    print_exc()
    LogCurve_69=None

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

try:
    ## saving node Set Matplotlib options ##
    from Vision.matplotlibNodes import MatPlotLibOptions
    Set_Matplotlib_options_71 = MatPlotLibOptions(constrkw = {}, name='Set Matplotlib options', library=matplotliblib)
    masterNet.addNode(Set_Matplotlib_options_71,366,218)
    Set_Matplotlib_options_71.inputPortByName['matplotlibOptions'].widget.set({'gridOn': 1, 'whichgrid': 'minor'}, run=False)
except:
    print "WARNING: failed to restore MatPlotLibOptions named Set Matplotlib options in network masterNet"
    print_exc()
    Set_Matplotlib_options_71=None

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

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

masterNet.freeze()

## saving connections for network Log ##
if Set_Matplotlib_options_71 is not None and LogCurve_69 is not None:
    try:
        masterNet.connectNodes(
            Set_Matplotlib_options_71, LogCurve_69, "matplotlibOptions", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Set_Matplotlib_options_71 and LogCurve_69 in network masterNet"
if ReadTable_70 is not None and Index_72 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_70, Index_72, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_70 and Index_72 in network masterNet"
if ReadTable_70 is not None and Index_73 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_70, Index_73, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_70 and Index_73 in network masterNet"
if Index_72 is not None and LogCurve_69 is not None:
    try:
        masterNet.connectNodes(
            Index_72, LogCurve_69, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_72 and LogCurve_69 in network masterNet"
if Index_73 is not None and LogCurve_69 is not None:
    try:
        masterNet.connectNodes(
            Index_73, LogCurve_69, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_73 and LogCurve_69 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

