def sig_source_f(sampling_freq=10000.0, waveform=101, frequency=10.0, amplitude=100.0, offset=0.0): c = sb.Component(components_dir + 'sig_source_f/sig_source_f.spd.xml', execparams=execparams) c.waveform = waveform c.frequency = frequency c.sampling_freq = sampling_freq c.amplitude = amplitude c.offset = offset if sampling_freq <= 500000.0: c.transfer_size = long(sampling_freq + 1) else: c.transfer_size = long(500000) return c
def pfb_clock_sync_ccf(sps, loop_bw, taps, filter_size=32, init_phase=0, max_rate_deviation=1.5, osps=1): c = sb.Component(components_dir + 'pfb_clock_sync_ccf_4o/pfb_clock_sync_ccf_4o.spd.xml', execparams=execparams) c.sps = sps c.loop_bandwidth = loop_bw c.taps = list(taps) c.filter_size = filter_size c.init_phase = init_phase c.max_rate_deviation = max_rate_deviation c.osps = osps return c
def sig_source_c(sampling_freq=10000.0, waveform=101, frequency=10.0, amplitude=1000.0, offset=0.0): c = sb.Component( components_dir + 'components_with_complex_props/sig_source_c/sig_source_c.spd.xml', execparams=execparams) c.waveform = waveform c.frequency = frequency c.sampling_freq = sampling_freq c.amplitude = amplitude if sampling_freq <= 250000.0: c.transfer_size = long(sampling_freq + 1) else: c.transfer_size = long(250000) c.offset.real = offset.real c.offset.imag = offset.imag return c
def test_FindByAbsoluteNamingService(self): from ossie.utils import sb comp = sb.Component('PortTest') orb = CORBA.ORB_init() obj = orb.resolve_initial_references("NameService") rootContext = obj._narrow(CosNaming.NamingContext) bindingName = URI.stringToName("PortTest2") rootContext.rebind(bindingName, comp.ref) self.assertNotEqual(self._domMgr, None) self.assertNotEqual(self._devMgr, None) sadpath = "/waveforms/PortConnectFindByAbsoluteNamingService/PortConnectFindByAbsoluteNamingService.sad.xml" self._domMgr.installApplication(sadpath) self.assertEqual(len(self._domMgr._get_applicationFactories()), 1) appFact = self._domMgr._get_applicationFactories()[0] try: self._app = appFact.create(appFact._get_name(), [], []) except: rootContext.unbind(bindingName) self.fail( "Did not create application PortConnectFindByAbsoluteNamingService" ) components = self._getComponents() # Use the TestableObject interface to check that 'PortTest1' has # exactly one connection, and that it's connected to 'PortTest2'. ids = components['PortTest1'].runTest(0, []) if (len(ids) != 1): rootContext.unbind(bindingName) self.fail("There are more than one connection on PortTest1") expectedId = comp.ref._get_identifier() if (str(ids[0].value.value()) != expectedId): rootContext.unbind(bindingName) self.fail("The expected id does not match") rootContext.unbind(bindingName) sb.domainless._cleanUpLaunchedComponents()
def dc_blocker_cc(d_len, lng_form): c = sb.Component(components_dir + 'dc_blocker_cc/dc_blocker_cc.spd.xml', execparams=execparams) c.delay_length = d_len c.long_form = lng_form return c
def complex_to_real(vlen=1): c = sb.Component(components_dir + 'complex_to_real/complex_to_real.spd.xml', execparams=execparams) c.vlen = vlen return c
def chunks_to_symbols_bf(symbol_table, D): c = sb.Component(components_dir + 'chunks_to_symbols_bf/chunks_to_symbols_bf.spd.xml') c.symbol_table = symbol_table c.D = D return c
def integrate_ss(decim): c = sb.Component(components_dir + 'integrate_ss/integrate_ss.spd.xml', execparams=execparams) c.decim = decim return c
def complex_to_mag_squared(vlen=1): c = sb.Component(components_dir + 'complex_to_mag_squared/complex_to_mag_squared.spd.xml', execparams=execparams) c.vlen = vlen return c
def hilbert_fc(ntaps): c = sb.Component(components_dir + 'hilbert_fc/hilbert_fc.spd.xml', execparams=execparams) c.ntaps = ntaps return c
def add_const_ss(k): c = sb.Component(components_dir + 'add_const_ss/add_const_ss.spd.xml', execparams=execparams) c.k = k return c
def short_to_float(vlen=1, scale=1.0): c = sb.Component(components_dir + 'short_to_float/short_to_float.spd.xml', execparams=execparams) c.scale = scale c.vlen = 1 return c
def and_const_bb(k): c = sb.Component(components_dir + 'and_const_bb/and_const_bb.spd.xml', execparams=execparams) c.k = k return c
def fir_filter_fsf(decimation=1, taps=[]): c = sb.Component(components_dir + 'fir_filter_fsf/fir_filter_fsf.spd.xml', execparams=execparams) c.decimation = decimation c.taps = list(taps) return c
def copy(sizeof=4): c = sb.Component(components_dir + 'copy_octet/copy_octet.spd.xml', execparams=execparams) return c
def multiply_ss(vlen=1): c = sb.Component(components_dir + 'multiply_ss_2i/multiply_ss_2i.spd.xml', execparams=execparams) c.vlen = vlen return c
def multiply_const_vss(k): c = sb.Component(components_dir + 'multiply_const_vss/multiply_const_vss.spd.xml', execparams=execparams) c.k = list(k) return c
def multiply_const_ff(k): c = sb.Component(components_dir + 'multiply_const_ff/multiply_const_ff.spd.xml', execparams=execparams) c.k = k return c
def iir_filter_ffd(fftaps, fbtaps): c = sb.Component(components_dir + 'iir_filter_ffd/iir_filter_ffd.spd.xml', execparams=execparams) c.fftaps = fftaps c.fbtaps = fbtaps return c
# # This file is part of REDHAWK bulkioInterfaces. # # REDHAWK bulkioInterfaces is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # REDHAWK bulkioInterfaces is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # import sys from ossie.utils import sb dsource = sb.DataSource() dsink = sb.DataSink() test_comp = sb.Component(sys.argv[1]) data = range(100) dsource.connect(test_comp, providesPortName='dataShortIn') test_comp.connect(dsink, providesPortName='shortIn', usesPortName='dataShortOut') sb.start() dsource.push(data, EOS=True) dest_data = dsink.getData(eos_block=True)
def add_ff(vlen=1): c = sb.Component(components_dir + 'add_ff_2i/add_ff_2i.spd.xml', execparams=execparams) c.vlen = vlen return c
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along with this # program. If not, see http://www.gnu.org/licenses/. # from ossie.utils import sb from ossie.properties import props_from_dict import ossie.properties print ossie.properties.__file__ import math from math import cos import time c = sb.Component('../fcalc.spd.xml') src1 = sb.DataSource() src2 = sb.DataSource() sink = sb.DataSink() src1.connect(c, 'a') src2.connect(c, 'b') c.connect(sink, 'floatIn') c.equation = "math.sin(3*a)+cos(5*b)" print c.query([]) sb.start() data1 = [float(x) for x in xrange(1024)] data2 = [float(x) for x in xrange(-512, 0)]
def unpack_k_bits_bb(k): c = sb.Component(components_dir + 'unpack_k_bits_bb/unpack_k_bits_bb.spd.xml') c.k = k return c
def and_ss(): c = sb.Component(components_dir + 'and_ss_2i/and_ss_2i.spd.xml', execparams=execparams) return c
def glfsr_source_b(degree, repeat=False): c = sb.Component(components_dir + 'glfsr_source_b/glfsr_source_b.spd.xml', execparams=execparams) c.degree = degree c.repeat = repeat return c
def kludge_copy(sizeof=4): c = sb.Component(components_dir + 'kludge_copy_float/kludge_copy_float.spd.xml', execparams=execparams) return c
def getPropValue(component, prop): tmpComponent = sb.Component(component) return eval("tmpComponent." + prop)
def float_to_complex(vlen=1): c = sb.Component(components_dir + 'float_to_complex/float_to_complex.spd.xml', execparams=execparams) c.vlen = vlen return c
# # This file is part of REDHAWK bulkioInterfaces. # # REDHAWK bulkioInterfaces is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # REDHAWK bulkioInterfaces is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # import sys from ossie.utils import sb dsource = sb.DataSource() dsink = sb.DataSink() test_comp = sb.Component('CPP_Ports') data = range(100) dsource.connect(test_comp, providesPortName='dataShortIn') test_comp.connect(dsink, providesPortName='shortIn', usesPortName='dataShortOut') sb.start() dsource.push(data, EOS=True) dest_data = dsink.getData(eos_block=True)
def add_const_vff(k): c = sb.Component(components_dir + 'add_const_vff/add_const_vff.spd.xml', execparams=execparams) c.k = list(k) return c