########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Monday 16 April 2007 09:58:52 
#    
#       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-semixy_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Log-semixy_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_21 = LogCurveNE(constrkw = {}, name='LogCurve', library=matplotliblib)
    masterNet.addNode(LogCurve_21,84,469)
except:
    print "WARNING: failed to restore LogCurveNE named LogCurve in network masterNet"
    print_exc()
    LogCurve_21=None

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

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

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

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

try:
    ## saving node Semilogx ##
    from Vision.matplotlibNodes import SemilogxNE
    Semilogx_26 = SemilogxNE(constrkw = {}, name='Semilogx', library=matplotliblib)
    masterNet.addNode(Semilogx_26,232,461)
except:
    print "WARNING: failed to restore SemilogxNE named Semilogx in network masterNet"
    print_exc()
    Semilogx_26=None

try:
    ## saving node Semilogy ##
    from Vision.matplotlibNodes import SemilogyNE
    Semilogy_27 = SemilogyNE(constrkw = {}, name='Semilogy', library=matplotliblib)
    masterNet.addNode(Semilogy_27,373,458)
except:
    print "WARNING: failed to restore SemilogyNE named Semilogy in network masterNet"
    print_exc()
    Semilogy_27=None

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

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

try:
    ## saving node Draw Area ##
    from Vision.matplotlibNodes import MPLDrawAreaNE
    Draw_Area_30 = MPLDrawAreaNE(constrkw = {}, name='Draw Area', library=matplotliblib)
    masterNet.addNode(Draw_Area_30,515,321)
    Draw_Area_30.inputPortByName['bottom'].widget.set(0.683333333333, run=False)
    Draw_Area_30.inputPortByName['height'].widget.set(0.286111111111, run=False)
    Draw_Area_30.inputPortByName['title'].widget.set("", run=False)
    Draw_Area_30.inputPortByName['xlabel'].widget.set("", run=False)
    Draw_Area_30.inputPortByName['ylabel'].widget.set("Semilogy", run=False)
except:
    print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet"
    print_exc()
    Draw_Area_30=None

try:
    ## saving node Draw Area ##
    from Vision.matplotlibNodes import MPLDrawAreaNE
    Draw_Area_31 = MPLDrawAreaNE(constrkw = {}, name='Draw Area', library=matplotliblib)
    masterNet.addNode(Draw_Area_31,367,325)
    Draw_Area_31.inputPortByName['bottom'].widget.set(0.397222222222, run=False)
    Draw_Area_31.inputPortByName['height'].widget.set(0.25, run=False)
    Draw_Area_31.inputPortByName['title'].widget.set("", run=False)
    Draw_Area_31.inputPortByName['xlabel'].widget.set("", run=False)
    Draw_Area_31.inputPortByName['ylabel'].widget.set("Semilogx", run=False)
except:
    print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet"
    print_exc()
    Draw_Area_31=None

try:
    ## saving node Figure ##
    from Vision.matplotlibNodes import MPLFigureNE
    Figure_32 = MPLFigureNE(constrkw = {}, name='Figure', library=matplotliblib)
    masterNet.addNode(Figure_32,235,572)
    Figure_32.inputPortByName['packOpts'].widget.set("{'side':'top', 'fill':'both', 'expand':1}", run=False)
except:
    print "WARNING: failed to restore MPLFigureNE named Figure in network masterNet"
    print_exc()
    Figure_32=None

try:
    ## saving node Draw Area ##
    from Vision.matplotlibNodes import MPLDrawAreaNE
    Draw_Area_33 = MPLDrawAreaNE(constrkw = {}, name='Draw Area', library=matplotliblib)
    masterNet.addNode(Draw_Area_33,6,337)
    Draw_Area_33.inputPortByName['height'].widget.set(0.25, run=False)
    Draw_Area_33.inputPortByName['title'].widget.set("", run=False)
    Draw_Area_33.inputPortByName['xlabel'].widget.set("", run=False)
    Draw_Area_33.inputPortByName['ylabel'].widget.set("Log", run=False)
except:
    print "WARNING: failed to restore MPLDrawAreaNE named Draw Area in network masterNet"
    print_exc()
    Draw_Area_33=None

