예제 #1
0
def createPlot(resp):
    if resp == 'Line':
        return sb.LinePlot()
    elif resp == 'Line (PSD)':
        return sb.LinePSD()
    elif resp == 'Raster':
        return sb.RasterPlot()
    elif resp == 'Raster (PSD)':
        return sb.RasterPSD()
#                   sigGen -> SinkSDDS -> SourceSDDS -> plot
#                          |
#                          -> plot
#############################################################################
from ossie.utils import sb

# connect sig gen to an SDDS sender
siggen = sb.launch('rh.SigGen')
sdds_out = sb.launch('rh.SinkSDDS')
sdds_out.network_settings.interface = 'lo'
sdds_out.network_settings.ip_address = '127.0.0.1'  #sender IP
sdds_out.network_settings.port = 29000
siggen.connect(sdds_out, providesPortName="dataFloatIn")

# test to make sure sig gen is running
sgplot = sb.LinePlot()
siggen.connect(sgplot, providesPortName="floatIn")

sdds_in = sb.launch("rh.SourceSDDS")
sdds_in.interface = "lo"

## SOURCESDDS connection method #1
# this is not necessary if you connect BULKIO ports
#sdds_in.attachment_override.ip_address='127.0.0.1' #sender IP
#sdds_in.attachment_override.port=29000
#sdds_in.attachment_override.enabled=True

## SOURCESDDS connection method #2
## connect SDDS sender (sink) to receiver (source) blocks
## this is not necessary if you do attach override
sdds_out.connect(sdds_in, providesPortName='dataSddsIn')
#!/usr/bin/python -i
############################################################################
#                   sigGen -> SinkV49 -> SourceV49 -> plot
#                          |
#                          -> plot
#
#     THE SAD.xml file is from the REDHAWK repos installed by default
#     on CentOS
#############################################################################
from ossie.utils import sb

sb.loadSADFile(
    '/var/redhawk/sdr/dom/waveforms/rh/vita49_loopback_demo/vita49_loopback_demo.sad.xml'
)
siggen = sb.getComponent('SigGen_1')
v49_out = sb.getComponent('SinkVITA49_1')
v49_in = sb.getComponent('SourceVITA49_1')

# test to make sure sig gen is running
sgplot = sb.LinePlot()
siggen.connect(sgplot, providesPortName="floatIn")

# see the data flowing through the source.
v49plot = sb.LinePlot()
v49_in.connect(v49plot, providesPortName="floatIn")

sb.start()
예제 #4
0
#!/usr/bin/python -i
############################################################################
# Container 1:                         # Container 2
#                                      #
#                   sigGen -> SinkSDDS #  SourceSDDS -> plot
#                          |           #
#                          -> plot     #
#                                      #
#############################################################################
#
#                         Wireshark on docker0 interface
#                         to see traffic traverse the gateway
#############################################################################

##CONTAINER 1##
from ossie.utils import sb

# connect sig gen to an SDDS sender
siggen = sb.launch('rh.SigGen')
sdds_out = sb.launch('rh.SinkSDDS')
sdds_out.network_settings.interface = 'eth0'
sdds_out.network_settings.ip_address = '172.17.0.3'  #receiver IP
sdds_out.network_settings.port = 29000
siggen.connect(sdds_out, providesPortName="dataFloatIn")

# test to make sure sig gen is running
sgplot = sb.LinePlot()
siggen.connect(sgplot, providesPortName="floatIn")

sb.start()