Ejemplo n.º 1
0
    ReadTable_26 = ReadTable(constrkw={}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_26, 285, 7)
    ReadTable_26.inputPortByName['filename'].widget.set("Data/plot_data.dat",
                                                        run=False)
    ReadTable_26.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_26.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_26.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_26 = None

try:
    ## saving node Plot ##
    from Vision.matplotlibNodes import PlotNE
    Plot_27 = PlotNE(constrkw={}, name='Plot', library=matplotliblib)
    masterNet.addNode(Plot_27, 313, 350)
    Plot_27.inputPortByName['color'].widget.set("blue", run=False)
    apply(Plot_27.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore PlotNE named Plot in network masterNet"
    print_exc()
    Plot_27 = None

try:
    ## saving node Set Matplotlib options ##
    from Vision.matplotlibNodes import MatPlotLibOptions
    Set_Matplotlib_options_28 = MatPlotLibOptions(
        constrkw={}, name='Set Matplotlib options', library=matplotliblib)
    masterNet.addNode(Set_Matplotlib_options_28, 493, 176)
    Set_Matplotlib_options_28.inputPortByName['matplotlibOptions'].widget.set(
Ejemplo n.º 2
0
    from Vision.StandardNodes import ReadTable
    ReadTable_56 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_56,232,7)
    ReadTable_56.inputPortByName['filename'].widget.set("Data/legend_data.dat", run=False)
    ReadTable_56.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_56.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_56.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_56=None

try:
    ## saving node Plot ##
    from Vision.matplotlibNodes import PlotNE
    Plot_57 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib)
    masterNet.addNode(Plot_57,31,351)
    Plot_57.inputPortByName['lineStyle'].widget.set("dotted", run=False)
    apply(Plot_57.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore PlotNE named Plot in network masterNet"
    print_exc()
    Plot_57=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_58 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_58,215,173)
    apply(Index_58.inputPortByName['index'].widget.configure, (), {'max': 4})
    Index_58.inputPortByName['index'].widget.set(2, run=False)
Ejemplo n.º 3
0
    from Vision.StandardNodes import ReadTable
    ReadTable_0 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_0,138,9)
    ReadTable_0.inputPortByName['filename'].widget.set("Vision/Examples/matplotlib/Data/legend_data.dat", run=False)
    ReadTable_0.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_0.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_0.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_0=None

try:
    ## saving node Plot ##
    from Vision.matplotlibNodes import PlotNE
    Plot_1 = PlotNE(constrkw = {}, name='Plot', library=matplotliblib)
    masterNet.addNode(Plot_1,4,321)
    Plot_1.inputPortByName['lineStyle'].widget.set("dotted", run=False)
    apply(Plot_1.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore PlotNE named Plot in network masterNet"
    print_exc()
    Plot_1=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_2 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_2,17,153)
    apply(Index_2.inputPortByName['index'].widget.configure, (), {'max': 3})
    Index_2.inputPortByName['index'].widget.set(2, run=False)
Ejemplo n.º 4
0
    def afterAddingToNetwork(self):
        masterNet = self.macroNetwork
        from NetworkEditor.macros import MacroNode
        MacroNode.afterAddingToNetwork(self)
        ## loading libraries ##
        from Vision.matplotlibNodes import matplotliblib
        from MyDefaultLib import mydefaultlib
        ## building macro network ##
        plotAbsFFT_0 = self
        from traceback import print_exc
        ## loading libraries ##
        from Vision.matplotlibNodes import matplotliblib
        self.macroNetwork.getEditor().addLibraryInstance(
            matplotliblib, "Vision.matplotlibNodes", "matplotliblib")

        from MyDefaultLib import mydefaultlib
        self.macroNetwork.getEditor().addLibraryInstance(
            mydefaultlib, "MyDefaultLib", "mydefaultlib")

        try:
            ## saving node input Ports ##
            input_Ports_1 = self.macroNetwork.ipNode
        except:
            print "WARNING: failed to restore MacroInputNode named input Ports in network self.macroNetwork"
            print_exc()
            input_Ports_1 = None

        try:
            ## saving node output Ports ##
            output_Ports_2 = self.macroNetwork.opNode
        except:
            print "WARNING: failed to restore MacroOutputNode named output Ports in network self.macroNetwork"
            print_exc()
            output_Ports_2 = None

        try:
            ## saving node Plot ##
            from Vision.matplotlibNodes import PlotNE
            Plot_3 = PlotNE(constrkw={}, name='Plot', library=matplotliblib)
            self.macroNetwork.addNode(Plot_3, 220, 210)
        except:
            print "WARNING: failed to restore PlotNE named Plot in network self.macroNetwork"
            print_exc()
            Plot_3 = None

        try:
            ## saving node absFFT ##
            from MyDefaultLib.signal.absFFT import absFFT
            absFFT_4 = absFFT(constrkw={}, name='absFFT', library=mydefaultlib)
            self.macroNetwork.addNode(absFFT_4, 202, 122)
            apply(absFFT_4.inputPortByName['data'].configure, (),
                  {'color': 'white'})
            apply(absFFT_4.inputPortByName['fs'].configure, (),
                  {'color': 'white'})
            apply(absFFT_4.inputPortByName['nfft'].configure, (), {
                'color': 'white',
                'shape': 'diamond'
            })
        except:
            print "WARNING: failed to restore absFFT named absFFT in network self.macroNetwork"
            print_exc()
            absFFT_4 = None

        self.macroNetwork.run()
        self.macroNetwork.freeze()

        ## saving connections for network plotAbsFFT ##
        if absFFT_4 is not None and Plot_3 is not None:
            try:
                self.macroNetwork.connectNodes(absFFT_4,
                                               Plot_3,
                                               "out0",
                                               "y",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between absFFT_4 and Plot_3 in network self.macroNetwork"
        if absFFT_4 is not None and Plot_3 is not None:
            try:
                self.macroNetwork.connectNodes(absFFT_4,
                                               Plot_3,
                                               "freqs",
                                               "x",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between absFFT_4 and Plot_3 in network self.macroNetwork"
        input_Ports_1 = self.macroNetwork.ipNode
        if input_Ports_1 is not None and absFFT_4 is not None:
            try:
                self.macroNetwork.connectNodes(input_Ports_1,
                                               absFFT_4,
                                               "new",
                                               "data",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and absFFT_4 in network self.macroNetwork"
        if input_Ports_1 is not None and absFFT_4 is not None:
            try:
                self.macroNetwork.connectNodes(input_Ports_1,
                                               absFFT_4,
                                               "new",
                                               "fs",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between input_Ports_1 and absFFT_4 in network self.macroNetwork"
        output_Ports_2 = self.macroNetwork.opNode
        if Plot_3 is not None and output_Ports_2 is not None:
            try:
                self.macroNetwork.connectNodes(Plot_3,
                                               output_Ports_2,
                                               "plot",
                                               "new",
                                               blocking=True)
            except:
                print "WARNING: failed to restore connection between Plot_3 and output_Ports_2 in network self.macroNetwork"
        self.macroNetwork.unfreeze()

        #self.macroNetwork.run()

        plotAbsFFT_0.shrink()

        ## reset modifications ##
        plotAbsFFT_0.resetTags()
        plotAbsFFT_0.buildOriginalList()