masterNet.freeze()

## saving connections for network Log-semixy ##
if Set_Matplotlib_options_23 is not None and LogCurve_21 is not None:
    try:
        masterNet.connectNodes(
            Set_Matplotlib_options_23, LogCurve_21, "matplotlibOptions", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Set_Matplotlib_options_23 and LogCurve_21 in network masterNet"
if ReadTable_22 is not None and Index_24 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_22, Index_24, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_22 and Index_24 in network masterNet"
if ReadTable_22 is not None and Index_25 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_22, Index_25, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_22 and Index_25 in network masterNet"
if Index_24 is not None and LogCurve_21 is not None:
    try:
        masterNet.connectNodes(
            Index_24, LogCurve_21, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_24 and LogCurve_21 in network masterNet"
if Index_25 is not None and LogCurve_21 is not None:
    try:
        masterNet.connectNodes(
            Index_25, LogCurve_21, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_25 and LogCurve_21 in network masterNet"
if ReadTable_22 is not None and Index_28 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_22, Index_28, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_22 and Index_28 in network masterNet"
if ReadTable_22 is not None and Index_29 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_22, Index_29, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_22 and Index_29 in network masterNet"
if Index_28 is not None and Semilogy_27 is not None:
    try:
        masterNet.connectNodes(
            Index_28, Semilogy_27, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_28 and Semilogy_27 in network masterNet"
if Index_24 is not None and Semilogx_26 is not None:
    try:
        masterNet.connectNodes(
            Index_24, Semilogx_26, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_24 and Semilogx_26 in network masterNet"
if Index_24 is not None and Semilogy_27 is not None:
    try:
        masterNet.connectNodes(
            Index_24, Semilogy_27, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_24 and Semilogy_27 in network masterNet"
if Index_29 is not None and Semilogx_26 is not None:
    try:
        masterNet.connectNodes(
            Index_29, Semilogx_26, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_29 and Semilogx_26 in network masterNet"
if Draw_Area_30 is not None and Semilogy_27 is not None:
    try:
        masterNet.connectNodes(
            Draw_Area_30, Semilogy_27, "drawAreaDef", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Draw_Area_30 and Semilogy_27 in network masterNet"
if Draw_Area_31 is not None and Semilogx_26 is not None:
    try:
        masterNet.connectNodes(
            Draw_Area_31, Semilogx_26, "drawAreaDef", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Draw_Area_31 and Semilogx_26 in network masterNet"
if Semilogx_26 is not None and Figure_32 is not None:
    try:
        masterNet.connectNodes(
            Semilogx_26, Figure_32, "axes", "plots", blocking=True)
    except:
        print "WARNING: failed to restore connection between Semilogx_26 and Figure_32 in network masterNet"
if Semilogy_27 is not None and Figure_32 is not None:
    try:
        masterNet.connectNodes(
            Semilogy_27, Figure_32, "axes", "plots", blocking=True)
    except:
        print "WARNING: failed to restore connection between Semilogy_27 and Figure_32 in network masterNet"
if Draw_Area_33 is not None and LogCurve_21 is not None:
    try:
        masterNet.connectNodes(
            Draw_Area_33, LogCurve_21, "drawAreaDef", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Draw_Area_33 and LogCurve_21 in network masterNet"
if LogCurve_21 is not None and Figure_32 is not None:
    try:
        masterNet.connectNodes(
            LogCurve_21, Figure_32, "axes", "plots", blocking=True)
    except:
        print "WARNING: failed to restore connection between LogCurve_21 and Figure_32 in network masterNet"
if Set_Matplotlib_options_23 is not None and Semilogy_27 is not None:
    try:
        masterNet.connectNodes(
            Set_Matplotlib_options_23, Semilogy_27, "matplotlibOptions", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Set_Matplotlib_options_23 and Semilogy_27 in network masterNet"
if Set_Matplotlib_options_23 is not None and Semilogx_26 is not None:
    try:
        masterNet.connectNodes(
            Set_Matplotlib_options_23, Semilogx_26, "matplotlibOptions", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Set_Matplotlib_options_23 and Semilogx_26 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

