########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Friday 13 April 2007 15:51:47 
#    
#       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.2 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Log_semixy_net.py,v 1.2 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_199 = LogCurveNE(constrkw = {}, name='LogCurve', library=matplotliblib)
    masterNet.addNode(LogCurve_199,101,464)
except:
    print "WARNING: failed to restore LogCurveNE named LogCurve in network masterNet"
    print_exc()
    LogCurve_199=None

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

try:
    ## saving node Set Matplotlib options ##
    from Vision.matplotlibNodes import MatPlotLibOptions
    Set_Matplotlib_options_201 = MatPlotLibOptions(constrkw = {}, name='Set Matplotlib options', library=matplotliblib)
    masterNet.addNode(Set_Matplotlib_options_201,212,363)
    Set_Matplotlib_options_201.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_201=None

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

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

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

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

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

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

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

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

try:
    ## saving node Figure ##
    from Vision.matplotlibNodes import MPLFigureNE
    Figure_210 = MPLFigureNE(constrkw = {}, name='Figure', library=matplotliblib)
    masterNet.addNode(Figure_210,288,567)
    Figure_210.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_210=None

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

masterNet.freeze()

## saving connections for network Log ##
if Set_Matplotlib_options_201 is not None and LogCurve_199 is not None:
    try:
        masterNet.connectNodes(
            Set_Matplotlib_options_201, LogCurve_199, "matplotlibOptions", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Set_Matplotlib_options_201 and LogCurve_199 in network masterNet"
if ReadTable_200 is not None and Index_202 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_200, Index_202, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_200 and Index_202 in network masterNet"
if ReadTable_200 is not None and Index_203 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_200, Index_203, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_200 and Index_203 in network masterNet"
if Index_202 is not None and LogCurve_199 is not None:
    try:
        masterNet.connectNodes(
            Index_202, LogCurve_199, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_202 and LogCurve_199 in network masterNet"
if Index_203 is not None and LogCurve_199 is not None:
    try:
        masterNet.connectNodes(
            Index_203, LogCurve_199, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_203 and LogCurve_199 in network masterNet"
if ReadTable_200 is not None and Index_206 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_200, Index_206, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_200 and Index_206 in network masterNet"
if ReadTable_200 is not None and Index_207 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_200, Index_207, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_200 and Index_207 in network masterNet"
if Index_206 is not None and Semilogy_205 is not None:
    try:
        masterNet.connectNodes(
            Index_206, Semilogy_205, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_206 and Semilogy_205 in network masterNet"
if Index_202 is not None and Semilogx_204 is not None:
    try:
        masterNet.connectNodes(
            Index_202, Semilogx_204, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_202 and Semilogx_204 in network masterNet"
if Index_202 is not None and Semilogy_205 is not None:
    try:
        masterNet.connectNodes(
            Index_202, Semilogy_205, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_202 and Semilogy_205 in network masterNet"
if Index_207 is not None and Semilogx_204 is not None:
    try:
        masterNet.connectNodes(
            Index_207, Semilogx_204, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_207 and Semilogx_204 in network masterNet"
if Draw_Area_208 is not None and Semilogy_205 is not None:
    try:
        masterNet.connectNodes(
            Draw_Area_208, Semilogy_205, "drawAreaDef", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Draw_Area_208 and Semilogy_205 in network masterNet"
if Set_Matplotlib_options_201 is not None and Semilogy_205 is not None:
    try:
        masterNet.connectNodes(
            Set_Matplotlib_options_201, Semilogy_205, "matplotlibOptions", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Set_Matplotlib_options_201 and Semilogy_205 in network masterNet"
if Set_Matplotlib_options_201 is not None and Semilogx_204 is not None:
    try:
        masterNet.connectNodes(
            Set_Matplotlib_options_201, Semilogx_204, "matplotlibOptions", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Set_Matplotlib_options_201 and Semilogx_204 in network masterNet"
if Draw_Area_209 is not None and Semilogx_204 is not None:
    try:
        masterNet.connectNodes(
            Draw_Area_209, Semilogx_204, "drawAreaDef", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Draw_Area_209 and Semilogx_204 in network masterNet"
if Semilogx_204 is not None and Figure_210 is not None:
    try:
        masterNet.connectNodes(
            Semilogx_204, Figure_210, "axes", "plots", blocking=True)
    except:
        print "WARNING: failed to restore connection between Semilogx_204 and Figure_210 in network masterNet"
if Semilogy_205 is not None and Figure_210 is not None:
    try:
        masterNet.connectNodes(
            Semilogy_205, Figure_210, "axes", "plots", blocking=True)
    except:
        print "WARNING: failed to restore connection between Semilogy_205 and Figure_210 in network masterNet"
if Draw_Area_211 is not None and LogCurve_199 is not None:
    try:
        masterNet.connectNodes(
            Draw_Area_211, LogCurve_199, "drawAreaDef", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Draw_Area_211 and LogCurve_199 in network masterNet"
if LogCurve_199 is not None and Figure_210 is not None:
    try:
        masterNet.connectNodes(
            LogCurve_199, Figure_210, "axes", "plots", blocking=True)
    except:
        print "WARNING: failed to restore connection between LogCurve_199 and Figure_210 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

